Replace 2 uses of updateLogicalHeight with computeLogicalHeight
authortony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Sep 2012 23:43:28 +0000 (23:43 +0000)
committertony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Sep 2012 23:43:28 +0000 (23:43 +0000)
https://bugs.webkit.org/show_bug.cgi?id=97486

Reviewed by Ojan Vafai.

More work for bug 96804.  This is just a refactoring.

No new tests, behavior should be the same as before.

* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::computeLogicalHeight):
* rendering/RenderFlowThread.h:
* rendering/RenderMultiColumnFlowThread.cpp:
(WebCore::RenderMultiColumnFlowThread::computeLogicalHeight):
(WebCore):
* rendering/RenderMultiColumnFlowThread.h:
(RenderMultiColumnFlowThread):

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

Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderFlowThread.cpp
Source/WebCore/rendering/RenderFlowThread.h
Source/WebCore/rendering/RenderMultiColumnFlowThread.cpp
Source/WebCore/rendering/RenderMultiColumnFlowThread.h

index e0b80d4..65c38e2 100644 (file)
@@ -1,3 +1,23 @@
+2012-09-24  Tony Chang  <tony@chromium.org>
+
+        Replace 2 uses of updateLogicalHeight with computeLogicalHeight
+        https://bugs.webkit.org/show_bug.cgi?id=97486
+
+        Reviewed by Ojan Vafai.
+
+        More work for bug 96804.  This is just a refactoring.
+
+        No new tests, behavior should be the same as before.
+
+        * rendering/RenderFlowThread.cpp:
+        (WebCore::RenderFlowThread::computeLogicalHeight):
+        * rendering/RenderFlowThread.h:
+        * rendering/RenderMultiColumnFlowThread.cpp:
+        (WebCore::RenderMultiColumnFlowThread::computeLogicalHeight):
+        (WebCore):
+        * rendering/RenderMultiColumnFlowThread.h:
+        (RenderMultiColumnFlowThread):
+
 2012-09-21  Kenneth Russell  <kbr@google.com>
 
         [V8] ArrayBuffer code should not pass a negative length to SetIndexedPropertiesToExternalArrayData()
index 0741ea8..d5a99b7 100644 (file)
@@ -222,19 +222,18 @@ void RenderFlowThread::updateLogicalWidth()
     }
 }
 
-void RenderFlowThread::updateLogicalHeight()
+void RenderFlowThread::computeLogicalHeight(LayoutUnit, LayoutUnit logicalTop, LogicalExtentComputedValues& computedValues) const
 {
-    LayoutUnit logicalHeight = 0;
+    computedValues.m_position = logicalTop;
+    computedValues.m_extent = 0;
 
-    for (RenderRegionList::iterator iter = m_regionList.begin(); iter != m_regionList.end(); ++iter) {
+    for (RenderRegionList::const_iterator iter = m_regionList.begin(); iter != m_regionList.end(); ++iter) {
         RenderRegion* region = *iter;
         if (!region->isValid())
             continue;
         ASSERT(!region->needsLayout());
-        logicalHeight += region->logicalHeightOfAllFlowThreadContent();
+        computedValues.m_extent += region->logicalHeightOfAllFlowThreadContent();
     }
-
-    setLogicalHeight(logicalHeight);
 }
 
 void RenderFlowThread::paintFlowThreadPortionInRegion(PaintInfo& paintInfo, RenderRegion* region, LayoutRect flowThreadPortionRect, LayoutRect flowThreadPortionOverflowRect, const LayoutPoint& paintOffset) const
index d09183d..b942eee 100644 (file)
@@ -74,7 +74,7 @@ public:
     const RenderRegionList& renderRegionList() const { return m_regionList; }
 
     virtual void updateLogicalWidth() OVERRIDE;
-    virtual void updateLogicalHeight() OVERRIDE;
+    virtual void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logicalTop, LogicalExtentComputedValues&) const OVERRIDE;
 
     void paintFlowThreadPortionInRegion(PaintInfo&, RenderRegion*, LayoutRect flowThreadPortionRect, LayoutRect flowThreadPortionOverflowRect, const LayoutPoint&) const;
     bool hitTestFlowThreadPortionInRegion(RenderRegion*, LayoutRect flowThreadPortionRect, LayoutRect flowThreadPortionOverflowRect, const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset) const;
index e553c54..5625068 100644 (file)
@@ -42,4 +42,11 @@ const char* RenderMultiColumnFlowThread::renderName() const
     return "RenderMultiColumnFlowThread";
 }
 
+void RenderMultiColumnFlowThread::computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logicalTop, LogicalExtentComputedValues& computedValues) const
+{
+    // We simply remain at our intrinsic height.
+    computedValues.m_extent = logicalHeight;
+    computedValues.m_position = logicalTop;
+}
+
 }
index 363cd07..5952227 100644 (file)
@@ -39,7 +39,7 @@ public:
 private:
     virtual const char* renderName() const OVERRIDE;
     
-    virtual void updateLogicalHeight() OVERRIDE { } // We simply remain at our intrinsic height.
+    virtual void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logicalTop, LogicalExtentComputedValues&) const OVERRIDE;
 };
 
 } // namespace WebCore