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

Unified Diff: Source/core/layout/line/BreakingContextInlineHeaders.h

Issue 1196213002: Remove duplicate measure hyphen string method (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Making hyphenWidth as inline and removing static nature 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
« no previous file with comments | « Source/core/layout/LayoutText.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/line/BreakingContextInlineHeaders.h
diff --git a/Source/core/layout/line/BreakingContextInlineHeaders.h b/Source/core/layout/line/BreakingContextInlineHeaders.h
index a33c7bb57207c4f5f2262173fe2ab28b993a9ff7..5adf62ac869c204ddd2d4b4f49c975396f4cad2a 100644
--- a/Source/core/layout/line/BreakingContextInlineHeaders.h
+++ b/Source/core/layout/line/BreakingContextInlineHeaders.h
@@ -496,13 +496,6 @@ inline float firstPositiveWidth(const WordMeasurements& wordMeasurements)
return 0;
}
-inline float measureHyphenWidth(LayoutText* layoutText, const Font& font, TextDirection textDirection)
-{
- const ComputedStyle& style = layoutText->styleRef();
- return font.width(constructTextRun(layoutText, font,
- style.hyphenString().string(), style, style.direction()));
-}
-
ALWAYS_INLINE TextDirection textDirectionFromUnicode(WTF::Unicode::Direction direction)
{
return direction == WTF::Unicode::RightToLeft
@@ -594,7 +587,7 @@ inline bool BreakingContext::handleText(WordMeasurements& wordMeasurements, bool
m_lineInfo.setEmpty(false, m_block, &m_width);
if (c == softHyphenCharacter && m_autoWrap && !hyphenWidth) {
- hyphenWidth = measureHyphenWidth(layoutText, font, textDirectionFromUnicode(m_resolver.position().direction()));
+ hyphenWidth = layoutText->hyphenWidth(font, textDirectionFromUnicode(m_resolver.position().direction()));
m_width.addUncommittedWidth(hyphenWidth);
}
« no previous file with comments | « Source/core/layout/LayoutText.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698