Bug 977991 patch 6 - Use the faster eRestyle_StyleAttribute path for style attribute changes. r=birtles

This commit is contained in:
L. David Baron 2014-09-13 06:17:37 -07:00
parent c35ea83a99
commit 7fc557d455
2 changed files with 4 additions and 3 deletions

View File

@ -1576,7 +1576,8 @@ Element::SetSMILOverrideStyleRule(css::StyleRule* aStyleRule,
if (doc) {
nsCOMPtr<nsIPresShell> shell = doc->GetShell();
if (shell) {
shell->RestyleForAnimation(this, eRestyle_Self);
shell->RestyleForAnimation(this,
eRestyle_StyleAttribute | eRestyle_ChangeAnimationPhase);
}
}
}

View File

@ -78,7 +78,7 @@ nsHTMLCSSStyleSheet::ElementRulesMatching(nsPresContext* aPresContext,
// don't want SMIL animation to trigger new CSS transitions. Instead,
// request an Animation restyle, so we still get noticed.
aPresContext->PresShell()->RestyleForAnimation(aElement,
eRestyle_Self);
eRestyle_StyleAttribute | eRestyle_ChangeAnimationPhase);
} else {
// Animation restyle (or non-restyle traversal of rules)
// Now we can walk SMIL overrride style, without triggering transitions.
@ -143,7 +143,7 @@ nsHTMLCSSStyleSheet::HasAttributeDependentStyle(AttributeRuleProcessorData* aDat
// Perhaps should check that it's XUL, SVG, (or HTML) namespace, but
// it doesn't really matter.
if (aData->mAttrHasChanged && aData->mAttribute == nsGkAtoms::style) {
return eRestyle_Self;
return eRestyle_StyleAttribute | eRestyle_ChangeAnimationPhase;
}
return nsRestyleHint(0);