1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/xbl/test/test_bug310107.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,53 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=310107 1.8 +--> 1.9 +<head> 1.10 + <title>Test for Bug 310107</title> 1.11 + <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.12 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 1.13 +</head> 1.14 +<body> 1.15 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=310107">Mozilla Bug 310107</a> 1.16 +<p id="display"></p> 1.17 +<div id="content" style="display: none"> 1.18 + 1.19 +</div> 1.20 +<pre id="test"> 1.21 +<script class="testbody" type="text/javascript"> 1.22 +/** Test for Bug 310107 **/ 1.23 +SimpleTest.waitForExplicitFinish(); 1.24 + 1.25 +var win = window.open("bug310107-resource.xhtml", "", "width=10, height=10"); 1.26 + 1.27 +function runTest() { 1.28 + window.el = win.document.getElementById("bar"); 1.29 + window.doc = win.document; 1.30 + is(window.el.prop, 2, "Unexpected prop value at load"); 1.31 + 1.32 + win.location = "data:text/html,<body onload='window.opener.loadDone()'>"; 1.33 +} 1.34 + 1.35 +function loadDone() { 1.36 + is(window.el.prop, 2, "Prop still 2 because we're in bfcache"); 1.37 + is(window.el, window.doc.getElementById("bar"), 1.38 + "document didn't get bfcached?"); 1.39 + 1.40 + // Remove our node from the DOM 1.41 + window.el.parentNode.removeChild(window.el); 1.42 + 1.43 + is(window.el.prop, undefined, "Binding should have been detached"); 1.44 + is(typeof(window.el.prop), "undefined", "Really undefined"); 1.45 + 1.46 + win.close(); 1.47 + 1.48 + SimpleTest.finish(); 1.49 +} 1.50 + 1.51 + 1.52 +</script> 1.53 +</pre> 1.54 +</body> 1.55 +</html> 1.56 +