Bug 1344966 - Post eRestyle_CSSAnimations instead of eRestyle_Self and eRestyle_Subtree. r?heycam
MozReview-Commit-ID: 7azwzIPc45X
--- a/dom/animation/EffectCompositor.cpp
+++ b/dom/animation/EffectCompositor.cpp
@@ -327,22 +327,18 @@ EffectCompositor::PostRestyleForAnimatio
// allow us mutate ElementData of the |aElement| in SequentialTask.
// Instead we call Servo_NoteExplicitHints for the element in PreTraverse() right
// which will be called right before the second traversal that we do for
// updating CSS animations.
// In that case PreTraverse() will return true so that we know to do the
// second traversal so we don't need to post any restyle requests to the
// PresShell.
return;
- } else if (!mPresContext->RestyleManager()->IsInStyleRefresh()) {
- // FIXME: stylo only supports Self and Subtree hints now, so we override
- // it for stylo if we are not in process of restyling.
- hint = eRestyle_Self | eRestyle_Subtree;
} else {
- MOZ_ASSERT_UNREACHABLE("Should not request restyle");
+ MOZ_ASSERT(!mPresContext->RestyleManager()->IsInStyleRefresh());
}
}
mPresContext->PresShell()->RestyleForAnimation(element, hint);
}
void
EffectCompositor::PostRestyleForThrottledAnimations()
{
@@ -978,18 +974,18 @@ EffectCompositor::PreTraverse()
NonOwningAnimationTarget target = iter.Key();
// We need to post restyle hints even if the target is not in EffectSet to
// ensure the final restyling for removed animations.
// We can't call PostRestyleEvent directly here since we are still in the
// middle of the servo traversal.
mPresContext->RestyleManager()->AsServo()->
- PostRestyleEventForAnimations(target.mElement,
- eRestyle_Self | eRestyle_Subtree);
+ PostRestyleEventForAnimations(target.mElement, eRestyle_CSSAnimations);
+
foundElementsNeedingRestyle = true;
EffectSet* effects =
EffectSet::GetEffectSet(target.mElement, target.mPseudoType);
if (!effects) {
// Drop EffectSets that have been destroyed.
iter.Remove();
continue;
@@ -1030,17 +1026,17 @@ EffectCompositor::PreTraverse(dom::Eleme
for (auto& elementsToRestyle : mElementsToRestyle) {
if (!elementsToRestyle.Get(key)) {
// Ignore throttled restyle and no restyle request.
continue;
}
mPresContext->RestyleManager()->AsServo()->
- PostRestyleEventForAnimations(aElement, eRestyle_Self);
+ PostRestyleEventForAnimations(aElement, eRestyle_CSSAnimations);
EffectSet* effects = EffectSet::GetEffectSet(aElement, pseudoType);
if (effects) {
MaybeUpdateCascadeResults(aElement, pseudoType);
for (KeyframeEffectReadOnly* effect : *effects) {
effect->GetAnimation()->WillComposeStyle();
}