зеркало из https://github.com/mozilla/pjs.git
ifdef CSS animations so that the feature can be backed out by flipping the switches in configure.in and then reverting the changes to the following four files appropriately: nsIDOMCSS2Properties.idl, nsIDOMCSSRule.idl, property_database.js, test_transitions_computed_values.html. (Bug 435442, patch 15) r=bzbarsky
This commit is contained in:
Родитель
6bbc3c7002
Коммит
058a80b273
|
@ -254,6 +254,7 @@ MOZ_TREE_PIXMAN = @MOZ_TREE_PIXMAN@
|
|||
|
||||
MOZ_UPDATE_XTERM = @MOZ_UPDATE_XTERM@
|
||||
MOZ_MATHML = @MOZ_MATHML@
|
||||
MOZ_CSS_ANIMATIONS = @MOZ_CSS_ANIMATIONS@
|
||||
MOZ_PERMISSIONS = @MOZ_PERMISSIONS@
|
||||
MOZ_XTF = @MOZ_XTF@
|
||||
MOZ_SVG = @MOZ_SVG@
|
||||
|
|
|
@ -4952,6 +4952,7 @@ MOZ_FEEDS=1
|
|||
MOZ_INSTALLER=1
|
||||
MOZ_JSDEBUGGER=1
|
||||
MOZ_MATHML=1
|
||||
MOZ_CSS_ANIMATIONS=1
|
||||
MOZ_MORK=
|
||||
MOZ_MORKREADER=1
|
||||
MOZ_AUTH_EXTENSION=1
|
||||
|
@ -6534,6 +6535,8 @@ if test "$MOZ_MATHML"; then
|
|||
AC_DEFINE(MOZ_MATHML)
|
||||
fi
|
||||
|
||||
AC_DEFINE(MOZ_CSS_ANIMATIONS)
|
||||
|
||||
dnl ========================================================
|
||||
dnl Keeping AC_DEFINE(MOZ_SVG) for the moment in case of something needs it.
|
||||
dnl ========================================================
|
||||
|
@ -8924,6 +8927,7 @@ AC_SUBST(MINIMO)
|
|||
AC_SUBST(MOZ_PLATFORM_MAEMO)
|
||||
AC_SUBST(MOZ_AUTH_EXTENSION)
|
||||
AC_SUBST(MOZ_MATHML)
|
||||
AC_SUBST(MOZ_CSS_ANIMATIONS)
|
||||
AC_SUBST(MOZ_PERMISSIONS)
|
||||
AC_SUBST(MOZ_XTF)
|
||||
AC_SUBST(MOZ_PREF_EXTENSIONS)
|
||||
|
|
|
@ -687,10 +687,13 @@ nsContentUtils::InitializeEventTable() {
|
|||
{ nsGkAtoms::onMozTouchMove, NS_MOZTOUCH_MOVE, EventNameType_None, NS_MOZTOUCH_EVENT },
|
||||
{ nsGkAtoms::onMozTouchUp, NS_MOZTOUCH_UP, EventNameType_None, NS_MOZTOUCH_EVENT },
|
||||
|
||||
{ nsGkAtoms::ontransitionend, NS_TRANSITION_END, EventNameType_None, NS_TRANSITION_EVENT },
|
||||
{ nsGkAtoms::ontransitionend, NS_TRANSITION_END, EventNameType_None, NS_TRANSITION_EVENT }
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
,
|
||||
{ nsGkAtoms::onanimationstart, NS_ANIMATION_START, EventNameType_None, NS_ANIMATION_EVENT },
|
||||
{ nsGkAtoms::onanimationend, NS_ANIMATION_END, EventNameType_None, NS_ANIMATION_EVENT },
|
||||
{ nsGkAtoms::onanimationiteration, NS_ANIMATION_ITERATION, EventNameType_None, NS_ANIMATION_EVENT }
|
||||
#endif
|
||||
};
|
||||
|
||||
sAtomEventTable = new nsDataHashtable<nsISupportsHashKey, EventNameMapping>;
|
||||
|
|
|
@ -3036,9 +3036,11 @@ nsGenericElement::UnbindFromTree(PRBool aDeep, PRBool aNullParent)
|
|||
DeleteProperty(nsGkAtoms::transitionsOfBeforeProperty);
|
||||
DeleteProperty(nsGkAtoms::transitionsOfAfterProperty);
|
||||
DeleteProperty(nsGkAtoms::transitionsProperty);
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
DeleteProperty(nsGkAtoms::animationsOfBeforeProperty);
|
||||
DeleteProperty(nsGkAtoms::animationsOfAfterProperty);
|
||||
DeleteProperty(nsGkAtoms::animationsProperty);
|
||||
#endif
|
||||
}
|
||||
|
||||
// Unset this since that's what the old code effectively did.
|
||||
|
|
|
@ -632,9 +632,11 @@ GK_ATOM(ol, "ol")
|
|||
GK_ATOM(omitXmlDeclaration, "omit-xml-declaration")
|
||||
GK_ATOM(onabort, "onabort")
|
||||
GK_ATOM(onafterscriptexecute, "onafterscriptexecute")
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
GK_ATOM(onanimationend, "onanimationend")
|
||||
GK_ATOM(onanimationiteration, "onanimationiteration")
|
||||
GK_ATOM(onanimationstart, "onanimationstart")
|
||||
#endif
|
||||
GK_ATOM(onbeforecopy, "onbeforecopy")
|
||||
GK_ATOM(onbeforecut, "onbeforecut")
|
||||
GK_ATOM(onbeforepaste, "onbeforepaste")
|
||||
|
@ -1832,9 +1834,11 @@ GK_ATOM(volumechange, "volumechange")
|
|||
#endif
|
||||
|
||||
// Content property names
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
GK_ATOM(animationsProperty, "AnimationsProperty") // FrameAnimations*
|
||||
GK_ATOM(animationsOfBeforeProperty, "AnimationsOfBeforeProperty") // FrameAnimations*
|
||||
GK_ATOM(animationsOfAfterProperty, "AnimationsOfAfterProperty") // FrameAnimations*
|
||||
#endif
|
||||
GK_ATOM(transitionsProperty, "TransitionsProperty") // FrameTransitions*
|
||||
GK_ATOM(transitionsOfBeforeProperty, "TransitionsOfBeforeProperty") // FrameTransitions*
|
||||
GK_ATOM(transitionsOfAfterProperty, "TransitionsOfAfterProperty") // FrameTransitions*
|
||||
|
|
|
@ -134,8 +134,10 @@ nsresult
|
|||
NS_NewDOMScrollAreaEvent(nsIDOMEvent** aInstancePtrResult, nsPresContext* aPresContext, class nsScrollAreaEvent* aEvent);
|
||||
nsresult
|
||||
NS_NewDOMTransitionEvent(nsIDOMEvent** aInstancePtrResult, nsPresContext* aPresContext, class nsTransitionEvent* aEvent);
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
nsresult
|
||||
NS_NewDOMAnimationEvent(nsIDOMEvent** aInstancePtrResult, nsPresContext* aPresContext, class nsAnimationEvent* aEvent);
|
||||
#endif
|
||||
nsresult
|
||||
NS_NewDOMCloseEvent(nsIDOMEvent** aInstancePtrResult, nsPresContext* aPresContext, class nsEvent* aEvent);
|
||||
nsresult
|
||||
|
|
|
@ -84,11 +84,14 @@ CPPSRCS = \
|
|||
nsDOMEventTargetHelper.cpp \
|
||||
nsDOMScrollAreaEvent.cpp \
|
||||
nsDOMTransitionEvent.cpp \
|
||||
nsDOMAnimationEvent.cpp \
|
||||
nsDOMPopStateEvent.cpp \
|
||||
nsDOMCloseEvent.cpp \
|
||||
$(NULL)
|
||||
|
||||
ifdef MOZ_CSS_ANIMATIONS
|
||||
CPPSRCS += nsDOMAnimationEvent.cpp
|
||||
endif
|
||||
|
||||
# we don't want the shared lib, but we want to force the creation of a static lib.
|
||||
FORCE_STATIC_LIB = 1
|
||||
|
||||
|
|
|
@ -105,10 +105,13 @@ static const char* const sEventNames[] = {
|
|||
"MozTouchMove",
|
||||
"MozTouchUp",
|
||||
"MozScrolledAreaChanged",
|
||||
"transitionend",
|
||||
"transitionend"
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
,
|
||||
"animationstart",
|
||||
"animationend",
|
||||
"animationiteration"
|
||||
#endif
|
||||
};
|
||||
|
||||
static char *sPopupAllowedEvents;
|
||||
|
@ -819,6 +822,7 @@ NS_METHOD nsDOMEvent::DuplicatePrivateData()
|
|||
NS_ENSURE_TRUE(newEvent, NS_ERROR_OUT_OF_MEMORY);
|
||||
break;
|
||||
}
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
case NS_ANIMATION_EVENT:
|
||||
{
|
||||
nsAnimationEvent* oldAnimationEvent =
|
||||
|
@ -829,6 +833,7 @@ NS_METHOD nsDOMEvent::DuplicatePrivateData()
|
|||
NS_ENSURE_TRUE(newEvent, NS_ERROR_OUT_OF_MEMORY);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
case NS_MOZTOUCH_EVENT:
|
||||
{
|
||||
newEvent = new nsMozTouchEvent(PR_FALSE, msg, nsnull,
|
||||
|
@ -1359,12 +1364,14 @@ const char* nsDOMEvent::GetEventName(PRUint32 aEventType)
|
|||
return sEventNames[eDOMEvents_MozScrolledAreaChanged];
|
||||
case NS_TRANSITION_END:
|
||||
return sEventNames[eDOMEvents_transitionend];
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
case NS_ANIMATION_START:
|
||||
return sEventNames[eDOMEvents_animationstart];
|
||||
case NS_ANIMATION_END:
|
||||
return sEventNames[eDOMEvents_animationend];
|
||||
case NS_ANIMATION_ITERATION:
|
||||
return sEventNames[eDOMEvents_animationiteration];
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -189,10 +189,13 @@ public:
|
|||
eDOMEvents_MozTouchMove,
|
||||
eDOMEvents_MozTouchUp,
|
||||
eDOMEvents_MozScrolledAreaChanged,
|
||||
eDOMEvents_transitionend,
|
||||
eDOMEvents_transitionend
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
,
|
||||
eDOMEvents_animationstart,
|
||||
eDOMEvents_animationend,
|
||||
eDOMEvents_animationiteration
|
||||
#endif
|
||||
};
|
||||
|
||||
nsDOMEvent(nsPresContext* aPresContext, nsEvent* aEvent);
|
||||
|
|
|
@ -777,9 +777,11 @@ nsEventDispatcher::CreateEvent(nsPresContext* aPresContext,
|
|||
case NS_TRANSITION_EVENT:
|
||||
return NS_NewDOMTransitionEvent(aDOMEvent, aPresContext,
|
||||
static_cast<nsTransitionEvent*>(aEvent));
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
case NS_ANIMATION_EVENT:
|
||||
return NS_NewDOMAnimationEvent(aDOMEvent, aPresContext,
|
||||
static_cast<nsAnimationEvent*>(aEvent));
|
||||
#endif
|
||||
}
|
||||
|
||||
// For all other types of events, create a vanilla event object.
|
||||
|
@ -859,8 +861,10 @@ nsEventDispatcher::CreateEvent(nsPresContext* aPresContext,
|
|||
// is probably wrong!
|
||||
if (aEventType.LowerCaseEqualsLiteral("transitionevent"))
|
||||
return NS_NewDOMTransitionEvent(aDOMEvent, aPresContext, nsnull);
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
if (aEventType.LowerCaseEqualsLiteral("animationevent"))
|
||||
return NS_NewDOMAnimationEvent(aDOMEvent, aPresContext, nsnull);
|
||||
#endif
|
||||
if (aEventType.LowerCaseEqualsLiteral("popstateevent"))
|
||||
return NS_NewDOMPopStateEvent(aDOMEvent, aPresContext, nsnull);
|
||||
if (aEventType.LowerCaseEqualsLiteral("mozaudioavailableevent"))
|
||||
|
|
|
@ -246,7 +246,9 @@
|
|||
#include "nsIDOMNotifyAudioAvailableEvent.h"
|
||||
#include "nsIDOMScrollAreaEvent.h"
|
||||
#include "nsIDOMTransitionEvent.h"
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
#include "nsIDOMAnimationEvent.h"
|
||||
#endif
|
||||
#include "nsIDOMNSDocumentStyle.h"
|
||||
#include "nsIDOMDocumentRange.h"
|
||||
#include "nsIDOMDocumentTraversal.h"
|
||||
|
@ -328,8 +330,10 @@
|
|||
#include "nsIDOMCSSMediaRule.h"
|
||||
#include "nsIDOMCSSFontFaceRule.h"
|
||||
#include "nsIDOMCSSMozDocumentRule.h"
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
#include "nsIDOMMozCSSKeyframeRule.h"
|
||||
#include "nsIDOMMozCSSKeyframesRule.h"
|
||||
#endif
|
||||
#include "nsIDOMCSSPrimitiveValue.h"
|
||||
#include "nsIDOMCSSStyleRule.h"
|
||||
#include "nsIDOMCSSStyleSheet.h"
|
||||
|
@ -1441,8 +1445,10 @@ static nsDOMClassInfoData sClassInfoData[] = {
|
|||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
NS_DEFINE_CLASSINFO_DATA(TransitionEvent, nsDOMGenericSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
NS_DEFINE_CLASSINFO_DATA(AnimationEvent, nsDOMGenericSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
#endif
|
||||
NS_DEFINE_CLASSINFO_DATA(ContentFrameMessageManager, nsDOMGenericSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
|
||||
|
@ -1488,10 +1494,12 @@ static nsDOMClassInfoData sClassInfoData[] = {
|
|||
NS_DEFINE_CLASSINFO_DATA(EventException, nsDOMGenericSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
NS_DEFINE_CLASSINFO_DATA(MozCSSKeyframeRule, nsDOMGenericSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
NS_DEFINE_CLASSINFO_DATA(MozCSSKeyframesRule, nsDOMGenericSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
#endif
|
||||
};
|
||||
|
||||
// Objects that should be constructable through |new Name();|
|
||||
|
@ -4128,10 +4136,12 @@ nsDOMClassInfo::Init()
|
|||
DOM_CLASSINFO_EVENT_MAP_ENTRIES
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
DOM_CLASSINFO_MAP_BEGIN(AnimationEvent, nsIDOMAnimationEvent)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMAnimationEvent)
|
||||
DOM_CLASSINFO_EVENT_MAP_ENTRIES
|
||||
DOM_CLASSINFO_MAP_END
|
||||
#endif
|
||||
|
||||
DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(ContentFrameMessageManager, nsIContentFrameMessageManager)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
|
||||
|
@ -4229,6 +4239,7 @@ nsDOMClassInfo::Init()
|
|||
DOM_CLASSINFO_MAP_ENTRY(nsIException)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
DOM_CLASSINFO_MAP_BEGIN(MozCSSKeyframeRule, nsIDOMMozCSSKeyframeRule)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozCSSKeyframeRule)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
@ -4236,6 +4247,7 @@ nsDOMClassInfo::Init()
|
|||
DOM_CLASSINFO_MAP_BEGIN(MozCSSKeyframesRule, nsIDOMMozCSSKeyframesRule)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozCSSKeyframesRule)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
#endif
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
{
|
||||
|
|
|
@ -482,7 +482,9 @@ DOMCI_CLASS(PopStateEvent)
|
|||
DOMCI_CLASS(EventListenerInfo)
|
||||
|
||||
DOMCI_CLASS(TransitionEvent)
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
DOMCI_CLASS(AnimationEvent)
|
||||
#endif
|
||||
|
||||
DOMCI_CLASS(ContentFrameMessageManager)
|
||||
|
||||
|
@ -510,5 +512,7 @@ DOMCI_CLASS(IDBDatabaseException)
|
|||
|
||||
DOMCI_CLASS(EventException)
|
||||
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
DOMCI_CLASS(MozCSSKeyframeRule)
|
||||
DOMCI_CLASS(MozCSSKeyframesRule)
|
||||
#endif
|
||||
|
|
|
@ -64,8 +64,6 @@ XPIDLSRCS = \
|
|||
nsIDOMCSSImportRule.idl \
|
||||
nsIDOMCSSMediaRule.idl \
|
||||
nsIDOMCSSMozDocumentRule.idl \
|
||||
nsIDOMMozCSSKeyframeRule.idl \
|
||||
nsIDOMMozCSSKeyframesRule.idl \
|
||||
nsIDOMCSSPageRule.idl \
|
||||
nsIDOMCSSStyleRule.idl \
|
||||
nsIDOMCSSUnknownRule.idl \
|
||||
|
@ -77,4 +75,11 @@ XPIDLSRCS = \
|
|||
nsIDOMNSRGBAColor.idl \
|
||||
$(NULL)
|
||||
|
||||
ifdef MOZ_CSS_ANIMATIONS
|
||||
XPIDLSRCS += \
|
||||
nsIDOMMozCSSKeyframeRule.idl \
|
||||
nsIDOMMozCSSKeyframesRule.idl \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
|
|
@ -85,10 +85,15 @@ XPIDLSRCS = \
|
|||
nsIDOMOrientationEvent.idl \
|
||||
nsIDOMScrollAreaEvent.idl \
|
||||
nsIDOMTransitionEvent.idl \
|
||||
nsIDOMAnimationEvent.idl \
|
||||
nsIDOMPopStateEvent.idl \
|
||||
nsIDOMCloseEvent.idl \
|
||||
nsIDOMEventException.idl \
|
||||
$(NULL)
|
||||
|
||||
ifdef MOZ_CSS_ANIMATIONS
|
||||
XPIDLSRCS += \
|
||||
nsIDOMAnimationEvent.idl \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
|
|
@ -95,7 +95,9 @@
|
|||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsObjectFrame.h"
|
||||
#include "nsTransitionManager.h"
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
#include "nsAnimationManager.h"
|
||||
#endif
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "nsIFrameMessageManager.h"
|
||||
#include "FrameLayerBuilder.h"
|
||||
|
@ -915,9 +917,11 @@ nsPresContext::Init(nsIDeviceContext* aDeviceContext)
|
|||
if (!mTransitionManager)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
mAnimationManager = new nsAnimationManager(this);
|
||||
if (!mAnimationManager)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
#endif
|
||||
|
||||
if (mDocument->GetDisplayDocument()) {
|
||||
NS_ASSERTION(mDocument->GetDisplayDocument()->GetShell() &&
|
||||
|
@ -1081,10 +1085,12 @@ nsPresContext::SetShell(nsIPresShell* aShell)
|
|||
mTransitionManager->Disconnect();
|
||||
mTransitionManager = nsnull;
|
||||
}
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
if (mAnimationManager) {
|
||||
mAnimationManager->Disconnect();
|
||||
mAnimationManager = nsnull;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1634,7 +1640,9 @@ nsPresContext::RebuildAllStyleData(nsChangeHint aExtraHint)
|
|||
}
|
||||
|
||||
RebuildUserFontSet();
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
AnimationManager()->KeyframesListIsDirty();
|
||||
#endif
|
||||
|
||||
mShell->FrameConstructor()->RebuildAllStyleData(aExtraHint);
|
||||
}
|
||||
|
|
|
@ -102,7 +102,9 @@ class nsUserFontSet;
|
|||
struct nsFontFaceRuleContainer;
|
||||
class nsObjectFrame;
|
||||
class nsTransitionManager;
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
class nsAnimationManager;
|
||||
#endif
|
||||
class nsRefreshDriver;
|
||||
class imgIContainer;
|
||||
|
||||
|
@ -239,7 +241,9 @@ public:
|
|||
{ return GetPresShell()->FrameManager(); }
|
||||
|
||||
nsTransitionManager* TransitionManager() { return mTransitionManager; }
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
nsAnimationManager* AnimationManager() { return mAnimationManager; }
|
||||
#endif
|
||||
|
||||
nsRefreshDriver* RefreshDriver() { return mRefreshDriver; }
|
||||
#endif
|
||||
|
@ -1063,7 +1067,9 @@ protected:
|
|||
nsILookAndFeel* mLookAndFeel; // [STRONG]
|
||||
nsRefPtr<nsRefreshDriver> mRefreshDriver;
|
||||
nsRefPtr<nsTransitionManager> mTransitionManager;
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
nsRefPtr<nsAnimationManager> mAnimationManager;
|
||||
#endif
|
||||
nsIAtom* mMedium; // initialized by subclass ctors;
|
||||
// weak pointer to static atom
|
||||
|
||||
|
|
|
@ -66,7 +66,9 @@
|
|||
#include "nsStyleSet.h"
|
||||
#include "nsCSSStyleSheet.h" // XXX for UA sheet loading hack, can this go away please?
|
||||
#include "nsIDOMCSSStyleSheet.h" // for Pref-related rule management (bugs 22963,20760,31816)
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
#include "nsAnimationManager.h"
|
||||
#endif
|
||||
#include "nsINameSpaceManager.h" // for Pref-related rule management (bugs 22963,20760,31816)
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsFrame.h"
|
||||
|
@ -4790,11 +4792,13 @@ PresShell::FlushPendingNotifications(mozFlushType aType)
|
|||
mFrameConstructor->ProcessPendingRestyles();
|
||||
}
|
||||
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
// Dispatch any 'animationstart' events those (or earlier) restyles
|
||||
// queued up.
|
||||
if (!mIsDestroying) {
|
||||
mPresContext->AnimationManager()->DispatchEvents();
|
||||
}
|
||||
#endif
|
||||
|
||||
// Process whatever XBL constructors those restyles queued up. This
|
||||
// ensures that onload doesn't fire too early and that we won't do extra
|
||||
|
@ -5113,7 +5117,9 @@ nsIPresShell::ReconstructStyleDataInternal()
|
|||
|
||||
if (mPresContext) {
|
||||
mPresContext->RebuildUserFontSet();
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
mPresContext->AnimationManager()->KeyframesListIsDirty();
|
||||
#endif
|
||||
}
|
||||
|
||||
Element* root = mDocument->GetRootElement();
|
||||
|
|
|
@ -242,6 +242,7 @@ static inline mozilla::css::Side operator++(mozilla::css::Side& side, int) {
|
|||
#define NS_COLOR_MOZ_VISITEDHYPERLINKTEXT -5
|
||||
#define NS_COLOR_MOZ_ACTIVEHYPERLINKTEXT -6
|
||||
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
// See nsStyleDisplay
|
||||
#define NS_STYLE_ANIMATION_DIRECTION_NORMAL 0
|
||||
#define NS_STYLE_ANIMATION_DIRECTION_ALTERNATE 1
|
||||
|
@ -258,6 +259,7 @@ static inline mozilla::css::Side operator++(mozilla::css::Side& side, int) {
|
|||
// See nsStyleDisplay
|
||||
#define NS_STYLE_ANIMATION_PLAY_STATE_RUNNING 0
|
||||
#define NS_STYLE_ANIMATION_PLAY_STATE_PAUSED 1
|
||||
#endif
|
||||
|
||||
// See nsStyleBackground
|
||||
#define NS_STYLE_BG_ATTACHMENT_SCROLL 0
|
||||
|
|
|
@ -674,6 +674,7 @@ Declaration::GetValue(nsCSSProperty aProperty, nsAString& aValue) const
|
|||
}
|
||||
break;
|
||||
}
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
case eCSSProperty_animation: {
|
||||
const nsCSSProperty* subprops =
|
||||
nsCSSProps::SubpropertyEntryFor(eCSSProperty_animation);
|
||||
|
@ -724,6 +725,7 @@ Declaration::GetValue(nsCSSProperty aProperty, nsAString& aValue) const
|
|||
}
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
case eCSSProperty_marker: {
|
||||
const nsCSSValue &endValue =
|
||||
*data->ValueFor(eCSSProperty_marker_end);
|
||||
|
|
|
@ -112,7 +112,6 @@ CPPSRCS = \
|
|||
Declaration.cpp \
|
||||
nsCSSKeywords.cpp \
|
||||
Loader.cpp \
|
||||
nsAnimationManager.cpp \
|
||||
nsCSSParser.cpp \
|
||||
nsCSSProps.cpp \
|
||||
nsCSSPseudoClasses.cpp \
|
||||
|
@ -148,6 +147,12 @@ CPPSRCS = \
|
|||
StyleRule.cpp \
|
||||
$(NULL)
|
||||
|
||||
ifdef MOZ_CSS_ANIMATIONS
|
||||
CPPSRCS += \
|
||||
nsAnimationManager.cpp \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
FORCE_STATIC_LIB = 1
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
|
|
@ -254,6 +254,7 @@ public:
|
|||
PRUint32 aLineNumber, // for error reporting
|
||||
nsCSSSelectorList **aSelectorList);
|
||||
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
already_AddRefed<nsCSSKeyframeRule>
|
||||
ParseKeyframeRule(const nsSubstring& aBuffer,
|
||||
nsIURI* aURL,
|
||||
|
@ -263,6 +264,7 @@ public:
|
|||
nsIURI* aURL, // for error reporting
|
||||
PRUint32 aLineNumber, // for error reporting
|
||||
nsTArray<float>& aSelectorList);
|
||||
#endif
|
||||
|
||||
protected:
|
||||
class nsAutoParseCompoundProperty;
|
||||
|
@ -367,9 +369,11 @@ protected:
|
|||
nsCSSValue& aValue);
|
||||
|
||||
PRBool ParsePageRule(RuleAppendFunc aAppendFunc, void* aProcessData);
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
PRBool ParseKeyframesRule(RuleAppendFunc aAppendFunc, void* aProcessData);
|
||||
already_AddRefed<nsCSSKeyframeRule> ParseKeyframeRule();
|
||||
PRBool ParseKeyframeSelectorList(nsTArray<float>& aSelectorList);
|
||||
#endif
|
||||
|
||||
enum nsSelectorParsingStatus {
|
||||
// we have parsed a selector and we saw a token that cannot be
|
||||
|
@ -542,7 +546,9 @@ protected:
|
|||
nsCSSValue* aValues,
|
||||
size_t aNumProperties);
|
||||
PRBool ParseTransition();
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
PRBool ParseAnimation();
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_SVG
|
||||
PRBool ParsePaint(nsCSSProperty aPropID);
|
||||
|
@ -1314,6 +1320,7 @@ CSSParserImpl::ParseSelectorString(const nsSubstring& aSelectorString,
|
|||
}
|
||||
|
||||
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
already_AddRefed<nsCSSKeyframeRule>
|
||||
CSSParserImpl::ParseKeyframeRule(const nsSubstring& aBuffer,
|
||||
nsIURI* aURI,
|
||||
|
@ -1362,6 +1369,7 @@ CSSParserImpl::ParseKeyframeSelectorString(const nsSubstring& aSelectorString,
|
|||
|
||||
return success;
|
||||
}
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
|
@ -1593,9 +1601,11 @@ CSSParserImpl::ParseAtRule(RuleAppendFunc aAppendFunc,
|
|||
parseFunc = &CSSParserImpl::ParsePageRule;
|
||||
newSection = eCSSSection_General;
|
||||
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
} else if (mToken.mIdent.LowerCaseEqualsLiteral("-moz-keyframes")) {
|
||||
parseFunc = &CSSParserImpl::ParseKeyframesRule;
|
||||
newSection = eCSSSection_General;
|
||||
#endif
|
||||
|
||||
} else {
|
||||
if (!NonMozillaVendorIdentifier(mToken.mIdent)) {
|
||||
|
@ -2309,6 +2319,7 @@ CSSParserImpl::ParsePageRule(RuleAppendFunc aAppendFunc, void* aData)
|
|||
return PR_FALSE;
|
||||
}
|
||||
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
PRBool
|
||||
CSSParserImpl::ParseKeyframesRule(RuleAppendFunc aAppendFunc, void* aData)
|
||||
{
|
||||
|
@ -2403,6 +2414,7 @@ CSSParserImpl::ParseKeyframeSelectorList(nsTArray<float>& aSelectorList)
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
CSSParserImpl::SkipUntil(PRUnichar aStopSymbol)
|
||||
|
@ -5565,8 +5577,10 @@ CSSParserImpl::ParsePropertyByFunction(nsCSSProperty aPropID)
|
|||
return ParseMozTransformOrigin();
|
||||
case eCSSProperty_transition:
|
||||
return ParseTransition();
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
case eCSSProperty_animation:
|
||||
return ParseAnimation();
|
||||
#endif
|
||||
case eCSSProperty_transition_property:
|
||||
return ParseTransitionProperty();
|
||||
|
||||
|
@ -8373,6 +8387,7 @@ CSSParserImpl::ParseTransition()
|
|||
return PR_TRUE;
|
||||
}
|
||||
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
PRBool
|
||||
CSSParserImpl::ParseAnimation()
|
||||
{
|
||||
|
@ -8425,6 +8440,7 @@ CSSParserImpl::ParseAnimation()
|
|||
}
|
||||
return PR_TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
PRBool
|
||||
CSSParserImpl::ParseShadowItem(nsCSSValue& aValue, PRBool aIsBoxShadow)
|
||||
|
@ -8820,6 +8836,7 @@ nsCSSParser::ParseSelectorString(const nsSubstring& aSelectorString,
|
|||
ParseSelectorString(aSelectorString, aURI, aLineNumber, aSelectorList);
|
||||
}
|
||||
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
already_AddRefed<nsCSSKeyframeRule>
|
||||
nsCSSParser::ParseKeyframeRule(const nsSubstring& aBuffer,
|
||||
nsIURI* aURI,
|
||||
|
@ -8839,3 +8856,4 @@ nsCSSParser::ParseKeyframeSelectorString(const nsSubstring& aSelectorString,
|
|||
ParseKeyframeSelectorString(aSelectorString, aURI, aLineNumber,
|
||||
aSelectorList);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -53,7 +53,9 @@ class nsIURI;
|
|||
class nsIUnicharInputStream;
|
||||
struct nsCSSSelectorList;
|
||||
class nsMediaList;
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
class nsCSSKeyframeRule;
|
||||
#endif
|
||||
|
||||
namespace mozilla {
|
||||
namespace css {
|
||||
|
@ -196,6 +198,7 @@ public:
|
|||
PRUint32 aLineNumber,
|
||||
nsCSSSelectorList** aSelectorList);
|
||||
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
/*
|
||||
* Parse a keyframe rule (which goes inside an @keyframes rule).
|
||||
* Return it if the parse was successful.
|
||||
|
@ -213,6 +216,7 @@ public:
|
|||
nsIURI* aURL,
|
||||
PRUint32 aLineNumber,
|
||||
nsTArray<float>& aSelectorList);
|
||||
#endif
|
||||
|
||||
protected:
|
||||
// This is a CSSParserImpl*, but if we expose that type name in this
|
||||
|
|
|
@ -364,6 +364,7 @@ CSS_PROP_FONT(
|
|||
CSS_PROP_NO_OFFSET,
|
||||
eStyleAnimType_None)
|
||||
#endif
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
CSS_PROP_SHORTHAND(
|
||||
-moz-animation,
|
||||
animation,
|
||||
|
@ -454,6 +455,7 @@ CSS_PROP_DISPLAY(
|
|||
kTransitionTimingFunctionKTable,
|
||||
CSS_PROP_NO_OFFSET,
|
||||
eStyleAnimType_None)
|
||||
#endif
|
||||
CSS_PROP_BACKENDONLY(
|
||||
azimuth,
|
||||
azimuth,
|
||||
|
|
|
@ -445,6 +445,7 @@ nsCSSProps::OtherNameFor(nsCSSProperty aProperty)
|
|||
|
||||
/***************************************************************************/
|
||||
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
const PRInt32 nsCSSProps::kAnimationDirectionKTable[] = {
|
||||
eCSSKeyword_normal, NS_STYLE_ANIMATION_DIRECTION_NORMAL,
|
||||
eCSSKeyword_alternate, NS_STYLE_ANIMATION_DIRECTION_ALTERNATE,
|
||||
|
@ -469,6 +470,7 @@ const PRInt32 nsCSSProps::kAnimationPlayStateKTable[] = {
|
|||
eCSSKeyword_paused, NS_STYLE_ANIMATION_PLAY_STATE_PAUSED,
|
||||
eCSSKeyword_UNKNOWN,-1
|
||||
};
|
||||
#endif
|
||||
|
||||
const PRInt32 nsCSSProps::kAppearanceKTable[] = {
|
||||
eCSSKeyword_none, NS_THEME_NONE,
|
||||
|
@ -1637,6 +1639,7 @@ const PRUint32 nsCSSProps::kFlagsTable[eCSSProperty_COUNT] = {
|
|||
#undef CSS_PROP_SHORTHAND
|
||||
};
|
||||
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
static const nsCSSProperty gAnimationSubpropTable[] = {
|
||||
eCSSProperty_animation_duration,
|
||||
eCSSProperty_animation_timing_function,
|
||||
|
@ -1651,6 +1654,7 @@ static const nsCSSProperty gAnimationSubpropTable[] = {
|
|||
eCSSProperty_animation_name,
|
||||
eCSSProperty_UNKNOWN
|
||||
};
|
||||
#endif
|
||||
|
||||
static const nsCSSProperty gBorderRadiusSubpropTable[] = {
|
||||
// Code relies on these being in topleft-topright-bottomright-bottomleft
|
||||
|
|
|
@ -329,11 +329,13 @@ public:
|
|||
*iter_ != eCSSProperty_UNKNOWN; ++iter_)
|
||||
|
||||
// Keyword/Enum value tables
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
static const PRInt32 kAnimationDirectionKTable[];
|
||||
static const PRInt32 kAnimationFillModeKTable[];
|
||||
static const PRInt32 kAnimationIterationCountKTable[];
|
||||
static const PRInt32 kAnimationPlayStateKTable[];
|
||||
static const PRInt32 kAnimationTimingFunctionKTable[];
|
||||
#endif
|
||||
static const PRInt32 kAppearanceKTable[];
|
||||
static const PRInt32 kAzimuthKTable[];
|
||||
static const PRInt32 kBackgroundAttachmentKTable[];
|
||||
|
|
|
@ -837,7 +837,9 @@ struct RuleCascadeData {
|
|||
#endif
|
||||
|
||||
nsTArray<nsFontFaceRuleContainer> mFontFaceRules;
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
nsTArray<nsCSSKeyframesRule*> mKeyframesRules;
|
||||
#endif
|
||||
|
||||
// Looks up or creates the appropriate list in |mAttributeSelectors|.
|
||||
// Returns null only on allocation failure.
|
||||
|
@ -2455,6 +2457,7 @@ nsCSSRuleProcessor::AppendFontFaceRules(
|
|||
return PR_TRUE;
|
||||
}
|
||||
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
// Append all the currently-active keyframes rules to aArray. Return
|
||||
// true for success and false for failure.
|
||||
PRBool
|
||||
|
@ -2471,6 +2474,7 @@ nsCSSRuleProcessor::AppendKeyframesRules(
|
|||
|
||||
return PR_TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
nsresult
|
||||
nsCSSRuleProcessor::ClearRuleCascades()
|
||||
|
@ -2737,13 +2741,17 @@ static PLDHashTableOps gRulesByWeightOps = {
|
|||
struct CascadeEnumData {
|
||||
CascadeEnumData(nsPresContext* aPresContext,
|
||||
nsTArray<nsFontFaceRuleContainer>& aFontFaceRules,
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
nsTArray<nsCSSKeyframesRule*>& aKeyframesRules,
|
||||
#endif
|
||||
nsMediaQueryResultCacheKey& aKey,
|
||||
PLArenaPool& aArena,
|
||||
PRUint8 aSheetType)
|
||||
: mPresContext(aPresContext),
|
||||
mFontFaceRules(aFontFaceRules),
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
mKeyframesRules(aKeyframesRules),
|
||||
#endif
|
||||
mCacheKey(aKey),
|
||||
mArena(aArena),
|
||||
mSheetType(aSheetType)
|
||||
|
@ -2761,7 +2769,9 @@ struct CascadeEnumData {
|
|||
|
||||
nsPresContext* mPresContext;
|
||||
nsTArray<nsFontFaceRuleContainer>& mFontFaceRules;
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
nsTArray<nsCSSKeyframesRule*>& mKeyframesRules;
|
||||
#endif
|
||||
nsMediaQueryResultCacheKey& mCacheKey;
|
||||
PLArenaPool& mArena;
|
||||
// Hooray, a manual PLDHashTable since nsClassHashtable doesn't
|
||||
|
@ -2817,6 +2827,7 @@ CascadeRuleEnumFunc(nsICSSRule* aRule, void* aData)
|
|||
ptr->mRule = fontFaceRule;
|
||||
ptr->mSheetType = data->mSheetType;
|
||||
}
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
else if (nsICSSRule::KEYFRAMES_RULE == type) {
|
||||
nsCSSKeyframesRule *keyframesRule =
|
||||
static_cast<nsCSSKeyframesRule*>(aRule);
|
||||
|
@ -2824,6 +2835,7 @@ CascadeRuleEnumFunc(nsICSSRule* aRule, void* aData)
|
|||
return PR_FALSE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
@ -2924,7 +2936,9 @@ nsCSSRuleProcessor::RefreshRuleCascade(nsPresContext* aPresContext)
|
|||
eCompatibility_NavQuirks == aPresContext->CompatibilityMode()));
|
||||
if (newCascade) {
|
||||
CascadeEnumData data(aPresContext, newCascade->mFontFaceRules,
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
newCascade->mKeyframesRules,
|
||||
#endif
|
||||
newCascade->mCacheKey,
|
||||
newCascade->mRuleHash.Arena(),
|
||||
mSheetType);
|
||||
|
|
|
@ -56,7 +56,9 @@ struct RuleCascadeData;
|
|||
struct nsCSSSelectorList;
|
||||
struct CascadeEnumData;
|
||||
struct TreeMatchContext;
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
class nsCSSKeyframesRule;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* The CSS style rule processor provides a mechanism for sibling style
|
||||
|
@ -141,8 +143,10 @@ public:
|
|||
PRBool AppendFontFaceRules(nsPresContext* aPresContext,
|
||||
nsTArray<nsFontFaceRuleContainer>& aArray);
|
||||
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
PRBool AppendKeyframesRules(nsPresContext* aPresContext,
|
||||
nsTArray<nsCSSKeyframesRule*>& aArray);
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG
|
||||
void AssertQuirksChangeOK() {
|
||||
|
|
|
@ -1693,6 +1693,7 @@ nsCSSFontFaceRule::GetDesc(nsCSSFontDesc aDescID, nsCSSValue & aValue)
|
|||
aValue = mDecl.*nsCSSFontFaceStyleDecl::Fields[aDescID];
|
||||
}
|
||||
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
// -------------------------------------------
|
||||
// nsCSSKeyframeStyleDeclaration
|
||||
//
|
||||
|
@ -2130,3 +2131,4 @@ nsCSSKeyframesRule::UseForPresentation(nsPresContext* aPresContext,
|
|||
return PR_FALSE;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -48,8 +48,10 @@
|
|||
#include "nsIDOMCSSMediaRule.h"
|
||||
#include "nsIDOMCSSMozDocumentRule.h"
|
||||
#include "nsIDOMCSSFontFaceRule.h"
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
#include "nsIDOMMozCSSKeyframeRule.h"
|
||||
#include "nsIDOMMozCSSKeyframesRule.h"
|
||||
#endif
|
||||
#include "nsIDOMCSSStyleDeclaration.h"
|
||||
#include "nsICSSRuleList.h"
|
||||
#include "nsAutoPtr.h"
|
||||
|
@ -313,6 +315,7 @@ private:
|
|||
} // namespace css
|
||||
} // namespace mozilla
|
||||
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
class nsCSSKeyframeRule;
|
||||
|
||||
class NS_FINAL_CLASS nsCSSKeyframeStyleDeclaration
|
||||
|
@ -438,5 +441,6 @@ private:
|
|||
|
||||
nsString mName;
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* !defined(nsCSSRules_h_) */
|
||||
|
|
|
@ -3931,6 +3931,7 @@ nsComputedDOMStyle::DoGetTransitionTimingFunction()
|
|||
return valueList;
|
||||
}
|
||||
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
nsIDOMCSSValue*
|
||||
nsComputedDOMStyle::DoGetAnimationName()
|
||||
{
|
||||
|
@ -4109,6 +4110,7 @@ nsComputedDOMStyle::DoGetAnimationPlayState()
|
|||
|
||||
return valueList;
|
||||
}
|
||||
#endif
|
||||
|
||||
#define COMPUTED_STYLE_MAP_ENTRY(_prop, _method) \
|
||||
{ eCSSProperty_##_prop, &nsComputedDOMStyle::DoGet##_method, PR_FALSE }
|
||||
|
@ -4262,6 +4264,7 @@ nsComputedDOMStyle::GetQueryablePropertyMap(PRUint32* aLength)
|
|||
* Implementations of -moz- styles *
|
||||
\* ******************************* */
|
||||
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
COMPUTED_STYLE_MAP_ENTRY(animation_delay, AnimationDelay),
|
||||
COMPUTED_STYLE_MAP_ENTRY(animation_direction, AnimationDirection),
|
||||
COMPUTED_STYLE_MAP_ENTRY(animation_duration, AnimationDuration),
|
||||
|
@ -4270,6 +4273,7 @@ nsComputedDOMStyle::GetQueryablePropertyMap(PRUint32* aLength)
|
|||
COMPUTED_STYLE_MAP_ENTRY(animation_name, AnimationName),
|
||||
COMPUTED_STYLE_MAP_ENTRY(animation_play_state, AnimationPlayState),
|
||||
COMPUTED_STYLE_MAP_ENTRY(animation_timing_function, AnimationTimingFunction),
|
||||
#endif
|
||||
COMPUTED_STYLE_MAP_ENTRY(appearance, Appearance),
|
||||
COMPUTED_STYLE_MAP_ENTRY(background_clip, BackgroundClip),
|
||||
COMPUTED_STYLE_MAP_ENTRY(_moz_background_inline_policy, BackgroundInlinePolicy),
|
||||
|
|
|
@ -368,6 +368,7 @@ private:
|
|||
nsIDOMCSSValue* DoGetTransitionDelay();
|
||||
nsIDOMCSSValue* DoGetTransitionTimingFunction();
|
||||
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
/* CSS Animations */
|
||||
nsIDOMCSSValue* DoGetAnimationName();
|
||||
nsIDOMCSSValue* DoGetAnimationDuration();
|
||||
|
@ -377,6 +378,7 @@ private:
|
|||
nsIDOMCSSValue* DoGetAnimationFillMode();
|
||||
nsIDOMCSSValue* DoGetAnimationIterationCount();
|
||||
nsIDOMCSSValue* DoGetAnimationPlayState();
|
||||
#endif
|
||||
|
||||
/* SVG properties */
|
||||
nsIDOMCSSValue* DoGetFill();
|
||||
|
|
|
@ -78,8 +78,10 @@ public:
|
|||
MEDIA_RULE,
|
||||
FONT_FACE_RULE,
|
||||
PAGE_RULE,
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
KEYFRAME_RULE,
|
||||
KEYFRAMES_RULE,
|
||||
#endif
|
||||
DOCUMENT_RULE
|
||||
};
|
||||
|
||||
|
|
|
@ -3603,6 +3603,7 @@ static const TransitionPropInfo transitionPropInfo[4] = {
|
|||
&nsStyleDisplay::mTransitionTimingFunctionCount },
|
||||
};
|
||||
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
// Each property's index in this array must match its index in the
|
||||
// mutable array |animationPropData| below.
|
||||
static const TransitionPropInfo animationPropInfo[8] = {
|
||||
|
@ -3623,6 +3624,7 @@ static const TransitionPropInfo animationPropInfo[8] = {
|
|||
{ eCSSProperty_animation_iteration_count,
|
||||
&nsStyleDisplay::mAnimationIterationCountCount },
|
||||
};
|
||||
#endif
|
||||
|
||||
// Information about each transition or animation property that changes
|
||||
// during ComputeDisplayData.
|
||||
|
@ -3899,6 +3901,7 @@ nsRuleNode::ComputeDisplayData(void* aStartStruct,
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
// Each property's index in this array must match its index in the
|
||||
// const array |animationPropInfo| above.
|
||||
TransitionPropData animationPropData[8];
|
||||
|
@ -4216,6 +4219,7 @@ nsRuleNode::ComputeDisplayData(void* aStartStruct,
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// opacity: factor, inherit, initial
|
||||
SetFactor(*aRuleData->ValueForOpacity(), display->mOpacity, canStoreInRuleTree,
|
||||
|
|
|
@ -59,7 +59,9 @@
|
|||
#include "nsContentUtils.h"
|
||||
#include "nsRuleProcessorData.h"
|
||||
#include "nsTransitionManager.h"
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
#include "nsAnimationManager.h"
|
||||
#endif
|
||||
#include "nsIEventStateManager.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
|
||||
|
@ -117,7 +119,9 @@ nsStyleSet::Init(nsPresContext *aPresContext)
|
|||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
GatherRuleProcessors(eAnimationSheet);
|
||||
#endif
|
||||
GatherRuleProcessors(eTransitionSheet);
|
||||
|
||||
return NS_OK;
|
||||
|
@ -198,6 +202,7 @@ nsStyleSet::GatherRuleProcessors(sheetType aType)
|
|||
//don't regather if this level is disabled
|
||||
return NS_OK;
|
||||
}
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
if (aType == eAnimationSheet) {
|
||||
// We have no sheet for the animations level; just a rule
|
||||
// processor. (XXX: We should probably do this for the other
|
||||
|
@ -205,6 +210,7 @@ nsStyleSet::GatherRuleProcessors(sheetType aType)
|
|||
mRuleProcessors[aType] = PresContext()->AnimationManager();
|
||||
return NS_OK;
|
||||
}
|
||||
#endif
|
||||
if (aType == eTransitionSheet) {
|
||||
// We have no sheet for the transitions level; just a rule
|
||||
// processor. (XXX: We should probably do this for the other
|
||||
|
@ -519,6 +525,7 @@ nsStyleSet::GetContext(nsStyleContext* aParentContext,
|
|||
NS_ASSERTION(result->GetPseudo() == aPseudoTag, "Unexpected pseudo");
|
||||
}
|
||||
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
if (aDoAnimations) {
|
||||
// Normally the animation manager has already added the correct
|
||||
// style rule. However, if the animation-name just changed, it
|
||||
|
@ -563,6 +570,7 @@ nsStyleSet::GetContext(nsStyleContext* aParentContext,
|
|||
aPseudoTag, aPseudoType, PR_FALSE, nsnull);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return result.forget();
|
||||
}
|
||||
|
@ -738,9 +746,11 @@ nsStyleSet::FileRules(nsIStyleRuleProcessor::EnumFunc aCollectorFunc,
|
|||
#endif
|
||||
aRuleWalker->SetLevel(eTransitionSheet, PR_FALSE, PR_FALSE);
|
||||
(*aCollectorFunc)(mRuleProcessors[eTransitionSheet], aData);
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
// GetContext() depends on the animation rules being *last*
|
||||
aRuleWalker->SetLevel(eAnimationSheet, PR_FALSE, PR_FALSE);
|
||||
(*aCollectorFunc)(mRuleProcessors[eAnimationSheet], aData);
|
||||
#endif
|
||||
#ifdef DEBUG
|
||||
AssertNoCSSRules(aRuleWalker->CurrentNode(), lastImportantRN);
|
||||
AssertNoImportantRules(aRuleWalker->CurrentNode(), lastImportantRN);
|
||||
|
@ -782,8 +792,10 @@ nsStyleSet::WalkRuleProcessors(nsIStyleRuleProcessor::EnumFunc aFunc,
|
|||
if (mRuleProcessors[eOverrideSheet])
|
||||
(*aFunc)(mRuleProcessors[eOverrideSheet], aData);
|
||||
(*aFunc)(mRuleProcessors[eTransitionSheet], aData);
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
// GetContext depends on the animation rule being *last*
|
||||
(*aFunc)(mRuleProcessors[eAnimationSheet], aData);
|
||||
#endif
|
||||
}
|
||||
|
||||
PRBool nsStyleSet::BuildDefaultStyleData(nsPresContext* aPresContext)
|
||||
|
@ -1137,6 +1149,7 @@ nsStyleSet::AppendFontFaceRules(nsPresContext* aPresContext,
|
|||
return PR_TRUE;
|
||||
}
|
||||
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
PRBool
|
||||
nsStyleSet::AppendKeyframesRules(nsPresContext* aPresContext,
|
||||
nsTArray<nsCSSKeyframesRule*>& aArray)
|
||||
|
@ -1151,6 +1164,7 @@ nsStyleSet::AppendKeyframesRules(nsPresContext* aPresContext,
|
|||
}
|
||||
return PR_TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
nsStyleSet::BeginShutdown(nsPresContext* aPresContext)
|
||||
|
|
|
@ -60,7 +60,9 @@
|
|||
|
||||
class nsIURI;
|
||||
class nsCSSFontFaceRule;
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
class nsCSSKeyframesRule;
|
||||
#endif
|
||||
class nsRuleWalker;
|
||||
struct RuleProcessorData;
|
||||
struct TreeMatchContext;
|
||||
|
@ -172,10 +174,12 @@ class nsStyleSet
|
|||
PRBool AppendFontFaceRules(nsPresContext* aPresContext,
|
||||
nsTArray<nsFontFaceRuleContainer>& aArray);
|
||||
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
// Append all the currently-active keyframes rules to aArray. Return
|
||||
// true for success and false for failure.
|
||||
PRBool AppendKeyframesRules(nsPresContext* aPresContext,
|
||||
nsTArray<nsCSSKeyframesRule*>& aArray);
|
||||
#endif
|
||||
|
||||
// Begin ignoring style context destruction, to avoid lots of unnecessary
|
||||
// work on document teardown.
|
||||
|
@ -240,7 +244,9 @@ class nsStyleSet
|
|||
eStyleAttrSheet,
|
||||
eOverrideSheet, // CSS
|
||||
eTransitionSheet,
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
eAnimationSheet,
|
||||
#endif
|
||||
eSheetTypeCount
|
||||
// be sure to keep the number of bits in |mDirty| below and in
|
||||
// NS_RULE_NODE_LEVEL_MASK updated when changing the number of sheet
|
||||
|
|
|
@ -1983,6 +1983,7 @@ void nsTransition::SetUnknownProperty(const nsAString& aUnknownProperty)
|
|||
mUnknownProperty = do_GetAtom(aUnknownProperty);
|
||||
}
|
||||
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
nsAnimation::nsAnimation(const nsAnimation& aCopy)
|
||||
: mTimingFunction(aCopy.mTimingFunction)
|
||||
, mDuration(aCopy.mDuration)
|
||||
|
@ -2007,6 +2008,7 @@ nsAnimation::SetInitialValues()
|
|||
mPlayState = NS_STYLE_ANIMATION_PLAY_STATE_RUNNING;
|
||||
mIterationCount = 1.0f;
|
||||
}
|
||||
#endif
|
||||
|
||||
nsStyleDisplay::nsStyleDisplay()
|
||||
{
|
||||
|
@ -2038,6 +2040,7 @@ nsStyleDisplay::nsStyleDisplay()
|
|||
mTransitionDelayCount = 1;
|
||||
mTransitionPropertyCount = 1;
|
||||
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
mAnimations.AppendElement();
|
||||
NS_ABORT_IF_FALSE(mAnimations.Length() == 1,
|
||||
"appending within auto buffer should never fail");
|
||||
|
@ -2050,6 +2053,7 @@ nsStyleDisplay::nsStyleDisplay()
|
|||
mAnimationFillModeCount = 1;
|
||||
mAnimationPlayStateCount = 1;
|
||||
mAnimationIterationCountCount = 1;
|
||||
#endif
|
||||
}
|
||||
|
||||
nsStyleDisplay::nsStyleDisplay(const nsStyleDisplay& aSource)
|
||||
|
@ -2058,6 +2062,7 @@ nsStyleDisplay::nsStyleDisplay(const nsStyleDisplay& aSource)
|
|||
, mTransitionDurationCount(aSource.mTransitionDurationCount)
|
||||
, mTransitionDelayCount(aSource.mTransitionDelayCount)
|
||||
, mTransitionPropertyCount(aSource.mTransitionPropertyCount)
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
, mAnimations(aSource.mAnimations)
|
||||
, mAnimationTimingFunctionCount(aSource.mAnimationTimingFunctionCount)
|
||||
, mAnimationDurationCount(aSource.mAnimationDurationCount)
|
||||
|
@ -2067,6 +2072,7 @@ nsStyleDisplay::nsStyleDisplay(const nsStyleDisplay& aSource)
|
|||
, mAnimationFillModeCount(aSource.mAnimationFillModeCount)
|
||||
, mAnimationPlayStateCount(aSource.mAnimationPlayStateCount)
|
||||
, mAnimationIterationCountCount(aSource.mAnimationIterationCountCount)
|
||||
#endif
|
||||
{
|
||||
MOZ_COUNT_CTOR(nsStyleDisplay);
|
||||
mAppearance = aSource.mAppearance;
|
||||
|
|
|
@ -1417,6 +1417,7 @@ private:
|
|||
// eCSSProperty_UNKNOWN
|
||||
};
|
||||
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
struct nsAnimation {
|
||||
nsAnimation() { /* leaves uninitialized; see also SetInitialValues */ }
|
||||
explicit nsAnimation(const nsAnimation& aCopy);
|
||||
|
@ -1455,6 +1456,7 @@ private:
|
|||
PRUint8 mPlayState;
|
||||
float mIterationCount; // NS_IEEEPositiveInfinity() means infinite
|
||||
};
|
||||
#endif
|
||||
|
||||
struct nsStyleDisplay {
|
||||
nsStyleDisplay();
|
||||
|
@ -1511,6 +1513,7 @@ struct nsStyleDisplay {
|
|||
mTransitionDelayCount,
|
||||
mTransitionPropertyCount;
|
||||
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
nsAutoTArray<nsAnimation, 1> mAnimations; // [reset]
|
||||
// The number of elements in mAnimations that are not from repeating
|
||||
// a list due to another property being longer.
|
||||
|
@ -1522,6 +1525,7 @@ struct nsStyleDisplay {
|
|||
mAnimationFillModeCount,
|
||||
mAnimationPlayStateCount,
|
||||
mAnimationIterationCountCount;
|
||||
#endif
|
||||
|
||||
PRBool IsBlockInside() const {
|
||||
return NS_STYLE_DISPLAY_BLOCK == mDisplay ||
|
||||
|
|
|
@ -95,7 +95,6 @@ GARBAGE += css_properties.js
|
|||
|
||||
|
||||
_TEST_FILES = test_acid3_test46.html \
|
||||
test_animations.html \
|
||||
test_any_dynamic.html \
|
||||
test_at_rule_parse_serialize.html \
|
||||
test_bug73586.html \
|
||||
|
@ -153,7 +152,6 @@ _TEST_FILES = test_acid3_test46.html \
|
|||
test_inherit_storage.html \
|
||||
test_initial_computation.html \
|
||||
test_initial_storage.html \
|
||||
test_keyframes_rules.html \
|
||||
test_media_queries.html \
|
||||
test_media_queries_dynamic.html \
|
||||
test_media_queries_dynamic_xbl.html \
|
||||
|
@ -228,6 +226,13 @@ _TEST_FILES = test_acid3_test46.html \
|
|||
visited_image_loading_frame_empty.html \
|
||||
$(NULL)
|
||||
|
||||
ifdef MOZ_CSS_ANIMATIONS
|
||||
_TEST_FILES += \
|
||||
test_animations.html \
|
||||
test_keyframes_rules.html \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
_VISITED_REFTEST_FILES = \
|
||||
$(shell find $(topsrcdir)/layout/reftests/css-visited/ -name '*.html' -o -name '*.xhtml') \
|
||||
$(topsrcdir)/layout/reftests/svg/pseudo-classes-02.svg \
|
||||
|
|
|
@ -103,7 +103,9 @@ class nsHashKey;
|
|||
#define NS_COMMAND_EVENT 24
|
||||
#define NS_SCROLLAREA_EVENT 25
|
||||
#define NS_TRANSITION_EVENT 26
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
#define NS_ANIMATION_EVENT 27
|
||||
#endif
|
||||
|
||||
#define NS_UI_EVENT 28
|
||||
#ifdef MOZ_SVG
|
||||
|
@ -494,10 +496,12 @@ class nsHashKey;
|
|||
#define NS_TRANSITION_EVENT_START 4200
|
||||
#define NS_TRANSITION_END (NS_TRANSITION_EVENT_START)
|
||||
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
#define NS_ANIMATION_EVENT_START 4250
|
||||
#define NS_ANIMATION_START (NS_ANIMATION_EVENT_START)
|
||||
#define NS_ANIMATION_END (NS_ANIMATION_EVENT_START + 1)
|
||||
#define NS_ANIMATION_ITERATION (NS_ANIMATION_EVENT_START + 2)
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_SMIL
|
||||
#define NS_SMIL_TIME_EVENT_START 4300
|
||||
|
@ -1493,6 +1497,7 @@ public:
|
|||
float elapsedTime;
|
||||
};
|
||||
|
||||
#ifdef MOZ_CSS_ANIMATIONS
|
||||
class nsAnimationEvent : public nsEvent
|
||||
{
|
||||
public:
|
||||
|
@ -1506,6 +1511,7 @@ public:
|
|||
nsString animationName;
|
||||
float elapsedTime;
|
||||
};
|
||||
#endif
|
||||
|
||||
class nsUIStateChangeEvent : public nsGUIEvent
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче