Bug 469302 - Page source code after form submit shows initial form page instead of new page, r=gavin, sr=mrbkap
authorStappel <stanley.appel@ps.net>
Tue, 30 Dec 2008 20:45:05 -0800
changeset 23204 eba3f74d77345eaa11d7474c92c1667c0cfb53ab
parent 23203 a5227b4f2814c6e40d99587819ba502a548207c4
child 23205 219526c76f59e01a423952fcfab2a8a4003c76f1
push id4389
push userphilringnalda@gmail.com
push dateWed, 31 Dec 2008 04:45:48 +0000
treeherdermozilla-central@eba3f74d7734 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgavin, mrbkap
bugs469302
milestone1.9.2a1pre
Bug 469302 - Page source code after form submit shows initial form page instead of new page, r=gavin, sr=mrbkap
toolkit/components/viewsource/content/viewSource.js
--- a/toolkit/components/viewsource/content/viewSource.js
+++ b/toolkit/components/viewsource/content/viewSource.js
@@ -222,25 +222,27 @@ function viewSource(url)
 
           //
           // Load the page using the page descriptor rather than the URL.
           // This allows the content to be fetched from the cache (if
           // possible) rather than the network...
           //
           PageLoader.loadPage(arg, pageLoaderIface.DISPLAY_AS_SOURCE);
 
+          // The content was successfully loaded.
+          loadFromURL = false;
+
           // Record the page load in the session history so <back> will work.
           var shEntry = Cc["@mozilla.org/browser/session-history-entry;1"].createInstance(Ci.nsISHEntry);
           shEntry.setURI(makeURI(viewSrcUrl, null, null));
           shEntry.setTitle(viewSrcUrl);
           shEntry.loadType = Ci.nsIDocShellLoadInfo.loadHistory;
-          getBrowser().webNavigation.sessionHistory.addEntry(shEntry, true);
-
-          // The content was successfully loaded from the page cookie.
-          loadFromURL = false;
+          getBrowser().webNavigation.sessionHistory
+                      .QueryInterface(Ci.nsISHistoryInternal)
+                      .addEntry(shEntry, true);
         }
       } catch(ex) {
         // Ignore the failure.  The content will be loaded via the URL
         // that was supplied in arg[0].
       }
     }
   }