--- a/docshell/base/timeline/RestyleTimelineMarker.h
+++ b/docshell/base/timeline/RestyleTimelineMarker.h
@@ -15,17 +15,17 @@ namespace mozilla {
class RestyleTimelineMarker : public TimelineMarker
{
public:
RestyleTimelineMarker(nsRestyleHint aRestyleHint,
MarkerTracingType aTracingType)
: TimelineMarker("Styles", aTracingType)
{
if (aRestyleHint) {
- mRestyleHint.AssignWithConversion(RestyleManager::RestyleHintToString(aRestyleHint));
+ mRestyleHint.AssignWithConversion(GeckoRestyleManager::RestyleHintToString(aRestyleHint));
}
}
virtual void AddDetails(JSContext* aCx, dom::ProfileTimelineMarker& aMarker) override
{
TimelineMarker::AddDetails(aCx, aMarker);
if (GetTracingType() == MarkerTracingType::START) {
--- a/layout/base/GeckoRestyleManager.cpp
+++ b/layout/base/GeckoRestyleManager.cpp
@@ -78,18 +78,18 @@ ElementTagToString(dom::Element* aElemen
{
nsCString result;
nsDependentAtomString buf(aElement->NodeInfo()->NameAtom());
result.AppendPrintf("(%s@%p)", NS_ConvertUTF16toUTF8(buf).get(), aElement);
return result;
}
#endif
-RestyleManager::RestyleManager(nsPresContext* aPresContext)
- : RestyleManagerBase(aPresContext)
+GeckoRestyleManager::GeckoRestyleManager(nsPresContext* aPresContext)
+ : RestyleManager(aPresContext)
, mDoRebuildAllStyleData(false)
, mInRebuildAllStyleData(false)
, mSkipAnimationRules(false)
, mHavePendingNonAnimationRestyles(false)
, mRebuildAllExtraHint(nsChangeHint(0))
, mRebuildAllRestyleHint(nsRestyleHint(0))
, mAnimationGeneration(0)
, mReframingStyleContexts(nullptr)
@@ -100,22 +100,22 @@ RestyleManager::RestyleManager(nsPresCon
#ifdef RESTYLE_LOGGING
, mLoggingDepth(0)
#endif
{
mPendingRestyles.Init(this);
}
void
-RestyleManager::RestyleElement(Element* aElement,
- nsIFrame* aPrimaryFrame,
- nsChangeHint aMinHint,
- RestyleTracker& aRestyleTracker,
- nsRestyleHint aRestyleHint,
- const RestyleHintData& aRestyleHintData)
+GeckoRestyleManager::RestyleElement(Element* aElement,
+ nsIFrame* aPrimaryFrame,
+ nsChangeHint aMinHint,
+ RestyleTracker& aRestyleTracker,
+ nsRestyleHint aRestyleHint,
+ const RestyleHintData& aRestyleHintData)
{
MOZ_ASSERT(mReframingStyleContexts, "should have rsc");
NS_ASSERTION(aPrimaryFrame == aElement->GetPrimaryFrame(),
"frame/content mismatch");
if (aPrimaryFrame && aPrimaryFrame->GetContent() != aElement) {
// XXXbz this is due to image maps messing with the primary frame pointer
// of <area>s. See bug 135040. We can remove this block once that's fixed.
aPrimaryFrame = nullptr;
@@ -167,27 +167,28 @@ RestyleManager::RestyleElement(Element*
// Style change for a display:contents node that did not recreate frames.
ComputeAndProcessStyleChange(newContext, aElement, aMinHint,
aRestyleTracker, aRestyleHint,
aRestyleHintData);
}
}
}
-RestyleManager::ReframingStyleContexts::ReframingStyleContexts(
- RestyleManager* aRestyleManager)
+GeckoRestyleManager::ReframingStyleContexts
+ ::ReframingStyleContexts(
+ GeckoRestyleManager* aRestyleManager)
: mRestyleManager(aRestyleManager)
, mRestorePointer(mRestyleManager->mReframingStyleContexts)
{
MOZ_ASSERT(!mRestyleManager->mReframingStyleContexts,
"shouldn't construct recursively");
mRestyleManager->mReframingStyleContexts = this;
}
-RestyleManager::ReframingStyleContexts::~ReframingStyleContexts()
+GeckoRestyleManager::ReframingStyleContexts::~ReframingStyleContexts()
{
// Before we go away, we need to flush out any frame construction that
// was enqueued, so that we initiate transitions.
// Note that this is a little bit evil in that we're calling into code
// that calls our member functions from our destructor, but it's at
// the beginning of our destructor, so it shouldn't be too bad.
mRestyleManager->PresContext()->FrameConstructor()->CreateNeededFrames();
}
@@ -195,18 +196,18 @@ RestyleManager::ReframingStyleContexts::
static inline dom::Element*
ElementForStyleContext(nsIContent* aParentContent,
nsIFrame* aFrame,
CSSPseudoElementType aPseudoType);
// Forwarded nsIDocumentObserver method, to handle restyling (and
// passing the notification to the frame).
nsresult
-RestyleManager::ContentStateChanged(nsIContent* aContent,
- EventStates aStateMask)
+GeckoRestyleManager::ContentStateChanged(nsIContent* aContent,
+ EventStates aStateMask)
{
// XXXbz it would be good if this function only took Elements, but
// we'd have to make ESM guarantee that usefully.
if (!aContent->IsElement()) {
return NS_OK;
}
Element* aElement = aContent->AsElement();
@@ -216,42 +217,42 @@ RestyleManager::ContentStateChanged(nsIC
ContentStateChangedInternal(aElement, aStateMask, &changeHint, &restyleHint);
PostRestyleEvent(aElement, restyleHint, changeHint);
return NS_OK;
}
// Forwarded nsIMutationObserver method, to handle restyling.
void
-RestyleManager::AttributeWillChange(Element* aElement,
- int32_t aNameSpaceID,
- nsIAtom* aAttribute,
- int32_t aModType,
- const nsAttrValue* aNewValue)
+GeckoRestyleManager::AttributeWillChange(Element* aElement,
+ int32_t aNameSpaceID,
+ nsIAtom* aAttribute,
+ int32_t aModType,
+ const nsAttrValue* aNewValue)
{
RestyleHintData rsdata;
nsRestyleHint rshint =
StyleSet()->HasAttributeDependentStyle(aElement,
aNameSpaceID,
aAttribute,
aModType,
false,
aNewValue,
rsdata);
PostRestyleEvent(aElement, rshint, nsChangeHint(0), &rsdata);
}
// Forwarded nsIMutationObserver method, to handle restyling (and
// passing the notification to the frame).
void
-RestyleManager::AttributeChanged(Element* aElement,
- int32_t aNameSpaceID,
- nsIAtom* aAttribute,
- int32_t aModType,
- const nsAttrValue* aOldValue)
+GeckoRestyleManager::AttributeChanged(Element* aElement,
+ int32_t aNameSpaceID,
+ nsIAtom* aAttribute,
+ int32_t aModType,
+ const nsAttrValue* aOldValue)
{
// Hold onto the PresShell to prevent ourselves from being destroyed.
// XXXbz how, exactly, would this attribute change cause us to be
// destroyed from inside this function?
nsCOMPtr<nsIPresShell> shell = PresContext()->GetPresShell();
mozilla::Unused << shell; // Unused within this function
// Get the frame associated with the content which is the highest in the frame tree
@@ -329,39 +330,39 @@ RestyleManager::AttributeChanged(Element
aModType,
true,
aOldValue,
rsdata);
PostRestyleEvent(aElement, rshint, hint, &rsdata);
}
/* static */ uint64_t
-RestyleManager::GetAnimationGenerationForFrame(nsIFrame* aFrame)
+GeckoRestyleManager::GetAnimationGenerationForFrame(nsIFrame* aFrame)
{
EffectSet* effectSet = EffectSet::GetEffectSet(aFrame);
return effectSet ? effectSet->GetAnimationGeneration() : 0;
}
void
-RestyleManager::RestyleForEmptyChange(Element* aContainer)
+GeckoRestyleManager::RestyleForEmptyChange(Element* aContainer)
{
// In some cases (:empty + E, :empty ~ E), a change in the content of
// an element requires restyling its parent's siblings.
nsRestyleHint hint = eRestyle_Subtree;
nsIContent* grandparent = aContainer->GetParent();
if (grandparent &&
(grandparent->GetFlags() & NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS)) {
hint = nsRestyleHint(hint | eRestyle_LaterSiblings);
}
PostRestyleEvent(aContainer, hint, nsChangeHint(0));
}
void
-RestyleManager::RestyleForAppend(nsIContent* aContainer,
- nsIContent* aFirstNewContent)
+GeckoRestyleManager::RestyleForAppend(nsIContent* aContainer,
+ nsIContent* aFirstNewContent)
{
// The container cannot be a document, but might be a ShadowRoot.
if (!aContainer->IsElement()) {
return;
}
Element* container = aContainer->AsElement();
#ifdef DEBUG
@@ -417,17 +418,17 @@ RestyleManager::RestyleForAppend(nsICont
}
}
}
// Needed since we can't use PostRestyleEvent on non-elements (with
// eRestyle_LaterSiblings or nsRestyleHint(eRestyle_Subtree |
// eRestyle_LaterSiblings) as appropriate).
static void
-RestyleSiblingsStartingWith(RestyleManager* aRestyleManager,
+RestyleSiblingsStartingWith(GeckoRestyleManager* aRestyleManager,
nsIContent* aStartingSibling /* may be null */)
{
for (nsIContent* sibling = aStartingSibling; sibling;
sibling = sibling->GetNextSibling()) {
if (sibling->IsElement()) {
aRestyleManager->
PostRestyleEvent(sibling->AsElement(),
nsRestyleHint(eRestyle_Subtree | eRestyle_LaterSiblings),
@@ -439,18 +440,18 @@ RestyleSiblingsStartingWith(RestyleManag
// Restyling for a ContentInserted or CharacterDataChanged notification.
// This could be used for ContentRemoved as well if we got the
// notification before the removal happened (and sometimes
// CharacterDataChanged is more like a removal than an addition).
// The comments are written and variables are named in terms of it being
// a ContentInserted notification.
void
-RestyleManager::RestyleForInsertOrChange(nsINode* aContainer,
- nsIContent* aChild)
+GeckoRestyleManager::RestyleForInsertOrChange(nsINode* aContainer,
+ nsIContent* aChild)
{
// The container might be a document or a ShadowRoot.
if (!aContainer->IsElement()) {
return;
}
Element* container = aContainer->AsElement();
NS_ASSERTION(!aChild->IsRootOfAnonymousSubtree(),
@@ -528,19 +529,19 @@ RestyleManager::RestyleForInsertOrChange
}
break;
}
}
}
}
void
-RestyleManager::ContentRemoved(nsINode* aContainer,
- nsIContent* aOldChild,
- nsIContent* aFollowingSibling)
+GeckoRestyleManager::ContentRemoved(nsINode* aContainer,
+ nsIContent* aOldChild,
+ nsIContent* aFollowingSibling)
{
// The container might be a document or a ShadowRoot.
if (!aContainer->IsElement()) {
return;
}
Element* container = aContainer->AsElement();
if (aOldChild->IsRootOfAnonymousSubtree()) {
@@ -619,18 +620,18 @@ RestyleManager::ContentRemoved(nsINode*
if (content == aFollowingSibling) {
reachedFollowingSibling = true;
}
}
}
}
void
-RestyleManager::RebuildAllStyleData(nsChangeHint aExtraHint,
- nsRestyleHint aRestyleHint)
+GeckoRestyleManager::RebuildAllStyleData(nsChangeHint aExtraHint,
+ nsRestyleHint aRestyleHint)
{
NS_ASSERTION(!(aExtraHint & nsChangeHint_ReconstructFrame),
"Should not reconstruct the root of the frame tree. "
"Use ReconstructDocElementHierarchy instead.");
MOZ_ASSERT(!(aRestyleHint & ~(eRestyle_Subtree | eRestyle_ForceDescendants)),
"the only bits allowed in aRestyleHint are eRestyle_Subtree and "
"eRestyle_ForceDescendants");
@@ -657,17 +658,17 @@ RestyleManager::RebuildAllStyleData(nsCh
nsAutoScriptBlocker scriptBlocker;
mDoRebuildAllStyleData = true;
ProcessPendingRestyles();
}
void
-RestyleManager::StartRebuildAllStyleData(RestyleTracker& aRestyleTracker)
+GeckoRestyleManager::StartRebuildAllStyleData(RestyleTracker& aRestyleTracker)
{
MOZ_ASSERT(mIsProcessingRestyles);
nsIFrame* rootFrame = PresContext()->PresShell()->GetRootFrame();
if (!rootFrame) {
// No need to do anything.
return;
}
@@ -715,32 +716,32 @@ RestyleManager::StartRebuildAllStyleData
// frame and not the root node's primary frame? (We could do
// roughly what we do for aRestyleHint above.)
ComputeAndProcessStyleChange(rootFrame,
changeHint, aRestyleTracker, restyleHint,
RestyleHintData());
}
void
-RestyleManager::FinishRebuildAllStyleData()
+GeckoRestyleManager::FinishRebuildAllStyleData()
{
MOZ_ASSERT(mInRebuildAllStyleData, "bad caller");
// Tell the style set it's safe to destroy the old rule tree. We
// must do this after the ProcessRestyledFrames call in case the
// change list has frame reconstructs in it (since frames to be
// reconstructed will still have their old style context pointers
// until they are destroyed).
StyleSet()->EndReconstruct();
mInRebuildAllStyleData = false;
}
void
-RestyleManager::ProcessPendingRestyles()
+GeckoRestyleManager::ProcessPendingRestyles()
{
NS_PRECONDITION(PresContext()->Document(), "No document? Pshaw!");
NS_PRECONDITION(!nsContentUtils::IsSafeToRunScript(),
"Missing a script blocker!");
// First do any queued-up frame creation. (We should really
// merge this into the rest of the process, though; see bug 827239.)
PresContext()->FrameConstructor()->CreateNeededFrames();
@@ -806,32 +807,32 @@ RestyleManager::ProcessPendingRestyles()
"repeatedly setting mDoRebuildAllStyleData?");
}
MOZ_ASSERT(!mInRebuildAllStyleData,
"should have called FinishRebuildAllStyleData");
}
void
-RestyleManager::BeginProcessingRestyles(RestyleTracker& aRestyleTracker)
+GeckoRestyleManager::BeginProcessingRestyles(RestyleTracker& aRestyleTracker)
{
// Make sure to not rebuild quote or counter lists while we're
// processing restyles
PresContext()->FrameConstructor()->BeginUpdate();
mInStyleRefresh = true;
if (ShouldStartRebuildAllFor(aRestyleTracker)) {
mDoRebuildAllStyleData = false;
StartRebuildAllStyleData(aRestyleTracker);
}
}
void
-RestyleManager::EndProcessingRestyles()
+GeckoRestyleManager::EndProcessingRestyles()
{
FlushOverflowChangedTracker();
MOZ_ASSERT(mAnimationsWithDestroyedFrame);
mAnimationsWithDestroyedFrame->
StopAnimationsForElementsWithoutFrames();
// Set mInStyleRefresh to false now, since the EndUpdate call might
@@ -845,17 +846,17 @@ RestyleManager::EndProcessingRestyles()
PresContext()->FrameConstructor()->EndUpdate();
#ifdef DEBUG
PresContext()->PresShell()->VerifyStyleTree();
#endif
}
void
-RestyleManager::UpdateOnlyAnimationStyles()
+GeckoRestyleManager::UpdateOnlyAnimationStyles()
{
bool doCSS = PresContext()->EffectCompositor()->HasPendingStyleUpdates();
nsIDocument* document = PresContext()->Document();
nsSMILAnimationController* animationController =
document->HasAnimationController() ?
document->GetAnimationController() :
nullptr;
@@ -887,20 +888,20 @@ RestyleManager::UpdateOnlyAnimationStyle
}
ProcessRestyles(tracker);
transitionManager->SetInAnimationOnlyStyleUpdate(false);
}
void
-RestyleManager::PostRestyleEvent(Element* aElement,
- nsRestyleHint aRestyleHint,
- nsChangeHint aMinChangeHint,
- const RestyleHintData* aRestyleHintData)
+GeckoRestyleManager::PostRestyleEvent(Element* aElement,
+ nsRestyleHint aRestyleHint,
+ nsChangeHint aMinChangeHint,
+ const RestyleHintData* aRestyleHintData)
{
if (MOZ_UNLIKELY(IsDisconnected()) ||
MOZ_UNLIKELY(PresContext()->PresShell()->IsDestroying())) {
return;
}
if (aRestyleHint == 0 && !aMinChangeHint) {
// Nothing to do here
@@ -917,18 +918,18 @@ RestyleManager::PostRestyleEvent(Element
if (aRestyleHint & ~eRestyle_AllHintsWithAnimations) {
mHavePendingNonAnimationRestyles = true;
}
PostRestyleEventInternal(false);
}
void
-RestyleManager::PostRebuildAllStyleDataEvent(nsChangeHint aExtraHint,
- nsRestyleHint aRestyleHint)
+GeckoRestyleManager::PostRebuildAllStyleDataEvent(nsChangeHint aExtraHint,
+ nsRestyleHint aRestyleHint)
{
NS_ASSERTION(!(aExtraHint & nsChangeHint_ReconstructFrame),
"Should not reconstruct the root of the frame tree. "
"Use ReconstructDocElementHierarchy instead.");
MOZ_ASSERT(!(aRestyleHint & eRestyle_SomeDescendants),
"PostRebuildAllStyleDataEvent does not handle "
"eRestyle_SomeDescendants");
@@ -938,21 +939,21 @@ RestyleManager::PostRebuildAllStyleDataE
// Get a restyle event posted if necessary
PostRestyleEventInternal(false);
}
// aContent must be the content for the frame in question, which may be
// :before/:after content
/* static */ bool
-RestyleManager::TryInitiatingTransition(nsPresContext* aPresContext,
- nsIContent* aContent,
- nsStyleContext* aOldStyleContext,
- RefPtr<nsStyleContext>*
- aNewStyleContext /* inout */)
+GeckoRestyleManager::TryInitiatingTransition(nsPresContext* aPresContext,
+ nsIContent* aContent,
+ nsStyleContext* aOldStyleContext,
+ RefPtr<nsStyleContext>*
+ aNewStyleContext /* inout */)
{
if (!aContent || !aContent->IsElement()) {
return false;
}
// Notify the transition manager. If it starts a transition,
// it might modify the new style context.
RefPtr<nsStyleContext> sc = *aNewStyleContext;
@@ -1110,17 +1111,17 @@ GetPrevContinuationWithSameStyle(nsIFram
prevStyle->GetParent() != selfStyle->GetParent(),
"continuations should have the same style context");
prevContinuation = nullptr;
}
return prevContinuation;
}
nsresult
-RestyleManager::ReparentStyleContext(nsIFrame* aFrame)
+GeckoRestyleManager::ReparentStyleContext(nsIFrame* aFrame)
{
nsIAtom* frameType = aFrame->GetType();
if (frameType == nsGkAtoms::placeholderFrame) {
// Also reparent the out-of-flow and all its continuations.
nsIFrame* outOfFlow =
nsPlaceholderFrame::GetRealFrameForPlaceholder(aFrame);
NS_ASSERTION(outOfFlow, "no out-of-flow frame");
do {
@@ -1479,17 +1480,17 @@ ElementRestyler::ElementRestyler(nsPresC
#endif
{
}
void
ElementRestyler::AddLayerChangesForAnimation()
{
uint64_t frameGeneration =
- RestyleManager::GetAnimationGenerationForFrame(mFrame);
+ GeckoRestyleManager::GetAnimationGenerationForFrame(mFrame);
nsChangeHint hint = nsChangeHint(0);
for (const LayerAnimationInfo::Record& layerInfo :
LayerAnimationInfo::sRecords) {
Layer* layer =
FrameLayerBuilder::GetDedicatedLayer(mFrame, layerInfo.mLayerType);
if (layer && frameGeneration != layer->GetAnimationGeneration()) {
// If we have a transform layer but don't have any transform style, we
@@ -1549,43 +1550,43 @@ ElementRestyler::CaptureChange(nsStyleCo
mParentFrameHintsNotHandledForDescendants,
aEqualStructs,
aSamePointerStructs);
NS_ASSERTION(!(ourChange & nsChangeHint_AllReflowHints) ||
(ourChange & nsChangeHint_NeedReflow),
"Reflow hint bits set without actually asking for a reflow");
LOG_RESTYLE("CaptureChange, ourChange = %s, aChangeToAssume = %s",
- RestyleManager::ChangeHintToString(ourChange).get(),
- RestyleManager::ChangeHintToString(aChangeToAssume).get());
+ GeckoRestyleManager::ChangeHintToString(ourChange).get(),
+ GeckoRestyleManager::ChangeHintToString(aChangeToAssume).get());
LOG_RESTYLE_INDENT();
// nsChangeHint_UpdateEffects is inherited, but it can be set due to changes
// in inherited properties (fill and stroke). Avoid propagating it into
// text nodes.
if ((ourChange & nsChangeHint_UpdateEffects) &&
mContent && !mContent->IsElement()) {
ourChange &= ~nsChangeHint_UpdateEffects;
}
ourChange |= aChangeToAssume;
if (!NS_IsHintSubset(ourChange, mHintsHandled)) {
mHintsHandled |= ourChange;
if (!(ourChange & nsChangeHint_ReconstructFrame) || mContent) {
LOG_RESTYLE("appending change %s",
- RestyleManager::ChangeHintToString(ourChange).get());
+ GeckoRestyleManager::ChangeHintToString(ourChange).get());
mChangeList->AppendChange(mFrame, mContent, ourChange);
} else {
LOG_RESTYLE("change has already been handled");
}
}
mHintsNotHandledForDescendants |=
NS_HintsNotHandledForDescendantsIn(ourChange);
LOG_RESTYLE("mHintsNotHandledForDescendants = %s",
- RestyleManager::ChangeHintToString(mHintsNotHandledForDescendants).get());
+ GeckoRestyleManager::ChangeHintToString(mHintsNotHandledForDescendants).get());
}
class MOZ_RAII AutoSelectorArrayTruncater final
{
public:
explicit AutoSelectorArrayTruncater(
nsTArray<nsCSSSelector*>& aSelectorsForDescendants)
: mSelectorsForDescendants(aSelectorsForDescendants)
@@ -1670,17 +1671,17 @@ ElementRestyler::ConditionallyRestyleCon
MOZ_ASSERT(aFrame->GetContent()->IsElement());
MOZ_ASSERT(!aFrame->GetContent()->IsStyledByServo());
if (aFrame->GetContent()->HasFlag(mRestyleTracker.RootBit())) {
aRestyleRoot = aFrame->GetContent()->AsElement();
}
for (nsIFrame* f = aFrame; f;
- f = RestyleManager::GetNextContinuationWithSameStyle(f, f->StyleContext())) {
+ f = GeckoRestyleManager::GetNextContinuationWithSameStyle(f, f->StyleContext())) {
nsIFrame::ChildListIterator lists(f);
for (; !lists.IsDone(); lists.Next()) {
for (nsIFrame* child : lists.CurrentList()) {
// Out-of-flows are reached through their placeholders. Continuations
// and block-in-inline splits are reached through those chains.
if (!(child->GetStateBits() & NS_FRAME_OUT_OF_FLOW) &&
!GetPrevContinuationWithSameStyle(child)) {
// only do frames that are in flow
@@ -1951,17 +1952,17 @@ ElementRestyler::MoveStyleContextsForChi
nsTArray<nsStyleContext*> contextsToMove;
MOZ_ASSERT(!MustReframeForBeforePseudo(),
"shouldn't need to reframe ::before as we would have had "
"eRestyle_Subtree and wouldn't get in here");
DebugOnly<nsIFrame*> lastContinuation;
for (nsIFrame* f = mFrame; f;
- f = RestyleManager::GetNextContinuationWithSameStyle(f, f->StyleContext())) {
+ f = GeckoRestyleManager::GetNextContinuationWithSameStyle(f, f->StyleContext())) {
lastContinuation = f;
if (!MoveStyleContextsForContentChildren(f, aOldContext, contextsToMove)) {
return false;
}
}
MOZ_ASSERT(!MustReframeForAfterPseudo(lastContinuation),
"shouldn't need to reframe ::after as we would have had "
@@ -2106,19 +2107,18 @@ ElementRestyler::Restyle(nsRestyleHint a
if (thisResult > result) {
// We take the highest RestyleResult value when working out what to do
// with this frame and its descendants. Higher RestyleResult values
// represent a superset of the work done by lower values.
result = thisResult;
}
- f = RestyleManager::GetNextContinuationWithSameStyle(f,
- oldContext,
- &haveMoreContinuations);
+ f = GeckoRestyleManager::GetNextContinuationWithSameStyle(
+ f, oldContext, &haveMoreContinuations);
}
// Some changes to animations don't affect the computed style and yet still
// require the layer to be updated. For example, pausing an animation via
// the Web Animations API won't affect an element's style but still
// requires us to pull the animation off the layer.
//
// Although we only expect this code path to be called when computed style
@@ -2615,17 +2615,17 @@ ElementRestyler::RestyleSelf(nsIFrame* a
// Getting the hint would be nice too, but that's harder.
// XXXbryner we may be able to avoid some of the refcounting goop here.
// We do need a reference to oldContext for the lifetime of this function, and it's possible
// that the frame has the last reference to it, so AddRef it here.
LOG_RESTYLE("RestyleSelf %s, aRestyleHint = %s",
FrameTagToString(aSelf).get(),
- RestyleManagerBase::RestyleHintToString(aRestyleHint).get());
+ RestyleManager::RestyleHintToString(aRestyleHint).get());
LOG_RESTYLE_INDENT();
// Initially assume that it is safe to stop restyling.
//
// Throughout most of this function, we update the following two variables
// independently. |result| is set to RestyleResult::eContinue when we
// detect a condition that would not allow us to return RestyleResult::eStop.
// |canStopWithStyleChange| is set to false when we detect a condition
@@ -2902,39 +2902,39 @@ ElementRestyler::RestyleSelf(nsIFrame* a
if (result == RestyleResult::eStop) {
oldContext->CalcStyleDifference(newContext, nsChangeHint(0),
&equalStructs,
&samePointerStructs);
if (equalStructs != NS_STYLE_INHERIT_MASK) {
// At least one struct had different data in it, so we must
// continue restyling children.
LOG_RESTYLE_CONTINUE("there is different style data: %s",
- RestyleManager::StructNamesToString(
+ GeckoRestyleManager::StructNamesToString(
~equalStructs & NS_STYLE_INHERIT_MASK).get());
result = RestyleResult::eContinue;
}
}
} else {
bool changedStyle =
- RestyleManager::TryInitiatingTransition(mPresContext,
- aSelf->GetContent(),
- oldContext, &newContext);
+ GeckoRestyleManager::TryInitiatingTransition(mPresContext,
+ aSelf->GetContent(),
+ oldContext, &newContext);
if (changedStyle) {
LOG_RESTYLE_CONTINUE("TryInitiatingTransition changed the new style "
"context");
result = RestyleResult::eContinue;
canStopWithStyleChange = false;
}
CaptureChange(oldContext, newContext, assumeDifferenceHint,
&equalStructs, &samePointerStructs);
if (equalStructs != NS_STYLE_INHERIT_MASK) {
// At least one struct had different data in it, so we must
// continue restyling children.
LOG_RESTYLE_CONTINUE("there is different style data: %s",
- RestyleManager::StructNamesToString(
+ GeckoRestyleManager::StructNamesToString(
~equalStructs & NS_STYLE_INHERIT_MASK).get());
result = RestyleResult::eContinue;
}
}
if (canStopWithStyleChange) {
// If any inherited struct pointers are different, or if any
// reset struct pointers are different and we have descendants
@@ -3036,17 +3036,17 @@ ElementRestyler::RestyleSelf(nsIFrame* a
swap->mStructsToSwap = equalStructs;
} else {
LOG_RESTYLE("swapping style structs between %p and %p",
oldContext.get(), newContext.get());
oldContext->SwapStyleData(newContext, equalStructs);
*aSwappedStructs |= equalStructs;
}
#ifdef RESTYLE_LOGGING
- uint32_t structs = RestyleManager::StructsToLog() & equalStructs;
+ uint32_t structs = GeckoRestyleManager::StructsToLog() & equalStructs;
if (structs) {
LOG_RESTYLE_INDENT();
LOG_RESTYLE("old style context now has: %s",
oldContext->GetCachedStyleDataAsString(structs).get());
LOG_RESTYLE("new style context now has: %s",
newContext->GetCachedStyleDataAsString(structs).get());
}
#endif
@@ -3191,17 +3191,17 @@ ElementRestyler::RestyleChildren(nsResty
// kids would use mFrame->StyleContext(), which is out of date if
// mHintsHandled has a ReconstructFrame hint; doing this could trigger
// assertions about mismatched rule trees.
nsIFrame* lastContinuation;
if (!(mHintsHandled & nsChangeHint_ReconstructFrame)) {
InitializeAccessibilityNotifications(mFrame->StyleContext());
for (nsIFrame* f = mFrame; f;
- f = RestyleManager::GetNextContinuationWithSameStyle(f, f->StyleContext())) {
+ f = GeckoRestyleManager::GetNextContinuationWithSameStyle(f, f->StyleContext())) {
lastContinuation = f;
RestyleContentChildren(f, aChildRestyleHint);
}
SendAccessibilityNotifications();
}
// Check whether we might need to create a new ::after frame.
@@ -3311,17 +3311,18 @@ ElementRestyler::ComputeStyleChangeFor(n
content ? content->GetParentElementCrossingShadowRoot() : nullptr;
treeMatchContext.InitAncestors(parent);
nsTArray<nsCSSSelector*> selectorsForDescendants;
selectorsForDescendants.AppendElements(
aRestyleHintData.mSelectorsForDescendants);
nsTArray<nsIContent*> visibleKidsOfHiddenElement;
nsIFrame* nextIBSibling;
for (nsIFrame* ibSibling = aFrame; ibSibling; ibSibling = nextIBSibling) {
- nextIBSibling = RestyleManager::GetNextBlockInInlineSibling(propTable, ibSibling);
+ nextIBSibling =
+ GeckoRestyleManager::GetNextBlockInInlineSibling(propTable, ibSibling);
if (nextIBSibling) {
// Don't allow some ib-split siblings to be processed with
// RestyleResult::eStopWithStyleChange and others not.
aRestyleHint |= eRestyle_Force;
}
// Outer loop over ib-split siblings
@@ -3731,21 +3732,22 @@ ClearCachedInheritedStyleDataOnDescendan
entry.mStyleContext->ClearCachedInheritedStyleDataOnDescendants(
entry.mStructs);
}
entry.mStyleContext = nullptr;
}
}
void
-RestyleManager::ComputeAndProcessStyleChange(nsIFrame* aFrame,
- nsChangeHint aMinChange,
- RestyleTracker& aRestyleTracker,
- nsRestyleHint aRestyleHint,
- const RestyleHintData& aRestyleHintData)
+GeckoRestyleManager::ComputeAndProcessStyleChange(
+ nsIFrame* aFrame,
+ nsChangeHint aMinChange,
+ RestyleTracker& aRestyleTracker,
+ nsRestyleHint aRestyleHint,
+ const RestyleHintData& aRestyleHintData)
{
MOZ_ASSERT(mReframingStyleContexts, "should have rsc");
nsStyleChangeList changeList;
nsTArray<ElementRestyler::ContextToClear> contextsToClear;
// swappedStructOwners needs to be kept alive until after
// ProcessRestyledFrames and ClearCachedInheritedStyleDataOnDescendants
// calls; see comment in ElementRestyler::Restyle.
@@ -3754,22 +3756,23 @@ RestyleManager::ComputeAndProcessStyleCh
aRestyleTracker, aRestyleHint,
aRestyleHintData,
contextsToClear, swappedStructOwners);
ProcessRestyledFrames(changeList);
ClearCachedInheritedStyleDataOnDescendants(contextsToClear);
}
void
-RestyleManager::ComputeAndProcessStyleChange(nsStyleContext* aNewContext,
- Element* aElement,
- nsChangeHint aMinChange,
- RestyleTracker& aRestyleTracker,
- nsRestyleHint aRestyleHint,
- const RestyleHintData& aRestyleHintData)
+GeckoRestyleManager::ComputeAndProcessStyleChange(
+ nsStyleContext* aNewContext,
+ Element* aElement,
+ nsChangeHint aMinChange,
+ RestyleTracker& aRestyleTracker,
+ nsRestyleHint aRestyleHint,
+ const RestyleHintData& aRestyleHintData)
{
MOZ_ASSERT(mReframingStyleContexts, "should have rsc");
MOZ_ASSERT(aNewContext->StyleDisplay()->mDisplay == StyleDisplay::Contents);
nsIFrame* frame = GetNearestAncestorFrame(aElement);
MOZ_ASSERT(frame, "display:contents node in map although it's a "
"display:none descendant?");
TreeMatchContext treeMatchContext(true,
nsRuleWalker::eRelevantLinkUnvisited,
@@ -3843,17 +3846,17 @@ AutoDisplayContentsAncestorPusher::~Auto
mTreeMatchContext.mAncestorFilter.PopAncestor();
}
mTreeMatchContext.PopStyleScope(mAncestors[i]);
}
}
#ifdef RESTYLE_LOGGING
uint32_t
-RestyleManager::StructsToLog()
+GeckoRestyleManager::StructsToLog()
{
static bool initialized = false;
static uint32_t structs;
if (!initialized) {
structs = 0;
const char* value = getenv("MOZ_DEBUG_RESTYLE_STRUCTS");
if (value) {
nsCString s(value);
@@ -3876,17 +3879,17 @@ RestyleManager::StructsToLog()
initialized = true;
}
return structs;
}
#endif
#ifdef DEBUG
/* static */ nsCString
-RestyleManager::StructNamesToString(uint32_t aSIDs)
+GeckoRestyleManager::StructNamesToString(uint32_t aSIDs)
{
nsCString result;
bool any = false;
for (nsStyleStructID sid = nsStyleStructID(0);
sid < nsStyleStructID_Length;
sid = nsStyleStructID(sid + 1)) {
if (aSIDs & nsCachedStyleData::GetBitForSID(sid)) {
if (any) {
--- a/layout/base/GeckoRestyleManager.h
+++ b/layout/base/GeckoRestyleManager.h
@@ -3,18 +3,18 @@
* 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/. */
/**
* Code responsible for managing style changes: tracking what style
* changes need to happen, scheduling them, and doing them.
*/
-#ifndef mozilla_RestyleManager_h
-#define mozilla_RestyleManager_h
+#ifndef mozilla_GeckoRestyleManager_h
+#define mozilla_GeckoRestyleManager_h
#include "mozilla/RestyleLogging.h"
#include "mozilla/RestyleManager.h"
#include "nsISupportsImpl.h"
#include "nsChangeHint.h"
#include "RestyleTracker.h"
#include "nsPresContext.h"
#include "nsRefreshDriver.h"
@@ -29,36 +29,36 @@ namespace mozilla {
enum class CSSPseudoElementType : uint8_t;
class EventStates;
struct UndisplayedNode;
namespace dom {
class Element;
} // namespace dom
-class RestyleManager final : public RestyleManagerBase
+class GeckoRestyleManager final : public RestyleManager
{
public:
- typedef RestyleManagerBase base_type;
+ typedef RestyleManager base_type;
friend class RestyleTracker;
friend class ElementRestyler;
- explicit RestyleManager(nsPresContext* aPresContext);
+ explicit GeckoRestyleManager(nsPresContext* aPresContext);
private:
// Private destructor, to discourage deletion outside of Release():
- ~RestyleManager()
+ ~GeckoRestyleManager()
{
MOZ_ASSERT(!mReframingStyleContexts,
"temporary member should be nulled out before destruction");
}
public:
- NS_INLINE_DECL_REFCOUNTING(mozilla::RestyleManager)
+ NS_INLINE_DECL_REFCOUNTING(mozilla::GeckoRestyleManager)
// Forwarded nsIDocumentObserver method, to handle restyling (and
// passing the notification to the frame).
nsresult ContentStateChanged(nsIContent* aContent,
EventStates aStateMask);
// Forwarded nsIMutationObserver method, to handle restyling.
void AttributeWillChange(Element* aElement,
@@ -150,17 +150,17 @@ public:
class MOZ_STACK_CLASS ReframingStyleContexts final {
public:
/**
* Construct a ReframingStyleContexts object. The caller must
* ensure that aRestyleManager lives at least as long as the
* object. (This is generally easy since the caller is typically a
* method of RestyleManager.)
*/
- explicit ReframingStyleContexts(RestyleManager* aRestyleManager);
+ explicit ReframingStyleContexts(GeckoRestyleManager* aRestyleManager);
~ReframingStyleContexts();
void Put(nsIContent* aContent, nsStyleContext* aStyleContext) {
MOZ_ASSERT(aContent);
CSSPseudoElementType pseudoType = aStyleContext->GetPseudoType();
if (pseudoType == CSSPseudoElementType::NotPseudo) {
mElementContexts.Put(aContent, aStyleContext);
} else if (pseudoType == CSSPseudoElementType::before) {
@@ -185,17 +185,17 @@ public:
if (aPseudoType == CSSPseudoElementType::after) {
MOZ_ASSERT(aContent->NodeInfo()->NameAtom() == nsGkAtoms::mozgeneratedcontentafter);
return mAfterPseudoContexts.GetWeak(aContent->GetParent());
}
MOZ_ASSERT(false, "unexpected aPseudoType");
return nullptr;
}
private:
- RestyleManager* mRestyleManager;
+ GeckoRestyleManager* mRestyleManager;
AutoRestore<ReframingStyleContexts*> mRestorePointer;
ReframingStyleContextTable mElementContexts;
ReframingStyleContextTable mBeforePseudoContexts;
ReframingStyleContextTable mAfterPseudoContexts;
};
/**
* Return the current ReframingStyleContexts struct, or null if we're
@@ -351,17 +351,17 @@ public:
#ifdef DEBUG
bool InRebuildAllStyleData() const { return mInRebuildAllStyleData; }
#endif
#ifdef RESTYLE_LOGGING
/**
* Returns whether a restyle event currently being processed by this
- * RestyleManager should be logged.
+ * GeckoRestyleManager should be logged.
*/
bool ShouldLogRestyle() {
return ShouldLogRestyle(PresContext());
}
/**
* Returns whether a restyle event currently being processed for the
* document with the specified nsPresContext should be logged.
@@ -392,17 +392,17 @@ public:
static nsCString StructNamesToString(uint32_t aSIDs);
int32_t& LoggingDepth() { return mLoggingDepth; }
#endif
private:
inline nsStyleSet* StyleSet() const {
MOZ_ASSERT(PresContext()->StyleSet()->IsGecko(),
- "RestyleManager should only be used with a Gecko-flavored "
+ "GeckoRestyleManager should only be used with a Gecko-flavored "
"style backend");
return PresContext()->StyleSet()->AsGecko();
}
/* aMinHint is the minimal change that should be made to the element */
// XXXbz do we really need the aPrimaryFrame argument here?
void RestyleElement(Element* aElement,
nsIFrame* aPrimaryFrame,
@@ -535,17 +535,17 @@ public:
* have been handled by ancestors, and by the end of Restyle it
* represents the hints that have been handled for this frame. This
* method is intended to be called after Restyle, to find out what
* hints have been handled for this frame.
*/
nsChangeHint HintsHandledForFrame() { return mHintsHandled; }
/**
- * Called from RestyleManager::ComputeAndProcessStyleChange to restyle
+ * Called from GeckoRestyleManager::ComputeAndProcessStyleChange to restyle
* children of a display:contents element.
*/
void RestyleChildrenOfDisplayContentsElement(nsIFrame* aParentFrame,
nsStyleContext* aNewContext,
nsChangeHint aMinHint,
RestyleTracker& aRestyleTracker,
nsRestyleHint aRestyleHint,
const RestyleHintData&
@@ -562,17 +562,17 @@ public:
nsRestyleHint aRestyleHint,
const RestyleHintData& aRestyleHintData,
nsTArray<ContextToClear>& aContextsToClear,
nsTArray<RefPtr<nsStyleContext>>&
aSwappedStructOwners);
#ifdef RESTYLE_LOGGING
bool ShouldLogRestyle() {
- return RestyleManager::ShouldLogRestyle(mPresContext);
+ return GeckoRestyleManager::ShouldLogRestyle(mPresContext);
}
#endif
private:
inline nsStyleSet* StyleSet() const;
// Enum class for the result of RestyleSelf, which indicates whether the
// restyle procedure should continue to the children, and how.
@@ -815,9 +815,9 @@ class MOZ_RAII AutoDisplayContentsAncest
private:
TreeMatchContext& mTreeMatchContext;
nsPresContext* const mPresContext;
AutoTArray<mozilla::dom::Element*, 4> mAncestors;
};
} // namespace mozilla
-#endif /* mozilla_RestyleManager_h */
+#endif /* mozilla_GeckoRestyleManager_h */
--- a/layout/base/RestyleManager.cpp
+++ b/layout/base/RestyleManager.cpp
@@ -6,37 +6,37 @@
#include "mozilla/RestyleManager.h"
#include "mozilla/StyleSetHandleInlines.h"
#include "nsIFrame.h"
#include "nsIPresShellInlines.h"
namespace mozilla {
-RestyleManagerBase::RestyleManagerBase(nsPresContext* aPresContext)
+RestyleManager::RestyleManager(nsPresContext* aPresContext)
: mPresContext(aPresContext)
, mRestyleGeneration(1)
, mHoverGeneration(0)
, mObservingRefreshDriver(false)
, mInStyleRefresh(false)
{
MOZ_ASSERT(mPresContext);
}
/**
* Calculates the change hint and the restyle hint for a given content state
* change.
*
* This is called from both Restyle managers.
*/
void
-RestyleManagerBase::ContentStateChangedInternal(Element* aElement,
- EventStates aStateMask,
- nsChangeHint* aOutChangeHint,
- nsRestyleHint* aOutRestyleHint)
+RestyleManager::ContentStateChangedInternal(Element* aElement,
+ EventStates aStateMask,
+ nsChangeHint* aOutChangeHint,
+ nsRestyleHint* aOutRestyleHint)
{
MOZ_ASSERT(aOutChangeHint);
MOZ_ASSERT(aOutRestyleHint);
StyleSetHandle styleSet = PresContext()->StyleSet();
NS_ASSERTION(styleSet, "couldn't get style set");
*aOutChangeHint = nsChangeHint(0);
@@ -99,17 +99,17 @@ RestyleManagerBase::ContentStateChangedI
// Exposing information to the page about whether the link is
// visited or not isn't really something we can worry about here.
// FIXME: We could probably do this a bit better.
*aOutChangeHint |= nsChangeHint_RepaintFrame;
}
}
/* static */ nsCString
-RestyleManagerBase::RestyleHintToString(nsRestyleHint aHint)
+RestyleManager::RestyleHintToString(nsRestyleHint aHint)
{
nsCString result;
bool any = false;
const char* names[] = {
"Self", "SomeDescendants", "Subtree", "LaterSiblings", "CSSTransitions",
"CSSAnimations", "SVGAttrAnimations", "StyleAttribute",
"StyleAttribute_Animations", "Force", "ForceDescendants"
};
@@ -134,17 +134,17 @@ RestyleManagerBase::RestyleHintToString(
result.AppendLiteral("0");
}
}
return result;
}
#ifdef DEBUG
/* static */ nsCString
-RestyleManagerBase::ChangeHintToString(nsChangeHint aHint)
+RestyleManager::ChangeHintToString(nsChangeHint aHint)
{
nsCString result;
bool any = false;
const char* names[] = {
"RepaintFrame", "NeedReflow", "ClearAncestorIntrinsics",
"ClearDescendantIntrinsics", "NeedDirtyReflow", "SyncFrameView",
"UpdateCursor", "UpdateEffects", "UpdateOpacityLayer",
"UpdateTransformLayer", "ReconstructFrame", "UpdateOverflow",
@@ -199,17 +199,17 @@ RestyleManagerBase::ChangeHintToString(n
result.AppendLiteral("nsChangeHint(0)");
}
}
return result;
}
#endif
void
-RestyleManagerBase::PostRestyleEventInternal(bool aForLazyConstruction)
+RestyleManager::PostRestyleEventInternal(bool aForLazyConstruction)
{
// Make sure we're not in a style refresh; if we are, we still have
// a call to ProcessPendingRestyles coming and there's no need to
// add ourselves as a refresh observer until then.
bool inRefresh = !aForLazyConstruction && mInStyleRefresh;
nsIPresShell* presShell = PresContext()->PresShell();
if (!ObservingRefreshDriver() && !inRefresh) {
SetObservingRefreshDriver(PresContext()->RefreshDriver()->
@@ -372,17 +372,17 @@ VerifyStyleTree(nsIFrame* aFrame)
for (nsStyleContext* extraContext;
(extraContext = aFrame->GetAdditionalStyleContext(contextIndex));
++contextIndex) {
VerifyContextParent(aFrame, extraContext, context);
}
}
void
-RestyleManagerBase::DebugVerifyStyleTree(nsIFrame* aFrame)
+RestyleManager::DebugVerifyStyleTree(nsIFrame* aFrame)
{
if (IsServo()) {
// XXXheycam For now, we know that we don't use the same inheritance
// hierarchy for certain cases, so just skip these assertions until
// we work out what we want to assert (bug 1322570).
return;
}
if (aFrame) {
@@ -729,30 +729,30 @@ NeedToReframeForAddingOrRemovingTransfor
if (FrameHasPositionedPlaceholderDescendants(f, positionMask)) {
return true;
}
}
return false;
}
/* static */ nsIFrame*
-RestyleManagerBase::GetNearestAncestorFrame(nsIContent* aContent)
+RestyleManager::GetNearestAncestorFrame(nsIContent* aContent)
{
nsIFrame* ancestorFrame = nullptr;
for (nsIContent* ancestor = aContent->GetParent();
ancestor && !ancestorFrame;
ancestor = ancestor->GetParent()) {
ancestorFrame = ancestor->GetPrimaryFrame();
}
return ancestorFrame;
}
/* static */ nsIFrame*
-RestyleManagerBase::GetNextBlockInInlineSibling(FramePropertyTable* aPropTable,
- nsIFrame* aFrame)
+RestyleManager::GetNextBlockInInlineSibling(FramePropertyTable* aPropTable,
+ nsIFrame* aFrame)
{
NS_ASSERTION(!aFrame->GetPrevContinuation(),
"must start with the first continuation");
// Might we have ib-split siblings?
if (!(aFrame->GetStateBits() & NS_FRAME_PART_OF_IBSPLIT)) {
// nothing more to do here
return nullptr;
}
@@ -1018,17 +1018,17 @@ StyleChangeReflow(nsIFrame* aFrame, nsCh
do {
aFrame->PresContext()->PresShell()->FrameNeedsReflow(
aFrame, dirtyType, dirtyBits, rootHandling);
aFrame = nsLayoutUtils::GetNextContinuationOrIBSplitSibling(aFrame);
} while (aFrame);
}
/* static */ nsIFrame*
-RestyleManagerBase::GetNextContinuationWithSameStyle(
+RestyleManager::GetNextContinuationWithSameStyle(
nsIFrame* aFrame, nsStyleContext* aOldStyleContext,
bool* aHaveMoreContinuations)
{
// See GetPrevContinuationWithSameStyle about {ib} splits.
nsIFrame* nextContinuation = aFrame->GetNextContinuation();
if (!nextContinuation &&
(aFrame->GetStateBits() & NS_FRAME_PART_OF_IBSPLIT)) {
@@ -1058,17 +1058,17 @@ RestyleManagerBase::GetNextContinuationW
if (aHaveMoreContinuations) {
*aHaveMoreContinuations = true;
}
}
return nextContinuation;
}
nsresult
-RestyleManagerBase::ProcessRestyledFrames(nsStyleChangeList& aChangeList)
+RestyleManager::ProcessRestyledFrames(nsStyleChangeList& aChangeList)
{
NS_ASSERTION(!nsContentUtils::IsSafeToRunScript(),
"Someone forgot a script blocker");
if (aChangeList.IsEmpty())
return NS_OK;
PROFILER_LABEL("RestyleManager", "ProcessRestyledFrames",
js::ProfileEntry::Category::CSS);
@@ -1370,41 +1370,40 @@ RestyleManagerBase::ProcessRestyledFrame
}
#endif
}
aChangeList.Clear();
return NS_OK;
}
-RestyleManagerBase::AnimationsWithDestroyedFrame
- ::AnimationsWithDestroyedFrame(
- RestyleManagerBase* aRestyleManager)
+RestyleManager::AnimationsWithDestroyedFrame::AnimationsWithDestroyedFrame(
+ RestyleManager* aRestyleManager)
: mRestyleManager(aRestyleManager)
, mRestorePointer(mRestyleManager->mAnimationsWithDestroyedFrame)
{
MOZ_ASSERT(!mRestyleManager->mAnimationsWithDestroyedFrame,
"shouldn't construct recursively");
mRestyleManager->mAnimationsWithDestroyedFrame = this;
}
void
-RestyleManagerBase::AnimationsWithDestroyedFrame
- ::StopAnimationsForElementsWithoutFrames()
+RestyleManager::AnimationsWithDestroyedFrame
+ ::StopAnimationsForElementsWithoutFrames()
{
StopAnimationsWithoutFrame(mContents, CSSPseudoElementType::NotPseudo);
StopAnimationsWithoutFrame(mBeforeContents, CSSPseudoElementType::before);
StopAnimationsWithoutFrame(mAfterContents, CSSPseudoElementType::after);
}
void
-RestyleManagerBase::AnimationsWithDestroyedFrame
- ::StopAnimationsWithoutFrame(
- nsTArray<RefPtr<nsIContent>>& aArray,
- CSSPseudoElementType aPseudoType)
+RestyleManager::AnimationsWithDestroyedFrame
+ ::StopAnimationsWithoutFrame(
+ nsTArray<RefPtr<nsIContent>>& aArray,
+ CSSPseudoElementType aPseudoType)
{
nsAnimationManager* animationManager =
mRestyleManager->PresContext()->AnimationManager();
nsTransitionManager* transitionManager =
mRestyleManager->PresContext()->TransitionManager();
for (nsIContent* content : aArray) {
if (content->GetPrimaryFrame()) {
continue;
--- a/layout/base/RestyleManager.h
+++ b/layout/base/RestyleManager.h
@@ -1,43 +1,43 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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_RestyleManagerBase_h
-#define mozilla_RestyleManagerBase_h
+#ifndef mozilla_RestyleManager_h
+#define mozilla_RestyleManager_h
#include "mozilla/OverflowChangedTracker.h"
#include "nsChangeHint.h"
#include "nsPresContext.h"
class nsCString;
class nsCSSFrameConstructor;
class nsStyleChangeList;
namespace mozilla {
class EventStates;
-class RestyleManager;
+class GeckoRestyleManager;
class ServoRestyleManager;
namespace dom {
class Element;
}
/**
- * Class for sharing data and logic common to both RestyleManager and
+ * Class for sharing data and logic common to both GeckoRestyleManager and
* ServoRestyleManager.
*/
-class RestyleManagerBase
+class RestyleManager
{
protected:
- explicit RestyleManagerBase(nsPresContext* aPresContext);
+ explicit RestyleManager(nsPresContext* aPresContext);
public:
typedef mozilla::dom::Element Element;
// Get an integer that increments every time we process pending restyles.
// The value is never 0.
uint32_t GetRestyleGeneration() const { return mRestyleGeneration; }
@@ -87,17 +87,17 @@ public:
// on elements that have no frame at the end of the restyling process.
// It only lives during the restyling process.
class MOZ_STACK_CLASS AnimationsWithDestroyedFrame final {
public:
// Construct a AnimationsWithDestroyedFrame object. The caller must
// ensure that aRestyleManager lives at least as long as the
// object. (This is generally easy since the caller is typically a
// method of RestyleManager.)
- explicit AnimationsWithDestroyedFrame(RestyleManagerBase* aRestyleManager);
+ explicit AnimationsWithDestroyedFrame(RestyleManager* aRestyleManager);
// This method takes the content node for the generated content for
// animation/transition on ::before and ::after, rather than the
// content node for the real element.
void Put(nsIContent* aContent, nsStyleContext* aStyleContext) {
MOZ_ASSERT(aContent);
CSSPseudoElementType pseudoType = aStyleContext->GetPseudoType();
if (pseudoType == CSSPseudoElementType::NotPseudo) {
@@ -114,17 +114,17 @@ public:
}
void StopAnimationsForElementsWithoutFrames();
private:
void StopAnimationsWithoutFrame(nsTArray<RefPtr<nsIContent>>& aArray,
CSSPseudoElementType aPseudoType);
- RestyleManagerBase* mRestyleManager;
+ RestyleManager* mRestyleManager;
AutoRestore<AnimationsWithDestroyedFrame*> mRestorePointer;
// Below three arrays might include elements that have already had their
// animations or transitions stopped.
//
// mBeforeContents and mAfterContents hold the real element rather than
// the content node for the generated content (which might change during
// a reframe)
@@ -137,17 +137,17 @@ public:
* Return the current AnimationsWithDestroyedFrame struct, or null if we're
* not currently in a restyling operation.
*/
AnimationsWithDestroyedFrame* GetAnimationsWithDestroyedFrame() {
return mAnimationsWithDestroyedFrame;
}
protected:
- ~RestyleManagerBase() {
+ ~RestyleManager() {
MOZ_ASSERT(!mAnimationsWithDestroyedFrame,
"leaving dangling pointers from AnimationsWithDestroyedFrame");
}
void ContentStateChangedInternal(Element* aElement,
EventStates aStateMask,
nsChangeHint* aOutChangeHint,
nsRestyleHint* aOutRestyleHint);
--- a/layout/base/RestyleManagerHandle.h
+++ b/layout/base/RestyleManagerHandle.h
@@ -10,35 +10,35 @@
#include "mozilla/Assertions.h"
#include "mozilla/EventStates.h"
#include "mozilla/HandleRefPtr.h"
#include "mozilla/RefCountType.h"
#include "mozilla/StyleBackendType.h"
#include "nsChangeHint.h"
namespace mozilla {
+class GeckoRestyleManager;
class RestyleManager;
class ServoRestyleManager;
-class RestyleManagerBase;
namespace dom {
class Element;
} // namespace dom
} // namespace mozilla
class nsAttrValue;
class nsIAtom;
class nsIContent;
class nsIFrame;
class nsStyleChangeList;
namespace mozilla {
#define SERVO_BIT 0x1
/**
- * Smart pointer class that can hold a pointer to either a RestyleManager
+ * Smart pointer class that can hold a pointer to either a GeckoRestyleManager
* or a ServoRestyleManager.
*/
class RestyleManagerHandle
{
public:
typedef HandleRefPtr<RestyleManagerHandle> RefPtr;
// We define this Ptr class with a RestyleManager API that forwards on to the
@@ -62,61 +62,61 @@ public:
}
StyleBackendType BackendType() const
{
return IsGecko() ? StyleBackendType::Gecko :
StyleBackendType::Servo;
}
- RestyleManager* AsGecko()
+ GeckoRestyleManager* AsGecko()
{
MOZ_ASSERT(IsGecko());
- return reinterpret_cast<RestyleManager*>(mValue);
+ return reinterpret_cast<GeckoRestyleManager*>(mValue);
}
ServoRestyleManager* AsServo()
{
MOZ_ASSERT(IsServo());
return reinterpret_cast<ServoRestyleManager*>(mValue & ~SERVO_BIT);
}
- RestyleManager* GetAsGecko() { return IsGecko() ? AsGecko() : nullptr; }
+ GeckoRestyleManager* GetAsGecko() { return IsGecko() ? AsGecko() : nullptr; }
ServoRestyleManager* GetAsServo() { return IsServo() ? AsServo() : nullptr; }
- const RestyleManager* AsGecko() const
+ const GeckoRestyleManager* AsGecko() const
{
return const_cast<Ptr*>(this)->AsGecko();
}
const ServoRestyleManager* AsServo() const
{
MOZ_ASSERT(IsServo());
return const_cast<Ptr*>(this)->AsServo();
}
- const RestyleManager* GetAsGecko() const { return IsGecko() ? AsGecko() : nullptr; }
+ const GeckoRestyleManager* GetAsGecko() const { return IsGecko() ? AsGecko() : nullptr; }
const ServoRestyleManager* GetAsServo() const { return IsServo() ? AsServo() : nullptr; }
- const mozilla::RestyleManagerBase* AsBase() const {
- return reinterpret_cast<const RestyleManagerBase*>(mValue & ~SERVO_BIT);
+ const RestyleManager* AsBase() const {
+ return reinterpret_cast<const RestyleManager*>(mValue & ~SERVO_BIT);
}
- mozilla::RestyleManagerBase* AsBase() {
- return reinterpret_cast<RestyleManagerBase*>(mValue & ~SERVO_BIT);
+ RestyleManager* AsBase() {
+ return reinterpret_cast<RestyleManager*>(mValue & ~SERVO_BIT);
}
// 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 or ServoRestyleManager. See corresponding comments in
- // RestyleManager.h for descriptions of these methods.
+ // GeckoRestyleManager or ServoRestyleManager. See corresponding comments
+ // in GeckoRestyleManager.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);
@@ -150,47 +150,47 @@ public:
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 or a ServoRestyleManager. The least
- // significant bit is 0 for the former, 1 for the latter. This is
+ // Stores a pointer to a GeckoRestyleManager or a ServoRestyleManager.
+ // The least significant bit is 0 for the former, 1 for the latter. This is
// valid as the least significant bit will never be used for a pointer
// value on platforms we care about.
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)
+ MOZ_IMPLICIT RestyleManagerHandle(GeckoRestyleManager* aManager)
{
*this = aManager;
}
MOZ_IMPLICIT RestyleManagerHandle(ServoRestyleManager* aManager)
{
*this = aManager;
}
RestyleManagerHandle& operator=(decltype(nullptr))
{
mPtr.mValue = 0;
return *this;
}
- RestyleManagerHandle& operator=(RestyleManager* aManager)
+ RestyleManagerHandle& operator=(GeckoRestyleManager* aManager)
{
MOZ_ASSERT(!(reinterpret_cast<uintptr_t>(aManager) & SERVO_BIT),
"least significant bit shouldn't be set; we use it for state");
mPtr.mValue = reinterpret_cast<uintptr_t>(aManager);
return *this;
}
RestyleManagerHandle& operator=(ServoRestyleManager* aManager)
--- a/layout/base/RestyleTracker.cpp
+++ b/layout/base/RestyleTracker.cpp
@@ -72,29 +72,29 @@ RestyleTracker::ProcessOneRestyle(Elemen
{
NS_PRECONDITION((aRestyleHint & eRestyle_LaterSiblings) == 0,
"Someone should have handled this before calling us");
NS_PRECONDITION(Document(), "Must have a document");
NS_PRECONDITION(aElement->GetComposedDoc() == Document(),
"Element has unexpected document");
LOG_RESTYLE("aRestyleHint = %s, aChangeHint = %s",
- RestyleManager::RestyleHintToString(aRestyleHint).get(),
- RestyleManager::ChangeHintToString(aChangeHint).get());
+ GeckoRestyleManager::RestyleHintToString(aRestyleHint).get(),
+ GeckoRestyleManager::ChangeHintToString(aChangeHint).get());
nsIFrame* primaryFrame = aElement->GetPrimaryFrame();
if (aRestyleHint & ~eRestyle_LaterSiblings) {
#ifdef RESTYLE_LOGGING
if (ShouldLogRestyle() && primaryFrame &&
- RestyleManager::StructsToLog() != 0) {
+ GeckoRestyleManager::StructsToLog() != 0) {
LOG_RESTYLE("style context tree before restyle:");
LOG_RESTYLE_INDENT();
primaryFrame->StyleContext()->LogStyleContextTree(
- LoggingDepth(), RestyleManager::StructsToLog());
+ LoggingDepth(), GeckoRestyleManager::StructsToLog());
}
#endif
mRestyleManager->RestyleElement(aElement, primaryFrame, aChangeHint,
*this, aRestyleHint, aRestyleHintData);
} else if (aChangeHint &&
(primaryFrame ||
(aChangeHint & nsChangeHint_ReconstructFrame))) {
// Don't need to recompute style; just apply the hint
@@ -141,17 +141,17 @@ RestyleTracker::DoProcessRestyles()
// EndProcessingRestyles makes. This is because in EndReconstruct we
// try to destroy the old rule tree using the GC mechanism, which
// means it only gets destroyed if it's unreferenced (and if it's
// referenced, we assert). So we want the ReframingStyleContexts
// (which holds old style contexts) to be destroyed before the
// EndReconstruct so those style contexts go away before
// EndReconstruct.
{
- RestyleManager::ReframingStyleContexts
+ GeckoRestyleManager::ReframingStyleContexts
reframingStyleContexts(mRestyleManager);
mRestyleManager->BeginProcessingRestyles(*this);
LOG_RESTYLE("Processing %d pending %srestyles with %d restyle roots for %s",
mPendingRestyles.Count(),
mRestyleManager->PresContext()->TransitionManager()->
InAnimationOnlyStyleUpdate()
--- a/layout/base/RestyleTracker.h
+++ b/layout/base/RestyleTracker.h
@@ -19,18 +19,18 @@
#include "nsIContentInlines.h"
#include "mozilla/SplayTree.h"
#include "mozilla/RestyleLogging.h"
#include "GeckoProfiler.h"
#include "mozilla/Maybe.h"
namespace mozilla {
-class RestyleManager;
class ElementRestyler;
+class GeckoRestyleManager;
class RestyleTracker {
public:
typedef mozilla::dom::Element Element;
friend class ElementRestyler; // for AddPendingRestyleToTable
explicit RestyleTracker(Element::FlagsType aRestyleBits)
@@ -47,17 +47,17 @@ public:
"Shouldn't have both restyle flags set");
NS_PRECONDITION((mRestyleBits & ELEMENT_POTENTIAL_RESTYLE_ROOT_FLAGS) != 0,
"Must have root flag");
NS_PRECONDITION((mRestyleBits & ELEMENT_POTENTIAL_RESTYLE_ROOT_FLAGS) !=
ELEMENT_POTENTIAL_RESTYLE_ROOT_FLAGS,
"Shouldn't have both root flags");
}
- void Init(RestyleManager* aRestyleManager) {
+ void Init(GeckoRestyleManager* aRestyleManager) {
mRestyleManager = aRestyleManager;
}
uint32_t Count() const {
return mPendingRestyles.Count();
}
/**
@@ -198,17 +198,17 @@ private:
typedef nsClassHashtable<nsISupportsHashKey, RestyleData> PendingRestyleTable;
typedef AutoTArray< RefPtr<Element>, 32> RestyleRootArray;
// Our restyle bits. These will be a subset of ELEMENT_ALL_RESTYLE_FLAGS, and
// will include one flag from ELEMENT_PENDING_RESTYLE_FLAGS, one flag
// from ELEMENT_POTENTIAL_RESTYLE_ROOT_FLAGS, and might also include
// ELEMENT_IS_CONDITIONAL_RESTYLE_ANCESTOR.
Element::FlagsType mRestyleBits;
- RestyleManager* mRestyleManager; // Owns us
+ GeckoRestyleManager* mRestyleManager; // Owns us
// A hashtable that maps elements to pointers to RestyleData structs. The
// values only make sense if the element's current document is our
// document and it has our RestyleBit() flag set. In particular,
// said bit might not be set if the element had a restyle posted and
// then was moved around in the DOM.
PendingRestyleTable mPendingRestyles;
// An array that keeps track of our possible restyle roots. This
// maintains the invariant that if A and B are both restyle roots
--- a/layout/base/ServoRestyleManager.cpp
+++ b/layout/base/ServoRestyleManager.cpp
@@ -14,17 +14,17 @@
#include "nsPrintfCString.h"
#include "nsStyleChangeList.h"
using namespace mozilla::dom;
namespace mozilla {
ServoRestyleManager::ServoRestyleManager(nsPresContext* aPresContext)
- : RestyleManagerBase(aPresContext)
+ : RestyleManager(aPresContext)
, mReentrantChanges(nullptr)
{
}
void
ServoRestyleManager::PostRestyleEvent(Element* aElement,
nsRestyleHint aRestyleHint,
nsChangeHint aMinChangeHint)
--- a/layout/base/ServoRestyleManager.h
+++ b/layout/base/ServoRestyleManager.h
@@ -29,21 +29,21 @@ class nsIContent;
class nsIFrame;
class nsStyleChangeList;
namespace mozilla {
/**
* Restyle manager for a Servo-backed style system.
*/
-class ServoRestyleManager : public RestyleManagerBase
+class ServoRestyleManager : public RestyleManager
{
friend class ServoStyleSet;
public:
- typedef RestyleManagerBase base_type;
+ typedef RestyleManager base_type;
NS_INLINE_DECL_REFCOUNTING(ServoRestyleManager)
explicit ServoRestyleManager(nsPresContext* aPresContext);
void PostRestyleEvent(dom::Element* aElement,
nsRestyleHint aRestyleHint,
nsChangeHint aMinChangeHint);
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -1877,26 +1877,26 @@ nsCSSFrameConstructor::CreateGeneratedCo
if (NS_FAILED(rv)) {
container->UnbindFromTree();
return;
}
// stylo: ServoRestyleManager does not handle transitions yet, and when it
// does it probably won't need to track reframed style contexts to start
// transitions correctly.
- if (mozilla::RestyleManager* geckoRM = RestyleManager()->GetAsGecko()) {
- RestyleManager::ReframingStyleContexts* rsc =
+ if (mozilla::GeckoRestyleManager* geckoRM = RestyleManager()->GetAsGecko()) {
+ GeckoRestyleManager::ReframingStyleContexts* rsc =
geckoRM->GetReframingStyleContexts();
if (rsc) {
nsStyleContext* oldStyleContext = rsc->Get(container, aPseudoElement);
if (oldStyleContext) {
- RestyleManager::TryInitiatingTransition(aState.mPresContext,
- container,
- oldStyleContext,
- &pseudoStyleContext);
+ GeckoRestyleManager::TryInitiatingTransition(aState.mPresContext,
+ container,
+ oldStyleContext,
+ &pseudoStyleContext);
} else {
aState.mPresContext->TransitionManager()->
PruneCompletedTransitions(container, aPseudoElement,
pseudoStyleContext);
}
}
}
@@ -5048,26 +5048,26 @@ nsCSSFrameConstructor::ResolveStyleConte
"shouldn't waste time creating style contexts for "
"comments and processing instructions");
result = styleSet->ResolveStyleForText(aContent, aParentStyleContext);
}
// ServoRestyleManager does not handle transitions yet, and when it does
// it probably won't need to track reframed style contexts to start
// transitions correctly.
- if (mozilla::RestyleManager* geckoRM = RestyleManager()->GetAsGecko()) {
- RestyleManager::ReframingStyleContexts* rsc =
+ if (mozilla::GeckoRestyleManager* geckoRM = RestyleManager()->GetAsGecko()) {
+ GeckoRestyleManager::ReframingStyleContexts* rsc =
geckoRM->GetReframingStyleContexts();
if (rsc) {
nsStyleContext* oldStyleContext =
rsc->Get(aContent, CSSPseudoElementType::NotPseudo);
nsPresContext* presContext = mPresShell->GetPresContext();
if (oldStyleContext) {
- RestyleManager::TryInitiatingTransition(presContext, aContent,
- oldStyleContext, &result);
+ GeckoRestyleManager::TryInitiatingTransition(presContext, aContent,
+ oldStyleContext, &result);
} else if (aContent->IsElement()) {
presContext->TransitionManager()->
PruneCompletedTransitions(aContent->AsElement(),
CSSPseudoElementType::NotPseudo, result);
}
}
}
--- a/layout/base/nsCSSFrameConstructor.h
+++ b/layout/base/nsCSSFrameConstructor.h
@@ -50,17 +50,17 @@ class FlattenedChildIterator;
class nsCSSFrameConstructor : public nsFrameManager
{
public:
typedef mozilla::CSSPseudoElementType CSSPseudoElementType;
typedef mozilla::dom::Element Element;
friend class mozilla::RestyleManager;
- friend class mozilla::RestyleManagerBase;
+ friend class mozilla::GeckoRestyleManager;
friend class mozilla::ServoRestyleManager;
nsCSSFrameConstructor(nsIDocument* aDocument, nsIPresShell* aPresShell);
~nsCSSFrameConstructor(void) {
NS_ASSERTION(mUpdateCount == 0, "Dying in the middle of our own update?");
}
// get the alternate text for a content node
--- a/layout/base/nsPresContext.cpp
+++ b/layout/base/nsPresContext.cpp
@@ -918,17 +918,17 @@ nsPresContext::Init(nsDeviceContext* aDe
this);
nsresult rv = mEventManager->Init();
NS_ENSURE_SUCCESS(rv, rv);
mEventManager->SetPresContext(this);
#ifdef RESTYLE_LOGGING
- mRestyleLoggingEnabled = RestyleManager::RestyleLoggingInitiallyEnabled();
+ mRestyleLoggingEnabled = GeckoRestyleManager::RestyleLoggingInitiallyEnabled();
#endif
#ifdef DEBUG
mInitialized = true;
#endif
return NS_OK;
}
@@ -939,20 +939,17 @@ void
nsPresContext::AttachShell(nsIPresShell* aShell, StyleBackendType aBackendType)
{
MOZ_ASSERT(!mShell);
mShell = aShell;
if (aBackendType == StyleBackendType::Servo) {
mRestyleManager = new ServoRestyleManager(this);
} else {
- // Since RestyleManager is also the name of a method of nsPresContext,
- // it is necessary to prefix the class with the mozilla namespace
- // here.
- mRestyleManager = new mozilla::RestyleManager(this);
+ mRestyleManager = new GeckoRestyleManager(this);
}
// Since CounterStyleManager is also the name of a method of
// nsPresContext, it is necessary to prefix the class with the mozilla
// namespace here.
mCounterStyleManager = new mozilla::CounterStyleManager(this);
nsIDocument *doc = mShell->GetDocument();
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -682,29 +682,29 @@ nsFrame::DestroyFrom(nsIFrame* aDestruct
// Unfortunately, we need to do this for all frames being reframed
// and not only those whose current style involves CSS transitions,
// because what matters is whether the new style (not the old)
// specifies CSS transitions.
if (presContext->RestyleManager()->IsGecko()) {
// stylo: ServoRestyleManager does not handle transitions yet, and when
// it does it probably won't need to track reframed style contexts to
// initiate transitions correctly.
- RestyleManager::ReframingStyleContexts* rsc =
+ GeckoRestyleManager::ReframingStyleContexts* rsc =
presContext->RestyleManager()->AsGecko()->GetReframingStyleContexts();
if (rsc) {
rsc->Put(mContent, mStyleContext);
}
}
}
if (HasCSSAnimations() || HasCSSTransitions() ||
EffectSet::GetEffectSet(this)) {
// If no new frame for this element is created by the end of the
// restyling process, stop animations and transitions for this frame
- RestyleManagerBase::AnimationsWithDestroyedFrame* adf =
+ RestyleManager::AnimationsWithDestroyedFrame* adf =
presContext->RestyleManager()->AsBase()
->GetAnimationsWithDestroyedFrame();
// AnimationsWithDestroyedFrame only lives during the restyling process.
if (adf) {
adf->Put(mContent, mStyleContext);
}
}
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -759,17 +759,17 @@ nsDisplayListBuilder::AddAnimationsAndTr
}
// Update the animation generation on the layer. We need to do this before
// any early returns since even if we don't add any animations to the
// layer, we still need to mark it as up-to-date with regards to animations.
// Otherwise, in RestyleManager we'll notice the discrepancy between the
// animation generation numbers and update the layer indefinitely.
uint64_t animationGeneration =
- RestyleManager::GetAnimationGenerationForFrame(aFrame);
+ GeckoRestyleManager::GetAnimationGenerationForFrame(aFrame);
aLayer->SetAnimationGeneration(animationGeneration);
EffectCompositor::ClearIsRunningOnCompositor(aFrame, aProperty);
nsTArray<RefPtr<dom::Animation>> compositorAnimations =
EffectCompositor::GetAnimationsForCompositor(aFrame, aProperty);
if (compositorAnimations.IsEmpty()) {
return;
}
--- a/layout/style/nsComputedDOMStyle.cpp
+++ b/layout/style/nsComputedDOMStyle.cpp
@@ -561,17 +561,17 @@ public:
~StyleResolver()
{
if (mRestyleManager) {
mRestyleManager->SetSkipAnimationRules(mOldSkipAnimationRules);
}
}
private:
- RestyleManager* mRestyleManager = nullptr;
+ GeckoRestyleManager* mRestyleManager = nullptr;
bool mOldSkipAnimationRules = false;
nsComputedDOMStyle::AnimationFlag mAnimationFlag;
};
}
already_AddRefed<nsStyleContext>
nsComputedDOMStyle::DoGetStyleContextForElementNoFlush(
Element* aElement,
--- a/layout/style/nsHTMLCSSStyleSheet.cpp
+++ b/layout/style/nsHTMLCSSStyleSheet.cpp
@@ -72,17 +72,18 @@ nsHTMLCSSStyleSheet::ElementRulesMatchin
aRuleWalker->Forward(declaration->AsGecko());
}
declaration = aElement->GetSMILOverrideStyleDeclaration();
if (declaration) {
MOZ_ASSERT(aPresContext->RestyleManager()->IsGecko(),
"stylo: ElementRulesMatching must not be called when we have "
"a Servo-backed style system");
- RestyleManager* restyleManager = aPresContext->RestyleManager()->AsGecko();
+ GeckoRestyleManager* restyleManager =
+ aPresContext->RestyleManager()->AsGecko();
if (!restyleManager->SkipAnimationRules()) {
// Animation restyle (or non-restyle traversal of rules)
// Now we can walk SMIL overrride style, without triggering transitions.
declaration->SetImmutable();
aRuleWalker->Forward(declaration->AsGecko());
}
}
}
--- a/layout/style/nsStyleSet.cpp
+++ b/layout/style/nsStyleSet.cpp
@@ -1769,17 +1769,18 @@ nsStyleSet::ResolveStyleByRemovingAnimat
#endif
MOZ_ASSERT(pseudoType == CSSPseudoElementType::NotPseudo ||
pseudoType == CSSPseudoElementType::before ||
pseudoType == CSSPseudoElementType::after,
"unexpected type for animations");
MOZ_ASSERT(PresContext()->RestyleManager()->IsGecko(),
"stylo: the style set and restyle manager must have the same "
"StyleBackendType");
- RestyleManager* restyleManager = PresContext()->RestyleManager()->AsGecko();
+ GeckoRestyleManager* restyleManager =
+ PresContext()->RestyleManager()->AsGecko();
bool oldSkipAnimationRules = restyleManager->SkipAnimationRules();
restyleManager->SetSkipAnimationRules(true);
RefPtr<nsStyleContext> result =
ResolveStyleWithReplacement(aTarget, nullptr, aStyleContext->GetParent(),
aStyleContext, aWhichToRemove,
eSkipStartingAnimations);
@@ -1788,17 +1789,18 @@ nsStyleSet::ResolveStyleByRemovingAnimat
return result.forget();
}
already_AddRefed<nsStyleContext>
nsStyleSet::ResolveStyleWithoutAnimation(Element* aTarget,
nsStyleContext* aParentContext)
{
- RestyleManager* restyleManager = PresContext()->RestyleManager()->AsGecko();
+ GeckoRestyleManager* restyleManager =
+ PresContext()->RestyleManager()->AsGecko();
TreeMatchContext treeContext(true, nsRuleWalker::eRelevantLinkUnvisited,
aTarget->OwnerDoc());
InitStyleScopes(treeContext, aTarget);
bool oldSkipAnimationRules = restyleManager->SkipAnimationRules();
restyleManager->SetSkipAnimationRules(true);