mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 21:35:39 +00:00
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:
parent
09fb09e249
commit
af7c75acf9
@ -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*() {
|
||||
|
@ -137,6 +137,10 @@ public:
|
||||
void SetAnimationIndex(uint64_t aIndex)
|
||||
{
|
||||
MOZ_ASSERT(IsTiedToMarkup());
|
||||
if (IsRelevant() &&
|
||||
mAnimationIndex != aIndex) {
|
||||
nsNodeUtils::AnimationChanged(this);
|
||||
}
|
||||
mAnimationIndex = aIndex;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user