Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 <?xml version="1.0"?>
2 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
3 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
4 <!--
5 https://bugzilla.mozilla.org/show_bug.cgi?id=454235
6 -->
7 <window title="Mozilla Bug 454235"
8 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
9 <script type="application/javascript"
10 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
12 <!-- test results are displayed in the html:body -->
13 <body xmlns="http://www.w3.org/1999/xhtml">
14 <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=454235"
15 target="_blank">Mozilla Bug 454235</a>
16 </body>
18 <!-- test code goes here -->
19 <script type="application/javascript"><![CDATA[
21 /** Test for Bug 454235 **/
22 SimpleTest.waitForExplicitFinish();
24 SimpleTest.waitForFocus(doTest);
26 function doTest() {
27 var shownBrowser = document.getElementById("shownBrowser");
28 var hiddenBrowser = document.getElementById("hiddenBrowser");
29 var offScreenBrowser = document.getElementById("offScreenBrowser");
30 var offScreenSubBrowser = offScreenBrowser.contentDocument.getElementById("topBrowser");
31 var offScreenBurriedBrowser = offScreenBrowser.contentDocument.getElementById("burriedBrowser");
33 hiddenBrowser.contentWindow.focus();
34 ok(!hiddenBrowser.contentDocument.hasFocus(),"hidden browser is visible");
36 offScreenBrowser.docShell.isOffScreenBrowser = true;
37 offScreenBrowser.contentWindow.focus();
38 ok(offScreenBrowser.contentDocument.hasFocus(),"offscreen browser is not visible");
40 offScreenSubBrowser.contentWindow.focus();
41 todo(offScreenSubBrowser.contentDocument.hasFocus(),"visible browser in offscreen browser is not visible");
43 offScreenBurriedBrowser.contentWindow.focus();
44 ok(!offScreenBurriedBrowser.contentDocument.hasFocus(),"hidden browser in offscreen browser is visible");
46 SimpleTest.finish();
47 }
51 ]]></script>
52 <box flex="1" style="visibility: hidden; border:5px black solid">
53 <browser style="border:5px blue solid" id="hiddenBrowser" src="bug454235-subframe.xul"/>
54 <browser style="border:5px yellow solid" id="offScreenBrowser" src="bug454235-subframe.xul"/>
55 </box>
56 </window>