Bug 221165

Summary: In table with "width:max-content" and percent-width cells, first cell ends up infinitely-wide
Product: WebKit Reporter: Daniel Holbert <dholbert>
Component: TablesAssignee: Cameron McCormack (:heycam) <heycam>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, changseok, esprehn+autocc, ews-watchlist, glenn, heycam, kondapallykalyan, pdr, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: Safari 14   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

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].