1
0
mirror of https://github.com/roytam1/UXP.git synced 2026-05-26 13:58:49 +00:00

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
parent 4bf43b8fb4
commit 6803c1f710
24 changed files with 55 additions and 414 deletions
+3 -4
View File
@@ -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).
+2 -3
View File
@@ -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**
+3 -4
View File
@@ -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) {
-155
View File
@@ -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<RestyleManagerHandle> 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<RestyleManager*>(mValue);
}
RestyleManager* GetAsGecko() { return AsGecko(); }
const RestyleManager* AsGecko() const
{
return const_cast<Ptr*>(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<uintptr_t>(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
-181
View File
@@ -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
-2
View File
@@ -112,8 +112,6 @@ EXPORTS.mozilla += [
'RestyleLogging.h',
'RestyleManager.h',
'RestyleManagerBase.h',
'RestyleManagerHandle.h',
'RestyleManagerHandleInlines.h',
'StaticPresData.h',
]
+7 -8
View File
@@ -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);
+3 -2
View File
@@ -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();
+1 -2
View File
@@ -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.
-2
View File
@@ -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"
+3 -3
View File
@@ -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<mozilla::EffectCompositor> mEffectCompositor;
RefPtr<nsTransitionManager> mTransitionManager;
RefPtr<nsAnimationManager> mAnimationManager;
mozilla::RestyleManagerHandle::RefPtr mRestyleManager;
RefPtr<mozilla::RestyleManager> mRestyleManager;
RefPtr<mozilla::CounterStyleManager> mCounterStyleManager;
nsIAtom* MOZ_UNSAFE_REF("always a static atom") mMedium; // initialized by subclass ctors
nsCOMPtr<nsIAtom> mMediaEmulated;
+9 -10
View File
@@ -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;
}
}
+1 -3
View File
@@ -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<nsIPresShell> shellKungFuDeathGrip(shell);
mStyleFlushObservers.RemoveElement(shell);
RestyleManagerHandle restyleManager =
RestyleManager* restyleManager =
shell->GetPresContext()->RestyleManager();
restyleManager->SetObservingRefreshDriver(false);
shell->FlushPendingNotifications(ChangesToFlush(Flush_Style, false));
+2 -3
View File
@@ -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");
+2 -4
View File
@@ -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);
+4 -5
View File
@@ -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();
+1 -2
View File
@@ -16,8 +16,7 @@
#include "nsTableFrame.h"
#include "celldata.h"
#include "mozilla/RestyleManagerHandle.h"
#include "mozilla/RestyleManagerHandleInlines.h"
#include "mozilla/RestyleManager.h"
#include <algorithm>
#include "nsIScriptError.h"
+2 -3
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>
+2 -3
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.
+1 -2
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;
+4 -5
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();
}
+3 -4
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();
+1 -2
View File
@@ -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"
+1 -2
View File
@@ -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"