Title: [222605] trunk
Revision
222605
Author
[email protected]
Date
2017-09-27 23:57:08 -0700 (Wed, 27 Sep 2017)

Log Message

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

Patch by Fujii Hironori <[email protected]> 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.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (222604 => 222605)


--- trunk/LayoutTests/ChangeLog	2017-09-28 06:18:21 UTC (rev 222604)
+++ trunk/LayoutTests/ChangeLog	2017-09-28 06:57:08 UTC (rev 222605)
@@ -1,3 +1,23 @@
+2017-09-27  Fujii Hironori  <[email protected]>
+
+        [REGRESSION] word-spacing property is incorrectly applied
+        https://bugs.webkit.org/show_bug.cgi?id=142086
+        <rdar://problem/19985240>
+
+        Reviewed by Zalan Bujtas.
+
+        * 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.
+
 2017-09-27  Wenson Hsieh  <[email protected]>
 
         Drag event DataTransfer has unexpected types "dyn.ah62d4..."

Modified: trunk/LayoutTests/platform/gtk/TestExpectations (222604 => 222605)


--- trunk/LayoutTests/platform/gtk/TestExpectations	2017-09-28 06:18:21 UTC (rev 222604)
+++ trunk/LayoutTests/platform/gtk/TestExpectations	2017-09-28 06:57:08 UTC (rev 222605)
@@ -3438,7 +3438,6 @@
 webkit.org/b/177363 imported/w3c/web-platform-tests/css/css-ui-3/text-overflow-022.html [ ImageOnlyFailure ]
 
 webkit.org/b/177364 fast/text/international/iso-8859-8.html [ Failure ]
-webkit.org/b/177364 fast/text/word-space-between-inlines.html [ ImageOnlyFailure ]
 
 webkit.org/b/175661 inspector/worker/resources-in-worker.html [ Failure ]
 

Modified: trunk/LayoutTests/platform/gtk/fast/css/word-space-extra-expected.txt (222604 => 222605)


--- trunk/LayoutTests/platform/gtk/fast/css/word-space-extra-expected.txt	2017-09-28 06:18:21 UTC (rev 222604)
+++ trunk/LayoutTests/platform/gtk/fast/css/word-space-extra-expected.txt	2017-09-28 06:57:08 UTC (rev 222605)
@@ -441,7 +441,7 @@
               text run at (369,201) width 144: " elements too"
           RenderText {#text} at (513,198) size 772x35
             text run at (513,198) width 259: ". (with monospace font from"
-            text run at (0,216) width 144: "elements to too) "
+            text run at (0,216) width 164: "elements to too) "
         RenderText {#text} at (0,0) size 0x0
         RenderBR {BR} at (0,0) size 0x0
         RenderBR {BR} at (0,234) size 0x17

Modified: trunk/LayoutTests/platform/mac/TestExpectations (222604 => 222605)


--- trunk/LayoutTests/platform/mac/TestExpectations	2017-09-28 06:18:21 UTC (rev 222604)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2017-09-28 06:57:08 UTC (rev 222605)
@@ -1029,12 +1029,6 @@
 # SVG gradients are not bit-for-bit equivalent through a scale.
 webkit.org/b/142192 svg/transforms/transformed-text-fill-gradient.html [ ImageOnlyFailure ]
 
-# Word-spacing is incorrectly applied
-webkit.org/b/142086 fast/css/word-spacing-between-blocks.html [ ImageOnlyFailure ]
-webkit.org/b/142086 fast/css/word-spacing-between-inlines.html [ ImageOnlyFailure ]
-webkit.org/b/142086 fast/css/word-spacing-characters.html [ ImageOnlyFailure ]
-webkit.org/b/142086 fast/text/word-space-between-inlines.html [ ImageOnlyFailure ]
-
 # Underlines' starting and ending positions need to be pixel-snapped
 webkit.org/b/142087 fast/css3-text/css3-text-decoration/no-gap-between-two-rounded-textboxes.html [ ImageOnlyFailure ]
 webkit.org/b/142087 fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-ink-inherit.html [ ImageOnlyFailure ]

Modified: trunk/LayoutTests/platform/mac/fast/css/word-space-extra-expected.png


(Binary files differ)

Modified: trunk/LayoutTests/platform/mac/fast/css/word-space-extra-expected.txt (222604 => 222605)


--- trunk/LayoutTests/platform/mac/fast/css/word-space-extra-expected.txt	2017-09-28 06:18:21 UTC (rev 222604)
+++ trunk/LayoutTests/platform/mac/fast/css/word-space-extra-expected.txt	2017-09-28 06:57:08 UTC (rev 222605)
@@ -441,7 +441,7 @@
               text run at (371,200) width 142: " elements too"
           RenderText {#text} at (512,198) size 776x36
             text run at (512,198) width 264: ". (with monospace font from"
-            text run at (0,216) width 148: "elements to too) "
+            text run at (0,216) width 168: "elements to too) "
         RenderText {#text} at (0,0) size 0x0
         RenderBR {BR} at (0,0) size 0x0
         RenderBR {BR} at (0,234) size 0x18

Modified: trunk/Source/WebCore/ChangeLog (222604 => 222605)


--- trunk/Source/WebCore/ChangeLog	2017-09-28 06:18:21 UTC (rev 222604)
+++ trunk/Source/WebCore/ChangeLog	2017-09-28 06:57:08 UTC (rev 222605)
@@ -1,3 +1,23 @@
+2017-09-27  Fujii Hironori  <[email protected]>
+
+        [REGRESSION] word-spacing property is incorrectly applied
+        https://bugs.webkit.org/show_bug.cgi?id=142086
+        <rdar://problem/19985240>
+
+        Reviewed by Zalan Bujtas.
+
+        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'.
+
 2017-09-27  Zan Dobersek  <[email protected]>
 
         [Cairo] Remove unnecessary cairo.h includes

Modified: trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp (222604 => 222605)


--- trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp	2017-09-28 06:18:21 UTC (rev 222604)
+++ trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp	2017-09-28 06:57:08 UTC (rev 222605)
@@ -504,7 +504,7 @@
                     &wordMeasurement.fallbackFonts, &overflow);
                 UChar c = renderer.characterAt(wordMeasurement.startOffset);
                 // renderer.width() omits word-spacing value for leading whitespace, so let's just add it back here.
-                if (!atFirstWordMeasurement && (c == ' ' || c == '\t'))
+                if (!atFirstWordMeasurement && FontCascade::treatAsSpace(c))
                     measuredWidth += renderer.style().fontCascade().wordSpacing();
             } else
                 measuredWidth += wordMeasurement.width;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to