Bug 79075

Summary: <style scoped>: Add @global rules
Product: WebKit Reporter: Roland Steiner <rolandsteiner>
Component: CSSAssignee: Roland Steiner <rolandsteiner>
Status: RESOLVED WONTFIX    
Severity: Normal CC: abarth, annulen, dglazkov, dominicc, ericbidelman, haraken, ian, japhet, koivisto, macpherson, menard, morrita, ojan, rakuco, syoichi, tabatkins, vestbo, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 49142    
Attachments:
Description Flags
work-in-progress
none
Patch koivisto: review-

Roland Steiner
Reported 2012-02-20 21:30:14 PST
Add @global rules to allow scoped style rules to "react" to the surrounding context (see HTML5 spec)
Attachments
work-in-progress (42.76 KB, patch)
2012-03-07 05:31 PST, Roland Steiner
no flags
Patch (100.71 KB, patch)
2012-03-09 01:13 PST, Roland Steiner
koivisto: review-
Roland Steiner
Comment 1 2012-03-07 05:31:35 PST
Created attachment 130606 [details] work-in-progress work-in-progress patch. compiles, but no tests yet. checking EWS, mostly (but any comments welcome!)
WebKit Review Bot
Comment 2 2012-03-07 06:09:37 PST
Comment on attachment 130606 [details] work-in-progress Attachment 130606 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/11851043
Early Warning System Bot
Comment 3 2012-03-07 06:54:50 PST
Comment on attachment 130606 [details] work-in-progress Attachment 130606 [details] did not pass qt-ews (qt): Output: http://queues.webkit.org/results/11850084
Roland Steiner
Comment 4 2012-03-09 01:13:44 PST
Created attachment 131005 [details] Patch Patch - it's big, but the largest part is straightforward plumbing.
Antti Koivisto
Comment 5 2012-03-12 04:10:59 PDT
Comment on attachment 131005 [details] Patch I feel the scoped stylesheet feature is getting too complex and bloaty for anyone to use effectively. If I understand correctly @global wouldn't be needed in the first place if the spec wasn't limiting the selector matching to the scope by default. It seems to me that just using explicit :scope ancestor for scoped rules would achieve the same result with much less spec and implementation bloat. Since the required code changes are invasive, I don't think we should implement any more of this feature until it is cleaned up.
Tab Atkins
Comment 6 2012-03-13 08:59:04 PDT
(In reply to comment #5) > (From update of attachment 131005 [details]) > I feel the scoped stylesheet feature is getting too complex and bloaty for anyone to use effectively. If I understand correctly @global wouldn't be needed in the first place if the spec wasn't limiting the selector matching to the scope by default. It seems to me that just using explicit :scope ancestor for scoped rules would achieve the same result with much less spec and implementation bloat. This was discussed on mailing lists. The general feeling is that the behavior you seem to prefer (matching the behavior of querySelector) is basically broken; it is very rarely what authors actually want to happen, and it causes a lot of confusion and annoyance when authors run into it (with elements being matched that they didn't expect). The current behavior appears to be *nearly always* what authors expect and want, but there are still occasional instances where you really do want to match outside of the scoped subtree. This is why the new find() and findAll() methods are instead defaulting to the current <style scoped> behavior, where the entire selector must match within the scope. There's no equivalent @global construct for find/All(), but that's because JS can hack around this issue when necessary.
Konstantin Tokarev
Comment 7 2016-08-11 12:32:00 PDT
<style scoped> was removed from tree in r156683, as well as from spec.
Note You need to log in before you can comment on or make changes to this bug.