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

Side by Side Diff: third_party/WebKit/LayoutTests/paint/selection/selection-drag-image-in-iframe.html

Issue 2693813002: Selection API: Some functions should throw InvalidNodeTypeError and IndexSizeError. (Closed)
Patch Set: adjust 2 more tests Created 3 years, 10 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
OLDNEW
1 <!doctype HTML> 1 <!doctype HTML>
2 <iframe id="subframe" style="position:relative; top: 100px; left: 100px" srcdoc= "<img id='target' src='../../images/resources/grid-small.png'>"></iframe> 2 <iframe id="subframe" style="position:relative; top: 100px; left: 100px" srcdoc= "<img id='target' src='../../images/resources/grid-small.png'>"></iframe>
3 <script> 3 <script>
4 4
5 function dragAndDrop() { 5 function dragAndDrop() {
6 var target = subframe.contentDocument.getElementById("target"); 6 var target = subframe.contentDocument.getElementById("target");
7 7
8 var x1 = subframe.offsetLeft + target.offsetLeft; 8 var x1 = subframe.offsetLeft + target.offsetLeft;
9 var x2 = subframe.offsetLeft + target.offsetLeft + target.offsetWidth; 9 var x2 = subframe.offsetLeft + target.offsetLeft + target.offsetWidth;
10 var y = subframe.offsetTop + target.offsetTop + target.offsetHeight / 2; 10 var y = subframe.offsetTop + target.offsetTop + target.offsetHeight / 2;
11 11
12 subframe.contentWindow.getSelection().setBaseAndExtent(target, 0, target, 1) ; 12 subframe.contentWindow.getSelection().setBaseAndExtent(target, 0, target, 0) ;
13 13
14 if (window.eventSender) { 14 if (window.eventSender) {
15 eventSender.dragMode = true; 15 eventSender.dragMode = true;
16 eventSender.mouseMoveTo((x1 + x2) / 2, y); 16 eventSender.mouseMoveTo((x1 + x2) / 2, y);
17 eventSender.mouseDown(); 17 eventSender.mouseDown();
18 eventSender.mouseMoveTo(0, 0); 18 eventSender.mouseMoveTo(0, 0);
19 eventSender.mouseUp(); 19 eventSender.mouseUp();
20 } 20 }
21 testRunner.notifyDone(); 21 testRunner.notifyDone();
22 } 22 }
23 23
24 if (window.testRunner) { 24 if (window.testRunner) {
25 testRunner.waitUntilDone(); 25 testRunner.waitUntilDone();
26 testRunner.dumpDragImage(); 26 testRunner.dumpDragImage();
27 } else { 27 } else {
28 // To run manually, click and select the image in the iframe to try to drag it. 28 // To run manually, click and select the image in the iframe to try to drag it.
29 document.write("this test does not work in manual mode"); 29 document.write("this test does not work in manual mode");
30 } 30 }
31 window.onload = dragAndDrop; 31 window.onload = dragAndDrop;
32 32
33 </script> 33 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698