Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions css-flexbox-1/flex-grow-007.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Flexbox Test: flex-grow - less than one</title>
<link rel="author" title="Geoffrey Sneddon" href="mailto:me@gsnedders.com">
<link rel="help" title="7.3.1. The 'flex-grow' property" href="http://www.w3.org/TR/css-flexbox-1/#propdef-flex-grow">
<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
<meta name="flags" content="">
<meta name="assert" content="Test checks that remaining free space is calculated from 'flex-grow' set to positive number less than one.">
<style>
.container {
background: red;
height: 50px;
width: 100px;
}
#test1, #test2 {
display: flex;
width: 190px;
}
#test1 > div, #test2 > div {
background: green;
height: 50px;
}
#test1 > div {
flex-grow: 0.1;
width: 90px;
}
#test2 > div {
flex-grow: 0.05;
width: 45px;
}
</style>
<body>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div class="container">
<div id="test1">
<div></div>
</div>
</div>
<div class="container">
<div id="test2">
<div></div>
<div></div>
</div>
</div>
</body>
45 changes: 45 additions & 0 deletions css-flexbox-1/flex-shrink-008.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Flexbox Test: flex-shrink - less than one</title>
<link rel="author" title="Geoffrey Sneddon" href="mailto:me@gsnedders.com">
<link rel="help" title="7.3.1. The 'flex-shrink' property" href="http://www.w3.org/TR/css-flexbox-1/#propdef-flex-shrink">
<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
<meta name="flags" content="">
<meta name="assert" content="Test checks that remaining free space is calculated from 'flex-shrink' set to positive number less than one.">
<style>
.container {
background: red;
height: 50px;
width: 100px;
}
#test1, #test2 {
display: flex;
width: 50px;
}
#test1 > div, #test2 > div {
background: green;
height: 50px;
}
#test1 > div {
flex-shrink: 0.9;
width: 550px;
}
#test2 > div {
flex-shrink: 0.25;
width: 75px;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've done the maths for this three times and got three different results. (I've gone wrong in different places each time!) From the one time I got what every browser does, can someone else confirm that this doesn't run into (undefined) rounding issues?

}
</style>
<body>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div class="container">
<div id="test1">
<div></div>
</div>
</div>
<div class="container">
<div id="test2">
<div></div>
<div></div>
</div>
</div>
</body>