test_media_queries_dynamic_xbl.html 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <!DOCTYPE HTML>
  2. <html>
  3. <!--
  4. https://bugzilla.mozilla.org/show_bug.cgi?id=156716
  5. -->
  6. <head>
  7. <title>Test for Bug 156716</title>
  8. <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  9. <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
  10. </head>
  11. <body onload="run()">
  12. <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=156716">Mozilla Bug 156716</a>
  13. <iframe id="display" src="media_queries_dynamic_xbl_iframe.html"></iframe>
  14. <pre id="test">
  15. <script class="testbody" type="text/javascript">
  16. /** Test for Bug 156716 **/
  17. function run() {
  18. var iframe = document.getElementById("display");
  19. var subdoc = iframe.contentDocument;
  20. var subwin = iframe.contentWindow;
  21. var p = subdoc.getElementById("para");
  22. iframe.setAttribute("style", "height: 300px; width: 100px");
  23. is(subwin.getComputedStyle(p, "").color, "rgb(128, 0, 128)",
  24. "should be purple when portait");
  25. iframe.setAttribute("style", "height: 100px; width: 300px");
  26. is(subwin.getComputedStyle(p, "").color, "rgb(0, 0, 255)",
  27. "should be blue when landscape");
  28. SimpleTest.finish();
  29. }
  30. SimpleTest.waitForExplicitFinish();
  31. </script>
  32. </pre>
  33. </body>
  34. </html>