Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-values-4] Add viewport unit tests for scrollbars #45036

Merged
merged 1 commit into from
Mar 11, 2024
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
33 changes: 33 additions & 0 deletions css/css-values/viewport-units-scrollbars-auto-ltr-001-ref.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!DOCTYPE html>
<title>CSS Values and Units Test: Viewport units and scrollbars</title>
<meta charset="UTF-8">
<link rel="author" title="fantasai" href="http://fantasai.inkedblade.net/contact">


<!-- This reference assumes that a <div> scrollbar looks identical to the root scrollbar. -->
<style>
html, body {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html {
width: 100%;
height: 100%;
overflow: hidden;
}
body {
width: 100%;
height: 100%;
background: white;
overflow: auto;
}
div {
width: 200%;
height: 200%;
border-right: solid blue 4px;
border-bottom: solid blue 4px;
}
</style>

<div></div>
29 changes: 29 additions & 0 deletions css/css-values/viewport-units-scrollbars-auto-vhw-001.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!DOCTYPE html>
<title>CSS Values and Units Test: Viewport units and scrollbars</title>
<meta charset="UTF-8">
<meta name="assert" content="100vw is reduced by scrollbar width when the scrollbars are unconditional">
<link rel="author" title="fantasai" href="http://fantasai.inkedblade.net/contact">
<link rel="help" href="http://www.w3.org/TR/css3-values/#viewport-relative-lengths">

<link rel="match" href="viewport-units-scrollbars-auto-ltr-001-ref.html">

<style>
html, body {
margin: 0;
padding: 0;
width: 100vw;
height: 100vh;
box-sizing: border-box;
}
html {
background: red;
overflow: auto;
width: 200%;
height: 200%;
}
body {
background: white;
border-right: solid blue 4px;
border-bottom: solid blue 4px;
}
</style>
13 changes: 13 additions & 0 deletions css/css-values/viewport-units-scrollbars-scroll-blank-001-ref.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<title>CSS Values and Units Test: Viewport units and scrollbars</title>
<meta charset="UTF-8">
<link rel="author" title="fantasai" href="http://fantasai.inkedblade.net/contact">

<style>
html {
overflow: scroll;
}
body {
background: white;
}
</style>
22 changes: 22 additions & 0 deletions css/css-values/viewport-units-scrollbars-scroll-ltr-001-ref.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!DOCTYPE html>
<title>CSS Values and Units Test: Viewport units and scrollbars</title>
<meta charset="UTF-8">
<link rel="author" title="fantasai" href="http://fantasai.inkedblade.net/contact">

<style>
html, body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
box-sizing: border-box;
}
html {
overflow: scroll;
}
body {
background: white;
border-right: solid green 4px;
border-bottom: solid green 4px;
}
</style>
28 changes: 28 additions & 0 deletions css/css-values/viewport-units-scrollbars-scroll-vhw-001.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!DOCTYPE html>
<title>CSS Values and Units Test: Viewport units and scrollbars</title>
<meta charset="UTF-8">
<meta name="assert" content="100vw is reduced by scrollbar width when the scrollbars are unconditional">
<link rel="author" title="fantasai" href="http://fantasai.inkedblade.net/contact">
<link rel="help" href="http://www.w3.org/TR/css3-values/#viewport-relative-lengths">

<link rel="match" href="viewport-units-scrollbars-scroll-ltr-001-ref.html">

<style>
html, body {
margin: 0;
padding: 0;
width: 100vw;
height: 100vh;
box-sizing: border-box;
}
html {
background: red;
overflow: scroll;
}
body {
background: white;
border-right: solid green 4px;
border-bottom: solid green 4px;
}
</style>