Bug 1125455 patch 4 - For main-thread application of transitions, don't apply transitions when animations are also running. r=birtles

I've verified locally that this patch (not others in this series) fixes
the test failures that match the test changes in this patch.
This commit is contained in:
L. David Baron 2015-03-18 07:35:30 -07:00
Родитель 9d97e616c7
Коммит 8f015c4370
4 изменённых файлов: 16 добавлений и 6 удалений

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

@ -297,6 +297,16 @@ Animation::ComposeStyle(nsRefPtr<css::AnimValuesStyleRule>& aStyleRule,
continue;
}
if (!prop.mWinsInCascade) {
// This isn't the winning declaration, so don't add it to style.
// For transitions, this is important, because it's how we
// implement the rule that CSS transitions don't run when a CSS
// animation is running on the same property and element. For
// animations, this is only skipping things that will otherwise be
// overridden.
continue;
}
aSetProperties.AddProperty(prop.mProperty);
MOZ_ASSERT(prop.mSegments.Length() > 0,

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

@ -672,6 +672,10 @@ nsTransitionManager::UpdateCascadeResults(
if (changed) {
aTransitions->UpdateAnimationGeneration(mPresContext);
// Invalidate our style rule.
aTransitions->mStyleRuleRefreshTime = TimeStamp();
aTransitions->mNeedsRefreshes = true;
}
}

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

@ -2027,9 +2027,9 @@ 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");
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");
is(cs.getPropertyValue("opacity"), "0.35", "opacity animation overriding transition at 0.5s");
done_div();
SpecialPowers.DOMWindowUtils.restoreNormalRefresh();

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

@ -2149,13 +2149,9 @@ addAsyncAnimTest(function *() {
"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();