Move a few more functions from RenderBlock to RenderBlockFlow
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 5 Jan 2014 00:28:39 +0000 (00:28 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 5 Jan 2014 00:28:39 +0000 (00:28 +0000)
https://bugs.webkit.org/show_bug.cgi?id=126494

Reviewed by Andreas Kling.

* rendering/RenderBlock.h:
* rendering/RenderBlockFlow.h:
(WebCore::RenderBlockFlow::adjustInlineDirectionLineBounds):
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::textAlignmentForLine):
(WebCore::RenderBlockFlow::updateLogicalWidthForAlignment):
(WebCore::RenderBlockFlow::startAlignedOffsetForLine):
These are only used by RenderBlockFlow, so move them there.

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

Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBlock.h
Source/WebCore/rendering/RenderBlockFlow.h
Source/WebCore/rendering/RenderBlockLineLayout.cpp

index 8b2947c..2dad818 100644 (file)
@@ -1,3 +1,19 @@
+2014-01-04  Sam Weinig  <sam@webkit.org>
+
+        Move a few more functions from RenderBlock to RenderBlockFlow
+        https://bugs.webkit.org/show_bug.cgi?id=126494
+
+        Reviewed by Andreas Kling.
+
+        * rendering/RenderBlock.h:
+        * rendering/RenderBlockFlow.h:
+        (WebCore::RenderBlockFlow::adjustInlineDirectionLineBounds):
+        * rendering/RenderBlockLineLayout.cpp:
+        (WebCore::RenderBlockFlow::textAlignmentForLine):
+        (WebCore::RenderBlockFlow::updateLogicalWidthForAlignment):
+        (WebCore::RenderBlockFlow::startAlignedOffsetForLine):
+        These are only used by RenderBlockFlow, so move them there.
+
 2014-01-04  Simon Fraser  <simon.fraser@apple.com>
 
         Prepare the ScrollingTree for remote use
index 00fa136..73f9fc2 100644 (file)
@@ -190,7 +190,6 @@ public:
             : logicalWidth() - logicalRightOffsetForLine(position, shouldIndentText, logicalHeight);
     }
 
-    LayoutUnit startAlignedOffsetForLine(LayoutUnit position, bool shouldIndentText);
     LayoutUnit textIndentOffset() const;
 
     virtual VisiblePosition positionForPoint(const LayoutPoint&) OVERRIDE;
@@ -299,8 +298,6 @@ public:
     LayoutUnit collapsedMarginBeforeForChild(const RenderBox& child) const;
     LayoutUnit collapsedMarginAfterForChild(const RenderBox& child) const;
 
-    void updateLogicalWidthForAlignment(const ETextAlign&, BidiRun* trailingSpaceRun, float& logicalLeft, float& totalLogicalWidth, float& availableLogicalWidth, int expansionOpportunityCount);
-
     virtual void updateFirstLetter();
 
     virtual void scrollbarsChanged(bool /*horizontalScrollbarChanged*/, bool /*verticalScrollbarChanged*/) { }
@@ -407,9 +404,6 @@ protected:
         return adjustLogicalLeftOffsetForLine(logicalLeftFloatOffsetForLine(logicalTop, fixedOffset, logicalHeight), applyTextIndent);
     }
 
-    virtual ETextAlign textAlignmentForLine(bool endsWithSoftBreak) const;
-    virtual void adjustInlineDirectionLineBounds(int /* expansionOpportunityCount */, float& /* logicalLeft */, float& /* logicalWidth */) const { }
-
     virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) OVERRIDE;
 
     virtual void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const OVERRIDE;
index 39d5b05..8907651 100644 (file)
@@ -475,6 +475,10 @@ public:
     static void appendRunsForObject(BidiRunList<BidiRun>&, int start, int end, RenderObject*, InlineBidiResolver&);
     RootInlineBox* createAndAppendRootInlineBox();
 
+    LayoutUnit startAlignedOffsetForLine(LayoutUnit position, bool shouldIndentText);
+    virtual ETextAlign textAlignmentForLine(bool endsWithSoftBreak) const;
+    virtual void adjustInlineDirectionLineBounds(int /* expansionOpportunityCount */, float& /* logicalLeft */, float& /* logicalWidth */) const { }
+
 private:
     void layoutLineBoxes(bool relayoutChildren, LayoutUnit& repaintLogicalTop, LayoutUnit& repaintLogicalBottom);
     void layoutSimpleLines(LayoutUnit& repaintLogicalTop, LayoutUnit& repaintLogicalBottom);
@@ -515,6 +519,7 @@ private:
     // region/page/column that has a different available line width than the old one. Used to know when you have to dirty a
     // line, i.e., that it can't be re-used.
     bool lineWidthForPaginatedLineChanged(RootInlineBox*, LayoutUnit lineDelta, RenderFlowThread*) const;
+    void updateLogicalWidthForAlignment(const ETextAlign&, BidiRun* trailingSpaceRun, float& logicalLeft, float& totalLogicalWidth, float& availableLogicalWidth, int expansionOpportunityCount);
 
 // END METHODS DEFINED IN RenderBlockLineLayout
 
index 8372be0..d8b0d2d 100644 (file)
@@ -352,7 +352,7 @@ RootInlineBox* RenderBlockFlow::constructLine(BidiRunList<BidiRun>& bidiRuns, co
     return lastRootBox();
 }
 
-ETextAlign RenderBlock::textAlignmentForLine(bool endsWithSoftBreak) const
+ETextAlign RenderBlockFlow::textAlignmentForLine(bool endsWithSoftBreak) const
 {
     ETextAlign alignment = style().textAlign();
     if (!endsWithSoftBreak && alignment == JUSTIFY)
@@ -548,7 +548,7 @@ static inline void computeExpansionForJustifiedText(BidiRun* firstRun, BidiRun*
     }
 }
 
-void RenderBlock::updateLogicalWidthForAlignment(const ETextAlign& textAlign, BidiRun* trailingSpaceRun, float& logicalLeft, float& totalLogicalWidth, float& availableLogicalWidth, int expansionOpportunityCount)
+void RenderBlockFlow::updateLogicalWidthForAlignment(const ETextAlign& textAlign, BidiRun* trailingSpaceRun, float& logicalLeft, float& totalLogicalWidth, float& availableLogicalWidth, int expansionOpportunityCount)
 {
     // Armed with the total width of the line (without justification),
     // we now examine our text-align property in order to determine where to position the
@@ -2128,7 +2128,7 @@ bool RenderBlockFlow::positionNewFloatOnLine(FloatingObject* newFloat, FloatingO
     return true;
 }
 
-LayoutUnit RenderBlock::startAlignedOffsetForLine(LayoutUnit position, bool firstLine)
+LayoutUnit RenderBlockFlow::startAlignedOffsetForLine(LayoutUnit position, bool firstLine)
 {
     ETextAlign textAlign = style().textAlign();