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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 return logicalLeft; 375 return logicalLeft;
376 } 376 }
377 377
378 float InlineFlowBox::placeBoxRangeInInlineDirection(InlineBox* firstChild, Inlin eBox* lastChild, 378 float InlineFlowBox::placeBoxRangeInInlineDirection(InlineBox* firstChild, Inlin eBox* lastChild,
379 float& logicalLeft, float& minLogicalLeft, float& maxLogicalRight, bool& nee dsWordSpacing) 379 float& logicalLeft, float& minLogicalLeft, float& maxLogicalRight, bool& nee dsWordSpacing)
380 { 380 {
381 for (InlineBox* curr = firstChild; curr && curr != lastChild; curr = curr->n extOnLine()) { 381 for (InlineBox* curr = firstChild; curr && curr != lastChild; curr = curr->n extOnLine()) {
382 if (curr->renderer().isText()) { 382 if (curr->renderer().isText()) {
383 InlineTextBox* text = toInlineTextBox(curr); 383 InlineTextBox* text = toInlineTextBox(curr);
384 RenderText& rt = text->renderer(); 384 RenderText& rt = text->renderer();
385 float space = 0;
385 if (rt.textLength()) { 386 if (rt.textLength()) {
386 if (needsWordSpacing && isSpaceOrNewline(rt.characterAt(text->st art()))) 387 if (needsWordSpacing && isSpaceOrNewline(rt.characterAt(text->st art())))
387 logicalLeft += rt.style(isFirstLineStyle())->font().fontDesc ription().wordSpacing(); 388 space = rt.style(isFirstLineStyle())->font().fontDescription ().wordSpacing();
388 needsWordSpacing = !isSpaceOrNewline(rt.characterAt(text->end()) ); 389 needsWordSpacing = !isSpaceOrNewline(rt.characterAt(text->end()) );
389 } 390 }
390 text->setLogicalLeft(logicalLeft); 391 if (isLeftToRightDirection()) {
392 logicalLeft += space;
393 text->setLogicalLeft(logicalLeft);
394 } else {
395 text->setLogicalLeft(logicalLeft);
396 logicalLeft += space;
397 }
391 if (knownToHaveNoOverflow()) 398 if (knownToHaveNoOverflow())
392 minLogicalLeft = std::min(logicalLeft, minLogicalLeft); 399 minLogicalLeft = std::min(logicalLeft, minLogicalLeft);
393 logicalLeft += text->logicalWidth(); 400 logicalLeft += text->logicalWidth();
394 if (knownToHaveNoOverflow()) 401 if (knownToHaveNoOverflow())
395 maxLogicalRight = std::max(logicalLeft, maxLogicalRight); 402 maxLogicalRight = std::max(logicalLeft, maxLogicalRight);
396 } else { 403 } else {
397 if (curr->renderer().isOutOfFlowPositioned()) { 404 if (curr->renderer().isOutOfFlowPositioned()) {
398 if (curr->renderer().parent()->style()->isLeftToRightDirection() ) { 405 if (curr->renderer().parent()->style()->isLeftToRightDirection() ) {
399 curr->setLogicalLeft(logicalLeft); 406 curr->setLogicalLeft(logicalLeft);
400 } else { 407 } else {
(...skipping 1264 matching lines...) Expand 10 before | Expand all | Expand 10 after
1665 ASSERT(child->prevOnLine() == prev); 1672 ASSERT(child->prevOnLine() == prev);
1666 prev = child; 1673 prev = child;
1667 } 1674 }
1668 ASSERT(prev == m_lastChild); 1675 ASSERT(prev == m_lastChild);
1669 #endif 1676 #endif
1670 } 1677 }
1671 1678
1672 #endif 1679 #endif
1673 1680
1674 } // namespace blink 1681 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698