Bug 191365 - [css-grid] [css-flex] Width of table as grid/flex item is infinite when the sum of columns' width exceed 100%
Summary: [css-grid] [css-flex] Width of table as grid/flex item is infinite when the s...
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: Sergio Villar Senin
URL:
Keywords: InRadar
: 210103 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-11-07 08:39 PST by Javier Fernandez
Modified: 2020-05-21 07:46 PDT (History)
17 users (show)

See Also:


Attachments
Test case to reproduce the issue (371 bytes, text/html)
2018-11-07 08:39 PST, Javier Fernandez
no flags Details
Patch (5.62 KB, patch)
2020-05-21 07:14 PDT, Sergio Villar Senin
no flags Details | Formatted Diff | Diff
Patch (5.78 KB, patch)
2020-05-21 07:19 PDT, Sergio Villar Senin
rego: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Javier Fernandez 2018-11-07 08:39:29 PST
Created attachment 354094 [details]
Test case to reproduce the issue

Steps to reproduce the problem:
1. Load the attached test case

What is the expected behavior?
The width of the columns (yellow and green boxes) should be just 1ch  

What went wrong?
The width of the columns are 999969 px.
Comment 1 Sergio Villar Senin 2020-05-21 07:14:55 PDT
Created attachment 399952 [details]
Patch
Comment 2 Sergio Villar Senin 2020-05-21 07:18:39 PDT
*** Bug 210103 has been marked as a duplicate of this bug. ***
Comment 3 Sergio Villar Senin 2020-05-21 07:19:05 PDT
Created attachment 399953 [details]
Patch

Improved ChangeLog
Comment 4 Manuel Rego Casasnovas 2020-05-21 07:28:54 PDT
Comment on attachment 399953 [details]
Patch

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

r+

> Source/WebCore/ChangeLog:3
> +        [css-grid] width of table in a grid is incorrect when table cell has width:100%

This is also for flexbox, so please reword the title adding [css-flex] and mentioning flexbox too.

> Source/WebCore/rendering/AutoTableLayout.cpp:201
> +        // The max logical width of a table may be "infinity" (or tableMaxWidth, to
> +        // be more exact) if the sum of the columns' percentages is 100% or more,
> +        // AND there is at least one column that has a non-percentage-based positive
> +        // logical width. In such situations no table logical width will be large
> +        // enough to satisfy the constraint set by the contents. So the idea is to
> +        // use ~infinity to make sure we use all available size in the containing
> +        // block. However, this just doesn't work if this is a flex or grid item, so
> +        // disallow scaling in that case.

Nit: You don't need to wrap comments to 80 chars in WebKit.
Comment 5 Sergio Villar Senin 2020-05-21 07:37:04 PDT
Comment on attachment 399953 [details]
Patch

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

Thanks!

>> Source/WebCore/ChangeLog:3
>> +        [css-grid] width of table in a grid is incorrect when table cell has width:100%
> 
> This is also for flexbox, so please reword the title adding [css-flex] and mentioning flexbox too.

Hmmm the bug was about grid and I marked the flex one as duplicate. I guess I could reword the title in the bug and the update this.

>> Source/WebCore/rendering/AutoTableLayout.cpp:201
>> +        // disallow scaling in that case.
> 
> Nit: You don't need to wrap comments to 80 chars in WebKit.

Yeah, it was the editor that formatted it like that. I'll expand it a bit.
Comment 6 Sergio Villar Senin 2020-05-21 07:45:25 PDT
Committed r261996: <https://trac.webkit.org/changeset/261996>
Comment 7 Radar WebKit Bug Importer 2020-05-21 07:46:16 PDT
<rdar://problem/63493063>