summaryrefslogtreecommitdiffstats
path: root/layout/reftests/bugs/474472-1.html
blob: 86b25bba06490468cf17b4679733013673db7d81 (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" src="data:text/html,<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>