4 https://bugzilla.mozilla.org/show_bug.cgi?id=1332876
8 <title>Test for Bug
1332876</title>
9 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
10 <script src=
"/tests/SimpleTest/EventUtils.js"></script>
11 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css"/>
14 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=1332876">Mozilla Bug
1332876</a>
16 <div id=
"content" style=
"display: none">
19 <iframe srcdoc=
"<html><body><span>Edit me!</span>"></iframe>
23 <script type=
"application/javascript">
25 /** Test for Bug
1332876 **/
26 SimpleTest.waitForExplicitFinish();
27 SimpleTest.waitForFocus(function() {
28 let iframe = document.querySelector(
"iframe");
29 iframe.contentDocument.designMode =
"on";
31 iframe.contentWindow.addEventListener(
"keypress", function() {
32 info(
"Hiding the iframe...");
33 iframe.style.display =
"none";
34 document.body.offsetHeight;
35 ok(true,
"did not crash");
39 iframe.contentWindow.addEventListener(
"click", function() {
40 info(
"Waiting keypress event...");
41 // Use another macro task for avoiding impossible event nesting.
42 SimpleTest.executeSoon(() =
> {
43 synthesizeKey(
"a", {}, iframe.contentWindow);
47 let span = iframe.contentDocument.querySelector(
"span");
48 ok(span != null,
"The span element should've been loaded in the iframe");
49 info(
"Waiting click event to focus the iframe...");
50 synthesizeMouseAtCenter(span, {}, iframe.contentWindow);