diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp index a50de435b811..3646da9d5c0b 100644 --- a/dom/base/nsDocument.cpp +++ b/dom/base/nsDocument.cpp @@ -1494,6 +1494,8 @@ nsIDocument::nsIDocument() mDOMInteractiveSet(false), mDOMCompleteSet(false), mAutoFocusFired(false), + mScrolledToRefAlready(false), + mChangeScrollPosWhenScrollingToRef(false), mIsScopedStyleEnabled(eScopedStyle_Unknown), mPendingFullscreenRequests(0), mCompatMode(eCompatibility_FullStandards), @@ -1557,8 +1559,6 @@ nsDocument::nsDocument(const char* aContentType) , mOnloadBlockCount(0) , mAsyncOnloadBlockCount(0) , mPreloadPictureDepth(0) - , mScrolledToRefAlready(0) - , mChangeScrollPosWhenScrollingToRef(0) , mValidWidth(false) , mValidHeight(false) , mAutoSize(false) @@ -9434,7 +9434,7 @@ nsIDocument::TriggerAutoFocus() } void -nsDocument::SetScrollToRef(nsIURI *aDocumentURI) +nsIDocument::SetScrollToRef(nsIURI* aDocumentURI) { if (!aDocumentURI) { return; @@ -9466,7 +9466,7 @@ nsDocument::SetScrollToRef(nsIURI *aDocumentURI) } void -nsDocument::ScrollToRef() +nsIDocument::ScrollToRef() { if (mScrolledToRefAlready) { nsCOMPtr shell = GetShell(); @@ -9525,18 +9525,6 @@ nsDocument::ScrollToRef() } } -void -nsDocument::ResetScrolledToRefAlready() -{ - mScrolledToRefAlready = false; -} - -void -nsDocument::SetChangeScrollPosWhenScrollingToRef(bool aValue) -{ - mChangeScrollPosWhenScrollingToRef = aValue; -} - void nsIDocument::RegisterActivityObserver(nsISupports* aSupports) { diff --git a/dom/base/nsDocument.h b/dom/base/nsDocument.h index 97334d413f44..559a6efb1925 100644 --- a/dom/base/nsDocument.h +++ b/dom/base/nsDocument.h @@ -591,11 +591,6 @@ public: // Only BlockOnload should call this! void AsyncBlockOnload(); - virtual void SetScrollToRef(nsIURI *aDocumentURI) override; - virtual void ScrollToRef() override; - virtual void ResetScrolledToRefAlready() override; - virtual void SetChangeScrollPosWhenScrollingToRef(bool aValue) override; - // Returns the size of the mBlockedTrackingNodes array. (nsIDocument.h) // // This array contains nodes that have been blocked to prevent @@ -792,10 +787,6 @@ private: // Set if we've found a URL for the current picture nsString mPreloadPictureFoundSource; - nsCString mScrollToRef; - uint8_t mScrolledToRefAlready : 1; - uint8_t mChangeScrollPosWhenScrollingToRef : 1; - // These member variables cache information about the viewport so we don't have to // recalculate it each time. bool mValidWidth, mValidHeight; diff --git a/dom/base/nsIDocument.h b/dom/base/nsIDocument.h index 306f05224c38..afa5266d182e 100644 --- a/dom/base/nsIDocument.h +++ b/dom/base/nsIDocument.h @@ -2769,10 +2769,17 @@ public: void SetAutoFocusElement(Element* aAutoFocusElement); void TriggerAutoFocus(); - virtual void SetScrollToRef(nsIURI *aDocumentURI) = 0; - virtual void ScrollToRef() = 0; - virtual void ResetScrolledToRefAlready() = 0; - virtual void SetChangeScrollPosWhenScrollingToRef(bool aValue) = 0; + void SetScrollToRef(nsIURI* aDocumentURI); + void ScrollToRef(); + void ResetScrolledToRefAlready() + { + mScrolledToRefAlready = false; + } + + void SetChangeScrollPosWhenScrollingToRef(bool aValue) + { + mChangeScrollPosWhenScrollingToRef = aValue; + } using mozilla::dom::DocumentOrShadowRoot::GetElementById; using mozilla::dom::DocumentOrShadowRoot::GetElementsByTagName; @@ -3874,6 +3881,9 @@ protected: bool mDOMCompleteSet: 1; bool mAutoFocusFired: 1; + bool mScrolledToRefAlready : 1; + bool mChangeScrollPosWhenScrollingToRef : 1; + // Whether