Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / pasteboard / dragstart-contains-default-content.html
blobbb739a93a34f47b0b10e15bbc29467bb967e7b3e
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <style>
5 body { font-family: serif; }
6 .testCase { border: 1px solid black; padding: 10px; margin: 10px; width: 100%; }
7 </style>
8 <script>
9 function log(text) {
10 var log = document.getElementById('log');
11 log.appendChild(document.createTextNode(text));
12 log.appendChild(document.createElement('br'));
15 function dragStartTest(e) {
16 log("Test ID: " + e.currentTarget.id);
17 log("text/plain: " + e.dataTransfer.getData("text/plain"));
18 log("text/url: " + e.dataTransfer.getData("text/url"));
19 log("text/html: " + e.dataTransfer.getData("text/html"));
22 function dragCenterOfRect(clientRect) {
23 var x = clientRect.left + clientRect.width / 2;
24 var y = clientRect.top + clientRect.height / 2;
26 eventSender.mouseMoveTo(x, y);
27 eventSender.mouseDown();
28 eventSender.leapForward(200);
29 eventSender.mouseMoveTo(x + 100, y + 100);
30 eventSender.mouseUp();
33 function runTest() {
34 if (!window.testRunner)
35 return;
36 testRunner.dumpAsText();
38 var selection = window.getSelection();
39 selection.selectAllChildren(document.getElementById('selectionTest'));
40 dragCenterOfRect(selection.getRangeAt(0).getBoundingClientRect());
41 dragCenterOfRect(document.getElementById('imageTest').getBoundingClientRect());
42 dragCenterOfRect(document.getElementById('linkTest').getBoundingClientRect());
44 </script>
45 </head>
46 <body onload="runTest()">
47 <p>Simple test that the dragstart event contains the default data in the event.
48 <div class="testCase" id="selectionTest" ondragstart="dragStartTest(event)">
49 <p>Select some text in this box and drag it.
50 </div>
51 <div class="testCase">
52 <p>Drag the image. <img id="imageTest" src="data:image/png;base64,
53 iVBORw0KGgoAAAANSUhEUgAAAJYAAAA8CAIAAAAL5NQ9AAAACXBIWXMAAAsTAAALEwEAmpwY
54 AAAAB3RJTUUH2woaBQc4oLEFpAAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeB
55 DhcAAACMSURBVHja7dNBEYAgFEVRPhHMYgAzUIsmVnFvB/fsoQb+ObfBmzMvxneW1D1vzz2w
56 FiEUQiFEKIRCKIQIhVAIhRChEAqhECIUQiEUQoRCKIRCiFAIhVAIEep3xTWTLzzu5oVCKIRC
57 iFAIhVAIEQqhEAohQiEUQiFEKIRCKIQIhVAIhRChEAqhECLUZi3VEwcBMGr1NgAAAABJRU5E
58 rkJggg==" ondragstart="dragStartTest(event)">
59 </div>
60 <div class="testCase">
61 <p>Drag the link. <a id="linkTest" href="http://www.example.com/" ondragstart="dragStartTest(event)">Link</a>
62 </div>
63 <div id="log"></div>
64 </html>