Changeset 238441 in webkit


Ignore:
Timestamp:
Nov 22, 2018 12:45:48 AM (5 years ago)
Author:
jfernandez@igalia.com
Message:

Tables with vertical-lr writing-mode doesn't apply correctly vertical-align: baseline
https://bugs.webkit.org/show_bug.cgi?id=191881

Reviewed by Manuel Rego Casasnovas.

Source/WebCore:

We should use the font's descent value when wriring-mode flips line flow (vertical-lr).

This change also fixes bug 170175, since Flexbox use the same code to determine the first
line baseline of a flex item.

Test: fast/writing-mode/vertical-align-table-baseline-latin.html

  • rendering/RenderBlockFlow.cpp:

(WebCore::RenderBlockFlow::firstLineBaseline const):

LayoutTests:

Tests to verify that columns of a vertical-lr table vertically aligned by baseline work like
in the case of horizontal tables.
Also added tests to verify flexbox baseline alignment works as expected in vertical-lr mode.

The vertical-align-table-baseline.html test has been rebaselined due to the new behavior.

  • fast/writing-mode/vertical-align-table-baseline-latin-expected.html: Added.
  • fast/writing-mode/vertical-align-table-baseline-latin.html: Added.
  • fast/writing-mode/vertical-align-flex-baseline-expected.html: Added.
  • fast/writing-mode/vertical-align-flex-baseline-html: Added.
  • platform/gtk/fast/writing-mode/vertical-align-table-baseline-expected.txt: Rebaseline.
  • platform/gtk/fast/writing-mode/vertical-align-table-baseline-expected.png: Rebaseline.
  • platform/win/fast/writing-mode/vertical-align-table-baseline-expected.txt: Rebaseline.
  • platform/win/fast/writing-mode/vertical-align-table-baseline-expected.png: Rebaseline.
Location:
trunk
Files:
4 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r238438 r238441  
     12018-11-22  Javier Fernandez  <jfernandez@igalia.com>
     2
     3        Tables with vertical-lr writing-mode doesn't apply correctly vertical-align: baseline
     4        https://bugs.webkit.org/show_bug.cgi?id=191881
     5
     6        Reviewed by Manuel Rego Casasnovas.
     7
     8        Tests to verify that columns of a vertical-lr table vertically aligned by baseline work like
     9        in the case of horizontal tables.
     10        Also added tests to verify flexbox baseline alignment works as expected in vertical-lr mode.
     11
     12        The vertical-align-table-baseline.html test has been rebaselined due to the new behavior.
     13
     14        * fast/writing-mode/vertical-align-table-baseline-latin-expected.html: Added.
     15        * fast/writing-mode/vertical-align-table-baseline-latin.html: Added.
     16        * fast/writing-mode/vertical-align-flex-baseline-expected.html: Added.
     17        * fast/writing-mode/vertical-align-flex-baseline-html: Added.
     18        * platform/gtk/fast/writing-mode/vertical-align-table-baseline-expected.txt: Rebaseline.
     19        * platform/gtk/fast/writing-mode/vertical-align-table-baseline-expected.png: Rebaseline.
     20        * platform/win/fast/writing-mode/vertical-align-table-baseline-expected.txt: Rebaseline.
     21        * platform/win/fast/writing-mode/vertical-align-table-baseline-expected.png: Rebaseline.
     22
    1232018-11-21  Wenson Hsieh  <wenson_hsieh@apple.com>
    224
  • trunk/LayoutTests/platform/gtk/fast/writing-mode/vertical-align-table-baseline-expected.txt

    r221725 r238441  
    77        RenderTableSection {TBODY} at (2,2) size 230x580
    88          RenderTableRow {TR} at (0,2) size 226x580
    9             RenderTableCell {TD} at (2,46) size 226x80 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
    10               RenderText {#text} at (47,-42) size 108x144
    11                 text run at (47,-42) width 144: "\x{7B2C}\x{4E00}\x{6BB5}"
    12                 text run at (102,-42) width 48: "\x{843D}"
     9            RenderTableCell {TD} at (2,14) size 226x80 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
     10              RenderText {#text} at (15,-10) size 108x144
     11                text run at (15,-10) width 144: "\x{7B2C}\x{4E00}\x{6BB5}"
     12                text run at (70,-10) width 48: "\x{843D}"
    1313            RenderTableCell {TD} at (2,195) size 226x384 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=1]
    1414              RenderText {#text} at (4,2) size 218x291
  • trunk/LayoutTests/platform/win/fast/writing-mode/vertical-align-table-baseline-expected.txt

    r195789 r238441  
    77        RenderTableSection {TBODY} at (2,2) size 228x580
    88          RenderTableRow {TR} at (0,2) size 224x580
    9             RenderTableCell {TD} at (2,45) size 224x83 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
    10               RenderText {#text} at (45,-41) size 110x144
    11                 text run at (45,-41) width 144: "\x{7B2C}\x{4E00}\x{6BB5}"
    12                 text run at (100,-41) width 48: "\x{843D}"
     9            RenderTableCell {TD} at (2,14) size 224x83 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
     10              RenderText {#text} at (14,-10) size 110x144
     11                text run at (14,-10) width 144: "\x{7B2C}\x{4E00}\x{6BB5}"
     12                text run at (69,-10) width 48: "\x{843D}"
    1313            RenderTableCell {TD} at (2,196) size 224x383 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=1]
    1414              RenderText {#text} at (2,2) size 220x288
  • trunk/Source/WebCore/ChangeLog

    r238440 r238441  
     12018-11-22  Javier Fernandez  <jfernandez@igalia.com>
     2
     3        Tables with vertical-lr writing-mode doesn't apply correctly vertical-align: baseline
     4        https://bugs.webkit.org/show_bug.cgi?id=191881
     5
     6        Reviewed by Manuel Rego Casasnovas.
     7
     8        We should use the font's descent value when wriring-mode flips line flow (vertical-lr).
     9
     10        This change also fixes bug 170175, since Flexbox use the same code to determine the first
     11        line baseline of a flex item.
     12
     13        Test: fast/writing-mode/vertical-align-table-baseline-latin.html
     14
     15        * rendering/RenderBlockFlow.cpp:
     16        (WebCore::RenderBlockFlow::firstLineBaseline const):
     17
    1182018-11-21  Ryosuke Niwa  <rniwa@webkit.org>
    219
  • trunk/Source/WebCore/rendering/RenderBlockFlow.cpp

    r238359 r238441  
    30143014
    30153015    ASSERT(firstRootBox());
     3016    if (style().isFlippedLinesWritingMode())
     3017        return firstRootBox()->logicalTop() + firstLineStyle().fontMetrics().descent(firstRootBox()->baselineType());
    30163018    return firstRootBox()->logicalTop() + firstLineStyle().fontMetrics().ascent(firstRootBox()->baselineType());
    30173019}
Note: See TracChangeset for help on using the changeset viewer.