Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / pasteboard / drag-and-drop-inputimage-contenteditable.html
blob16d18d57bfc34d99b7a7651f67f5b1f64a951ae5
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 <style>
6 #target {
7 height: 200px;
8 width: 220px;
9 border: 5px solid blue;
11 </style>
12 </head>
13 <body onload="runTest()">
14 <p id="description"></p>
15 <div contenteditable=true id="target"></div>
16 <div><input type="image" id="source" src="resources/apple.gif" itemprop="somedata" arbitrary="green" draggable=true></div>
17 <div id="console"></div>
19 <script>
20 description('This test verify dragging an image in the page keeps its attributes. To test manually, drag the image and drop it in the rect with a blue border.');
21 var jsTestIsAsync = true;
22 var target = document.getElementById('target');
24 function contentInserted() {
25 shouldBe('target.getElementsByTagName("input").length', '1');
26 shouldBe('target.getElementsByTagName("input")[0].attributes.length', '6');
27 shouldBeEqualToString('target.getElementsByTagName("input")[0].id', 'source');
28 shouldBeEqualToString('target.getElementsByTagName("input")[0].type', 'image');
29 shouldBeTrue('target.getElementsByTagName("input")[0].draggable');
30 shouldBeEqualToString('target.getElementsByTagName("input")[0].attributes["itemprop"].value', 'somedata');
31 shouldBeEqualToString('target.getElementsByTagName("input")[0].attributes["arbitrary"].value', 'green');
33 finishJSTest();
36 function runTest() {
37 target.addEventListener('DOMNodeInserted', contentInserted, false);
38 if (!window.testRunner)
39 return;
41 testRunner.waitUntilDone();
43 e = document.getElementById("source");
44 x = e.offsetLeft + e.offsetWidth / 2;
45 y = e.offsetTop + e.offsetHeight / 2;
47 eventSender.mouseMoveTo(x, y);
48 eventSender.mouseDown();
49 eventSender.leapForward(100);
50 e = document.getElementById("target");
51 x = e.offsetLeft + e.offsetWidth / 2;
52 y = e.offsetTop + e.offsetHeight / 2;
54 eventSender.mouseMoveTo(x, y);
55 eventSender.mouseUp();
57 </script>
58 </body>
59 </html>