Skip to content

Commit

Permalink
[layout] Stretch semi-replaced elements when OOF in inline direction.
Browse files Browse the repository at this point in the history
As per: w3c/csswg-drafts#6789

Removes the tests which were previously testing the shrink-to-fit
behaviour, and adds new tests for the stretch behaviour (on more
elements).

Bug: 1274898
Change-Id: I5c40a4b88fe06d7ef79113a66ef3976375d026eb
  • Loading branch information
bfgeek authored and chromium-wpt-export-bot committed Nov 30, 2021
1 parent 9811acc commit 7c403d0
Show file tree
Hide file tree
Showing 8 changed files with 208 additions and 41 deletions.
10 changes: 0 additions & 10 deletions css/css-position/position-absolute-center-005.html

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!DOCTYPE html>
<style>
.cb {
position: relative;
border: 3px solid black;
height: 100px;
width: 150px;
display: inline-block;
vertical-align: top;
margin: 5px;
}
.wide {
width: 350px;
}
.abs {
margin: 0;
position: absolute;
box-sizing: border-box;
top: 3px;
left: 3px;
outline: 2px solid lime;
width: calc(100% - 6px);
height: calc(100% - 6px);
}
</style>
<div class="cb"><button class="abs">button</button></div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!DOCTYPE html>
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/6789">
<link rel="match" href="position-absolute-semi-replaced-stretch-button-ref.html">
<title>Semi-replaced elements should stretch with an auto main size, and explicit insets in that direction.</title>
<style>
.cb {
position: relative;
border: 3px solid black;
height: 100px;
width: 150px;
display: inline-block;
vertical-align: top;
margin: 5px;
}
.wide {
/* Some of the form controls are wider than others
and need a wider CB in order to see if they're
stretching or shrinking. */
width: 350px;
}
.abs {
margin: 0;
position: absolute;
box-sizing: border-box;
top: 3px;
right: 3px;
bottom: 3px;
left: 3px;
outline: 2px solid lime;
width: auto;
height: auto;
}
</style>
<div class="cb"><button class="abs">button</button></div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!DOCTYPE html>
<style>
.cb {
position: relative;
border: 3px solid black;
height: 100px;
width: 150px;
display: inline-block;
vertical-align: top;
margin: 5px;
}
.wide {
width: 350px;
}
.abs {
margin: 0;
position: absolute;
box-sizing: border-box;
top: 3px;
left: 3px;
outline: 2px solid lime;
width: calc(100% - 6px);
height: calc(100% - 6px);
}
</style>
<div class="cb"><input type="button" class="abs" value="input-btn"></div>
<div class="cb"><input type="submit" class="abs"></div>
<div class="cb"><input type="reset" class="abs"></div>
<div class="cb"><input type="color" class="abs"></div>
<div class="cb wide"><input type="text" class="abs" value="text"></div>
<div class="cb wide"><input type="password" class="abs" value="pass"></div>
<div class="cb wide"><input type="date" class="abs" value="text"></div>
<div class="cb wide"><input type="file" class="abs"></div>
<div class="cb wide"><input type="range" class="abs"></div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<!DOCTYPE html>
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/6789">
<link rel="match" href="position-absolute-semi-replaced-stretch-input-ref.html">
<title>Semi-replaced elements should stretch with an auto main size, and explicit insets in that direction.</title>
<style>
.cb {
position: relative;
border: 3px solid black;
height: 100px;
width: 150px;
display: inline-block;
vertical-align: top;
margin: 5px;
}
.wide {
/* Some of the form controls are wider than others
and need a wider CB in order to see if they're
stretching or shrinking. */
width: 350px;
}
.abs {
margin: 0;
position: absolute;
box-sizing: border-box;
top: 3px;
right: 3px;
bottom: 3px;
left: 3px;
outline: 2px solid lime;
width: auto;
height: auto;
}
</style>
<div class="cb"><input type="button" class="abs" value="input-btn"></div>
<div class="cb"><input type="submit" class="abs"></div>
<div class="cb"><input type="reset" class="abs"></div>
<div class="cb"><input type="color" class="abs"></div>
<div class="cb wide"><input type="text" class="abs" value="text"></div>
<div class="cb wide"><input type="password" class="abs" value="pass"></div>
<div class="cb wide"><input type="date" class="abs" value="text"></div>
<div class="cb wide"><input type="file" class="abs"></div>
<div class="cb wide"><input type="range" class="abs"></div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!DOCTYPE html>
<style>
.cb {
position: relative;
border: 3px solid black;
height: 100px;
width: 150px;
display: inline-block;
vertical-align: top;
margin: 5px;
}
.wide {
width: 350px;
}
.abs {
margin: 0;
position: absolute;
box-sizing: border-box;
top: 3px;
left: 3px;
outline: 2px solid lime;
width: calc(100% - 6px);
height: calc(100% - 6px);
}
</style>
<div class="cb"><select class="abs"><option>select</option></select></div>
<div class="cb"><output class="abs">output</output></div>
<div class="cb"><label class="abs">label</output></div>
<div class="cb"><fieldset class="abs">fieldset</fieldset></div>
<div class="cb wide"><textarea class="abs">textarea</textarea></div>
<div class="cb wide"><progress value="0.4" class="abs"></div>
<div class="cb wide"><meter value="0.4" class="abs"></div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!DOCTYPE html>
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/6789">
<link rel="match" href="position-absolute-semi-replaced-stretch-other-ref.html">
<title>Semi-replaced elements should stretch with an auto main size, and explicit insets in that direction.</title>
<style>
.cb {
position: relative;
border: 3px solid black;
height: 100px;
width: 150px;
display: inline-block;
vertical-align: top;
margin: 5px;
}
.wide {
/* Some of the form controls are wider than others
and need a wider CB in order to see if they're
stretching or shrinking. */
width: 350px;
}
.abs {
margin: 0;
position: absolute;
box-sizing: border-box;
top: 3px;
right: 3px;
bottom: 3px;
left: 3px;
outline: 2px solid lime;
width: auto;
height: auto;
}
</style>
<div class="cb"><select class="abs"><option>select</option></select></div>
<div class="cb"><output class="abs">output</output></div>
<div class="cb"><label class="abs">label</output></div>
<div class="cb"><fieldset class="abs">fieldset</fieldset></div>
<div class="cb wide"><textarea class="abs">textarea</textarea></div>
<div class="cb wide"><progress value="0.4" class="abs"></div>
<div class="cb wide"><meter value="0.4" class="abs"></div>
31 changes: 0 additions & 31 deletions html/rendering/widgets/button-layout/abspos.html

This file was deleted.

0 comments on commit 7c403d0

Please sign in to comment.