Bug 1334036 - Part 6: Trigger restyle if important rules are changed. r=birtles,emilio

If we add/remove important rules, we should call MaybeUpdateCascadeResults()
to make sure EffectSet::mPropertiesWithImportantRules is correct, and so we can
avoid that these important rules are overridden by animations running on
compositor. Currently, we call MaybeUpdateCascadeResults only while iterating
elements which needs to be restyled, so we should request a restyle on this
element whose important rules are changed.

MozReview-Commit-ID: 87MBQrirVto

--HG--
extra : rebase_source : 8afa207f82ba4a803d41cad06cd7877207830d34
This commit is contained in:
Boris Chiou 2017-05-19 16:04:40 +08:00
Родитель 1e2c865691
Коммит 256a5c133a
1 изменённых файлов: 12 добавлений и 0 удалений

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

@ -541,10 +541,22 @@ Gecko_UpdateAnimations(RawGeckoElementBorrowed aElement,
UpdateTransitions(const_cast<dom::Element*>(aElement), pseudoType,
oldServoValues, servoValues);
}
if (aTasks & UpdateAnimationsTasks::EffectProperties) {
presContext->EffectCompositor()->UpdateEffectProperties(
servoValues, const_cast<dom::Element*>(aElement), pseudoType);
}
if (aTasks & UpdateAnimationsTasks::CascadeResults) {
// This task will be scheduled if we detected any changes to !important
// rules. We post a restyle here so that we can update the cascade
// results in the pre-traversal of the next restyle.
presContext->EffectCompositor()
->RequestRestyle(const_cast<Element*>(aElement),
pseudoType,
EffectCompositor::RestyleType::Standard,
EffectCompositor::CascadeLevel::Animations);
}
}
}