[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 10:41:17 PST 2012


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


Antti Koivisto <koivisto at iki.fi> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |koivisto at iki.fi




--- Comment #9 from Antti Koivisto <koivisto at iki.fi>  2012-01-15 10:41:17 PST ---
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.

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