Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(507)

Unified Diff: third_party/WebKit/Source/core/layout/line/LineWidth.cpp

Issue 1583783002: Use IndentTextOrNot instead of a bool (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@568851-2
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/line/LineWidth.cpp
diff --git a/third_party/WebKit/Source/core/layout/line/LineWidth.cpp b/third_party/WebKit/Source/core/layout/line/LineWidth.cpp
index b740c28f9d447c088a4114b662e697099ff780ff..cb39bed728bf079c6d7d9f09432091ec82f4247a 100644
--- a/third_party/WebKit/Source/core/layout/line/LineWidth.cpp
+++ b/third_party/WebKit/Source/core/layout/line/LineWidth.cpp
@@ -53,8 +53,8 @@ void LineWidth::updateAvailableWidth(LayoutUnit replacedHeight)
{
LayoutUnit height = m_block.logicalHeight();
LayoutUnit logicalHeight = m_block.minLineHeightForReplacedObject(m_isFirstLine, replacedHeight);
- m_left = m_block.logicalLeftOffsetForLine(height, shouldIndentText(), logicalHeight).toFloat();
- m_right = m_block.logicalRightOffsetForLine(height, shouldIndentText(), logicalHeight).toFloat();
+ m_left = m_block.logicalLeftOffsetForLine(height, indentText(), logicalHeight).toFloat();
+ m_right = m_block.logicalRightOffsetForLine(height, indentText(), logicalHeight).toFloat();
computeAvailableWidthFromLeftAndRight();
}
@@ -118,7 +118,7 @@ void LineWidth::applyOverhang(LineLayoutRubyRun rubyRun, LineLayoutItem startLay
m_overhangWidth += startOverhang + endOverhang;
}
-inline static float availableWidthAtOffset(LineLayoutBlockFlow block, const LayoutUnit& offset, bool shouldIndentText, float& newLineLeft,
+inline static float availableWidthAtOffset(LineLayoutBlockFlow block, const LayoutUnit& offset, IndentTextOrNot shouldIndentText, float& newLineLeft,
float& newLineRight, const LayoutUnit& lineHeight = 0)
{
newLineLeft = block.logicalLeftOffsetForLine(offset, shouldIndentText, lineHeight).toFloat();
@@ -148,7 +148,7 @@ void LineWidth::wrapNextToShapeOutside(bool isFirstLine)
float newLineLeft = m_left;
float newLineRight = m_right;
while (true) {
- newLineWidth = availableWidthAtOffset(m_block, newLineTop, shouldIndentText(), newLineLeft, newLineRight, lineHeight);
+ newLineWidth = availableWidthAtOffset(m_block, newLineTop, indentText(), newLineLeft, newLineRight, lineHeight);
if (newLineWidth >= m_uncommittedWidth)
break;
@@ -181,7 +181,7 @@ void LineWidth::fitBelowFloats(bool isFirstLine)
if (floatLogicalBottom <= lastFloatLogicalBottom)
break;
- newLineWidth = availableWidthAtOffset(m_block, floatLogicalBottom, shouldIndentText(), newLineLeft, newLineRight);
+ newLineWidth = availableWidthAtOffset(m_block, floatLogicalBottom, indentText(), newLineLeft, newLineRight);
lastFloatLogicalBottom = floatLogicalBottom;
if (newLineWidth >= m_uncommittedWidth)

Powered by Google App Engine
This is Rietveld 408576698