From d6d86645b4f3498fb7e17a791ba80a10408bbd92 Mon Sep 17 00:00:00 2001 From: Daniel Holbert Date: Thu, 16 Oct 2014 22:14:02 -0700 Subject: [PATCH] Bug 1084039: Clean up AnimationPlayerCollection::PseudoElement(). r=birtles --- layout/style/AnimationCommon.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/layout/style/AnimationCommon.h b/layout/style/AnimationCommon.h index 9288246411b..3c483bb7eab 100644 --- a/layout/style/AnimationCommon.h +++ b/layout/style/AnimationCommon.h @@ -18,6 +18,7 @@ #include "mozilla/dom/Nullable.h" #include "nsStyleStruct.h" #include "mozilla/Attributes.h" +#include "mozilla/Assertions.h" #include "mozilla/FloatingPoint.h" #include "nsCSSPseudoElements.h" #include "nsCycleCollectionParticipant.h" @@ -251,15 +252,17 @@ struct AnimationPlayerCollection : public PRCList mElementProperty == nsGkAtoms::animationsOfAfterProperty; } - nsString PseudoElement() + nsString PseudoElement() const { if (IsForElement()) { return EmptyString(); - } else if (IsForBeforePseudo()) { - return NS_LITERAL_STRING("::before"); - } else { - return NS_LITERAL_STRING("::after"); } + if (IsForBeforePseudo()) { + return NS_LITERAL_STRING("::before"); + } + MOZ_ASSERT(IsForAfterPseudo(), + "::before & ::after should be the only pseudo-elements here"); + return NS_LITERAL_STRING("::after"); } mozilla::dom::Element* GetElementToRestyle() const;