|
1 <!DOCTYPE HTML> |
|
2 <html> |
|
3 <!-- |
|
4 https://bugzilla.mozilla.org/show_bug.cgi?id=310107 |
|
5 --> |
|
6 <head> |
|
7 <title>Test for Bug 310107</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> |
|
12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=310107">Mozilla Bug 310107</a> |
|
13 <p id="display"></p> |
|
14 <div id="content" style="display: none"> |
|
15 |
|
16 </div> |
|
17 <pre id="test"> |
|
18 <script class="testbody" type="text/javascript"> |
|
19 /** Test for Bug 310107 **/ |
|
20 SimpleTest.waitForExplicitFinish(); |
|
21 |
|
22 var win = window.open("bug310107-resource.xhtml", "", "width=10, height=10"); |
|
23 |
|
24 function runTest() { |
|
25 window.el = win.document.getElementById("bar"); |
|
26 window.doc = win.document; |
|
27 is(window.el.prop, 2, "Unexpected prop value at load"); |
|
28 |
|
29 win.location = "data:text/html,<body onload='window.opener.loadDone()'>"; |
|
30 } |
|
31 |
|
32 function loadDone() { |
|
33 is(window.el.prop, 2, "Prop still 2 because we're in bfcache"); |
|
34 is(window.el, window.doc.getElementById("bar"), |
|
35 "document didn't get bfcached?"); |
|
36 |
|
37 // Remove our node from the DOM |
|
38 window.el.parentNode.removeChild(window.el); |
|
39 |
|
40 is(window.el.prop, undefined, "Binding should have been detached"); |
|
41 is(typeof(window.el.prop), "undefined", "Really undefined"); |
|
42 |
|
43 win.close(); |
|
44 |
|
45 SimpleTest.finish(); |
|
46 } |
|
47 |
|
48 |
|
49 </script> |
|
50 </pre> |
|
51 </body> |
|
52 </html> |
|
53 |