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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jun 6 02:13:45 PDT 2011


--- Comment #22 from Roland Steiner <rolandsteiner at chromium.org>  2011-06-06 02:13:44 PST ---
To give a quick update: I started implementing this as discussed, with the following modifications:

.) Use the address of the scoping element (parent of <style scoped>) as the "ID". This can be shared by multiple <style scoped> under the same element and doesn't require bookkeeping.

.) Collect the rules of every scope (global, and for every scoping element) within separate hash maps. The idea is that we don't need to to even try matching rules if their scoping element isn't an ancestor.

.) add the scoping element address as "hash" to the bloom filter, so as to be able to quickly discard scoped style sheets that don't apply.

However, esp. the 2nd point leads to a bit of yak-shave to adapt all the functions that only expect a single, global RuleSet (originally containing only a single set of rules maps, i.e. hash maps that are distinguished by what the last selector of the rule is - ID, class, pseudo-class, tag name or "universal").

A simpler implementation would be to add the scoping "ID"/address to RuleData. This has the disadvantage that it increases the size of RuleData, and that we'd have to compare that for every rule rather than once per scope.

I'd therefore be inclined to continue with the initially mentioned yak-shave, unless someone chimes in with a better idea.

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