upload webkit/tizen 2.0_beta source.
[framework/web/webkit-efl.git] / LayoutTests / fast / lists / drag-into-marker.html
1 <body contenteditable="true">
2
3 <ul id="ul" style="margin:1em; border:1px solid black;"><li id="li" contenteditable="true" style="list-style-type: square; font-size: 3em;">hello <span id="spanToDrag">world</span></a></div></li></ul>
4
5 <p>This is an automated test for elementAtPoint for points over position:outside list markers.  The dictionary returned by elementAtPoint should contain the list item as the DOMNode, not the list, for points over position:outside list markers.  elementAtPoint is used to determine the drag operation that will occur when something is dropped over a given point.  So, this test drags a bit of text over the list marker and drops it.  It should be pasted into the list item, which is contenteditable.</p>
6
7 <script>
8
9 function runTest() {
10     if (!window.layoutTestController)
11         return;
12
13     window.layoutTestController.waitUntilDone();
14     
15     var spanToDrag = document.getElementById("spanToDrag");
16     var x = spanToDrag.offsetLeft + spanToDrag.offsetWidth / 2;
17     var y = spanToDrag.offsetTop + spanToDrag.offsetHeight / 2;
18
19     eventSender.mouseMoveTo(x, y);
20     eventSender.mouseDown();
21     eventSender.mouseUp();
22     eventSender.mouseDown();
23     eventSender.mouseUp();
24     
25     // Wait a moment so that the next mouseDown will kick off a drag, instead of a triple-click
26     eventSender.leapForward(1300);
27     eventSender.mouseDown();
28     // Wait a moment so that the mouseDown will kick off a drag instead of starting a new selection.
29     eventSender.leapForward(400);
30     
31     var li = document.getElementById("li");
32     var ul = document.getElementById("ul");
33     
34     // WebCore paints a position:outside list markers at an offset from the top left corner of the 
35     // bounds of the list item.  The offset is computed using a magic number and the
36     // fonts ascent, two values we can't get to.  This (x, y) *should* be over the list marker.
37     var x = ul.offsetLeft + 18;
38     var y = li.offsetTop + li.offsetHeight / 2 + 20;
39
40     eventSender.mouseMoveTo(x, y);
41     eventSender.mouseUp();
42
43     window.layoutTestController.notifyDone();
44 }
45
46 runTest();
47 </script>
48
49 </body>