From 5861678ec0ac3fe00df62ff33b29a3cc0287f2ea Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Tue, 18 Mar 2003 04:09:24 +0000 Subject: [PATCH] Fix regression bug 197823 -- scrolling state restoration broken during history navigation if URL includes anchor name. Remove unnecessary and deleterious flush. r+sr=dbaron git-svn-id: svn://10.0.0.236/trunk@139643 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/content/html/document/src/nsHTMLContentSink.cpp | 4 +++- mozilla/content/xml/document/src/nsXMLContentSink.cpp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/mozilla/content/html/document/src/nsHTMLContentSink.cpp b/mozilla/content/html/document/src/nsHTMLContentSink.cpp index da457dc61e6..1eb7e77807e 100644 --- a/mozilla/content/html/document/src/nsHTMLContentSink.cpp +++ b/mozilla/content/html/document/src/nsHTMLContentSink.cpp @@ -4344,7 +4344,9 @@ HTMLContentSink::ScrollToRef(PRBool aReallyScroll) mDocument->GetShellAt(i, getter_AddRefs(shell)); if (shell) { // Scroll to the anchor - shell->FlushPendingNotifications(PR_FALSE); + if (aReallyScroll) { + shell->FlushPendingNotifications(PR_FALSE); + } // Check an empty string which might be caused by the UTF-8 conversion if (!ref.IsEmpty()) { diff --git a/mozilla/content/xml/document/src/nsXMLContentSink.cpp b/mozilla/content/xml/document/src/nsXMLContentSink.cpp index ebdc62cf1e2..0ec11a8835e 100644 --- a/mozilla/content/xml/document/src/nsXMLContentSink.cpp +++ b/mozilla/content/xml/document/src/nsXMLContentSink.cpp @@ -352,7 +352,9 @@ nsXMLContentSink::ScrollToRef(PRBool aReallyScroll) mDocument->GetShellAt(i, getter_AddRefs(shell)); if (shell) { // Scroll to the anchor - shell->FlushPendingNotifications(PR_FALSE); + if (aReallyScroll) { + shell->FlushPendingNotifications(PR_FALSE); + } // Check an empty string which might be caused by the UTF-8 conversion if (!ref.IsEmpty())