Changeset 287063 in webkit


Ignore:
Timestamp:
Dec 14, 2021 10:53:53 PM (7 months ago)
Author:
jh718.park@samsung.com
Message:

Fix that height is calculated incorrectly when using display:table, box-sizing:border-box and padding.
https://bugs.webkit.org/show_bug.cgi?id=196175

Reviewed by Darin Adler.

Currently, box sizing type check is missing, so the height of display:table element's percent height child
is subtracted by its border and padding even when its 'box-sizing' is not 'content-box'.

This patch adds the missing box sizing type check.

LayoutTests/imported/w3c:

  • web-platform-tests/css/css-sizing/table-child-percentage-height-with-border-box-expected.html: Added.
  • web-platform-tests/css/css-sizing/table-child-percentage-height-with-border-box.html: Added.

Source/WebCore:

Test: imported/w3c/web-platform-tests/css/css-sizing/table-child-percentage-height-with-border-box.html

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::computePercentageLogicalHeight const):

LayoutTests:

  • platform/gtk/fast/table/003-expected.txt:
  • platform/gtk/tables/mozilla/bugs/bug30692-expected.txt:
  • platform/ios/tables/mozilla/bugs/bug30692-expected.txt:
  • platform/mac-catalina/tables/mozilla/bugs/bug30692-expected.txt:
  • platform/mac-mojave/tables/mozilla/bugs/bug30692-expected.txt:
  • platform/mac/fast/table/003-expected.txt:
  • platform/mac/tables/mozilla/bugs/bug30692-expected.txt:
Location:
trunk
Files:
2 added
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r287055 r287063  
     12021-12-14  Joonghun Park  <jh718.park@samsung.com>
     2
     3        Fix that height is calculated incorrectly when using display:table, box-sizing:border-box and padding.
     4        https://bugs.webkit.org/show_bug.cgi?id=196175
     5
     6        Reviewed by Darin Adler.
     7
     8        Currently, box sizing type check is missing, so the height of display:table element's percent height child
     9        is subtracted by its border and padding even when its 'box-sizing' is not 'content-box'.
     10
     11        This patch adds the missing box sizing type check.
     12
     13        * platform/gtk/fast/table/003-expected.txt:
     14        * platform/gtk/tables/mozilla/bugs/bug30692-expected.txt:
     15        * platform/ios/tables/mozilla/bugs/bug30692-expected.txt:
     16        * platform/mac-catalina/tables/mozilla/bugs/bug30692-expected.txt:
     17        * platform/mac-mojave/tables/mozilla/bugs/bug30692-expected.txt:
     18        * platform/mac/fast/table/003-expected.txt:
     19        * platform/mac/tables/mozilla/bugs/bug30692-expected.txt:
     20
    1212021-12-14  Ryan Haddad  <ryanhaddad@apple.com>
    222
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r287049 r287063  
     12021-12-14  Joonghun Park  <jh718.park@samsung.com>
     2
     3        Fix that height is calculated incorrectly when using display:table, box-sizing:border-box and padding.
     4        https://bugs.webkit.org/show_bug.cgi?id=196175
     5
     6        Reviewed by Darin Adler.
     7
     8        Currently, box sizing type check is missing, so the height of display:table element's percent height child
     9        is subtracted by its border and padding even when its 'box-sizing' is not 'content-box'.
     10
     11        This patch adds the missing box sizing type check.
     12
     13        * web-platform-tests/css/css-sizing/table-child-percentage-height-with-border-box-expected.html: Added.
     14        * web-platform-tests/css/css-sizing/table-child-percentage-height-with-border-box.html: Added.
     15
    1162021-12-14  Alex Christensen  <achristensen@webkit.org>
    217
  • trunk/LayoutTests/platform/gtk/fast/table/003-expected.txt

    r282363 r287063  
    3535                text run at (2,2) width 37: "world"
    3636          RenderTableRow {TR} at (0,74) size 213x46
    37             RenderTableCell {TD} at (2,77) size 209x40 [border: (1px inset #808080)] [r=3 c=0 rs=1 cs=1]
     37            RenderTableCell {TD} at (2,74) size 209x46 [border: (1px inset #808080)] [r=3 c=0 rs=1 cs=1]
    3838              RenderText {#text} at (0,0) size 0x0
    3939      RenderTable {TABLE} at (0,282) size 106x78
     
    7777layer at (58,16) size 728x18
    7878  RenderBlock {DIV} at (3,3) size 728x18
    79 layer at (16,245) size 201x36 clip at (17,246) size 199x34
    80   RenderTextControl {TEXTAREA} at (4,2) size 201x36 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
     79layer at (16,242) size 201x42 clip at (17,243) size 199x40
     80  RenderTextControl {TEXTAREA} at (4,2) size 201x42 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
    8181    RenderBlock {DIV} at (3,3) size 195x18
  • trunk/LayoutTests/platform/gtk/tables/mozilla/bugs/bug30692-expected.txt

    r268545 r287063  
    2121          RenderTableSection {TBODY} at (0,0) size 784x100
    2222            RenderTableRow {TR} at (0,2) size 784x96
    23               RenderTableCell {TD} at (2,14) size 780x72 [bgcolor=#FF0000] [r=0 c=0 rs=1 cs=1]
     23              RenderTableCell {TD} at (2,11) size 780x78 [bgcolor=#FF0000] [r=0 c=0 rs=1 cs=1]
    2424                RenderText {#text} at (0,0) size 0x0
    2525        RenderBlock {HR} at (0,144) size 784x2 [border: (1px inset #000000)]
     
    4545                  RenderText {#text} at (0,0) size 222x17
    4646                    text run at (0,0) width 222: "OK: the height of the P is 80 pixels"
    47 layer at (11,96) size 622x69 clip at (12,97) size 620x67
    48   RenderTextControl {TEXTAREA} at (1,1) size 623x70 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
     47layer at (11,93) size 622x75 clip at (12,94) size 620x73
     48  RenderTextControl {TEXTAREA} at (1,1) size 623x76 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
    4949    RenderBlock {DIV} at (3,3) size 617x18
    5050      RenderText {#text} at (0,0) size 295x17
  • trunk/LayoutTests/platform/ios/tables/mozilla/bugs/bug30692-expected.txt

    r279795 r287063  
    2121          RenderTableSection {TBODY} at (0,0) size 784x100
    2222            RenderTableRow {TR} at (0,2) size 784x96
    23               RenderTableCell {TD} at (2,14) size 780x72 [bgcolor=#FF0000] [r=0 c=0 rs=1 cs=1]
     23              RenderTableCell {TD} at (2,11) size 780x78 [bgcolor=#FF0000] [r=0 c=0 rs=1 cs=1]
    2424                RenderText {#text} at (0,0) size 0x0
    2525        RenderBlock {HR} at (0,146) size 784x2 [border: (1px inset #000000)]
     
    4545                  RenderText {#text} at (0,0) size 226x19
    4646                    text run at (0,0) width 226: "OK: the height of the P is 80 pixels"
    47 layer at (11,102) size 622x69 clip at (12,103) size 620x67
    48   RenderTextControl {TEXTAREA} at (1,1) size 623x70 [bgcolor=#FFFFFF] [border: (1px solid #3C3C4399)]
     47layer at (11,99) size 622x75 clip at (12,100) size 620x73
     48  RenderTextControl {TEXTAREA} at (1,1) size 623x76 [bgcolor=#FFFFFF] [border: (1px solid #3C3C4399)]
    4949    RenderBlock {DIV} at (6,3) size 610x14
    5050      RenderText {#text} at (0,0) size 223x14
  • trunk/LayoutTests/platform/mac-catalina/tables/mozilla/bugs/bug30692-expected.txt

    r268670 r287063  
    2121          RenderTableSection {TBODY} at (0,0) size 784x100
    2222            RenderTableRow {TR} at (0,2) size 784x96
    23               RenderTableCell {TD} at (2,14) size 780x72 [bgcolor=#FF0000] [r=0 c=0 rs=1 cs=1]
     23              RenderTableCell {TD} at (2,11) size 780x78 [bgcolor=#FF0000] [r=0 c=0 rs=1 cs=1]
    2424                RenderText {#text} at (0,0) size 0x0
    2525        RenderBlock {HR} at (0,144) size 784x2 [border: (1px inset #000000)]
     
    4545                  RenderText {#text} at (0,0) size 226x18
    4646                    text run at (0,0) width 226: "OK: the height of the P is 80 pixels"
    47 layer at (11,96) size 622x69 clip at (12,97) size 620x67
    48   RenderTextControl {TEXTAREA} at (1,1) size 623x70 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
     47layer at (11,93) size 622x75 clip at (12,94) size 620x73
     48  RenderTextControl {TEXTAREA} at (1,1) size 623x76 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
    4949    RenderBlock {DIV} at (3,3) size 617x13
    5050      RenderText {#text} at (0,0) size 222x13
  • trunk/LayoutTests/platform/mac-mojave/tables/mozilla/bugs/bug30692-expected.txt

    r268683 r287063  
    2121          RenderTableSection {TBODY} at (0,0) size 784x100
    2222            RenderTableRow {TR} at (0,2) size 784x96
    23               RenderTableCell {TD} at (2,14) size 780x72 [bgcolor=#FF0000] [r=0 c=0 rs=1 cs=1]
     23              RenderTableCell {TD} at (2,11) size 780x78 [bgcolor=#FF0000] [r=0 c=0 rs=1 cs=1]
    2424                RenderText {#text} at (0,0) size 0x0
    2525        RenderBlock {HR} at (0,144) size 784x2 [border: (1px inset #000000)]
     
    4545                  RenderText {#text} at (0,0) size 226x18
    4646                    text run at (0,0) width 226: "OK: the height of the P is 80 pixels"
    47 layer at (11,96) size 622x69 clip at (12,97) size 620x67
    48   RenderTextControl {TEXTAREA} at (1,1) size 623x70 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
     47layer at (11,93) size 622x75 clip at (12,94) size 620x73
     48  RenderTextControl {TEXTAREA} at (1,1) size 623x76 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
    4949    RenderBlock {DIV} at (3,3) size 617x13
    5050      RenderText {#text} at (0,0) size 222x13
  • trunk/LayoutTests/platform/mac/fast/table/003-expected.txt

    r282306 r287063  
    3535                text run at (2,2) width 38: "world"
    3636          RenderTableRow {TR} at (0,74) size 173x40
    37             RenderTableCell {TD} at (2,77) size 169x34 [border: (1px inset #808080)] [r=3 c=0 rs=1 cs=1]
     37            RenderTableCell {TD} at (2,74) size 169x40 [border: (1px inset #808080)] [r=3 c=0 rs=1 cs=1]
    3838              RenderText {#text} at (0,0) size 0x0
    3939      RenderTable {TABLE} at (0,271) size 106x78
     
    7777layer at (69,16) size 717x13
    7878  RenderBlock {DIV} at (3,3) size 718x13
    79 layer at (16,240) size 161x30 clip at (17,241) size 159x28
    80   RenderTextControl {TEXTAREA} at (4,2) size 161x30 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
     79layer at (16,237) size 161x36 clip at (17,238) size 159x34
     80  RenderTextControl {TEXTAREA} at (4,2) size 161x36 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
    8181    RenderBlock {DIV} at (3,3) size 155x13
  • trunk/LayoutTests/platform/mac/tables/mozilla/bugs/bug30692-expected.txt

    r268670 r287063  
    2121          RenderTableSection {TBODY} at (0,0) size 784x100
    2222            RenderTableRow {TR} at (0,2) size 784x96
    23               RenderTableCell {TD} at (2,14) size 780x72 [bgcolor=#FF0000] [r=0 c=0 rs=1 cs=1]
     23              RenderTableCell {TD} at (2,11) size 780x78 [bgcolor=#FF0000] [r=0 c=0 rs=1 cs=1]
    2424                RenderText {#text} at (0,0) size 0x0
    2525        RenderBlock {HR} at (0,144) size 784x2 [border: (1px inset #000000)]
     
    4545                  RenderText {#text} at (0,0) size 226x18
    4646                    text run at (0,0) width 226: "OK: the height of the P is 80 pixels"
    47 layer at (11,96) size 622x69 clip at (12,97) size 620x67
    48   RenderTextControl {TEXTAREA} at (1,1) size 623x70 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
     47layer at (11,93) size 622x75 clip at (12,94) size 620x73
     48  RenderTextControl {TEXTAREA} at (1,1) size 623x76 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
    4949    RenderBlock {DIV} at (3,3) size 617x13
    5050      RenderText {#text} at (0,0) size 223x13
  • trunk/Source/WebCore/ChangeLog

    r287062 r287063  
     12021-12-14  Joonghun Park  <jh718.park@samsung.com>
     2
     3        Fix that height is calculated incorrectly when using display:table, box-sizing:border-box and padding.
     4        https://bugs.webkit.org/show_bug.cgi?id=196175
     5
     6        Reviewed by Darin Adler.
     7
     8        Currently, box sizing type check is missing, so the height of display:table element's percent height child
     9        is subtracted by its border and padding even when its 'box-sizing' is not 'content-box'.
     10
     11        This patch adds the missing box sizing type check.
     12
     13        Test: imported/w3c/web-platform-tests/css/css-sizing/table-child-percentage-height-with-border-box.html
     14
     15        * rendering/RenderBox.cpp:
     16        (WebCore::RenderBox::computePercentageLogicalHeight const):
     17
    1182021-12-14  Alan Bujtas  <zalan@apple.com>
    219
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r287023 r287063  
    33473347    // |availableHeight| (given by |overridingLogicalHeight|) to arrive
    33483348    // at the child's computed height.
    3349     bool subtractBorderAndPadding = isTable() || (is<RenderTableCell>(*cb) && !skippedAutoHeightContainingBlock && cb->hasOverridingLogicalHeight());
     3349    bool subtractBorderAndPadding = isTable() || (is<RenderTableCell>(*cb) && !skippedAutoHeightContainingBlock && cb->hasOverridingLogicalHeight() && style().boxSizing() == BoxSizing::ContentBox);
    33503350    if (subtractBorderAndPadding) {
    33513351        result -= borderAndPaddingLogicalHeight();
Note: See TracChangeset for help on using the changeset viewer.