Bug 685782. SetHistoryEntry should start syncing at the root of the docshell tree, not at its parent docshell. r=smaug
authorBoris Zbarsky <bzbarsky@mit.edu>
Mon, 03 Oct 2011 15:13:35 -0400
changeset 78005 69f7a86b4cb100e56de9dbe294c2a25b89a7860f
parent 78004 5a26e1aa86e56961bf1c83d688e7bda28a9a7b7b
child 78006 c9af88f9998b5b4d8b3bccaea30d4ae17303d11a
push id21260
push usermbrubeck@mozilla.com
push dateMon, 03 Oct 2011 23:22:50 +0000
treeherdermozilla-central@25b8388347af [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs685782
milestone10.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 685782. SetHistoryEntry should start syncing at the root of the docshell tree, not at its parent docshell. r=smaug
docshell/base/nsDocShell.cpp
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -10445,19 +10445,19 @@ nsDocShell::SetHistoryEntry(nsCOMPtr<nsI
     if (newRootEntry) {
         // newRootEntry is now the new root entry.
         // Find the old root entry as well.
 
         // Need a strong ref. on |oldRootEntry| so it isn't destroyed when
         // SetChildHistoryEntry() does SwapHistoryEntries() (bug 304639).
         nsCOMPtr<nsISHEntry> oldRootEntry = GetRootSHEntry(*aPtr);
         if (oldRootEntry) {
-            nsCOMPtr<nsIDocShellTreeItem> parentAsItem;
-            GetSameTypeParent(getter_AddRefs(parentAsItem));
-            nsCOMPtr<nsIDocShell> rootShell = do_QueryInterface(parentAsItem);
+            nsCOMPtr<nsIDocShellTreeItem> rootAsItem;
+            GetSameTypeRootTreeItem(getter_AddRefs(rootAsItem));
+            nsCOMPtr<nsIDocShell> rootShell = do_QueryInterface(rootAsItem);
             if (rootShell) { // if we're the root just set it, nothing to swap
                 SwapEntriesData data = { this, newRootEntry };
                 nsIDocShell *rootIDocShell =
                     static_cast<nsIDocShell*>(rootShell);
                 nsDocShell *rootDocShell = static_cast<nsDocShell*>
                                                       (rootIDocShell);
 
 #ifdef NS_DEBUG