Closed Bug 1450250 Opened 7 years ago Closed 6 years ago

<svg:use> should use an actual shadow tree, instead of NAC.

Categories

(Core :: SVG, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: emilio, Assigned: emilio)

References

(Regressed 1 open bug)

Details

Attachments

(4 files)

This is for soundness in general, since you can stash any kind of element in there and can cause non-desired stuff to run from layout, like in bug 1450181. Also, it's needed to allow you to do <svg:use style="display: contents">, which works in other engines but not in Gecko. Finally, it allows to simplify a lot of hacks that were added for that, like :-moz-use-shadow-tree-root, blocks_ancestor_combinators, etc... Using NAC here is really a hack.
Priority: -- → P3
This will make a lot of stuff much nicer, I think we should do this.
Flags: needinfo?(emilio)
Depends on: 1475980
This fixes a couple fuzz bugs and prevents special-casing <svg:use> even more in bug 1431255. Unfortunately not as many hacks went away as I'd have hoped, since we still need to match document rules, see the linked SVGWG issues. But blocks_ancestor_combinators goes away, which is nice since it's on a very hot path.
Assignee: nobody → emilio
Flags: needinfo?(emilio)
Very happy to see this. Thanks Emilio!
Attached file SMIL document-related fixes. (deleted) —
Depends on D2154. This is a prerequisite to make some SMIL-in-use tests pass.
This matches chrome: https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/svg/animation/svg_smil_element.cc?l=260&rcl=325eafc631f396944801f17675a7092b216d60ca And we rely on that to animate <use> with SMIL, like: <use href="#foo"> <animate ...> </use> There, the flattened tree parent of the <animate> element is null, because <use> is a shadow root without slots. Similarly we need to skip the GetCtx check which seems unneeded, and also is not correct since <animate> can animate when it's out of the flattened tree. Depends on D2192.
It's used by SVGAnimationElement, and otherwise it can't find the root element. It also feels like the right thing to do, and didn't break any XBL+svg tests (though we may as well get rid of those at this point). Depends on D2192.
Comment on attachment 8992341 [details] Bug 1450250: Make svg:use use an actual shadow tree. r=heycam Cameron McCormack (:heycam) has approved the revision. https://phabricator.services.mozilla.com/D2154
Attachment #8992341 - Flags: review+
Comment on attachment 8992695 [details] SMIL document-related fixes. Cameron McCormack (:heycam) has approved the revision. https://phabricator.services.mozilla.com/D2192
Attachment #8992695 - Flags: review+
Comment on attachment 8992707 [details] Make <animate> target the light DOM parent, not the flattened tree parent. Cameron McCormack (:heycam) has approved the revision. https://phabricator.services.mozilla.com/D2194
Attachment #8992707 - Flags: review+
Comment on attachment 8992708 [details] Preserve the behavior of GetOuterSVGElement so that it works for <animate>. Cameron McCormack (:heycam) has approved the revision. https://phabricator.services.mozilla.com/D2195
Attachment #8992708 - Flags: review+
Pushed by emilio@crisal.io: https://hg.mozilla.org/integration/mozilla-inbound/rev/d4d2a2444ad1 SMIL document-related fixes. r=heycam https://hg.mozilla.org/integration/mozilla-inbound/rev/91b097951606 Make <animate> target the light DOM parent, not the flattened tree parent. r=heycam https://hg.mozilla.org/integration/mozilla-inbound/rev/d335f602d578 Preserve the behavior of GetOuterSVGElement so that it works for <animate>. r=heycam https://hg.mozilla.org/integration/mozilla-inbound/rev/453d0a08f00c Make svg:use use an actual shadow tree. r=heycam
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/12092 for changes under testing/web-platform/tests
Upstream web-platform-tests status checks passed, PR will merge once commit reaches central.
Depends on: 1477543
Depends on: 1477544
Blocks: 1472027
Depends on: 1480224
Depends on: 1480275
Depends on: 1486488
No longer blocks: 1487649
Depends on: 1487649
Depends on: 1502658
Depends on: 1513920
Regressions: 1531333
Regressions: 1547619
Regressions: 1551137
Regressions: 1579181
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: