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

Unified Diff: Source/core/rendering/RenderBlockLineLayout.cpp

Issue 655073002: Fix trailing space handling for complex text (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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/fast/text/international/complex-text-trailing-space-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderBlockLineLayout.cpp
diff --git a/Source/core/rendering/RenderBlockLineLayout.cpp b/Source/core/rendering/RenderBlockLineLayout.cpp
index 4cd3937e549461039aa480e123f0871bd251c9bf..2f87a417b96e76df5db5049cf565935c66e99818 100644
--- a/Source/core/rendering/RenderBlockLineLayout.cpp
+++ b/Source/core/rendering/RenderBlockLineLayout.cpp
@@ -1167,11 +1167,16 @@ static LayoutUnit getBorderPaddingMargin(RenderBoxModelObject* child, bool endOf
static inline void stripTrailingSpace(float& inlineMax, float& inlineMin, RenderObject* trailingSpaceChild)
{
if (trailingSpaceChild && trailingSpaceChild->isText()) {
+ bool useComplexCodePath = !toRenderText(trailingSpaceChild)->
+ canUseSimpleFontCodePath();
// Collapse away the trailing space at the end of a block.
RenderText* t = toRenderText(trailingSpaceChild);
const UChar space = ' ';
const Font& font = t->style()->font(); // FIXME: This ignores first-line.
- float spaceWidth = font.width(constructTextRun(t, font, &space, 1, t->style(), LTR));
+ TextRun run = constructTextRun(t, font, &space, 1, t->style(), LTR);
+ if (useComplexCodePath)
+ run.setUseComplexCodePath(true);
+ float spaceWidth = font.width(run);
inlineMax -= spaceWidth + font.fontDescription().wordSpacing();
if (inlineMin > inlineMax)
inlineMin = inlineMax;
« no previous file with comments | « LayoutTests/fast/text/international/complex-text-trailing-space-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698