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:
Hiroyuki Ikezoe 2017-06-08 10:22:25 +09:00
Родитель baffccc880
Коммит cdde6f6108
6 изменённых файлов: 28 добавлений и 8 удалений

Просмотреть файл

@ -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]