Closed Bug 1032124 Opened 11 years ago Closed 6 years ago

Cloned object (using nested use element) not updated when manipulated through JavaScript

Categories

(Core :: SVG, defect)

30 Branch
x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla69
Tracking Status
firefox69 --- fixed

People

(Reporter: pim, Assigned: violet.bugreport)

References

Details

(Keywords: testcase)

Attachments

(2 files)

Attached image bugreport.svg
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:29.0) Gecko/20100101 Firefox/29.0 (Beta/Release) Build ID: 20140428193813 Steps to reproduce: Open attached SVG in firefox; Two red lines are shown. Perform onClick event on SVG to manipulate the line color. Actual results: The first line is updated to the correct color (lime). The second line does not change color. Expected results: Since both elements refer to the same line element, both lines should have changed color. The second line, which is in fact a reference to a reference to the line element, is not updated. This might be flagged as a duplicate of #537987, but since no JavaScript and only a single refrence is used in its attached test case, I filed this as a new bug.
Status: UNCONFIRMED → NEW
Component: Untriaged → SVG
Ever confirmed: true
Keywords: testcase
Product: Firefox → Core
It's not really related to bug 537987 but it is pretty similar to bug 467498
This also popped up on Stack Overflow today. Except in this case it is use->use->element, rather than use->symbol->use->element. https://stackoverflow.com/questions/53744396/vue-svg-element-doesnt-updates-in-firefox/53753302 I've created a small test case to replicate it: https://jsfiddle.net/qz8aLtxk/ <svg> <defs> <rect id="rect" width="140" height="150" fill="red"/> </defs> <use id="use" xlink:href="#rect"/> <use id="use2" xlink:href="#use" x="150"/> </svg> <button>Toggle green</button> .green { fill: green; } document.querySelector("button").addEventListener("click", function() { document.getElementById("rect").classList.toggle("green"); })
Assignee: nobody → violet.bugreport
Status: NEW → ASSIGNED
Attachment #9070821 - Attachment description: Bug 1032124 - Update all cloned places when <use> is recloned → Bug 1032124 - Use the referenced element to check whether ignore a mutation event
Attachment #9070821 - Attachment description: Bug 1032124 - Use the referenced element to check whether ignore a mutation event → Bug 1032124 - Use the referenced element to check whether to ignore a mutation event

Robert, would you take a look at this patch? Just in case that you missed the review email. Thanks.

Flags: needinfo?(longsonr)

I was waiting till you fixed the review comments from emilio. I think it's likely fine once you've done that though.

Flags: needinfo?(longsonr)

(In reply to Robert Longson [:longsonr] from comment #5)

I was waiting till you fixed the review comments from emilio. I think it's likely fine once you've done that though.

Actually I've already done that a few days ago. The patch was completely rewritten during a revision because a hidden root cause was discovered after discussing with emilio. Thus most of the comments on the previous revisions become obsolete (the original changes were reverted)

Pushed by violet.bugreport@gmail.com: https://hg.mozilla.org/integration/autoland/rev/96b0fd9c79cd Use the referenced element to check whether to ignore a mutation event r=emilio,longsonr
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/17330 for changes under testing/web-platform/tests
Upstream web-platform-tests status checks passed, PR will merge once commit reaches central.
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla69
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: