test_bug1451199-1.html (1201B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=1451199 5 --> 6 <head> 7 <meta charset="utf-8"> 8 <title>Test for Bug 1451199</title> 9 <script src="/tests/SimpleTest/SimpleTest.js"></script> 10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 11 <script type="application/javascript"> 12 13 /** Test for Bug 1451199 */ 14 SimpleTest.waitForExplicitFinish(); 15 16 addLoadEvent(function() { 17 var iframe = document.querySelector("iframe"); 18 iframe.width = "50"; 19 iframe.contentDocument.documentElement.offsetWidth; // Flush layout 20 21 // We have to be careful to not check l.matches until the very end 22 // of the test. 23 var l = frames[0].matchMedia("(orientation: portrait)"); 24 l.onchange = function() { 25 is(l.matches, false, 26 "Should not match portrait by the time we get notified"); 27 SimpleTest.finish(); 28 }; 29 iframe.width = "200"; 30 }); 31 </script> 32 </head> 33 <body> 34 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1451199">Mozilla Bug 1451199</a> 35 <p id="display"><iframe height="100" width="200"></iframe></p> 36 <div id="content" style="display: none"> 37 38 </div> 39 <pre id="test"> 40 </pre> 41 </body> 42 </html>