summaryrefslogtreecommitdiffstats
path: root/gfx/layers/apz/test/mochitest/helper_overscroll_behavior_bug1425573.html
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/layers/apz/test/mochitest/helper_overscroll_behavior_bug1425573.html')
-rw-r--r--gfx/layers/apz/test/mochitest/helper_overscroll_behavior_bug1425573.html44
1 files changed, 44 insertions, 0 deletions
diff --git a/gfx/layers/apz/test/mochitest/helper_overscroll_behavior_bug1425573.html b/gfx/layers/apz/test/mochitest/helper_overscroll_behavior_bug1425573.html
new file mode 100644
index 0000000000..817522f9c3
--- /dev/null
+++ b/gfx/layers/apz/test/mochitest/helper_overscroll_behavior_bug1425573.html
@@ -0,0 +1,44 @@
+<head>
+ <meta name="viewport" content="width=device-width; initial-scale=1.0">
+ <title>Wheel-scrolling over inactive subframe with overscroll-behavior</title>
+ <script type="application/javascript" src="apz_test_native_event_utils.js"></script>
+ <script type="application/javascript" src="apz_test_utils.js"></script>
+ <script src="/tests/SimpleTest/paint_listener.js"></script>
+ <script type="application/javascript">
+
+async function test() {
+ var subframe = document.getElementById("scroll");
+
+ // scroll over the middle of the subframe, and make sure that the page
+ // does not scroll.
+ var waitForScroll = false; // don't wait for a scroll event, it will never come
+ await promiseMoveMouseAndScrollWheelOver(subframe, 100, 100, waitForScroll);
+ ok(window.scrollY == 0, "overscroll-behavior was respected");
+}
+
+waitUntilApzStable()
+.then(test)
+.then(subtestDone, subtestFailed);
+
+ </script>
+ <style>
+ #scroll {
+ width: 200px;
+ height: 200px;
+ overflow: scroll;
+ overscroll-behavior: contain;
+ }
+ #scrolled {
+ width: 200px;
+ height: 1000px; /* so the subframe has room to scroll */
+ background: linear-gradient(red, blue); /* so you can see it scroll */
+ }
+ </style>
+</head>
+<body>
+ <div id="scroll">
+ <div id="scrolled"></div>
+ </div>
+ <div style="height: 5000px;"></div><!-- So the page is scrollable as well -->
+</body>
+</head>