Bug 523188: Allow for ClearAnimValue() (and SetSMILOverrideStyleRule()) to be called for animation targets that aren't in a document. r=birtles r=roc

This commit is contained in:
Daniel Holbert
2009-10-20 09:54:47 -07:00
parent 7de428843c
commit c9ff162901
8 changed files with 101 additions and 7 deletions

View File

@@ -2974,13 +2974,16 @@ nsGenericElement::SetSMILOverrideStyleRule(nsICSSStyleRule* aStyleRule,
if (aNotify) {
nsIDocument* doc = GetCurrentDoc();
NS_ABORT_IF_FALSE(doc, "Shouldn't be able to animate style on a node "
"unless it's in a document...");
nsPresShellIterator iter(doc);
nsCOMPtr<nsIPresShell> shell;
while (shell = iter.GetNextShell()) {
nsPresContext* presContext = shell->GetPresContext();
presContext->SMILOverrideStyleChanged(this);
// Only need to notify PresContexts if we're in a document. (We might not
// be in a document, if we're clearing animation effects on a target node
// that's been detached since the previous animation sample.)
if (doc) {
nsPresShellIterator iter(doc);
nsCOMPtr<nsIPresShell> shell;
while (shell = iter.GetNextShell()) {
nsPresContext* presContext = shell->GetPresContext();
presContext->SMILOverrideStyleChanged(this);
}
}
}