Chromium Code Reviews| Index: Source/core/rendering/InlineTextBox.cpp |
| diff --git a/Source/core/rendering/InlineTextBox.cpp b/Source/core/rendering/InlineTextBox.cpp |
| index 60a35deccf1253ac5df7bbcae293e5ccc1ae2019..f3e27ca8ea094b75ab00e25ccea291434bf5a2e6 100644 |
| --- a/Source/core/rendering/InlineTextBox.cpp |
| +++ b/Source/core/rendering/InlineTextBox.cpp |
| @@ -307,7 +307,7 @@ float InlineTextBox::placeEllipsisBox(bool flowIsLTR, float visibleLeftEdge, flo |
| // If we got here that means that we were only partially truncated and we need to return the pixel offset at which |
| // to place the ellipsis. |
| - float widthOfVisibleText = toRenderText(renderer())->width(m_start, offset, textPos(), isFirstLineStyle()); |
| + float widthOfVisibleText = toRenderText(renderer())->width(m_start, offset, textPos(), flowIsLTR ? LTR : RTL, isFirstLineStyle()); |
|
eseidel
2014/01/07 02:52:57
These width measurements are starting to feel like
|
| // The ellipsis needs to be placed just after the last visible character. |
| // Where "after" is defined by the flow directionality, not the inline |
| @@ -506,7 +506,7 @@ void InlineTextBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset, |
| // farther to the right. |
| // NOTE: WebKit's behavior differs from that of IE which appears to just overlay the ellipsis on top of the |
| // truncated string i.e. |Hello|CBA| -> |...lo|CBA| |
| - LayoutUnit widthOfVisibleText = toRenderText(renderer())->width(m_start, m_truncation, textPos(), isFirstLineStyle()); |
| + LayoutUnit widthOfVisibleText = toRenderText(renderer())->width(m_start, m_truncation, textPos(), isLeftToRightDirection() ? LTR : RTL, isFirstLineStyle()); |
| LayoutUnit widthOfHiddenText = m_logicalWidth - widthOfVisibleText; |
| // FIXME: The hit testing logic also needs to take this translation into account. |
| LayoutSize truncationOffset(isLeftToRightDirection() ? widthOfHiddenText : -widthOfHiddenText, 0); |
| @@ -1064,7 +1064,7 @@ void InlineTextBox::paintDecoration(GraphicsContext* context, const FloatPoint& |
| float width = m_logicalWidth; |
| if (m_truncation != cNoTruncation) { |
| - width = toRenderText(renderer())->width(m_start, m_truncation, textPos(), isFirstLineStyle()); |
| + width = toRenderText(renderer())->width(m_start, m_truncation, textPos(), isLeftToRightDirection() ? LTR : RTL, isFirstLineStyle()); |
| if (!isLeftToRightDirection()) |
| localOrigin.move(m_logicalWidth - width, 0); |
| } |
| @@ -1351,7 +1351,7 @@ void InlineTextBox::paintCompositionUnderline(GraphicsContext* ctx, const FloatP |
| if (paintStart <= underline.startOffset) { |
| paintStart = underline.startOffset; |
| useWholeWidth = false; |
| - start = toRenderText(renderer())->width(m_start, paintStart - m_start, textPos(), isFirstLineStyle()); |
| + start = toRenderText(renderer())->width(m_start, paintStart - m_start, textPos(), isLeftToRightDirection() ? LTR : RTL, isFirstLineStyle()); |
| } |
| if (paintEnd != underline.endOffset) { // end points at the last char, not past it |
| paintEnd = min(paintEnd, (unsigned)underline.endOffset); |
| @@ -1362,7 +1362,7 @@ void InlineTextBox::paintCompositionUnderline(GraphicsContext* ctx, const FloatP |
| useWholeWidth = false; |
| } |
| if (!useWholeWidth) { |
| - width = toRenderText(renderer())->width(paintStart, paintEnd - paintStart, textPos() + start, isFirstLineStyle()); |
| + width = toRenderText(renderer())->width(paintStart, paintEnd - paintStart, textPos() + start, isLeftToRightDirection() ? LTR : RTL, isFirstLineStyle()); |
| } |
| // Thick marked text underlines are 2px thick as long as there is room for the 2px line under the baseline. |