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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <script>
leviw_travelin_and_unemployed 2015/03/19 12:56:11 Nit: doctype.
ramya.v 2015/03/24 05:29:19 Done.
2 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.
3 if (!window.testRunner)
4 return;
5
6 window.testRunner.dumpAsText();
7 drag();
8 }
9
10
11 function drag() {
12
13 var testElem = document.getElementById("text");
14 testElem.addEventListener("mousemove", function(event) {
15 event.preventDefault();
16 }, false);
17
18 var text_x = testElem.offsetLeft;
19 var text_y = testElem.offsetTop;
20
21 eventSender.mouseMoveTo(text_x, text_y);
22 eventSender.mouseDown();
23
24 // Start the selection
25 eventSender.mouseMoveTo(text_x, text_y + 1);
26
27 // Create the selection
28 eventSender.mouseMoveTo(text_x + 10, text_y + 10);
29 eventSender.mouseUp();
30
31 var range = window.getSelection().getRangeAt(0);
32 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.
33 document.getElementById("result").innerHTML = result;
34
35 window.testRunner.notifyDone();
36 }
37 </script>
38 <p>Test for <a href="https://code.google.com/p/chromium/issues/detail?id=346473" >bug
39 346473</a>: Text selection should happen even if mousemove event is cancelled,
40 since there is no default action specified for mousemove event in the spec which
41 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.
42
43 <p id="text">
44 TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT
45 </p>
46
47 <p id="result"></p>
OLDNEW
« 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