Move repaint methods from RenderObject to RenderBox
authorojan@chromium.org <ojan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Mar 2013 19:22:17 +0000 (19:22 +0000)
committerojan@chromium.org <ojan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Mar 2013 19:22:17 +0000 (19:22 +0000)
https://bugs.webkit.org/show_bug.cgi?id=112773

Reviewed by Julien Chaffraix.

repaintOverhangingFloats and repaintDuringLayoutIfMoved are only ever called
on RenderBoxes, so don't need to be on RenderObject. This also lets us
devirtualize repaintDuringLayoutIfMoved.

* rendering/RenderBox.h:
(WebCore::RenderBox::repaintOverhangingFloats):
* rendering/RenderObject.cpp:
* rendering/RenderObject.h:

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

Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderBlock.h
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderBox.h
Source/WebCore/rendering/RenderObject.cpp
Source/WebCore/rendering/RenderObject.h

index 338fd8c..4abc8b1 100644 (file)
@@ -1,3 +1,19 @@
+2013-03-20  Ojan Vafai  <ojan@chromium.org>
+
+        Move repaint methods from RenderObject to RenderBox
+        https://bugs.webkit.org/show_bug.cgi?id=112773
+
+        Reviewed by Julien Chaffraix.
+
+        repaintOverhangingFloats and repaintDuringLayoutIfMoved are only ever called
+        on RenderBoxes, so don't need to be on RenderObject. This also lets us
+        devirtualize repaintDuringLayoutIfMoved.
+
+        * rendering/RenderBox.h:
+        (WebCore::RenderBox::repaintOverhangingFloats):
+        * rendering/RenderObject.cpp:
+        * rendering/RenderObject.h:
+
 2013-03-20  Christian Biesinger  <cbiesinger@chromium.org>
 
         Add a feature observer for RenderDeprecatedFlexibleBox
index 9075e10..37b103e 100644 (file)
@@ -2845,7 +2845,7 @@ void RenderBlock::repaintOverhangingFloats(bool paintAllDescendants)
         // condition is replaced with being a descendant of us.
         if (logicalBottomForFloat(r) > logicalHeight() && ((paintAllDescendants && r->m_renderer->isDescendantOf(this)) || r->shouldPaint()) && !r->m_renderer->hasSelfPaintingLayer()) {
             r->m_renderer->repaint();
-            r->m_renderer->repaintOverhangingFloats();
+            r->m_renderer->repaintOverhangingFloats(false);
         }
     }
 }
index 74bd537..06ef383 100644 (file)
@@ -612,7 +612,7 @@ private:
     virtual LayoutUnit collapsedMarginBefore() const { return maxPositiveMarginBefore() - maxNegativeMarginBefore(); }
     virtual LayoutUnit collapsedMarginAfter() const { return maxPositiveMarginAfter() - maxNegativeMarginAfter(); }
 
-    virtual void repaintOverhangingFloats(bool paintAllDescendants);
+    virtual void repaintOverhangingFloats(bool paintAllDescendants) OVERRIDE;
 
     void layoutBlockChildren(bool relayoutChildren, LayoutUnit& maxFloatLogicalBottom);
     void layoutInlineChildren(bool relayoutChildren, LayoutUnit& repaintLogicalTop, LayoutUnit& repaintLogicalBottom);
index 4e1cf58..81ac9c8 100644 (file)
@@ -2013,6 +2013,10 @@ void RenderBox::repaintDuringLayoutIfMoved(const LayoutRect& oldRect)
     }
 }
 
+void RenderBox::repaintOverhangingFloats(bool)
+{
+}
+
 void RenderBox::updateLogicalWidth()
 {
     LogicalExtentComputedValues computedValues;
index 9372eb5..c6538dc 100644 (file)
@@ -377,8 +377,8 @@ public:
 
     virtual LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const OVERRIDE;
     virtual void computeRectForRepaint(const RenderLayerModelObject* repaintContainer, LayoutRect&, bool fixed = false) const OVERRIDE;
-
-    virtual void repaintDuringLayoutIfMoved(const LayoutRect&);
+    void repaintDuringLayoutIfMoved(const LayoutRect&);
+    virtual void repaintOverhangingFloats(bool paintAllDescendants);
 
     virtual LayoutUnit containingBlockLogicalWidthForContent() const;
     LayoutUnit containingBlockLogicalHeightForContent(AvailableLogicalHeightType) const;
index 54703cf..b46912a 100644 (file)
@@ -1510,14 +1510,6 @@ bool RenderObject::repaintAfterLayoutIfNeeded(const RenderLayerModelObject* repa
     return false;
 }
 
-void RenderObject::repaintDuringLayoutIfMoved(const LayoutRect&)
-{
-}
-
-void RenderObject::repaintOverhangingFloats(bool)
-{
-}
-
 bool RenderObject::checkForRepaintDuringLayout() const
 {
     return !document()->view()->needsFullRepaint() && !hasLayer() && everHadLayout();
index 73bc7fe..d2eec92 100644 (file)
@@ -844,12 +844,6 @@ public:
     // Repaint only if our old bounds and new bounds are different. The caller may pass in newBounds and newOutlineBox if they are known.
     bool repaintAfterLayoutIfNeeded(const RenderLayerModelObject* repaintContainer, const LayoutRect& oldBounds, const LayoutRect& oldOutlineBox, const LayoutRect* newBoundsPtr = 0, const LayoutRect* newOutlineBoxPtr = 0);
 
-    // Repaint only if the object moved.
-    virtual void repaintDuringLayoutIfMoved(const LayoutRect&);
-
-    // Called to repaint a block's floats.
-    virtual void repaintOverhangingFloats(bool paintAllDescendants = false);
-
     bool checkForRepaintDuringLayout() const;
 
     // Returns the rect that should be repainted whenever this object changes.  The rect is in the view's