Bug 1340958 - Do not call EffectCompositor::GetServoAnimationRule for print preview. r=heycam

The only one caller of GetServoAnimationRule is Gecko_GetAnimationRule.
There is no risk that pres context is destroyed in Gecko_GetAnimationRule.

MozReview-Commit-ID: 52pxbCiCNoJ

--HG--
extra : rebase_source : 8000e267d1d5706c709f807e11396dda3579c4dc
This commit is contained in:
Hiroyuki Ikezoe 2017-03-17 12:48:34 +09:00
parent 00ae32a7b2
commit a3c9c5051e
2 changed files with 4 additions and 5 deletions

View File

@ -482,10 +482,8 @@ EffectCompositor::GetServoAnimationRule(const dom::Element* aElement,
CSSPseudoElementType aPseudoType,
CascadeLevel aCascadeLevel)
{
if (!mPresContext || !mPresContext->IsDynamic()) {
// For print or print preview, ignore animations.
return nullptr;
}
MOZ_ASSERT(mPresContext && mPresContext->IsDynamic(),
"Should not be in print preview");
EffectSet* effectSet = EffectSet::GetEffectSet(aElement, aPseudoType);
if (!effectSet) {

View File

@ -404,7 +404,8 @@ Gecko_GetAnimationRule(RawGeckoElementBorrowed aElement,
return emptyDeclarationBlock;
}
nsPresContext* presContext = doc->GetShell()->GetPresContext();
if (!presContext) {
if (!presContext || !presContext->IsDynamic()) {
// For print or print preview, ignore animations.
return emptyDeclarationBlock;
}