-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests to test the special layout handling for fit-content, min-co…
…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
1 parent
765c706
commit 4358ece
Showing
36 changed files
with
596 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,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> |
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,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> |
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,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> |
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,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
18
css/css-sizing/div-fit-content-auto-margin-bottom.tentative.html
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,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
18
css/css-sizing/div-fit-content-auto-margin-top.tentative.html
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,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> |
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,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> |
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> | ||
<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> |
19 changes: 19 additions & 0 deletions
19
css/css-sizing/div-fit-content-orthogonal-auto-margin-left.tentative.html
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,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> |
19 changes: 19 additions & 0 deletions
19
css/css-sizing/div-fit-content-orthogonal-auto-margin-right.tentative.html
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,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> |
18 changes: 18 additions & 0 deletions
18
css/css-sizing/div-fit-content-orthogonal-auto-margin.tentative.html
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,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> |
17 changes: 17 additions & 0 deletions
17
css/css-sizing/div-fit-content-orthogonal-block-size.tentative.html
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,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
17
css/css-sizing/div-max-content-auto-margin-bottom.tentative.html
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,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
17
css/css-sizing/div-max-content-auto-margin-top.tentative.html
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,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> |
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> | ||
<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> |
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,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> |
18 changes: 18 additions & 0 deletions
18
css/css-sizing/div-max-content-orthogonal-auto-margin-left.tentative.html
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,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> |
18 changes: 18 additions & 0 deletions
18
css/css-sizing/div-max-content-orthogonal-auto-margin-right.tentative.html
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,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> |
17 changes: 17 additions & 0 deletions
17
css/css-sizing/div-max-content-orthogonal-auto-margin.tentative.html
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,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> |
16 changes: 16 additions & 0 deletions
16
css/css-sizing/div-max-content-orthogonal-block-size.tentative.html
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> | ||
<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
16
css/css-sizing/div-min-content-auto-margin-bottom.tentative.html
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> | ||
<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
17
css/css-sizing/div-min-content-auto-margin-top.tentative.html
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,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> |
Oops, something went wrong.