Backed out changeset 587b33b52ee0 (bug 1180125)

This commit is contained in:
Carsten "Tomcat" Book 2015-07-29 17:32:15 +02:00
parent 8ccc9308d6
commit f32d1861be
5 changed files with 36 additions and 25 deletions

View File

@ -718,21 +718,6 @@ AnimationCollection::HasAnimationOfProperty(nsCSSProperty aProperty) const
return false;
}
/*static*/ nsString
AnimationCollection::PseudoTypeAsString(nsCSSPseudoElements::Type aPseudoType)
{
switch (aPseudoType) {
case nsCSSPseudoElements::ePseudo_before:
return NS_LITERAL_STRING("::before");
case nsCSSPseudoElements::ePseudo_after:
return NS_LITERAL_STRING("::after");
default:
MOZ_ASSERT(aPseudoType == nsCSSPseudoElements::ePseudo_NotPseudoElement,
"Unexpected pseudo type");
return EmptyString();
}
}
mozilla::dom::Element*
AnimationCollection::GetElementToRestyle() const
{

View File

@ -348,6 +348,19 @@ public:
mElementProperty == nsGkAtoms::animationsOfAfterProperty;
}
nsString PseudoElement() const
{
if (IsForElement()) {
return EmptyString();
}
if (IsForBeforePseudo()) {
return NS_LITERAL_STRING("::before");
}
MOZ_ASSERT(IsForAfterPseudo(),
"::before & ::after should be the only pseudo-elements here");
return NS_LITERAL_STRING("::after");
}
nsCSSPseudoElements::Type PseudoElementType() const
{
if (IsForElement()) {
@ -361,8 +374,6 @@ public:
return nsCSSPseudoElements::ePseudo_after;
}
static nsString PseudoTypeAsString(nsCSSPseudoElements::Type aPseudoType);
dom::Element* GetElementToRestyle() const;
void PostRestyleForAnimation(nsPresContext *aPresContext) {

View File

@ -252,7 +252,7 @@ CSSAnimation::QueueEvents()
computedTiming.mActiveDuration);
manager->QueueEvent(
AnimationEventInfo(owningElement, mAnimationName, NS_ANIMATION_START,
elapsedTime, owningPseudoType));
elapsedTime, PseudoTypeAsString(owningPseudoType)));
// Then have the shared code below append an 'animationend':
message = NS_ANIMATION_END;
} else {
@ -274,7 +274,7 @@ CSSAnimation::QueueEvents()
manager->QueueEvent(
AnimationEventInfo(owningElement, mAnimationName, message, elapsedTime,
owningPseudoType));
PseudoTypeAsString(owningPseudoType)));
}
CommonAnimationManager*
@ -288,6 +288,19 @@ CSSAnimation::GetAnimationManager() const
return context->AnimationManager();
}
/* static */ nsString
CSSAnimation::PseudoTypeAsString(nsCSSPseudoElements::Type aPseudoType)
{
switch (aPseudoType) {
case nsCSSPseudoElements::ePseudo_before:
return NS_LITERAL_STRING("::before");
case nsCSSPseudoElements::ePseudo_after:
return NS_LITERAL_STRING("::after");
default:
return EmptyString();
}
}
////////////////////////// nsAnimationManager ////////////////////////////
NS_IMPL_CYCLE_COLLECTION(nsAnimationManager, mEventDispatcher)

View File

@ -32,13 +32,13 @@ struct AnimationEventInfo {
const nsSubstring& aAnimationName,
uint32_t aMessage,
const mozilla::StickyTimeDuration& aElapsedTime,
nsCSSPseudoElements::Type aPseudoType)
const nsAString& aPseudoElement)
: mElement(aElement), mEvent(true, aMessage)
{
// XXX Looks like nobody initialize WidgetEvent::time
mEvent.animationName = aAnimationName;
mEvent.elapsedTime = aElapsedTime.ToSeconds();
mEvent.pseudoElement = AnimationCollection::PseudoTypeAsString(aPseudoType);
mEvent.pseudoElement = aPseudoElement;
}
// InternalAnimationEvent doesn't support copy-construction, so we need
@ -165,6 +165,8 @@ protected:
void QueueEvents();
static nsString PseudoTypeAsString(nsCSSPseudoElements::Type aPseudoType);
nsString mAnimationName;
// The (pseudo-)element whose computed animation-name refers to this

View File

@ -852,8 +852,7 @@ struct TransitionEventInfo {
InternalTransitionEvent mEvent;
TransitionEventInfo(nsIContent *aElement, nsCSSProperty aProperty,
TimeDuration aDuration,
nsCSSPseudoElements::Type aPseudoType)
TimeDuration aDuration, const nsAString& aPseudoElement)
: mElement(aElement)
, mEvent(true, NS_TRANSITION_END)
{
@ -861,7 +860,7 @@ struct TransitionEventInfo {
mEvent.propertyName =
NS_ConvertUTF8toUTF16(nsCSSProps::GetStringValue(aProperty));
mEvent.elapsedTime = aDuration.ToSeconds();
mEvent.pseudoElement = AnimationCollection::PseudoTypeAsString(aPseudoType);
mEvent.pseudoElement = aPseudoElement;
}
// InternalTransitionEvent doesn't support copy-construction, so we need
@ -941,7 +940,8 @@ nsTransitionManager::FlushTransitions(FlushFlags aFlags)
anim->GetEffect()->Timing().mIterationDuration;
events.AppendElement(
TransitionEventInfo(collection->mElement, prop,
duration, collection->PseudoElementType()));
duration,
collection->PseudoElement()));
// Leave this transition in the list for one more refresh
// cycle, since we haven't yet processed its style change, and