[Webkit-unassigned] [Bug 49142] Implement HTML5 style scoped attribute
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue May 24 07:38:19 PDT 2011
https://bugs.webkit.org/show_bug.cgi?id=49142
--- Comment #10 from Dimitri Glazkov (Google) <dglazkov at chromium.org> 2011-05-24 07:38:19 PST ---
(In reply to comment #9)
> (In reply to comment #7)
> > The easy-peasy way to implement this is to treat selectors in scoped styles as if they were prefixed with some unique id that matches only the parent node of the scoped style element.
>
> Interesting approach, but it strikes me as a bit hacky.
I don't see anything hacky. To me, it seems like a natural way to view scoped stylesheets.
>It also means that that unique artificial id mustn't take part in the normal specificity resolution.
Can you explain a bit more here? Specificity is just an order in which the rules are applied. I don't understand how this approach would complicate anything here.
>If I understand correctly, it would also meant that we have to update the Document-wide style rule set whenever an element is inserted or removed from the DOM that has a scoped style associated in its shadow DOM.
I think that's something that needs to be tackled orthogonally. This problem is still in place with all other stylesheets removal/addition.
>
> I would have intended to have a separate CSSStyleSelector on every TreeScope that builds the combined style rule set either on the fly, or on instantiation (This is probably the same overhead as above for instantiation, but there is no cost on deletion, as the Document style data itself isn't touched).
I would caution that this is some of the most performance-sensitive code in WebKit. If you're thinking of a different approach, I would like to first understand how you will accomplish this.
> It should also be more flexible to tackle issues such as the one mentioned by Hixie in comment #8.
>
> (In reply to comment #8)
>
> @Hixie: Speaking of specificity: I would have assumed that a scoped style sheet takes precedence of "global" styles, but that isn't mentioned in the spec. So am I correct to assume that the following is true?
>
> <style>
> p p { color: red }
> </style>
> <p>
> <style scoped="scoped">p { color: green}</style>
> <p>Still red</p>
> </p>
>
> I.e., the scoped style doesn't take, because the global style is more specific (?).
It should work just like it would without the scoped attribute.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list