Bug 1300701 - Notify changedAnimations to mutation observer when priority of CSS animations on an element is changed. r=birtles

MozReview-Commit-ID: GXv4c2DiRij

--HG--
extra : rebase_source : 770933f3a0832dfb05417c39697716b30185adba
This commit is contained in:
Hiroyuki Ikezoe 2016-09-12 15:04:33 +09:00
parent 09fb09e249
commit af7c75acf9
2 changed files with 30 additions and 0 deletions

View File

@ -9,6 +9,9 @@
@keyframes anim {
to { transform: translate(100px); }
}
@keyframes anotherAnim {
to { transform: translate(0px); }
}
#target {
width: 100px;
height: 100px;
@ -1397,6 +1400,29 @@ function assert_records(expected, desc) {
e.style = "";
});
addAsyncAnimTest("animtion_order_change", aOptions, function*() {
e.style.animation = "anim 100s, anotherAnim 100s";
var animations = e.getAnimations();
yield await_frame();
assert_records([{ added: animations, changed: [], removed: []}],
"records after creation");
e.style.animation = "anotherAnim 100s, anim 100s";
animations = e.getAnimations();
yield await_frame();
assert_records([{ added: [], changed: animations, removed: []}],
"records after the order is changed");
e.style.animation = "anotherAnim 100s, anim 100s";
yield await_frame();
assert_records([],
"no records after applying the same order");
e.style.animation = "";
yield await_frame();
});
});
addAsyncAnimTest("tree_ordering", { observe: div, subtree: true }, function*() {

View File

@ -137,6 +137,10 @@ public:
void SetAnimationIndex(uint64_t aIndex)
{
MOZ_ASSERT(IsTiedToMarkup());
if (IsRelevant() &&
mAnimationIndex != aIndex) {
nsNodeUtils::AnimationChanged(this);
}
mAnimationIndex = aIndex;
}