1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/generic/test/test_bug448987.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,72 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=448987 1.8 +--> 1.9 +<head> 1.10 + <title>Test for Bug 448987</title> 1.11 + <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.12 + <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script> 1.13 + <script type="text/javascript" src="/tests/SimpleTest/WindowSnapshot.js"></script> 1.14 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 1.15 + <style> 1.16 + iframe { 1.17 + width: 500px; 1.18 + height: 300px; 1.19 + } 1.20 + </style> 1.21 +</head> 1.22 +<body> 1.23 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=448987">Mozilla Bug 448987</a> 1.24 +<p id="display"></p> 1.25 +<div id="content"> 1.26 +<iframe id="f1"></iframe> 1.27 +<iframe id="f2"></iframe> 1.28 +<iframe id="f3"></iframe> 1.29 +</div> 1.30 +<pre id="test"> 1.31 +<script type="application/javascript"> 1.32 + 1.33 +/** Test for Bug 448987 **/ 1.34 +SimpleTest.waitForExplicitFinish(); 1.35 + 1.36 +SpecialPowers.setIntPref("accessibility.tabfocus", 7); 1.37 + 1.38 +var f1 = document.getElementById("f1"); 1.39 +var f2 = document.getElementById("f2"); 1.40 +var f3 = document.getElementById("f3"); 1.41 + 1.42 +var snapshotf1; 1.43 + 1.44 +SimpleTest.waitForFocus(function() { 1.45 + f1.src = "file_bug448987.html"; 1.46 +}); 1.47 + 1.48 +function firstIframeLoaded() { 1.49 + snapshotf1 = snapshotWindow(f1.contentWindow); 1.50 + f2.src="file_bug448987_ref.html"; 1.51 +} 1.52 + 1.53 +function secondIframeLoaded() { 1.54 + ok(compareSnapshots(snapshotf1, 1.55 + snapshotWindow(f2.contentWindow), true)[0], 1.56 + "<area shape=default> should render focus outline"); 1.57 + f3.src="file_bug448987_notref.html"; 1.58 +} 1.59 + 1.60 +function thirdIframeLoaded() { 1.61 + ok(compareSnapshots(snapshotf1, 1.62 + snapshotWindow(f3.contentWindow), false)[0], 1.63 + "file_bug448987.html should render focus outline, file_bug448987_notref.html should not"); 1.64 + finish(); 1.65 +} 1.66 + 1.67 +function finish() 1.68 +{ 1.69 + SpecialPowers.clearUserPref("accessibility.tabfocus"); 1.70 + SimpleTest.finish(); 1.71 +} 1.72 +</script> 1.73 +</pre> 1.74 +</body> 1.75 +</html>