Closed Bug 1908625 Opened 2 years ago Closed 2 years ago

SVG <image> element not rerendering after removeAttribute("xlink:href")

Categories

(Core :: SVG, defect)

Firefox 129
defect

Tracking

()

RESOLVED FIXED
130 Branch
Tracking Status
firefox-esr115 --- wontfix
firefox-esr128 --- wontfix
firefox128 --- wontfix
firefox129 --- wontfix
firefox130 --- fixed

People

(Reporter: marti.kanera, Assigned: longsonr)

References

(Regression)

Details

(Keywords: regression)

Attachments

(3 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:129.0) Gecko/20100101 Firefox/129.0

Steps to reproduce:

  1. Create an SVG element with an <image> tag in the HTML.
  2. Set the xlink:href attribute on the <image> tag to point to an image URL.
  3. Use JavaScript to call image.removeAttribute('xlink:href') on the <image> element.

Actual results:

Even though retrieving the attribute using image.getAttribute("xlink:href") returns null, the image itself remains visible.

Expected results:

The image should no longer be visible when the xlink:href attribute is removed.

Component: Untriaged → SVG
Product: Firefox → Core

Here is an example demonstrating the issue: https://codepen.io/martinkanera/pen/VwJvdZX

regression range: https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=2601aa4526288006e2dc3f4e84f5735db5da60e9&tochange=4d770d6a88770f9af267a8a34e002f955b0c37cd

Probably regression from this commit in there:
Emilio Cobos Álvarez — Bug 1756750 - Don't reframe <svg:image> on loading / broken changes. r=jfkthame

Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: regression
Regressed by: 1756750

Comment on attachment 9413650 [details]
testcase 1 (using removeAttributeNS)

Note, Robert adjusted the testcase to use removeAttributeNS (whereas the reporter's original testcase used removeAttribute), in case removeAttributeNS worked better here.

In fact both versions work before the regression-range, and both fail after the regression-range.

Attachment #9413650 - Attachment description: reporter's testcase → testcase 1 (using removeAttributeNS)

Set release status flags based on info from the regressing bug 1756750

:emilio, since you are the author of the regressor, bug 1756750, could you take a look?

For more information, please visit BugBot documentation.

Assignee: nobody → longsonr
Status: NEW → ASSIGNED
Pushed by dholbert@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d7ec63326fa5 SVG image elements should update if their href is removed r=emilio
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/47206 for changes under testing/web-platform/tests

I triggered lando at longsonr's request (he's AFK but wanted to get this in), but then I noticed some minor things I'd like to improve in the tests -- and I think one of the changes might reveal a piece of this that's not-yet-fixed. I'll file a followup bug or two.

Flags: needinfo?(emilio)
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 130 Branch
Upstream PR merged by moz-wptsync-bot

The patch landed in nightly and beta is affected.
:longsonr, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox129 to wontfix.

For more information, please visit BugBot documentation.

Flags: needinfo?(longsonr)

Given that it regressed two years ago, I imagine it's not encountered that much.

Flags: needinfo?(longsonr)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: