Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / drag-selects-image.html
blob289a2c20199546c87b56f7f968df050a6457af65
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script>
5 function log(str)
7 var result = document.getElementById('result');
8 result.appendChild(document.createTextNode(str));
9 result.appendChild(document.createElement('br'));
11 function dragNowhere(element)
13 eventSender.mouseMoveTo(element.offsetLeft + element.offsetWidth / 2,
14 element.offsetTop + element.offsetHeight / 2);
15 eventSender.mouseDown();
16 eventSender.leapForward(100);
17 eventSender.mouseMoveTo(element.offsetLeft + 1, element.offsetHeight + 1);
18 eventSender.mouseUp();
20 window.onload = function()
22 if (!window.testRunner)
23 return;
24 testRunner.dumpAsText();
26 log('Starting test...');
27 log(window.getSelection().rangeCount + ' range(s) selected');
28 log('Dragging image in non-editable area...');
29 dragNowhere(document.getElementById('imageOne'));
30 log(window.getSelection().rangeCount + ' range(s) selected');
31 log('Dragging image in editable area...');
32 dragNowhere(document.getElementById('imageTwo'));
33 log(window.getSelection().rangeCount + ' range(s) selected');
34 if (window.getSelection().rangeCount && window.getSelection().containsNode(document.getElementById('imageTwo')))
35 log('imageTwo is selected');
37 </script>
38 </head>
39 <body>
40 <div>
41 <h3>Non-editable area</h3>
42 <img id="imageOne" src="resources/abe.png">
43 </div>
44 <div contenteditable="true">
45 <h3>Editable area</h3>
46 <img id="imageTwo" src="resources/onload-image.png">
47 </div>
48 <p>This tests that images are properly left selected or unselected when an image drag is started.
49 Only the image in the editable area should be selected when an image drag is started.
50 <div id="result">
51 </div>
52 </body>
53 </html>