Issue #2488 - Part 4: Remove the RestyleManagerHandle smart pointer class

This commit is contained in:
FranklinDM 2024-03-29 16:08:08 +08:00 committed by roytam1
commit 6803c1f710
24 changed files with 55 additions and 414 deletions

View file

@ -5,8 +5,7 @@
#include "mozilla/AnimationCollection.h"
#include "mozilla/RestyleManagerHandle.h"
#include "mozilla/RestyleManagerHandleInlines.h"
#include "mozilla/RestyleManager.h"
#include "nsAnimationManager.h" // For dom::CSSAnimation
#include "nsPresContext.h"
#include "nsTransitionManager.h" // For dom::CSSTransition
@ -138,7 +137,7 @@ AnimationCollection<AnimationType>::UpdateCheckGeneration(
nsPresContext* aPresContext)
{
mCheckGeneration =
aPresContext->RestyleManager()->AsGecko()->GetAnimationGeneration();
aPresContext->RestyleManager()->GetAnimationGeneration();
}
template<class AnimationType>

View file

@ -19,8 +19,7 @@
#include "nsAttrValue.h"
#include "nsAttrValueInlines.h"
#include "nsCSSPseudoElements.h"
#include "mozilla/RestyleManagerHandle.h"
#include "mozilla/RestyleManagerHandleInlines.h"
#include "mozilla/RestyleManager.h"
using namespace mozilla;
using namespace mozilla::dom;
@ -73,7 +72,7 @@ nsHTMLCSSStyleSheet::ElementRulesMatching(nsPresContext* aPresContext,
declaration = aElement->GetSMILOverrideStyleDeclaration();
if (declaration) {
RestyleManager* restyleManager = aPresContext->RestyleManager()->AsGecko();
RestyleManager* restyleManager = aPresContext->RestyleManager();
if (!restyleManager->SkipAnimationRules()) {
// Animation restyle (or non-restyle traversal of rules)
// Now we can walk SMIL overrride style, without triggering transitions.

View file

@ -34,8 +34,7 @@
#include "mozilla/dom/Element.h"
#include "nsHashKeys.h"
#include "mozilla/OperatorNewExtensions.h"
#include "mozilla/RestyleManagerHandle.h"
#include "mozilla/RestyleManagerHandleInlines.h"
#include "mozilla/RestyleManager.h"
using namespace mozilla;
using namespace mozilla::dom;

View file

@ -40,8 +40,7 @@
#include "nsCSSRules.h"
#include "nsPrintfCString.h"
#include "nsIFrame.h"
#include "mozilla/RestyleManagerHandle.h"
#include "mozilla/RestyleManagerHandleInlines.h"
#include "mozilla/RestyleManager.h"
#include "nsQueryObject.h"
#include <inttypes.h>
@ -1755,7 +1754,7 @@ nsStyleSet::ResolveStyleWithoutAnimation(dom::Element* aTarget,
pseudoType == CSSPseudoElementType::before ||
pseudoType == CSSPseudoElementType::after,
"unexpected type for animations");
RestyleManager* restyleManager = PresContext()->RestyleManager()->AsGecko();
RestyleManager* restyleManager = PresContext()->RestyleManager();
bool oldSkipAnimationRules = restyleManager->SkipAnimationRules();
restyleManager->SetSkipAnimationRules(true);
@ -2235,7 +2234,7 @@ nsStyleSet::ReparentStyleContext(nsStyleContext* aStyleContext,
CSSPseudoElementType pseudoType = aStyleContext->GetPseudoType();
nsRuleNode* ruleNode = aStyleContext->RuleNode();
NS_ASSERTION(!PresContext()->RestyleManager()->AsGecko()->SkipAnimationRules(),
NS_ASSERTION(!PresContext()->RestyleManager()->SkipAnimationRules(),
"we no longer handle SkipAnimationRules()");
nsRuleNode* visitedRuleNode = nullptr;
@ -2515,5 +2514,5 @@ nsStyleSet::ClearSelectors()
if (!mRuleTree) {
return;
}
PresContext()->RestyleManager()->AsGecko()->ClearSelectors();
PresContext()->RestyleManager()->ClearSelectors();
}

View file

@ -31,8 +31,7 @@
#include "nsDisplayList.h"
#include "nsStyleChangeList.h"
#include "nsStyleSet.h"
#include "mozilla/RestyleManagerHandle.h"
#include "mozilla/RestyleManagerHandleInlines.h"
#include "mozilla/RestyleManager.h"
#include "nsDOMMutationObserver.h"
using mozilla::TimeStamp;
@ -503,7 +502,7 @@ nsTransitionManager::StyleContextChanged(dom::Element *aElement,
if (collection &&
collection->mCheckGeneration ==
mPresContext->RestyleManager()->AsGecko()->GetAnimationGeneration()) {
mPresContext->RestyleManager()->GetAnimationGeneration()) {
// When we start a new transition, we immediately post a restyle.
// If the animation generation on the collection is current, that
// means *this* is that restyle, since we bump the animation
@ -914,7 +913,7 @@ nsTransitionManager::ConsiderInitiatingTransition(
OwningElementRef(*aElement, aNewStyleContext->GetPseudoType()));
animation->SetTimelineNoUpdate(timeline);
animation->SetCreationSequence(
mPresContext->RestyleManager()->AsGecko()->GetAnimationGeneration());
mPresContext->RestyleManager()->GetAnimationGeneration());
animation->SetEffectFromStyle(pt);
animation->PlayFromStyle();