Partial fix for bug #644. We still re-load the document un-necessarily, but

at least now we move to the anchor


git-svn-id: svn://10.0.0.236/trunk@20447 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
troy%netscape.com
1999-02-11 23:08:04 +00:00
parent 5467c1838d
commit 16ef48adcd
2 changed files with 18 additions and 10 deletions

View File

@@ -2066,11 +2066,15 @@ HTMLContentSink::ScrollToRef()
if (nsnull != frame) {
nsIViewManager* vm = shell->GetViewManager();
if (nsnull != vm) {
nsIView* rootView = nsnull;
vm->GetRootView(rootView);
if (nsnull != rootView) {
nsIView* viewportView = nsnull;
vm->GetRootView(viewportView);
if (nsnull != viewportView) {
nsIView* viewportScrollView;
viewportView->GetChild(0, viewportScrollView);
// Try and get the nsIScrollableView interface
nsIScrollableView* sview = nsnull;
rootView->QueryInterface(kIScrollableViewIID, (void**) &sview);
viewportScrollView->QueryInterface(kIScrollableViewIID, (void**) &sview);
if (nsnull != sview) {
// Determine the x,y scroll offsets for the given
// frame. The offsets are relative to the
@@ -2079,7 +2083,7 @@ HTMLContentSink::ScrollToRef()
nsPoint offset;
nsIView* view;
frame->GetOffsetFromView(offset, &view);
if (view == rootView) {
if (view == viewportView) {
// XXX write me!
// printf("view==rootView ");
}