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

Unified Diff: LayoutTests/fast/events/drag-on-mouse-move-cancelled.html

Issue 1013303003: Preventing the default action on 'mousemove' listener shouldn't prevent selection (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « no previous file | LayoutTests/fast/events/drag-on-mouse-move-cancelled-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/events/drag-on-mouse-move-cancelled.html
diff --git a/LayoutTests/fast/events/drag-on-mouse-move-cancelled.html b/LayoutTests/fast/events/drag-on-mouse-move-cancelled.html
new file mode 100644
index 0000000000000000000000000000000000000000..896c8667d0f9ecd6b9e9a821303e86ad4f40fd6c
--- /dev/null
+++ b/LayoutTests/fast/events/drag-on-mouse-move-cancelled.html
@@ -0,0 +1,47 @@
+<script>
leviw_travelin_and_unemployed 2015/03/19 12:56:11 Nit: doctype.
ramya.v 2015/03/24 05:29:19 Done.
+window.onload = function(evt) {
leviw_travelin_and_unemployed 2015/03/19 12:56:11 You don't need an onload handler. Just put the scr
ramya.v 2015/03/24 05:29:19 Done.
+ if (!window.testRunner)
+ return;
+
+ window.testRunner.dumpAsText();
+ drag();
+}
+
+
+function drag() {
+
+ var testElem = document.getElementById("text");
+ testElem.addEventListener("mousemove", function(event) {
+ event.preventDefault();
+ }, false);
+
+ var text_x = testElem.offsetLeft;
+ var text_y = testElem.offsetTop;
+
+ eventSender.mouseMoveTo(text_x, text_y);
+ eventSender.mouseDown();
+
+ // Start the selection
+ eventSender.mouseMoveTo(text_x, text_y + 1);
+
+ // Create the selection
+ eventSender.mouseMoveTo(text_x + 10, text_y + 10);
+ eventSender.mouseUp();
+
+ var range = window.getSelection().getRangeAt(0);
+ var result = range.toString().length > 0 ? "SUCCESS" : "FAILED";
leviw_travelin_and_unemployed 2015/03/19 12:56:11 You should use js-test.js instead of rolling this
ramya.v 2015/03/24 05:29:19 Done.
+ document.getElementById("result").innerHTML = result;
+
+ window.testRunner.notifyDone();
+}
+</script>
+<p>Test for <a href="https://code.google.com/p/chromium/issues/detail?id=346473">bug
+346473</a>: Text selection should happen even if mousemove event is cancelled,
+since there is no default action specified for mousemove event in the spec which
+is to be prevented on defaultPrevent.</p>
leviw_travelin_and_unemployed 2015/03/19 12:56:11 "defaultPrevent" Also since this is easy to test
ramya.v 2015/03/24 05:29:19 Done.
+
+<p id="text">
+TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT
+</p>
+
+<p id="result"></p>
« no previous file with comments | « no previous file | LayoutTests/fast/events/drag-on-mouse-move-cancelled-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698