Title: [149838] trunk/Source/WebCore
Revision
149838
Author
[email protected]
Date
2013-05-09 13:35:32 -0700 (Thu, 09 May 2013)

Log Message

Reoptimize free-standing :focus/link/visited/-webkit-any-link selectors.
<http://webkit.org/b/115590>

Reviewed by Darin Adler.

Common pseudo selectors should go into their respective rule buckets instead of ending up in the universal one.

* css/RuleSet.cpp:
(WebCore::RuleSet::findBestRuleSetAndAdd):
        
    Check tag selectors with * local name (usually created for namespace) for a suitable narrower bucket too.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (149837 => 149838)


--- trunk/Source/WebCore/ChangeLog	2013-05-09 20:31:21 UTC (rev 149837)
+++ trunk/Source/WebCore/ChangeLog	2013-05-09 20:35:32 UTC (rev 149838)
@@ -1,3 +1,17 @@
+2013-05-09  Antti Koivisto  <[email protected]>
+
+        Reoptimize free-standing :focus/link/visited/-webkit-any-link selectors.
+        <http://webkit.org/b/115590>
+
+        Reviewed by Darin Adler.
+
+        Common pseudo selectors should go into their respective rule buckets instead of ending up in the universal one.
+
+        * css/RuleSet.cpp:
+        (WebCore::RuleSet::findBestRuleSetAndAdd):
+        
+            Check tag selectors with * local name (usually created for namespace) for a suitable narrower bucket too.
+
 2013-05-09  Darin Adler  <[email protected]>
 
         RenderQuote has giant function for language to quotes map

Modified: trunk/Source/WebCore/css/RuleSet.cpp (149837 => 149838)


--- trunk/Source/WebCore/css/RuleSet.cpp	2013-05-09 20:31:21 UTC (rev 149837)
+++ trunk/Source/WebCore/css/RuleSet.cpp	2013-05-09 20:35:32 UTC (rev 149838)
@@ -214,13 +214,15 @@
     }
 
     if (component->m_match == CSSSelector::Tag) {
+        // If this is part of a subselector chain, recurse ahead to find a narrower set (ID/class/:pseudo)
+        if (component->relation() == CSSSelector::SubSelector) {
+            const CSSSelector* nextComponent = component->tagHistory();
+            if (nextComponent->m_match == CSSSelector::Class || nextComponent->m_match == CSSSelector::Id || SelectorChecker::isCommonPseudoClassSelector(nextComponent)) {
+                if (findBestRuleSetAndAdd(nextComponent, ruleData))
+                    return true;
+            }
+        }
         if (component->tagQName().localName() != starAtom) {
-            // If this is part of a subselector chain, recurse ahead to find a narrower set (ID/class.)
-            if (component->relation() == CSSSelector::SubSelector
-                && (component->tagHistory()->m_match == CSSSelector::Class || component->tagHistory()->m_match == CSSSelector::Id || SelectorChecker::isCommonPseudoClassSelector(component->tagHistory()))
-                && findBestRuleSetAndAdd(component->tagHistory(), ruleData))
-                return true;
-
             addToRuleSet(component->tagQName().localName().impl(), m_tagRules, ruleData);
             return true;
         }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to