Skip to content

Commit

Permalink
Bug 1827564 [wpt PR 39488] - Handle min/max sizes in non-replaced pos…
Browse files Browse the repository at this point in the history
…itioned boxes, a=testonly

Automatic update from web-platform-tests
Handle min/max sizes in non-replaced positioned boxes

--

wpt-commits: dca730d002f78ee7b215cadd3b1e625255da8077
wpt-pr: 39488
  • Loading branch information
delan authored and moz-wptsync-bot committed Apr 18, 2023
1 parent 625e5d4 commit 5c94b85
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!doctype html>
<meta charset="utf-8">
<link rel="author" name="Delan Azabani" href="mailto:dazabani@igalia.com">
<p>Test passes if there is a green square containing a smaller black square below.
<div style="width: 2em; height: 2em; background: green;">
<div style="width: 1em; height: 1em; background: black;"></div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!doctype html>
<meta charset="utf-8">
<title>CSS Test: ‘max-width’ and ‘max-height’ affect percentage sizes in descendants</title>
<link rel="author" name="Delan Azabani" href="mailto:dazabani@igalia.com">
<link rel="help" href="https://drafts.csswg.org/css2/#min-max-widths">
<link rel="help" href="https://drafts.csswg.org/css2/#min-max-heights">
<link rel="match" href="absolute-non-replaced-max-001-ref.html">
<meta name="assert" value="This test verifies that when the used ‘width’ and ‘height’ are affected by ‘max-width’ and ‘max-height’, the descendants are laid out with a containing block of the new size, so any percentage sizes are resolved against that new size.">
<p>Test passes if there is a green square containing a smaller black square below.
<div style="position: absolute; width: 4em; height: 4em; max-width: 2em; max-height: 2em; background: green;">
<div style="width: 50%; height: 50%; background: black;"></div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!doctype html>
<meta charset="utf-8">
<title>CSS Test: ‘min-width’ and ‘min-height’ affect percentage sizes in descendants</title>
<link rel="author" name="Delan Azabani" href="mailto:dazabani@igalia.com">
<link rel="help" href="https://drafts.csswg.org/css2/#min-max-widths">
<link rel="help" href="https://drafts.csswg.org/css2/#min-max-heights">
<link rel="match" href="absolute-non-replaced-min-max-001-ref.html">
<meta name="assert" value="This test verifies that when the used ‘width’ and ‘height’ are affected by ‘min-width’ and ‘min-height’, the descendants are laid out with a containing block of the new size, so any percentage sizes are resolved against that new size.">
<p>Test passes if there is a green square below.
<div style="position: absolute; width: 0; height: 0; min-width: 1em; min-height: 1em; background: black;">
<div style="width: 100%; height: 100%; background: green;"></div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!doctype html>
<meta charset="utf-8">
<link rel="author" name="Delan Azabani" href="mailto:dazabani@igalia.com">
<p>Test passes if there is a green square below.
<div style="width: 1em; height: 1em; background: green;"></div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!doctype html>
<meta charset="utf-8">
<title>CSS Test: ‘min-width’ and ‘min-height’ take precedence over ‘max-width’ and ‘max-height’ when contradictory</title>
<link rel="author" name="Delan Azabani" href="mailto:dazabani@igalia.com">
<link rel="help" href="https://drafts.csswg.org/css2/#min-max-widths">
<link rel="help" href="https://drafts.csswg.org/css2/#min-max-heights">
<link rel="match" href="absolute-non-replaced-min-max-001-ref.html">
<meta name="assert" value="This test verifies that when ‘min-width’ is greater than ‘max-width’, or ‘min-height’ is greater than ‘max-height’, the minimums take precedence, because the steps that recalculate sizes and margins for the minimums (step 3) come after the steps for the maximums (step 2).">
<p>Test passes if there is a green square below.
<div style="position: absolute; width: 0; height: 0; min-width: 1em; min-height: 1em; max-width: 0; max-height: 0; background: green;"></div>

0 comments on commit 5c94b85

Please sign in to comment.