Changeset 148358 in webkit


Ignore:
Timestamp:
Apr 13, 2013 9:38:41 AM (11 years ago)
Author:
Antoine Quint
Message:

Width of last of consecutive tabs may be incorrect with "white-space: pre-wrap"
https://bugs.webkit.org/show_bug.cgi?id=114562

Reviewed by Dan Bernstein.

Source/WebCore:

When we measure the last word of a RenderText, make sure we use the correct x
position taking into account the current accumulated word measurements up to
this character. This is of particular importance in the case of tabs where the
measured width would differ based on the x position.

Test: fast/text/tab-last-word-in-renderer-pre-wrap.html

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::setLogicalWidthForTextRun):

LayoutTests:

  • fast/text/tab-last-word-in-renderer-pre-wrap-expected.html: Added.
  • fast/text/tab-last-word-in-renderer-pre-wrap.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r148310 r148358  
     12013-04-13  Antoine Quint  <graouts@apple.com>
     2
     3        Width of last of consecutive tabs may be incorrect with "white-space: pre-wrap"
     4        https://bugs.webkit.org/show_bug.cgi?id=114562
     5
     6        Reviewed by Dan Bernstein.
     7
     8        * fast/text/tab-last-word-in-renderer-pre-wrap-expected.html: Added.
     9        * fast/text/tab-last-word-in-renderer-pre-wrap.html: Added.
     10
    1112013-04-12  Alexey Proskuryakov  <ap@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r148357 r148358  
     12013-04-13  Antoine Quint  <graouts@apple.com>
     2
     3        Width of last of consecutive tabs may be incorrect with "white-space: pre-wrap"
     4        https://bugs.webkit.org/show_bug.cgi?id=114562
     5
     6        Reviewed by Dan Bernstein.
     7
     8        When we measure the last word of a RenderText, make sure we use the correct x
     9        position taking into account the current accumulated word measurements up to
     10        this character. This is of particular importance in the case of tabs where the
     11        measured width would differ based on the x position.
     12
     13        Test: fast/text/tab-last-word-in-renderer-pre-wrap.html
     14
     15        * rendering/RenderBlockLineLayout.cpp:
     16        (WebCore::setLogicalWidthForTextRun):
     17
    1182013-04-13  Mark Salisbury  <mark.salisbury@hp.com>
    219
  • trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp

    r148223 r148358  
    865865            if (kerningIsEnabled && lastEndOffset == run->m_stop) {
    866866                int wordLength = lastEndOffset - wordMeasurement.startOffset;
    867                 measuredWidth += renderer->width(wordMeasurement.startOffset, wordLength, xPos, lineInfo.isFirstLine());
     867                measuredWidth += renderer->width(wordMeasurement.startOffset, wordLength, xPos + measuredWidth, lineInfo.isFirstLine());
    868868                if (i > 0 && wordLength == 1 && renderer->characterAt(wordMeasurement.startOffset) == ' ')
    869869                    measuredWidth += renderer->style()->wordSpacing();
Note: See TracChangeset for help on using the changeset viewer.