summaryrefslogtreecommitdiffstats
path: root/layout/reftests/css-scroll-snap
diff options
context:
space:
mode:
Diffstat (limited to 'layout/reftests/css-scroll-snap')
-rw-r--r--layout/reftests/css-scroll-snap/reftest.list2
-rw-r--r--layout/reftests/css-scroll-snap/scroll-margin-on-anchor-ref.html16
-rw-r--r--layout/reftests/css-scroll-snap/scroll-margin-on-anchor.html29
-rw-r--r--layout/reftests/css-scroll-snap/scroll-padding-on-anchor-ref.html16
-rw-r--r--layout/reftests/css-scroll-snap/scroll-padding-on-anchor.html31
5 files changed, 94 insertions, 0 deletions
diff --git a/layout/reftests/css-scroll-snap/reftest.list b/layout/reftests/css-scroll-snap/reftest.list
new file mode 100644
index 0000000000..8a0082b6d0
--- /dev/null
+++ b/layout/reftests/css-scroll-snap/reftest.list
@@ -0,0 +1,2 @@
+fails-if(useDrawSnapshot) == scroll-margin-on-anchor.html#target scroll-margin-on-anchor-ref.html
+fails-if(useDrawSnapshot) == scroll-padding-on-anchor.html#target scroll-padding-on-anchor-ref.html
diff --git a/layout/reftests/css-scroll-snap/scroll-margin-on-anchor-ref.html b/layout/reftests/css-scroll-snap/scroll-margin-on-anchor-ref.html
new file mode 100644
index 0000000000..f04ccfbbb1
--- /dev/null
+++ b/layout/reftests/css-scroll-snap/scroll-margin-on-anchor-ref.html
@@ -0,0 +1,16 @@
+<style>
+html,body {
+ overflow: hidden;
+ margin: 0px;
+ padding: 0px;
+}
+body {
+ margin-top: 100px;
+}
+#target {
+ background-color: blue;
+ width: 100%;
+ height: 100px;
+}
+</style>
+<div id="target"></div>
diff --git a/layout/reftests/css-scroll-snap/scroll-margin-on-anchor.html b/layout/reftests/css-scroll-snap/scroll-margin-on-anchor.html
new file mode 100644
index 0000000000..9a86be4070
--- /dev/null
+++ b/layout/reftests/css-scroll-snap/scroll-margin-on-anchor.html
@@ -0,0 +1,29 @@
+<!--
+ This reftest is a test case that scroll-margin value is properly handled when
+ navigating an anchor node, id="target" in this case, so the content scrolls
+ to the target element on loading.
+-->
+<style>
+html,body {
+ overflow: hidden;
+ margin: 0px;
+ padding: 0px;
+}
+.spacer {
+ height: 2000px;
+ width: 100%;
+ padding: 0px;
+ margin: 0px;
+}
+#target {
+ background-color: blue;
+ width: 100%;
+ height: 100px;
+ padding: 0px;
+ margin: 0px;
+ scroll-margin: 100px;
+}
+</style>
+<div class="spacer"></div>
+<div id="target"></div>
+<div class="spacer"></div>
diff --git a/layout/reftests/css-scroll-snap/scroll-padding-on-anchor-ref.html b/layout/reftests/css-scroll-snap/scroll-padding-on-anchor-ref.html
new file mode 100644
index 0000000000..845ed4e13c
--- /dev/null
+++ b/layout/reftests/css-scroll-snap/scroll-padding-on-anchor-ref.html
@@ -0,0 +1,16 @@
+<style>
+html,body {
+ overflow: hidden;
+ margin: 0px;
+ padding: 0px;
+}
+body {
+ padding-top: 100px;
+}
+#target {
+ background-color: blue;
+ width: 100%;
+ height: 100px;
+}
+</style>
+<div id="target"></div>
diff --git a/layout/reftests/css-scroll-snap/scroll-padding-on-anchor.html b/layout/reftests/css-scroll-snap/scroll-padding-on-anchor.html
new file mode 100644
index 0000000000..450a0cb0d7
--- /dev/null
+++ b/layout/reftests/css-scroll-snap/scroll-padding-on-anchor.html
@@ -0,0 +1,31 @@
+<!--
+ This reftest is a test case that scroll-padding value is propery handled when
+ navigating an anchor node, id="target" in this case, so the content scrolls
+ to the target element on loading.
+-->
+<style>
+html {
+ overflow: hidden;
+ scroll-padding: 100px;
+}
+body {
+ margin: 0px;
+ padding: 0px;
+}
+.spacer {
+ height: 2000px;
+ width: 100%;
+ padding: 0px;
+ margin: 0px;
+}
+#target {
+ background-color: blue;
+ width: 100%;
+ height: 100px;
+ padding: 0px;
+ margin: 0px;
+}
+</style>
+<div class="spacer"></div>
+<div id="target"></div>
+<div class="spacer"></div>