content/base/test/file_bug426646-1.html

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     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";
     6 function soon(f) {
     7   return function() { setTimeout(f, 0); };
     8 }
    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 }
    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 }
    22 function doe3() {
    23   window.frames[0].frameElement.onload = soon(doe4);
    24   history.go(-1);
    25 }
    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>

mercurial