mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 03:45:46 +00:00
Bug 1368889 - Post animation restyle hint againt pseudo element instead of its parent. r=birtles
To traverse pseudo elements in animation-only restyle, the pseudo element itself needs the animation-only dirty bit. MozReview-Commit-ID: 11RfVqnPXfJ --HG-- extra : rebase_source : d048c9a053c03bf3fef46fcbfd9cbd5f60204e1d
This commit is contained in:
parent
baffccc880
commit
cdde6f6108
@ -1042,6 +1042,7 @@ EffectCompositor::PreTraverseInSubtree(Element* aRoot,
|
||||
// middle of the servo traversal.
|
||||
mPresContext->RestyleManager()->AsServo()->
|
||||
PostRestyleEventForAnimations(target.mElement,
|
||||
target.mPseudoType,
|
||||
cascadeLevel == CascadeLevel::Transitions
|
||||
? eRestyle_CSSTransitions
|
||||
: eRestyle_CSSAnimations);
|
||||
@ -1108,6 +1109,7 @@ EffectCompositor::PreTraverse(dom::Element* aElement,
|
||||
|
||||
mPresContext->RestyleManager()->AsServo()->
|
||||
PostRestyleEventForAnimations(aElement,
|
||||
aPseudoType,
|
||||
cascadeLevel == CascadeLevel::Transitions
|
||||
? eRestyle_CSSTransitions
|
||||
: eRestyle_CSSAnimations);
|
||||
|
@ -249,6 +249,15 @@ public:
|
||||
bool PreTraverseInSubtree(dom::Element* aElement,
|
||||
AnimationRestyleType aRestyleType);
|
||||
|
||||
// Returns the target element for restyling.
|
||||
//
|
||||
// If |aPseudoType| is ::after or ::before, returns the generated content
|
||||
// element of which |aElement| is the parent. If |aPseudoType| is any other
|
||||
// pseudo type (other thant CSSPseudoElementType::NotPseudo) returns nullptr.
|
||||
// Otherwise, returns |aElement|.
|
||||
static dom::Element* GetElementToRestyle(dom::Element* aElement,
|
||||
CSSPseudoElementType aPseudoType);
|
||||
|
||||
private:
|
||||
~EffectCompositor() = default;
|
||||
|
||||
@ -258,10 +267,6 @@ private:
|
||||
CSSPseudoElementType aPseudoType,
|
||||
CascadeLevel aCascadeLevel);
|
||||
|
||||
static dom::Element* GetElementToRestyle(dom::Element* aElement,
|
||||
CSSPseudoElementType
|
||||
aPseudoType);
|
||||
|
||||
// Get the properties in |aEffectSet| that we are able to animate on the
|
||||
// compositor but which are also specified at a higher level in the cascade
|
||||
// than the animations level.
|
||||
|
@ -767,6 +767,7 @@ nsSMILAnimationController::PreTraverseInSubtree(Element* aRoot)
|
||||
|
||||
context->RestyleManager()->AsServo()->
|
||||
PostRestyleEventForAnimations(key.mElement,
|
||||
CSSPseudoElementType::NotPseudo,
|
||||
eRestyle_StyleAttribute_Animations);
|
||||
|
||||
foundElementsNeedingRestyle = true;
|
||||
|
@ -74,10 +74,22 @@ ServoRestyleManager::PostRestyleEventForCSSRuleChanges()
|
||||
}
|
||||
|
||||
/* static */ void
|
||||
ServoRestyleManager::PostRestyleEventForAnimations(Element* aElement,
|
||||
nsRestyleHint aRestyleHint)
|
||||
ServoRestyleManager::PostRestyleEventForAnimations(
|
||||
Element* aElement,
|
||||
CSSPseudoElementType aPseudoType,
|
||||
nsRestyleHint aRestyleHint)
|
||||
{
|
||||
Servo_NoteExplicitHints(aElement, aRestyleHint, nsChangeHint(0));
|
||||
Element* elementToRestyle =
|
||||
EffectCompositor::GetElementToRestyle(aElement, aPseudoType);
|
||||
|
||||
if (!elementToRestyle) {
|
||||
// FIXME: Bug 1371107: When reframing happens,
|
||||
// EffectCompositor::mElementsToRestyle still has unbinded old pseudo
|
||||
// element. We should drop it.
|
||||
return;
|
||||
}
|
||||
|
||||
Servo_NoteExplicitHints(elementToRestyle, aRestyleHint, nsChangeHint(0));
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -107,6 +107,7 @@ public:
|
||||
* traversal of the same restyling process.
|
||||
*/
|
||||
static void PostRestyleEventForAnimations(dom::Element* aElement,
|
||||
CSSPseudoElementType aPseudoType,
|
||||
nsRestyleHint aRestyleHint);
|
||||
protected:
|
||||
~ServoRestyleManager() override
|
||||
|
@ -42,7 +42,6 @@ to mochitest command.
|
||||
* test_bug413958.html `monitorConsole` [3]
|
||||
* test_parser_diagnostics_unprintables.html [550]
|
||||
* Transition support:
|
||||
* test_transitions.html: pseudo elements [4]
|
||||
* test_transitions_and_reframes.html `pseudo-element`: bug 1366422 [4]
|
||||
* Events:
|
||||
* test_animations_event_order.html [2]
|
||||
|
Loading…
Reference in New Issue
Block a user