layout/generic/test/test_bug448987.html

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:db5192f97046
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=448987
5 -->
6 <head>
7 <title>Test for Bug 448987</title>
8 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
9 <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
10 <script type="text/javascript" src="/tests/SimpleTest/WindowSnapshot.js"></script>
11 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
12 <style>
13 iframe {
14 width: 500px;
15 height: 300px;
16 }
17 </style>
18 </head>
19 <body>
20 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=448987">Mozilla Bug 448987</a>
21 <p id="display"></p>
22 <div id="content">
23 <iframe id="f1"></iframe>
24 <iframe id="f2"></iframe>
25 <iframe id="f3"></iframe>
26 </div>
27 <pre id="test">
28 <script type="application/javascript">
29
30 /** Test for Bug 448987 **/
31 SimpleTest.waitForExplicitFinish();
32
33 SpecialPowers.setIntPref("accessibility.tabfocus", 7);
34
35 var f1 = document.getElementById("f1");
36 var f2 = document.getElementById("f2");
37 var f3 = document.getElementById("f3");
38
39 var snapshotf1;
40
41 SimpleTest.waitForFocus(function() {
42 f1.src = "file_bug448987.html";
43 });
44
45 function firstIframeLoaded() {
46 snapshotf1 = snapshotWindow(f1.contentWindow);
47 f2.src="file_bug448987_ref.html";
48 }
49
50 function secondIframeLoaded() {
51 ok(compareSnapshots(snapshotf1,
52 snapshotWindow(f2.contentWindow), true)[0],
53 "<area shape=default> should render focus outline");
54 f3.src="file_bug448987_notref.html";
55 }
56
57 function thirdIframeLoaded() {
58 ok(compareSnapshots(snapshotf1,
59 snapshotWindow(f3.contentWindow), false)[0],
60 "file_bug448987.html should render focus outline, file_bug448987_notref.html should not");
61 finish();
62 }
63
64 function finish()
65 {
66 SpecialPowers.clearUserPref("accessibility.tabfocus");
67 SimpleTest.finish();
68 }
69 </script>
70 </pre>
71 </body>
72 </html>

mercurial