Bug 226729 - [css-flexbox] Tables inside flexbox do not account for their borders correctly
Summary: [css-flexbox] Tables inside flexbox do not account for their borders correctly
Status: RESOLVED CONFIGURATION CHANGED
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:
 
Reported: 2021-06-07 07:27 PDT by Felipe Erias
Modified: 2024-01-22 15:51 PST (History)
13 users (show)

See Also:


Attachments
Patch (3.68 KB, patch)
2021-06-07 07:47 PDT, Felipe Erias
no flags Details | Formatted Diff | Diff
Patch (8.85 KB, patch)
2021-06-10 22:38 PDT, Felipe Erias
ews-feeder: commit-queue-
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-06-07 07:27:41 PDT
An empty table inside a flexbox tries to follow its overriding logical height. However, in so doing it may fail to account correctly for its border.

This means that the final logical height of the element can be wrong when the border is not empty.

Test case:

imported/w3c/web-platform-tests/css/css-flexbox/table-as-item-inflexible-in-column-1.html
Comment 1 Felipe Erias 2021-06-07 07:47:25 PDT
Created attachment 430745 [details]
Patch
Comment 2 Felipe Erias 2021-06-10 22:38:56 PDT
Created attachment 431181 [details]
Patch
Comment 3 Felipe Erias 2021-06-10 22:46:53 PDT
Updated the title because this turned out to be a more general problem.

When a table's height or width is set though an attribute of the <table> tag, that value will include borders and padding. When it is set through CSS, that will depend on the value of the table's "box-sizing" property.

With the last patch, RenderTable will check for the presence of those attributes in the <table> tag as well as the value of "box-sizing" before deciding how to handle the table's border and padding.

This fixes:
  imported/w3c/web-platform-tests/css/css-flexbox/table-as-item-inflexible-in-row-2.html

I suspect that table-as-item-inflexible-in-column-2.html also fails for a similar reason.
Comment 4 Radar WebKit Bug Importer 2021-06-14 07:28:15 PDT
<rdar://problem/79287201>
Comment 5 Tim Nguyen (:ntim) 2022-04-06 15:52:29 PDT
Comment on attachment 431181 [details]
Patch

Cleaning r? flag, since it does not build, and it is quite old at this point.
Comment 6 Ahmad Saleem 2023-06-17 17:02:43 PDT
Safari Technology Preview 172 is passing both tests:

https://wpt.fyi/results/css/css-flexbox?label=master&label=experimental&aligned=&q=table-as-item-inflexible-in-column

Do we need to track this anymore?
Comment 7 Brent Fulgham 2024-01-22 15:51:35 PST
Closing based on Ahmad's testing.