Bug 227604

Summary: `flex-basis` behaves unexpectedly with children using `max-height: fit-content;`
Product: WebKit Reporter: Patrick Angle <pangle>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED CONFIGURATION CHANGED    
Severity: Normal CC: ahmad.saleem792, bfulgham, simon.fraser, svillar, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 227605    
Attachments:
Description Flags
Screen Recording of Issue
none
Test Case to Reproduce Issue none

Description Patrick Angle 2021-07-01 17:19:19 PDT
Created attachment 432754 [details]
Screen Recording of Issue

Applying a flex-basis of 100% to a children of a flex container behaves as expected when first applied, but if a media query causes that style to "go away" and come back, the results are different than when the 100% was initially applied. See attached video and reproduction page.

Steps to reproduce:
1. Open the attached reproduction page.
2. Size the window to just taller than 600px (you should see four stacked colorful divs)
3. Check the box to change the flex-basis to `100%` from `inherit`.
4. Reduce the window height until the colorful boxes become boring text.
5. Resize the window back to taller than 600px.
6. Observe that only the yellow div is visible, the others are all 0px tall now, despite having the same style applied as when we started resizing the window.

Reproduces on ToT WebKit. I can not reproduce this prior to r279271, but that issue may simply have been masking this problem.
Comment 1 Patrick Angle 2021-07-01 17:19:49 PDT
Created attachment 432755 [details]
Test Case to Reproduce Issue
Comment 2 Radar WebKit Bug Importer 2021-07-08 17:20:41 PDT
<rdar://problem/80350842>
Comment 3 Ahmad Saleem 2022-10-27 13:54:39 PDT
I am unable to reproduce this bug in Safari 16.1 using attached test case:

1) Open and resize and notice the it changes to "text" when changing height
2) Tick "flex-basis: 100%" and then resize till it becomes text.
3) and then resize and you will notice that all color divs are showing and nothing like video.

It is matching with other browsers (Chrome Canary 109 and Firefox Nightly 108) and does not have any issue of not able to display other colorful divs.

I am going to mark this as "RESOLVED CONFIGURATION CHANGED" (assuming fixed along the way), if it is still reproducible, please share updated test case. Thanks!