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

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: 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.h ('k') | Source/core/layout/line/BreakingContextInlineHeaders.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutText.cpp
diff --git a/Source/core/layout/LayoutText.cpp b/Source/core/layout/LayoutText.cpp
index a3379781c48d689fef5eb0b161c22d4dca597471..4df0b5aecd0f5b4e1d4b585744dcb77d4b8d432e 100644
--- a/Source/core/layout/LayoutText.cpp
+++ b/Source/core/layout/LayoutText.cpp
@@ -35,7 +35,6 @@
#include "core/layout/LayoutBlock.h"
#include "core/layout/LayoutTextCombine.h"
#include "core/layout/LayoutView.h"
-#include "core/layout/TextRunConstructor.h"
#include "core/layout/line/AbstractInlineTextBox.h"
#include "core/layout/line/EllipsisBox.h"
#include "core/layout/line/GlyphOverflow.h"
@@ -857,12 +856,6 @@ void LayoutText::computePreferredLogicalWidths(float leadWidth)
computePreferredLogicalWidths(leadWidth, fallbackFonts, glyphBounds);
}
-static inline float hyphenWidth(LayoutText* layoutObject, const Font& font, TextDirection direction)
-{
- const ComputedStyle& style = layoutObject->styleRef();
- return font.width(constructTextRun(layoutObject, font, style.hyphenString().string(), style, direction));
-}
-
void LayoutText::computePreferredLogicalWidths(float leadWidth, HashSet<const SimpleFontData*>& fallbackFonts, FloatRect& glyphBounds)
{
ASSERT(m_hasTab || preferredLogicalWidthsDirty() || !m_knownToHaveNoOverflowAndNoFallbackFonts);
@@ -1019,7 +1012,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 += hyphenWidth(f, textDirection);
}
currMinWidth += w;
« no previous file with comments | « Source/core/layout/LayoutText.h ('k') | Source/core/layout/line/BreakingContextInlineHeaders.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698