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

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: Modifying comment as per review comments 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..8e1c627b7f0a243f86cc4694bc67c6caaa831170
--- /dev/null
+++ b/LayoutTests/fast/events/drag-on-mouse-move-cancelled.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test.js"></script>
+</head>
+<body>
+<p id="text">
+TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT
+</p>
+<script>
+ description('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. To test manually try to select the text in ' +
+ 'the paragraph, selection should happen.');
+
+ 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();
+
+ // Create the selection
+ eventSender.mouseMoveTo(text_x + 10, text_y);
+ eventSender.mouseUp();
+
+ shouldBe('window.getSelection().getRangeAt(0).toString().length','1');
+</script>
+</body>
+</html>
« 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