Skip to content

Commit

Permalink
Add tests to test the special layout handling for fit-content, min-co…
Browse files Browse the repository at this point in the history
…ntent and max-content

Differential Revision: https://phabricator.services.mozilla.com/D106995

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1669734
gecko-commit: 7436beab77b18e3efbf66fae2297d5fca512797c
gecko-reviewers: emilio
  • Loading branch information
sefeng211 authored and moz-wptsync-bot committed Mar 16, 2021
1 parent 765c706 commit 4358ece
Show file tree
Hide file tree
Showing 36 changed files with 596 additions and 0 deletions.
15 changes: 15 additions & 0 deletions css/css-sizing/div-auto-margin-bottom-ref.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE HTML>
<title> Ensure bottom takes effect after element is centered </title>
<style>
div {
inset: 0;
background-color: black;
margin: auto;
position: absolute;
block-size: 200px;
inline-size: 100px;
bottom: 10px;
border: 5px solid red;
}
</style>
<div></div>
14 changes: 14 additions & 0 deletions css/css-sizing/div-auto-margin-ref.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE HTML>
<title> Ensure element is centered by auto margin </title>
<style>
div {
inset: 0;
background-color: black;
margin: auto;
position: absolute;
block-size: 200px;
inline-size: 100px;
border: 5px solid red;
}
</style>
<div></div>
15 changes: 15 additions & 0 deletions css/css-sizing/div-auto-margin-top-ref.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE HTML>
<title> Ensure top takes effect after element is centered </title>
<style>
div {
inset: 0;
background-color: black;
margin: auto;
top: 10px;
position: absolute;
block-size: 200px;
inline-size: 100px;
border: 5px solid red;
}
</style>
<div></div>
13 changes: 13 additions & 0 deletions css/css-sizing/div-block-size-ref.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE HTML>
<title> Ensure block size is same as height of inner div </title>
<style>
div {
inset: 0;
background-color: black;
position: absolute;
block-size: 200px;
inline-size: 100px;
border: 5px solid red;
}
</style>
<div></div>
18 changes: 18 additions & 0 deletions css/css-sizing/div-fit-content-auto-margin-bottom.tentative.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE HTML>
<title> Ensure bottom takes effect after element is centered </title>
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/3973">
<link rel="match" href="div-auto-margin-bottom-ref.html">
<style>
#outer {
inset: 0;
background-color: black;
margin: auto;
bottom: 10px;
position: absolute;
block-size: -moz-fit-content;
block-size: fit-content;
inline-size: 100px;
border: 5px solid red;
}
</style>
<div id="outer"><div style="block-size: 200px"></div></div>
18 changes: 18 additions & 0 deletions css/css-sizing/div-fit-content-auto-margin-top.tentative.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE HTML>
<title> Ensure top takes effect after element is centered </title>
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/3973">
<link rel="match" href="div-auto-margin-top-ref.html">
<style>
#outer {
inset: 0;
background-color: black;
margin: auto;
top: 10px;
position: absolute;
block-size: -moz-fit-content;
block-size: fit-content;
inline-size: 100px;
border: 5px solid red;
}
</style>
<div id="outer"><div style="block-size: 200px"></div></div>
17 changes: 17 additions & 0 deletions css/css-sizing/div-fit-content-auto-margin.tentative.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE HTML>
<title> Ensure element is centered by auto margin </title>
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/3973">
<link rel="match" href="div-auto-margin-ref.html">
<style>
#outer {
inset: 0;
background-color: black;
margin: auto;
position: absolute;
block-size: -moz-fit-content;
block-size: fit-content;
inline-size: 100px;
border: 5px solid red;
}
</style>
<div id="outer"><div style="block-size: 200px"></div></div>
16 changes: 16 additions & 0 deletions css/css-sizing/div-fit-content-block-size.tentative.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE HTML>
<title> Ensure block size is same as height of inner div </title>
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/3973">
<link rel="match" href="div-block-size-ref.html">
<style>
#outer {
inset: 0;
background-color: black;
position: absolute;
block-size: -moz-fit-content;
block-size: fit-content;
inline-size: 100px;
border: 5px solid red;
}
</style>
<div id="outer"><div style="block-size: 200px"></div></div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE HTML>
<title> Ensure left takes effect after element is centered for orthogonal writing mode </title>
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/3973">
<link rel="match" href="div-orthogonal-auto-margin-left-ref.html">
<style>
#outer {
inset: 0;
background-color: black;
writing-mode: vertical-rl;
margin: auto;
left: 10px;
position: absolute;
block-size: -moz-fit-content;
block-size: fit-content;
inline-size: 100px;
border: 5px solid red;
}
</style>
<div id="outer"><div style="block-size: 200px"></div></div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE HTML>
<title> Ensure right takes effect after element is centered for orthogonal writing mode </title>
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/3973">
<link rel="match" href="div-orthogonal-auto-margin-right-ref.html">
<style>
#outer {
inset: 0;
background-color: black;
writing-mode: vertical-rl;
margin: auto;
right: 10px;
position: absolute;
block-size: -moz-fit-content;
block-size: fit-content;
inline-size: 100px;
border: 5px solid red;
}
</style>
<div id="outer"><div style="block-size: 200px"></div></div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE HTML>
<title> Ensure element is centered by auto margin for orthogonal writing mode </title>
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/3973">
<link rel="match" href="div-orthogonal-auto-margin-ref.html">
<style>
#outer {
inset: 0;
background-color: black;
writing-mode: vertical-rl;
margin: auto;
position: absolute;
block-size: -moz-fit-content;
block-size: fit-content;
inline-size: 100px;
border: 5px solid red;
}
</style>
<div id="outer"><div style="block-size: 200px"></div></div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE HTML>
<title> Ensure block size is same as height of inner div for orthogonal writing mode </title>
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/3973">
<link rel="match" href="div-orthogonal-block-size-ref.html">
<style>
#outer {
inset: 0;
background-color: black;
position: absolute;
block-size: -moz-fit-content;
block-size: fit-content;
inline-size: 100px;
writing-mode: vertical-rl;
border: 5px solid red;
}
</style>
<div id="outer"><div style="block-size: 200px"></div></div>
17 changes: 17 additions & 0 deletions css/css-sizing/div-max-content-auto-margin-bottom.tentative.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE HTML>
<title> Ensure bottom takes effect after element is centered </title>
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/3973">
<link rel="match" href="div-auto-margin-bottom-ref.html">
<style>
#outer {
inset: 0;
background-color: black;
margin: auto;
position: absolute;
block-size: max-content;
inline-size: 100px;
bottom: 10px;
border: 5px solid red;
}
</style>
<div id="outer"><div style="block-size: 200px;"></div></div>
17 changes: 17 additions & 0 deletions css/css-sizing/div-max-content-auto-margin-top.tentative.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE HTML>
<title> Ensure top takes effect after element is centered </title>
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/3973">
<link rel="match" href="div-auto-margin-top-ref.html">
<style>
#outer {
inset: 0;
background-color: black;
margin: auto;
top: 10px;
position: absolute;
block-size: max-content;
inline-size: 100px;
border: 5px solid red;
}
</style>
<div id="outer"><div style="block-size: 200px"></div></div>
16 changes: 16 additions & 0 deletions css/css-sizing/div-max-content-auto-margin.tentative.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE HTML>
<title> Ensure element is centered by auto margin </title>
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/3973">
<link rel="match" href="div-auto-margin-ref.html">
<style>
#outer {
inset: 0;
background-color: black;
margin: auto;
position: absolute;
block-size: max-content;
inline-size: 100px;
border: 5px solid red;
}
</style>
<div id="outer"><div style="block-size: 200px"></div></div>
15 changes: 15 additions & 0 deletions css/css-sizing/div-max-content-block-size.tentative.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE HTML>
<title> Ensure block size is same as height of inner div </title>
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/3973">
<link rel="match" href="div-block-size-ref.html">
<style>
#outer {
inset: 0;
background-color: black;
position: absolute;
block-size: max-content;
inline-size: 100px;
border: 5px solid red;
}
</style>
<div id="outer"><div style="block-size: 200px;"></div></div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE HTML>
<title> Ensure left takes effect after element is centered for orthogonal writing mode </title>
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/3973">
<link rel="match" href="div-orthogonal-auto-margin-left-ref.html">
<style>
#outer {
inset: 0;
background-color: black;
writing-mode: vertical-rl;
margin: auto;
left: 10px;
position: absolute;
block-size: max-content;
inline-size: 100px;
border: 5px solid red;
}
</style>
<div id="outer"><div style="block-size: 200px;"></div></div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE HTML>
<title> Ensure right takes effect after element is centered for orthogonal writing mode </title>
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/3973">
<link rel="match" href="div-orthogonal-auto-margin-right-ref.html">
<style>
#outer {
inset: 0;
background-color: black;
writing-mode: vertical-rl;
margin: auto;
right: 10px;
position: absolute;
block-size: max-content;
inline-size: 100px;
border: 5px solid red;
}
</style>
<div id="outer"><div style="block-size: 200px;"></div></div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE HTML>
<title> Ensure element is centered by auto margin for orthogonal writing mode </title>
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/3973">
<link rel="match" href="div-orthogonal-auto-margin-ref.html">
<style>
#outer {
inset: 0;
background-color: black;
writing-mode: vertical-rl;
margin: auto;
position: absolute;
block-size: max-content;
inline-size: 100px;
border: 5px solid red;
}
</style>
<div id="outer"><div style="block-size: 200px;"></div></div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE HTML>
<title> Ensure block size is same as height of inner div for orthogonal writing mode </title>
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/3973">
<link rel="match" href="div-orthogonal-block-size-ref.html">
<style>
#outer {
inset: 0;
background-color: black;
writing-mode: vertical-rl;
position: absolute;
block-size: max-content;
inline-size: 100px;
border: 5px solid red;
}
</style>
<div id="outer"><div style="block-size: 200px;"></div></div>
16 changes: 16 additions & 0 deletions css/css-sizing/div-min-content-auto-margin-bottom.tentative.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE HTML>
<title> Ensure bottom takes effect after element is centered </title>
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/3973">
<link rel="match" href="div-auto-margin-bottom-ref.html">
<style>
#outer {
inset: 0;
background-color: black; margin: auto;
bottom: 10px;
position: absolute;
block-size: min-content;
inline-size: 100px;
border: 5px solid red;
}
</style>
<div id="outer"><div style="block-size: 200px;"></div></div>
17 changes: 17 additions & 0 deletions css/css-sizing/div-min-content-auto-margin-top.tentative.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE HTML>
<title> Ensure top takes effect after element is centered </title>
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/3973">
<link rel="match" href="div-auto-margin-top-ref.html">
<style>
#outer {
inset: 0;
background-color: black;
margin: auto;
top: 10px;
position: absolute;
block-size: min-content;
inline-size: 100px;
border: 5px solid red;
}
</style>
<div id="outer"><div style="block-size: 200px;"></div></div>

0 comments on commit 4358ece

Please sign in to comment.