Changeset 277777 in webkit


Ignore:
Timestamp:
May 20, 2021 1:00:20 AM (14 months ago)
Author:
commit-queue@webkit.org
Message:

[css-flexbox] Wrong height of an empty table inside an orthogonal flex parent
https://bugs.webkit.org/show_bug.cgi?id=225339

Patch by Felipe Erias <Felipe Erias> on 2021-05-20
Reviewed by Sergio Villar Senin.
LayoutTests/imported/w3c:

Add a test for an empty table inside a flexbox container, where the logical heights of both elements
are orthogonal to each other (the table has vertical writing mode and the flexbox uses row direction).

This is a flipped version of table-as-item-specified-height.html.

  • web-platform-tests/css/css-flexbox/table-as-item-specified-width-vertical-expected.html: Added.
  • web-platform-tests/css/css-flexbox/table-as-item-specified-width-vertical.html: Added.

Source/WebCore:

When setting the height of an empty table, give precedence to the overriding value if it has been set.
Do not cache the height of that empty table as the intrinsic content height, because doing so may cause
layout problems (the table is actually empty and may be assigned a different height by its parent).

Test: imported/w3c/web-platform-tests/css/css-flexbox/table-as-item-specified-height.html

imported/w3c/web-platform-tests/css/css-flexbox/table-as-item-specified-width-vertical.html

  • rendering/RenderTable.cpp:

(WebCore::RenderTable::layout):

LayoutTests:

Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r277775 r277777  
     12021-05-20  Felipe Erias  <felipeerias@igalia.com>
     2
     3        [css-flexbox] Wrong height of an empty table inside an orthogonal flex parent
     4        https://bugs.webkit.org/show_bug.cgi?id=225339
     5
     6        Reviewed by Sergio Villar Senin.
     7
     8        * TestExpectations: Remove one WPT test that now passes.
     9
    1102021-05-19  Tomoki Imai  <Tomoki.Imai@sony.com>
    211
  • trunk/LayoutTests/TestExpectations

    r277772 r277777  
    39123912webkit.org/b/221473 imported/w3c/web-platform-tests/css/css-flexbox/table-as-item-inflexible-in-column-2.html [ ImageOnlyFailure ]
    39133913webkit.org/b/221473 imported/w3c/web-platform-tests/css/css-flexbox/table-as-item-inflexible-in-row-2.html [ ImageOnlyFailure ]
    3914 webkit.org/b/221473 imported/w3c/web-platform-tests/css/css-flexbox/table-as-item-specified-height.html [ ImageOnlyFailure ]
    39153914webkit.org/b/221473 imported/w3c/web-platform-tests/css/css-flexbox/table-as-item-min-height-1.html [ ImageOnlyFailure ]
    39163915
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r277767 r277777  
     12021-05-20  Felipe Erias  <felipeerias@igalia.com>
     2
     3        [css-flexbox] Wrong height of an empty table inside an orthogonal flex parent
     4        https://bugs.webkit.org/show_bug.cgi?id=225339
     5
     6        Reviewed by Sergio Villar Senin.
     7       
     8        Add a test for an empty table inside a flexbox container, where the logical heights of both elements
     9        are orthogonal to each other (the table has vertical writing mode and the flexbox uses row direction).
     10       
     11        This is a flipped version of table-as-item-specified-height.html.
     12
     13        * web-platform-tests/css/css-flexbox/table-as-item-specified-width-vertical-expected.html: Added.
     14        * web-platform-tests/css/css-flexbox/table-as-item-specified-width-vertical.html: Added.
     15
    1162021-05-19  Alex Christensen  <achristensen@webkit.org>
    217
  • trunk/Source/WebCore/ChangeLog

    r277776 r277777  
     12021-05-20  Felipe Erias  <felipeerias@igalia.com>
     2
     3        [css-flexbox] Wrong height of an empty table inside an orthogonal flex parent
     4        https://bugs.webkit.org/show_bug.cgi?id=225339
     5
     6        Reviewed by Sergio Villar Senin.
     7       
     8        When setting the height of an empty table, give precedence to the overriding value if it has been set.
     9        Do not cache the height of that empty table as the intrinsic content height, because doing so may cause
     10        layout problems (the table is actually empty and may be assigned a different height by its parent).
     11
     12        Test: imported/w3c/web-platform-tests/css/css-flexbox/table-as-item-specified-height.html
     13              imported/w3c/web-platform-tests/css/css-flexbox/table-as-item-specified-width-vertical.html
     14
     15        * rendering/RenderTable.cpp:
     16        (WebCore::RenderTable::layout):
     17
    1182021-05-19  Jean-Yves Avenard  <jya@apple.com>
    219
  • trunk/Source/WebCore/rendering/RenderTable.cpp

    r277124 r277777  
    434434    LayoutUnit movedSectionLogicalTop;
    435435    unsigned sectionCount = 0;
     436    bool shouldCacheIntrinsicContentLogicalHeightForFlexItem = true;
    436437
    437438    LayoutRepainter repainter(*this, checkForRepaintDuringLayout());
     
    529530
    530531        if (!topSection() && computedLogicalHeight > totalSectionLogicalHeight && !document().inQuirksMode()) {
    531             // Completely empty tables (with no sections or anything) should at least honor specified height
    532             // in strict mode.
    533             setLogicalHeight(logicalHeight() + computedLogicalHeight);
     532            // Completely empty tables (with no sections or anything) should at least honor their
     533            // overriding or specified height in strict mode, but this value will not be cached.
     534            shouldCacheIntrinsicContentLogicalHeightForFlexItem = false;
     535            setLogicalHeight(hasOverridingLogicalHeight() ? overridingLogicalHeight() : logicalHeight() + computedLogicalHeight);
    534536        }
    535537
     
    600602    // FIXME: This value isn't the intrinsic content logical height, but we need
    601603    // to update the value as its used by flexbox layout. crbug.com/367324
    602     cacheIntrinsicContentLogicalHeightForFlexItem(contentLogicalHeight());
    603    
     604    if (shouldCacheIntrinsicContentLogicalHeightForFlexItem)
     605        cacheIntrinsicContentLogicalHeightForFlexItem(contentLogicalHeight());
     606
    604607    m_columnLogicalWidthChanged = false;
    605608    clearNeedsLayout();
Note: See TracChangeset for help on using the changeset viewer.