Title: [120136] trunk/Source/WebCore
Revision
120136
Author
[email protected]
Date
2012-06-12 16:07:21 -0700 (Tue, 12 Jun 2012)

Log Message

Fix packing in StyleBoxData for Windows.
https://bugs.webkit.org/show_bug.cgi?id=88858

Reviewed by Tony Chang.

MSVC doesn't pack bitfields if the types are mixed.
We can safely change the bool type to an unsigned so
the packing will happen. I have added a compile assert
for future regressions.

No new tests : we should not see any regressions.

* rendering/style/StyleBoxData.h:
* rendering/style/StyleBoxData.cpp:
(StyleBoxData):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (120135 => 120136)


--- trunk/Source/WebCore/ChangeLog	2012-06-12 23:04:17 UTC (rev 120135)
+++ trunk/Source/WebCore/ChangeLog	2012-06-12 23:07:21 UTC (rev 120136)
@@ -1,3 +1,21 @@
+2012-06-12  Alexis Menard  <[email protected]>
+
+        Fix packing in StyleBoxData for Windows.
+        https://bugs.webkit.org/show_bug.cgi?id=88858
+
+        Reviewed by Tony Chang.
+
+        MSVC doesn't pack bitfields if the types are mixed.
+        We can safely change the bool type to an unsigned so
+        the packing will happen. I have added a compile assert
+        for future regressions.
+
+        No new tests : we should not see any regressions.
+
+        * rendering/style/StyleBoxData.h:
+        * rendering/style/StyleBoxData.cpp:
+        (StyleBoxData):
+
 2012-06-12  Adrienne Walker  <[email protected]>
 
         [chromium] Paint scrollbars on WebKit thread and composite those textures

Modified: trunk/Source/WebCore/rendering/style/StyleBoxData.cpp (120135 => 120136)


--- trunk/Source/WebCore/rendering/style/StyleBoxData.cpp	2012-06-12 23:04:17 UTC (rev 120135)
+++ trunk/Source/WebCore/rendering/style/StyleBoxData.cpp	2012-06-12 23:07:21 UTC (rev 120136)
@@ -27,6 +27,14 @@
 
 namespace WebCore {
 
+struct SameSizeAsStyleBoxData : public RefCounted<SameSizeAsStyleBoxData> {
+    Length length[7];
+    int m_zIndex;
+    uint32_t bitfields;
+};
+
+COMPILE_ASSERT(sizeof(StyleBoxData) == sizeof(SameSizeAsStyleBoxData), StyleBoxData_should_not_grow);
+
 StyleBoxData::StyleBoxData()
     : m_minWidth(RenderStyle::initialMinSize())
     , m_maxWidth(RenderStyle::initialMaxSize())

Modified: trunk/Source/WebCore/rendering/style/StyleBoxData.h (120135 => 120136)


--- trunk/Source/WebCore/rendering/style/StyleBoxData.h	2012-06-12 23:04:17 UTC (rev 120135)
+++ trunk/Source/WebCore/rendering/style/StyleBoxData.h	2012-06-12 23:07:21 UTC (rev 120136)
@@ -80,7 +80,7 @@
     Length m_verticalAlign;
 
     int m_zIndex;
-    bool m_hasAutoZIndex : 1;
+    unsigned m_hasAutoZIndex : 1;
     unsigned m_boxSizing : 1; // EBoxSizing
 #if ENABLE(CSS_BOX_DECORATION_BREAK)
     unsigned m_boxDecorationBreak : 1; // EBoxDecorationBreak
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to