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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp

Issue 1656743002: Removing more implicit LayoutUnit construction (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix additional test 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/LayoutBlockFlowLine.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp b/third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp
index b97a60cd3b60cca5d5e9d4b5acac845797e8c592..8db266c97893d029ab5d619a5d29d1e2d76d9a9b 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp
@@ -435,7 +435,7 @@ static inline void setLogicalWidthForTextRun(RootInlineBox* lineBox, BidiRun* ru
LayoutUnit hyphenWidth;
if (toInlineTextBox(run->m_box)->hasHyphen())
- hyphenWidth = layoutText->hyphenWidth(font, run->direction());
+ hyphenWidth = LayoutUnit(layoutText->hyphenWidth(font, run->direction()));
float measuredWidth = 0;
FloatRect glyphBounds;
@@ -500,7 +500,7 @@ static inline void setLogicalWidthForTextRun(RootInlineBox* lineBox, BidiRun* ru
glyphOverflow.setFromBounds(glyphBounds, font.fontMetrics().floatAscent(), font.fontMetrics().floatDescent(), measuredWidth);
- run->m_box->setLogicalWidth(measuredWidth + hyphenWidth);
+ run->m_box->setLogicalWidth(LayoutUnit(measuredWidth) + hyphenWidth);
if (!fallbackFonts.isEmpty()) {
ASSERT(run->m_box->isText());
GlyphOverflowAndFallbackFontsMap::ValueType* it = textBoxDataMap.add(toInlineTextBox(run->m_box), std::make_pair(Vector<const SimpleFontData*>(), GlyphOverflow())).storedValue;
@@ -1988,7 +1988,7 @@ void LayoutBlockFlow::checkLinesForTextOverflow()
// accommodate our truncation string, and no replaced elements (images, tables) can overlap the ellipsis
// space.
- LayoutUnit width = indentText == IndentText ? firstLineEllipsisWidth : ellipsisWidth;
+ LayoutUnit width(indentText == IndentText ? firstLineEllipsisWidth : ellipsisWidth);
LayoutUnit blockEdge = ltr ? blockRightEdge : blockLeftEdge;
if (curr->lineCanAccommodateEllipsis(ltr, blockEdge, lineBoxEdge, width)) {
LayoutUnit totalLogicalWidth = curr->placeEllipsis(selectedEllipsisStr, ltr, blockLeftEdge, blockRightEdge, width);
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlock.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutBox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698