Skip to content

Commit

Permalink
[flex] Fix line cross-size calculation with extreme baselines.
Browse files Browse the repository at this point in the history
As pointed out in:
WebKit/WebKit#31376 (comment)

Blink/WebKit were doing something incorrect when a baseline was
outside the border-box of a flex-item.

This was because we were initializing max_major_descent and
max_minor_descent to zero, instead of LayoutUnit::Min(), (similar
to FlexLine::max_major_ascent_ FlexLine::max_minor_ascent_).

This only occurs with a single item in a flex-line.

Change-Id: I4f32eb912a07247d16231451ba63e7c7a75a8b23
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5901280
Commit-Queue: Ian Kilpatrick <[email protected]>
Reviewed-by: David Grogan <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1363827}
  • Loading branch information
bfgeek authored and chromium-wpt-export-bot committed Oct 3, 2024
1 parent 2ef4a5b commit a860f3b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions css/css-flexbox/baseline-outside-flex-item.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<link rel="help" href="https://drafts.csswg.org/css-flexbox-1/#alignment">
<link rel="match" href="../reference/ref-filled-green-100px-square.xht" />
<title>A baseline outside a single flex-item shouldn't affect the size of the flex-line.</title>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div style="display: flex; width: 100px; align-items: baseline; background: red;">
<div style="height: 100px; background: green; min-width: 100px;">
<div style="margin-top: 200px; color: transparent;">baseline</div>
</div>
</div>

0 comments on commit a860f3b

Please sign in to comment.