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

Unified Diff: third_party/WebKit/LayoutTests/fast/events/autoscroll-disabled-user-select-none.html

Issue 2536083002: SelectionAutoscroll should not happen in user-select:none. (Closed)
Patch Set: Add test. Created 4 years 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/autoscroll-disabled-user-select-none.html
diff --git a/third_party/WebKit/LayoutTests/fast/events/autoscroll-disabled-user-select-none.html b/third_party/WebKit/LayoutTests/fast/events/autoscroll-disabled-user-select-none.html
new file mode 100644
index 0000000000000000000000000000000000000000..689cdbec7abf9fb120f1b377319ade4039e10ed7
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/events/autoscroll-disabled-user-select-none.html
@@ -0,0 +1,33 @@
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<div id="container" style="height: 400px; overflow: auto;">
+ <div style="-webkit-user-select:none; height: 2000px; background-color: yellow">
+ Hello World! Hello Woorld! Hello Wooorld! Hello Woooorld!<br />
+ Hello World! Hello Woorld! Hello Wooorld! Hello Woooorld!<br />
+ Hello World! Hello Woorld! Hello Wooorld! Hello Woooorld!<br />
+ Hello World! Hello Woorld! Hello Wooorld! Hello Woooorld!<br />
+ Hello World! Hello Woorld! Hello Wooorld! Hello Woooorld!<br />
+ </div>
+</div>
+<script>
+var testSelectNone = async_test("Selection-autoscroll should not be triggered when the selection happens in an element with user-select:none");
+testSelectNone.step(function() {
+ if (!window.eventSender)
+ return;
+ var dragStartX = 50;
+ var dragStartY = 50;
+ var dragEndX = 60;
+ var dragEndY = 400;
+ var container = document.getElementById("container");
+
+ eventSender.dragMode = false;
+ eventSender.mouseMoveTo(dragStartX, dragStartY);
+ eventSender.mouseDown();
+ eventSender.mouseMoveTo(dragEndX, dragEndY);
+
+ requestAnimationFrame(function() {
+ assert_equals(container.scrollTop, 0);
+ testSelectNone.done();
+ });
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698