-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WebKit export: Convert new scrollbar-gutter-root* tests from LayoutTe…
…sts to wpts https://bugs.webkit.org/show_bug.cgi?id=278568
- Loading branch information
Showing
4 changed files
with
173 additions
and
0 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
css/css-overflow/scrollbar-gutter-root-both-edges-ref.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,50 @@ | ||
<!doctype html> | ||
<meta charset="utf-8"> | ||
<title>CSS Overflow: scrollbar-gutter on the root element</title> | ||
<link rel="help" href="https://drafts.csswg.org/css-overflow-4/#scrollbar-gutter-property"> | ||
|
||
<style> | ||
html { | ||
background-color: blue; | ||
margin: 10px; | ||
padding: 10px; | ||
border: 5px solid black; | ||
} | ||
|
||
body { | ||
margin: 10px; | ||
padding: 10px; | ||
border: 5px solid green; | ||
} | ||
|
||
#abspos { | ||
position:absolute; | ||
top: 150px; | ||
left: 15px; | ||
background-color: green; | ||
width: 80px; | ||
height: 100px; | ||
transform: translateZ(0); | ||
} | ||
|
||
p { | ||
background-color: purple; | ||
color: white; | ||
} | ||
</style> | ||
|
||
<div id="outer" style="width: 100px; height: 100px; overflow: scroll; left: -200px; position: absolute;"> | ||
<div id="inner" style="width: 100%; height: 200%;"></div> | ||
</div> | ||
|
||
<script> | ||
var outer = document.getElementById("outer"); | ||
var inner = document.getElementById("inner"); | ||
// Compute scrollbar gutter size and add it as margin to the root element | ||
var scrollbarWidthPlusMargin = String((outer.offsetWidth - inner.offsetWidth) + 10) + "px"; | ||
document.documentElement.style.marginRight = scrollbarWidthPlusMargin; | ||
document.documentElement.style.marginLeft = scrollbarWidthPlusMargin; | ||
</script> | ||
|
||
<p id="content">Should not have space around me in the inline axis.</p> | ||
<div id="abspos"></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,38 @@ | ||
<!doctype html> | ||
<meta charset="utf-8"> | ||
<title>CSS Overflow: scrollbar-gutter on the root element</title> | ||
<link rel="help" href="https://drafts.csswg.org/css-overflow-4/#scrollbar-gutter-property"> | ||
<link rel="match" href="scrollbar-gutter-root-both-edges-ref.html"> | ||
|
||
<style> | ||
body,html { | ||
background-color: blue; | ||
margin: 10px; | ||
padding: 10px; | ||
border: 5px solid black; | ||
} | ||
|
||
body{ | ||
border: 5px solid green; | ||
} | ||
|
||
|
||
:root { | ||
scrollbar-gutter: stable both-edges; | ||
} | ||
p { | ||
background-color: purple; | ||
color: white; | ||
} | ||
div { | ||
position:absolute; | ||
left:-20px; | ||
top:150px; | ||
background-color: green; | ||
width: 100px; | ||
height: 100px; | ||
transform: translateZ(0); | ||
} | ||
</style> | ||
<p id="content">Should not have space around me in the inline axis.</p> | ||
<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,47 @@ | ||
<!doctype html> | ||
<meta charset="utf-8"> | ||
<title>CSS Overflow: scrollbar-gutter on the root element</title> | ||
<link rel="help" href="https://drafts.csswg.org/css-overflow-4/#scrollbar-gutter-property"> | ||
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1874093"> | ||
|
||
<style> | ||
html { | ||
background-color: blue; | ||
margin: 10px; | ||
padding: 10px; | ||
border: 5px solid black; | ||
} | ||
|
||
body { | ||
margin: 10px; | ||
padding: 10px; | ||
border: 5px solid green; | ||
} | ||
|
||
#abspos { | ||
position:absolute; | ||
top:150px; | ||
left: 0px; | ||
background-color: green; | ||
width: 80px; | ||
height: 100px; | ||
transform: translateZ(0); | ||
} | ||
|
||
p { | ||
background-color: purple; | ||
color: white; | ||
} | ||
</style> | ||
<div id="outer" style="width: 100px; height: 100px; overflow: scroll; left: -200px; position: absolute;"> | ||
<div id="inner" style="width: 100%; height: 200%;"></div> | ||
</div> | ||
<script> | ||
var outer = document.getElementById("outer"); | ||
var inner = document.getElementById("inner"); | ||
// Compute scrollbar gutter size and add it as margin to the root element | ||
document.documentElement.style.marginRight = String((outer.offsetWidth - inner.offsetWidth) + 10) + "px"; | ||
</script> | ||
|
||
<p id="content">Should not have space around me in the inline axis.</p> | ||
<div id="abspos"> </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,38 @@ | ||
<!doctype html> | ||
<meta charset="utf-8"> | ||
<title>CSS Overflow: scrollbar-gutter on the root element</title> | ||
<link rel="help" href="https://drafts.csswg.org/css-overflow-4/#scrollbar-gutter-property"> | ||
<link rel="match" href="scrollbar-gutter-root-ref.html"> | ||
|
||
<style> | ||
body,html { | ||
background-color: blue; | ||
margin: 10px; | ||
padding: 10px; | ||
border: 5px solid black; | ||
} | ||
|
||
body{ | ||
border: 5px solid green; | ||
} | ||
|
||
|
||
:root { | ||
scrollbar-gutter: stable; | ||
} | ||
p { | ||
background-color: purple; | ||
color: white; | ||
} | ||
div { | ||
position:absolute; | ||
left:-20px; | ||
top:150px; | ||
background-color: green; | ||
width: 100px; | ||
height: 100px; | ||
transform: translateZ(0); | ||
} | ||
</style> | ||
<p id="content">Should not have space around me in the inline axis.</p> | ||
<div></div> |