Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[css-sizing-3] Add tests for percentage resolution (#5280)
This just tests that percentages don't resolve against min-content, which should be indefinite.
- Loading branch information
Showing
2 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<title>CSS Sizing: Test that percentages don't resolve against min-content</title> | ||
<link rel="author" title="Google Inc." href="https://www.google.com/" /> | ||
|
||
<style> | ||
.inner { | ||
background-color: green; | ||
} | ||
</style> | ||
|
||
<body> | ||
<div class="outer"> | ||
<div class="inner">This should be a single-line green background with no red visible.</div> | ||
</div> | ||
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<title>CSS Sizing: Test that percentages don't resolve against min-content</title> | ||
<link rel="help" href="https://drafts.csswg.org/css-sizing-3/#percentage-sizing" /> | ||
<link rel="author" title="Google Inc." href="https://www.google.com/" /> | ||
<link rel="match" href="percentage-resolution-001-ref.html" /> | ||
|
||
<style> | ||
.outer { | ||
min-height: min-content; | ||
max-height: min-content; | ||
height: 500px; | ||
background-color: red; | ||
} | ||
|
||
.inner { | ||
height: 50%; | ||
background-color: green; | ||
} | ||
</style> | ||
|
||
<body> | ||
<div class="outer"> | ||
<div class="inner">This should be a single-line green background with no red visible.</div> | ||
</div> | ||
</body> |
86097c0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test is invalid.
https://drafts.csswg.org/css-sizing-3/#valdef-width-min-content
"If specified for the inline axis, use the min-content inline size; otherwise compute to auto."
Can you please revert this?
86097c0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mstensho I've sent #20505.