Skip to content

Commit

Permalink
Part 2 - Fix flex item's stretched cross size with box-sizing:border-…
Browse files Browse the repository at this point in the history
…box when computing flex container's intrinsic inline size.

When the flex item has 'box-sizing:border-box', we should subtract its margin
when computing its stretched cross size.

The testcase is adapted from aspect-ratio-intrinsic-size-008.html, with
"box-sizing:border-box" added to the flex item.

Differential Revision: https://phabricator.services.mozilla.com/D231867

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1936370
gecko-commit: c9a7242c12e360a34bcbcec1824abd9fe8cdc81b
gecko-reviewers: dholbert
  • Loading branch information
aethanyc authored and moz-wptsync-bot committed Dec 13, 2024
1 parent 2c1ac39 commit 7c9bf45
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions css/css-flexbox/aspect-ratio-intrinsic-size-010.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<link rel="author" title="Ting-Yu Lin" href="mailto:[email protected]">
<link rel="author" title="Mozilla" href="https://www.mozilla.org/">
<link rel="help" href="https://drafts.csswg.org/css-flexbox-1/#valdef-align-items-stretch">
<link rel="help" href="https://drafts.csswg.org/css-sizing-3/#intrinsic-sizes">
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1936370">
<link rel="match" href="../reference/ref-filled-green-100px-square-only.html">
<meta name="assert" content="This checks that a flex item with an aspect-ratio transfers its size when it also has stretch alignment.">

<p>Test passes if there is a filled green square.</p>
<div style="display: inline-flex; height: 100px; background: green;">
<div style="box-sizing: border-box; padding: 3px; border: 7px solid green; margin: 10px;
aspect-ratio: 1/1;"></div>
</div>

0 comments on commit 7c9bf45

Please sign in to comment.