Bug 1444580: Devirtualize more animation stuff. r=smaug

MozReview-Commit-ID: 4U6oIg81Pdw
This commit is contained in:
Emilio Cobos Álvarez 2018-03-11 14:33:53 +01:00
Родитель 64c7ec5de6
Коммит 54f085ea7b
3 изменённых файлов: 14 добавлений и 23 удалений

Просмотреть файл

@ -6723,7 +6723,7 @@ nsDocument::EnumerateExternalResources(nsSubDocEnumFunc aCallback, void* aData)
}
nsSMILAnimationController*
nsDocument::GetAnimationController()
nsIDocument::GetAnimationController()
{
// We create the animation controller lazily because most documents won't want
// one and only SVG documents and the like will call this
@ -6754,7 +6754,7 @@ nsDocument::GetAnimationController()
}
PendingAnimationTracker*
nsDocument::GetOrCreatePendingAnimationTracker()
nsIDocument::GetOrCreatePendingAnimationTracker()
{
if (!mPendingAnimationTracker) {
mPendingAnimationTracker = new PendingAnimationTracker(this);

Просмотреть файл

@ -503,19 +503,6 @@ public:
virtual void
EnumerateExternalResources(nsSubDocEnumFunc aCallback, void* aData) override;
// Returns our (lazily-initialized) animation controller.
// If HasAnimationController is true, this is guaranteed to return non-null.
nsSMILAnimationController* GetAnimationController() override;
virtual mozilla::PendingAnimationTracker*
GetPendingAnimationTracker() final
{
return mPendingAnimationTracker;
}
virtual mozilla::PendingAnimationTracker*
GetOrCreatePendingAnimationTracker() override;
virtual void SuppressEventHandling(uint32_t aIncrease) override;
virtual void UnsuppressEventHandlingAndFireEvents(bool aFireEvents) override;
@ -644,10 +631,6 @@ protected:
void EnsureOnloadBlocker();
// Tracker for animations that are waiting to start.
// nullptr until GetOrCreatePendingAnimationTracker is called.
RefPtr<mozilla::PendingAnimationTracker> mPendingAnimationTracker;
public:
RefPtr<mozilla::EventListenerManager> mListenerManager;

Просмотреть файл

@ -2533,19 +2533,23 @@ public:
// Getter for this document's SMIL Animation Controller. Performs lazy
// initialization, if this document supports animation and if
// mAnimationController isn't yet initialized.
virtual nsSMILAnimationController* GetAnimationController() = 0;
//
// If HasAnimationController is true, this is guaranteed to return non-null.
nsSMILAnimationController* GetAnimationController();
// Gets the tracker for animations that are waiting to start.
// Returns nullptr if there is no pending animation tracker for this document
// which will be the case if there have never been any CSS animations or
// transitions on elements in the document.
virtual mozilla::PendingAnimationTracker* GetPendingAnimationTracker() = 0;
mozilla::PendingAnimationTracker* GetPendingAnimationTracker()
{
return mPendingAnimationTracker;
}
// Gets the tracker for animations that are waiting to start and
// creates it if it doesn't already exist. As a result, the return value
// will never be nullptr.
virtual mozilla::PendingAnimationTracker*
GetOrCreatePendingAnimationTracker() = 0;
mozilla::PendingAnimationTracker* GetOrCreatePendingAnimationTracker();
/**
* Prevents user initiated events from being dispatched to the document and
@ -4178,6 +4182,10 @@ protected:
nsRefPtrHashtable<nsPtrHashKey<nsIContent>, mozilla::dom::BoxObject>*
mBoxObjectTable;
// Tracker for animations that are waiting to start.
// nullptr until GetOrCreatePendingAnimationTracker is called.
RefPtr<mozilla::PendingAnimationTracker> mPendingAnimationTracker;
public:
js::ExpandoAndGeneration mExpandoAndGeneration;