Skip to content

Commit

Permalink
[layout] block-in-inlines should stretch when justify-self is in use
Browse files Browse the repository at this point in the history
Usually, justify-self causes an element to shrink-to-fit in the absence
of a preferred size. But we have to let an inline child of the justified
element stretch so that any of _its_ block children can still stretch to
the justified grandparent.

Fixed: 374034249
Change-Id: I17b7fa89d84a76eacff2d2e6448db1b7bfe46a32
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5942095
Reviewed-by: David Baron <[email protected]>
Commit-Queue: David Grogan <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1370819}
  • Loading branch information
davidsgrogan authored and chromium-wpt-export-bot committed Oct 18, 2024
1 parent 7139f9d commit 2ab788d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion css/css-align/blocks/justify-self-block-in-inline.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<!DOCTYPE html>
<link rel="help" href="https://drafts.csswg.org/css-align-3/#justify-abspos">
<link rel="help" href="https://drafts.csswg.org/css-align/#justify-self-property">
<link rel="help" href="https://crbug.com/374034249">
<meta name="assert"
content="block-in-inline width is stretched to its parent width, not sized as 'fit-content'" />

Expand All @@ -24,4 +25,13 @@
<span class="inline-block" style="width: 100px;">inline-block</span>
</div>

<div style="width: 100px; justify-self: left;">
<span>
<div class="block-in-inline"
style="height: 100px; background: green;"
data-expected-width="100">
</div>
</span>
</div>

<script>checkLayout('.block-in-inline')</script>

0 comments on commit 2ab788d

Please sign in to comment.