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

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

Issue 1194623005: Fix ellipsis width when font has no ellipsis glyph (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: NeedsRebaseline 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 | « LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutBlockFlowLine.cpp
diff --git a/Source/core/layout/LayoutBlockFlowLine.cpp b/Source/core/layout/LayoutBlockFlowLine.cpp
index 4d751b68012c40f64eceab66693b672db1810324..d2f019afb8326c13d52344df1aeed22f5ecdb944 100644
--- a/Source/core/layout/LayoutBlockFlowLine.cpp
+++ b/Source/core/layout/LayoutBlockFlowLine.cpp
@@ -1925,8 +1925,9 @@ void LayoutBlockFlow::checkLinesForTextOverflow()
// Determine the width of the ellipsis using the current font.
const Font& font = style()->font();
+ const size_t fullStopStringLength = 3;
const UChar fullStopString[] = {fullstopCharacter, fullstopCharacter, fullstopCharacter};
- DEFINE_STATIC_LOCAL(AtomicString, fullstopCharacterStr, (fullStopString, 3));
+ DEFINE_STATIC_LOCAL(AtomicString, fullstopCharacterStr, (fullStopString, fullStopStringLength));
DEFINE_STATIC_LOCAL(AtomicString, ellipsisStr, (&horizontalEllipsisCharacter, 1));
AtomicString& selectedEllipsisStr = ellipsisStr;
@@ -1943,7 +1944,7 @@ void LayoutBlockFlow::checkLinesForTextOverflow()
firstLineEllipsisWidth = firstLineFont.width(constructTextRun(this, firstLineFont, &horizontalEllipsisCharacter, 1, *firstLineStyle(), ellipsisDirection));
} else {
selectedEllipsisStr = fullstopCharacterStr;
- firstLineEllipsisWidth = firstLineFont.width(constructTextRun(this, firstLineFont, fullStopString, 1, *firstLineStyle(), ellipsisDirection));
+ firstLineEllipsisWidth = firstLineFont.width(constructTextRun(this, firstLineFont, fullStopString, fullStopStringLength, *firstLineStyle(), ellipsisDirection));
}
ellipsisWidth = (font == firstLineFont) ? firstLineEllipsisWidth : 0;
@@ -1954,7 +1955,7 @@ void LayoutBlockFlow::checkLinesForTextOverflow()
ellipsisWidth = font.width(constructTextRun(this, font, &horizontalEllipsisCharacter, 1, styleRef(), ellipsisDirection));
} else {
selectedEllipsisStr = fullstopCharacterStr;
- ellipsisWidth = font.width(constructTextRun(this, font, fullStopString, 1, styleRef(), ellipsisDirection));
+ ellipsisWidth = font.width(constructTextRun(this, font, fullStopString, fullStopStringLength, styleRef(), ellipsisDirection));
}
}
« no previous file with comments | « LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698