Title: [111867] trunk/Source/WebCore
Revision
111867
Author
[email protected]
Date
2012-03-23 09:32:36 -0700 (Fri, 23 Mar 2012)

Log Message

Unreviewed, rolling out r111751.
http://trac.webkit.org/changeset/111751
https://bugs.webkit.org/show_bug.cgi?id=82060

caused 15% page cycler regression for chromium-linux
(Requested by eae on #webkit).

Patch by Sheriff Bot <[email protected]> on 2012-03-23

* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::collectMatchingRulesForList):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (111866 => 111867)


--- trunk/Source/WebCore/ChangeLog	2012-03-23 16:14:18 UTC (rev 111866)
+++ trunk/Source/WebCore/ChangeLog	2012-03-23 16:32:36 UTC (rev 111867)
@@ -1,3 +1,15 @@
+2012-03-23  Sheriff Bot  <[email protected]>
+
+        Unreviewed, rolling out r111751.
+        http://trac.webkit.org/changeset/111751
+        https://bugs.webkit.org/show_bug.cgi?id=82060
+
+        caused 15% page cycler regression for chromium-linux
+        (Requested by eae on #webkit).
+
+        * css/CSSStyleSelector.cpp:
+        (WebCore::CSSStyleSelector::collectMatchingRulesForList):
+
 2012-03-23  Kentaro Hara  <[email protected]>
 
         Support [ImplementedAs] for attributes

Modified: trunk/Source/WebCore/css/CSSStyleSelector.cpp (111866 => 111867)


--- trunk/Source/WebCore/css/CSSStyleSelector.cpp	2012-03-23 16:14:18 UTC (rev 111866)
+++ trunk/Source/WebCore/css/CSSStyleSelector.cpp	2012-03-23 16:32:36 UTC (rev 111867)
@@ -1160,6 +1160,8 @@
         return 0;
 #endif
     StyledElement* p = static_cast<StyledElement*>(parent);
+    if (p->inlineStyle())
+        return 0;
 #if ENABLE(SVG)
     if (p->isSVGElement() && static_cast<SVGElement*>(p)->animatedSMILStyleProperties())
         return 0;
@@ -1251,7 +1253,8 @@
     return true;
 }
 
-static inline bool stylesEqual(const StylePropertySet* a, const StylePropertySet* b)
+// This function makes some assumptions that only make sense for attribute styles (we only compare CSSProperty::id() and CSSProperty::value().)
+static inline bool attributeStylesEqual(StylePropertySet* a, StylePropertySet* b)
 {
     if (a == b)
         return true;
@@ -1265,16 +1268,9 @@
             const CSSProperty& bProperty = b->propertyAt(j);
             if (aProperty.id() != bProperty.id())
                 continue;
-
-            // We don't check the short-hand property because long-hand vs short-hand is handled by checking the property set's count above.
-            if (aProperty.isImportant() != bProperty.isImportant()
-                || aProperty.isInherited() != bProperty.isInherited() || aProperty.isImplicit() != bProperty.isImplicit())
-                return false;
-
             // We could get a few more hits by comparing cssText() here, but that gets expensive quickly.
             if (aProperty.value() != bProperty.value())
                 return false;
-
             break;
         }
         if (j == propertyCount)
@@ -1300,15 +1296,14 @@
         return false;
     if (element->hasClass() != m_element->hasClass())
         return false;
+    if (element->inlineStyle())
+        return false;
 #if ENABLE(SVG)
     if (element->isSVGElement() && static_cast<SVGElement*>(element)->animatedSMILStyleProperties())
         return false;
 #endif
     if (!!element->attributeStyle() != !!m_styledElement->attributeStyle())
         return false;
-    if (!!element->inlineStyle() != !!m_styledElement->inlineStyle())
-        return false;
-
     StylePropertySet* additionalAttributeStyleA = element->additionalAttributeStyle();
     StylePropertySet* additionalAttributeStyleB = m_styledElement->additionalAttributeStyle();
     if (!additionalAttributeStyleA != !additionalAttributeStyleB)
@@ -1392,15 +1387,12 @@
     if (element->hasClass() && m_element->getAttribute(classAttr) != element->getAttribute(classAttr))
         return false;
 
-    if (element->attributeStyle() && !stylesEqual(element->attributeStyle(), m_styledElement->attributeStyle()))
+    if (element->attributeStyle() && !attributeStylesEqual(element->attributeStyle(), m_styledElement->attributeStyle()))
         return false;
 
-    if (additionalAttributeStyleA && !stylesEqual(additionalAttributeStyleA, additionalAttributeStyleB))
+    if (additionalAttributeStyleA && !attributeStylesEqual(additionalAttributeStyleA, additionalAttributeStyleB))
         return false;
 
-    if (element->inlineStyle() && !stylesEqual(element->inlineStyle(), m_styledElement->inlineStyle()))
-        return false;
-
     if (element->isLink() && m_elementLinkState != style->insideLink())
         return false;
 
@@ -1432,7 +1424,9 @@
 {
     if (!m_styledElement || !m_parentStyle)
         return 0;
-
+    // If the element has inline style it is probably unique.
+    if (m_styledElement->inlineStyle())
+        return 0;
 #if ENABLE(SVG)
     if (m_styledElement->isSVGElement() && static_cast<SVGElement*>(m_styledElement)->animatedSMILStyleProperties())
         return 0;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to