← Back to release summary

SVG2 CSS Cascading

Category
CSS
Type
Chromium catches up
Status
Proposed (Chrome Proposed)
Intent stage
None

WPT details: https://wpt.fyi/svg/linking/reftests/use-descendant-combinator-003.html https://wpt.fyi/svg/struct/reftests/use-inheritance-001.svg https://wpt.fyi/svg/struct/reftests/use-inheritance-nth-child-of.svg https://wpt.fyi/svg/struct/reftests/use-inheritance-nth-last-child-of.svg https://wpt.fyi/svg/styling/use-element-attr-selector-transition.tentative.html https://wpt.fyi/svg/styling/use-element-id-selector-transition.tentative.html

Summary

Align the Blink implementation with the SVG2 specification for matching CSS rules in <use> element trees. Match selectors against the <use> instantiation elements instead of the originating element subtree. This means selectors will no longer match ancestor and sibling elements outside the cloned subtree. More importantly, state selectors like :hover will now start matching in <use> instances.

Motivation

CSS selectors match against the wrong tree for <use> instantiations, which means selectors do not match correctly for structural relationships and user interaction state. :hover support issue that will be fixed shipping this feature: https://crbug.com/40663285

Standards & signals

Ecosystem

View on chromestatus.com