Index: Source/core/rendering/line/LineWidth.cpp |
diff --git a/Source/core/rendering/line/LineWidth.cpp b/Source/core/rendering/line/LineWidth.cpp |
index 714bc6ca8d5568d9ed440368f03e2d385d79f145..1a27a29da9a579e5e07237e5d7135ec9ec7545cf 100644 |
--- a/Source/core/rendering/line/LineWidth.cpp |
+++ b/Source/core/rendering/line/LineWidth.cpp |
@@ -119,17 +119,11 @@ void LineWidth::applyOverhang(RenderRubyRun* rubyRun, RenderObject* startRendere |
m_overhangWidth += startOverhang + endOverhang; |
} |
-inline static float availableWidthAtOffset(const RenderBlockFlow& block, const LayoutUnit& offset, bool shouldIndentText, float& newLineLeft, float& newLineRight) |
+inline static float availableWidthAtOffset(const RenderBlockFlow& block, const LayoutUnit& offset, bool shouldIndentText, float& newLineLeft, |
+ float& newLineRight, const LayoutUnit& lineHeight = 0) |
{ |
- newLineLeft = block.logicalLeftOffsetForLine(offset, shouldIndentText).toFloat(); |
- newLineRight = block.logicalRightOffsetForLine(offset, shouldIndentText).toFloat(); |
- return std::max(0.0f, newLineRight - newLineLeft); |
-} |
- |
-inline static float availableWidthAtOffset(const RenderBlockFlow& block, const LayoutUnit& offset, bool shouldIndentText) |
-{ |
- float newLineLeft = block.logicalLeftOffsetForLine(offset, shouldIndentText).toFloat(); |
- float newLineRight = block.logicalRightOffsetForLine(offset, shouldIndentText).toFloat(); |
+ newLineLeft = block.logicalLeftOffsetForLine(offset, shouldIndentText, lineHeight).toFloat(); |
+ newLineRight = block.logicalRightOffsetForLine(offset, shouldIndentText, lineHeight).toFloat(); |
return std::max(0.0f, newLineRight - newLineLeft); |
} |
@@ -144,16 +138,6 @@ void LineWidth::updateLineDimension(LayoutUnit newLineTop, LayoutUnit newLineWid |
m_right = newLineRight; |
} |
-inline static bool isWholeLineFit(const RenderBlockFlow& block, const LayoutUnit& lineTop, LayoutUnit lineHeight, float uncommittedWidth, bool shouldIndentText) |
-{ |
- for (LayoutUnit lineBottom = lineTop; lineBottom <= lineTop + lineHeight; lineBottom++) { |
- LayoutUnit availableWidthAtBottom = availableWidthAtOffset(block, lineBottom, shouldIndentText); |
- if (availableWidthAtBottom < uncommittedWidth) |
- return false; |
- } |
- return true; |
-} |
- |
void LineWidth::wrapNextToShapeOutside(bool isFirstLine) |
{ |
LayoutUnit lineHeight = m_block.lineHeight(isFirstLine, m_block.isHorizontalWritingMode() ? HorizontalLine : VerticalLine, PositionOfInteriorLineBoxes); |
@@ -165,8 +149,8 @@ void LineWidth::wrapNextToShapeOutside(bool isFirstLine) |
float newLineLeft = m_left; |
float newLineRight = m_right; |
while (true) { |
- newLineWidth = availableWidthAtOffset(m_block, newLineTop, shouldIndentText(), newLineLeft, newLineRight); |
- if (newLineWidth >= m_uncommittedWidth && isWholeLineFit(m_block, newLineTop, lineHeight, m_uncommittedWidth, shouldIndentText())) |
+ newLineWidth = availableWidthAtOffset(m_block, newLineTop, shouldIndentText(), newLineLeft, newLineRight, lineHeight); |
+ if (newLineWidth >= m_uncommittedWidth) |
break; |
if (newLineTop >= floatLogicalBottom) |