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