REGRESSION(r82611) InlineBox has 33 bits of bitset, causing alignment issues and...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Sep 2011 20:49:27 +0000 (20:49 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Sep 2011 20:49:27 +0000 (20:49 +0000)
https://bugs.webkit.org/show_bug.cgi?id=64914

Patch by Andreas Kling <kling@webkit.org> on 2011-09-30
Reviewed by Antti Koivisto.

Remove InlineBox::prevOnLineExists() and its two accompanying bitfields
since nobody is using them anymore. nextOnLineExists() is still used by
GTK+ accessibility code.

Also added a compile-time assertion to guard against future bloating of
the InlineBox class.

* rendering/InlineBox.cpp:
(WebCore::SameSizeAsInlineBox::~SameSizeAsInlineBox):
* rendering/InlineBox.h:
(WebCore::InlineBox::InlineBox):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96422 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/rendering/InlineBox.cpp
Source/WebCore/rendering/InlineBox.h

index c368157..157de22 100644 (file)
@@ -1,3 +1,22 @@
+2011-09-30  Andreas Kling  <kling@webkit.org>
+
+        REGRESSION(r82611) InlineBox has 33 bits of bitset, causing alignment issues and extra memory use.
+        https://bugs.webkit.org/show_bug.cgi?id=64914
+
+        Reviewed by Antti Koivisto.
+
+        Remove InlineBox::prevOnLineExists() and its two accompanying bitfields
+        since nobody is using them anymore. nextOnLineExists() is still used by
+        GTK+ accessibility code.
+
+        Also added a compile-time assertion to guard against future bloating of
+        the InlineBox class.
+
+        * rendering/InlineBox.cpp:
+        (WebCore::SameSizeAsInlineBox::~SameSizeAsInlineBox):
+        * rendering/InlineBox.h:
+        (WebCore::InlineBox::InlineBox):
+
 2011-09-30  Pierre Rossi  <pierre.rossi@gmail.com>
 
         [Qt] Build fix: Qt::escape is deprecated in Qt5
index 2eda402..18e9a1a 100644 (file)
 using namespace std;
 
 namespace WebCore {
+
+class SameSizeAsInlineBox {
+    virtual ~SameSizeAsInlineBox() { }
+    void* a[4];
+    FloatPoint b;
+    float c;
+    uint32_t d;
+#ifndef NDEBUG
+    bool e;
+#endif
+};
+
+COMPILE_ASSERT(sizeof(InlineBox) == sizeof(SameSizeAsInlineBox), InlineBox_size_guard);
     
 #ifndef NDEBUG
 static bool inInlineBoxDetach;
@@ -258,21 +271,6 @@ bool InlineBox::nextOnLineExists() const
     return m_nextOnLineExists;
 }
 
-bool InlineBox::prevOnLineExists() const
-{
-    if (!m_determinedIfPrevOnLineExists) {
-        m_determinedIfPrevOnLineExists = true;
-        
-        if (!parent())
-            m_prevOnLineExists = false;
-        else if (prevOnLine())
-            m_prevOnLineExists = true;
-        else
-            m_prevOnLineExists = parent()->prevOnLineExists();
-    }
-    return m_prevOnLineExists;
-}
-
 InlineBox* InlineBox::nextLeafChild() const
 {
     InlineBox* leaf = 0;
index cf6da56..3f5d128 100644 (file)
@@ -56,9 +56,7 @@ public:
         , m_dirOverride(false)
         , m_isText(false)
         , m_determinedIfNextOnLineExists(false)
-        , m_determinedIfPrevOnLineExists(false)
         , m_nextOnLineExists(false)
-        , m_prevOnLineExists(false)
         , m_expansion(0)
 #ifndef NDEBUG
         , m_hasBadParent(false)
@@ -90,9 +88,7 @@ public:
         , m_dirOverride(false)
         , m_isText(false)
         , m_determinedIfNextOnLineExists(false)
-        , m_determinedIfPrevOnLineExists(false)
         , m_nextOnLineExists(false)
-        , m_prevOnLineExists(false)
         , m_expansion(0)
 #ifndef NDEBUG
         , m_hasBadParent(false)
@@ -203,7 +199,6 @@ public:
         m_prev = prev;
     }
     bool nextOnLineExists() const;
-    bool prevOnLineExists() const;
 
     virtual bool isLeaf() const { return true; }
     
@@ -364,9 +359,7 @@ public:
     bool m_isText : 1; // Whether or not this object represents text with a non-zero height. Includes non-image list markers, text boxes.
 protected:
     mutable bool m_determinedIfNextOnLineExists : 1;
-    mutable bool m_determinedIfPrevOnLineExists : 1;
     mutable bool m_nextOnLineExists : 1;
-    mutable bool m_prevOnLineExists : 1;
     signed m_expansion : 11; // for justified text
 
 #ifndef NDEBUG