summaryrefslogtreecommitdiffstats
path: root/layout/reftests/bugs/474472-1.html
blob: 8c857042e3a6c3d37ef79cd4c47a3dfebc859605 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<!DOCTYPE html>
<html class="reftest-wait">
  <body>
    <iframe id="foo" srcdoc="<body bgcolor='red'>FAIL</body>"></iframe> 
    <script type="text/javascript">
      // Globals
      var foo = document.getElementById('foo');
      var win = foo.contentWindow;

      // Start the chain of execution when iframe's window loads
      win.onload = iframeWindowLoaded;

      function iframeWindowLoaded() {
        setTimeout("tweak()", 0);
      }
      function tweak() {
        win.location ="data:text/html,<body bgcolor='lime'>PASS</body>";
        foo.onload = snapshot;
      }
      function snapshot() {
        document.documentElement.className = '';
      }
    </script>
  </body>
</html>