dom/events/test/test_bug944011.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/events/test/test_bug944011.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,52 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<!--
     1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=944011
     1.8 +-->
     1.9 +<head>
    1.10 +  <meta charset="utf-8">
    1.11 +  <title>Test for Bug 944011</title>
    1.12 +  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    1.13 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    1.14 +  <script type="application/javascript">
    1.15 +
    1.16 +  /** Test for Bug 944011 comment 24 - Event handlers should fire even if the
    1.17 +      target comes from a non-current inner. **/
    1.18 +  SimpleTest.waitForExplicitFinish();
    1.19 +  var gLoadCount = 0;
    1.20 +  function loaded() {
    1.21 +    ++gLoadCount;
    1.22 +    switch(gLoadCount) {
    1.23 +      case 1:
    1.24 +        ok(true, "Got first load");
    1.25 +        oldBody = window[0].document.body;
    1.26 +        oldBody.onclick = function() {
    1.27 +          ok(true, "Got onclick");
    1.28 +          SimpleTest.finish();
    1.29 +        }
    1.30 +        $('ifr').setAttribute('src', 'data:text/html,<html><body>Second frame</body></html>');
    1.31 +        break;
    1.32 +      case 2:
    1.33 +        ok(true, "Got second load");
    1.34 +        oldBody.dispatchEvent(new MouseEvent('click'));
    1.35 +        break;
    1.36 +      default:
    1.37 +        ok(false, "Unexpected load");
    1.38 +        SimpleTest.finish();
    1.39 +    }
    1.40 +  }
    1.41 +
    1.42 +
    1.43 +  </script>
    1.44 +</head>
    1.45 +<body>
    1.46 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=944011">Mozilla Bug 944011</a>
    1.47 +<p id="display"></p>
    1.48 +<div id="content" style="display: none">
    1.49 +  <iframe id="ifr" onload="loaded();" src="data:text/html,<html><body>foo</body></html>"></iframe>
    1.50 +  <div name="testTarget"></div>
    1.51 +</div>
    1.52 +<pre id="test">
    1.53 +</pre>
    1.54 +</body>
    1.55 +</html>

mercurial