Bug 723446. Be a little more careful changing declarations on keyframe rules. r=dbaron

This commit is contained in:
Boris Zbarsky 2012-02-02 11:59:39 -05:00
parent af561ad0ae
commit ad5fde345e
2 changed files with 6 additions and 1 deletions

View File

@ -1964,7 +1964,11 @@ nsCSSKeyframeRule::GetStyle(nsIDOMCSSStyleDeclaration** aStyle)
void
nsCSSKeyframeRule::ChangeDeclaration(css::Declaration* aDeclaration)
{
// Be careful to not assign to an nsAutoPtr if we would be assigning
// the thing it already holds.
if (aDeclaration != mDeclaration) {
mDeclaration = aDeclaration;
}
if (mSheet) {
mSheet->SetModifiedByChildRule();

View File

@ -66,6 +66,7 @@ class nsAutoPtr
void
assign( T* newPtr )
{
NS_ABORT_IF_FALSE(mRawPtr != newPtr || !newPtr, "This makes no sense!");
T* oldPtr = mRawPtr;
mRawPtr = newPtr;
delete oldPtr;