Scroll browser window to top-left if anchor can not be found (quirks only) bug 80784. r=kin@netscape.com sr=attinasi@netscape.com

This commit is contained in:
kmcclusk%netscape.com 2001-10-17 01:06:19 +00:00
Родитель 7a0407bd6d
Коммит d850dc2072
2 изменённых файлов: 34 добавлений и 2 удалений

Просмотреть файл

@ -3914,7 +3914,23 @@ PresShell::GoToAnchor(const nsString& aAnchorName)
}
}
} else {
rv = NS_ERROR_FAILURE;
rv = NS_ERROR_FAILURE; //changed to NS_OK in quirks mode if ScrollTo is called
// Scroll to the top/left if the anchor can not be
// found (quirks mode only). @see bug 80784
nsCompatibility compatMode;
mPresContext->GetCompatibilityMode(&compatMode);
if ((compatMode == eCompatibility_NavQuirks) && (mViewManager)) {
// Get the viewport scroller
nsIScrollableView* scrollingView;
mViewManager->GetRootScrollableView(&scrollingView);
if (scrollingView) {
// Scroll to the top of the page
scrollingView->ScrollTo(0, 0, NS_VMREFRESH_IMMEDIATE);
rv = NS_OK;
}
}
}
return rv;

Просмотреть файл

@ -3914,7 +3914,23 @@ PresShell::GoToAnchor(const nsString& aAnchorName)
}
}
} else {
rv = NS_ERROR_FAILURE;
rv = NS_ERROR_FAILURE; //changed to NS_OK in quirks mode if ScrollTo is called
// Scroll to the top/left if the anchor can not be
// found (quirks mode only). @see bug 80784
nsCompatibility compatMode;
mPresContext->GetCompatibilityMode(&compatMode);
if ((compatMode == eCompatibility_NavQuirks) && (mViewManager)) {
// Get the viewport scroller
nsIScrollableView* scrollingView;
mViewManager->GetRootScrollableView(&scrollingView);
if (scrollingView) {
// Scroll to the top of the page
scrollingView->ScrollTo(0, 0, NS_VMREFRESH_IMMEDIATE);
rv = NS_OK;
}
}
}
return rv;