Title: [173769] trunk/Source/WebCore
Revision
173769
Author
[email protected]
Date
2014-09-19 13:26:07 -0700 (Fri, 19 Sep 2014)

Log Message

Add a size check for CSSSelector
https://bugs.webkit.org/show_bug.cgi?id=136882

Patch by Benjamin Poulain <[email protected]> on 2014-09-19
Reviewed by Christophe Dumez.

* css/CSSSelector.cpp:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (173768 => 173769)


--- trunk/Source/WebCore/ChangeLog	2014-09-19 20:19:57 UTC (rev 173768)
+++ trunk/Source/WebCore/ChangeLog	2014-09-19 20:26:07 UTC (rev 173769)
@@ -1,3 +1,12 @@
+2014-09-19  Benjamin Poulain  <[email protected]>
+
+        Add a size check for CSSSelector
+        https://bugs.webkit.org/show_bug.cgi?id=136882
+
+        Reviewed by Christophe Dumez.
+
+        * css/CSSSelector.cpp:
+
 2014-09-19  Eva Balazsfalvi  <[email protected]>
 
         REGRESSION(r173464): It broke the !ENABLE(PICTURE_SIZES) build

Modified: trunk/Source/WebCore/css/CSSSelector.cpp (173768 => 173769)


--- trunk/Source/WebCore/css/CSSSelector.cpp	2014-09-19 20:19:57 UTC (rev 173768)
+++ trunk/Source/WebCore/css/CSSSelector.cpp	2014-09-19 20:26:07 UTC (rev 173769)
@@ -42,6 +42,13 @@
 
 using namespace HTMLNames;
 
+struct SameSizeAsCSSSelector {
+    unsigned flags;
+    void* unionPointer;
+};
+
+static_assert(sizeof(CSSSelector) == sizeof(SameSizeAsCSSSelector), "CSSSelector should remain small.");
+
 void CSSSelector::createRareData()
 {
     ASSERT(match() != Tag);

Modified: trunk/Source/WebCore/css/CSSSelector.h (173768 => 173769)


--- trunk/Source/WebCore/css/CSSSelector.h	2014-09-19 20:19:57 UTC (rev 173768)
+++ trunk/Source/WebCore/css/CSSSelector.h	2014-09-19 20:26:07 UTC (rev 173769)
@@ -277,15 +277,15 @@
         void setForPage() { m_isForPage = true; }
 
     private:
-        unsigned m_relation           : 3; // enum Relation
-        mutable unsigned m_match      : 4; // enum Match
-        mutable unsigned m_pseudoType : 8; // PseudoType
-        mutable bool m_parsedNth      : 1; // Used for :nth-*
-        bool m_isLastInSelectorList   : 1;
-        bool m_isLastInTagHistory     : 1;
-        bool m_hasRareData            : 1;
-        bool m_isForPage              : 1;
-        bool m_tagIsForNamespaceRule  : 1;
+        unsigned m_relation              : 3; // enum Relation.
+        mutable unsigned m_match         : 4; // enum Match.
+        mutable unsigned m_pseudoType    : 8; // PseudoType.
+        mutable unsigned m_parsedNth     : 1; // Used for :nth-*.
+        unsigned m_isLastInSelectorList  : 1;
+        unsigned m_isLastInTagHistory    : 1;
+        unsigned m_hasRareData           : 1;
+        unsigned m_isForPage             : 1;
+        unsigned m_tagIsForNamespaceRule : 1;
 
         unsigned specificityForOneSelector() const;
         unsigned specificityForPage() const;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to