Closed Bug 1867225 Opened 6 months ago Closed 6 months ago

SVGUseElement::mOriginal usage is suspicious / probably wrong.

Categories

(Core :: SVG, defect)

defect

Tracking

()

RESOLVED FIXED
122 Branch
Tracking Status
firefox122 --- fixed

People

(Reporter: emilio, Assigned: emilio)

References

Details

Attachments

(1 file)

This is done regardless of whether the clone is for <svg:use> or it is a regular .cloneNode call from script.

It should probably be doing it only if aNodeInfo->GetDocument()->CloningForSVGUse().

https://crisal.io/tmp/svg-use-original.html is an example that shows wrong behavior with the first version of the patch for bug 1806964. I'm fairly sure you can make it misbehave in some way in release too, but I haven't spent enough time trying to do it.

Robert does the proposal above sound good? Am I missing something?

With that and something like https://hg.mozilla.org/try/rev/2ea7097c0966a4819dc30abb17ab28dca9d00210#l2.35 seems we could go back to using ResetWithId, wdyt?

Sounds worth trying, yes.

it's all about where you find the thing use points to when it's a clone.

use A-> use B->rect

use B exists as a clone and an original. When its clone renders in order to render use A then the clone needs to find the rect which will be in use B's document if use B has a local href to rect.

For .cloneNode as part of the shadow DOM where do we expect to find the rect? If that's always also in the shadow DOM because it's also cloned through the cloneNode then setting mOriginal only for CloningForSVGUse() is the right thing to do.

Assignee: nobody → emilio
Status: NEW → ASSIGNED
Blocks: 1806964
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/fa1d01606045
Use ResetWithID for local SVG use references. r=longsonr
Status: ASSIGNED → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → 122 Branch
Regressions: 1872408
See Also: 1806964
Regressions: 1885741
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: