Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / pasteboard / drag-and-drop-image-contenteditable.html
blobb3147a385170864ad2139924d23bce048938c9b0
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><img id="source" src="resources/apple.gif" alt="alt-text" itemprop="somedata" arbitrary="green"></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("img").length', '1');
26 shouldBe('target.getElementsByTagName("img")[0].attributes.length', '5');
27 shouldBeEqualToString('target.getElementsByTagName("img")[0].id', 'source');
28 shouldBeEqualToString('target.getElementsByTagName("img")[0].alt', 'alt-text');
29 shouldBeEqualToString('target.getElementsByTagName("img")[0].attributes["itemprop"].value', 'somedata');
30 shouldBeEqualToString('target.getElementsByTagName("img")[0].attributes["arbitrary"].value', 'green');
32 finishJSTest();
35 function runTest() {
36 target.addEventListener('DOMNodeInserted', contentInserted, false);
37 if (!window.testRunner)
38 return;
40 testRunner.waitUntilDone();
42 e = document.getElementById("source");
43 x = e.offsetLeft + e.offsetWidth / 2;
44 y = e.offsetTop + e.offsetHeight / 2;
46 eventSender.mouseMoveTo(x, y);
47 eventSender.mouseDown();
48 eventSender.leapForward(100);
49 e = document.getElementById("target");
50 x = e.offsetLeft + e.offsetWidth / 2;
51 y = e.offsetTop + e.offsetHeight / 2;
53 eventSender.mouseMoveTo(x, y);
54 eventSender.mouseUp();
56 </script>
57 </body>
58 </html>