Bug 253928

Summary: Table flex-item inside inline-flex with column flex-direction does not recalculate size when tbody visibility is toggled
Product: WebKit Reporter: decademoon.bugzilla
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED CONFIGURATION CHANGED    
Severity: Normal CC: ahmad.saleem792, bfulgham, dgrogan, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: Safari Technology Preview   
Hardware: Mac (Apple Silicon)   
OS: macOS 13   

decademoon.bugzilla
Reported 2023-03-14 19:46:44 PDT
Consider the following document: <div class="flex-container"> <table> <thead> <tr> <th>col</th> </tr> </thead> <tbody> <tr> <td>the quick brown fox jumps over the lazy dog</td> </tr> </tbody> </table> </div> td { white-space: nowrap; } .flex-container { display: inline-flex; flex-direction: column; } If we toggle the visibility of the <tbody> (or remove the node) then the size of the table is not recalculated. Then, toggling the inline-flex style on the container div will force its size to be recalculated correctly. JsFiddle reproduction: https://jsfiddle.net/no4s7jhb/2/ Steps: 1. Click "toggle" to hide the tbody. Table size stays the same. 2. Click "force layout" and observe that the table size is recalculated. Occurs in Safari Technology Preview 16.4 (and probably earlier). Chrome 110 and Firefox 110 recalculate the table size correctly.
Attachments
alan
Comment 1 2023-03-14 20:23:39 PDT
Thank you for filing this bug. I am able to reproduce this all the way back to August last year (haven't tried anything older yet).
Ahmad Saleem
Comment 2 2023-03-15 11:52:20 PDT
(In reply to zalan from comment #1) > Thank you for filing this bug. I am able to reproduce this all the way back > to August last year (haven't tried anything older yet). Calling something similar to Shrink to Fit here - https://searchfox.org/wubkat/source/Source/WebCore/rendering/RenderFlexibleBox.cpp#626 or More like repainting issue of Table Cell to repaint? Just trying to understand for learning. :-) Able to reproduce on WebKit ToT (261699@main) as well.
Radar WebKit Bug Importer
Comment 3 2023-03-21 19:47:15 PDT
Ahmad Saleem
Comment 4 2025-11-30 01:29:05 PST
I am not able to reproduce this anymore on Safari 26.2 Beta. @Alan - should we close this?
Ahmad Saleem
Comment 5 2025-11-30 01:50:05 PST
I am marking this as `Configuration Changed`, please reopen, if it still reproduces.
Note You need to log in before you can comment on or make changes to this bug.