From 16ef48adcdb905c854ee25de8fcc586d389cdd9d Mon Sep 17 00:00:00 2001 From: "troy%netscape.com" Date: Thu, 11 Feb 1999 23:08:04 +0000 Subject: [PATCH] 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 --- .../html/document/src/nsHTMLContentSink.cpp | 14 +++++++++----- .../layout/html/document/src/nsHTMLContentSink.cpp | 14 +++++++++----- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/mozilla/content/html/document/src/nsHTMLContentSink.cpp b/mozilla/content/html/document/src/nsHTMLContentSink.cpp index 3a9dc631fe7..ad6ccb4f4fd 100644 --- a/mozilla/content/html/document/src/nsHTMLContentSink.cpp +++ b/mozilla/content/html/document/src/nsHTMLContentSink.cpp @@ -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 "); } diff --git a/mozilla/layout/html/document/src/nsHTMLContentSink.cpp b/mozilla/layout/html/document/src/nsHTMLContentSink.cpp index 3a9dc631fe7..ad6ccb4f4fd 100644 --- a/mozilla/layout/html/document/src/nsHTMLContentSink.cpp +++ b/mozilla/layout/html/document/src/nsHTMLContentSink.cpp @@ -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 "); }