|
1 <html><head> |
|
2 <title>Bug 426646, Using location.replace breaks iframe history</title> |
|
3 <script type="text/javascript"> |
|
4 var url1 = "data:text/html;charset=utf-8,1st%20page"; |
|
5 |
|
6 function soon(f) { |
|
7 return function() { setTimeout(f, 0); }; |
|
8 } |
|
9 |
|
10 function doe() { |
|
11 document.body.innerHTML = "<iframe src='about:blank'></iframe>"; |
|
12 document.body.innerHTML += "<iframe src='about:blank'></iframe>"; |
|
13 window.frames[0].frameElement.onload = soon(doe2); |
|
14 window.frames[0].location.replace(url1); |
|
15 } |
|
16 |
|
17 function doe2() { |
|
18 window.frames[0].location = 'data:text/html;charset=utf-8,2nd%20page'; |
|
19 window.frames[0].frameElement.onload = soon(doe3); |
|
20 } |
|
21 |
|
22 function doe3() { |
|
23 window.frames[0].frameElement.onload = soon(doe4); |
|
24 history.go(-1); |
|
25 } |
|
26 |
|
27 function doe4() { |
|
28 opener.is(window.frames[0].location, url1, "History.go(-1) didn't work?"); |
|
29 opener.is(window.frames[1].location, "about:blank", |
|
30 "History.go(-1) didn't work?"); |
|
31 close(); |
|
32 } |
|
33 </script> |
|
34 </head> |
|
35 <body onload="doe();" onunload="opener.nextTest();"> |
|
36 </body></html> |