diff --git a/mozilla/content/events/src/nsEventStateManager.cpp b/mozilla/content/events/src/nsEventStateManager.cpp index eee45f695d3..a99d0da6989 100644 --- a/mozilla/content/events/src/nsEventStateManager.cpp +++ b/mozilla/content/events/src/nsEventStateManager.cpp @@ -55,10 +55,11 @@ #include "nsPIDOMWindow.h" #include "nsIEnumerator.h" #include "nsFrameTraversal.h" +#include "nsIDocShellTreeItem.h" +#include "nsIWebNavigation.h" #include "nsIServiceManager.h" #include "nsIPref.h" -#include "nsISessionHistory.h" #include "nsXULAtoms.h" #include "nsIDOMXULDocument.h" @@ -846,24 +847,12 @@ nsEventStateManager::PostHandleEvent(nsIPresContext* aPresContext, nsCOMPtr pcContainer; mPresContext->GetContainer(getter_AddRefs(pcContainer)); if (pcContainer) { - nsCOMPtr webShell = do_QueryInterface(pcContainer); - if (webShell) { - nsCOMPtr root; - webShell->GetRootWebShell(*getter_AddRefs(root)); - if (nsnull != root) { - nsCOMPtr sHist; - root->GetSessionHistory(*getter_AddRefs(sHist)); - if (sHist) { - if (numLines > 0) - { - sHist->GoBack(root); - } - else - { - sHist->GoForward(root); - } - } - } + nsCOMPtr webNav(do_QueryInterface(pcContainer)); + if (webNav) { + if (numLines > 0) + webNav->GoBack(); + else + webNav->GoForward(); } } } diff --git a/mozilla/layout/events/src/nsEventStateManager.cpp b/mozilla/layout/events/src/nsEventStateManager.cpp index eee45f695d3..a99d0da6989 100644 --- a/mozilla/layout/events/src/nsEventStateManager.cpp +++ b/mozilla/layout/events/src/nsEventStateManager.cpp @@ -55,10 +55,11 @@ #include "nsPIDOMWindow.h" #include "nsIEnumerator.h" #include "nsFrameTraversal.h" +#include "nsIDocShellTreeItem.h" +#include "nsIWebNavigation.h" #include "nsIServiceManager.h" #include "nsIPref.h" -#include "nsISessionHistory.h" #include "nsXULAtoms.h" #include "nsIDOMXULDocument.h" @@ -846,24 +847,12 @@ nsEventStateManager::PostHandleEvent(nsIPresContext* aPresContext, nsCOMPtr pcContainer; mPresContext->GetContainer(getter_AddRefs(pcContainer)); if (pcContainer) { - nsCOMPtr webShell = do_QueryInterface(pcContainer); - if (webShell) { - nsCOMPtr root; - webShell->GetRootWebShell(*getter_AddRefs(root)); - if (nsnull != root) { - nsCOMPtr sHist; - root->GetSessionHistory(*getter_AddRefs(sHist)); - if (sHist) { - if (numLines > 0) - { - sHist->GoBack(root); - } - else - { - sHist->GoForward(root); - } - } - } + nsCOMPtr webNav(do_QueryInterface(pcContainer)); + if (webNav) { + if (numLines > 0) + webNav->GoBack(); + else + webNav->GoForward(); } } }