From a76857bd471abd3a251326a397cd675106397c9c Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Sat, 22 Dec 2012 00:27:27 -0800 Subject: [PATCH] Bug 822766. Be a bit more careful with our level assert in ReplaceAnimationRule. r=dbaron --- layout/style/crashtests/822766-1.html | 31 +++++++++++++++++++++++++ layout/style/crashtests/crashtests.list | 1 + layout/style/nsStyleSet.cpp | 3 ++- 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 layout/style/crashtests/822766-1.html diff --git a/layout/style/crashtests/822766-1.html b/layout/style/crashtests/822766-1.html new file mode 100644 index 00000000000..77bb1e25a83 --- /dev/null +++ b/layout/style/crashtests/822766-1.html @@ -0,0 +1,31 @@ + + + + + + + + diff --git a/layout/style/crashtests/crashtests.list b/layout/style/crashtests/crashtests.list index 06284fee0b4..db6ba70f42a 100644 --- a/layout/style/crashtests/crashtests.list +++ b/layout/style/crashtests/crashtests.list @@ -83,3 +83,4 @@ load 788836.html load 806310-1.html load 812824.html load 822842.html +load 822766-1.html diff --git a/layout/style/nsStyleSet.cpp b/layout/style/nsStyleSet.cpp index 6ab33e4f355..020d8f4ba51 100644 --- a/layout/style/nsStyleSet.cpp +++ b/layout/style/nsStyleSet.cpp @@ -516,7 +516,8 @@ ReplaceAnimationRule(nsRuleNode *aOldRuleNode, } NS_ABORT_IF_FALSE(!IsMoreSpecificThanAnimation(n) && - n->GetLevel() != nsStyleSet::eAnimationSheet, + (n->IsRoot() || + n->GetLevel() != nsStyleSet::eAnimationSheet), "wrong level"); if (aNewAnimRule) {