/** Test for Bug 558663 **/ var ok = parent.ok; var SimpleTest = parent.SimpleTest; var compareSnapshots = parent.compareSnapshots; var snapshotWindow = parent.snapshotWindow; var synthesizeMouse = parent.synthesizeMouse;
function runTest() { var contentDocument = document.getElementById("iframe").contentDocument;
contentDocument.designMode = "on";
contentDocument.execCommand("enableObjectResizing", false, true);
// The editor requires the event loop to spin after you turn on design mode
// before it takes effect.
setTimeout(continueTest, 100);
}
function continueTest() { var win = document.getElementById("iframe").contentWindow; var doc = win.document; var image = doc.getElementById("image");
// We want to test that clicking on the image and then clicking on one of the
// draggers doesn't make the draggers disappear.
// clean snapshot var before = snapshotWindow(win);
// click to get the draggers
synthesizeMouse(image, 1, 1, {type: "mousedown"}, win);
synthesizeMouse(image, 1, 1, {type: "mouseup"}, win);
// mouse over a dragger will change its color, so move the mouse away
synthesizeMouse(doc.documentElement, 50, 50, {type: "mousemove"}, win);
// snapshot with hopefully draggers var middle = snapshotWindow(win);
// clicking on the top left dragger shouldn't change anything
synthesizeMouse(image, 1, 1, {type: "mousedown"}, win);
synthesizeMouse(image, 1, 1, {type: "mouseup"}, win);
// mouse over a dragger will change its color, so move the mouse away
synthesizeMouse(doc.documentElement, 50, 50, {type: "mousemove"}, win);
// snapshot with hopefully draggers again var middle2 = snapshotWindow(win);
// click outside the image (but inside the document) to unselect it
synthesizeMouse(doc.documentElement, 50, 50, {type: "mousedown"}, win);
synthesizeMouse(doc.documentElement, 50, 50, {type: "mouseup"}, win);
// and then click outside the document so we don't draw a caret
synthesizeMouse(document.documentElement, 1, 1, {type: "mousedown"}, window);
synthesizeMouse(document.documentElement, 1, 1, {type: "mouseup"}, window);
// hopefully clean snapshot var end = snapshotWindow(win);
// before == end && middle == middle2 && before/end != middle/middle2
checkSnapshots(before, end, true, "before and after should be the same")
checkSnapshots(middle, middle2, true, "middle two should be the same");
checkSnapshots(before, middle, false, "before and middle should not be the same");
checkSnapshots(before, middle2, false, "before and middle2 should not be the same");
checkSnapshots(middle, end, false, "middle and end should not be the same");
checkSnapshots(middle2, end, false, "middle2 and end should not be the same");
SimpleTest.finish();
}
</script>
</pre>
</body>
</html>
Messung V0.5
¤ Dauer der Verarbeitung: 0.0 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.