Skip to content

Commit

Permalink
[css-sizing-3] Add tests for percentage resolution (#5280)
Browse files Browse the repository at this point in the history
This just tests that percentages don't resolve against min-content,
which should be indefinite.
  • Loading branch information
gsnedders authored and foolip committed Nov 22, 2019
1 parent b2acffa commit 86097c0
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
16 changes: 16 additions & 0 deletions css/css-sizing/percentage-resolution-001-ref.html
@@ -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>
26 changes: 26 additions & 0 deletions css/css-sizing/percentage-resolution-001.html
@@ -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>

2 comments on commit 86097c0

@mstensho
Copy link
Contributor

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?

@foolip
Copy link
Member

@foolip foolip commented on 86097c0 Nov 28, 2019

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.

Please sign in to comment.