Skip to content

Commit

Permalink
Prevent stretch from producing a negative size
Browse files Browse the repository at this point in the history
Signed-off-by: Oriol Brufau <[email protected]>
  • Loading branch information
Loirooriol authored and servo-wpt-sync committed Oct 22, 2024
1 parent 0979b8b commit 21f7326
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions css/css-sizing/keyword-sizes-on-floated-element.html
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,12 @@
<div class="test max-height stretch" data-expected-height="90">XXXXX XXXXX</div>
</div>

<!-- Stretch sizes can't result in a negative content size -->
<div class="wrapper" style="width: 0px; height: 0px">
<div class="test width min-width max-width stretch" data-expected-width="10"></div>
<div class="test height min-height max-height stretch" data-expected-height="10"></div>
</div>

<!-- Indefinite stretch -->
<div style="width: 100px; max-height: 100px">
<div class="test height stretch indefinite" data-expected-height="30">X X</div>
Expand Down
6 changes: 6 additions & 0 deletions css/css-sizing/keyword-sizes-on-inline-block.html
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,12 @@
<div class="test max-height stretch" data-expected-height="90">XXXXX XXXXX</div>
</div>

<!-- Stretch sizes can't result in a negative content size -->
<div class="wrapper" style="width: 0px; height: 0px">
<div class="test width min-width max-width stretch" data-expected-width="10"></div>
<div class="test height min-height max-height stretch" data-expected-height="10"></div>
</div>

<!-- Indefinite stretch -->
<div class="wrapper" style="width: 100px; max-height: 100px">
<div class="test height stretch indefinite" data-expected-height="30">X X</div>
Expand Down

0 comments on commit 21f7326

Please sign in to comment.