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

Unified Diff: Source/core/layout/LayoutText.cpp

Issue 1196213002: Remove duplicate measure hyphen string method (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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: Source/core/layout/LayoutText.cpp
diff --git a/Source/core/layout/LayoutText.cpp b/Source/core/layout/LayoutText.cpp
index a3379781c48d689fef5eb0b161c22d4dca597471..cac6bfb700edb67f07a1edad8d0bb7d78f5e995b 100644
--- a/Source/core/layout/LayoutText.cpp
+++ b/Source/core/layout/LayoutText.cpp
@@ -857,10 +857,10 @@ void LayoutText::computePreferredLogicalWidths(float leadWidth)
computePreferredLogicalWidths(leadWidth, fallbackFonts, glyphBounds);
}
-static inline float hyphenWidth(LayoutText* layoutObject, const Font& font, TextDirection direction)
+float LayoutText::hyphenWidth(LayoutText* layoutText, const Font& font, TextDirection direction)
{
- const ComputedStyle& style = layoutObject->styleRef();
- return font.width(constructTextRun(layoutObject, font, style.hyphenString().string(), style, direction));
+ const ComputedStyle& style = layoutText->styleRef();
+ return font.width(constructTextRun(layoutText, font, style.hyphenString().string(), style, direction));
}
void LayoutText::computePreferredLogicalWidths(float leadWidth, HashSet<const SimpleFontData*>& fallbackFonts, FloatRect& glyphBounds)
@@ -1019,7 +1019,7 @@ void LayoutText::computePreferredLogicalWidths(float leadWidth, HashSet<const Si
} else {
w = widthFromFont(f, i, wordLen, leadWidth, currMaxWidth, textDirection, &fallbackFonts, &glyphBounds);
if (c == softHyphenCharacter)
- currMinWidth += hyphenWidth(this, f, textDirection);
+ currMinWidth += LayoutText::hyphenWidth(this, f, textDirection);
}
currMinWidth += w;

Powered by Google App Engine
This is Rietveld 408576698