There are no reftests for :nth-child(.. of ) in SVG
Categories
(Core :: SVG, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox113 | --- | fixed |
People
(Reporter: zrhoffman, Assigned: zrhoffman)
References
Details
Attachments
(1 file)
All of the tests for:nth-child(.. of )
so far seem to target HTML only and not SVG, but Selectors 4 applies for SVG, so that is missing test coverage.
At minimum, there should be reftests for :nth-child(.. of )
matching in SVG and :nth-child(.. of )
invalidation in SVG.
Assignee | ||
Updated•1 year ago
|
Comment 1•1 year ago
|
||
Usually the only complicated thing about SVG and CSS is the <use> element and its use of a shadow tree. See https://www.w3.org/TR/SVG2/struct.html#UseStyleInheritance
Assignee | ||
Comment 2•1 year ago
|
||
Thanks for the direction, :longsonr! I made a couple of invalidation reftests (one for :nth-child(... of class)
in SVG, one for :nth-last-child(... of class)
in SVG) that use <use>
, let me know what you think.
Assignee | ||
Comment 3•1 year ago
|
||
These reftests will only pass if our :nth-child(.. of <selector>) and
:nth-last-child(.. of <selector>) invalidation considers DOM elements of
any type (including SVG elements), not only HTML elements.
Updated•1 year ago
|
Comment 4•1 year ago
|
||
There's nothing wrong with these tests but the other thing to test is a selector that crosses the shadow boundary of the use element so
:nth-last-child(odd of use .c) should match nothing because use is outside the shadow dom but c is inside it so of now matches nothing at all (or should do).
https://www.w3.org/TR/SVG/struct.html#UseStyleInheritance
However, if a CSS rule uses a complex selector to match an element based on its ancestors or siblings, and those ancestors or siblings are not cloned as part of the shadow tree, then that rule would no longer match the element instance. Similarly, child-indexed pseudo-classes such as nth-of-type and nth-child may apply to one element but not the other. This represents a change from how style cloning was defined in previous versions of SVG.
I.e. the specification specifically references nth-child here so given it's explicitly mentioned, we really ought to test we do it right (I think we do).
Updated•1 year ago
|
Pushed by zach@zrhoffman.net: https://hg.mozilla.org/integration/autoland/rev/82905658a3d0 Add reftests for :nth-child(... of <selector list>) in SVG r=longsonr,firefox-svg-reviewers
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/39046 for changes under testing/web-platform/tests
Comment 7•1 year ago
|
||
bugherder |
Upstream PR merged by moz-wptsync-bot
Description
•