Changeset 222605 in webkit


Ignore:
Timestamp:
Sep 27, 2017 11:57:08 PM (7 years ago)
Author:
commit-queue@webkit.org
Message:

[REGRESSION] word-spacing property is incorrectly applied
https://bugs.webkit.org/show_bug.cgi?id=142086
<rdar://problem/19985240>

Patch by Fujii Hironori <Fujii Hironori> on 2017-09-27
Reviewed by Zalan Bujtas.

Source/WebCore:

word-spacing property isn't applied to text nodes with starting
with '\n' if the kerning enabled. In Bug 165796, only ' ' and '\t'
are treated for word-spacing, but '\n'. It should be treated as
well.

Test: fast/text/word-space-between-inlines.html

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::setLogicalWidthForTextRun): Use
FontCascade::treatAsSpace() instead of checking explicitly by
comparing with ' ' and '\t'.

LayoutTests:

  • platform/gtk/TestExpectations: Unmark

fast/text/word-space-between-inlines.html

  • platform/mac/TestExpectations: Unmark

fast/css/word-spacing-between-blocks.html,
fast/css/word-spacing-between-inlines.html,
fast/css/word-spacing-characters.html and
fast/text/word-space-between-inlines.html.

  • platform/gtk/fast/css/word-space-extra-expected.txt:

Rebaselined.

  • platform/mac/fast/css/word-space-extra-expected.png: Ditto.
  • platform/mac/fast/css/word-space-extra-expected.txt: Ditto.
Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r222595 r222605  
     12017-09-27  Fujii Hironori  <Hironori.Fujii@sony.com>
     2
     3        [REGRESSION] word-spacing property is incorrectly applied
     4        https://bugs.webkit.org/show_bug.cgi?id=142086
     5        <rdar://problem/19985240>
     6
     7        Reviewed by Zalan Bujtas.
     8
     9        * platform/gtk/TestExpectations: Unmark
     10        fast/text/word-space-between-inlines.html
     11        * platform/mac/TestExpectations: Unmark
     12        fast/css/word-spacing-between-blocks.html,
     13        fast/css/word-spacing-between-inlines.html,
     14        fast/css/word-spacing-characters.html and
     15        fast/text/word-space-between-inlines.html.
     16        * platform/gtk/fast/css/word-space-extra-expected.txt:
     17        Rebaselined.
     18        * platform/mac/fast/css/word-space-extra-expected.png: Ditto.
     19        * platform/mac/fast/css/word-space-extra-expected.txt: Ditto.
     20
    1212017-09-27  Wenson Hsieh  <wenson_hsieh@apple.com>
    222
  • trunk/LayoutTests/platform/gtk/TestExpectations

    r222572 r222605  
    34393439
    34403440webkit.org/b/177364 fast/text/international/iso-8859-8.html [ Failure ]
    3441 webkit.org/b/177364 fast/text/word-space-between-inlines.html [ ImageOnlyFailure ]
    34423441
    34433442webkit.org/b/175661 inspector/worker/resources-in-worker.html [ Failure ]
  • trunk/LayoutTests/platform/gtk/fast/css/word-space-extra-expected.txt

    r222078 r222605  
    442442          RenderText {#text} at (513,198) size 772x35
    443443            text run at (513,198) width 259: ". (with monospace font from"
    444             text run at (0,216) width 144: "elements to too) "
     444            text run at (0,216) width 164: "elements to too) "
    445445        RenderText {#text} at (0,0) size 0x0
    446446        RenderBR {BR} at (0,0) size 0x0
  • trunk/LayoutTests/platform/mac/TestExpectations

    r222594 r222605  
    10291029# SVG gradients are not bit-for-bit equivalent through a scale.
    10301030webkit.org/b/142192 svg/transforms/transformed-text-fill-gradient.html [ ImageOnlyFailure ]
    1031 
    1032 # Word-spacing is incorrectly applied
    1033 webkit.org/b/142086 fast/css/word-spacing-between-blocks.html [ ImageOnlyFailure ]
    1034 webkit.org/b/142086 fast/css/word-spacing-between-inlines.html [ ImageOnlyFailure ]
    1035 webkit.org/b/142086 fast/css/word-spacing-characters.html [ ImageOnlyFailure ]
    1036 webkit.org/b/142086 fast/text/word-space-between-inlines.html [ ImageOnlyFailure ]
    10371031
    10381032# Underlines' starting and ending positions need to be pixel-snapped
  • trunk/LayoutTests/platform/mac/fast/css/word-space-extra-expected.txt

    r209910 r222605  
    442442          RenderText {#text} at (512,198) size 776x36
    443443            text run at (512,198) width 264: ". (with monospace font from"
    444             text run at (0,216) width 148: "elements to too) "
     444            text run at (0,216) width 168: "elements to too) "
    445445        RenderText {#text} at (0,0) size 0x0
    446446        RenderBR {BR} at (0,0) size 0x0
  • trunk/Source/WebCore/ChangeLog

    r222604 r222605  
     12017-09-27  Fujii Hironori  <Hironori.Fujii@sony.com>
     2
     3        [REGRESSION] word-spacing property is incorrectly applied
     4        https://bugs.webkit.org/show_bug.cgi?id=142086
     5        <rdar://problem/19985240>
     6
     7        Reviewed by Zalan Bujtas.
     8
     9        word-spacing property isn't applied to text nodes with starting
     10        with '\n' if the kerning enabled. In Bug 165796, only ' ' and '\t'
     11        are treated for word-spacing, but '\n'. It should be treated as
     12        well.
     13
     14        Test: fast/text/word-space-between-inlines.html
     15
     16        * rendering/RenderBlockLineLayout.cpp:
     17        (WebCore::setLogicalWidthForTextRun): Use
     18        FontCascade::treatAsSpace() instead of checking explicitly by
     19        comparing with ' ' and '\t'.
     20
    1212017-09-27  Zan Dobersek  <zdobersek@igalia.com>
    222
  • trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp

    r222575 r222605  
    505505                UChar c = renderer.characterAt(wordMeasurement.startOffset);
    506506                // renderer.width() omits word-spacing value for leading whitespace, so let's just add it back here.
    507                 if (!atFirstWordMeasurement && (c == ' ' || c == '\t'))
     507                if (!atFirstWordMeasurement && FontCascade::treatAsSpace(c))
    508508                    measuredWidth += renderer.style().fontCascade().wordSpacing();
    509509            } else
Note: See TracChangeset for help on using the changeset viewer.