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

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

Issue 529753002: Word-Spacing in InlineBox RTL scenario not to ignore if first character is space (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: TestExpectations update Created 6 years, 3 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/rendering/InlineFlowBox.cpp
diff --git a/Source/core/rendering/InlineFlowBox.cpp b/Source/core/rendering/InlineFlowBox.cpp
index 34dc81ea42276238da0b6a82aea1a98c5c20290c..2b7c1fd0f15ae785a398b3c43106ed11b87db8ea 100644
--- a/Source/core/rendering/InlineFlowBox.cpp
+++ b/Source/core/rendering/InlineFlowBox.cpp
@@ -382,12 +382,19 @@ float InlineFlowBox::placeBoxRangeInInlineDirection(InlineBox* firstChild, Inlin
if (curr->renderer().isText()) {
InlineTextBox* text = toInlineTextBox(curr);
RenderText& rt = text->renderer();
+ float space = 0;
if (rt.textLength()) {
if (needsWordSpacing && isSpaceOrNewline(rt.characterAt(text->start())))
- logicalLeft += rt.style(isFirstLineStyle())->font().fontDescription().wordSpacing();
+ space = rt.style(isFirstLineStyle())->font().fontDescription().wordSpacing();
needsWordSpacing = !isSpaceOrNewline(rt.characterAt(text->end()));
}
- text->setLogicalLeft(logicalLeft);
+ if (isLeftToRightDirection()) {
+ logicalLeft += space;
+ text->setLogicalLeft(logicalLeft);
+ } else {
+ text->setLogicalLeft(logicalLeft);
+ logicalLeft += space;
+ }
if (knownToHaveNoOverflow())
minLogicalLeft = std::min(logicalLeft, minLogicalLeft);
logicalLeft += text->logicalWidth();

Powered by Google App Engine
This is Rietveld 408576698