[Webkit-unassigned] [Bug 76064] [CSSRegions]Add back region style code removed in r104036

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Jan 15 23:02:48 PST 2012


--- Comment #10 from Mihnea Ovidenie <mihnea at adobe.com>  2012-01-15 23:02:48 PST ---
(In reply to comment #9)
> Hmm, reading the spec some of this starts making more sense. Maybe this is better fixed in place.
> You will want to create the RuleSets for the regions on style selector initialization time. Creating them on every style look up is super slow. I believe you are also getting the specificity (and so the applying order) wrong by matching them separately from the author style. Per spec the @region should behave like @media and not affect the ordering.
> Something like this might work for a better and more correct implementation:
> 1) Cache the region RuleSets in the containing RuleSet. This is done by adding (roughly)
> Vector<<pair<CSSSelector, RuleSet*> > m_regionSelectorsAndRuleSets;
> member to RuleSets.
> 3) These sub-RuleSets are created by RuleSet::addRulesFromSheet (thus only once per style selector). The rule position is set to match the actual stylesheet position.
> 2) When matching the region style (the region element is set) CSSStyleSelector::matchRules will loop though m_regionSelectorsAndRuleSets, if any, and try to match the selectors to the region element.
> 3) If the region selector matches then CSSStyleSelector::matchRules is invoked recursively for the sub-RuleSet (this will require some refactoring of matchRules, the actual matching needs to be split out).
> The (confusingly similar) m_regionStyleRules and m_regionRules members of CSSStyleSelector both go away.

Thanks for the review/suggestions. I will leave the actual code in place (not roll out the patch) and come up with another patch that will improve the current solution.

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