blob: f4100f9c378bf06973d9299d293e7bdc620514ea (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
<html>
<head>
<script>
if (window.testRunner) {
testRunner.waitUntilDone();
testRunner.dumpAsText();
}
function log(message) {
var console = document.getElementById("console");
var li = document.createElement("li");
var text = document.createTextNode(message);
console.appendChild(li);
li.appendChild(text);
}
function step1() {
window.frames[0].document.write("<div contenteditable>drag<img src='../resources/abe.png' id=dragme>me<span id=target> </span></div>");
setTimeout("step2()", 100);
}
function step2() {
if (!window.testRunner) {
log("This test uses eventSender. To run it manually, drag the selected image to another position in the editable div and drop it. It should not disappear.");
return;
}
var doc = window.frames[0].document;
e = doc.getElementById("dragme");
x = e.offsetLeft + e.offsetWidth / 2;
y = e.offsetTop + e.offsetHeight / 2;
eventSender.mouseMoveTo(x, y);
eventSender.mouseDown();
e = doc.getElementById("target");
x = e.offsetLeft + e.offsetWidth / 2;
y = e.offsetTop + e.offsetHeight / 2;
eventSender.mouseMoveTo(x, y);
eventSender.mouseUp();
document.write("<p><a href='http://bugs.webkit.org/show_bug.cgi?id=14428'>Bug 14428</a>: FCKEditor: Images disappear on drag/drop and copy/paste</p>");
if (doc.getElementById("dragme").parentNode.tagName == "SPAN" && doc.getElementById("dragme").src.length > 10)
document.write("<p>SUCCESS</p>");
else
document.write("<p>FAILURE</p>");
testRunner.notifyDone();
}
</script>
</head>
<body onload="setTimeout('step1()', 100)">
<iframe src="about:blank"></iframe>
<ul id="console"></ul>
</body>
</html>
|