Index: third_party/WebKit/Source/core/layout/line/LineWidth.h |
diff --git a/third_party/WebKit/Source/core/layout/line/LineWidth.h b/third_party/WebKit/Source/core/layout/line/LineWidth.h |
index 6f18faae32b95f220bfc9be723da3f6ec77a9adb..5f63846aa0adc2ffb398a4b3cb1a5daaa26c61d3 100644 |
--- a/third_party/WebKit/Source/core/layout/line/LineWidth.h |
+++ b/third_party/WebKit/Source/core/layout/line/LineWidth.h |
@@ -50,7 +50,10 @@ public: |
bool fitsOnLine(float extra) const { return currentWidth() + extra <= (m_availableWidth + LayoutUnit::epsilon()); } |
bool fitsOnLine(float extra, WhitespaceTreatment whitespaceTreatment) const |
{ |
- return currentWidth() - (whitespaceTreatment == ExcludeWhitespace ? trailingWhitespaceWidth() : 0) + extra <= (m_availableWidth + LayoutUnit::epsilon()); |
+ LayoutUnit w = LayoutUnit::fromFloatFloor(currentWidth() + extra); |
+ if (whitespaceTreatment == ExcludeWhitespace) |
+ w -= LayoutUnit::fromFloatCeil(trailingWhitespaceWidth()); |
+ return w <= m_availableWidth; |
} |
// Note that m_uncommittedWidth may not be LayoutUnit-snapped at this point. Because |
@@ -77,7 +80,7 @@ public: |
private: |
void computeAvailableWidthFromLeftAndRight(); |
- void updateLineDimension(LayoutUnit newLineTop, LayoutUnit newLineWidth, const float& newLineLeft, const float& newLineRight); |
+ void updateLineDimension(LayoutUnit newLineTop, LayoutUnit newLineWidth, const LayoutUnit& newLineLeft, const LayoutUnit& newLineRight); |
void wrapNextToShapeOutside(bool isFirstLine); |
LineLayoutBlockFlow m_block; |
@@ -85,9 +88,9 @@ private: |
float m_committedWidth; |
float m_overhangWidth; // The amount by which |m_availableWidth| has been inflated to account for possible contraction due to ruby overhang. |
float m_trailingWhitespaceWidth; |
- float m_left; |
- float m_right; |
- float m_availableWidth; |
+ LayoutUnit m_left; |
+ LayoutUnit m_right; |
+ LayoutUnit m_availableWidth; |
bool m_isFirstLine; |
IndentTextOrNot m_indentText; |
}; |