ladybird/Tests/LibWeb/Layout/input/flex
Andreas Kling 7867fef8d7 LibWeb: Use correct width for flex item intrinsic height calculation
Before this change, we always used the flex container's full available
space as the width for intrinsic (height) sizing of flex items.

This meant that flex lines with more than one flex item had their
intrinsic height determined as if they were alone on the line.

For flex row layouts, if we've already determined the flex item's main
size, we now use that as the width to get the intrinsic height.

This leads to more correct layouts, and also avoids some redundant work
since we no longer do unnecessary sizing work with the wrong width (and
can hit cache instead).
2025-09-29 13:27:58 +02:00
..
abspos-flex-child-static-position-with-align-items.html LibWeb: Adjust 4 abspos tests to highlight errors 2023-07-08 06:13:56 +02:00
abspos-flex-child-static-position-with-justify-content.html LibWeb: Add tests for justify-*: left/right 2024-09-10 10:40:07 +01:00
abspos-flex-child-static-position-with-padding-on-flex-container.html LibWeb: Don't offset abspos children of flex container by padding twice 2023-10-08 09:06:30 +02:00
abspos-flex-child-with-auto-height.html LibWeb: Handle case where abspos flex child position depends on height 2023-09-03 15:44:47 +02:00
abspos-flex-child-with-percentage-height.html LibWeb: Make FC of containing block responsible for abspos layout 2024-09-12 07:36:32 +02:00
align-center-margin.html LibWeb: Respect margin boxes when center-aligning flex items 2025-03-05 18:07:10 +01:00
align-items-normal.html LibWeb: Make align-items: normal behave like stretch on flex items 2023-08-20 19:37:50 +02:00
align-keywords-start-and-end.html LibWeb: Support start and end alignment values in flex layout 2023-06-06 21:02:04 +02:00
align-self-end-crash.html LibWeb: Don't assert when flex-item has align-self: end 2023-06-20 13:26:41 +02:00
aspect-ratio-and-cyclic-percentages-row.html LibWeb: Honor "should treat as auto" cases in aspect-ratio decisions 2025-08-05 21:33:41 +02:00
aspect-ratio-with-percentage-width-and-height.html LibWeb: Don't let aspect-ratio influence size definiteness 2025-08-05 21:33:41 +02:00
automatic-minimum-size-with-explicit-flex-basis-and-flex-container-with-max-content-main-size.html LibWeb: Fix a case of incorrect flex container max-content main size 2023-06-08 13:54:11 +02:00
box-baseline-with-inline-flex-empty-child.html LibWeb: Only derive baseline from children with a non-empty line box 2023-07-28 17:02:33 +02:00
br-element-does-not-get-blockified-by-itself.html Tests: Add doctypes to remaining test cases 2025-06-21 14:09:47 +02:00
button-layout-inside-flex.html LibWeb: Set fit-content width for buttons in used values, not computed 2025-08-18 11:04:34 +01:00
calc-flex-basis.html LibWeb: Support flex-basis: calc(...) 2023-05-17 07:40:17 +02:00
column-layout-intrinsic-main-size-with-cross-max-size-constraint.html LibWeb: Use correct max-size in intrinsic sizing of column flex layout 2024-01-16 13:14:00 +01:00
columns-33-percent-width.html LibWeb: Forbid using CSS::Length as reference value in resolved() 2024-01-07 09:03:57 +01:00
cross-alignment-when-nested-in-gfc.html LibWeb: Mark width & height of grid item definite before inside layout 2025-08-07 09:34:16 +02:00
cross-size-of-item-with-box-sizing-border-box-and-nonzero-padding.html LibWeb: Fix bug where box-sizing: border-box made flex items too small 2023-04-27 13:57:52 +02:00
flex-basis-intrinsic-sizing-keywords.html LibWeb: Allow flex-basis: {min,max,fit}-content 2024-06-23 19:15:24 +02:00
flex-basis-smaller-than-min-content-size.html LibWeb: Treat percentage max-width as none during min-content sizing 2025-09-28 19:25:18 +02:00
flex-column-container-with-max-width-max-content.html LibWeb: Ignore flex container size constraints during intrinsic sizing 2023-08-01 20:15:20 +02:00
flex-column-item-with-intrinsic-aspect-ratio-and-percentage-max-width.html LibWeb: Fix percentage min/max sizes on flex items with intrinsic ratio 2023-05-10 18:46:04 +02:00
flex-column-item-with-natural-aspect-ratio-and-automatic-cross-size.html LibWeb: Resolve flex item auto cross sizes through aspect ratio 2023-07-05 19:03:20 +02:00
flex-column-item-with-percentage-max-width.html LibWeb: Resolve flex item percentages against used flex container sizes 2023-07-18 06:04:55 +02:00
flex-column-reverse-constrained-wrap.html Meta: Add doctypes to some flex layout tests 2025-05-12 23:15:06 +01:00
flex-constrained-wrap-reverse.html Meta: Add doctypes to some flex layout tests 2025-05-12 23:15:06 +01:00
flex-container-intrinsic-cross-size-with-max-content-main-size.html LibWeb: Allow infinitely long flex lines when sizing under max-content 2023-06-01 15:11:48 +02:00
flex-container-with-definite-width-avoids-float-intrusions.html LibWeb: Avoid floats for BFC/FFC/GFCs with a definite width 2025-08-01 14:26:12 +02:00
flex-container-with-max-width-and-negative-margin-in-same-axis.html LibWeb: Stop changing width of block-level flex containers during layout 2023-05-08 15:56:00 +02:00
flex-container-with-width-auto-avoids-float-intrusions.html LibWeb: Avoid floats for BFC/FFC/GFCs with a definite width 2025-08-01 14:26:12 +02:00
flex-gap-between-items-and-lines.html Meta: Add doctypes to some flex layout tests 2025-05-12 23:15:06 +01:00
flex-item-min-width-fit-content.html LibWeb: Fully resolve min- and max-sizes for flex items 2023-07-17 08:40:15 +02:00
flex-item-on-row-with-intrinsic-size.html Meta: Add doctypes to some flex layout tests 2025-05-12 23:15:06 +01:00
flex-item-percentage-main-size-during-min-content-sizing.html Tests/LibWeb: Move assets used by multiple test types into Assets/ 2024-11-05 14:02:07 +00:00
flex-item-with-calc-main-size-and-layout-dependent-containing-block-size.html LibWeb: Support flex items with calc() main size containing percentages 2023-06-02 17:17:45 +02:00
flex-item-with-intrinsic-aspect-ratio-and-max-height.html LibWeb: Adjust flex item main size through aspect ratio if needed 2023-05-10 13:03:05 +02:00
flex-item-with-percentage-width-in-flex-container-with-definite-max-width.html LibWeb: Don't treat non-replaced sizes as 0 for min-content contrib 2025-07-23 19:52:59 +02:00
flex-optimization-cases.html Meta: Add doctypes to some flex layout tests 2025-05-12 23:15:06 +01:00
flex-row-reverse-constrained-wrap.html Meta: Add doctypes to some flex layout tests 2025-05-12 23:15:06 +01:00
flex-row-reverse-with-centered-content.html LibWeb: Initial offset in reverse flex layout moved to opposite side 2023-05-09 10:32:09 +02:00
flex-shorthand-flex-basis-zero-percent.html LibWeb: Set flex-basis to 0% when omitted from flex shorthand 2023-06-08 10:05:56 +02:00
inf-available-space-with-auto-margins.html LibWeb: Avoid leaking infinite remaining_free_space in FFC calculation 2023-07-26 05:17:56 +02:00
inline-flex-baseline-of-child.html LibWeb: Propagate margin and offset when computing a box's baseline 2024-07-15 21:31:51 +02:00
inline-flex-early-resolution-of-percentage-height.html LibWeb: Don't limit available space during early height for inline-flex 2024-04-13 14:10:10 +02:00
inline-flex-with-main-axis-margin-on-flex-container.html LibWeb: Allow IFC to size inline-flex boxes midway through flex layout 2023-06-19 18:51:00 +02:00
intrinsic-cross-size-contribution-with-main-size-constraint.html Tests/LibWeb: Move assets used by multiple test types into Assets/ 2024-11-05 14:02:07 +00:00
intrinsic-height-of-column-items-with-different-kinds-of-width.html LibWeb: Support more kinds of indefinite widths on flex column items 2023-08-05 10:58:12 +02:00
intrinsic-height-of-flex-container-with-svg-item-that-only-has-natural-aspect-ratio.html LibWeb: Don't let items flex to infinite size in column layout 2023-07-06 09:25:48 +02:00
justify-content-1.html LibWeb: Add tests for justify-*: left/right 2024-09-10 10:40:07 +01:00
justify-content-on-min-content-with-gap.html Meta: Add doctypes to some flex layout tests 2025-05-12 23:15:06 +01:00
justify-content-space-between-single-item.html Meta: Add doctypes to some flex layout tests 2025-05-12 23:15:06 +01:00
justify-content-with-margin-auto-child.html LibWeb: Add tests for justify-*: left/right 2024-09-10 10:40:07 +01:00
list-container-display-contents.html LibWeb: Add support for "display: contents" 2023-07-28 05:29:43 +02:00
multi-line-column-container-with-automatic-height.html LibWeb: Fix multi-line flex column layouts with auto height on container 2023-04-16 21:45:15 +02:00
no-stretch-fit-width-for-item-that-can-resolve-aspect-ratio-through-height.html LibWeb: Fix overeager fallback to stretch-fit width for some flex items 2024-06-23 19:15:24 +02:00
percent-width-contribution-to-min-content-size.html LibWeb: Don't treat non-replaced sizes as 0 for min-content contrib 2025-07-23 19:52:59 +02:00
percentage-flex-basis-with-indefinite-flex-container-size.html LibWeb: Treat unresolvable percentage flex-basis values as 'content' 2023-04-18 10:06:02 +02:00
percentage-flex-basis-with-indefinite-reference-value.html LibWeb: Don't mark heights as definite in set_content_height() 2024-02-21 17:54:05 +01:00
percentage-flex-item-height-with-indefinite-containing-block-height.html LibWeb: Don't mark heights as definite in set_content_height() 2024-02-21 17:54:05 +01:00
relpos-flex-item.html LibWeb: Resolve used insets for flex items 2023-07-04 06:43:53 +02:00
reverse-flex-layout-with-space-between-and-space-around.html LibWeb: Support reverse flex layout with space-around/space-between 2023-05-28 18:02:00 +02:00
reverse-with-justify-content-normal.html LibWeb: Fix reverse flex layout with justify-content: normal 2024-01-08 14:42:19 +01:00
row-item-with-intrinsic-keyword-for-height.html LibWeb: Use correct width for flex item intrinsic height calculation 2025-09-29 13:27:58 +02:00
space-between-with-negative-remaining-space-on-line.html LibWeb: Clamp justification space between flex items to 0 2024-01-25 15:10:21 +01:00
specified-size-suggestion-with-box-sizing-border-box.html LibWeb: Honor box-sizing in flex item "specified size suggestion" 2023-04-17 18:22:53 +02:00
stretch-alignment-with-cross-gap.html LibWeb: Honor gap between flex lines when using align-content: stretch 2023-04-16 20:52:32 +02:00
stretch-fit-width-for-column-layout-svg-item-that-only-has-natural-aspect-ratio.html LibWeb: Stretch-fit flex items with aspect ratio but no fixed sizes 2024-02-25 14:06:06 +01:00
svg-flex-item-with-percentage-max-size.html LibWeb: Treat flex item cross axis max-size as "none" in more cases 2024-01-15 12:55:47 +01:00