chrome_content_integration_window.xhtml (1947B)
1 <?xml version="1.0"?> 2 <?xml-stylesheet type="text/css" href="chrome://global/skin"?> 3 <window title="Content/chrome integration subwindow" 4 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" 5 onload="runTests()" 6 style="background:black; -moz-appearance:none;"> 7 <script src="chrome://mochikit/content/tests/SimpleTest/WindowSnapshot.js"></script> 8 9 <stack style="align-items: center; height: 300px; width: 200px;"> 10 <!-- the bottom 100px is a strip of black that should be visible through the content iframe --> 11 <vbox style="background:pink; border-bottom:100px solid black"/> 12 <!-- the middle 100px is a strip of black in the content iframe --> 13 <!-- the bottom 100px of the iframe is transparent, the top 100px is yellow --> 14 <iframe type="content" style="border:none; width: 10px; height: 10px;" 15 transparent="transparent" 16 src="data:text/html,<div style='position:absolute;left:0;top:0;width:100%;height:100px;background:yellow;border-bottom:100px solid black'>"/> 17 <!-- the top 100px is a strip of black above the content iframe --> 18 <vbox style="border-top:100px solid black;"/> 19 </stack> 20 21 <script type="application/javascript"> 22 <![CDATA[ 23 var imports = [ "SimpleTest", "is", "isnot", "ok", "SpecialPowers" ]; 24 for (var name of imports) { 25 window[name] = window.arguments[0][name]; 26 } 27 28 function runTests() { 29 var testCanvas = snapshotWindow(window); 30 31 var refCanvas = snapshotWindow(window); 32 var ctx = refCanvas.getContext('2d'); 33 ctx.fillStyle = "black"; 34 ctx.fillRect(0, 0, refCanvas.width, refCanvas.height); 35 36 var comparison = compareSnapshots(testCanvas, refCanvas, true); 37 ok(comparison[0], "Rendering OK, got " + comparison[1] + ", expected " + comparison[2]); 38 39 var tester = window.SimpleTest; 40 window.close(); 41 tester.finish(); 42 } 43 ]]> 44 </script> 45 </window>