mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-26 19:55:39 +00:00
Bug 1444580: Devirtualize the scroll to ref stuff. r=smaug
MozReview-Commit-ID: AhtY8Y684A9
This commit is contained in:
parent
5c084a2cca
commit
50b16abb7e
@ -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<nsIPresShell> 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)
|
||||
{
|
||||
|
@ -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;
|
||||
|
@ -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 <style scoped> support is enabled in this document.
|
||||
enum { eScopedStyle_Unknown, eScopedStyle_Disabled, eScopedStyle_Enabled };
|
||||
unsigned int mIsScopedStyleEnabled : 2;
|
||||
@ -4106,6 +4116,8 @@ protected:
|
||||
|
||||
nsWeakPtr mAutoFocusElement;
|
||||
|
||||
nsCString mScrollToRef;
|
||||
|
||||
// Weak reference to the scope object (aka the script global object)
|
||||
// that, unlike mScriptGlobalObject, is never unset once set. This
|
||||
// is a weak reference to avoid leaks due to circular references.
|
||||
|
Loading…
Reference in New Issue
Block a user