test_shared_sheet_caching.html (1104B)
1 <!doctype html> 2 <meta charset="utf-8"> 3 <script src="/tests/SimpleTest/SimpleTest.js"></script> 4 <script> 5 function childWindowLoaded(childWin) { 6 is( 7 childWin.getComputedStyle(childWin.document.documentElement).backgroundColor, 8 "rgb(0, 255, 0)", 9 "Sheet should apply", 10 ) 11 is( 12 SpecialPowers.getDOMWindowUtils(childWin).parsedStyleSheets, 13 0, 14 `Shouldn't need to parse the stylesheet ${childWin.parent == window ? "frame" : "top"}` 15 ); 16 if (childWin.top == childWin) { 17 childWin.close(); 18 SimpleTest.finish(); 19 } 20 } 21 </script> 22 <link rel="stylesheet" href="file_shared_sheet_caching.css"> 23 <iframe src="file_shared_sheet_caching.html"></iframe> 24 <a rel="opener" href="file_shared_sheet_caching.html" target="_blank">Navigation</a> 25 <script> 26 SimpleTest.waitForExplicitFinish(); 27 onload = function() { 28 info("Sheets parsed: " + SpecialPowers.DOMWindowUtils.parsedStyleSheets); 29 is( 30 getComputedStyle(document.documentElement).backgroundColor, 31 "rgb(0, 255, 0)", 32 "Sheet should apply", 33 ) 34 document.querySelector("a").click(); 35 } 36 </script>