Changeset 261996 in webkit


Ignore:
Timestamp:
May 21, 2020 7:45:18 AM (4 years ago)
Author:
svillar@igalia.com
Message:

Source/WebCore:
[css-grid] [css-flex] Width of table as grid/flex item is infinite when the sum of columns' width exceed 100%
https://bugs.webkit.org/show_bug.cgi?id=191365

Reviewed by Manuel Rego Casasnovas.

Automatic table layout algorithm generates infinite width tables
(tableMaxWidth to be more exact) when the sum of the columns percentages
exceed the 100% value and there is at least one non-percentage based
column with positive width as in those cases it's impossible to fulfill
the table constrains. That should not be done in the case of the table
being a flex or a grid item because they both define new formatting
contexts.

Based on Blink's crrev.com/1095220 by <mstensho@chromium.org>

  • rendering/AutoTableLayout.cpp:

(WebCore::shouldScaleColumnsForParent): return false when the table is
either a grid or a flex item.

LayoutTests:
[css-grid] width of table in a grid is incorrect when table cell has width:100%
https://bugs.webkit.org/show_bug.cgi?id=191365

Reviewed by Manuel Rego Casasnovas.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r261995 r261996  
     12020-05-21  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        [css-grid] width of table in a grid is incorrect when table cell has width:100%
     4        https://bugs.webkit.org/show_bug.cgi?id=191365
     5
     6        Reviewed by Manuel Rego Casasnovas.
     7
     8        * TestExpectations: Unskipped 3 tests that are now passing.
     9
    1102020-05-21  Diego Pino Garcia  <dpino@igalia.com>
    211
  • trunk/LayoutTests/TestExpectations

    r261946 r261996  
    10591059imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-013.html [ Pass Failure ]
    10601060imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-015.html [ Pass Failure ]
    1061 webkit.org/b/191365 imported/w3c/web-platform-tests/css/css-grid/grid-items/item-with-table-with-infinite-max-intrinsic-width.html [ ImageOnlyFailure ]
    1062 webkit.org/b/191365 imported/w3c/web-platform-tests/css/css-grid/grid-items/table-with-infinite-max-intrinsic-width.html [ ImageOnlyFailure ]
    10631061webkit.org/b/191367 imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-ignores-first-letter-002.html [ ImageOnlyFailure ]
    10641062webkit.org/b/191460 imported/w3c/web-platform-tests/css/css-grid/grid-items/anonymous-grid-item-001.html [ Skip ]
     
    42464244webkit.org/b/210093 imported/w3c/web-platform-tests/css/css-flexbox/select-element-zero-height-002.html [ ImageOnlyFailure ]
    42474245webkit.org/b/210102 imported/w3c/web-platform-tests/css/css-flexbox/table-as-item-auto-min-width.html [ ImageOnlyFailure ]
    4248 webkit.org/b/210103 imported/w3c/web-platform-tests/css/css-flexbox/item-with-table-with-infinite-max-intrinsic-width.html [ ImageOnlyFailure ]
    42494246webkit.org/b/210144 imported/w3c/web-platform-tests/css/css-flexbox/anonymous-flex-item-004.html [ ImageOnlyFailure ]
    42504247webkit.org/b/210144 imported/w3c/web-platform-tests/css/css-flexbox/anonymous-flex-item-005.html [ ImageOnlyFailure ]
  • trunk/Source/WebCore/ChangeLog

    r261994 r261996  
     12020-05-21  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        [css-grid] [css-flex] Width of table as grid/flex item is infinite when the sum of columns' width exceed 100%
     4        https://bugs.webkit.org/show_bug.cgi?id=191365
     5
     6        Reviewed by Manuel Rego Casasnovas.
     7
     8        Automatic table layout algorithm generates infinite width tables
     9        (tableMaxWidth to be more exact) when the sum of the columns percentages
     10        exceed the 100% value and there is at least one non-percentage based
     11        column with positive width as in those cases it's impossible to fulfill
     12        the table constrains. That should not be done in the case of the table
     13        being a flex or a grid item because they both define new formatting
     14        contexts.
     15
     16        Based on Blink's crrev.com/1095220 by <mstensho@chromium.org>
     17
     18        * rendering/AutoTableLayout.cpp:
     19        (WebCore::shouldScaleColumnsForParent): return false when the table is
     20        either a grid or a flex item.
     21
    1222020-05-21  Zalan Bujtas  <zalan@apple.com>
    223
  • trunk/Source/WebCore/rendering/AutoTableLayout.cpp

    r238359 r261996  
    2424
    2525#include "RenderChildIterator.h"
     26#include "RenderFlexibleBox.h"
     27#include "RenderGrid.h"
    2628#include "RenderTable.h"
    2729#include "RenderTableCell.h"
     
    190192        if (is<RenderTableCell>(containingBlock))
    191193            return false;
     194        // The max logical width of a table may be "infinity" (or tableMaxWidth, to be more exact) if the sum if the
     195        // columns' percentages is 100% or more, AND there is at least one column that has a non-percentage-based positive
     196        // logical width. In such situations no table logical width will be large enough to satisfy the constraint
     197        // set by the contents. So the idea is to use ~infinity to make sure we use all available size in the containing
     198        // block. However, this just doesn't work if this is a flex or grid item, so disallow scaling in that case.
     199        if (is<RenderFlexibleBox>(containingBlock) || is<RenderGrid>(containingBlock))
     200            return false;
    192201        containingBlock = containingBlock->containingBlock();
    193202    }
Note: See TracChangeset for help on using the changeset viewer.