2 window
.onload = function(evt
) {
3 if (!window
.testRunner
)
6 window
.testRunner
.dumpAsText();
8 if (-1 == document
.location
.href
.indexOf("?second")) {
15 function firstLoad() {
16 window
.testRunner
.waitUntilDone();
18 var link_x
= document
.getElementById("link").offsetLeft
;
19 var link_y
= document
.getElementById("link").offsetTop
;
21 eventSender
.mouseMoveTo(link_x
, link_y
);
22 eventSender
.mouseDown();
23 // The mouse move event causes us to consider starting a drag.
24 eventSender
.mouseMoveTo(link_x
, link_y
+ 1);
25 // But we don't move far before mouseup so it counts as a click.
26 eventSender
.mouseUp();
29 function secondLoad() {
30 var text_x
= document
.getElementById("text").offsetLeft
;
31 var text_y
= document
.getElementById("text").offsetTop
;
33 eventSender
.mouseMoveTo(text_x
, text_y
);
34 eventSender
.mouseDown();
36 // Start the selection
37 eventSender
.mouseMoveTo(text_x
, text_y
+ 1);
39 // Create the selection
40 eventSender
.mouseMoveTo(text_x
+ 100, text_y
+ 100);
41 eventSender
.mouseUp();
43 var range
= window
.getSelection().getRangeAt(0);
44 var result
= range
.toString().length
> 0 ? "SUCCESS" : "FAILED";
45 document
.getElementById("result").innerHTML
= result
;
47 window
.testRunner
.notifyDone();
50 <p>Test for
<a href=
"http://bugs.webkit.org/show_bug.cgi?id=16479">bug
51 16479</a>: text selection does not always begin at mouse down point. To run
52 test manually, click on test link and then try to select some text below. The
53 selected region should start where the mouse down starts.
</p>
55 <p><a id=
"link" href=
"reset-drag-on-mouse-down.html?second" title=
"title">test link
</a></p>
58 TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT
59 TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT
60 TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT
61 TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT
62 TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT
63 TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT
64 TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT
65 TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT
66 TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT
67 TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT
68 TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT
69 TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT
70 TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT
71 TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT
72 TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT
73 TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT
74 TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT
75 TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT
76 TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT
77 TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT