Bug 1084039: Clean up AnimationPlayerCollection::PseudoElement(). r=birtles

This commit is contained in:
Daniel Holbert 2014-10-16 22:14:02 -07:00
parent 7ec4ce1032
commit d6d86645b4

View File

@ -18,6 +18,7 @@
#include "mozilla/dom/Nullable.h" #include "mozilla/dom/Nullable.h"
#include "nsStyleStruct.h" #include "nsStyleStruct.h"
#include "mozilla/Attributes.h" #include "mozilla/Attributes.h"
#include "mozilla/Assertions.h"
#include "mozilla/FloatingPoint.h" #include "mozilla/FloatingPoint.h"
#include "nsCSSPseudoElements.h" #include "nsCSSPseudoElements.h"
#include "nsCycleCollectionParticipant.h" #include "nsCycleCollectionParticipant.h"
@ -251,15 +252,17 @@ struct AnimationPlayerCollection : public PRCList
mElementProperty == nsGkAtoms::animationsOfAfterProperty; mElementProperty == nsGkAtoms::animationsOfAfterProperty;
} }
nsString PseudoElement() nsString PseudoElement() const
{ {
if (IsForElement()) { if (IsForElement()) {
return EmptyString(); 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; mozilla::dom::Element* GetElementToRestyle() const;