diff --git a/layout/base/RestyleManager.cpp b/layout/base/RestyleManager.cpp index 482b9612c181..759e06e4a622 100644 --- a/layout/base/RestyleManager.cpp +++ b/layout/base/RestyleManager.cpp @@ -1821,10 +1821,12 @@ RestyleManager::DebugVerifyStyleTree(nsIFrame* aFrame) // aContent must be the content for the frame in question, which may be // :before/:after content -static void -TryStartingTransition(nsPresContext *aPresContext, nsIContent *aContent, - nsStyleContext *aOldStyleContext, - nsRefPtr *aNewStyleContext /* inout */) +/* static */ void +RestyleManager::TryStartingTransition(nsPresContext* aPresContext, + nsIContent* aContent, + nsStyleContext* aOldStyleContext, + nsRefPtr* + aNewStyleContext /* inout */) { if (!aContent || !aContent->IsElement()) { return; @@ -2608,8 +2610,8 @@ ElementRestyler::RestyleSelf(nsIFrame* aSelf, nsRestyleHint aRestyleHint) if (newContext != oldContext) { if (!copyFromContinuation) { - TryStartingTransition(mPresContext, aSelf->GetContent(), - oldContext, &newContext); + RestyleManager::TryStartingTransition(mPresContext, aSelf->GetContent(), + oldContext, &newContext); CaptureChange(oldContext, newContext, assumeDifferenceHint); } diff --git a/layout/base/RestyleManager.h b/layout/base/RestyleManager.h index 6c3e60f9a681..516f1fbb1d71 100644 --- a/layout/base/RestyleManager.h +++ b/layout/base/RestyleManager.h @@ -176,6 +176,19 @@ public: return mReframingStyleContexts; } + /** + * Try starting a transition for an element or a ::before or ::after + * pseudo-element, given an old and new style context. This may + * change the new style context if a transition is started. + * + * For the pseudo-elements, aContent must be the anonymous content + * that we're creating for that pseudo-element, not the real element. + */ + static void + TryStartingTransition(nsPresContext* aPresContext, nsIContent* aContent, + nsStyleContext* aOldStyleContext, + nsRefPtr* aNewStyleContext /* inout */); + private: void RestyleForEmptyChange(Element* aContainer);