Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(232)

Unified Diff: third_party/WebKit/LayoutTests/fast/events/wheel/mouse-wheel-scroll-latching.html

Issue 2158423002: Wheel scroll latching enabled behind flag. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/fast/events/wheel/mouse-wheel-scroll-latching.html
diff --git a/third_party/WebKit/LayoutTests/fast/events/wheel/mouse-wheel-scroll-latching.html b/third_party/WebKit/LayoutTests/fast/events/wheel/mouse-wheel-scroll-latching.html
new file mode 100644
index 0000000000000000000000000000000000000000..22d06703d4f857c075951a1cbd13b076a3227618
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/events/wheel/mouse-wheel-scroll-latching.html
@@ -0,0 +1,74 @@
+<!DOCTYPE HTML>
+<script src="../../../resources/js-test.js"></script>
+<style>
+
+ ::-webkit-scrollbar {
+ display: none;
+ }
+ body {
+ margin: 0px;
+ height: 1000px;
+ width: 1000px;
+ }
+ #parent {
+ background-color: #FF7F7F;
+ height: 600px;
+ width: 600px;
+ overflow: scroll;
+ }
+ #content1 {
+ height: 700px;
+ width: 700px;
+ }
+ #child {
+ background-color: #84BE6A;
+ height: 500px;
+ width: 500px;
+ overflow: scroll;
+ }
+ #content2 {
+ height: 600px;
+ width: 600px;
+ }
+</style>
+
+<div id="parent">
+ <div id="content1">
+ <div id="child">
+ <div id="content2">
+ </div>
+ </div>
+ </div>
+</div>
+
+<script>
+
+window.jsTestIsAsync = true;
+
+var parent = document.getElementById('parent');
+var child = document.getElementById('child');
+
+function runTest() {
+ if (!window.chrome || !chrome.gpuBenchmarking) {
+ debug("This test requires window.chrome and chrome.gpuBenchmarking.");
+ finishJSTest();
+ }
+ var rect = child.getBoundingClientRect();
+ chrome.gpuBenchmarking.smoothScrollBy(150, scrollValueCheck,
+ (rect.left + rect.right) / 2,
+ (rect.top + rect.bottom) / 2,
+ 2, "down", 4000);
+}
+
+function scrollValueCheck() {
+ debug("The child div scrolls till the end.");
+ shouldBecomeEqual("child.scrollTop", "100",
+ function () {
+ shouldBeZero("parent.scrollTop");
+ finishJSTest();
+ });
+}
+
+window.onload = runTest();
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698