diff --git a/dom/animation/EffectCompositor.cpp b/dom/animation/EffectCompositor.cpp index 802cbbb1e3..21f19d5974 100644 --- a/dom/animation/EffectCompositor.cpp +++ b/dom/animation/EffectCompositor.cpp @@ -14,8 +14,7 @@ #include "mozilla/AnimationUtils.h" #include "mozilla/EffectSet.h" #include "mozilla/LayerAnimationInfo.h" -#include "mozilla/RestyleManagerHandle.h" -#include "mozilla/RestyleManagerHandleInlines.h" +#include "mozilla/RestyleManager.h" #include "nsComputedDOMStyle.h" // nsComputedDOMStyle::GetPresShellForContent #include "nsCSSPropertyIDSet.h" #include "nsCSSProps.h" @@ -202,7 +201,7 @@ EffectCompositor::RequestRestyle(dom::Element* aElement, if (aRestyleType == RestyleType::Layer) { // Prompt layers to re-sync their animations. - mPresContext->RestyleManager()->AsGecko()->IncrementAnimationGeneration(); + mPresContext->RestyleManager()->IncrementAnimationGeneration(); EffectSet* effectSet = EffectSet::GetEffectSet(aElement, aPseudoType); if (effectSet) { @@ -314,7 +313,7 @@ EffectCompositor::GetAnimationRule(dom::Element* aElement, return nullptr; } - if (mPresContext->RestyleManager()->AsGecko()->SkipAnimationRules()) { + if (mPresContext->RestyleManager()->SkipAnimationRules()) { // We don't need to worry about updating mElementsToRestyle in this case // since this is not the animation restyle we requested when we called // PostRestyleForAnimation (see comment at start of this method). diff --git a/dom/animation/EffectSet.cpp b/dom/animation/EffectSet.cpp index 3731e47bae..b528bae16d 100644 --- a/dom/animation/EffectSet.cpp +++ b/dom/animation/EffectSet.cpp @@ -5,8 +5,7 @@ #include "EffectSet.h" #include "mozilla/dom/Element.h" // For Element -#include "mozilla/RestyleManagerHandle.h" -#include "mozilla/RestyleManagerHandleInlines.h" +#include "mozilla/RestyleManager.h" #include "nsCSSPseudoElements.h" // For CSSPseudoElementType #include "nsCycleCollectionNoteChild.h" // For CycleCollectionNoteChild #include "nsPresContext.h" @@ -111,7 +110,7 @@ void EffectSet::UpdateAnimationGeneration(nsPresContext* aPresContext) { mAnimationGeneration = - aPresContext->RestyleManager()->AsGecko()->GetAnimationGeneration(); + aPresContext->RestyleManager()->GetAnimationGeneration(); } /* static */ nsIAtom** diff --git a/dom/svg/nsSVGElement.cpp b/dom/svg/nsSVGElement.cpp index a71b0d6486..9698617042 100644 --- a/dom/svg/nsSVGElement.cpp +++ b/dom/svg/nsSVGElement.cpp @@ -54,8 +54,7 @@ #include "nsSMILAnimationController.h" #include "mozilla/dom/SVGElementBinding.h" #include "mozilla/Unused.h" -#include "mozilla/RestyleManagerHandle.h" -#include "mozilla/RestyleManagerHandleInlines.h" +#include "mozilla/RestyleManager.h" using namespace mozilla; using namespace mozilla::dom; @@ -927,9 +926,9 @@ nsSVGElement::WalkAnimatedContentStyleRules(nsRuleWalker* aRuleWalker) // whether this is a "no-animation restyle". (This should match the check // in nsHTMLCSSStyleSheet::RulesMatching(), where we determine whether to // apply the SMILOverrideStyle.) - RestyleManagerHandle restyleManager = + RestyleManager* restyleManager = aRuleWalker->PresContext()->RestyleManager(); - if (!restyleManager->AsGecko()->SkipAnimationRules()) { + if (!restyleManager->SkipAnimationRules()) { // update/walk the animated content style rule. css::StyleRule* animContentStyleRule = GetAnimatedContentStyleRule(); if (!animContentStyleRule) { diff --git a/layout/base/RestyleManagerHandle.h b/layout/base/RestyleManagerHandle.h deleted file mode 100644 index 9cebd030a4..0000000000 --- a/layout/base/RestyleManagerHandle.h +++ /dev/null @@ -1,155 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef mozilla_RestyleManagerHandle_h -#define mozilla_RestyleManagerHandle_h - -#include "mozilla/Assertions.h" -#include "mozilla/EventStates.h" -#include "mozilla/HandleRefPtr.h" -#include "mozilla/RefCountType.h" -#include "nsChangeHint.h" - -namespace mozilla { -class RestyleManager; -namespace dom { -class Element; -} // namespace dom -} // namespace mozilla -class nsAttrValue; -class nsIAtom; -class nsIContent; -class nsIFrame; -class nsStyleChangeList; - -namespace mozilla { - -/** - * Smart pointer class that can hold a pointer to a RestyleManager. - */ -class RestyleManagerHandle -{ -public: - typedef HandleRefPtr RefPtr; - - // We define this Ptr class with a RestyleManager API that forwards on to the - // wrapped pointer, rather than putting these methods on RestyleManagerHandle - // itself, so that we can have RestyleManagerHandle behave like a smart - // pointer and be dereferenced with operator->. - class Ptr - { - public: - friend class ::mozilla::RestyleManagerHandle; - - RestyleManager* AsGecko() - { - return reinterpret_cast(mValue); - } - - RestyleManager* GetAsGecko() { return AsGecko(); } - - const RestyleManager* AsGecko() const - { - return const_cast(this)->AsGecko(); - } - - const RestyleManager* GetAsGecko() const { return AsGecko(); } - - // These inline methods are defined in RestyleManagerHandleInlines.h. - inline MozExternalRefCountType AddRef(); - inline MozExternalRefCountType Release(); - - // Restyle manager interface. These inline methods are defined in - // RestyleManagerHandleInlines.h and just forward to the underlying - // RestyleManager. See corresponding comments in - // RestyleManager.h for descriptions of these methods. - - inline void Disconnect(); - inline void PostRestyleEvent(dom::Element* aElement, - nsRestyleHint aRestyleHint, - nsChangeHint aMinChangeHint); - inline void PostRestyleEventForLazyConstruction(); - inline void RebuildAllStyleData(nsChangeHint aExtraHint, - nsRestyleHint aRestyleHint); - inline void PostRebuildAllStyleDataEvent(nsChangeHint aExtraHint, - nsRestyleHint aRestyleHint); - inline void ProcessPendingRestyles(); - inline void ContentInserted(nsINode* aContainer, - nsIContent* aChild); - inline void ContentAppended(nsIContent* aContainer, - nsIContent* aFirstNewContent); - inline void ContentRemoved(nsINode* aContainer, - nsIContent* aOldChild, - nsIContent* aFollowingSibling); - inline void RestyleForInsertOrChange(nsINode* aContainer, - nsIContent* aChild); - inline void RestyleForAppend(nsIContent* aContainer, - nsIContent* aFirstNewContent); - inline void ContentStateChanged(nsIContent* aContent, - EventStates aStateMask); - inline void AttributeWillChange(dom::Element* aElement, - int32_t aNameSpaceID, - nsIAtom* aAttribute, - int32_t aModType, - const nsAttrValue* aNewValue); - inline void AttributeChanged(dom::Element* aElement, - int32_t aNameSpaceID, - nsIAtom* aAttribute, - int32_t aModType, - const nsAttrValue* aOldValue); - inline nsresult ReparentStyleContext(nsIFrame* aFrame); - inline bool HasPendingRestyles(); - inline uint64_t GetRestyleGeneration() const; - inline uint32_t GetHoverGeneration() const; - inline void SetObservingRefreshDriver(bool aObserving); - inline nsresult ProcessRestyledFrames(nsStyleChangeList& aChangeList); - inline void FlushOverflowChangedTracker(); - inline void NotifyDestroyingFrame(nsIFrame* aFrame); - - private: - // Stores a pointer to an RestyleManager. - uintptr_t mValue; - }; - - MOZ_IMPLICIT RestyleManagerHandle(decltype(nullptr) = nullptr) - { - mPtr.mValue = 0; - } - RestyleManagerHandle(const RestyleManagerHandle& aOth) - { - mPtr.mValue = aOth.mPtr.mValue; - } - MOZ_IMPLICIT RestyleManagerHandle(RestyleManager* aManager) - { - *this = aManager; - } - - RestyleManagerHandle& operator=(decltype(nullptr)) - { - mPtr.mValue = 0; - return *this; - } - - RestyleManagerHandle& operator=(RestyleManager* aManager) - { - mPtr.mValue = reinterpret_cast(aManager); - return *this; - } - - // Make RestyleManagerHandle usable in boolean contexts. - explicit operator bool() const { return !!mPtr.mValue; } - bool operator!() const { return !mPtr.mValue; } - - // Make RestyleManagerHandle behave like a smart pointer. - Ptr* operator->() { return &mPtr; } - const Ptr* operator->() const { return &mPtr; } - -private: - Ptr mPtr; -}; - -} // namespace mozilla - -#endif // mozilla_RestyleManagerHandle_h diff --git a/layout/base/RestyleManagerHandleInlines.h b/layout/base/RestyleManagerHandleInlines.h deleted file mode 100644 index 74ee6a2e10..0000000000 --- a/layout/base/RestyleManagerHandleInlines.h +++ /dev/null @@ -1,181 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef mozilla_RestyleManagerHandleInlines_h -#define mozilla_RestyleManagerHandleInlines_h - -#include "mozilla/RestyleManager.h" - -namespace mozilla { - -MozExternalRefCountType -RestyleManagerHandle::Ptr::AddRef() -{ - return AsGecko()->AddRef(); -} - -MozExternalRefCountType -RestyleManagerHandle::Ptr::Release() -{ - return AsGecko()->Release(); -} - -void -RestyleManagerHandle::Ptr::Disconnect() -{ - AsGecko()->Disconnect(); -} - -void -RestyleManagerHandle::Ptr::PostRestyleEvent(dom::Element* aElement, - nsRestyleHint aRestyleHint, - nsChangeHint aMinChangeHint) -{ - AsGecko()->PostRestyleEvent(aElement, aRestyleHint, aMinChangeHint); -} - -void -RestyleManagerHandle::Ptr::PostRestyleEventForLazyConstruction() -{ - AsGecko()->PostRestyleEventForLazyConstruction(); -} - -void -RestyleManagerHandle::Ptr::RebuildAllStyleData(nsChangeHint aExtraHint, - nsRestyleHint aRestyleHint) -{ - AsGecko()->RebuildAllStyleData(aExtraHint, aRestyleHint); -} - -void -RestyleManagerHandle::Ptr::PostRebuildAllStyleDataEvent( - nsChangeHint aExtraHint, - nsRestyleHint aRestyleHint) -{ - AsGecko()->PostRebuildAllStyleDataEvent(aExtraHint, aRestyleHint); -} - -void -RestyleManagerHandle::Ptr::ProcessPendingRestyles() -{ - AsGecko()->ProcessPendingRestyles(); -} - -nsresult -RestyleManagerHandle::Ptr::ProcessRestyledFrames(nsStyleChangeList& aChangeList) -{ - return AsGecko()->ProcessRestyledFrames(aChangeList); -} - -void -RestyleManagerHandle::Ptr::FlushOverflowChangedTracker() -{ - AsGecko()->FlushOverflowChangedTracker(); -} - -void -RestyleManagerHandle::Ptr::ContentInserted(nsINode* aContainer, - nsIContent* aChild) -{ - AsGecko()->ContentInserted(aContainer, aChild); -} - -void -RestyleManagerHandle::Ptr::ContentAppended(nsIContent* aContainer, - nsIContent* aFirstNewContent) -{ - AsGecko()->ContentAppended(aContainer, aFirstNewContent); -} - -void -RestyleManagerHandle::Ptr::ContentRemoved(nsINode* aContainer, - nsIContent* aOldChild, - nsIContent* aFollowingSibling) -{ - AsGecko()->ContentRemoved(aContainer, aOldChild, aFollowingSibling); -} - -void -RestyleManagerHandle::Ptr::RestyleForInsertOrChange(nsINode* aContainer, - nsIContent* aChild) -{ - AsGecko()->RestyleForInsertOrChange(aContainer, aChild); -} - -void -RestyleManagerHandle::Ptr::RestyleForAppend(nsIContent* aContainer, - nsIContent* aFirstNewContent) -{ - AsGecko()->RestyleForAppend(aContainer, aFirstNewContent); -} - -void -RestyleManagerHandle::Ptr::ContentStateChanged(nsIContent* aContent, - EventStates aStateMask) -{ - AsGecko()->ContentStateChanged(aContent, aStateMask); -} - -void -RestyleManagerHandle::Ptr::AttributeWillChange(dom::Element* aElement, - int32_t aNameSpaceID, - nsIAtom* aAttribute, - int32_t aModType, - const nsAttrValue* aNewValue) -{ - AsGecko()->AttributeWillChange(aElement, aNameSpaceID, aAttribute, aModType, - aNewValue); -} - -void -RestyleManagerHandle::Ptr::AttributeChanged(dom::Element* aElement, - int32_t aNameSpaceID, - nsIAtom* aAttribute, - int32_t aModType, - const nsAttrValue* aOldValue) -{ - AsGecko()->AttributeChanged(aElement, aNameSpaceID, aAttribute, aModType, - aOldValue); -} - -nsresult -RestyleManagerHandle::Ptr::ReparentStyleContext(nsIFrame* aFrame) -{ - return AsGecko()->ReparentStyleContext(aFrame); -} - -bool -RestyleManagerHandle::Ptr::HasPendingRestyles() -{ - return AsGecko()->HasPendingRestyles(); -} - -uint64_t -RestyleManagerHandle::Ptr::GetRestyleGeneration() const -{ - return AsGecko()->GetRestyleGeneration(); -} - -uint32_t -RestyleManagerHandle::Ptr::GetHoverGeneration() const -{ - return AsGecko()->GetHoverGeneration(); -} - -void -RestyleManagerHandle::Ptr::SetObservingRefreshDriver(bool aObserving) -{ - AsGecko()->SetObservingRefreshDriver(aObserving); -} - -void -RestyleManagerHandle::Ptr::NotifyDestroyingFrame(nsIFrame* aFrame) -{ - AsGecko()->NotifyDestroyingFrame(aFrame); -} - -} // namespace mozilla - -#endif // mozilla_RestyleManagerHandleInlines_h diff --git a/layout/base/moz.build b/layout/base/moz.build index 1b3532aa28..4838e9bbb5 100644 --- a/layout/base/moz.build +++ b/layout/base/moz.build @@ -112,8 +112,6 @@ EXPORTS.mozilla += [ 'RestyleLogging.h', 'RestyleManager.h', 'RestyleManagerBase.h', - 'RestyleManagerHandle.h', - 'RestyleManagerHandleInlines.h', 'StaticPresData.h', ] diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index e6a7c76dd8..fdeb9f35b9 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -79,8 +79,7 @@ #include "nsAutoLayoutPhase.h" #include "nsStyleStructInlines.h" #include "nsPageContentFrame.h" -#include "mozilla/RestyleManagerHandle.h" -#include "mozilla/RestyleManagerHandleInlines.h" +#include "mozilla/RestyleManager.h" #include "StickyScrollContainer.h" #include "nsFieldSetFrame.h" #include "nsInlineFrame.h" @@ -454,7 +453,7 @@ AnyKidsNeedBlockParent(nsIFrame *aFrameList) // Reparent a frame into a wrapper frame that is a child of its old parent. static void -ReparentFrame(RestyleManagerHandle aRestyleManager, +ReparentFrame(RestyleManager* aRestyleManager, nsContainerFrame* aNewParentFrame, nsIFrame* aFrame) { @@ -467,7 +466,7 @@ ReparentFrames(nsCSSFrameConstructor* aFrameConstructor, nsContainerFrame* aNewParentFrame, const nsFrameList& aFrameList) { - RestyleManagerHandle restyleManager = aFrameConstructor->RestyleManager(); + RestyleManager* restyleManager = aFrameConstructor->RestyleManager(); for (nsFrameList::Enumerator e(aFrameList); !e.AtEnd(); e.Next()) { ReparentFrame(restyleManager, aNewParentFrame, e.get()); } @@ -1883,9 +1882,9 @@ nsCSSFrameConstructor::CreateGeneratedContentItem(nsFrameConstructorState& aStat return; } - if (mozilla::RestyleManager* geckoRM = RestyleManager()->GetAsGecko()) { + if (mozilla::RestyleManager* restyleManager = RestyleManager()) { RestyleManager::ReframingStyleContexts* rsc = - geckoRM->GetReframingStyleContexts(); + restyleManager->GetReframingStyleContexts(); if (rsc) { nsStyleContext* oldStyleContext = rsc->Get(container, aPseudoElement); if (oldStyleContext) { @@ -5056,9 +5055,9 @@ nsCSSFrameConstructor::ResolveStyleContext(nsStyleContext* aParentStyleContext, result = styleSet->ResolveStyleForText(aContent, aParentStyleContext); } - if (mozilla::RestyleManager* geckoRM = RestyleManager()->GetAsGecko()) { + if (mozilla::RestyleManager* restyleManager = RestyleManager()) { RestyleManager::ReframingStyleContexts* rsc = - geckoRM->GetReframingStyleContexts(); + restyleManager->GetReframingStyleContexts(); if (rsc) { nsStyleContext* oldStyleContext = rsc->Get(aContent, CSSPseudoElementType::NotPseudo); diff --git a/layout/base/nsCSSFrameConstructor.h b/layout/base/nsCSSFrameConstructor.h index 6328e52944..4982d53573 100644 --- a/layout/base/nsCSSFrameConstructor.h +++ b/layout/base/nsCSSFrameConstructor.h @@ -14,7 +14,6 @@ #include "mozilla/Attributes.h" #include "mozilla/LinkedList.h" #include "mozilla/RestyleManagerBase.h" -#include "mozilla/RestyleManagerHandle.h" #include "nsCOMPtr.h" #include "nsILayoutHistoryState.h" @@ -41,6 +40,8 @@ class nsFrameConstructorState; namespace mozilla { +class RestyleManager; + namespace dom { class FlattenedChildIterator; @@ -72,7 +73,7 @@ private: nsCSSFrameConstructor& operator=(const nsCSSFrameConstructor& aCopy) = delete; public: - mozilla::RestyleManagerHandle RestyleManager() const + mozilla::RestyleManager* RestyleManager() const { return mPresShell->GetPresContext()->RestyleManager(); } nsIFrame* ConstructRootFrame(); diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp index d1baeb0d1c..e156e432d3 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp @@ -126,8 +126,7 @@ #include "GeckoProfiler.h" #include "nsAnimationManager.h" #include "nsTransitionManager.h" -#include "mozilla/RestyleManagerHandle.h" -#include "mozilla/RestyleManagerHandleInlines.h" +#include "mozilla/RestyleManager.h" #include "LayoutLogging.h" // Make sure getpid() works. diff --git a/layout/base/nsPresContext.cpp b/layout/base/nsPresContext.cpp index f473619537..65f221a8ae 100644 --- a/layout/base/nsPresContext.cpp +++ b/layout/base/nsPresContext.cpp @@ -34,8 +34,6 @@ #include "nsLayoutUtils.h" #include "nsViewManager.h" #include "mozilla/RestyleManager.h" -#include "mozilla/RestyleManagerHandle.h" -#include "mozilla/RestyleManagerHandleInlines.h" #include "SurfaceCacheUtils.h" #include "nsCSSRuleProcessor.h" #include "nsRuleNode.h" diff --git a/layout/base/nsPresContext.h b/layout/base/nsPresContext.h index d904948c86..ee7427018b 100644 --- a/layout/base/nsPresContext.h +++ b/layout/base/nsPresContext.h @@ -39,7 +39,6 @@ #include "nsIMessageManager.h" #include "mozilla/RestyleLogging.h" #include "Units.h" -#include "mozilla/RestyleManagerHandle.h" #include "prenv.h" #include "mozilla/StaticPresData.h" @@ -71,6 +70,7 @@ namespace mozilla { class EffectCompositor; class EventStateManager; class CounterStyleManager; +class RestyleManager; namespace layers { class ContainerLayer; class LayerManager; @@ -243,7 +243,7 @@ public: nsRefreshDriver* RefreshDriver() { return mRefreshDriver; } - mozilla::RestyleManagerHandle RestyleManager() { + mozilla::RestyleManager* RestyleManager() { MOZ_ASSERT(mRestyleManager); return mRestyleManager; } @@ -1240,7 +1240,7 @@ protected: RefPtr mEffectCompositor; RefPtr mTransitionManager; RefPtr mAnimationManager; - mozilla::RestyleManagerHandle::RefPtr mRestyleManager; + RefPtr mRestyleManager; RefPtr mCounterStyleManager; nsIAtom* MOZ_UNSAFE_REF("always a static atom") mMedium; // initialized by subclass ctors nsCOMPtr mMediaEmulated; diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index 43a644a2b7..0a9627bc9b 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -178,8 +178,7 @@ #include "nsPlaceholderFrame.h" #include "nsTransitionManager.h" #include "ChildIterator.h" -#include "mozilla/RestyleManagerHandle.h" -#include "mozilla/RestyleManagerHandleInlines.h" +#include "mozilla/RestyleManager.h" #include "nsIDOMHTMLElement.h" #include "nsIDragSession.h" #include "nsIFrameInlines.h" @@ -567,7 +566,7 @@ VerifyStyleTree(nsPresContext* aPresContext, nsFrameManager* aFrameManager) { if (nsFrame::GetVerifyStyleTreeEnable()) { nsIFrame* rootFrame = aFrameManager->GetRootFrame(); - aPresContext->RestyleManager()->AsGecko()->DebugVerifyStyleTree(rootFrame); + aPresContext->RestyleManager()->DebugVerifyStyleTree(rootFrame); } } #define VERIFY_STYLE_TREE ::VerifyStyleTree(mPresContext, mFrameConstructor) @@ -2857,7 +2856,7 @@ PresShell::RecreateFramesFor(nsIContent* aContent) // Mark ourselves as not safe to flush while we're doing frame construction. ++mChangeNestCount; - RestyleManagerHandle restyleManager = mPresContext->RestyleManager(); + RestyleManager* restyleManager = mPresContext->RestyleManager(); nsresult rv = restyleManager->ProcessRestyledFrames(changeList); restyleManager->FlushOverflowChangedTracker(); --mChangeNestCount; @@ -3643,7 +3642,7 @@ void PresShell::DispatchSynthMouseMove(WidgetGUIEvent* aEvent, bool aFlushOnHoverChange) { - RestyleManagerHandle restyleManager = mPresContext->RestyleManager(); + RestyleManager* restyleManager = mPresContext->RestyleManager(); uint32_t hoverGenerationBefore = restyleManager->GetHoverGeneration(); nsEventStatus status; @@ -4448,7 +4447,7 @@ nsIPresShell::RestyleForCSSRuleChanges() return; } - RestyleManagerHandle restyleManager = mPresContext->RestyleManager(); + RestyleManager* restyleManager = mPresContext->RestyleManager(); if (scopeRoots.IsEmpty()) { // If scopeRoots is empty, we know that mStylesHaveChanged was true at // the beginning of this function, and that we need to restyle the whole @@ -6731,7 +6730,7 @@ FlushThrottledStyles(nsIDocument *aDocument, void *aData) if (shell && shell->IsVisible()) { nsPresContext* presContext = shell->GetPresContext(); if (presContext) { - presContext->RestyleManager()->AsGecko()->UpdateOnlyAnimationStyles(); + presContext->RestyleManager()->UpdateOnlyAnimationStyles(); } } @@ -9477,9 +9476,9 @@ PresShell::Observe(nsISupports* aSubject, { nsAutoScriptBlocker scriptBlocker; ++mChangeNestCount; - RestyleManagerHandle restyleManager = mPresContext->RestyleManager(); - restyleManager->AsGecko()->ProcessRestyledFrames(changeList); - restyleManager->AsGecko()->FlushOverflowChangedTracker(); + RestyleManager* restyleManager = mPresContext->RestyleManager(); + restyleManager->ProcessRestyledFrames(changeList); + restyleManager->FlushOverflowChangedTracker(); --mChangeNestCount; } } diff --git a/layout/base/nsRefreshDriver.cpp b/layout/base/nsRefreshDriver.cpp index 02838d7640..7496aae282 100644 --- a/layout/base/nsRefreshDriver.cpp +++ b/layout/base/nsRefreshDriver.cpp @@ -46,8 +46,6 @@ #include "mozilla/dom/Performance.h" #include "mozilla/dom/WindowBinding.h" #include "mozilla/RestyleManager.h" -#include "mozilla/RestyleManagerHandle.h" -#include "mozilla/RestyleManagerHandleInlines.h" #include "Layers.h" #include "imgIContainer.h" #include "mozilla/dom/ScriptSettings.h" @@ -1696,7 +1694,7 @@ nsRefreshDriver::Tick(int64_t aNowEpoch, TimeStamp aNowTime) nsCOMPtr shellKungFuDeathGrip(shell); mStyleFlushObservers.RemoveElement(shell); - RestyleManagerHandle restyleManager = + RestyleManager* restyleManager = shell->GetPresContext()->RestyleManager(); restyleManager->SetObservingRefreshDriver(false); shell->FlushPendingNotifications(ChangesToFlush(Flush_Style, false)); diff --git a/layout/generic/nsFirstLetterFrame.cpp b/layout/generic/nsFirstLetterFrame.cpp index f436245929..c45cd5f4b6 100644 --- a/layout/generic/nsFirstLetterFrame.cpp +++ b/layout/generic/nsFirstLetterFrame.cpp @@ -13,8 +13,7 @@ #include "nsGkAtoms.h" #include "nsStyleSet.h" #include "nsFrameManager.h" -#include "mozilla/RestyleManagerHandle.h" -#include "mozilla/RestyleManagerHandleInlines.h" +#include "mozilla/RestyleManager.h" #include "nsPlaceholderFrame.h" #include "nsCSSFrameConstructor.h" @@ -81,7 +80,7 @@ nsFirstLetterFrame::SetInitialChildList(ChildListID aListID, { MOZ_ASSERT(aListID == kPrincipalList, "Principal child list is the only " "list that nsFirstLetterFrame should set via this function"); - RestyleManagerHandle restyleManager = PresContext()->RestyleManager(); + RestyleManager* restyleManager = PresContext()->RestyleManager(); for (nsFrameList::Enumerator e(aChildList); !e.AtEnd(); e.Next()) { NS_ASSERTION(e.get()->GetParent() == this, "Unexpected parent"); diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index 8c92705152..27b75dce32 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -42,8 +42,6 @@ #include "nsLayoutUtils.h" #include "LayoutLogging.h" #include "mozilla/RestyleManager.h" -#include "mozilla/RestyleManagerHandle.h" -#include "mozilla/RestyleManagerHandleInlines.h" #include "nsIDOMNode.h" #include "nsISelection.h" @@ -677,7 +675,7 @@ nsFrame::DestroyFrom(nsIFrame* aDestructRoot) // because what matters is whether the new style (not the old) // specifies CSS transitions. RestyleManager::ReframingStyleContexts* rsc = - presContext->RestyleManager()->AsGecko()->GetReframingStyleContexts(); + presContext->RestyleManager()->GetReframingStyleContexts(); if (rsc) { rsc->Put(mContent, mStyleContext); } @@ -688,7 +686,7 @@ nsFrame::DestroyFrom(nsIFrame* aDestructRoot) // If no new frame for this element is created by the end of the // restyling process, stop animations and transitions for this frame RestyleManager::AnimationsWithDestroyedFrame* adf = - presContext->RestyleManager()->AsGecko()->GetAnimationsWithDestroyedFrame(); + presContext->RestyleManager()->GetAnimationsWithDestroyedFrame(); // AnimationsWithDestroyedFrame only lives during the restyling process. if (adf) { adf->Put(mContent, mStyleContext); diff --git a/layout/generic/nsInlineFrame.cpp b/layout/generic/nsInlineFrame.cpp index c15e33cb6c..ed6e6027dc 100644 --- a/layout/generic/nsInlineFrame.cpp +++ b/layout/generic/nsInlineFrame.cpp @@ -14,8 +14,7 @@ #include "nsPresContext.h" #include "nsRenderingContext.h" #include "nsCSSAnonBoxes.h" -#include "mozilla/RestyleManagerHandle.h" -#include "mozilla/RestyleManagerHandleInlines.h" +#include "mozilla/RestyleManager.h" #include "nsDisplayList.h" #include "mozilla/Likely.h" #include "SVGTextFrame.h" @@ -346,7 +345,7 @@ ReparentChildListStyle(nsPresContext* aPresContext, const nsFrameList::Slice& aFrames, nsIFrame* aParentFrame) { - RestyleManagerHandle restyleManager = aPresContext->RestyleManager(); + RestyleManager* restyleManager = aPresContext->RestyleManager(); for (nsFrameList::Enumerator e(aFrames); !e.AtEnd(); e.Next()) { NS_ASSERTION(e.get()->GetParent() == aParentFrame, "Bogus parentage"); @@ -493,7 +492,7 @@ nsInlineFrame::DrainSelfOverflowListInternal(DrainFlags aFlags) if (!(aFlags & eDontReparentFrames)) { nsIFrame* firstChild = overflowFrames->FirstChild(); const bool doReparentSC = (aFlags & eInFirstLine); - RestyleManagerHandle restyleManager = PresContext()->RestyleManager(); + RestyleManager* restyleManager = PresContext()->RestyleManager(); for (nsIFrame* f = firstChild; f; f = f->GetNextSibling()) { f->SetParent(this); if (doReparentSC) { @@ -560,7 +559,7 @@ nsInlineFrame::ReflowFrames(nsPresContext* aPresContext, nsLineLayout* lineLayout = aReflowInput.mLineLayout; bool inFirstLine = aReflowInput.mLineLayout->GetInFirstLine(); - RestyleManagerHandle restyleManager = aPresContext->RestyleManager(); + RestyleManager* restyleManager = aPresContext->RestyleManager(); WritingMode frameWM = aReflowInput.GetWritingMode(); WritingMode lineWM = aReflowInput.mLineLayout->mRootSpan->mWritingMode; LogicalMargin framePadding = aReflowInput.ComputedLogicalBorderPadding(); diff --git a/layout/mathml/nsMathMLmtableFrame.cpp b/layout/mathml/nsMathMLmtableFrame.cpp index 4bd7d43951..ad4bb55682 100644 --- a/layout/mathml/nsMathMLmtableFrame.cpp +++ b/layout/mathml/nsMathMLmtableFrame.cpp @@ -16,8 +16,7 @@ #include "nsTableFrame.h" #include "celldata.h" -#include "mozilla/RestyleManagerHandle.h" -#include "mozilla/RestyleManagerHandleInlines.h" +#include "mozilla/RestyleManager.h" #include #include "nsIScriptError.h" diff --git a/layout/style/AnimationCollection.cpp b/layout/style/AnimationCollection.cpp index 23a3e1a666..043b66d681 100644 --- a/layout/style/AnimationCollection.cpp +++ b/layout/style/AnimationCollection.cpp @@ -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::UpdateCheckGeneration( nsPresContext* aPresContext) { mCheckGeneration = - aPresContext->RestyleManager()->AsGecko()->GetAnimationGeneration(); + aPresContext->RestyleManager()->GetAnimationGeneration(); } template diff --git a/layout/style/nsHTMLCSSStyleSheet.cpp b/layout/style/nsHTMLCSSStyleSheet.cpp index 4f68e6741b..0246d6651a 100644 --- a/layout/style/nsHTMLCSSStyleSheet.cpp +++ b/layout/style/nsHTMLCSSStyleSheet.cpp @@ -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. diff --git a/layout/style/nsHTMLStyleSheet.cpp b/layout/style/nsHTMLStyleSheet.cpp index 70a5c7f414..94b727bcc9 100644 --- a/layout/style/nsHTMLStyleSheet.cpp +++ b/layout/style/nsHTMLStyleSheet.cpp @@ -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; diff --git a/layout/style/nsStyleSet.cpp b/layout/style/nsStyleSet.cpp index 9495b788df..a27dccc4b8 100644 --- a/layout/style/nsStyleSet.cpp +++ b/layout/style/nsStyleSet.cpp @@ -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 @@ -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(); } diff --git a/layout/style/nsTransitionManager.cpp b/layout/style/nsTransitionManager.cpp index 8590501c79..a2e97e2d28 100644 --- a/layout/style/nsTransitionManager.cpp +++ b/layout/style/nsTransitionManager.cpp @@ -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(); diff --git a/layout/svg/nsSVGContainerFrame.cpp b/layout/svg/nsSVGContainerFrame.cpp index 5c18cad425..84f79eaf83 100644 --- a/layout/svg/nsSVGContainerFrame.cpp +++ b/layout/svg/nsSVGContainerFrame.cpp @@ -7,8 +7,7 @@ #include "nsSVGContainerFrame.h" // Keep others in (case-insensitive) order: -#include "mozilla/RestyleManagerHandle.h" -#include "mozilla/RestyleManagerHandleInlines.h" +#include "mozilla/RestyleManager.h" #include "nsCSSFrameConstructor.h" #include "nsSVGEffects.h" #include "nsSVGElement.h" diff --git a/layout/svg/nsSVGEffects.cpp b/layout/svg/nsSVGEffects.cpp index ca4c5778ce..63fd215190 100644 --- a/layout/svg/nsSVGEffects.cpp +++ b/layout/svg/nsSVGEffects.cpp @@ -7,8 +7,7 @@ #include "nsSVGEffects.h" // Keep others in (case-insensitive) order: -#include "mozilla/RestyleManagerHandle.h" -#include "mozilla/RestyleManagerHandleInlines.h" +#include "mozilla/RestyleManager.h" #include "nsCSSFrameConstructor.h" #include "nsISupportsImpl.h" #include "nsSVGClipPathFrame.h"