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:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user