Closed
Bug 1409720
Opened 8 years ago
Closed 8 years ago
Descendent selector: style not applied when cloning element within group SVG, Use tag
Categories
(Firefox :: Untriaged, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: rich.tann, Unassigned)
Details
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/61.0.3163.100 Chrome/61.0.3163.100 Safari/537.36
Steps to reproduce:
Create an SVG group. Clone an item from within that group. Use descendent notation in CSS to refer to the item e.g. .groupclass .itemclass {}. This styleis not applied. If yo clone the group, it is applied
https://codepen.io/richtann/pen/rGoqWo
Actual results:
Styles not applied.
Expected results:
Style should have applied.
Comment 1•8 years ago
|
||
That's right, this is a change in SVG 2 as compared to SVG 1.1. We're now correct per the new specification.
Per https://www.w3.org/TR/SVG2/struct.html#UseElement
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.
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → INVALID
Comment 2•8 years ago
|
||
Is SVG 1.1 being depreciated ? (SVG 2 currently only a candidate)
In the second paragraph of the spec section you reference:
> In addition, all style rules that apply in the scope of the referenced element also apply in the scope of the cloned shadow tree.
It explicitly states "all style rules" should be applied. I'm not necessarily suggesting you are wrong but I cannot find the part of the spec that describes this yet, if it exists then as it stands the spec would be contradictory.
Can you please highlight where exactly this behaviour is specified?
Comment 3•7 years ago
|
||
Relevant SVG-WG issues on GitHub:
https://github.com/w3c/svgwg/issues/367#3
This has been acknowledged as a breaking change by one of the SVG-2 spec authors.
> if other browser developers / spec editors want to propose a different spec that is closer to how SVG 1.1 (and most current browsers) work, that's still an option.
SVG-2 reached "recommended" status last week, so this has been assigned as a SVG-2.1 milestone.
Comment 4•7 years ago
|
||
I meant to say "recommendation candidate" which I believe means no more major changes? anyway 2.1
You need to log in
before you can comment on or make changes to this bug.
Description
•