Bug 1125455 patch 1 - Add boolean for whether an animation of a property wins in the CSS cascade. r=birtles

This commit is contained in:
L. David Baron 2015-03-18 07:35:29 -07:00
Родитель 979db7f522
Коммит 065aeaa603
3 изменённых файлов: 17 добавлений и 0 удалений

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

@ -150,10 +150,25 @@ struct AnimationPropertySegment
struct AnimationProperty
{
nsCSSProperty mProperty;
// Does this property win in the CSS Cascade?
//
// For CSS transitions, this is true as long as a CSS animation on the
// same property and element is not running, in which case we set this
// to false so that the animation (lower in the cascade) can win. We
// then use this to decide whether to apply the style both in the CSS
// cascade and for OMTA.
//
// FIXME (bug 847287): For CSS Animations, which are overridden by
// !important rules in the cascade, we actually determine this from
// the CSS cascade computations, and then use it for OMTA.
bool mWinsInCascade;
InfallibleTArray<AnimationPropertySegment> mSegments;
bool operator==(const AnimationProperty& aOther) const {
return mProperty == aOther.mProperty &&
mWinsInCascade == aOther.mWinsInCascade &&
mSegments == aOther.mSegments;
}
bool operator!=(const AnimationProperty& aOther) const {

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

@ -594,6 +594,7 @@ nsAnimationManager::BuildAnimations(nsStyleContext* aStyleContext,
AnimationProperty &propData = *destAnim->Properties().AppendElement();
propData.mProperty = prop;
propData.mWinsInCascade = true;
KeyframeData *fromKeyframe = nullptr;
nsRefPtr<nsStyleContext> fromContext;

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

@ -545,6 +545,7 @@ nsTransitionManager::ConsiderStartingTransition(
AnimationProperty& prop = *pt->Properties().AppendElement();
prop.mProperty = aProperty;
prop.mWinsInCascade = true;
AnimationPropertySegment& segment = *prop.mSegments.AppendElement();
segment.mFromValue = startValue;