[Webkit-unassigned] [Bug 49142] Implement HTML5 style scoped attribute

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed May 25 23:21:08 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=49142





--- Comment #17 from Roland Steiner <rolandsteiner at chromium.org>  2011-05-25 23:21:07 PST ---
(In reply to comment #15)
> Well this particular example is bad for unrelated reasons -- <style> isn't allowed in <p>. But ignoring that for a second, the above will be red, yes. The _only_ thing that this does is change which style sheets apply. It doesn't affect the cascade, it doesn't affect selector matching, it doesn't affect specificity, it doesn't affect inheritance, it doesn't affect anything else.

This is probably not the right forum for this (and likely repeating previous arguments), but that would mean that a scoped style applies to basically everything under that style's parent if any ancestor happens to also match that style's selector - I would argue that that's counterintuitive and diminishes the usefulness of scoped style sheets, again requiring very specific classes, etc. to avoid that. It would also preclude "recursive" use of the same scoped stylesheet - esp. in the case of shadow DOM/XBL one couldn't use both scoped stylesheets and @allow-selectors-through for recursive templates.

For the issue of how to implement <style scoped>, this means that a scoped-id implementation cannot just apply normal selector matching, but the scoped-id must be matched separately after regular selector matching as "any ancestor has a scoped style sheet with that id".

> It would be helpful for me if you could quote the part of the specification that led you to conclude otherwise, so that I could fix it.

>From http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#the-style-element:

"The scoped attribute is a boolean attribute. If set, it indicates that the styles are intended just for the subtree rooted at the style element's parent element, as opposed to the whole Document."

"If the scoped attribute is present, then the user agent must apply the specified style information only to the style element's parent element (if any), and that element's child nodes. Otherwise, the specified styles must, if applied, be applied to the entire document."

I understood "styles are intended just for..." and "specified style information" to include the selectors, compounded by the "otherwise" statement (and probably fueled by some preconceived expectations as explained above).

-- 
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