In flex layout, a collapsed item should contribute zero main-axis size, but still preserve cross-axis strut behavior.
The strut pre-pass has three tiers to avoid unnecessary work. Each case below exercises exactly one tier.
Container has height:80px (definite).
Strut = 80px with no layout needed.
Container has no explicit height (indefinite cross-size). Strut computed via flex + cross-size, no line-breaker. B is 70px tall so cross-size should be at least 70px.
Multi-line container (flex-wrap:wrap; width:160px).
Full pre-pass needed because line assignments may differ.
D is collapsed on line 2; its strut should preserve the 50px line height.
<div style="display:flex;">
<div style="width:60px; height:40px;">A</div>
<div style="width:60px; height:60px; visibility:collapse;">B</div>
<div style="width:60px; height:40px;">C</div>
</div>
/* Expected in flex layout:
B width = 0, line cross-size keeps B strut (60px). */