content/base/test/test_reentrant_flush.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 <!DOCTYPE HTML>
     2 <html>
     3 <!--
     4 https://bugzilla.mozilla.org/show_bug.cgi?id=709256
     5 -->
     6 <head>
     7   <title>Test for Bug 709256</title>
     8   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     9   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    10 </head>
    11 <body>
    12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=709256">Mozilla Bug 709256</a>
    13 <p id="display">
    14 <iframe id="test"
    15         style="width: 100px" src="data:text/html,<body style='width: 100%'>">
    16 </iframe>
    17 </p>
    18 <div id="content" style="display: none">
    20 </div>
    21 <pre id="test">
    22 <script type="application/javascript">
    24 /** Test for Bug 709256 **/
    25 SimpleTest.waitForExplicitFinish();
    26 addLoadEvent(function() {
    27   var ifr = $("test");
    28   var bod = ifr.contentDocument.body;
    30   is(bod.getBoundingClientRect().width, 100,
    31     "Width of body should be 100px to start with");
    33   var resizeHandlerRan = false;
    35   function handleResize() {
    36     resizeHandlerRan = true;
    37     is(bod.getBoundingClientRect().width, 50,
    38        "Width of body should now be 50px");
    39   }
    41   var win = ifr.contentWindow;
    43   win.addEventListener("resize", handleResize, false);
    44   SpecialPowers.setFullZoom(win, 2);
    46   is(resizeHandlerRan, false,
    47      "Resize handler should not have run yet for this test to be valid");
    49   // Now flush out layout on the subdocument, to trigger the resize handler
    50   is(bod.getBoundingClientRect().width, 50, "Width of body should still be 50px");
    52   is(resizeHandlerRan, true, "Resize handler should have run");
    54   win.removeEventListener("resize", handleResize, false);
    56   SimpleTest.finish();
    57 });
    58 </script>
    59 </pre>
    60 </body>
    61 </html>

mercurial