Bug 224934 - [css-flexbox] Table layout disregards overriding width
Summary: [css-flexbox] Table layout disregards overriding width
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks: 221473
  Show dependency treegraph
 
Reported: 2021-04-22 08:45 PDT by Felipe Erias
Modified: 2021-04-25 14:01 PDT (History)
12 users (show)

See Also:


Attachments
Patch (12.71 KB, patch)
2021-04-22 09:11 PDT, Felipe Erias
no flags Details | Formatted Diff | Diff
Patch (12.51 KB, patch)
2021-04-23 06:21 PDT, Felipe Erias
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Felipe Erias 2021-04-22 08:45:46 PDT
Several WPT tests fail because table layout does not follow the width that has been set by its flex parent.
Comment 1 Felipe Erias 2021-04-22 09:11:54 PDT
Created attachment 426821 [details]
Patch
Comment 2 Sergio Villar Senin 2021-04-22 10:03:04 PDT
Comment on attachment 426821 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=426821&action=review

> Source/WebCore/ChangeLog:18
> +        Give precedence to the element's overriding width if it has been set, instead of discarding it

Super nit: we normally start writing the comment just after the semicolon, so move part of this description to the above line.

> Source/WebCore/ChangeLog:20
> +        (WebCore::RenderTable::computePreferredLogicalWidths):

Ditto.

> Source/WebCore/rendering/AutoTableLayout.cpp:287
> +        if (tableLogicalWidth.isFixed() && tableLogicalWidth.isPositive())

You can now write this in a single line like this:

else if (auto tableLogicalWidth = m_table->style().logicalWidth(); tableLogicalWidth.isFixed() && tableLogicalWidth.isPositive())
Comment 3 Sergio Villar Senin 2021-04-22 10:11:59 PDT
Comment on attachment 426821 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=426821&action=review

> LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-item-contains-strict-expected.txt:24
> +width expected 0 but got 51

You'd have to modify the GTK's specific expectations for this test, otherwise they'll fail in mac platforms
Comment 4 Felipe Erias 2021-04-23 06:21:27 PDT
Created attachment 426901 [details]
Patch
Comment 5 Felipe Erias 2021-04-23 06:22:37 PDT
Thank you very much for your review! I have updated the patch as suggested.
Comment 6 EWS 2021-04-25 14:00:16 PDT
Committed r276572 (237008@main): <https://commits.webkit.org/237008@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 426901 [details].
Comment 7 Radar WebKit Bug Importer 2021-04-25 14:01:16 PDT
<rdar://problem/77127138>