- From: CSS Meeting Bot via GitHub <sysbot+gh@w3.org>
- Date: Thu, 19 Sep 2019 05:13:59 +0000
- To: public-svg-issues@w3.org
The SVG Working Group just discussed `SVG2 spec means elements within a <use> tag can not be targeted for styling`, and agreed to the following: * `RESOLVED: child content of foreignObject is stripped out of a use element shadow tree clone -- check browsers for exact impl details` * `RESOLVED: No change to spec around use element styling, but focus on getting feedback from implementors about feasibility of current SVG 2 model` <details><summary>The full IRC log of that discussion</summary> <heycam> Topic: SVG2 spec means elements within a <use> tag can not be targeted for styling<br> <heycam> github: https://github.com/w3c/svgwg/issues/367<br> <heycam> emilio: SVG 1 says you take the style rules from the reference element<br> <heycam> ... that not only changes the behavior of decendant combinators, but also element specific states<br> <heycam> AmeliaBR: it wasn't clear in SVG 1, the way it was implemented was the specified style gets copied over, so any style rules directly set on the element get cloned with it<br> <heycam> ... and then inherited styles are inherited in<br> <heycam> ... nothing in Web Components shadow DOM that's at all like that<br> <heycam> ... trying to harmonize with shadow DOM, we defined it so that the style sheet is cloned in the shadow trees<br> <heycam> ... but that could break some select matching compared with the original element<br> <heycam> ... what gets fixed is the interactive selectors<br> <heycam> rniwa: do we know what implementations do?<br> <heycam> AmeliaBR: Firefox matches SVG 2 spec<br> <heycam> emilio: Blink and WebKit, in order to resolve style in the use subtree, you match the referenced element<br> <heycam> rniwa: so the original source element is used for styling<br> <heycam> emilio: so when you hover over the reference, all the clones get hover styles<br> <heycam> ... the Firefox behavior is a bit unfortunate, regarding the combinators, but we haven't received many bugs about that<br> <heycam> krit: how long has it been shipping?<br> <heycam> emilio: more than 2 years<br> <heycam> AmeliaBR: Firefox had never implemented the SVG 1.1 spec<br> <heycam> heycam: right<br> <heycam> myles: did you have to add special case SVG code?<br> <heycam> emilio: not really<br> <heycam> ... in special of the special casing code being on the "compute the style" function, the code checks if the element is in a use shadow tree, then also look at your tree parent scope for rules<br> <heycam> AmeliaBR: it can probably be represented by the adopted style sheets concept<br> <heycam> emilio: yeah....<br> <heycam> ... but to implement it efficiently, you just look up to the parent scope<br> <heycam> rniwa: conceptually you're copying the rules<br> <heycam> emilio: yes<br> <heycam> ... conceptually you just look at the outside use shadow tree<br> <heycam> AmeliaBR: when this has previously come up, Rossen has been cautious of breaking changes<br> <heycam> ... but we don't have a sensible spec<br> <heycam> ... in the existing SVG 1.1 match browsers, there were inconsistencies in terms of interactive styles, animations, whether htings get copied<br> <heycam> ... so in the details, we don't have a spec to define how those things work in a way that's actually corss browser<br> <heycam> ... so either way, implementations would have to change if we want truly consistent behavior<br> <heycam> ... I'm OK with making that be closer to SVG 1.1, but I need a spec proposal for that if people want to do that<br> <heycam> ... that also takes care of interactions, animations, etc.<br> <heycam> rniwa: the question to me is which behavior is more compatible with existing content<br> <heycam> ... also author expectations<br> <heycam> emilio: regarding author expectations, it's tricky. SVG 1 kind of matches "I'm styling the element I'm cloning"<br> <heycam> ... so ancestor combinators work<br> <heycam> ... however it doesn't match expectations of :hover<br> <heycam> ... the SVG 2 behavior works the other way around<br> <heycam> ... for authors who are familiar with shadow trees, it probably makes sense<br> <heycam> AmeliaBR: we have had some bug reports on SVG spec and Firefox about people whose selectors didn't work because they were using these ancestor selectors<br> <heycam> ... but when you explain how to fix it, it was OK<br> <heycam> ... the :hover not working, that's a much more intrinsic confusion<br> <heycam> ... and there's no easy way to explain that<br> <heycam> rniwa: whatever solution we come up with, it should handle :hover. :focus would even be a bigger problem<br> <heycam> AmeliaBR: SVG 1 really didn't discuss keyboard focus. but now we have a model, you can have focus in the shadow tree, so your :focus rules should reflect the element that's actually focused<br> <heycam> rniwa: there's also some niceness in that if we had adopted style sheets, it could be described in that way<br> <heycam> AmeliaBR: I need to talk to Antti and folks to check what they think<br> <heycam> s/AmeliaBR/rniwa/<br> <heycam> AmeliaBR: we should probably poke a Chromium engineer for feasibility too<br> <emilio> http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=7216 is a testcase that shows the difference of behaviors<br> <heycam> krit: we've had this issue for a long time, it's been waiting for implementor view for a while<br> <heycam> emilio: I recall having a WebKit patch for that in the past...<br> <heycam> emilio: there's a test case I've pasted<br> <heycam> krit: how does the shadow content know about the viewport size?<br> <heycam> AmeliaBR: that's the same as regular shadow DOM, it uses the document viewport for MQs etc.<br> <heycam> rniwa: might want to consider what happens if you support shadow root on an SVG element at some point<br> <heycam> AmeliaBR: definitely want to support custom SVG elements with shadowRoot<br> <krit> q?<br> <heycam> [some discussion about use elements pointing to foreignObject]<br> <emilio> rniwa: https://github.com/w3c/svgwg/issues/511<br> <heycam> krit: but in general we agree we don't want foreignObject in the shadow tree?<br> <heycam> rniwa: yes, that would get hairy<br> <heycam> ... then you can have SVG, MathML, plugins....<br> <heycam> RESOLVED: child content of foreignObject is stripped out of a use element shadow tree clone -- check browsers for exact impl details<br> <heycam> RESOLVED: No change to spec around use element styling, but focus on getting feedback from implementors about feasibility of current SVG 2 model<br> </details> -- GitHub Notification of comment by css-meeting-bot Please view or discuss this issue at https://github.com/w3c/svgwg/issues/367#issuecomment-532968985 using your GitHub account
Received on Thursday, 19 September 2019 05:14:01 UTC