Skip to content

Commit

Permalink
Merge r222605 - [REGRESSION] word-spacing property is incorrectly app…
Browse files Browse the repository at this point in the history
…lied

https://bugs.webkit.org/show_bug.cgi?id=142086
<rdar://problem/19985240>

Patch by Fujii Hironori <Hironori.Fujii@sony.com> 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.
  • Loading branch information
fujii authored and carlosgcampos committed Oct 17, 2017
1 parent e11fa84 commit a52de3e
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 8 deletions.
20 changes: 20 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,23 @@
2017-09-27 Fujii Hironori <Hironori.Fujii@sony.com>

[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 Zalan Bujtas <zalan@apple.com>

Deferred image size change makes image-load-on-delay.html flaky.
Expand Down
6 changes: 0 additions & 6 deletions LayoutTests/platform/mac/TestExpectations
Expand Up @@ -1052,12 +1052,6 @@ fast/canvas/canvas-fillRect-gradient-shadow.html [ Pass Failure ]
# 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 ]
Expand Down
Binary file modified LayoutTests/platform/mac/fast/css/word-space-extra-expected.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Expand Up @@ -441,7 +441,7 @@ layer at (0,0) size 785x2404
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
Expand Down
20 changes: 20 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,23 @@
2017-09-27 Fujii Hironori <Hironori.Fujii@sony.com>

[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 <zdobersek@igalia.com>

[Cairo] Remove unnecessary cairo.h includes
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/rendering/RenderBlockLineLayout.cpp
Expand Up @@ -504,7 +504,7 @@ static inline void setLogicalWidthForTextRun(RootInlineBox* lineBox, BidiRun* ru
&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;
Expand Down

0 comments on commit a52de3e

Please sign in to comment.