Changeset 135884 in webkit


Ignore:
Timestamp:
Nov 27, 2012 11:15:04 AM (11 years ago)
Author:
robert@webkit.org
Message:

REGRESSION (r125578): word-wrapping in absolute position with nbsp, word-spacing and custom font
https://bugs.webkit.org/show_bug.cgi?id=101443

Reviewed by David Hyatt.

Source/WebCore:

Leading non-breaking space in a text run should always get word-spacing applied. When RenderText
calculates the preferred with of a run of text it breaks it up into word segments that contain
no breaking spaces and calculates the width of each. So when calculating the width of ' b'
it needs to add word-spacing to the leading non-breaking space as it does not get collapsed away.

Test: fast/text/word-space-nbsp.html

  • platform/graphics/WidthIterator.cpp:

(WebCore::WidthIterator::advanceInternal):

LayoutTests:

  • fast/text/word-space-nbsp-expected.html: Added.
  • fast/text/word-space-nbsp.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r135880 r135884  
     12012-11-27  Robert Hogan  <robert@webkit.org>
     2
     3        REGRESSION (r125578): word-wrapping in absolute position with nbsp, word-spacing and custom font
     4        https://bugs.webkit.org/show_bug.cgi?id=101443
     5
     6        Reviewed by David Hyatt.
     7
     8        * fast/text/word-space-nbsp-expected.html: Added.
     9        * fast/text/word-space-nbsp.html: Added.
     10
    1112012-11-27  Tony Chang  <tony@chromium.org>
    212
  • trunk/Source/WebCore/ChangeLog

    r135883 r135884  
     12012-11-27  Robert Hogan  <robert@webkit.org>
     2
     3        REGRESSION (r125578): word-wrapping in absolute position with nbsp, word-spacing and custom font
     4        https://bugs.webkit.org/show_bug.cgi?id=101443
     5
     6        Reviewed by David Hyatt.
     7
     8        Leading non-breaking space in a text run should always get word-spacing applied. When RenderText
     9        calculates the preferred with of a run of text it breaks it up into word segments that contain
     10        no breaking spaces and calculates the width of each. So when calculating the width of '&nbsp;b'
     11        it needs to add word-spacing to the leading non-breaking space as it does not get collapsed away.
     12
     13        Test: fast/text/word-space-nbsp.html
     14
     15        * platform/graphics/WidthIterator.cpp:
     16        (WebCore::WidthIterator::advanceInternal):
     17
    1182012-11-27  Yong Li  <yoli@rim.com>
    219
  • trunk/Source/WebCore/platform/graphics/WidthIterator.cpp

    r131468 r135884  
    242242                // Account for word spacing.
    243243                // We apply additional space between "words" by adding width to the space character.
    244                 if (treatAsSpace && (character != '\t' || !m_run.allowTabs()) && textIterator.currentCharacter() && m_font->wordSpacing())
     244                if (treatAsSpace && (character != '\t' || !m_run.allowTabs()) && (textIterator.currentCharacter() || character == noBreakSpace) && m_font->wordSpacing())
    245245                    width += m_font->wordSpacing();
    246246            } else
Note: See TracChangeset for help on using the changeset viewer.