Bug 221165 - In table with "width:max-content" and percent-width cells, first cell ends up infinitely-wide
Summary: In table with "width:max-content" and percent-width cells, first cell ends up...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tables (show other bugs)
Version: Safari 14
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Cameron McCormack (:heycam)
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-01-29 16:13 PST by Daniel Holbert
Modified: 2021-04-05 17:42 PDT (History)
11 users (show)

See Also:


Attachments
Patch (13.39 KB, patch)
2021-03-28 15:51 PDT, Cameron McCormack (:heycam)
no flags Details | Formatted Diff | Diff
Patch (13.47 KB, patch)
2021-03-28 15:55 PDT, Cameron McCormack (:heycam)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Holbert 2021-01-29 16:13:25 PST
STR:
(1) Load this testcase:
https://jsfiddle.net/dholbert/yafp507j/
or this equivalent data URI:
data:text/html,<table border style="width:max-content"><td style="width:100%25">hi</td><td style="width:100%25">hi</td>

EXPECTED RESULTS:
No infinitely-sized content.

ACTUAL RESULTS:
The first table cell ends up infinitely-sized (or at least absurdly large).

Chrome gives ACTUAL RESULTS as well -- I suspect this is an issue that predates the blink/webkit fork. I filed https://bugs.chromium.org/p/chromium/issues/detail?id=1172498 to track this in Chrome.

Firefox gives EXPECTED RESULTS -- it just renders both cells as being content-sized.
Comment 1 Radar WebKit Bug Importer 2021-02-05 16:14:15 PST
<rdar://problem/74046127>
Comment 2 Cameron McCormack (:heycam) 2021-03-28 15:51:15 PDT
Created attachment 424512 [details]
Patch
Comment 3 Cameron McCormack (:heycam) 2021-03-28 15:55:26 PDT
Created attachment 424513 [details]
Patch
Comment 4 zalan 2021-04-04 19:46:09 PDT
Comment on attachment 424513 [details]
Patch

I am not too fond of the term "keyword" but I don't have a better candidate (unless we start renaming more functions here, but I don't think it's worth it)
Comment 5 Cameron McCormack (:heycam) 2021-04-05 00:20:36 PDT
The spec term for these keywords in css-sizing-3 is "auto box size" keywords, so an alternative could be "computeAutoBoxLogicalWidths", but as you say there'd be a bunch of other renaming you'd want to do to stop using "intrinsic".
Comment 6 EWS 2021-04-05 17:42:13 PDT
Committed r275462: <https://commits.webkit.org/r275462>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 424513 [details].