4 https://bugzilla.mozilla.org/show_bug.cgi?id=1574596
7 <title>Test for Bug
1574596</title>
8 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
9 <script src=
"/tests/SimpleTest/EventUtils.js"></script>
10 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css"/>
13 add_task(async
function() {
14 let iframe
= document
.getElementById("iframe1");
16 let edit
= iframe
.contentDocument
.getElementById("edit");
19 iframe
.contentDocument
.execCommand("enableObjectResizing", false, true);
21 async
function waitForSelectionChange() {
22 return new Promise(resolve
=> {
23 iframe
.contentDocument
.addEventListener("selectionchange", () => {
29 let target
= iframe
.contentDocument
.getElementById("target");
30 let promiseSelectionChangeEvent
= waitForSelectionChange();
31 synthesizeMouseAtCenter(target
, {}, iframe
.contentWindow
);
32 await promiseSelectionChangeEvent
;
34 ok(target
.hasAttribute("_moz_resizing"),
35 "resizers of the <img> should be visible");
37 iframe
.style
.display
= "none";
38 iframe
.offsetHeight
; // reflow
40 await
new Promise(SimpleTest
.executeSoon
);
41 ok(!target
.hasAttribute("_moz_resizing"),
42 "resizers of the <img> should be hidden");
44 iframe
.style
.display
= "";
45 iframe
.offsetHeight
; // reflow
47 promiseSelectionChangeEvent
= waitForSelectionChange();
48 synthesizeMouseAtCenter(target
, {}, iframe
.contentWindow
);
49 await promiseSelectionChangeEvent
;
51 ok(target
.hasAttribute("_moz_resizing"),
52 "resizers of the <img> should be visible again");
57 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=1574596">Mozilla Bug
1574596</a>
61 <iframe id=
"iframe1" srcdoc=
"<div id=edit contenteditable><img id='target' src='green.png'></div>"></iframe>