Title: [135445] trunk/Source/WebCore
Revision
135445
Author
[email protected]
Date
2012-11-21 15:32:52 -0800 (Wed, 21 Nov 2012)

Log Message

Style sharing: Compare class lists via SpaceSplitString instead of string comparison.
<http://webkit.org/b/102982>

Reviewed by Antti Koivisto.

Add an operator!= to SpaceSplitString and use that check if two elements are eligible
for style sharing instead of comparing the fastGetAttribute(classAttr) return values.
This works because SpaceSplitString maps equal strings to the same data internally.

* css/StyleResolver.cpp:
(WebCore::haveIdenticalStyleAffectingAttributes):
* dom/SpaceSplitString.h:
(WebCore::SpaceSplitString::operator!=):
(SpaceSplitString):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (135444 => 135445)


--- trunk/Source/WebCore/ChangeLog	2012-11-21 23:30:34 UTC (rev 135444)
+++ trunk/Source/WebCore/ChangeLog	2012-11-21 23:32:52 UTC (rev 135445)
@@ -1,3 +1,20 @@
+2012-11-21  Andreas Kling  <[email protected]>
+
+        Style sharing: Compare class lists via SpaceSplitString instead of string comparison.
+        <http://webkit.org/b/102982>
+
+        Reviewed by Antti Koivisto.
+
+        Add an operator!= to SpaceSplitString and use that check if two elements are eligible
+        for style sharing instead of comparing the fastGetAttribute(classAttr) return values.
+        This works because SpaceSplitString maps equal strings to the same data internally.
+
+        * css/StyleResolver.cpp:
+        (WebCore::haveIdenticalStyleAffectingAttributes):
+        * dom/SpaceSplitString.h:
+        (WebCore::SpaceSplitString::operator!=):
+        (SpaceSplitString):
+
 2012-11-21  Sheriff Bot  <[email protected]>
 
         Unreviewed, rolling out r135338, r135359, and r135378.

Modified: trunk/Source/WebCore/css/StyleResolver.cpp (135444 => 135445)


--- trunk/Source/WebCore/css/StyleResolver.cpp	2012-11-21 23:30:34 UTC (rev 135444)
+++ trunk/Source/WebCore/css/StyleResolver.cpp	2012-11-21 23:32:52 UTC (rev 135445)
@@ -1163,7 +1163,7 @@
                 return false;
         } else
 #endif
-        if (a->fastGetAttribute(classAttr) != b->fastGetAttribute(classAttr))
+        if (a->attributeData()->classNames() != b->attributeData()->classNames())
             return false;
     }
 

Modified: trunk/Source/WebCore/dom/SpaceSplitString.h (135444 => 135445)


--- trunk/Source/WebCore/dom/SpaceSplitString.h	2012-11-21 23:30:34 UTC (rev 135444)
+++ trunk/Source/WebCore/dom/SpaceSplitString.h	2012-11-21 23:32:52 UTC (rev 135445)
@@ -70,6 +70,8 @@
         SpaceSplitString() { }
         SpaceSplitString(const AtomicString& string, bool shouldFoldCase) { set(string, shouldFoldCase); }
 
+        bool operator!=(const SpaceSplitString& other) const { return m_data != other.m_data; }
+
         void set(const AtomicString&, bool shouldFoldCase);
         void clear() { m_data.clear(); }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to