Bug 1125455 patch 3 - Add mochitests for animations overriding transitions. r=birtles

Note that (at this stage) some of the tests in both files fail (which I
have verified locally), as noted by the todos and FIXMEs in the test,
which will be removed in later patches in this bug, as the failures are
fixed.
This commit is contained in:
L. David Baron 2015-03-18 07:35:30 -07:00
Родитель 3be5178484
Коммит 9d97e616c7
2 изменённых файлов: 53 добавлений и 0 удалений

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

@ -158,6 +158,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=435442
@keyframes overridetop {
0%, 100% { top: 0px }
}
@keyframes opacitymid {
0% { opacity: 0.2 }
100% { opacity: 0.8 }
}
</style>
</head>
<body>
@ -2011,6 +2016,22 @@ ancestor.parentNode.removeChild(ancestor);
done_div();
/*
* Bug 1125455 - Transitions should not run when animations are running.
*/
new_div("transition: opacity 2s linear; opacity: 0.8");
advance_clock(0);
is(cs.getPropertyValue("opacity"), "0.8", "initial opacity");
div.style.opacity = "0.2";
is(cs.getPropertyValue("opacity"), "0.8", "opacity transition at 0s");
advance_clock(500);
is(cs.getPropertyValue("opacity"), "0.65", "opacity transition at 0.5s");
div.style.animation = "opacitymid 2s linear";
todo_is(cs.getPropertyValue("opacity"), "0.2", "opacity animation overriding transition at 0s");
advance_clock(500);
todo_is(cs.getPropertyValue("opacity"), "0.35", "opacity animation overriding transition at 0.5s");
done_div();
SpecialPowers.DOMWindowUtils.restoreNormalRefresh();
</script>

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

@ -154,6 +154,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=964646
#visitedLink:link { background-color: yellow }
#visitedLink:visited { background-color: blue }
@keyframes opacitymid {
0% { opacity: 0.2 }
100% { opacity: 0.8 }
}
</style>
</head>
<body>
@ -2129,5 +2134,32 @@ addAsyncAnimTest(function *() {
done_div();
});
// Bug 1125455 - Transitions should not run when animations are running.
addAsyncAnimTest(function *() {
new_div("transition: opacity 2s linear; opacity: 0.8");
yield waitForPaintsFlushed();
omta_is("opacity", 0.8, RunningOn.MainThread,
"initial opacity");
gDiv.style.opacity = "0.2";
yield waitForPaintsFlushed();
omta_is("opacity", 0.8, RunningOn.Compositor,
"opacity transition at 0s");
advance_clock(500);
omta_is("opacity", 0.65, RunningOn.Compositor,
"opacity transition at 0.5s");
gDiv.style.animation = "opacitymid 2s linear";
yield waitForPaintsFlushed();
// FIXME: This omta_todo_is leads to a failure, since the compositor
// vs. main-thread check actually passes.
omta_todo_is("opacity", 0.2, RunningOn.Compositor,
"opacity animation overriding transition at 0s");
advance_clock(500);
// FIXME: This omta_todo_is leads to a failure, since the compositor
// vs. main-thread check actually passes.
omta_todo_is("opacity", 0.35, RunningOn.Compositor,
"opacity animation overriding transition at 0.5s");
done_div();
});
</script>
</html>