Changeset 129068 in webkit


Ignore:
Timestamp:
Sep 19, 2012 4:37:36 PM (12 years ago)
Author:
mitz@apple.com
Message:

When kerning is enabled, word spacing is doubly accounted for in RenderText::computePreferredLogicalWidths
https://bugs.webkit.org/show_bug.cgi?id=97146

Reviewed by Anders Carlsson.

Source/WebCore:

Test: fast/text/word-space-with-kerning.html

  • rendering/RenderText.cpp:

(WebCore::RenderText::computePreferredLogicalWidths): When kerning is enabled, words are
measured with their trailing space, if there is one, then the width of a space is subtracted.
Changed that width, stored in the local variable wordTrailingSpaceWidth, to include the
word spacing, since it is included in the result of widthFromCache().

LayoutTests:

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

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r129067 r129068  
     12012-09-19  Dan Bernstein  <mitz@apple.com>
     2
     3        When kerning is enabled, word spacing is doubly accounted for in RenderText::computePreferredLogicalWidths
     4        https://bugs.webkit.org/show_bug.cgi?id=97146
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * fast/text/word-space-with-kerning-expected.html: Added.
     9        * fast/text/word-space-with-kerning.html: Added.
     10
    1112012-09-19  Dirk Pranke  <dpranke@chromium.org>
    212
  • trunk/Source/WebCore/ChangeLog

    r129066 r129068  
     12012-09-19  Dan Bernstein  <mitz@apple.com>
     2
     3        When kerning is enabled, word spacing is doubly accounted for in RenderText::computePreferredLogicalWidths
     4        https://bugs.webkit.org/show_bug.cgi?id=97146
     5
     6        Reviewed by Anders Carlsson.
     7
     8        Test: fast/text/word-space-with-kerning.html
     9
     10        * rendering/RenderText.cpp:
     11        (WebCore::RenderText::computePreferredLogicalWidths): When kerning is enabled, words are
     12        measured with their trailing space, if there is one, then the width of a space is subtracted.
     13        Changed that width, stored in the local variable wordTrailingSpaceWidth, to include the
     14        word spacing, since it is included in the result of widthFromCache().
     15
    1162012-09-19  Joshua Bell  <jsbell@chromium.org>
    217
  • trunk/Source/WebCore/rendering/RenderText.cpp

    r128693 r129068  
    967967    // Non-zero only when kerning is enabled, in which case we measure words with their trailing
    968968    // space, then subtract its width.
    969     float wordTrailingSpaceWidth = f.typesettingFeatures() & Kerning ? f.width(RenderBlock::constructTextRun(this, f, &space, 1, styleToUse)) : 0;
     969    float wordTrailingSpaceWidth = f.typesettingFeatures() & Kerning ? f.width(RenderBlock::constructTextRun(this, f, &space, 1, styleToUse)) + wordSpacing : 0;
    970970
    971971    // If automatic hyphenation is allowed, we keep track of the width of the widest word (or word
Note: See TracChangeset for help on using the changeset viewer.