Bug 1504929 - Factor out IsEffectiveProperty(). r=birtles

Depends on D11598

Differential Revision: https://phabricator.services.mozilla.com/D11599

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Hiroyuki Ikezoe 2018-11-13 10:18:09 +00:00
Родитель e8d577185d
Коммит e74997c54d
1 изменённых файлов: 11 добавлений и 8 удалений

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

@ -262,6 +262,15 @@ KeyframeEffect::SetKeyframes(
}
}
static bool
IsEffectiveProperty(const EffectSet& aEffects, nsCSSPropertyID aProperty)
{
return !aEffects.PropertiesWithImportantRules()
.HasProperty(aProperty) ||
!aEffects.PropertiesForAnimationsLevel()
.HasProperty(aProperty);
}
const AnimationProperty*
KeyframeEffect::GetEffectiveAnimationOfProperty(nsCSSPropertyID aProperty,
const EffectSet& aEffects) const
@ -278,10 +287,7 @@ KeyframeEffect::GetEffectiveAnimationOfProperty(nsCSSPropertyID aProperty,
const AnimationProperty* result = nullptr;
// Only include the property if it is not overridden by !important rules in
// the transitions level.
if (!aEffects.PropertiesWithImportantRules()
.HasProperty(property.mProperty) ||
!aEffects.PropertiesForAnimationsLevel()
.HasProperty(property.mProperty)) {
if (IsEffectiveProperty(aEffects, property.mProperty)) {
result = &property;
}
return result;
@ -308,10 +314,7 @@ KeyframeEffect::GetPropertiesForCompositor(const EffectSet& aEffects) const
if (!compositorAnimatables.HasProperty(property.mProperty)) {
continue;
}
if (!aEffects.PropertiesWithImportantRules()
.HasProperty(property.mProperty) ||
!aEffects.PropertiesForAnimationsLevel()
.HasProperty(property.mProperty)) {
if (IsEffectiveProperty(aEffects, property.mProperty)) {
properties.AddProperty(property.mProperty);
}
}