Loading docshell/base/nsDocShell.cpp +99 −82 Original line number Diff line number Diff line Loading @@ -1678,6 +1678,10 @@ NS_IMETHODIMP nsDocShell::GetCurScrollPos(PRInt32 scrollOrientation, nsCOMPtr<nsIScrollableView> scrollView; NS_ENSURE_SUCCESS(GetRootScrollableView(getter_AddRefs(scrollView)), NS_ERROR_FAILURE); if (!scrollView) { return NS_ERROR_FAILURE; } nscoord x, y; NS_ENSURE_SUCCESS(scrollView->GetScrollPosition(x, y), NS_ERROR_FAILURE); Loading @@ -1704,6 +1708,10 @@ NS_IMETHODIMP nsDocShell::SetCurScrollPos(PRInt32 scrollOrientation, nsCOMPtr<nsIScrollableView> scrollView; NS_ENSURE_SUCCESS(GetRootScrollableView(getter_AddRefs(scrollView)), NS_ERROR_FAILURE); if (!scrollView) { return NS_ERROR_FAILURE; } PRInt32 other; PRInt32 x; Loading Loading @@ -1738,6 +1746,10 @@ NS_IMETHODIMP nsDocShell::SetCurScrollPosEx(PRInt32 curHorizontalPos, nsCOMPtr<nsIScrollableView> scrollView; NS_ENSURE_SUCCESS(GetRootScrollableView(getter_AddRefs(scrollView)), NS_ERROR_FAILURE); if (!scrollView) { return NS_ERROR_FAILURE; } NS_ENSURE_SUCCESS(scrollView->ScrollTo(curHorizontalPos, curVerticalPos, NS_VMREFRESH_IMMEDIATE), NS_ERROR_FAILURE); Loading @@ -1753,6 +1765,10 @@ NS_IMETHODIMP nsDocShell::GetScrollRange(PRInt32 scrollOrientation, nsCOMPtr<nsIScrollableView> scrollView; NS_ENSURE_SUCCESS(GetRootScrollableView(getter_AddRefs(scrollView)), NS_ERROR_FAILURE); if (!scrollView) { return NS_ERROR_FAILURE; } PRInt32 cx; PRInt32 cy; Loading Loading @@ -1918,6 +1934,10 @@ NS_IMETHODIMP nsDocShell::GetScrollbarVisibility(PRBool* verticalVisible, nsCOMPtr<nsIScrollableView> scrollView; NS_ENSURE_SUCCESS(GetRootScrollableView(getter_AddRefs(scrollView)), NS_ERROR_FAILURE); if (!scrollView) { return NS_ERROR_FAILURE; } PRBool vertVisible; PRBool horizVisible; Loading @@ -1943,6 +1963,10 @@ NS_IMETHODIMP nsDocShell::ScrollByLines(PRInt32 numLines) NS_ENSURE_SUCCESS(GetRootScrollableView(getter_AddRefs(scrollView)), NS_ERROR_FAILURE); if (!scrollView) { return NS_ERROR_FAILURE; } NS_ENSURE_SUCCESS(scrollView->ScrollByLines(0, numLines), NS_ERROR_FAILURE); Loading @@ -1955,6 +1979,10 @@ NS_IMETHODIMP nsDocShell::ScrollByPages(PRInt32 numPages) NS_ENSURE_SUCCESS(GetRootScrollableView(getter_AddRefs(scrollView)), NS_ERROR_FAILURE); if (!scrollView) { return NS_ERROR_FAILURE; } NS_ENSURE_SUCCESS(scrollView->ScrollByPages(numPages), NS_ERROR_FAILURE); Loading Loading @@ -2306,38 +2334,7 @@ NS_IMETHODIMP nsDocShell::InternalLoad(nsIURI* aURI, nsIURI* aReferrer, if(wasAnchor) { mLoadType = aLoadType; PRBool updateHistory = PR_TRUE; // Determine if this type of load should update history switch(mLoadType) { case loadHistory: case loadReloadNormal: case loadReloadBypassCache: case loadReloadBypassProxy: case loadReloadBypassProxyAndCache: updateHistory = PR_FALSE; break; } if (updateHistory) { UpdateCurrentSessionHistory(); UpdateCurrentGlobalHistory(); PRBool shouldAdd = PR_FALSE; ShouldAddToSessionHistory(aURI, &shouldAdd); if(shouldAdd) AddToSessionHistory(aURI, nsnull); shouldAdd = PR_FALSE; ShouldAddToGlobalHistory(aURI, &shouldAdd); if(shouldAdd) AddToGlobalHistory(aURI); } SetCurrentURI(aURI); OnNewURI(aURI, nsnull, mLoadType); return NS_OK; } Loading Loading @@ -2750,6 +2747,12 @@ NS_IMETHODIMP nsDocShell::ScrollIfAnchor(nsIURI* aURI, PRBool* aWasAnchor) sCurrentLeft = sCurrent; } // Exit when there are no anchors if (hashNew <= 0 && hashCurrent <= 0) { return NS_OK; } // Compare the URIs. // // NOTE: this is case sensitive so it won't pick up www.ABC.com and Loading Loading @@ -2790,11 +2793,9 @@ NS_IMETHODIMP nsDocShell::ScrollIfAnchor(nsIURI* aURI, PRBool* aWasAnchor) } NS_IMETHODIMP nsDocShell::OnLoadingSite(nsIChannel* aChannel) void nsDocShell::OnNewURI(nsIURI *aURI, nsIChannel *aChannel, loadType aLoadType) { nsCOMPtr<nsIURI> uri; aChannel->GetURI(getter_AddRefs(uri)); NS_ENSURE_TRUE(uri, NS_ERROR_FAILURE); NS_ASSERTION(aURI, "uri is null"); UpdateCurrentSessionHistory(); UpdateCurrentGlobalHistory(); Loading @@ -2802,7 +2803,7 @@ NS_IMETHODIMP nsDocShell::OnLoadingSite(nsIChannel* aChannel) PRBool updateHistory = PR_TRUE; // Determine if this type of load should update history switch(mLoadType) switch(aLoadType) { case loadHistory: case loadReloadNormal: Loading @@ -2826,17 +2827,22 @@ NS_IMETHODIMP nsDocShell::OnLoadingSite(nsIChannel* aChannel) { PRBool shouldAdd = PR_FALSE; ShouldAddToSessionHistory(uri, &shouldAdd); ShouldAddToSessionHistory(aURI, &shouldAdd); if(shouldAdd) AddToSessionHistory(uri, aChannel); { AddToSessionHistory(aURI, aChannel); } shouldAdd = PR_FALSE; ShouldAddToGlobalHistory(uri, &shouldAdd); ShouldAddToGlobalHistory(aURI, &shouldAdd); if(shouldAdd) AddToGlobalHistory(uri); { AddToGlobalHistory(aURI); } } SetCurrentURI(uri); SetCurrentURI(aURI); nsCOMPtr<nsIHTTPChannel> httpChannel(do_QueryInterface(aChannel)); if(httpChannel) { Loading @@ -2846,6 +2852,16 @@ NS_IMETHODIMP nsDocShell::OnLoadingSite(nsIChannel* aChannel) } mInitialPageLoad = PR_FALSE; } NS_IMETHODIMP nsDocShell::OnLoadingSite(nsIChannel* aChannel) { nsCOMPtr<nsIURI> uri; aChannel->GetURI(getter_AddRefs(uri)); NS_ENSURE_TRUE(uri, NS_ERROR_FAILURE); OnNewURI(uri, aChannel, mLoadType); return NS_OK; } Loading Loading @@ -3244,9 +3260,10 @@ NS_IMETHODIMP nsDocShell::GetRootScrollableView(nsIScrollableView** aOutScrollVi NS_ENSURE_SUCCESS(viewManager->GetRootScrollableView(aOutScrollView), NS_ERROR_FAILURE); NS_ASSERTION(*aOutScrollView, "no scroll view"); if (!*aOutScrollView) return NS_ERROR_FAILURE; if (*aOutScrollView == nsnull) { return NS_ERROR_FAILURE; } return NS_OK; } Loading docshell/base/nsDocShell.h +1 −0 Original line number Diff line number Diff line Loading @@ -197,6 +197,7 @@ protected: NS_IMETHOD StopCurrentLoads(); NS_IMETHOD ScrollIfAnchor(nsIURI* aURI, PRBool* aWasAnchor); NS_IMETHOD OnLoadingSite(nsIChannel* aChannel); virtual void OnNewURI(nsIURI *aURI, nsIChannel* aChannel, loadType aLoadType); virtual void SetCurrentURI(nsIURI* aURI); virtual void SetReferrerURI(nsIURI* aURI); Loading Loading
docshell/base/nsDocShell.cpp +99 −82 Original line number Diff line number Diff line Loading @@ -1678,6 +1678,10 @@ NS_IMETHODIMP nsDocShell::GetCurScrollPos(PRInt32 scrollOrientation, nsCOMPtr<nsIScrollableView> scrollView; NS_ENSURE_SUCCESS(GetRootScrollableView(getter_AddRefs(scrollView)), NS_ERROR_FAILURE); if (!scrollView) { return NS_ERROR_FAILURE; } nscoord x, y; NS_ENSURE_SUCCESS(scrollView->GetScrollPosition(x, y), NS_ERROR_FAILURE); Loading @@ -1704,6 +1708,10 @@ NS_IMETHODIMP nsDocShell::SetCurScrollPos(PRInt32 scrollOrientation, nsCOMPtr<nsIScrollableView> scrollView; NS_ENSURE_SUCCESS(GetRootScrollableView(getter_AddRefs(scrollView)), NS_ERROR_FAILURE); if (!scrollView) { return NS_ERROR_FAILURE; } PRInt32 other; PRInt32 x; Loading Loading @@ -1738,6 +1746,10 @@ NS_IMETHODIMP nsDocShell::SetCurScrollPosEx(PRInt32 curHorizontalPos, nsCOMPtr<nsIScrollableView> scrollView; NS_ENSURE_SUCCESS(GetRootScrollableView(getter_AddRefs(scrollView)), NS_ERROR_FAILURE); if (!scrollView) { return NS_ERROR_FAILURE; } NS_ENSURE_SUCCESS(scrollView->ScrollTo(curHorizontalPos, curVerticalPos, NS_VMREFRESH_IMMEDIATE), NS_ERROR_FAILURE); Loading @@ -1753,6 +1765,10 @@ NS_IMETHODIMP nsDocShell::GetScrollRange(PRInt32 scrollOrientation, nsCOMPtr<nsIScrollableView> scrollView; NS_ENSURE_SUCCESS(GetRootScrollableView(getter_AddRefs(scrollView)), NS_ERROR_FAILURE); if (!scrollView) { return NS_ERROR_FAILURE; } PRInt32 cx; PRInt32 cy; Loading Loading @@ -1918,6 +1934,10 @@ NS_IMETHODIMP nsDocShell::GetScrollbarVisibility(PRBool* verticalVisible, nsCOMPtr<nsIScrollableView> scrollView; NS_ENSURE_SUCCESS(GetRootScrollableView(getter_AddRefs(scrollView)), NS_ERROR_FAILURE); if (!scrollView) { return NS_ERROR_FAILURE; } PRBool vertVisible; PRBool horizVisible; Loading @@ -1943,6 +1963,10 @@ NS_IMETHODIMP nsDocShell::ScrollByLines(PRInt32 numLines) NS_ENSURE_SUCCESS(GetRootScrollableView(getter_AddRefs(scrollView)), NS_ERROR_FAILURE); if (!scrollView) { return NS_ERROR_FAILURE; } NS_ENSURE_SUCCESS(scrollView->ScrollByLines(0, numLines), NS_ERROR_FAILURE); Loading @@ -1955,6 +1979,10 @@ NS_IMETHODIMP nsDocShell::ScrollByPages(PRInt32 numPages) NS_ENSURE_SUCCESS(GetRootScrollableView(getter_AddRefs(scrollView)), NS_ERROR_FAILURE); if (!scrollView) { return NS_ERROR_FAILURE; } NS_ENSURE_SUCCESS(scrollView->ScrollByPages(numPages), NS_ERROR_FAILURE); Loading Loading @@ -2306,38 +2334,7 @@ NS_IMETHODIMP nsDocShell::InternalLoad(nsIURI* aURI, nsIURI* aReferrer, if(wasAnchor) { mLoadType = aLoadType; PRBool updateHistory = PR_TRUE; // Determine if this type of load should update history switch(mLoadType) { case loadHistory: case loadReloadNormal: case loadReloadBypassCache: case loadReloadBypassProxy: case loadReloadBypassProxyAndCache: updateHistory = PR_FALSE; break; } if (updateHistory) { UpdateCurrentSessionHistory(); UpdateCurrentGlobalHistory(); PRBool shouldAdd = PR_FALSE; ShouldAddToSessionHistory(aURI, &shouldAdd); if(shouldAdd) AddToSessionHistory(aURI, nsnull); shouldAdd = PR_FALSE; ShouldAddToGlobalHistory(aURI, &shouldAdd); if(shouldAdd) AddToGlobalHistory(aURI); } SetCurrentURI(aURI); OnNewURI(aURI, nsnull, mLoadType); return NS_OK; } Loading Loading @@ -2750,6 +2747,12 @@ NS_IMETHODIMP nsDocShell::ScrollIfAnchor(nsIURI* aURI, PRBool* aWasAnchor) sCurrentLeft = sCurrent; } // Exit when there are no anchors if (hashNew <= 0 && hashCurrent <= 0) { return NS_OK; } // Compare the URIs. // // NOTE: this is case sensitive so it won't pick up www.ABC.com and Loading Loading @@ -2790,11 +2793,9 @@ NS_IMETHODIMP nsDocShell::ScrollIfAnchor(nsIURI* aURI, PRBool* aWasAnchor) } NS_IMETHODIMP nsDocShell::OnLoadingSite(nsIChannel* aChannel) void nsDocShell::OnNewURI(nsIURI *aURI, nsIChannel *aChannel, loadType aLoadType) { nsCOMPtr<nsIURI> uri; aChannel->GetURI(getter_AddRefs(uri)); NS_ENSURE_TRUE(uri, NS_ERROR_FAILURE); NS_ASSERTION(aURI, "uri is null"); UpdateCurrentSessionHistory(); UpdateCurrentGlobalHistory(); Loading @@ -2802,7 +2803,7 @@ NS_IMETHODIMP nsDocShell::OnLoadingSite(nsIChannel* aChannel) PRBool updateHistory = PR_TRUE; // Determine if this type of load should update history switch(mLoadType) switch(aLoadType) { case loadHistory: case loadReloadNormal: Loading @@ -2826,17 +2827,22 @@ NS_IMETHODIMP nsDocShell::OnLoadingSite(nsIChannel* aChannel) { PRBool shouldAdd = PR_FALSE; ShouldAddToSessionHistory(uri, &shouldAdd); ShouldAddToSessionHistory(aURI, &shouldAdd); if(shouldAdd) AddToSessionHistory(uri, aChannel); { AddToSessionHistory(aURI, aChannel); } shouldAdd = PR_FALSE; ShouldAddToGlobalHistory(uri, &shouldAdd); ShouldAddToGlobalHistory(aURI, &shouldAdd); if(shouldAdd) AddToGlobalHistory(uri); { AddToGlobalHistory(aURI); } } SetCurrentURI(uri); SetCurrentURI(aURI); nsCOMPtr<nsIHTTPChannel> httpChannel(do_QueryInterface(aChannel)); if(httpChannel) { Loading @@ -2846,6 +2852,16 @@ NS_IMETHODIMP nsDocShell::OnLoadingSite(nsIChannel* aChannel) } mInitialPageLoad = PR_FALSE; } NS_IMETHODIMP nsDocShell::OnLoadingSite(nsIChannel* aChannel) { nsCOMPtr<nsIURI> uri; aChannel->GetURI(getter_AddRefs(uri)); NS_ENSURE_TRUE(uri, NS_ERROR_FAILURE); OnNewURI(uri, aChannel, mLoadType); return NS_OK; } Loading Loading @@ -3244,9 +3260,10 @@ NS_IMETHODIMP nsDocShell::GetRootScrollableView(nsIScrollableView** aOutScrollVi NS_ENSURE_SUCCESS(viewManager->GetRootScrollableView(aOutScrollView), NS_ERROR_FAILURE); NS_ASSERTION(*aOutScrollView, "no scroll view"); if (!*aOutScrollView) return NS_ERROR_FAILURE; if (*aOutScrollView == nsnull) { return NS_ERROR_FAILURE; } return NS_OK; } Loading
docshell/base/nsDocShell.h +1 −0 Original line number Diff line number Diff line Loading @@ -197,6 +197,7 @@ protected: NS_IMETHOD StopCurrentLoads(); NS_IMETHOD ScrollIfAnchor(nsIURI* aURI, PRBool* aWasAnchor); NS_IMETHOD OnLoadingSite(nsIChannel* aChannel); virtual void OnNewURI(nsIURI *aURI, nsIChannel* aChannel, loadType aLoadType); virtual void SetCurrentURI(nsIURI* aURI); virtual void SetReferrerURI(nsIURI* aURI); Loading