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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed May 25 22:52:50 PDT 2011


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





--- Comment #16 from Roland Steiner <rolandsteiner at chromium.org>  2011-05-25 22:52:50 PST ---
(In reply to comment #12)
> This is a good point. The approach with scoped-id creates no room for reuse optimizations. 

Actually, thinking a bit more about the issue (and maybe this is what you intended all along, and I just misunderstood you): 

If we generate the scoped-id from the MD5 hash (or similar) of the actual contents of the style sheet, then the need to constantly update the rule set within Document would vanish. An element matches the (prefixed to every rule) scoped-id iff it has a <style scoped> child whose contents would generate that id. This obviously cached, and wouldn't even needed to be re-calculated when instantiating shadow trees - the same style sheet replicated in various shadow DOMs would not create additional rule entries. We can add those entries when parsing the <template>, and adding or removing <x-foo> elements would be a no-op with regard to scoped style sheet updates.
It should also beautifully work with <style scoped> elements anywhere in the DOM (i.e., wouldn't need to be restricted to TreeScopes).

Furthermore, we would technically not need to ever remove rules from the Document (rules that reference an obsolete MD5 hash scope-id would just never match), just add new rules if a new unknown <style scoped> comes along. CSSOM could wreak havoc here, but for this we could add periodic rules garbage collection.

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