layout/style/test/test_media_queries_dynamic_xbl.html

Wed, 31 Dec 2014 06:55:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:55:50 +0100
changeset 2
7e26c7da4463
permissions
-rw-r--r--

Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2

     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">
    17 /** Test for Bug 156716 **/
    19 function run() {
    20   var iframe = document.getElementById("display");
    22   var subdoc = iframe.contentDocument;
    23   var subwin = iframe.contentWindow;
    24   var p = subdoc.getElementById("para");
    26   iframe.setAttribute("style", "height: 300px; width: 100px");
    27   is(subwin.getComputedStyle(p, "").color, "rgb(128, 0, 128)",
    28      "should be purple when portait");
    29   iframe.setAttribute("style", "height: 100px; width: 300px");
    30   is(subwin.getComputedStyle(p, "").color, "rgb(0, 0, 255)",
    31      "should be blue when landscape");
    32   SimpleTest.finish();
    33 }
    34 SimpleTest.waitForExplicitFinish();
    36 </script>
    37 </pre>
    38 </body>
    39 </html>

mercurial