author | Matheus Kerschbaum <matjk7@gmail.com> |
Sat, 05 Nov 2011 10:32:52 +0000 | |
changeset 81490 | 8248dbffd64534fb6c65ad3d757b795119e783c6 |
parent 81489 | 3690cdb0bcb63c3ebb47941c6f0d402613f05962 |
child 81491 | aff1bd412058cb6926a8feae1e8c0fc76b4c04a3 |
push id | 90 |
push user | ffxbld |
push date | Sun, 29 Jan 2012 07:46:52 +0000 |
treeherder | mozilla-release@acddb6b6a01c [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | dholbert |
bugs | 698630 |
milestone | 10.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/browser/installer/package-manifest.in +++ b/browser/installer/package-manifest.in @@ -474,19 +474,17 @@ @BINPATH@/res/entityTables/* #ifdef XP_MACOSX @BINPATH@/res/MainMenu.nib/ #endif ; svg @BINPATH@/res/svg.css @BINPATH@/components/dom_svg.xpt -#ifdef MOZ_SMIL @BINPATH@/components/dom_smil.xpt -#endif ; [Personal Security Manager] ; @BINPATH@/@DLL_PREFIX@nssckbi@DLL_SUFFIX@ @BINPATH@/components/pipboot.xpt @BINPATH@/components/pipnss.xpt @BINPATH@/components/pippki.xpt @BINPATH@/@DLL_PREFIX@nss3@DLL_SUFFIX@
--- a/config/autoconf.mk.in +++ b/config/autoconf.mk.in @@ -248,17 +248,16 @@ MOZ_NATIVE_PNG = @SYSTEM_PNG@ MOZ_TREE_CAIRO = @MOZ_TREE_CAIRO@ MOZ_TREE_PIXMAN = @MOZ_TREE_PIXMAN@ MOZ_UPDATE_XTERM = @MOZ_UPDATE_XTERM@ MOZ_PERMISSIONS = @MOZ_PERMISSIONS@ MOZ_XTF = @MOZ_XTF@ MOZ_SVG_DLISTS = @MOZ_SVG_DLISTS@ MOZ_CAIRO_CFLAGS = @MOZ_CAIRO_CFLAGS@ -MOZ_SMIL = @MOZ_SMIL@ MOZ_PREF_EXTENSIONS = @MOZ_PREF_EXTENSIONS@ MOZ_CAIRO_LIBS = @MOZ_CAIRO_LIBS@ MOZ_ENABLE_GNOMEUI = @MOZ_ENABLE_GNOMEUI@ MOZ_GNOMEUI_CFLAGS = @MOZ_GNOMEUI_CFLAGS@ MOZ_GNOMEUI_LIBS = @MOZ_GNOMEUI_LIBS@
--- a/configure.in +++ b/configure.in @@ -6185,28 +6185,16 @@ fi dnl ======================================================== dnl SVG Display Lists dnl ======================================================== if test -n "$MOZ_SVG_DLISTS"; then AC_DEFINE(MOZ_SVG_DLISTS) fi dnl ======================================================== -dnl SMIL -dnl ======================================================== -MOZ_SMIL=1 -MOZ_ARG_DISABLE_BOOL(smil, -[ --disable-smil Disable SMIL animation support], - MOZ_SMIL=, - MOZ_SMIL=1 ) -if test -n "$MOZ_SMIL"; then - AC_DEFINE(MOZ_SMIL) -fi - -dnl ======================================================== dnl Build Freetype in the tree dnl ======================================================== MOZ_ARG_ENABLE_BOOL(tree-freetype, [ --enable-tree-freetype Enable Tree FreeType], MOZ_TREE_FREETYPE=1, MOZ_TREE_FREETYPE= ) if test -n "$MOZ_TREE_FREETYPE"; then if test -n "$_WIN32_MSVC"; then @@ -8288,17 +8276,16 @@ AC_SUBST(FILTER) AC_SUBST(BIN_FLAGS) AC_SUBST(MOZ_WIDGET_TOOLKIT) AC_SUBST(MOZ_UPDATE_XTERM) AC_SUBST(MOZ_PLATFORM_MAEMO) AC_SUBST(MOZ_AUTH_EXTENSION) AC_SUBST(MOZ_PERMISSIONS) AC_SUBST(MOZ_XTF) AC_SUBST(MOZ_PREF_EXTENSIONS) -AC_SUBST(MOZ_SMIL) AC_SUBST(MOZ_JS_LIBS) AC_SUBST(MOZ_PSM) AC_SUBST(MOZ_DEBUG) AC_SUBST(MOZ_DEBUG_SYMBOLS) AC_SUBST(MOZ_DEBUG_ENABLE_DEFS) AC_SUBST(MOZ_DEBUG_DISABLE_DEFS) AC_SUBST(MOZ_DEBUG_FLAGS) AC_SUBST(MOZ_DEBUG_LDFLAGS)
--- a/content/base/public/nsIContent.h +++ b/content/base/public/nsIContent.h @@ -52,20 +52,18 @@ class nsIContent; class nsEventListenerManager; class nsIURI; class nsRuleWalker; class nsAttrValue; class nsAttrName; class nsTextFragment; class nsIDocShell; class nsIFrame; -#ifdef MOZ_SMIL class nsISMILAttr; class nsIDOMCSSStyleDeclaration; -#endif // MOZ_SMIL namespace mozilla { namespace css { class StyleRule; } } enum nsLinkState { @@ -886,17 +884,16 @@ public: */ nsIFrame* GetPrimaryFrame() const { return mPrimaryFrame; } void SetPrimaryFrame(nsIFrame* aFrame) { NS_PRECONDITION(!aFrame || !mPrimaryFrame || aFrame == mPrimaryFrame, "Losing track of existing primary frame"); mPrimaryFrame = aFrame; } -#ifdef MOZ_SMIL /* * Returns a new nsISMILAttr that allows the caller to animate the given * attribute on this element. * * The CALLER OWNS the result and is responsible for deleting it. */ virtual nsISMILAttr* GetAnimatedAttr(PRInt32 aNamespaceID, nsIAtom* aName) = 0; @@ -919,17 +916,16 @@ public: /** * Set the SMIL override style rule for this node. If aNotify is true, this * method will notify the document's pres context, so that the style changes * will be noticed. */ virtual nsresult SetSMILOverrideStyleRule(mozilla::css::StyleRule* aStyleRule, bool aNotify) = 0; -#endif // MOZ_SMIL nsresult LookupNamespaceURI(const nsAString& aNamespacePrefix, nsAString& aNamespaceURI) const; /** * If this content has independent selection, e.g., if this is input field * or textarea, this return TRUE. Otherwise, false. */
--- a/content/base/public/nsIDocument.h +++ b/content/base/public/nsIDocument.h @@ -56,19 +56,17 @@ #include "nsHashKeys.h" #include "nsNodeInfoManager.h" #include "nsIStreamListener.h" #include "nsIVariant.h" #include "nsIObserver.h" #include "nsGkAtoms.h" #include "nsAutoPtr.h" #include "nsPIDOMWindow.h" -#ifdef MOZ_SMIL #include "nsSMILAnimationController.h" -#endif // MOZ_SMIL #include "nsIScriptGlobalObject.h" #include "nsIDocumentEncoder.h" #include "nsIAnimationFrameListener.h" #include "nsEventStates.h" #include "nsIStructuredCloneContainer.h" #include "nsIBFCacheEntry.h" #include "nsDOMMemoryReporter.h" @@ -1321,27 +1319,25 @@ public: bool IsActive() const { return mDocumentContainer && !mRemovedFromDocShell; } void RegisterFreezableElement(nsIContent* aContent); bool UnregisterFreezableElement(nsIContent* aContent); typedef void (* FreezableElementEnumerator)(nsIContent*, void*); void EnumerateFreezableElements(FreezableElementEnumerator aEnumerator, void* aData); -#ifdef MOZ_SMIL // Indicates whether mAnimationController has been (lazily) initialized. // If this returns true, we're promising that GetAnimationController() // will have a non-null return value. bool HasAnimationController() { return !!mAnimationController; } // Getter for this document's SMIL Animation Controller. Performs lazy // initialization, if this document supports animation and if // mAnimationController isn't yet initialized. virtual nsSMILAnimationController* GetAnimationController() = 0; -#endif // MOZ_SMIL // Makes the images on this document capable of having their animation // active or suspended. An Image will animate as long as at least one of its // owning Documents needs it to animate; otherwise it can suspend. virtual void SetImagesNeedAnimating(bool aAnimating) = 0; /** * Prevents user initiated events from being dispatched to the document and @@ -1644,20 +1640,18 @@ protected: mozilla::css::Loader* mCSSLoader; // [STRONG] // The set of all object, embed, applet, video and audio elements for // which this is the owner document. (They might not be in the document.) // These are non-owning pointers, the elements are responsible for removing // themselves when they go away. nsAutoPtr<nsTHashtable<nsPtrHashKey<nsIContent> > > mFreezableElements; -#ifdef MOZ_SMIL // SMIL Animation Controller, lazily-initialized in GetAnimationController nsRefPtr<nsSMILAnimationController> mAnimationController; -#endif // MOZ_SMIL // Table of element properties for this document. nsPropertyTable mPropertyTable; nsTArray<nsAutoPtr<nsPropertyTable> > mExtraPropertyTables; // Compatibility mode nsCompatibility mCompatMode;
--- a/content/base/public/nsINode.h +++ b/content/base/public/nsINode.h @@ -279,19 +279,17 @@ private: // Its value is always between 0 and 300, inclusive. static PRUint32 sMutationCount; }; // Categories of node properties // 0 is global. #define DOM_USER_DATA 1 #define DOM_USER_DATA_HANDLER 2 -#ifdef MOZ_SMIL #define SMIL_MAPPED_ATTR_ANIMVAL 3 -#endif // MOZ_SMIL // IID for the nsINode interface #define NS_INODE_IID \ { 0x20d16be2, 0x3c58, 0x4099, \ { 0xbf, 0xa6, 0xd0, 0xe7, 0x6b, 0xb1, 0x3d, 0xc5 } } /** * An internal interface that abstracts some DOMNode-related parts that both
--- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -180,21 +180,19 @@ #endif // MOZ_MEDIA #include "mozAutoDocUpdate.h" #include "nsGlobalWindow.h" #include "mozilla/dom/indexedDB/IndexedDatabaseManager.h" #include "nsDOMNavigationTiming.h" #include "nsEventStateManager.h" -#ifdef MOZ_SMIL #include "nsSMILAnimationController.h" #include "imgIContainer.h" #include "nsSVGUtils.h" -#endif // MOZ_SMIL #include "nsRefreshDriver.h" // FOR CSP (autogenerated by xpidl) #include "nsIContentSecurityPolicy.h" #include "nsCSPService.h" #include "nsHTMLStyleSheet.h" #include "nsHTMLCSSStyleSheet.h" @@ -1586,21 +1584,19 @@ nsDocument::~nsDocument() // Clear mObservers to keep it in sync with the mutationobserver list mObservers.Clear(); if (mStyleSheetSetList) { mStyleSheetSetList->Disconnect(); } -#ifdef MOZ_SMIL if (mAnimationController) { mAnimationController->Disconnect(); } -#endif // MOZ_SMIL mParentDocument = nsnull; // Kill the subdocument map, doing this will release its strong // references, if any. if (mSubDocuments) { PL_DHashTableDestroy(mSubDocuments); @@ -1873,22 +1869,20 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMARRAY(mCatalogSheets) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMARRAY(mPreloadingImages) for (PRUint32 i = 0; i < tmp->mAnimationFrameListeners.Length(); ++i) { NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mAnimationFrameListeners[i]"); cb.NoteXPCOMChild(tmp->mAnimationFrameListeners[i]); } -#ifdef MOZ_SMIL // Traverse animation components if (tmp->mAnimationController) { tmp->mAnimationController->Traverse(&cb); } -#endif // MOZ_SMIL if (tmp->mSubDocuments && tmp->mSubDocuments->ops) { PL_DHashTableEnumerate(tmp->mSubDocuments, SubDocTraverser, &cb); } NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsDocument) @@ -1950,21 +1944,19 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(ns tmp->mRadioGroups.Clear(); // nsDocument has a pretty complex destructor, so we're going to // assume that *most* cycles you actually want to break somewhere // else, and not unlink an awful lot here. tmp->mIdentifierMap.Clear(); -#ifdef MOZ_SMIL if (tmp->mAnimationController) { tmp->mAnimationController->Unlink(); } -#endif // MOZ_SMIL tmp->mInUnlinkOrDeletion = false; NS_IMPL_CYCLE_COLLECTION_UNLINK_END nsresult nsDocument::Init() { @@ -3763,23 +3755,21 @@ nsDocument::SetScriptGlobalObject(nsIScr #ifdef DEBUG { nsCOMPtr<nsPIDOMWindow> win(do_QueryInterface(aScriptGlobalObject)); NS_ASSERTION(!win || win->IsInnerWindow(), "Script global object must be an inner window!"); } #endif -#ifdef MOZ_SMIL NS_ABORT_IF_FALSE(aScriptGlobalObject || !mAnimationController || mAnimationController->IsPausedByType( nsSMILTimeContainer::PAUSE_PAGEHIDE | nsSMILTimeContainer::PAUSE_BEGIN), "Clearing window pointer while animations are unpaused"); -#endif // MOZ_SMIL if (mScriptGlobalObject && !aScriptGlobalObject) { // We're detaching from the window. We need to grab a pointer to // our layout history state now. mLayoutHistoryState = GetLayoutHistoryState(); if (mPresShell && !EventHandlingSuppressed()) { RevokeAnimationFrameNotifications(); @@ -5530,17 +5520,16 @@ nsDocument::RequestExternalResource(nsIU } void nsDocument::EnumerateExternalResources(nsSubDocEnumFunc aCallback, void* aData) { mExternalResourceMap.EnumerateResources(aCallback, aData); } -#ifdef MOZ_SMIL nsSMILAnimationController* nsDocument::GetAnimationController() { // We create the animation controller lazily because most documents won't want // one and only SVG documents and the like will call this if (mAnimationController) return mAnimationController; // Refuse to create an Animation Controller if SMIL is disabled, and also @@ -5565,17 +5554,16 @@ nsDocument::GetAnimationController() // controller. (Skip this check for SVG-as-an-image documents, though, // because they don't get OnPageShow / OnPageHide calls). if (!mIsShowing && !mIsBeingUsedAsImage) { mAnimationController->OnPageHide(); } return mAnimationController; } -#endif // MOZ_SMIL struct DirTable { const char* mName; PRUint8 mValue; }; static const DirTable dirAttributes[] = { {"ltr", IBMBIDI_TEXTDIRECTION_LTR}, @@ -7274,21 +7262,19 @@ nsDocument::OnPageShow(bool aPersisted, // See nsIDocument if (!aDispatchStartTarget) { // Set mIsShowing before firing events, in case those event handlers // move us around. mIsShowing = true; } -#ifdef MOZ_SMIL if (mAnimationController) { mAnimationController->OnPageShow(); } -#endif if (aPersisted) { SetImagesNeedAnimating(true); } UpdateVisibilityState(); nsCOMPtr<nsIDOMEventTarget> target = aDispatchStartTarget; @@ -7344,21 +7330,19 @@ nsDocument::OnPageHide(bool aPersisted, // See nsIDocument if (!aDispatchStartTarget) { // Set mIsShowing before firing events, in case those event handlers // move us around. mIsShowing = false; } -#ifdef MOZ_SMIL if (mAnimationController) { mAnimationController->OnPageHide(); } -#endif if (aPersisted) { SetImagesNeedAnimating(false); } // Now send out a PageHide event. nsCOMPtr<nsIDOMEventTarget> target = aDispatchStartTarget; if (!target) { @@ -8539,28 +8523,28 @@ GetCommonAncestor(nsIDocument* aDoc1, ns if (child1 != child2) { break; } parent = child1; } return parent; } -// Returns the root document in a document hierarchy. -static nsIDocument* -GetRootDocument(nsIDocument* aDoc) -{ - if (!aDoc) - return nsnull; - nsIDocument* doc = aDoc; - while (doc->GetParentDocument()) { - doc = doc->GetParentDocument(); - } - return doc; -} +// Returns the root document in a document hierarchy. +static nsIDocument* +GetRootDocument(nsIDocument* aDoc) +{ + if (!aDoc) + return nsnull; + nsIDocument* doc = aDoc; + while (doc->GetParentDocument()) { + doc = doc->GetParentDocument(); + } + return doc; +} class nsCallRequestFullScreen : public nsRunnable { public: nsCallRequestFullScreen(Element* aElement) : mElement(aElement), mDoc(aElement->OwnerDoc()), mWasCallerChrome(nsContentUtils::IsCallerChrome()) @@ -8583,17 +8567,17 @@ void nsDocument::AsyncRequestFullScreen(Element* aElement) { if (!aElement) { return; } // Request full-screen asynchronously. nsCOMPtr<nsIRunnable> event(new nsCallRequestFullScreen(aElement)); NS_DispatchToCurrentThread(event); -} +} void nsDocument::RequestFullScreen(Element* aElement, bool aWasCallerChrome) { if (!aElement || !aElement->IsInDoc() || aElement->OwnerDoc() != this || !IsFullScreenEnabled(aWasCallerChrome) ||
--- a/content/base/src/nsDocument.h +++ b/content/base/src/nsDocument.h @@ -860,21 +860,19 @@ public: RequestExternalResource(nsIURI* aURI, nsINode* aRequestingNode, ExternalResourceLoad** aPendingLoad); virtual NS_HIDDEN_(void) EnumerateExternalResources(nsSubDocEnumFunc aCallback, void* aData); nsTArray<nsCString> mFileDataUris; -#ifdef MOZ_SMIL // Returns our (lazily-initialized) animation controller. // If HasAnimationController is true, this is guaranteed to return non-null. nsSMILAnimationController* GetAnimationController(); -#endif // MOZ_SMIL void SetImagesNeedAnimating(bool aAnimating); virtual void SuppressEventHandling(PRUint32 aIncrease); virtual void UnsuppressEventHandlingAndFireEvents(bool aFireEvents); void DecreaseEventSuppression() {
--- a/content/base/src/nsGenericDOMDataNode.cpp +++ b/content/base/src/nsGenericDOMDataNode.cpp @@ -923,17 +923,16 @@ nsGenericDOMDataNode::DoGetClasses() con } NS_IMETHODIMP nsGenericDOMDataNode::WalkContentStyleRules(nsRuleWalker* aRuleWalker) { return NS_OK; } -#ifdef MOZ_SMIL nsIDOMCSSStyleDeclaration* nsGenericDOMDataNode::GetSMILOverrideStyle() { return nsnull; } css::StyleRule* nsGenericDOMDataNode::GetSMILOverrideStyleRule() @@ -943,17 +942,16 @@ nsGenericDOMDataNode::GetSMILOverrideSty nsresult nsGenericDOMDataNode::SetSMILOverrideStyleRule(css::StyleRule* aStyleRule, bool aNotify) { NS_NOTREACHED("How come we're setting SMILOverrideStyle on a non-element?"); return NS_ERROR_UNEXPECTED; } -#endif // MOZ_SMIL css::StyleRule* nsGenericDOMDataNode::GetInlineStyleRule() { return nsnull; } NS_IMETHODIMP
--- a/content/base/src/nsGenericDOMDataNode.h +++ b/content/base/src/nsGenericDOMDataNode.h @@ -47,19 +47,17 @@ #include "nsTextFragment.h" #include "nsDOMError.h" #include "nsEventListenerManager.h" #include "nsGenericElement.h" #include "nsCycleCollectionParticipant.h" #include "nsDOMMemoryReporter.h" -#ifdef MOZ_SMIL #include "nsISMILAttr.h" -#endif // MOZ_SMIL // This bit is set to indicate that if the text node changes to // non-whitespace, we may need to create a frame for it. This bit must // not be set on nodes that already have a frame. #define NS_CREATE_FRAME_IF_NON_WHITESPACE (1 << NODE_TYPE_SPECIFIC_BITS_OFFSET) // This bit is set to indicate that if the text node changes to // whitespace, we may need to reframe it (or its ancestors). @@ -223,26 +221,24 @@ public: } virtual nsresult AppendText(const PRUnichar* aBuffer, PRUint32 aLength, bool aNotify); virtual bool TextIsOnlyWhitespace(); virtual void AppendTextTo(nsAString& aResult); virtual void DestroyContent(); virtual void SaveSubtreeState(); -#ifdef MOZ_SMIL virtual nsISMILAttr* GetAnimatedAttr(PRInt32 /*aNamespaceID*/, nsIAtom* /*aName*/) { return nsnull; } virtual nsIDOMCSSStyleDeclaration* GetSMILOverrideStyle(); virtual mozilla::css::StyleRule* GetSMILOverrideStyleRule(); virtual nsresult SetSMILOverrideStyleRule(mozilla::css::StyleRule* aStyleRule, bool aNotify); -#endif // MOZ_SMIL #ifdef DEBUG virtual void List(FILE* out, PRInt32 aIndent) const; virtual void DumpContent(FILE* out, PRInt32 aIndent, bool aDumpAll) const; #endif virtual nsIContent *GetBindingParent() const; virtual bool IsNodeOfType(PRUint32 aFlags) const;
--- a/content/base/src/nsGenericElement.cpp +++ b/content/base/src/nsGenericElement.cpp @@ -2288,20 +2288,18 @@ nsGenericElement::nsDOMSlots::~nsDOMSlot } void nsGenericElement::nsDOMSlots::Traverse(nsCycleCollectionTraversalCallback &cb, bool aIsXUL) { NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mSlots->mStyle"); cb.NoteXPCOMChild(mStyle.get()); -#ifdef MOZ_SMIL NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mSlots->mSMILOverrideStyle"); cb.NoteXPCOMChild(mSMILOverrideStyle.get()); -#endif // MOZ_SMIL NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mSlots->mAttributeMap"); cb.NoteXPCOMChild(mAttributeMap.get()); if (aIsXUL) { NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mSlots->mControllers"); cb.NoteXPCOMChild(mControllers); } @@ -2309,19 +2307,17 @@ nsGenericElement::nsDOMSlots::Traverse(n NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mSlots->mChildrenList"); cb.NoteXPCOMChild(NS_ISUPPORTS_CAST(nsIDOMNodeList*, mChildrenList)); } void nsGenericElement::nsDOMSlots::Unlink(bool aIsXUL) { mStyle = nsnull; -#ifdef MOZ_SMIL mSMILOverrideStyle = nsnull; -#endif // MOZ_SMIL if (mAttributeMap) { mAttributeMap->DropReference(); mAttributeMap = nsnull; } if (aIsXUL) NS_IF_RELEASE(mControllers); mChildrenList = nsnull; } @@ -2451,23 +2447,21 @@ nsGenericElement::InternalIsSupported(ns PL_strcasecmp(f, "SVGZoomEvents") == 0 || nsSVGFeatures::HaveFeature(aObject, aFeature)) { if (aVersion.IsEmpty() || PL_strcmp(v, "1.0") == 0 || PL_strcmp(v, "1.1") == 0) { *aReturn = true; } } -#ifdef MOZ_SMIL else if (NS_SMILEnabled() && PL_strcasecmp(f, "TimeControl") == 0) { if (aVersion.IsEmpty() || PL_strcmp(v, "1.0") == 0) { *aReturn = true; } } -#endif /* MOZ_SMIL */ return NS_OK; } NS_IMETHODIMP nsGenericElement::IsSupported(const nsAString& aFeature, const nsAString& aVersion, bool* aReturn) @@ -3350,17 +3344,16 @@ nsGenericElement::DoGetClasses() const } NS_IMETHODIMP nsGenericElement::WalkContentStyleRules(nsRuleWalker* aRuleWalker) { return NS_OK; } -#ifdef MOZ_SMIL nsIDOMCSSStyleDeclaration* nsGenericElement::GetSMILOverrideStyle() { nsGenericElement::nsDOMSlots *slots = DOMSlots(); if (!slots->mSMILOverrideStyle) { slots->mSMILOverrideStyle = new nsDOMCSSAttributeDeclaration(this, true); } @@ -3393,17 +3386,16 @@ nsGenericElement::SetSMILOverrideStyleRu if (shell) { shell->RestyleForAnimation(this, eRestyle_Self); } } } return NS_OK; } -#endif // MOZ_SMIL css::StyleRule* nsGenericElement::GetInlineStyleRule() { return nsnull; } NS_IMETHODIMP
--- a/content/base/src/nsGenericElement.h +++ b/content/base/src/nsGenericElement.h @@ -62,19 +62,17 @@ #include "nsIDOMXPathNSResolver.h" #include "nsPresContext.h" #include "nsIDOMDOMStringMap.h" #include "nsContentList.h" #include "nsDOMClassInfoID.h" // DOMCI_DATA #include "nsIDOMTouchEvent.h" #include "nsIInlineEventHandlers.h" -#ifdef MOZ_SMIL #include "nsISMILAttr.h" -#endif // MOZ_SMIL class nsIDOMAttr; class nsIDOMEventListener; class nsIFrame; class nsIDOMNamedNodeMap; class nsICSSDeclaration; class nsIDOMCSSStyleDeclaration; class nsIURI; @@ -344,26 +342,24 @@ public: virtual bool IsLink(nsIURI** aURI) const; virtual PRUint32 GetScriptTypeID() const; NS_IMETHOD SetScriptTypeID(PRUint32 aLang); virtual void DestroyContent(); virtual void SaveSubtreeState(); -#ifdef MOZ_SMIL virtual nsISMILAttr* GetAnimatedAttr(PRInt32 /*aNamespaceID*/, nsIAtom* /*aName*/) { return nsnull; } virtual nsIDOMCSSStyleDeclaration* GetSMILOverrideStyle(); virtual mozilla::css::StyleRule* GetSMILOverrideStyleRule(); virtual nsresult SetSMILOverrideStyleRule(mozilla::css::StyleRule* aStyleRule, bool aNotify); -#endif // MOZ_SMIL #ifdef DEBUG virtual void List(FILE* out, PRInt32 aIndent) const { List(out, aIndent, EmptyCString()); } virtual void DumpContent(FILE* out, PRInt32 aIndent, bool aDumpAll) const; void List(FILE* out, PRInt32 aIndent, const nsCString& aPrefix) const;
--- a/content/base/src/nsGkAtomList.h +++ b/content/base/src/nsGkAtomList.h @@ -1363,17 +1363,16 @@ GK_ATOM(xChannelSelector, "xChannelSelec GK_ATOM(xor_, "xor") GK_ATOM(y, "y") GK_ATOM(y1, "y1") GK_ATOM(y2, "y2") GK_ATOM(yChannelSelector, "yChannelSelector") GK_ATOM(z, "z") GK_ATOM(zoomAndPan, "zoomAndPan") -#ifdef MOZ_SMIL GK_ATOM(accumulate, "accumulate") GK_ATOM(additive, "additive") GK_ATOM(attributeName, "attributeName") GK_ATOM(attributeType, "attributeType") GK_ATOM(auto_reverse, "auto-reverse") GK_ATOM(begin, "begin") GK_ATOM(by, "by") GK_ATOM(calcMode, "calcMode") @@ -1390,17 +1389,16 @@ GK_ATOM(onendEvent, "onendEvent") GK_ATOM(onrepeat, "onrepeat") GK_ATOM(onrepeatEvent, "onrepeatEvent") GK_ATOM(repeatCount, "repeatCount") GK_ATOM(repeatDur, "repeatDur") GK_ATOM(repeatEvent, "repeatEvent") GK_ATOM(restart, "restart") GK_ATOM(to, "to") GK_ATOM(XML, "XML") -#endif // internal MathML attributes: different from columnalign_, columnlines_, // fontstyle_, rowalign_ and rowlines_ GK_ATOM(_moz_math_columnalign_, "_moz-math-columnalign") GK_ATOM(_moz_math_columnline_, "_moz-math-columnline") GK_ATOM(_moz_math_fontstyle_, "_moz-math-font-style") GK_ATOM(_moz_math_rowalign_, "_moz-math-rowalign") GK_ATOM(_moz_math_rowline_, "_moz-math-rowline")
--- a/content/base/src/nsStyledElement.cpp +++ b/content/base/src/nsStyledElement.cpp @@ -266,21 +266,17 @@ nsStyledElementNotElementCSSInlineStyle: } nsGenericElement::nsDOMSlots *slots = DOMSlots(); if (!slots->mStyle) { // Just in case... ReparseStyleAttribute(true); - slots->mStyle = new nsDOMCSSAttributeDeclaration(this -#ifdef MOZ_SMIL - , false -#endif // MOZ_SMIL - ); + slots->mStyle = new nsDOMCSSAttributeDeclaration(this, false); SetMayHaveStyle(); } *retval = NS_OK; return slots->mStyle; } nsresult
--- a/content/base/src/nsTreeSanitizer.cpp +++ b/content/base/src/nsTreeSanitizer.cpp @@ -318,17 +318,16 @@ nsIAtom** const kURLAttributesHTML[] = { &nsGkAtoms::src, &nsGkAtoms::longdesc, &nsGkAtoms::cite, &nsGkAtoms::background, nsnull }; nsIAtom** const kElementsSVG[] = { -#ifdef MOZ_SVG &nsGkAtoms::a, // a &nsGkAtoms::altGlyph, // altGlyph &nsGkAtoms::altGlyphDef, // altGlyphDef &nsGkAtoms::altGlyphItem, // altGlyphItem &nsGkAtoms::animate, // animate &nsGkAtoms::animateColor, // animateColor &nsGkAtoms::animateMotion, // animateMotion &nsGkAtoms::animateTransform, // animateTransform @@ -402,49 +401,39 @@ nsIAtom** const kElementsSVG[] = { &nsGkAtoms::text, // text &nsGkAtoms::textPath, // textPath &nsGkAtoms::title, // title &nsGkAtoms::tref, // tref &nsGkAtoms::tspan, // tspan &nsGkAtoms::use, // use &nsGkAtoms::view, // view &nsGkAtoms::vkern, // vkern -#endif nsnull }; nsIAtom** const kAttributesSVG[] = { -#ifdef MOZ_SVG // accent-height -#ifdef MOZ_SMIL &nsGkAtoms::accumulate, // accumulate &nsGkAtoms::additive, // additive -#endif &nsGkAtoms::alignment_baseline, // alignment-baseline // alphabetic &nsGkAtoms::amplitude, // amplitude // arabic-form // ascent -#ifdef MOZ_SMIL &nsGkAtoms::attributeName, // attributeName &nsGkAtoms::attributeType, // attributeType -#endif &nsGkAtoms::azimuth, // azimuth &nsGkAtoms::baseFrequency, // baseFrequency &nsGkAtoms::baseline_shift, // baseline-shift // baseProfile // bbox -#ifdef MOZ_SMIL &nsGkAtoms::begin, // begin -#endif &nsGkAtoms::bias, // bias -#ifdef MOZ_SMIL &nsGkAtoms::by, // by &nsGkAtoms::calcMode, // calcMode -#endif // cap-height &nsGkAtoms::_class, // class &nsGkAtoms::clip_path, // clip-path &nsGkAtoms::clip_rule, // clip-rule &nsGkAtoms::clipPathUnits, // clipPathUnits &nsGkAtoms::color, // color &nsGkAtoms::colorInterpolation, // color-interpolation &nsGkAtoms::colorInterpolationFilters, // color-interpolation-filters @@ -455,27 +444,23 @@ nsIAtom** const kAttributesSVG[] = { &nsGkAtoms::cy, // cy &nsGkAtoms::d, // d // descent &nsGkAtoms::diffuseConstant, // diffuseConstant &nsGkAtoms::direction, // direction &nsGkAtoms::display, // display &nsGkAtoms::divisor, // divisor &nsGkAtoms::dominant_baseline, // dominant-baseline -#ifdef MOZ_SMIL &nsGkAtoms::dur, // dur -#endif &nsGkAtoms::dx, // dx &nsGkAtoms::dy, // dy &nsGkAtoms::edgeMode, // edgeMode &nsGkAtoms::elevation, // elevation // enable-background -#ifdef MOZ_SMIL &nsGkAtoms::end, // end -#endif &nsGkAtoms::fill, // fill &nsGkAtoms::fill_opacity, // fill-opacity &nsGkAtoms::fill_rule, // fill-rule &nsGkAtoms::filter, // filter &nsGkAtoms::filterRes, // filterRes &nsGkAtoms::filterUnits, // filterUnits &nsGkAtoms::flood_color, // flood-color &nsGkAtoms::flood_opacity, // flood-opacity @@ -513,21 +498,19 @@ nsIAtom** const kAttributesSVG[] = { // k &nsGkAtoms::k1, // k1 &nsGkAtoms::k2, // k2 &nsGkAtoms::k3, // k3 &nsGkAtoms::k4, // k4 &nsGkAtoms::kerning, // kerning &nsGkAtoms::kernelMatrix, // kernelMatrix &nsGkAtoms::kernelUnitLength, // kernelUnitLength -#ifdef MOZ_SMIL &nsGkAtoms::keyPoints, // keyPoints &nsGkAtoms::keySplines, // keySplines &nsGkAtoms::keyTimes, // keyTimes -#endif &nsGkAtoms::lang, // lang // lengthAdjust &nsGkAtoms::letter_spacing, // letter-spacing &nsGkAtoms::lighting_color, // lighting-color &nsGkAtoms::limitingConeAngle, // limitingConeAngle // local &nsGkAtoms::marker, // marker &nsGkAtoms::marker_end, // marker-end @@ -570,25 +553,21 @@ nsIAtom** const kAttributesSVG[] = { &nsGkAtoms::pointsAtZ, // pointsAtZ &nsGkAtoms::preserveAlpha, // preserveAlpha &nsGkAtoms::preserveAspectRatio, // preserveAspectRatio &nsGkAtoms::primitiveUnits, // primitiveUnits &nsGkAtoms::r, // r &nsGkAtoms::radius, // radius &nsGkAtoms::refX, // refX &nsGkAtoms::refY, // refY -#ifdef MOZ_SMIL &nsGkAtoms::repeatCount, // repeatCount &nsGkAtoms::repeatDur, // repeatDur -#endif &nsGkAtoms::requiredExtensions, // requiredExtensions &nsGkAtoms::requiredFeatures, // requiredFeatures -#ifdef MOZ_SMIL &nsGkAtoms::restart, // restart -#endif &nsGkAtoms::result, // result &nsGkAtoms::rotate, // rotate &nsGkAtoms::rx, // rx &nsGkAtoms::ry, // ry &nsGkAtoms::scale, // scale &nsGkAtoms::seed, // seed &nsGkAtoms::shape_rendering, // shape-rendering &nsGkAtoms::slope, // slope @@ -620,19 +599,17 @@ nsIAtom** const kAttributesSVG[] = { &nsGkAtoms::target, // target &nsGkAtoms::targetX, // targetX &nsGkAtoms::targetY, // targetY &nsGkAtoms::text_anchor, // text-anchor &nsGkAtoms::text_decoration, // text-decoration // textLength &nsGkAtoms::text_rendering, // text-rendering &nsGkAtoms::title, // title -#ifdef MOZ_SMIL &nsGkAtoms::to, // to -#endif &nsGkAtoms::transform, // transform &nsGkAtoms::type, // type // u1 // u2 // underline-position // underline-thickness // unicode &nsGkAtoms::unicode_bidi, // unicode-bidi @@ -659,17 +636,16 @@ nsIAtom** const kAttributesSVG[] = { &nsGkAtoms::x2, // x2 &nsGkAtoms::xChannelSelector, // xChannelSelector &nsGkAtoms::y, // y &nsGkAtoms::y1, // y1 &nsGkAtoms::y2, // y2 &nsGkAtoms::yChannelSelector, // yChannelSelector &nsGkAtoms::z, // z &nsGkAtoms::zoomAndPan, // zoomAndPan -#endif nsnull }; nsIAtom** const kURLAttributesSVG[] = { nsnull }; nsIAtom** const kElementsMathML[] = {
--- a/content/events/public/nsEventNameList.h +++ b/content/events/public/nsEventNameList.h @@ -643,17 +643,16 @@ NON_IDL_EVENT(SVGZoom, NS_SVG_ZOOM, EventNameType_None, NS_SVGZOOM_EVENT) // This is a bit hackish, but SVG's event names are weird. NON_IDL_EVENT(zoom, NS_SVG_ZOOM, EventNameType_SVGSVG, NS_EVENT_NULL) -#ifdef MOZ_SMIL NON_IDL_EVENT(begin, NS_SMIL_BEGIN, EventNameType_SMIL, NS_EVENT_NULL) NON_IDL_EVENT(beginEvent, NS_SMIL_BEGIN, EventNameType_None, NS_SMIL_TIME_EVENT) @@ -668,17 +667,16 @@ NON_IDL_EVENT(endEvent, NON_IDL_EVENT(repeat, NS_SMIL_REPEAT, EventNameType_SMIL, NS_EVENT_NULL) NON_IDL_EVENT(repeatEvent, NS_SMIL_REPEAT, EventNameType_None, NS_SMIL_TIME_EVENT) -#endif // MOZ_SMIL NON_IDL_EVENT(MozAudioAvailable, NS_MOZAUDIOAVAILABLE, EventNameType_None, NS_EVENT_NULL) NON_IDL_EVENT(MozAfterPaint, NS_AFTERPAINT, EventNameType_None,
--- a/content/events/public/nsIPrivateDOMEvent.h +++ b/content/events/public/nsIPrivateDOMEvent.h @@ -100,20 +100,18 @@ NS_NewDOMTextEvent(nsIDOMEvent** aResult nsresult NS_NewDOMBeforeUnloadEvent(nsIDOMEvent** aResult, nsPresContext* aPresContext, nsEvent* aEvent); nsresult NS_NewDOMPageTransitionEvent(nsIDOMEvent** aResult, nsPresContext* aPresContext, nsEvent* aEvent); nsresult NS_NewDOMSVGEvent(nsIDOMEvent** aResult, nsPresContext* aPresContext, class nsEvent* aEvent); nsresult NS_NewDOMSVGZoomEvent(nsIDOMEvent** aResult, nsPresContext* aPresContext, class nsGUIEvent* aEvent); -#ifdef MOZ_SMIL nsresult NS_NewDOMTimeEvent(nsIDOMEvent** aResult, nsPresContext* aPresContext, class nsEvent* aEvent); -#endif // MOZ_SMIL nsresult NS_NewDOMXULCommandEvent(nsIDOMEvent** aResult, nsPresContext* aPresContext, class nsInputEvent* aEvent); nsresult NS_NewDOMCommandEvent(nsIDOMEvent** aInstancePtrResult, nsPresContext* aPresContext, nsCommandEvent* aEvent); nsresult NS_NewDOMMessageEvent(nsIDOMEvent** aInstancePtrResult, nsPresContext* aPresContext, class nsEvent* aEvent); nsresult NS_NewDOMProgressEvent(nsIDOMEvent** aInstancePtrResult, nsPresContext* aPresContext, class nsEvent* aEvent);
--- a/content/events/src/nsDOMEvent.cpp +++ b/content/events/src/nsDOMEvent.cpp @@ -80,19 +80,17 @@ static const char* const sEventNames[] = "DOMSubtreeModified", "DOMNodeInserted", "DOMNodeRemoved", "DOMNodeRemovedFromDocument", "DOMNodeInsertedIntoDocument", "DOMAttrModified", "DOMCharacterDataModified", "DOMActivate", "DOMFocusIn", "DOMFocusOut", "pageshow", "pagehide", "DOMMouseScroll", "MozMousePixelScroll", "offline", "online", "copy", "cut", "paste", "open", "message", "show", "SVGLoad", "SVGUnload", "SVGAbort", "SVGError", "SVGResize", "SVGScroll", "SVGZoom", -#ifdef MOZ_SMIL "beginEvent", "endEvent", "repeatEvent", -#endif // MOZ_SMIL #ifdef MOZ_MEDIA "loadstart", "progress", "suspend", "emptied", "stalled", "play", "pause", "loadedmetadata", "loadeddata", "waiting", "playing", "canplay", "canplaythrough", "seeking", "seeked", "timeupdate", "ended", "ratechange", "durationchange", "volumechange", "MozAudioAvailable", #endif // MOZ_MEDIA "MozAfterPaint", "MozBeforePaint", @@ -799,25 +797,23 @@ NS_METHOD nsDOMEvent::DuplicatePrivateDa } case NS_SVGZOOM_EVENT: { newEvent = new nsGUIEvent(false, msg, nsnull); NS_ENSURE_TRUE(newEvent, NS_ERROR_OUT_OF_MEMORY); newEvent->eventStructType = NS_SVGZOOM_EVENT; break; } -#ifdef MOZ_SMIL case NS_SMIL_TIME_EVENT: { newEvent = new nsUIEvent(false, msg, 0); NS_ENSURE_TRUE(newEvent, NS_ERROR_OUT_OF_MEMORY); newEvent->eventStructType = NS_SMIL_TIME_EVENT; break; } -#endif // MOZ_SMIL case NS_SIMPLE_GESTURE_EVENT: { nsSimpleGestureEvent* oldSimpleGestureEvent = static_cast<nsSimpleGestureEvent*>(mEvent); nsSimpleGestureEvent* simpleGestureEvent = new nsSimpleGestureEvent(false, msg, nsnull, 0, 0.0); NS_ENSURE_TRUE(simpleGestureEvent, NS_ERROR_OUT_OF_MEMORY); isInputEvent = true; simpleGestureEvent->direction = oldSimpleGestureEvent->direction; @@ -1290,24 +1286,22 @@ const char* nsDOMEvent::GetEventName(PRU case NS_SVG_ERROR: return sEventNames[eDOMEvents_SVGError]; case NS_SVG_RESIZE: return sEventNames[eDOMEvents_SVGResize]; case NS_SVG_SCROLL: return sEventNames[eDOMEvents_SVGScroll]; case NS_SVG_ZOOM: return sEventNames[eDOMEvents_SVGZoom]; -#ifdef MOZ_SMIL case NS_SMIL_BEGIN: return sEventNames[eDOMEvents_beginEvent]; case NS_SMIL_END: return sEventNames[eDOMEvents_endEvent]; case NS_SMIL_REPEAT: return sEventNames[eDOMEvents_repeatEvent]; -#endif // MOZ_SMIL #ifdef MOZ_MEDIA case NS_LOADSTART: return sEventNames[eDOMEvents_loadstart]; case NS_PROGRESS: return sEventNames[eDOMEvents_progress]; case NS_SUSPEND: return sEventNames[eDOMEvents_suspend]; case NS_EMPTIED:
--- a/content/events/src/nsDOMEvent.h +++ b/content/events/src/nsDOMEvent.h @@ -144,21 +144,19 @@ public: eDOMEvents_show, eDOMEvents_SVGLoad, eDOMEvents_SVGUnload, eDOMEvents_SVGAbort, eDOMEvents_SVGError, eDOMEvents_SVGResize, eDOMEvents_SVGScroll, eDOMEvents_SVGZoom, -#ifdef MOZ_SMIL eDOMEvents_beginEvent, eDOMEvents_endEvent, eDOMEvents_repeatEvent, -#endif // MOZ_SMIL #ifdef MOZ_MEDIA eDOMEvents_loadstart, eDOMEvents_progress, eDOMEvents_suspend, eDOMEvents_emptied, eDOMEvents_stalled, eDOMEvents_play, eDOMEvents_pause,
--- a/content/events/src/nsEventDispatcher.cpp +++ b/content/events/src/nsEventDispatcher.cpp @@ -787,20 +787,18 @@ nsEventDispatcher::CreateEvent(nsPresCon return NS_NewDOMTextEvent(aDOMEvent, aPresContext, static_cast<nsTextEvent*>(aEvent)); case NS_SVG_EVENT: return NS_NewDOMSVGEvent(aDOMEvent, aPresContext, aEvent); case NS_SVGZOOM_EVENT: return NS_NewDOMSVGZoomEvent(aDOMEvent, aPresContext, static_cast<nsGUIEvent*>(aEvent)); -#ifdef MOZ_SMIL case NS_SMIL_TIME_EVENT: return NS_NewDOMTimeEvent(aDOMEvent, aPresContext, aEvent); -#endif // MOZ_SMIL case NS_COMMAND_EVENT: return NS_NewDOMCommandEvent(aDOMEvent, aPresContext, static_cast<nsCommandEvent*>(aEvent)); case NS_SIMPLE_GESTURE_EVENT: return NS_NewDOMSimpleGestureEvent(aDOMEvent, aPresContext, static_cast<nsSimpleGestureEvent*>(aEvent)); case NS_MOZTOUCH_EVENT: @@ -854,21 +852,19 @@ nsEventDispatcher::CreateEvent(nsPresCon aEventType.LowerCaseEqualsLiteral("htmlevents")) return NS_NewDOMEvent(aDOMEvent, aPresContext, nsnull); if (aEventType.LowerCaseEqualsLiteral("svgevent") || aEventType.LowerCaseEqualsLiteral("svgevents")) return NS_NewDOMSVGEvent(aDOMEvent, aPresContext, nsnull); if (aEventType.LowerCaseEqualsLiteral("svgzoomevent") || aEventType.LowerCaseEqualsLiteral("svgzoomevents")) return NS_NewDOMSVGZoomEvent(aDOMEvent, aPresContext, nsnull); -#ifdef MOZ_SMIL if (aEventType.LowerCaseEqualsLiteral("timeevent") || aEventType.LowerCaseEqualsLiteral("timeevents")) return NS_NewDOMTimeEvent(aDOMEvent, aPresContext, nsnull); -#endif // MOZ_SMIL if (aEventType.LowerCaseEqualsLiteral("xulcommandevent") || aEventType.LowerCaseEqualsLiteral("xulcommandevents")) return NS_NewDOMXULCommandEvent(aDOMEvent, aPresContext, nsnull); if (aEventType.LowerCaseEqualsLiteral("commandevent") || aEventType.LowerCaseEqualsLiteral("commandevents")) return NS_NewDOMCommandEvent(aDOMEvent, aPresContext, nsnull); if (aEventType.LowerCaseEqualsLiteral("datacontainerevent") || aEventType.LowerCaseEqualsLiteral("datacontainerevents"))
--- a/content/events/src/nsEventListenerManager.cpp +++ b/content/events/src/nsEventListenerManager.cpp @@ -619,24 +619,22 @@ nsEventListenerManager::CompileEventHand else if (aListenerStruct->mTypeAtom == nsGkAtoms::onSVGError) attrName = nsGkAtoms::onerror; else if (aListenerStruct->mTypeAtom == nsGkAtoms::onSVGResize) attrName = nsGkAtoms::onresize; else if (aListenerStruct->mTypeAtom == nsGkAtoms::onSVGScroll) attrName = nsGkAtoms::onscroll; else if (aListenerStruct->mTypeAtom == nsGkAtoms::onSVGZoom) attrName = nsGkAtoms::onzoom; -#ifdef MOZ_SMIL else if (aListenerStruct->mTypeAtom == nsGkAtoms::onbeginEvent) attrName = nsGkAtoms::onbegin; else if (aListenerStruct->mTypeAtom == nsGkAtoms::onrepeatEvent) attrName = nsGkAtoms::onrepeat; else if (aListenerStruct->mTypeAtom == nsGkAtoms::onendEvent) attrName = nsGkAtoms::onend; -#endif // MOZ_SMIL content->GetAttr(kNameSpaceID_None, attrName, handlerBody); body = &handlerBody; } PRUint32 lineNo = 0; nsCAutoString url (NS_LITERAL_CSTRING("-moz-evil:lying-event-listener")); nsCOMPtr<nsIDocument> doc;
--- a/content/smil/Makefile.in +++ b/content/smil/Makefile.in @@ -41,76 +41,67 @@ srcdir = @srcdir@ VPATH = @srcdir@ include $(DEPTH)/config/autoconf.mk MODULE = content LIBRARY_NAME = gkconsmil_s LIBXUL_LIBRARY = 1 +EXPORTS = \ + nsISMILAnimationElement.h \ + nsISMILAttr.h \ + nsISMILType.h \ + nsSMILAnimationController.h \ + nsSMILCompositorTable.h \ + nsSMILCSSProperty.h \ + nsSMILKeySpline.h \ + nsSMILMappedAttribute.h \ + nsSMILMilestone.h \ + nsSMILTimeContainer.h \ + nsSMILTypes.h \ + $(NULL) -# nsSMILKeySpline is used by CSS transitions -- need to build it regardless -# of whether SMIL is enabled. -CPPSRCS = nsSMILKeySpline.cpp -EXPORTS = nsSMILKeySpline.h - -ifdef MOZ_SMIL -CPPSRCS += \ +CPPSRCS = \ nsDOMTimeEvent.cpp \ nsSMILAnimationController.cpp \ nsSMILAnimationFunction.cpp \ nsSMILCompositor.cpp \ nsSMILCSSProperty.cpp \ nsSMILCSSValueType.cpp \ nsSMILFloatType.cpp \ nsSMILInstanceTime.cpp \ nsSMILInterval.cpp \ + nsSMILKeySpline.cpp \ nsSMILMappedAttribute.cpp \ nsSMILNullType.cpp \ nsSMILParserUtils.cpp \ nsSMILRepeatCount.cpp \ nsSMILSetAnimationFunction.cpp \ nsSMILTimeContainer.cpp \ nsSMILTimedElement.cpp \ nsSMILTimeValue.cpp \ nsSMILTimeValueSpec.cpp \ nsSMILValue.cpp \ SMILBoolType.cpp \ SMILEnumType.cpp \ SMILIntegerType.cpp \ SMILStringType.cpp \ - $(NULL) -endif + $(NULL) include $(topsrcdir)/config/config.mk # we don't want the shared lib, but we want to force the creation of a static lib. FORCE_STATIC_LIB = 1 -ifdef MOZ_SMIL ifdef ENABLE_TESTS TOOL_DIRS += test endif # ENABLE_TESTS -EXPORTS += \ - nsISMILAnimationElement.h \ - nsISMILAttr.h \ - nsISMILType.h \ - nsSMILAnimationController.h \ - nsSMILCompositorTable.h \ - nsSMILCSSProperty.h \ - nsSMILKeySpline.h \ - nsSMILMappedAttribute.h \ - nsSMILMilestone.h \ - nsSMILTimeContainer.h \ - nsSMILTypes.h \ - $(NULL) - INCLUDES += \ -I$(srcdir)/../base/src \ -I$(srcdir)/../../layout/style \ -I$(srcdir)/../events/src \ $(NULL) -endif # MOZ_SMIL include $(topsrcdir)/config/rules.mk DEFINES += -D_IMPL_NS_LAYOUT
--- a/content/svg/content/src/DOMSVGLength.cpp +++ b/content/svg/content/src/DOMSVGLength.cpp @@ -106,33 +106,29 @@ DOMSVGLength::DOMSVGLength() , mUnit(nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER) , mValue(0.0f) { } NS_IMETHODIMP DOMSVGLength::GetUnitType(PRUint16* aUnit) { -#ifdef MOZ_SMIL if (mIsAnimValItem && HasOwner()) { Element()->FlushAnimations(); // May make HasOwner() == false } -#endif *aUnit = HasOwner() ? InternalItem().GetUnit() : mUnit; return NS_OK; } NS_IMETHODIMP DOMSVGLength::GetValue(float* aValue) { -#ifdef MOZ_SMIL if (mIsAnimValItem && HasOwner()) { Element()->FlushAnimations(); // May make HasOwner() == false } -#endif if (HasOwner()) { *aValue = InternalItem().GetValueInUserUnits(Element(), Axis()); if (NS_finite(*aValue)) { return NS_OK; } } else if (mUnit == nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER || mUnit == nsIDOMSVGLength::SVG_LENGTHTYPE_PX) { *aValue = mValue; @@ -157,41 +153,37 @@ DOMSVGLength::SetValue(float aUserUnitVa // Although the value passed in is in user units, this method does not turn // this length into a user unit length. Instead it converts the user unit // value to this length's current unit and sets that, leaving this length's // unit as it is. if (HasOwner()) { if (InternalItem().SetFromUserUnitValue(aUserUnitValue, Element(), Axis())) { Element()->DidChangeLengthList(mAttrEnum, true); -#ifdef MOZ_SMIL if (mList->mAList->IsAnimating()) { Element()->AnimationNeedsResample(); } -#endif return NS_OK; } } else if (mUnit == nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER || mUnit == nsIDOMSVGLength::SVG_LENGTHTYPE_PX) { mValue = aUserUnitValue; return NS_OK; } // else [SVGWG issue] Can't convert user unit value to this length's unit // ReportToConsole return NS_ERROR_FAILURE; } NS_IMETHODIMP DOMSVGLength::GetValueInSpecifiedUnits(float* aValue) { -#ifdef MOZ_SMIL if (mIsAnimValItem && HasOwner()) { Element()->FlushAnimations(); // May make HasOwner() == false } -#endif *aValue = HasOwner() ? InternalItem().GetValueInCurrentUnits() : mValue; return NS_OK; } NS_IMETHODIMP DOMSVGLength::SetValueInSpecifiedUnits(float aValue) { if (mIsAnimValItem) { @@ -200,21 +192,19 @@ DOMSVGLength::SetValueInSpecifiedUnits(f if (!NS_finite(aValue)) { return NS_ERROR_ILLEGAL_VALUE; } if (HasOwner()) { InternalItem().SetValueInCurrentUnits(aValue); Element()->DidChangeLengthList(mAttrEnum, true); -#ifdef MOZ_SMIL if (mList->mAList->IsAnimating()) { Element()->AnimationNeedsResample(); } -#endif return NS_OK; } mValue = aValue; return NS_OK; } NS_IMETHODIMP DOMSVGLength::SetValueAsString(const nsAString& aValue) @@ -225,36 +215,32 @@ DOMSVGLength::SetValueAsString(const nsA SVGLength value; if (!value.SetValueFromString(aValue)) { return NS_ERROR_DOM_SYNTAX_ERR; } if (HasOwner()) { InternalItem() = value; Element()->DidChangeLengthList(mAttrEnum, true); -#ifdef MOZ_SMIL if (mList->mAList->IsAnimating()) { Element()->AnimationNeedsResample(); } -#endif return NS_OK; } mValue = value.GetValueInCurrentUnits(); mUnit = value.GetUnit(); return NS_OK; } NS_IMETHODIMP DOMSVGLength::GetValueAsString(nsAString& aValue) { -#ifdef MOZ_SMIL if (mIsAnimValItem && HasOwner()) { Element()->FlushAnimations(); // May make HasOwner() == false } -#endif if (HasOwner()) { InternalItem().GetValueAsString(aValue); return NS_OK; } SVGLength(mValue, mUnit).GetValueAsString(aValue); return NS_OK; } @@ -270,21 +256,19 @@ DOMSVGLength::NewValueSpecifiedUnits(PRU } if (!SVGLength::IsValidUnitType(aUnit)) { return NS_ERROR_DOM_NOT_SUPPORTED_ERR; } if (HasOwner()) { InternalItem().SetValueAndUnit(aValue, PRUint8(aUnit)); Element()->DidChangeLengthList(mAttrEnum, true); -#ifdef MOZ_SMIL if (mList->mAList->IsAnimating()) { Element()->AnimationNeedsResample(); } -#endif return NS_OK; } mUnit = PRUint8(aUnit); mValue = aValue; return NS_OK; } NS_IMETHODIMP
--- a/content/svg/content/src/DOMSVGLengthList.cpp +++ b/content/svg/content/src/DOMSVGLengthList.cpp @@ -90,21 +90,19 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION( NS_INTERFACE_MAP_ENTRY(nsISupports) NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGLengthList) NS_INTERFACE_MAP_END nsIDOMSVGLength* DOMSVGLengthList::GetItemWithoutAddRef(PRUint32 aIndex) { -#ifdef MOZ_SMIL if (IsAnimValList()) { Element()->FlushAnimations(); } -#endif if (aIndex < Length()) { EnsureItemAt(aIndex); return mItems[aIndex]; } return nsnull; } void @@ -153,21 +151,19 @@ DOMSVGLengthList::InternalList() } // ---------------------------------------------------------------------------- // nsIDOMSVGLengthList implementation: NS_IMETHODIMP DOMSVGLengthList::GetNumberOfItems(PRUint32 *aNumberOfItems) { -#ifdef MOZ_SMIL if (IsAnimValList()) { Element()->FlushAnimations(); } -#endif *aNumberOfItems = Length(); return NS_OK; } NS_IMETHODIMP DOMSVGLengthList::Clear() { if (IsAnimValList()) { @@ -178,21 +174,19 @@ DOMSVGLengthList::Clear() // Notify any existing DOM items of removal *before* truncating the lists // so that they can find their SVGLength internal counterparts and copy // their values. This also notifies the animVal list: mAList->InternalBaseValListWillChangeTo(SVGLengthList()); mItems.Clear(); InternalList().Clear(); Element()->DidChangeLengthList(AttrEnum(), true); -#ifdef MOZ_SMIL if (mAList->IsAnimating()) { Element()->AnimationNeedsResample(); } -#endif } return NS_OK; } NS_IMETHODIMP DOMSVGLengthList::Initialize(nsIDOMSVGLength *newItem, nsIDOMSVGLength **_retval) { @@ -271,21 +265,19 @@ DOMSVGLengthList::InsertItemBefore(nsIDO // This MUST come after the insertion into InternalList(), or else under the // insertion into InternalList() the values read from domItem would be bad // data from InternalList() itself!: domItem->InsertingIntoList(this, AttrEnum(), index, IsAnimValList()); UpdateListIndicesFromIndex(mItems, index + 1); Element()->DidChangeLengthList(AttrEnum(), true); -#ifdef MOZ_SMIL if (mAList->IsAnimating()) { Element()->AnimationNeedsResample(); } -#endif *_retval = domItem.forget().get(); return NS_OK; } NS_IMETHODIMP DOMSVGLengthList::ReplaceItem(nsIDOMSVGLength *newItem, PRUint32 index, nsIDOMSVGLength **_retval) @@ -315,21 +307,19 @@ DOMSVGLengthList::ReplaceItem(nsIDOMSVGL InternalList()[index] = domItem->ToSVGLength(); mItems[index] = domItem; // This MUST come after the ToSVGPoint() call, otherwise that call // would end up reading bad data from InternalList()! domItem->InsertingIntoList(this, AttrEnum(), index, IsAnimValList()); Element()->DidChangeLengthList(AttrEnum(), true); -#ifdef MOZ_SMIL if (mAList->IsAnimating()) { Element()->AnimationNeedsResample(); } -#endif NS_ADDREF(*_retval = domItem.get()); return NS_OK; } NS_IMETHODIMP DOMSVGLengthList::RemoveItem(PRUint32 index, nsIDOMSVGLength **_retval) { @@ -356,21 +346,19 @@ DOMSVGLengthList::RemoveItem(PRUint32 in NS_ADDREF(*_retval = mItems[index]); InternalList().RemoveItem(index); mItems.RemoveElementAt(index); UpdateListIndicesFromIndex(mItems, index); Element()->DidChangeLengthList(AttrEnum(), true); -#ifdef MOZ_SMIL if (mAList->IsAnimating()) { Element()->AnimationNeedsResample(); } -#endif return NS_OK; } NS_IMETHODIMP DOMSVGLengthList::AppendItem(nsIDOMSVGLength *newItem, nsIDOMSVGLength **_retval) { return InsertItemBefore(newItem, Length(), _retval);
--- a/content/svg/content/src/DOMSVGNumber.cpp +++ b/content/svg/content/src/DOMSVGNumber.cpp @@ -101,42 +101,38 @@ DOMSVGNumber::DOMSVGNumber() , mIsAnimValItem(false) , mValue(0.0f) { } NS_IMETHODIMP DOMSVGNumber::GetValue(float* aValue) { -#ifdef MOZ_SMIL if (mIsAnimValItem && HasOwner()) { Element()->FlushAnimations(); // May make HasOwner() == false } -#endif *aValue = HasOwner() ? InternalItem() : mValue; return NS_OK; } NS_IMETHODIMP DOMSVGNumber::SetValue(float aValue) { if (mIsAnimValItem) { return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR; } NS_ENSURE_FINITE(aValue, NS_ERROR_ILLEGAL_VALUE); if (HasOwner()) { InternalItem() = aValue; Element()->DidChangeNumberList(mAttrEnum, true); -#ifdef MOZ_SMIL if (mList->mAList->IsAnimating()) { Element()->AnimationNeedsResample(); } -#endif return NS_OK; } mValue = aValue; return NS_OK; } void DOMSVGNumber::InsertingIntoList(DOMSVGNumberList *aList,
--- a/content/svg/content/src/DOMSVGNumberList.cpp +++ b/content/svg/content/src/DOMSVGNumberList.cpp @@ -90,21 +90,19 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION( NS_INTERFACE_MAP_ENTRY(nsISupports) NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGNumberList) NS_INTERFACE_MAP_END nsIDOMSVGNumber* DOMSVGNumberList::GetItemWithoutAddRef(PRUint32 aIndex) { -#ifdef MOZ_SMIL if (IsAnimValList()) { Element()->FlushAnimations(); } -#endif if (aIndex < Length()) { EnsureItemAt(aIndex); return mItems[aIndex]; } return nsnull; } void @@ -153,21 +151,19 @@ DOMSVGNumberList::InternalList() } // ---------------------------------------------------------------------------- // nsIDOMSVGNumberList implementation: NS_IMETHODIMP DOMSVGNumberList::GetNumberOfItems(PRUint32 *aNumberOfItems) { -#ifdef MOZ_SMIL if (IsAnimValList()) { Element()->FlushAnimations(); } -#endif *aNumberOfItems = Length(); return NS_OK; } NS_IMETHODIMP DOMSVGNumberList::Clear() { if (IsAnimValList()) { @@ -178,21 +174,19 @@ DOMSVGNumberList::Clear() // Notify any existing DOM items of removal *before* truncating the lists // so that they can find their SVGNumber internal counterparts and copy // their values. This also notifies the animVal list: mAList->InternalBaseValListWillChangeTo(SVGNumberList()); mItems.Clear(); InternalList().Clear(); Element()->DidChangeNumberList(AttrEnum(), true); -#ifdef MOZ_SMIL if (mAList->IsAnimating()) { Element()->AnimationNeedsResample(); } -#endif } return NS_OK; } NS_IMETHODIMP DOMSVGNumberList::Initialize(nsIDOMSVGNumber *newItem, nsIDOMSVGNumber **_retval) { @@ -271,21 +265,19 @@ DOMSVGNumberList::InsertItemBefore(nsIDO // This MUST come after the insertion into InternalList(), or else under the // insertion into InternalList() the values read from domItem would be bad // data from InternalList() itself!: domItem->InsertingIntoList(this, AttrEnum(), index, IsAnimValList()); UpdateListIndicesFromIndex(mItems, index + 1); Element()->DidChangeNumberList(AttrEnum(), true); -#ifdef MOZ_SMIL if (mAList->IsAnimating()) { Element()->AnimationNeedsResample(); } -#endif *_retval = domItem.forget().get(); return NS_OK; } NS_IMETHODIMP DOMSVGNumberList::ReplaceItem(nsIDOMSVGNumber *newItem, PRUint32 index, nsIDOMSVGNumber **_retval) @@ -315,21 +307,19 @@ DOMSVGNumberList::ReplaceItem(nsIDOMSVGN InternalList()[index] = domItem->ToSVGNumber(); mItems[index] = domItem; // This MUST come after the ToSVGPoint() call, otherwise that call // would end up reading bad data from InternalList()! domItem->InsertingIntoList(this, AttrEnum(), index, IsAnimValList()); Element()->DidChangeNumberList(AttrEnum(), true); -#ifdef MOZ_SMIL if (mAList->IsAnimating()) { Element()->AnimationNeedsResample(); } -#endif NS_ADDREF(*_retval = domItem.get()); return NS_OK; } NS_IMETHODIMP DOMSVGNumberList::RemoveItem(PRUint32 index, nsIDOMSVGNumber **_retval) { @@ -356,21 +346,19 @@ DOMSVGNumberList::RemoveItem(PRUint32 in NS_ADDREF(*_retval = mItems[index]); InternalList().RemoveItem(index); mItems.RemoveElementAt(index); UpdateListIndicesFromIndex(mItems, index); Element()->DidChangeNumberList(AttrEnum(), true); -#ifdef MOZ_SMIL if (mAList->IsAnimating()) { Element()->AnimationNeedsResample(); } -#endif return NS_OK; } NS_IMETHODIMP DOMSVGNumberList::AppendItem(nsIDOMSVGNumber *newItem, nsIDOMSVGNumber **_retval) { return InsertItemBefore(newItem, Length(), _retval);
--- a/content/svg/content/src/DOMSVGPathSegList.cpp +++ b/content/svg/content/src/DOMSVGPathSegList.cpp @@ -94,21 +94,19 @@ DOMSVGPathSegList::~DOMSVGPathSegList() InternalAList().GetAnimValKey() : InternalAList().GetBaseValKey(); sSVGPathSegListTearoffTable.RemoveTearoff(key); } nsIDOMSVGPathSeg* DOMSVGPathSegList::GetItemWithoutAddRef(PRUint32 aIndex) { -#ifdef MOZ_SMIL if (IsAnimValList()) { Element()->FlushAnimations(); } -#endif if (aIndex < Length()) { EnsureItemAt(aIndex); return ItemAt(aIndex); } return nsnull; } void @@ -250,21 +248,19 @@ DOMSVGPathSegList::InternalAList() } // ---------------------------------------------------------------------------- // nsIDOMSVGPathSegList implementation: NS_IMETHODIMP DOMSVGPathSegList::GetNumberOfItems(PRUint32 *aNumberOfItems) { -#ifdef MOZ_SMIL if (IsAnimValList()) { Element()->FlushAnimations(); } -#endif *aNumberOfItems = Length(); return NS_OK; } NS_IMETHODIMP DOMSVGPathSegList::Clear() { if (IsAnimValList()) { @@ -284,21 +280,19 @@ DOMSVGPathSegList::Clear() GetDOMWrapperIfExists(InternalAList().GetAnimValKey()); if (animList) { animList->InternalListWillChangeTo(SVGPathData()); // clears its mItems } } InternalList().Clear(); Element()->DidChangePathSegList(true); -#ifdef MOZ_SMIL if (AttrIsAnimating()) { Element()->AnimationNeedsResample(); } -#endif } return NS_OK; } NS_IMETHODIMP DOMSVGPathSegList::Initialize(nsIDOMSVGPathSeg *aNewItem, nsIDOMSVGPathSeg **_retval) { @@ -388,21 +382,19 @@ DOMSVGPathSegList::InsertItemBefore(nsID // This MUST come after the insertion into InternalList(), or else under the // insertion into InternalList() the values read from domItem would be bad // data from InternalList() itself!: domItem->InsertingIntoList(this, aIndex, IsAnimValList()); UpdateListIndicesFromIndex(aIndex + 1, argCount + 1); Element()->DidChangePathSegList(true); -#ifdef MOZ_SMIL if (AttrIsAnimating()) { Element()->AnimationNeedsResample(); } -#endif *_retval = domItem.forget().get(); return NS_OK; } NS_IMETHODIMP DOMSVGPathSegList::ReplaceItem(nsIDOMSVGPathSeg *aNewItem, PRUint32 aIndex, nsIDOMSVGPathSeg **_retval) @@ -454,21 +446,19 @@ DOMSVGPathSegList::ReplaceItem(nsIDOMSVG PRUint32 delta = newArgCount - oldArgCount; if (delta != 0) { for (PRUint32 i = aIndex + 1; i < Length(); ++i) { mItems[i].mInternalDataIndex += delta; } } Element()->DidChangePathSegList(true); -#ifdef MOZ_SMIL if (AttrIsAnimating()) { Element()->AnimationNeedsResample(); } -#endif NS_ADDREF(*_retval = domItem.get()); return NS_OK; } NS_IMETHODIMP DOMSVGPathSegList::RemoveItem(PRUint32 aIndex, nsIDOMSVGPathSeg **_retval) { @@ -498,21 +488,19 @@ DOMSVGPathSegList::RemoveItem(PRUint32 a MaybeRemoveItemFromAnimValListAt(aIndex, argCount); InternalList().mData.RemoveElementsAt(internalIndex, 1 + argCount); mItems.RemoveElementAt(aIndex); UpdateListIndicesFromIndex(aIndex, -(argCount + 1)); Element()->DidChangePathSegList(true); -#ifdef MOZ_SMIL if (AttrIsAnimating()) { Element()->AnimationNeedsResample(); } -#endif return NS_OK; } NS_IMETHODIMP DOMSVGPathSegList::AppendItem(nsIDOMSVGPathSeg *aNewItem, nsIDOMSVGPathSeg **_retval) { return InsertItemBefore(aNewItem, Length(), _retval);
--- a/content/svg/content/src/DOMSVGPoint.cpp +++ b/content/svg/content/src/DOMSVGPoint.cpp @@ -76,77 +76,69 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION( NS_INTERFACE_MAP_ENTRY(nsISupports) NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGPoint) NS_INTERFACE_MAP_END NS_IMETHODIMP DOMSVGPoint::GetX(float* aX) { -#ifdef MOZ_SMIL if (mIsAnimValItem && HasOwner()) { Element()->FlushAnimations(); // May make HasOwner() == false } -#endif *aX = HasOwner() ? InternalItem().mX : mPt.mX; return NS_OK; } NS_IMETHODIMP DOMSVGPoint::SetX(float aX) { if (mIsAnimValItem || mIsReadonly) { return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR; } NS_ENSURE_FINITE(aX, NS_ERROR_ILLEGAL_VALUE); if (HasOwner()) { InternalItem().mX = aX; Element()->DidChangePointList(true); -#ifdef MOZ_SMIL if (mList->AttrIsAnimating()) { Element()->AnimationNeedsResample(); } -#endif return NS_OK; } mPt.mX = aX; return NS_OK; } NS_IMETHODIMP DOMSVGPoint::GetY(float* aY) { -#ifdef MOZ_SMIL if (mIsAnimValItem && HasOwner()) { Element()->FlushAnimations(); // May make HasOwner() == false } -#endif *aY = HasOwner() ? InternalItem().mY : mPt.mY; return NS_OK; } NS_IMETHODIMP DOMSVGPoint::SetY(float aY) { if (mIsAnimValItem || mIsReadonly) { return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR; } NS_ENSURE_FINITE(aY, NS_ERROR_ILLEGAL_VALUE); if (HasOwner()) { InternalItem().mY = aY; Element()->DidChangePointList(true); -#ifdef MOZ_SMIL if (mList->AttrIsAnimating()) { Element()->AnimationNeedsResample(); } -#endif return NS_OK; } mPt.mY = aY; return NS_OK; } NS_IMETHODIMP DOMSVGPoint::MatrixTransform(nsIDOMSVGMatrix *matrix,
--- a/content/svg/content/src/DOMSVGPointList.cpp +++ b/content/svg/content/src/DOMSVGPointList.cpp @@ -114,21 +114,19 @@ DOMSVGPointList::~DOMSVGPointList() InternalAList().GetAnimValKey() : InternalAList().GetBaseValKey(); sSVGPointListTearoffTable.RemoveTearoff(key); } nsIDOMSVGPoint* DOMSVGPointList::GetItemWithoutAddRef(PRUint32 aIndex) { -#ifdef MOZ_SMIL if (IsAnimValList()) { Element()->FlushAnimations(); } -#endif if (aIndex < Length()) { EnsureItemAt(aIndex); return mItems[aIndex]; } return nsnull; } void @@ -195,21 +193,19 @@ DOMSVGPointList::InternalAList() } // ---------------------------------------------------------------------------- // nsIDOMSVGPointList implementation: NS_IMETHODIMP DOMSVGPointList::GetNumberOfItems(PRUint32 *aNumberOfItems) { -#ifdef MOZ_SMIL if (IsAnimValList()) { Element()->FlushAnimations(); } -#endif *aNumberOfItems = Length(); return NS_OK; } NS_IMETHODIMP DOMSVGPointList::Clear() { if (IsAnimValList()) { @@ -229,21 +225,19 @@ DOMSVGPointList::Clear() GetDOMWrapperIfExists(InternalAList().GetAnimValKey()); if (animList) { animList->InternalListWillChangeTo(SVGPointList()); // clears its mItems } } InternalList().Clear(); Element()->DidChangePointList(true); -#ifdef MOZ_SMIL if (AttrIsAnimating()) { Element()->AnimationNeedsResample(); } -#endif } return NS_OK; } NS_IMETHODIMP DOMSVGPointList::Initialize(nsIDOMSVGPoint *aNewItem, nsIDOMSVGPoint **_retval) { @@ -322,21 +316,19 @@ DOMSVGPointList::InsertItemBefore(nsIDOM // This MUST come after the insertion into InternalList(), or else under the // insertion into InternalList() the values read from domItem would be bad // data from InternalList() itself!: domItem->InsertingIntoList(this, aIndex, IsAnimValList()); UpdateListIndicesFromIndex(mItems, aIndex + 1); Element()->DidChangePointList(true); -#ifdef MOZ_SMIL if (AttrIsAnimating()) { Element()->AnimationNeedsResample(); } -#endif *_retval = domItem.forget().get(); return NS_OK; } NS_IMETHODIMP DOMSVGPointList::ReplaceItem(nsIDOMSVGPoint *aNewItem, PRUint32 aIndex, nsIDOMSVGPoint **_retval) @@ -366,21 +358,19 @@ DOMSVGPointList::ReplaceItem(nsIDOMSVGPo InternalList()[aIndex] = domItem->ToSVGPoint(); mItems[aIndex] = domItem; // This MUST come after the ToSVGPoint() call, otherwise that call // would end up reading bad data from InternalList()! domItem->InsertingIntoList(this, aIndex, IsAnimValList()); Element()->DidChangePointList(true); -#ifdef MOZ_SMIL if (AttrIsAnimating()) { Element()->AnimationNeedsResample(); } -#endif NS_ADDREF(*_retval = domItem.get()); return NS_OK; } NS_IMETHODIMP DOMSVGPointList::RemoveItem(PRUint32 aIndex, nsIDOMSVGPoint **_retval) { @@ -407,21 +397,19 @@ DOMSVGPointList::RemoveItem(PRUint32 aIn NS_ADDREF(*_retval = mItems[aIndex]); InternalList().RemoveItem(aIndex); mItems.RemoveElementAt(aIndex); UpdateListIndicesFromIndex(mItems, aIndex); Element()->DidChangePointList(true); -#ifdef MOZ_SMIL if (AttrIsAnimating()) { Element()->AnimationNeedsResample(); } -#endif return NS_OK; } NS_IMETHODIMP DOMSVGPointList::AppendItem(nsIDOMSVGPoint *aNewItem, nsIDOMSVGPoint **_retval) { return InsertItemBefore(aNewItem, Length(), _retval);
--- a/content/svg/content/src/DOMSVGTransform.cpp +++ b/content/svg/content/src/DOMSVGTransform.cpp @@ -340,17 +340,15 @@ DOMSVGTransform::ClearMatrixTearoff(DOMS //---------------------------------------------------------------------- // Implementation helpers void DOMSVGTransform::NotifyElementOfChange() { if (HasOwner()) { Element()->DidChangeTransformList(true); -#ifdef MOZ_SMIL if (mList->mAList->IsAnimating()) { Element()->AnimationNeedsResample(); } -#endif // MOZ_SMIL } } } // namespace mozilla
--- a/content/svg/content/src/DOMSVGTransformList.cpp +++ b/content/svg/content/src/DOMSVGTransformList.cpp @@ -92,21 +92,19 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION( NS_INTERFACE_MAP_END //---------------------------------------------------------------------- // DOMSVGTransformList methods: nsIDOMSVGTransform* DOMSVGTransformList::GetItemWithoutAddRef(PRUint32 aIndex) { -#ifdef MOZ_SMIL if (IsAnimValList()) { Element()->FlushAnimations(); } -#endif if (aIndex < Length()) { EnsureItemAt(aIndex); return mItems[aIndex]; } return nsnull; } void @@ -158,21 +156,19 @@ DOMSVGTransformList::InternalList() //---------------------------------------------------------------------- // nsIDOMSVGTransformList methods: /* readonly attribute unsigned long numberOfItems; */ NS_IMETHODIMP DOMSVGTransformList::GetNumberOfItems(PRUint32 *aNumberOfItems) { -#ifdef MOZ_SMIL if (IsAnimValList()) { Element()->FlushAnimations(); } -#endif *aNumberOfItems = Length(); return NS_OK; } /* readonly attribute unsigned long length; */ NS_IMETHODIMP DOMSVGTransformList::GetLength(PRUint32 *aLength) { @@ -191,21 +187,19 @@ DOMSVGTransformList::Clear() // Notify any existing DOM items of removal *before* truncating the lists // so that they can find their SVGTransform internal counterparts and copy // their values. This also notifies the animVal list: mAList->InternalBaseValListWillChangeLengthTo(0); mItems.Clear(); InternalList().Clear(); Element()->DidChangeTransformList(true); -#ifdef MOZ_SMIL if (mAList->IsAnimating()) { Element()->AnimationNeedsResample(); } -#endif } return NS_OK; } /* nsIDOMSVGTransform initialize (in nsIDOMSVGTransform newItem); */ NS_IMETHODIMP DOMSVGTransformList::Initialize(nsIDOMSVGTransform *newItem, nsIDOMSVGTransform **_retval) @@ -287,21 +281,19 @@ DOMSVGTransformList::InsertItemBefore(ns // This MUST come after the insertion into InternalList(), or else under the // insertion into InternalList() the values read from domItem would be bad // data from InternalList() itself!: domItem->InsertingIntoList(this, index, IsAnimValList()); UpdateListIndicesFromIndex(mItems, index + 1); Element()->DidChangeTransformList(true); -#ifdef MOZ_SMIL if (mAList->IsAnimating()) { Element()->AnimationNeedsResample(); } -#endif *_retval = domItem.forget().get(); return NS_OK; } /* nsIDOMSVGTransform replaceItem (in nsIDOMSVGTransform newItem, * in unsigned long index); */ NS_IMETHODIMP DOMSVGTransformList::ReplaceItem(nsIDOMSVGTransform *newItem, @@ -333,21 +325,19 @@ DOMSVGTransformList::ReplaceItem(nsIDOMS InternalList()[index] = domItem->ToSVGTransform(); mItems[index] = domItem; // This MUST come after the ToSVGPoint() call, otherwise that call // would end up reading bad data from InternalList()! domItem->InsertingIntoList(this, index, IsAnimValList()); Element()->DidChangeTransformList(true); -#ifdef MOZ_SMIL if (mAList->IsAnimating()) { Element()->AnimationNeedsResample(); } -#endif NS_ADDREF(*_retval = domItem.get()); return NS_OK; } /* nsIDOMSVGTransform removeItem (in unsigned long index); */ NS_IMETHODIMP DOMSVGTransformList::RemoveItem(PRUint32 index, nsIDOMSVGTransform **_retval) { @@ -374,21 +364,19 @@ DOMSVGTransformList::RemoveItem(PRUint32 NS_ADDREF(*_retval = mItems[index]); InternalList().RemoveItem(index); mItems.RemoveElementAt(index); UpdateListIndicesFromIndex(mItems, index); Element()->DidChangeTransformList(true); -#ifdef MOZ_SMIL if (mAList->IsAnimating()) { Element()->AnimationNeedsResample(); } -#endif return NS_OK; } /* nsIDOMSVGTransform appendItem (in nsIDOMSVGTransform newItem); */ NS_IMETHODIMP DOMSVGTransformList::AppendItem(nsIDOMSVGTransform *newItem, nsIDOMSVGTransform **_retval) {
--- a/content/svg/content/src/Makefile.in +++ b/content/svg/content/src/Makefile.in @@ -131,41 +131,37 @@ CPPSRCS = \ SVGLengthList.cpp \ SVGNumberList.cpp \ SVGPathData.cpp \ SVGPathSegUtils.cpp \ SVGPointList.cpp \ SVGTransform.cpp \ SVGTransformList.cpp \ SVGTransformListParser.cpp \ + nsSVGAnimateElement.cpp \ + nsSVGAnimateTransformElement.cpp \ + nsSVGAnimateMotionElement.cpp \ + nsSVGAnimationElement.cpp \ + nsSVGMpathElement.cpp \ + nsSVGSetElement.cpp \ + SVGIntegerPairSMILType.cpp \ + SVGLengthListSMILType.cpp \ + SVGMotionSMILType.cpp \ + SVGMotionSMILAttr.cpp \ + SVGMotionSMILAnimationFunction.cpp \ + SVGMotionSMILPathUtils.cpp \ + SVGNumberListSMILType.cpp \ + SVGNumberPairSMILType.cpp \ + SVGOrientSMILType.cpp \ + SVGPathSegListSMILType.cpp \ + SVGPointListSMILType.cpp \ + SVGTransformListSMILType.cpp \ + SVGViewBoxSMILType.cpp \ $(NULL) -ifdef MOZ_SMIL -CPPSRCS += nsSVGAnimateElement.cpp \ - nsSVGAnimateTransformElement.cpp \ - nsSVGAnimateMotionElement.cpp \ - nsSVGAnimationElement.cpp \ - nsSVGMpathElement.cpp \ - nsSVGSetElement.cpp \ - SVGIntegerPairSMILType.cpp \ - SVGLengthListSMILType.cpp \ - SVGMotionSMILType.cpp \ - SVGMotionSMILAttr.cpp \ - SVGMotionSMILAnimationFunction.cpp \ - SVGMotionSMILPathUtils.cpp \ - SVGNumberListSMILType.cpp \ - SVGNumberPairSMILType.cpp \ - SVGOrientSMILType.cpp \ - SVGPathSegListSMILType.cpp \ - SVGPointListSMILType.cpp \ - SVGTransformListSMILType.cpp \ - SVGViewBoxSMILType.cpp \ - $(NULL) -endif - include $(topsrcdir)/config/config.mk # we don't want the shared lib, but we want to force the creation of a static lib. FORCE_STATIC_LIB = 1 EXPORTS = \ nsSVGFeatures.h \ nsSVGRect.h \ @@ -181,17 +177,12 @@ INCLUDES += \ -I$(srcdir)/../../../base/src \ -I$(srcdir)/../../../../layout/generic \ -I$(srcdir)/../../../../layout/xul/base/src \ -I$(srcdir)/../../../../layout/svg/base/src \ -I$(srcdir)/../../../../layout/style \ -I$(srcdir)/../../../events/src \ -I$(srcdir)/../../../html/content/src \ -I$(topsrcdir)/content/xbl/src \ + -I$(srcdir)/../../../smil \ $(NULL) -ifdef MOZ_SMIL -INCLUDES += \ - -I$(srcdir)/../../../smil \ - $(NULL) -endif - DEFINES += -D_IMPL_NS_LAYOUT
--- a/content/svg/content/src/SVGAnimatedLengthList.cpp +++ b/content/svg/content/src/SVGAnimatedLengthList.cpp @@ -33,20 +33,18 @@ * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ #include "SVGAnimatedLengthList.h" #include "DOMSVGAnimatedLengthList.h" #include "nsSVGElement.h" #include "nsSVGAttrTearoffTable.h" -#ifdef MOZ_SMIL #include "nsSMILValue.h" #include "SVGLengthListSMILType.h" -#endif // MOZ_SMIL namespace mozilla { nsresult SVGAnimatedLengthList::SetBaseValueString(const nsAString& aValue) { SVGLengthList newBaseValue; nsresult rv = newBaseValue.SetValueFromString(aValue); @@ -144,17 +142,16 @@ SVGAnimatedLengthList::ClearAnimValue(ns // must do that before touching mAnimVal. See comments above. // domWrapper->InternalAnimValListWillChangeTo(mBaseVal); } mAnimVal = nsnull; aElement->DidAnimateLengthList(aAttrEnum); } -#ifdef MOZ_SMIL nsISMILAttr* SVGAnimatedLengthList::ToSMILAttr(nsSVGElement *aSVGElement, PRUint8 aAttrEnum, PRUint8 aAxis, bool aCanZeroPadList) { return new SMILAnimatedLengthList(this, aSVGElement, aAttrEnum, aAxis, aCanZeroPadList); } @@ -234,11 +231,10 @@ SVGAnimatedLengthList::SMILAnimatedLengt void SVGAnimatedLengthList::SMILAnimatedLengthList::ClearAnimValue() { if (mVal->mAnimVal) { mVal->ClearAnimValue(mElement, mAttrEnum); } } -#endif // MOZ_SMIL } // namespace mozilla
--- a/content/svg/content/src/SVGAnimatedLengthList.h +++ b/content/svg/content/src/SVGAnimatedLengthList.h @@ -36,19 +36,17 @@ #ifndef MOZILLA_SVGANIMATEDLENGTHLIST_H__ #define MOZILLA_SVGANIMATEDLENGTHLIST_H__ #include "SVGLengthList.h" class nsSVGElement; -#ifdef MOZ_SMIL #include "nsISMILAttr.h" -#endif // MOZ_SMIL namespace mozilla { /** * Class SVGAnimatedLengthList * * This class is very different to the SVG DOM interface of the same name found * in the SVG specification. This is a lightweight internal class - see @@ -95,33 +93,30 @@ public: void ClearAnimValue(nsSVGElement *aElement, PRUint32 aAttrEnum); bool IsAnimating() const { return !!mAnimVal; } -#ifdef MOZ_SMIL /// Callers own the returned nsISMILAttr nsISMILAttr* ToSMILAttr(nsSVGElement* aSVGElement, PRUint8 aAttrEnum, PRUint8 aAxis, bool aCanZeroPadList); -#endif // MOZ_SMIL private: // mAnimVal is a pointer to allow us to determine if we're being animated or // not. Making it a non-pointer member and using mAnimVal.IsEmpty() to check // if we're animating is not an option, since that would break animation *to* // the empty string (<set to="">). SVGLengthList mBaseVal; nsAutoPtr<SVGLengthList> mAnimVal; -#ifdef MOZ_SMIL struct SMILAnimatedLengthList : public nsISMILAttr { public: SMILAnimatedLengthList(SVGAnimatedLengthList* aVal, nsSVGElement* aSVGElement, PRUint8 aAttrEnum, PRUint8 aAxis, bool aCanZeroPadList) @@ -145,14 +140,13 @@ private: virtual nsresult ValueFromString(const nsAString& aStr, const nsISMILAnimationElement* aSrcElement, nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const; virtual nsSMILValue GetBaseValue() const; virtual void ClearAnimValue(); virtual nsresult SetAnimValue(const nsSMILValue& aValue); }; -#endif // MOZ_SMIL }; } // namespace mozilla #endif // MOZILLA_SVGANIMATEDLENGTHLIST_H__
--- a/content/svg/content/src/SVGAnimatedNumberList.cpp +++ b/content/svg/content/src/SVGAnimatedNumberList.cpp @@ -33,20 +33,18 @@ * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ #include "SVGAnimatedNumberList.h" #include "DOMSVGAnimatedNumberList.h" #include "nsSVGElement.h" #include "nsSVGAttrTearoffTable.h" -#ifdef MOZ_SMIL #include "nsSMILValue.h" #include "SVGNumberListSMILType.h" -#endif // MOZ_SMIL namespace mozilla { nsresult SVGAnimatedNumberList::SetBaseValueString(const nsAString& aValue) { SVGNumberList newBaseValue; nsresult rv = newBaseValue.SetValueFromString(aValue); @@ -146,17 +144,16 @@ SVGAnimatedNumberList::ClearAnimValue(ns // must do that before touching mAnimVal. See comments above. // domWrapper->InternalAnimValListWillChangeTo(mBaseVal); } mAnimVal = nsnull; aElement->DidAnimateNumberList(aAttrEnum); } -#ifdef MOZ_SMIL nsISMILAttr* SVGAnimatedNumberList::ToSMILAttr(nsSVGElement *aSVGElement, PRUint8 aAttrEnum) { return new SMILAnimatedNumberList(this, aSVGElement, aAttrEnum); } nsresult @@ -210,11 +207,10 @@ SVGAnimatedNumberList::SMILAnimatedNumbe void SVGAnimatedNumberList::SMILAnimatedNumberList::ClearAnimValue() { if (mVal->mAnimVal) { mVal->ClearAnimValue(mElement, mAttrEnum); } } -#endif // MOZ_SMIL } // namespace mozilla
--- a/content/svg/content/src/SVGAnimatedNumberList.h +++ b/content/svg/content/src/SVGAnimatedNumberList.h @@ -36,19 +36,17 @@ #ifndef MOZILLA_SVGANIMATEDNUMBERLIST_H__ #define MOZILLA_SVGANIMATEDNUMBERLIST_H__ #include "SVGNumberList.h" class nsSVGElement; -#ifdef MOZ_SMIL #include "nsISMILAttr.h" -#endif // MOZ_SMIL namespace mozilla { /** * Class SVGAnimatedNumberList * * This class is very different to the SVG DOM interface of the same name found * in the SVG specification. This is a lightweight internal class - see @@ -103,33 +101,30 @@ public: // useable, and represents the default base value of the attribute. bool IsExplicitlySet() const { return !!mAnimVal || mIsBaseSet; } bool IsAnimating() const { return !!mAnimVal; } -#ifdef MOZ_SMIL /// Callers own the returned nsISMILAttr nsISMILAttr* ToSMILAttr(nsSVGElement* aSVGElement, PRUint8 aAttrEnum); -#endif // MOZ_SMIL private: // mAnimVal is a pointer to allow us to determine if we're being animated or // not. Making it a non-pointer member and using mAnimVal.IsEmpty() to check // if we're animating is not an option, since that would break animation *to* // the empty string (<set to="">). SVGNumberList mBaseVal; nsAutoPtr<SVGNumberList> mAnimVal; bool mIsBaseSet; -#ifdef MOZ_SMIL struct SMILAnimatedNumberList : public nsISMILAttr { public: SMILAnimatedNumberList(SVGAnimatedNumberList* aVal, nsSVGElement* aSVGElement, PRUint8 aAttrEnum) : mVal(aVal) , mElement(aSVGElement) @@ -147,14 +142,13 @@ private: virtual nsresult ValueFromString(const nsAString& aStr, const nsISMILAnimationElement* aSrcElement, nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const; virtual nsSMILValue GetBaseValue() const; virtual void ClearAnimValue(); virtual nsresult SetAnimValue(const nsSMILValue& aValue); }; -#endif // MOZ_SMIL }; } // namespace mozilla #endif // MOZILLA_SVGANIMATEDNUMBERLIST_H__
--- a/content/svg/content/src/SVGAnimatedPathSegList.cpp +++ b/content/svg/content/src/SVGAnimatedPathSegList.cpp @@ -33,20 +33,18 @@ * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ #include "SVGAnimatedPathSegList.h" #include "DOMSVGPathSegList.h" #include "nsSVGElement.h" #include "nsSVGAttrTearoffTable.h" -#ifdef MOZ_SMIL #include "nsSMILValue.h" #include "SVGPathSegListSMILType.h" -#endif // MOZ_SMIL // See the comments in this file's header! namespace mozilla { nsresult SVGAnimatedPathSegList::SetBaseValueString(const nsAString& aValue) { @@ -169,17 +167,16 @@ SVGAnimatedPathSegList::ClearAnimValue(n // a different number of items to the last active animated value. // domWrapper->InternalListWillChangeTo(mBaseVal); } mAnimVal = nsnull; aElement->DidAnimatePathSegList(); } -#ifdef MOZ_SMIL nsISMILAttr* SVGAnimatedPathSegList::ToSMILAttr(nsSVGElement *aElement) { return new SMILAnimatedPathSegList(this, aElement); } nsresult SVGAnimatedPathSegList:: @@ -231,11 +228,10 @@ SVGAnimatedPathSegList::SMILAnimatedPath void SVGAnimatedPathSegList::SMILAnimatedPathSegList::ClearAnimValue() { if (mVal->mAnimVal) { mVal->ClearAnimValue(mElement); } } -#endif // MOZ_SMIL } // namespace mozilla
--- a/content/svg/content/src/SVGAnimatedPathSegList.h +++ b/content/svg/content/src/SVGAnimatedPathSegList.h @@ -36,19 +36,17 @@ #ifndef MOZILLA_SVGANIMATEDPATHSEGLIST_H__ #define MOZILLA_SVGANIMATEDPATHSEGLIST_H__ #include "SVGPathData.h" class nsSVGElement; -#ifdef MOZ_SMIL #include "nsISMILAttr.h" -#endif // MOZ_SMIL namespace mozilla { /** * Class SVGAnimatedPathSegList * * Despite the fact that no SVGAnimatedPathSegList interface or objects exist * in the SVG specification (unlike e.g. SVGAnimated*Length*List), we @@ -107,32 +105,29 @@ public: void *GetAnimValKey() const { return (void*)&mAnimVal; } bool IsAnimating() const { return !!mAnimVal; } -#ifdef MOZ_SMIL /// Callers own the returned nsISMILAttr nsISMILAttr* ToSMILAttr(nsSVGElement* aElement); -#endif // MOZ_SMIL private: // mAnimVal is a pointer to allow us to determine if we're being animated or // not. Making it a non-pointer member and using mAnimVal.IsEmpty() to check // if we're animating is not an option, since that would break animation *to* // the empty string (<set to="">). SVGPathData mBaseVal; nsAutoPtr<SVGPathData> mAnimVal; -#ifdef MOZ_SMIL struct SMILAnimatedPathSegList : public nsISMILAttr { public: SMILAnimatedPathSegList(SVGAnimatedPathSegList* aVal, nsSVGElement* aElement) : mVal(aVal) , mElement(aElement) {} @@ -147,14 +142,13 @@ private: virtual nsresult ValueFromString(const nsAString& aStr, const nsISMILAnimationElement* aSrcElement, nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const; virtual nsSMILValue GetBaseValue() const; virtual void ClearAnimValue(); virtual nsresult SetAnimValue(const nsSMILValue& aValue); }; -#endif // MOZ_SMIL }; } // namespace mozilla #endif // MOZILLA_SVGANIMATEDPATHSEGLIST_H__
--- a/content/svg/content/src/SVGAnimatedPointList.cpp +++ b/content/svg/content/src/SVGAnimatedPointList.cpp @@ -33,20 +33,18 @@ * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ #include "SVGAnimatedPointList.h" #include "DOMSVGPointList.h" #include "nsSVGElement.h" #include "nsSVGAttrTearoffTable.h" -#ifdef MOZ_SMIL #include "nsSMILValue.h" #include "SVGPointListSMILType.h" -#endif // MOZ_SMIL // See the comments in this file's header! namespace mozilla { nsresult SVGAnimatedPointList::SetBaseValueString(const nsAString& aValue) { @@ -172,17 +170,16 @@ SVGAnimatedPointList::ClearAnimValue(nsS // a different number of items to the last active animated value. // domWrapper->InternalListWillChangeTo(mBaseVal); } mAnimVal = nsnull; aElement->DidAnimatePointList(); } -#ifdef MOZ_SMIL nsISMILAttr* SVGAnimatedPointList::ToSMILAttr(nsSVGElement *aElement) { return new SMILAnimatedPointList(this, aElement); } nsresult SVGAnimatedPointList:: @@ -234,11 +231,10 @@ SVGAnimatedPointList::SMILAnimatedPointL void SVGAnimatedPointList::SMILAnimatedPointList::ClearAnimValue() { if (mVal->mAnimVal) { mVal->ClearAnimValue(mElement); } } -#endif // MOZ_SMIL } // namespace mozilla
--- a/content/svg/content/src/SVGAnimatedPointList.h +++ b/content/svg/content/src/SVGAnimatedPointList.h @@ -36,19 +36,17 @@ #ifndef MOZILLA_SVGANIMATEDPOINTLIST_H__ #define MOZILLA_SVGANIMATEDPOINTLIST_H__ #include "SVGPointList.h" class nsSVGElement; -#ifdef MOZ_SMIL #include "nsISMILAttr.h" -#endif // MOZ_SMIL namespace mozilla { /** * Class SVGAnimatedPointList * * Despite the fact that no SVGAnimatedPointList interface or objects exist * in the SVG specification (unlike e.g. SVGAnimated*Length*List), we @@ -107,32 +105,29 @@ public: void *GetAnimValKey() const { return (void*)&mAnimVal; } bool IsAnimating() const { return !!mAnimVal; } -#ifdef MOZ_SMIL /// Callers own the returned nsISMILAttr nsISMILAttr* ToSMILAttr(nsSVGElement* aElement); -#endif // MOZ_SMIL private: // mAnimVal is a pointer to allow us to determine if we're being animated or // not. Making it a non-pointer member and using mAnimVal.IsEmpty() to check // if we're animating is not an option, since that would break animation *to* // the empty string (<set to="">). SVGPointList mBaseVal; nsAutoPtr<SVGPointList> mAnimVal; -#ifdef MOZ_SMIL struct SMILAnimatedPointList : public nsISMILAttr { public: SMILAnimatedPointList(SVGAnimatedPointList* aVal, nsSVGElement* aElement) : mVal(aVal) , mElement(aElement) {} @@ -147,14 +142,13 @@ private: virtual nsresult ValueFromString(const nsAString& aStr, const nsISMILAnimationElement* aSrcElement, nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const; virtual nsSMILValue GetBaseValue() const; virtual void ClearAnimValue(); virtual nsresult SetAnimValue(const nsSMILValue& aValue); }; -#endif // MOZ_SMIL }; } // namespace mozilla #endif // MOZILLA_SVGANIMATEDPOINTLIST_H__
--- a/content/svg/content/src/SVGAnimatedPreserveAspectRatio.cpp +++ b/content/svg/content/src/SVGAnimatedPreserveAspectRatio.cpp @@ -35,20 +35,18 @@ * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ #include "mozilla/Util.h" #include "SVGAnimatedPreserveAspectRatio.h" #include "nsWhitespaceTokenizer.h" -#ifdef MOZ_SMIL #include "nsSMILValue.h" #include "SMILEnumType.h" -#endif // MOZ_SMIL using namespace mozilla; //////////////////////////////////////////////////////////////////////// // SVGAnimatedPreserveAspectRatio class NS_SVG_VAL_IMPL_CYCLE_COLLECTION( SVGAnimatedPreserveAspectRatio::DOMBaseVal, mSVGElement) @@ -236,21 +234,19 @@ SVGAnimatedPreserveAspectRatio::SetBaseV return res; } mBaseVal = val; mIsBaseSet = true; if (!mIsAnimated) { mAnimVal = mBaseVal; } -#ifdef MOZ_SMIL else { aSVGElement->AnimationNeedsResample(); } -#endif // We don't need to call DidChange* here - we're only called by // nsSVGElement::ParseAttribute under nsGenericElement::SetAttr, // which takes care of notifying. return NS_OK; } void @@ -281,40 +277,36 @@ SVGAnimatedPreserveAspectRatio::SetBaseA nsSVGElement *aSVGElement) { nsresult rv = mBaseVal.SetAlign(aAlign); NS_ENSURE_SUCCESS(rv, rv); mIsBaseSet = true; mAnimVal.mAlign = mBaseVal.mAlign; aSVGElement->DidChangePreserveAspectRatio(true); -#ifdef MOZ_SMIL if (mIsAnimated) { aSVGElement->AnimationNeedsResample(); } -#endif return NS_OK; } nsresult SVGAnimatedPreserveAspectRatio::SetBaseMeetOrSlice(PRUint16 aMeetOrSlice, nsSVGElement *aSVGElement) { nsresult rv = mBaseVal.SetMeetOrSlice(aMeetOrSlice); NS_ENSURE_SUCCESS(rv, rv); mIsBaseSet = true; mAnimVal.mMeetOrSlice = mBaseVal.mMeetOrSlice; aSVGElement->DidChangePreserveAspectRatio(true); -#ifdef MOZ_SMIL if (mIsAnimated) { aSVGElement->AnimationNeedsResample(); } -#endif return NS_OK; } void SVGAnimatedPreserveAspectRatio::SetAnimValue(PRUint64 aPackedValue, nsSVGElement *aSVGElement) { @@ -333,17 +325,16 @@ SVGAnimatedPreserveAspectRatio::ToDOMAni *aResult = new DOMAnimPAspectRatio(this, aSVGElement); if (!*aResult) return NS_ERROR_OUT_OF_MEMORY; NS_ADDREF(*aResult); return NS_OK; } -#ifdef MOZ_SMIL nsISMILAttr* SVGAnimatedPreserveAspectRatio::ToSMILAttr(nsSVGElement *aSVGElement) { return new SMILPreserveAspectRatio(this, aSVGElement); } static PRUint64 PackPreserveAspectRatio(const SVGPreserveAspectRatio& par) @@ -401,9 +392,8 @@ SMILPreserveAspectRatio::SetAnimValue(co { NS_ASSERTION(aValue.mType == &SMILEnumType::sSingleton, "Unexpected type to assign animated value"); if (aValue.mType == &SMILEnumType::sSingleton) { mVal->SetAnimValue(aValue.mU.mUint, mSVGElement); } return NS_OK; } -#endif // MOZ_SMIL
--- a/content/svg/content/src/SVGAnimatedPreserveAspectRatio.h +++ b/content/svg/content/src/SVGAnimatedPreserveAspectRatio.h @@ -124,20 +124,18 @@ public: bool IsAnimated() const { return mIsAnimated; } bool IsExplicitlySet() const { return mIsAnimated || mIsBaseSet; } nsresult ToDOMAnimatedPreserveAspectRatio( nsIDOMSVGAnimatedPreserveAspectRatio **aResult, nsSVGElement* aSVGElement); -#ifdef MOZ_SMIL // Returns a new nsISMILAttr object that the caller must delete nsISMILAttr* ToSMILAttr(nsSVGElement* aSVGElement); -#endif // MOZ_SMIL private: SVGPreserveAspectRatio mAnimVal; SVGPreserveAspectRatio mBaseVal; bool mIsAnimated; bool mIsBaseSet; @@ -179,30 +177,26 @@ public: SVGAnimatedPreserveAspectRatio* mVal; // kept alive because it belongs to mSVGElement nsRefPtr<nsSVGElement> mSVGElement; // Script may have modified animation parameters or timeline -- DOM getters // need to flush any resample requests to reflect these modifications. NS_IMETHOD GetAlign(PRUint16* aAlign) { -#ifdef MOZ_SMIL mSVGElement->FlushAnimations(); -#endif *aAlign = mVal->GetAnimValue().GetAlign(); return NS_OK; } NS_IMETHOD SetAlign(PRUint16 aAlign) { return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR; } NS_IMETHOD GetMeetOrSlice(PRUint16* aMeetOrSlice) { -#ifdef MOZ_SMIL mSVGElement->FlushAnimations(); -#endif *aMeetOrSlice = mVal->GetAnimValue().GetMeetOrSlice(); return NS_OK; } NS_IMETHOD SetMeetOrSlice(PRUint16 aValue) { return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR; } }; struct DOMAnimPAspectRatio : public nsIDOMSVGAnimatedPreserveAspectRatio @@ -221,17 +215,16 @@ public: NS_IMETHOD GetBaseVal(nsIDOMSVGPreserveAspectRatio **aBaseVal) { return mVal->ToDOMBaseVal(aBaseVal, mSVGElement); } NS_IMETHOD GetAnimVal(nsIDOMSVGPreserveAspectRatio **aAnimVal) { return mVal->ToDOMAnimVal(aAnimVal, mSVGElement); } }; -#ifdef MOZ_SMIL struct SMILPreserveAspectRatio : public nsISMILAttr { public: SMILPreserveAspectRatio(SVGAnimatedPreserveAspectRatio* aVal, nsSVGElement* aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} // These will stay alive because a nsISMILAttr only lives as long @@ -244,14 +237,13 @@ public: virtual nsresult ValueFromString(const nsAString& aStr, const nsISMILAnimationElement* aSrcElement, nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const; virtual nsSMILValue GetBaseValue() const; virtual void ClearAnimValue(); virtual nsresult SetAnimValue(const nsSMILValue& aValue); }; -#endif // MOZ_SMIL }; } // namespace mozilla #endif // MOZILLA_SVGANIMATEDPRESERVEASPECTRATIO_H__
--- a/content/svg/content/src/SVGAnimatedTransformList.cpp +++ b/content/svg/content/src/SVGAnimatedTransformList.cpp @@ -32,23 +32,21 @@ * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ #include "SVGAnimatedTransformList.h" #include "DOMSVGAnimatedTransformList.h" -#ifdef MOZ_SMIL #include "nsSMILValue.h" #include "SVGTransform.h" #include "SVGTransformListSMILType.h" #include "nsSVGUtils.h" #include "prdtoa.h" -#endif // MOZ_SMIL namespace mozilla { nsresult SVGAnimatedTransformList::SetBaseValueString(const nsAString& aValue) { SVGTransformList newBaseValue; nsresult rv = newBaseValue.SetValueFromString(aValue); @@ -164,17 +162,16 @@ SVGAnimatedTransformList::IsExplicitlySe // nsSVGElement::UnsetAttr or a failed nsSVGElement::ParseAttribute) // 2) DOM call -- simply fetching the baseVal doesn't mean the transform value // has been set. It is set if that baseVal has one or more transforms in // the list. // 3) Animation -- which will cause the mAnimVal member to be allocated return mIsAttrSet || !mBaseVal.IsEmpty() || mAnimVal; } -#ifdef MOZ_SMIL nsISMILAttr* SVGAnimatedTransformList::ToSMILAttr(nsSVGElement* aSVGElement) { return new SMILAnimatedTransformList(this, aSVGElement); } nsresult SVGAnimatedTransformList::SMILAnimatedTransformList::ValueFromString( @@ -345,11 +342,9 @@ SVGAnimatedTransformList::SMILAnimatedTr void SVGAnimatedTransformList::SMILAnimatedTransformList::ClearAnimValue() { if (mVal->mAnimVal) { mVal->ClearAnimValue(mElement); } } -#endif // MOZ_SMIL - } // namespace mozilla
--- a/content/svg/content/src/SVGAnimatedTransformList.h +++ b/content/svg/content/src/SVGAnimatedTransformList.h @@ -38,19 +38,17 @@ #ifndef MOZILLA_SVGANIMATEDTRANSFORMLIST_H__ #define MOZILLA_SVGANIMATEDTRANSFORMLIST_H__ #include "SVGTransformList.h" class nsSVGElement; -#ifdef MOZ_SMIL #include "nsISMILAttr.h" -#endif // MOZ_SMIL namespace mozilla { /** * Class SVGAnimatedTransformList * * This class is very different to the SVG DOM interface of the same name found * in the SVG specification. This is a lightweight internal class - see @@ -97,33 +95,30 @@ public: void ClearAnimValue(nsSVGElement *aElement); bool IsExplicitlySet() const; bool IsAnimating() const { return !!mAnimVal; } -#ifdef MOZ_SMIL /// Callers own the returned nsISMILAttr nsISMILAttr* ToSMILAttr(nsSVGElement* aSVGElement); -#endif // MOZ_SMIL private: // mAnimVal is a pointer to allow us to determine if we're being animated or // not. Making it a non-pointer member and using mAnimVal.IsEmpty() to check // if we're animating is not an option, since that would break animation *to* // the empty string (<set to="">). SVGTransformList mBaseVal; nsAutoPtr<SVGTransformList> mAnimVal; bool mIsAttrSet; -#ifdef MOZ_SMIL struct SMILAnimatedTransformList : public nsISMILAttr { public: SMILAnimatedTransformList(SVGAnimatedTransformList* aVal, nsSVGElement* aSVGElement) : mVal(aVal) , mElement(aSVGElement) {} @@ -145,14 +140,13 @@ private: PRInt32 aNVars); // These will stay alive because a nsISMILAttr only lives as long // as the Compositing step, and DOM elements don't get a chance to // die during that. SVGAnimatedTransformList* mVal; nsSVGElement* mElement; }; -#endif // MOZ_SMIL }; } // namespace mozilla #endif // MOZILLA_SVGANIMATEDTRANSFORMLIST_H__
--- a/content/svg/content/src/nsSVGAngle.cpp +++ b/content/svg/content/src/nsSVGAngle.cpp @@ -38,20 +38,18 @@ #include "nsSVGAngle.h" #include "prdtoa.h" #include "nsTextFormatter.h" #include "nsSVGUtils.h" #include "nsSVGMarkerElement.h" #include "nsMathUtils.h" #include "nsContentUtils.h" // NS_ENSURE_FINITE -#ifdef MOZ_SMIL #include "nsSMILValue.h" #include "SVGOrientSMILType.h" -#endif // MOZ_SMIL using namespace mozilla; /** * Mutable SVGAngle class for SVGSVGElement.createSVGAngle(). * * Note that this class holds its own nsSVGAngle, which therefore can't be * animated. This means SVGMarkerElement::setOrientToAngle(angle) must copy @@ -259,21 +257,19 @@ nsSVGAngle::GetDegreesPerUnit(PRUint8 aU void nsSVGAngle::SetBaseValueInSpecifiedUnits(float aValue, nsSVGElement *aSVGElement) { mBaseVal = aValue; if (!mIsAnimated) { mAnimVal = mBaseVal; } -#ifdef MOZ_SMIL else { aSVGElement->AnimationNeedsResample(); } -#endif aSVGElement->DidChangeAngle(mAttrEnum, true); } nsresult nsSVGAngle::ConvertToSpecifiedUnits(PRUint16 unitType, nsSVGElement *aSVGElement) { if (!IsValidUnitType(unitType)) @@ -296,21 +292,19 @@ nsSVGAngle::NewValueSpecifiedUnits(PRUin return NS_ERROR_DOM_NOT_SUPPORTED_ERR; mBaseVal = valueInSpecifiedUnits; mBaseValUnit = PRUint8(unitType); if (!mIsAnimated) { mAnimVal = mBaseVal; mAnimValUnit = mBaseValUnit; } -#ifdef MOZ_SMIL else { aSVGElement->AnimationNeedsResample(); } -#endif if (aSVGElement) { aSVGElement->DidChangeAngle(mAttrEnum, true); } return NS_OK; } nsresult nsSVGAngle::ToDOMBaseVal(nsIDOMSVGAngle **aResult, nsSVGElement *aSVGElement) @@ -350,21 +344,19 @@ nsSVGAngle::SetBaseValueString(const nsA } mBaseVal = value; mBaseValUnit = PRUint8(unitType); if (!mIsAnimated) { mAnimVal = mBaseVal; mAnimValUnit = mBaseValUnit; } -#ifdef MOZ_SMIL else { aSVGElement->AnimationNeedsResample(); } -#endif // We don't need to call DidChange* here - we're only called by // nsSVGElement::ParseAttribute under nsGenericElement::SetAttr, // which takes care of notifying. return NS_OK; } void @@ -381,21 +373,19 @@ nsSVGAngle::GetAnimValueString(nsAString void nsSVGAngle::SetBaseValue(float aValue, nsSVGElement *aSVGElement) { mBaseVal = aValue / GetDegreesPerUnit(mBaseValUnit); if (!mIsAnimated) { mAnimVal = mBaseVal; } -#ifdef MOZ_SMIL else { aSVGElement->AnimationNeedsResample(); } -#endif if (aSVGElement) { aSVGElement->DidChangeAngle(mAttrEnum, true); } } void nsSVGAngle::SetAnimValue(float aValue, PRUint8 aUnit, nsSVGElement *aSVGElement) { @@ -423,17 +413,16 @@ NS_NewDOMSVGAngle(nsIDOMSVGAngle** aResu *aResult = new DOMSVGAngle; if (!*aResult) return NS_ERROR_OUT_OF_MEMORY; NS_ADDREF(*aResult); return NS_OK; } -#ifdef MOZ_SMIL nsISMILAttr* nsSVGAngle::ToSMILAttr(nsSVGElement *aSVGElement) { if (aSVGElement->NodeInfo()->Equals(nsGkAtoms::marker, kNameSpaceID_SVG)) { nsSVGMarkerElement *marker = static_cast<nsSVGMarkerElement*>(aSVGElement); return new SMILOrient(marker->GetOrientType(), this, aSVGElement); } // SMILOrient would not be useful for general angle attributes (also, @@ -499,9 +488,8 @@ nsSVGAngle::SMILOrient::SetAnimValue(con if (aValue.mU.mOrient.mOrientType == nsIDOMSVGMarkerElement::SVG_MARKER_ORIENT_AUTO) { mAngle->SetAnimValue(0.0f, nsIDOMSVGAngle::SVG_ANGLETYPE_UNSPECIFIED, mSVGElement); } else { mAngle->SetAnimValue(aValue.mU.mOrient.mAngle, aValue.mU.mOrient.mUnit, mSVGElement); } } return NS_OK; } -#endif // MOZ_SMIL
--- a/content/svg/content/src/nsSVGAngle.h +++ b/content/svg/content/src/nsSVGAngle.h @@ -75,20 +75,18 @@ public: PRUint8 GetBaseValueUnit() const { return mBaseValUnit; } PRUint8 GetAnimValueUnit() const { return mAnimValUnit; } float GetBaseValInSpecifiedUnits() const { return mBaseVal; } float GetAnimValInSpecifiedUnits() const { return mAnimVal; } static nsresult ToDOMSVGAngle(nsIDOMSVGAngle **aResult); nsresult ToDOMAnimatedAngle(nsIDOMSVGAnimatedAngle **aResult, nsSVGElement* aSVGElement); -#ifdef MOZ_SMIL // Returns a new nsISMILAttr object that the caller must delete nsISMILAttr* ToSMILAttr(nsSVGElement* aSVGElement); -#endif // MOZ_SMIL static float GetDegreesPerUnit(PRUint8 aUnit); private: float mAnimVal; float mBaseVal; PRUint8 mAnimValUnit; @@ -193,17 +191,16 @@ public: NS_IMETHOD GetBaseVal(nsIDOMSVGAngle **aBaseVal) { return mVal->ToDOMBaseVal(aBaseVal, mSVGElement); } NS_IMETHOD GetAnimVal(nsIDOMSVGAngle **aAnimVal) { return mVal->ToDOMAnimVal(aAnimVal, mSVGElement); } }; -#ifdef MOZ_SMIL // We do not currently implemente a SMILAngle struct because in SVG 1.1 the // only *animatable* attribute that takes an <angle> is 'orient', on the // 'marker' element, and 'orient' must be special cased since it can also // take the value 'auto', making it a more complex type. struct SMILOrient : public nsISMILAttr { public: @@ -226,15 +223,14 @@ public: virtual nsresult ValueFromString(const nsAString& aStr, const nsISMILAnimationElement* aSrcElement, nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const; virtual nsSMILValue GetBaseValue() const; virtual void ClearAnimValue(); virtual nsresult SetAnimValue(const nsSMILValue& aValue); }; -#endif // MOZ_SMIL }; nsresult NS_NewDOMSVGAngle(nsIDOMSVGAngle** result); #endif //__NS_SVGANGLE_H__
--- a/content/svg/content/src/nsSVGBoolean.cpp +++ b/content/svg/content/src/nsSVGBoolean.cpp @@ -30,20 +30,18 @@ * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ #include "nsSVGBoolean.h" -#ifdef MOZ_SMIL #include "nsSMILValue.h" #include "SMILBoolType.h" -#endif // MOZ_SMIL using namespace mozilla; NS_SVG_VAL_IMPL_CYCLE_COLLECTION(nsSVGBoolean::DOMAnimatedBoolean, mSVGElement) NS_IMPL_CYCLE_COLLECTING_ADDREF(nsSVGBoolean::DOMAnimatedBoolean) NS_IMPL_CYCLE_COLLECTING_RELEASE(nsSVGBoolean::DOMAnimatedBoolean) @@ -82,21 +80,19 @@ nsSVGBoolean::SetBaseValueString(const n if (NS_FAILED(rv)) { return rv; } mBaseVal = val; if (!mIsAnimated) { mAnimVal = mBaseVal; } -#ifdef MOZ_SMIL else { aSVGElement->AnimationNeedsResample(); } -#endif // We don't need to call DidChange* here - we're only called by // nsSVGElement::ParseAttribute under nsGenericElement::SetAttr, // which takes care of notifying. return NS_OK; } void @@ -113,21 +109,19 @@ nsSVGBoolean::SetBaseValue(bool aValue, { NS_PRECONDITION(aValue == true || aValue == false, "Boolean out of range"); if (aValue != mBaseVal) { mBaseVal = aValue; if (!mIsAnimated) { mAnimVal = mBaseVal; } -#ifdef MOZ_SMIL else { aSVGElement->AnimationNeedsResample(); } -#endif aSVGElement->DidChangeBoolean(mAttrEnum, true); } } void nsSVGBoolean::SetAnimValue(bool aValue, nsSVGElement *aSVGElement) { mAnimVal = aValue; @@ -142,17 +136,16 @@ nsSVGBoolean::ToDOMAnimatedBoolean(nsIDO *aResult = new DOMAnimatedBoolean(this, aSVGElement); if (!*aResult) return NS_ERROR_OUT_OF_MEMORY; NS_ADDREF(*aResult); return NS_OK; } -#ifdef MOZ_SMIL nsISMILAttr* nsSVGBoolean::ToSMILAttr(nsSVGElement *aSVGElement) { return new SMILBool(this, aSVGElement); } nsresult nsSVGBoolean::SMILBool::ValueFromString(const nsAString& aStr, @@ -196,9 +189,8 @@ nsSVGBoolean::SMILBool::SetAnimValue(con { NS_ASSERTION(aValue.mType == &SMILBoolType::sSingleton, "Unexpected type to assign animated value"); if (aValue.mType == &SMILBoolType::sSingleton) { mVal->SetAnimValue(PRUint16(aValue.mU.mBool), mSVGElement); } return NS_OK; } -#endif // MOZ_SMIL
--- a/content/svg/content/src/nsSVGBoolean.h +++ b/content/svg/content/src/nsSVGBoolean.h @@ -60,20 +60,18 @@ public: { return mBaseVal; } void SetAnimValue(bool aValue, nsSVGElement *aSVGElement); bool GetAnimValue() const { return mAnimVal; } nsresult ToDOMAnimatedBoolean(nsIDOMSVGAnimatedBoolean **aResult, nsSVGElement* aSVGElement); -#ifdef MOZ_SMIL // Returns a new nsISMILAttr object that the caller must delete nsISMILAttr* ToSMILAttr(nsSVGElement* aSVGElement); -#endif // MOZ_SMIL private: bool mAnimVal; bool mBaseVal; bool mIsAnimated; PRUint8 mAttrEnum; // element specified tracking for attribute @@ -93,25 +91,22 @@ public: { *aResult = mVal->GetBaseValue(); return NS_OK; } NS_IMETHOD SetBaseVal(bool aValue) { mVal->SetBaseValue(aValue, mSVGElement); return NS_OK; } // Script may have modified animation parameters or timeline -- DOM getters // need to flush any resample requests to reflect these modifications. NS_IMETHOD GetAnimVal(bool* aResult) { -#ifdef MOZ_SMIL mSVGElement->FlushAnimations(); -#endif *aResult = mVal->GetAnimValue(); return NS_OK; } }; -#ifdef MOZ_SMIL struct SMILBool : public nsISMILAttr { public: SMILBool(nsSVGBoolean* aVal, nsSVGElement* aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} // These will stay alive because a nsISMILAttr only lives as long // as the Compositing step, and DOM elements don't get a chance to @@ -123,11 +118,10 @@ public: virtual nsresult ValueFromString(const nsAString& aStr, const nsISMILAnimationElement* aSrcElement, nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const; virtual nsSMILValue GetBaseValue() const; virtual void ClearAnimValue(); virtual nsresult SetAnimValue(const nsSMILValue& aValue); }; -#endif // MOZ_SMIL }; #endif //__NS_SVGBOOLEAN_H__
--- a/content/svg/content/src/nsSVGClass.cpp +++ b/content/svg/content/src/nsSVGClass.cpp @@ -31,20 +31,18 @@ * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ #include "nsSVGClass.h" #include "nsSVGStylableElement.h" -#ifdef MOZ_SMIL #include "nsSMILValue.h" #include "SMILStringType.h" -#endif // MOZ_SMIL using namespace mozilla; NS_SVG_VAL_IMPL_CYCLE_COLLECTION(nsSVGClass::DOMAnimatedString, mSVGElement) NS_IMPL_CYCLE_COLLECTING_ADDREF(nsSVGClass::DOMAnimatedString) NS_IMPL_CYCLE_COLLECTING_RELEASE(nsSVGClass::DOMAnimatedString) @@ -64,21 +62,19 @@ nsSVGClass::SetBaseValue(const nsAString bool aDoSetAttr) { NS_ASSERTION(aSVGElement, "Null element passed to SetBaseValue"); aSVGElement->SetFlags(NODE_MAY_HAVE_CLASS); if (aDoSetAttr) { aSVGElement->SetAttr(kNameSpaceID_None, nsGkAtoms::_class, aValue, true); } -#ifdef MOZ_SMIL if (mAnimVal) { aSVGElement->AnimationNeedsResample(); } -#endif } void nsSVGClass::GetBaseValue(nsAString& aValue, const nsSVGStylableElement *aSVGElement) const { aSVGElement->GetAttr(kNameSpaceID_None, nsGkAtoms::_class, aValue); } @@ -111,24 +107,21 @@ nsSVGClass::ToDOMAnimatedString(nsIDOMSV *aResult = new DOMAnimatedString(this, aSVGElement); NS_ADDREF(*aResult); return NS_OK; } NS_IMETHODIMP nsSVGClass::DOMAnimatedString::GetAnimVal(nsAString& aResult) { -#ifdef MOZ_SMIL mSVGElement->FlushAnimations(); -#endif mVal->GetAnimValue(aResult, mSVGElement); return NS_OK; } -#ifdef MOZ_SMIL nsISMILAttr* nsSVGClass::ToSMILAttr(nsSVGStylableElement *aSVGElement) { return new SMILString(this, aSVGElement); } nsresult nsSVGClass::SMILString::ValueFromString(const nsAString& aStr, @@ -167,9 +160,8 @@ nsSVGClass::SMILString::SetAnimValue(con { NS_ASSERTION(aValue.mType == &SMILStringType::sSingleton, "Unexpected type to assign animated value"); if (aValue.mType == &SMILStringType::sSingleton) { mVal->SetAnimValue(*static_cast<nsAString*>(aValue.mU.mPtr), mSVGElement); } return NS_OK; } -#endif // MOZ_SMIL
--- a/content/svg/content/src/nsSVGClass.h +++ b/content/svg/content/src/nsSVGClass.h @@ -38,19 +38,17 @@ #define __NS_SVGCLASS_H__ #include "nsIDOMSVGAnimatedString.h" #include "nsAutoPtr.h" #include "nsCycleCollectionParticipant.h" #include "nsString.h" #include "nsDOMError.h" -#ifdef MOZ_SMIL #include "nsISMILAttr.h" -#endif // MOZ_SMIL class nsSVGStylableElement; class nsSVGClass { public: void Init() { @@ -64,20 +62,18 @@ public: void SetAnimValue(const nsAString& aValue, nsSVGStylableElement *aSVGElement); void GetAnimValue(nsAString& aValue, const nsSVGStylableElement *aSVGElement) const; bool IsAnimated() const { return !!mAnimVal; } nsresult ToDOMAnimatedString(nsIDOMSVGAnimatedString **aResult, nsSVGStylableElement *aSVGElement); -#ifdef MOZ_SMIL // Returns a new nsISMILAttr object that the caller must delete nsISMILAttr* ToSMILAttr(nsSVGStylableElement *aSVGElement); -#endif // MOZ_SMIL private: nsAutoPtr<nsString> mAnimVal; public: struct DOMAnimatedString : public nsIDOMSVGAnimatedString { @@ -92,17 +88,16 @@ public: NS_IMETHOD GetBaseVal(nsAString& aResult) { mVal->GetBaseValue(aResult, mSVGElement); return NS_OK; } NS_IMETHOD SetBaseVal(const nsAString& aValue) { mVal->SetBaseValue(aValue, mSVGElement, true); return NS_OK; } NS_IMETHOD GetAnimVal(nsAString& aResult); }; -#ifdef MOZ_SMIL struct SMILString : public nsISMILAttr { public: SMILString(nsSVGClass *aVal, nsSVGStylableElement *aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} // These will stay alive because a nsISMILAttr only lives as long // as the Compositing step, and DOM elements don't get a chance to @@ -114,11 +109,10 @@ public: virtual nsresult ValueFromString(const nsAString& aStr, const nsISMILAnimationElement *aSrcElement, nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const; virtual nsSMILValue GetBaseValue() const; virtual void ClearAnimValue(); virtual nsresult SetAnimValue(const nsSMILValue& aValue); }; -#endif // MOZ_SMIL }; #endif //__NS_SVGCLASS_H__
--- a/content/svg/content/src/nsSVGElement.cpp +++ b/content/svg/content/src/nsSVGElement.cpp @@ -81,20 +81,18 @@ #include "SVGAnimatedPointList.h" #include "SVGAnimatedPathSegList.h" #include "SVGAnimatedTransformList.h" #include "nsIDOMSVGUnitTypes.h" #include "nsSVGRect.h" #include "nsIFrame.h" #include "prdtoa.h" #include <stdarg.h> -#ifdef MOZ_SMIL #include "nsSMILMappedAttribute.h" #include "SVGMotionSMILAttr.h" -#endif // MOZ_SMIL using namespace mozilla; // This is needed to ensure correct handling of calls to the // vararg-list methods in this file: // nsSVGElement::GetAnimated{Length,Number,Integer}Values // See bug 547964 for details: PR_STATIC_ASSERT(sizeof(void*) == sizeof(nsnull)); @@ -782,17 +780,16 @@ nsSVGElement::WalkContentStyleRules(nsRu if (!mContentStyleRule) UpdateContentStyleRule(); if (mContentStyleRule) { mContentStyleRule->RuleMatched(); aRuleWalker->Forward(mContentStyleRule); } -#ifdef MOZ_SMIL // Update & walk the animated content style rule, to include style from // animated mapped attributes. But first, get nsPresContext to check // whether this is a "no-animation restyle". (This should match the check // in nsHTMLCSSStyleSheet::RulesMatching(), where we determine whether to // apply the SMILOverrideStyle.) nsIDocument* doc = OwnerDoc(); nsIPresShell* shell = doc->GetShell(); nsPresContext* context = shell ? shell->GetPresContext() : nsnull; @@ -811,17 +808,16 @@ nsSVGElement::WalkContentStyleRules(nsRu UpdateAnimatedContentStyleRule(); animContentStyleRule = GetAnimatedContentStyleRule(); } if (animContentStyleRule) { animContentStyleRule->RuleMatched(); aRuleWalker->Forward(animContentStyleRule); } } -#endif // MOZ_SMIL return NS_OK; } // PresentationAttributes-FillStroke /* static */ const nsGenericElement::MappedAttributeEntry nsSVGElement::sFillStrokeMap[] = { { &nsGkAtoms::fill }, @@ -1118,17 +1114,16 @@ nsSVGElement::UpdateContentStyleRule() nsAutoString value; mAttrsAndChildren.AttrAt(i)->ToString(value); mappedAttrParser.ParseMappedAttrValue(attrName->Atom(), value); } mContentStyleRule = mappedAttrParser.CreateStyleRule(); } -#ifdef MOZ_SMIL static void ParseMappedAttrAnimValueCallback(void* aObject, nsIAtom* aPropertyName, void* aPropertyValue, void* aData) { NS_ABORT_IF_FALSE(aPropertyName != SMIL_MAPPED_ATTR_STYLERULE_ATOM, "animated content style rule should have been removed " @@ -1197,17 +1192,16 @@ nsSVGElement::UpdateAnimatedContentStyle css::StyleRule* nsSVGElement::GetAnimatedContentStyleRule() { return static_cast<css::StyleRule*>(GetProperty(SMIL_MAPPED_ATTR_ANIMVAL, SMIL_MAPPED_ATTR_STYLERULE_ATOM, nsnull)); } -#endif // MOZ_SMIL /* static */ nsIAtom* nsSVGElement::GetEventNameForAttr(nsIAtom* aAttr) { if (aAttr == nsGkAtoms::onload) return nsGkAtoms::onSVGLoad; if (aAttr == nsGkAtoms::onunload) return nsGkAtoms::onSVGUnload; @@ -1216,24 +1210,22 @@ nsIAtom* nsSVGElement::GetEventNameForAt if (aAttr == nsGkAtoms::onerror) return nsGkAtoms::onSVGError; if (aAttr == nsGkAtoms::onresize) return nsGkAtoms::onSVGResize; if (aAttr == nsGkAtoms::onscroll) return nsGkAtoms::onSVGScroll; if (aAttr == nsGkAtoms::onzoom) return nsGkAtoms::onSVGZoom; -#ifdef MOZ_SMIL if (aAttr == nsGkAtoms::onbegin) return nsGkAtoms::onbeginEvent; if (aAttr == nsGkAtoms::onrepeat) return nsGkAtoms::onrepeatEvent; if (aAttr == nsGkAtoms::onend) return nsGkAtoms::onendEvent; -#endif // MOZ_SMIL return aAttr; } nsSVGSVGElement * nsSVGElement::GetCtx() const { nsIContent* ancestor = GetFlattenedTreeParent(); @@ -2125,17 +2117,16 @@ nsSVGElement::RecompileScriptEventListen } nsAutoString value; GetAttr(kNameSpaceID_None, attr, value); AddScriptEventListener(GetEventNameForAttr(attr), value, true); } } -#ifdef MOZ_SMIL nsISMILAttr* nsSVGElement::GetAnimatedAttr(PRInt32 aNamespaceID, nsIAtom* aName) { if (aNamespaceID == kNameSpaceID_None) { // Transforms: if (GetTransformListAttrName() == aName) { SVGAnimatedTransformList* transformList = GetAnimatedTransformList(); return transformList ? transformList->ToSMILAttr(this) : nsnull; @@ -2322,9 +2313,8 @@ nsSVGElement::AnimationNeedsResample() void nsSVGElement::FlushAnimations() { nsIDocument* doc = GetCurrentDoc(); if (doc && doc->HasAnimationController()) { doc->GetAnimationController()->FlushResampleRequests(); } } -#endif // MOZ_SMIL
--- a/content/svg/content/src/nsSVGElement.h +++ b/content/svg/content/src/nsSVGElement.h @@ -46,20 +46,18 @@ #include "nsString.h" #include "nsCOMPtr.h" #include "nsIDOMSVGElement.h" #include "nsGenericElement.h" #include "nsStyledElement.h" #include "mozilla/css/StyleRule.h" -#ifdef MOZ_SMIL #include "nsISMILAttr.h" #include "nsSMILAnimationController.h" -#endif class nsSVGSVGElement; class nsSVGLength2; class nsSVGNumber2; class nsSVGNumberPair; class nsSVGInteger; class nsSVGIntegerPair; class nsSVGAngle; @@ -215,24 +213,19 @@ public: return nsnull; } // Despite the fact that animated transform lists are used for a variety of // attributes, no SVG element uses more than one. virtual SVGAnimatedTransformList* GetAnimatedTransformList() { return nsnull; } -#ifdef MOZ_SMIL virtual nsISMILAttr* GetAnimatedAttr(PRInt32 aNamespaceID, nsIAtom* aName); void AnimationNeedsResample(); void FlushAnimations(); -#else - void AnimationNeedsResample() { /* do nothing */ } - void FlushAnimations() { /* do nothing */ } -#endif virtual void RecompileScriptEventListeners(); void GetStringBaseValue(PRUint8 aAttrEnum, nsAString& aResult) const; void SetStringBaseValue(PRUint8 aAttrEnum, const nsAString& aValue); virtual nsIAtom* GetPointListAttrName() const { return nsnull; @@ -252,20 +245,18 @@ protected: static nsresult ReportAttributeParseFailure(nsIDocument* aDocument, nsIAtom* aAttribute, const nsAString& aValue); // Hooks for subclasses virtual bool IsEventName(nsIAtom* aName); void UpdateContentStyleRule(); -#ifdef MOZ_SMIL void UpdateAnimatedContentStyleRule(); mozilla::css::StyleRule* GetAnimatedContentStyleRule(); -#endif // MOZ_SMIL static nsIAtom* GetEventNameForAttr(nsIAtom* aAttr); struct LengthInfo { nsIAtom** mName; float mDefaultValue; PRUint8 mDefaultUnitType; PRUint8 mCtxType;
--- a/content/svg/content/src/nsSVGElementFactory.cpp +++ b/content/svg/content/src/nsSVGElementFactory.cpp @@ -218,33 +218,31 @@ NS_NewSVGFESpecularLightingElement(nsICo already_AddRefed<nsINodeInfo> aNodeInfo); nsresult NS_NewSVGFEImageElement(nsIContent **aResult, already_AddRefed<nsINodeInfo> aNodeInfo); nsresult NS_NewSVGFEDisplacementMapElement(nsIContent **aResult, already_AddRefed<nsINodeInfo> aNodeInfo); -#ifdef MOZ_SMIL nsresult NS_NewSVGAnimateElement(nsIContent **aResult, already_AddRefed<nsINodeInfo> aNodeInfo); nsresult NS_NewSVGAnimateTransformElement(nsIContent **aResult, already_AddRefed<nsINodeInfo> aNodeInfo); nsresult NS_NewSVGAnimateMotionElement(nsIContent **aResult, already_AddRefed<nsINodeInfo> aNodeInfo); nsresult NS_NewSVGMpathElement(nsIContent **aResult, already_AddRefed<nsINodeInfo> aNodeInfo); nsresult NS_NewSVGSetElement(nsIContent **aResult, already_AddRefed<nsINodeInfo> aNodeInfo); -#endif // MOZ_SMIL nsresult NS_NewSVGElement(nsIContent** aResult, already_AddRefed<nsINodeInfo> aNodeInfo, FromParser aFromParser) { static const char kSVGStyleSheetURI[] = "resource://gre/res/svg.css"; // this bit of code is to load svg.css on demand @@ -363,27 +361,25 @@ NS_NewSVGElement(nsIContent** aResult, a if (name == nsGkAtoms::feDisplacementMap) return NS_NewSVGFEDisplacementMapElement(aResult, aNodeInfo); if (name == nsGkAtoms::pattern) return NS_NewSVGPatternElement(aResult, aNodeInfo); if (name == nsGkAtoms::mask) return NS_NewSVGMaskElement(aResult, aNodeInfo); if (name == nsGkAtoms::svgSwitch) return NS_NewSVGSwitchElement(aResult, aNodeInfo); -#ifdef MOZ_SMIL if (NS_SMILEnabled()) { if (name == nsGkAtoms::animate) return NS_NewSVGAnimateElement(aResult, aNodeInfo); if (name == nsGkAtoms::animateTransform) return NS_NewSVGAnimateTransformElement(aResult, aNodeInfo); if (name == nsGkAtoms::animateMotion) return NS_NewSVGAnimateMotionElement(aResult, aNodeInfo); if (name == nsGkAtoms::mpath) return NS_NewSVGMpathElement(aResult, aNodeInfo); if (name == nsGkAtoms::set) return NS_NewSVGSetElement(aResult, aNodeInfo); } -#endif // MOZ_SMIL // if we don't know what to create, just create a standard xml element: return NS_NewXMLElement(aResult, aNodeInfo); }
--- a/content/svg/content/src/nsSVGEnum.cpp +++ b/content/svg/content/src/nsSVGEnum.cpp @@ -32,20 +32,18 @@ * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ #include "nsSVGEnum.h" #include "nsIAtom.h" #include "nsSVGElement.h" -#ifdef MOZ_SMIL #include "nsSMILValue.h" #include "SMILEnumType.h" -#endif // MOZ_SMIL using namespace mozilla; NS_SVG_VAL_IMPL_CYCLE_COLLECTION(nsSVGEnum::DOMAnimatedEnum, mSVGElement) NS_IMPL_CYCLE_COLLECTING_ADDREF(nsSVGEnum::DOMAnimatedEnum) NS_IMPL_CYCLE_COLLECTING_RELEASE(nsSVGEnum::DOMAnimatedEnum) @@ -79,21 +77,19 @@ nsSVGEnum::SetBaseValueString(const nsAS while (mapping && mapping->mKey) { if (valAtom == *(mapping->mKey)) { mIsBaseSet = true; if (mBaseVal != mapping->mVal) { mBaseVal = mapping->mVal; if (!mIsAnimated) { mAnimVal = mBaseVal; } -#ifdef MOZ_SMIL else { aSVGElement->AnimationNeedsResample(); } -#endif // We don't need to call DidChange* here - we're only called by // nsSVGElement::ParseAttribute under nsGenericElement::SetAttr, // which takes care of notifying. } return NS_OK; } mapping++; } @@ -127,21 +123,19 @@ nsSVGEnum::SetBaseValue(PRUint16 aValue, while (mapping && mapping->mKey) { if (mapping->mVal == aValue) { mIsBaseSet = true; if (mBaseVal != PRUint8(aValue)) { mBaseVal = PRUint8(aValue); if (!mIsAnimated) { mAnimVal = mBaseVal; } -#ifdef MOZ_SMIL else { aSVGElement->AnimationNeedsResample(); } -#endif aSVGElement->DidChangeEnum(mAttrEnum, true); } return NS_OK; } mapping++; } return NS_ERROR_DOM_SYNTAX_ERR; } @@ -161,17 +155,16 @@ nsSVGEnum::ToDOMAnimatedEnum(nsIDOMSVGAn *aResult = new DOMAnimatedEnum(this, aSVGElement); if (!*aResult) return NS_ERROR_OUT_OF_MEMORY; NS_ADDREF(*aResult); return NS_OK; } -#ifdef MOZ_SMIL nsISMILAttr* nsSVGEnum::ToSMILAttr(nsSVGElement *aSVGElement) { return new SMILEnum(this, aSVGElement); } nsresult nsSVGEnum::SMILEnum::ValueFromString(const nsAString& aStr, @@ -222,9 +215,8 @@ nsSVGEnum::SMILEnum::SetAnimValue(const "Unexpected type to assign animated value"); if (aValue.mType == &SMILEnumType::sSingleton) { NS_ABORT_IF_FALSE(aValue.mU.mUint <= USHRT_MAX, "Very large enumerated value - too big for PRUint16"); mVal->SetAnimValue(PRUint16(aValue.mU.mUint), mSVGElement); } return NS_OK; } -#endif // MOZ_SMIL
--- a/content/svg/content/src/nsSVGEnum.h +++ b/content/svg/content/src/nsSVGEnum.h @@ -71,20 +71,18 @@ public: void SetAnimValue(PRUint16 aValue, nsSVGElement *aSVGElement); PRUint16 GetAnimValue() const { return mAnimVal; } bool IsExplicitlySet() const { return mIsAnimated || mIsBaseSet; } nsresult ToDOMAnimatedEnum(nsIDOMSVGAnimatedEnumeration **aResult, nsSVGElement* aSVGElement); -#ifdef MOZ_SMIL // Returns a new nsISMILAttr object that the caller must delete nsISMILAttr* ToSMILAttr(nsSVGElement* aSVGElement); -#endif // MOZ_SMIL private: nsSVGEnumValue mAnimVal; nsSVGEnumValue mBaseVal; PRUint8 mAttrEnum; // element specified tracking for attribute bool mIsAnimated; bool mIsBaseSet; @@ -106,25 +104,22 @@ public: { *aResult = mVal->GetBaseValue(); return NS_OK; } NS_IMETHOD SetBaseVal(PRUint16 aValue) { return mVal->SetBaseValue(aValue, mSVGElement); } // Script may have modified animation parameters or timeline -- DOM getters // need to flush any resample requests to reflect these modifications. NS_IMETHOD GetAnimVal(PRUint16* aResult) { -#ifdef MOZ_SMIL mSVGElement->FlushAnimations(); -#endif *aResult = mVal->GetAnimValue(); return NS_OK; } }; -#ifdef MOZ_SMIL struct SMILEnum : public nsISMILAttr { public: SMILEnum(nsSVGEnum* aVal, nsSVGElement* aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} // These will stay alive because a nsISMILAttr only lives as long // as the Compositing step, and DOM elements don't get a chance to @@ -136,12 +131,11 @@ public: virtual nsresult ValueFromString(const nsAString& aStr, const nsISMILAnimationElement* aSrcElement, nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const; virtual nsSMILValue GetBaseValue() const; virtual void ClearAnimValue(); virtual nsresult SetAnimValue(const nsSMILValue& aValue); }; -#endif // MOZ_SMIL }; #endif //__NS_SVGENUM_H__
--- a/content/svg/content/src/nsSVGInteger.cpp +++ b/content/svg/content/src/nsSVGInteger.cpp @@ -30,20 +30,18 @@ * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ #include "nsSVGInteger.h" -#ifdef MOZ_SMIL #include "nsSMILValue.h" #include "SMILIntegerType.h" -#endif // MOZ_SMIL using namespace mozilla; NS_SVG_VAL_IMPL_CYCLE_COLLECTION(nsSVGInteger::DOMAnimatedInteger, mSVGElement) NS_IMPL_CYCLE_COLLECTING_ADDREF(nsSVGInteger::DOMAnimatedInteger) NS_IMPL_CYCLE_COLLECTING_RELEASE(nsSVGInteger::DOMAnimatedInteger) @@ -89,21 +87,19 @@ nsSVGInteger::SetBaseValueString(const n return rv; } mIsBaseSet = true; mBaseVal = value; if (!mIsAnimated) { mAnimVal = mBaseVal; } -#ifdef MOZ_SMIL else { aSVGElement->AnimationNeedsResample(); } -#endif return NS_OK; } void nsSVGInteger::GetBaseValueString(nsAString & aValueAsString) { aValueAsString.Truncate(); aValueAsString.AppendInt(mBaseVal); @@ -113,21 +109,19 @@ void nsSVGInteger::SetBaseValue(int aValue, nsSVGElement *aSVGElement) { mBaseVal = aValue; mIsBaseSet = true; if (!mIsAnimated) { mAnimVal = mBaseVal; } -#ifdef MOZ_SMIL else { aSVGElement->AnimationNeedsResample(); } -#endif aSVGElement->DidChangeInteger(mAttrEnum, true); } void nsSVGInteger::SetAnimValue(int aValue, nsSVGElement *aSVGElement) { mAnimVal = aValue; mIsAnimated = true; @@ -141,17 +135,16 @@ nsSVGInteger::ToDOMAnimatedInteger(nsIDO *aResult = new DOMAnimatedInteger(this, aSVGElement); if (!*aResult) return NS_ERROR_OUT_OF_MEMORY; NS_ADDREF(*aResult); return NS_OK; } -#ifdef MOZ_SMIL nsISMILAttr* nsSVGInteger::ToSMILAttr(nsSVGElement *aSVGElement) { return new SMILInteger(this, aSVGElement); } nsresult nsSVGInteger::SMILInteger::ValueFromString(const nsAString& aStr, @@ -195,9 +188,8 @@ nsSVGInteger::SMILInteger::SetAnimValue( { NS_ASSERTION(aValue.mType == &SMILIntegerType::sSingleton, "Unexpected type to assign animated value"); if (aValue.mType == &SMILIntegerType::sSingleton) { mVal->SetAnimValue(int(aValue.mU.mInt), mSVGElement); } return NS_OK; } -#endif // MOZ_SMIL
--- a/content/svg/content/src/nsSVGInteger.h +++ b/content/svg/content/src/nsSVGInteger.h @@ -69,20 +69,18 @@ public: // explicitly set by markup or a DOM call), false otherwise. // If this returns false, the animated value is still valid, that is, // useable, and represents the default base value of the attribute. bool IsExplicitlySet() const { return mIsAnimated || mIsBaseSet; } nsresult ToDOMAnimatedInteger(nsIDOMSVGAnimatedInteger **aResult, nsSVGElement* aSVGElement); -#ifdef MOZ_SMIL // Returns a new nsISMILAttr object that the caller must delete nsISMILAttr* ToSMILAttr(nsSVGElement* aSVGElement); -#endif // MOZ_SMIL private: PRInt32 mAnimVal; PRInt32 mBaseVal; PRUint8 mAttrEnum; // element specified tracking for attribute bool mIsAnimated; bool mIsBaseSet; @@ -103,25 +101,22 @@ public: { *aResult = mVal->GetBaseValue(); return NS_OK; } NS_IMETHOD SetBaseVal(PRInt32 aValue) { mVal->SetBaseValue(aValue, mSVGElement); return NS_OK; } // Script may have modified animation parameters or timeline -- DOM getters // need to flush any resample requests to reflect these modifications. NS_IMETHOD GetAnimVal(PRInt32* aResult) { -#ifdef MOZ_SMIL mSVGElement->FlushAnimations(); -#endif *aResult = mVal->GetAnimValue(); return NS_OK; } }; -#ifdef MOZ_SMIL struct SMILInteger : public nsISMILAttr { public: SMILInteger(nsSVGInteger* aVal, nsSVGElement* aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} // These will stay alive because a nsISMILAttr only lives as long // as the Compositing step, and DOM elements don't get a chance to @@ -133,12 +128,11 @@ public: virtual nsresult ValueFromString(const nsAString& aStr, const nsISMILAnimationElement* aSrcElement, nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const; virtual nsSMILValue GetBaseValue() const; virtual void ClearAnimValue(); virtual nsresult SetAnimValue(const nsSMILValue& aValue); }; -#endif // MOZ_SMIL }; #endif //__NS_SVGINTEGER_H__
--- a/content/svg/content/src/nsSVGIntegerPair.cpp +++ b/content/svg/content/src/nsSVGIntegerPair.cpp @@ -34,20 +34,18 @@ * * ***** END LICENSE BLOCK ***** */ #include "nsSVGIntegerPair.h" #include "nsSVGUtils.h" #include "nsCharSeparatedTokenizer.h" #include "nsDOMError.h" #include "nsMathUtils.h" -#ifdef MOZ_SMIL #include "nsSMILValue.h" #include "SVGIntegerPairSMILType.h" -#endif // MOZ_SMIL using namespace mozilla; NS_SVG_VAL_IMPL_CYCLE_COLLECTION(nsSVGIntegerPair::DOMAnimatedInteger, mSVGElement) NS_IMPL_CYCLE_COLLECTING_ADDREF(nsSVGIntegerPair::DOMAnimatedInteger) NS_IMPL_CYCLE_COLLECTING_RELEASE(nsSVGIntegerPair::DOMAnimatedInteger) @@ -114,21 +112,19 @@ nsSVGIntegerPair::SetBaseValueString(con mBaseVal[0] = val[0]; mBaseVal[1] = val[1]; mIsBaseSet = true; if (!mIsAnimated) { mAnimVal[0] = mBaseVal[0]; mAnimVal[1] = mBaseVal[1]; } -#ifdef MOZ_SMIL else { aSVGElement->AnimationNeedsResample(); } -#endif // We don't need to call DidChange* here - we're only called by // nsSVGElement::ParseAttribute under nsGenericElement::SetAttr, // which takes care of notifying. return NS_OK; } void @@ -147,40 +143,36 @@ nsSVGIntegerPair::SetBaseValue(PRInt32 a nsSVGElement *aSVGElement) { PRUint32 index = (aPairIndex == eFirst ? 0 : 1); mBaseVal[index] = aValue; mIsBaseSet = true; if (!mIsAnimated) { mAnimVal[index] = aValue; } -#ifdef MOZ_SMIL else { aSVGElement->AnimationNeedsResample(); } -#endif aSVGElement->DidChangeIntegerPair(mAttrEnum, true); } void nsSVGIntegerPair::SetBaseValues(PRInt32 aValue1, PRInt32 aValue2, nsSVGElement *aSVGElement) { mBaseVal[0] = aValue1; mBaseVal[1] = aValue2; mIsBaseSet = true; if (!mIsAnimated) { mAnimVal[0] = aValue1; mAnimVal[1] = aValue2; } -#ifdef MOZ_SMIL else { aSVGElement->AnimationNeedsResample(); } -#endif aSVGElement->DidChangeIntegerPair(mAttrEnum, true); } void nsSVGIntegerPair::SetAnimValue(const PRInt32 aValue[2], nsSVGElement *aSVGElement) { mAnimVal[0] = aValue[0]; mAnimVal[1] = aValue[1]; @@ -193,17 +185,16 @@ nsSVGIntegerPair::ToDOMAnimatedInteger(n PairIndex aIndex, nsSVGElement *aSVGElement) { *aResult = new DOMAnimatedInteger(this, aIndex, aSVGElement); NS_ADDREF(*aResult); return NS_OK; } -#ifdef MOZ_SMIL nsISMILAttr* nsSVGIntegerPair::ToSMILAttr(nsSVGElement *aSVGElement) { return new SMILIntegerPair(this, aSVGElement); } nsresult nsSVGIntegerPair::SMILIntegerPair::ValueFromString(const nsAString& aStr, @@ -250,9 +241,8 @@ nsSVGIntegerPair::SMILIntegerPair::SetAn { NS_ASSERTION(aValue.mType == &SVGIntegerPairSMILType::sSingleton, "Unexpected type to assign animated value"); if (aValue.mType == &SVGIntegerPairSMILType::sSingleton) { mVal->SetAnimValue(aValue.mU.mIntPair, mSVGElement); } return NS_OK; } -#endif // MOZ_SMIL
--- a/content/svg/content/src/nsSVGIntegerPair.h +++ b/content/svg/content/src/nsSVGIntegerPair.h @@ -36,21 +36,19 @@ #ifndef __NS_SVGINTEGERPAIR_H__ #define __NS_SVGINTEGERPAIR_H__ #include "nsIDOMSVGAnimatedInteger.h" #include "nsSVGElement.h" #include "nsDOMError.h" -#ifdef MOZ_SMIL #include "nsISMILAttr.h" class nsSMILValue; class nsISMILType; -#endif // MOZ_SMIL class nsSVGIntegerPair { public: enum PairIndex { eFirst, eSecond @@ -82,20 +80,18 @@ public: // If this returns false, the animated value is still valid, that is, // useable, and represents the default base value of the attribute. bool IsExplicitlySet() const { return mIsAnimated || mIsBaseSet; } nsresult ToDOMAnimatedInteger(nsIDOMSVGAnimatedInteger **aResult, PairIndex aIndex, nsSVGElement* aSVGElement); -#ifdef MOZ_SMIL // Returns a new nsISMILAttr object that the caller must delete nsISMILAttr* ToSMILAttr(nsSVGElement* aSVGElement); -#endif // MOZ_SMIL private: PRInt32 mAnimVal[2]; PRInt32 mBaseVal[2]; PRUint8 mAttrEnum; // element specified tracking for attribute bool mIsAnimated; bool mIsBaseSet; @@ -120,25 +116,22 @@ public: mVal->SetBaseValue(aValue, mIndex, mSVGElement); return NS_OK; } // Script may have modified animation parameters or timeline -- DOM getters // need to flush any resample requests to reflect these modifications. NS_IMETHOD GetAnimVal(PRInt32* aResult) { -#ifdef MOZ_SMIL mSVGElement->FlushAnimations(); -#endif *aResult = mVal->GetAnimValue(mIndex); return NS_OK; } }; -#ifdef MOZ_SMIL struct SMILIntegerPair : public nsISMILAttr { public: SMILIntegerPair(nsSVGIntegerPair* aVal, nsSVGElement* aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} // These will stay alive because a nsISMILAttr only lives as long // as the Compositing step, and DOM elements don't get a chance to @@ -150,12 +143,11 @@ public: virtual nsresult ValueFromString(const nsAString& aStr, const nsISMILAnimationElement* aSrcElement, nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const; virtual nsSMILValue GetBaseValue() const; virtual void ClearAnimValue(); virtual nsresult SetAnimValue(const nsSMILValue& aValue); }; -#endif // MOZ_SMIL }; #endif //__NS_SVGINTEGERPAIR_H__
--- a/content/svg/content/src/nsSVGLength2.cpp +++ b/content/svg/content/src/nsSVGLength2.cpp @@ -41,20 +41,18 @@ #include "nsSVGLength2.h" #include "prdtoa.h" #include "nsTextFormatter.h" #include "nsSVGSVGElement.h" #include "nsIFrame.h" #include "nsSVGIntegrationUtils.h" #include "nsSVGAttrTearoffTable.h" #include "nsContentUtils.h" // NS_ENSURE_FINITE -#ifdef MOZ_SMIL #include "nsSMILValue.h" #include "nsSMILFloatType.h" -#endif // MOZ_SMIL using namespace mozilla; NS_SVG_VAL_IMPL_CYCLE_COLLECTION(nsSVGLength2::DOMBaseVal, mSVGElement) NS_SVG_VAL_IMPL_CYCLE_COLLECTION(nsSVGLength2::DOMAnimVal, mSVGElement) NS_SVG_VAL_IMPL_CYCLE_COLLECTION(nsSVGLength2::DOMAnimatedLength, mSVGElement) @@ -311,21 +309,19 @@ void nsSVGLength2::SetBaseValueInSpecifiedUnits(float aValue, nsSVGElement *aSVGElement) { mBaseVal = aValue; mIsBaseSet = true; if (!mIsAnimated) { mAnimVal = mBaseVal; } -#ifdef MOZ_SMIL else { aSVGElement->AnimationNeedsResample(); } -#endif aSVGElement->DidChangeLength(mAttrEnum, true); } nsresult nsSVGLength2::ConvertToSpecifiedUnits(PRUint16 unitType, nsSVGElement *aSVGElement) { if (!IsValidUnitType(unitType)) @@ -350,21 +346,19 @@ nsSVGLength2::NewValueSpecifiedUnits(PRU return NS_ERROR_DOM_NOT_SUPPORTED_ERR; mBaseVal = valueInSpecifiedUnits; mIsBaseSet = true; mSpecifiedUnitType = PRUint8(unitType); if (!mIsAnimated) { mAnimVal = mBaseVal; } -#ifdef MOZ_SMIL else { aSVGElement->AnimationNeedsResample(); } -#endif aSVGElement->DidChangeLength(mAttrEnum, true); return NS_OK; } nsresult nsSVGLength2::ToDOMBaseVal(nsIDOMSVGLength **aResult, nsSVGElement *aSVGElement) { *aResult = sBaseSVGLengthTearoffTable.GetTearoff(this); @@ -420,21 +414,19 @@ nsSVGLength2::SetBaseValueString(const n } mBaseVal = value; mIsBaseSet = true; mSpecifiedUnitType = PRUint8(unitType); if (!mIsAnimated) { mAnimVal = mBaseVal; } -#ifdef MOZ_SMIL else { aSVGElement->AnimationNeedsResample(); } -#endif aSVGElement->DidChangeLength(mAttrEnum, aDoSetAttr); return NS_OK; } void nsSVGLength2::GetBaseValueString(nsAString & aValueAsString) { @@ -488,17 +480,16 @@ nsSVGLength2::ToDOMAnimatedLength(nsIDOM return NS_OK; } nsSVGLength2::DOMAnimatedLength::~DOMAnimatedLength() { sSVGAnimatedLengthTearoffTable.RemoveTearoff(mVal); } -#ifdef MOZ_SMIL nsISMILAttr* nsSVGLength2::ToSMILAttr(nsSVGElement *aSVGElement) { return new SMILLength(this, aSVGElement); } nsresult nsSVGLength2::SMILLength::ValueFromString(const nsAString& aStr, @@ -547,9 +538,8 @@ nsSVGLength2::SMILLength::SetAnimValue(c { NS_ASSERTION(aValue.mType == &nsSMILFloatType::sSingleton, "Unexpected type to assign animated value"); if (aValue.mType == &nsSMILFloatType::sSingleton) { mVal->SetAnimValue(float(aValue.mU.mDouble), mSVGElement); } return NS_OK; } -#endif // MOZ_SMIL
--- a/content/svg/content/src/nsSVGLength2.h +++ b/content/svg/content/src/nsSVGLength2.h @@ -39,21 +39,19 @@ #include "nsIDOMSVGLength.h" #include "nsIDOMSVGAnimatedLength.h" #include "nsSVGUtils.h" #include "nsSVGElement.h" #include "nsDOMError.h" #include "nsMathUtils.h" -#ifdef MOZ_SMIL #include "nsISMILAttr.h" class nsSMILValue; class nsISMILType; -#endif // MOZ_SMIL class nsIFrame; class nsSVGLength2 { public: void Init(PRUint8 aCtxType = nsSVGUtils::XY, @@ -107,20 +105,18 @@ public: // explicitly set by markup or a DOM call), false otherwise. // If this returns false, the animated value is still valid, that is, // useable, and represents the default base value of the attribute. bool IsExplicitlySet() const { return mIsAnimated || mIsBaseSet; } nsresult ToDOMAnimatedLength(nsIDOMSVGAnimatedLength **aResult, nsSVGElement* aSVGElement); -#ifdef MOZ_SMIL // Returns a new nsISMILAttr object that the caller must delete nsISMILAttr* ToSMILAttr(nsSVGElement* aSVGElement); -#endif // MOZ_SMIL private: float mAnimVal; float mBaseVal; PRUint8 mSpecifiedUnitType; PRUint8 mAttrEnum; // element specified tracking for attribute PRUint8 mCtxType; // X, Y or Unspecified @@ -218,52 +214,44 @@ private: nsSVGLength2* mVal; // kept alive because it belongs to mSVGElement nsRefPtr<nsSVGElement> mSVGElement; // Script may have modified animation parameters or timeline -- DOM getters // need to flush any resample requests to reflect these modifications. NS_IMETHOD GetUnitType(PRUint16* aResult) { -#ifdef MOZ_SMIL mSVGElement->FlushAnimations(); -#endif *aResult = mVal->mSpecifiedUnitType; return NS_OK; } NS_IMETHOD GetValue(float* aResult) { -#ifdef MOZ_SMIL mSVGElement->FlushAnimations(); -#endif *aResult = mVal->GetAnimValue(mSVGElement); return NS_OK; } NS_IMETHOD SetValue(float aValue) { return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR; } NS_IMETHOD GetValueInSpecifiedUnits(float* aResult) { -#ifdef MOZ_SMIL mSVGElement->FlushAnimations(); -#endif *aResult = mVal->mAnimVal; return NS_OK; } NS_IMETHOD SetValueInSpecifiedUnits(float aValue) { return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR; } NS_IMETHOD SetValueAsString(const nsAString& aValue) { return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR; } NS_IMETHOD GetValueAsString(nsAString& aValue) { -#ifdef MOZ_SMIL mSVGElement->FlushAnimations(); -#endif mVal->GetAnimValueString(aValue); return NS_OK; } NS_IMETHOD NewValueSpecifiedUnits(PRUint16 unitType, float valueInSpecifiedUnits) { return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR; } @@ -286,17 +274,16 @@ public: NS_IMETHOD GetBaseVal(nsIDOMSVGLength **aBaseVal) { return mVal->ToDOMBaseVal(aBaseVal, mSVGElement); } NS_IMETHOD GetAnimVal(nsIDOMSVGLength **aAnimVal) { return mVal->ToDOMAnimVal(aAnimVal, mSVGElement); } }; -#ifdef MOZ_SMIL struct SMILLength : public nsISMILAttr { public: SMILLength(nsSVGLength2* aVal, nsSVGElement *aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} // These will stay alive because a nsISMILAttr only lives as long // as the Compositing step, and DOM elements don't get a chance to @@ -308,12 +295,11 @@ public: virtual nsresult ValueFromString(const nsAString& aStr, const nsISMILAnimationElement* aSrcElement, nsSMILValue &aValue, bool& aPreventCachingOfSandwich) const; virtual nsSMILValue GetBaseValue() const; virtual void ClearAnimValue(); virtual nsresult SetAnimValue(const nsSMILValue& aValue); }; -#endif // MOZ_SMIL }; #endif // __NS_SVGLENGTH2_H__
--- a/content/svg/content/src/nsSVGNumber2.cpp +++ b/content/svg/content/src/nsSVGNumber2.cpp @@ -35,20 +35,18 @@ * ***** END LICENSE BLOCK ***** */ #include "nsSVGNumber2.h" #include "nsSVGUtils.h" #include "nsTextFormatter.h" #include "prdtoa.h" #include "nsMathUtils.h" #include "nsContentUtils.h" // NS_ENSURE_FINITE -#ifdef MOZ_SMIL #include "nsSMILValue.h" #include "nsSMILFloatType.h" -#endif // MOZ_SMIL class DOMSVGNumber : public nsIDOMSVGNumber { public: NS_DECL_ISUPPORTS DOMSVGNumber() : mVal(0) {} @@ -127,21 +125,19 @@ nsSVGNumber2::SetBaseValueString(const n return rv; } mBaseVal = val; mIsBaseSet = true; if (!mIsAnimated) { mAnimVal = mBaseVal; } -#ifdef MOZ_SMIL else { aSVGElement->AnimationNeedsResample(); } -#endif // We don't need to call DidChange* here - we're only called by // nsSVGElement::ParseAttribute under nsGenericElement::SetAttr, // which takes care of notifying. return NS_OK; } void @@ -155,21 +151,19 @@ void nsSVGNumber2::SetBaseValue(float aValue, nsSVGElement *aSVGElement) { mBaseVal = aValue; mIsBaseSet = true; if (!mIsAnimated) { mAnimVal = mBaseVal; } -#ifdef MOZ_SMIL else { aSVGElement->AnimationNeedsResample(); } -#endif aSVGElement->DidChangeNumber(mAttrEnum, true); } void nsSVGNumber2::SetAnimValue(float aValue, nsSVGElement *aSVGElement) { mAnimVal = aValue; mIsAnimated = true; @@ -183,17 +177,16 @@ nsSVGNumber2::ToDOMAnimatedNumber(nsIDOM *aResult = new DOMAnimatedNumber(this, aSVGElement); if (!*aResult) return NS_ERROR_OUT_OF_MEMORY; NS_ADDREF(*aResult); return NS_OK; } -#ifdef MOZ_SMIL nsISMILAttr* nsSVGNumber2::ToSMILAttr(nsSVGElement *aSVGElement) { return new SMILNumber(this, aSVGElement); } nsresult nsSVGNumber2::SMILNumber::ValueFromString(const nsAString& aStr, @@ -240,9 +233,8 @@ nsSVGNumber2::SMILNumber::SetAnimValue(c { NS_ASSERTION(aValue.mType == &nsSMILFloatType::sSingleton, "Unexpected type to assign animated value"); if (aValue.mType == &nsSMILFloatType::sSingleton) { mVal->SetAnimValue(float(aValue.mU.mDouble), mSVGElement); } return NS_OK; } -#endif // MOZ_SMIL
--- a/content/svg/content/src/nsSVGNumber2.h +++ b/content/svg/content/src/nsSVGNumber2.h @@ -38,21 +38,19 @@ #define __NS_SVGNUMBER2_H__ #include "nsIDOMSVGNumber.h" #include "nsIDOMSVGAnimatedNumber.h" #include "nsSVGElement.h" #include "nsDOMError.h" #include "nsMathUtils.h" -#ifdef MOZ_SMIL #include "nsISMILAttr.h" class nsSMILValue; class nsISMILType; -#endif // MOZ_SMIL class nsSVGNumber2 { public: void Init(PRUint8 aAttrEnum = 0xff, float aValue = 0) { mAnimVal = mBaseVal = aValue; mAttrEnum = aAttrEnum; @@ -76,20 +74,18 @@ public: // explicitly set by markup or a DOM call), false otherwise. // If this returns false, the animated value is still valid, that is, // useable, and represents the default base value of the attribute. bool IsExplicitlySet() const { return mIsAnimated || mIsBaseSet; } nsresult ToDOMAnimatedNumber(nsIDOMSVGAnimatedNumber **aResult, nsSVGElement* aSVGElement); -#ifdef MOZ_SMIL // Returns a new nsISMILAttr object that the caller must delete nsISMILAttr* ToSMILAttr(nsSVGElement* aSVGElement); -#endif // MOZ_SMIL private: float mAnimVal; float mBaseVal; PRUint8 mAttrEnum; // element specified tracking for attribute bool mIsAnimated; bool mIsBaseSet; @@ -116,25 +112,22 @@ public: mVal->SetBaseValue(aValue, mSVGElement); return NS_OK; } // Script may have modified animation parameters or timeline -- DOM getters // need to flush any resample requests to reflect these modifications. NS_IMETHOD GetAnimVal(float* aResult) { -#ifdef MOZ_SMIL mSVGElement->FlushAnimations(); -#endif *aResult = mVal->GetAnimValue(); return NS_OK; } }; -#ifdef MOZ_SMIL struct SMILNumber : public nsISMILAttr { public: SMILNumber(nsSVGNumber2* aVal, nsSVGElement* aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} // These will stay alive because a nsISMILAttr only lives as long // as the Compositing step, and DOM elements don't get a chance to @@ -146,12 +139,11 @@ public: virtual nsresult ValueFromString(const nsAString& aStr, const nsISMILAnimationElement* aSrcElement, nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const; virtual nsSMILValue GetBaseValue() const; virtual void ClearAnimValue(); virtual nsresult SetAnimValue(const nsSMILValue& aValue); }; -#endif // MOZ_SMIL }; #endif //__NS_SVGNUMBER2_H__
--- a/content/svg/content/src/nsSVGNumberPair.cpp +++ b/content/svg/content/src/nsSVGNumberPair.cpp @@ -35,20 +35,18 @@ * ***** END LICENSE BLOCK ***** */ #include "nsSVGNumberPair.h" #include "nsSVGUtils.h" #include "nsCharSeparatedTokenizer.h" #include "prdtoa.h" #include "nsDOMError.h" #include "nsMathUtils.h" -#ifdef MOZ_SMIL #include "nsSMILValue.h" #include "SVGNumberPairSMILType.h" -#endif // MOZ_SMIL using namespace mozilla; NS_SVG_VAL_IMPL_CYCLE_COLLECTION(nsSVGNumberPair::DOMAnimatedNumber, mSVGElement) NS_IMPL_CYCLE_COLLECTING_ADDREF(nsSVGNumberPair::DOMAnimatedNumber) NS_IMPL_CYCLE_COLLECTING_RELEASE(nsSVGNumberPair::DOMAnimatedNumber) @@ -114,21 +112,19 @@ nsSVGNumberPair::SetBaseValueString(cons mBaseVal[0] = val[0]; mBaseVal[1] = val[1]; mIsBaseSet = true; if (!mIsAnimated) { mAnimVal[0] = mBaseVal[0]; mAnimVal[1] = mBaseVal[1]; } -#ifdef MOZ_SMIL else { aSVGElement->AnimationNeedsResample(); } -#endif // We don't need to call DidChange* here - we're only called by // nsSVGElement::ParseAttribute under nsGenericElement::SetAttr, // which takes care of notifying. return NS_OK; } void @@ -147,40 +143,36 @@ nsSVGNumberPair::SetBaseValue(float aVal nsSVGElement *aSVGElement) { PRUint32 index = (aPairIndex == eFirst ? 0 : 1); mBaseVal[index] = aValue; mIsBaseSet = true; if (!mIsAnimated) { mAnimVal[index] = aValue; } -#ifdef MOZ_SMIL else { aSVGElement->AnimationNeedsResample(); } -#endif aSVGElement->DidChangeNumberPair(mAttrEnum, true); } void nsSVGNumberPair::SetBaseValues(float aValue1, float aValue2, nsSVGElement *aSVGElement) { mBaseVal[0] = aValue1; mBaseVal[1] = aValue2; mIsBaseSet = true; if (!mIsAnimated) { mAnimVal[0] = aValue1; mAnimVal[1] = aValue2; } -#ifdef MOZ_SMIL else { aSVGElement->AnimationNeedsResample(); } -#endif aSVGElement->DidChangeNumberPair(mAttrEnum, true); } void nsSVGNumberPair::SetAnimValue(const float aValue[2], nsSVGElement *aSVGElement) { mAnimVal[0] = aValue[0]; mAnimVal[1] = aValue[1]; @@ -193,17 +185,16 @@ nsSVGNumberPair::ToDOMAnimatedNumber(nsI PairIndex aIndex, nsSVGElement *aSVGElement) { *aResult = new DOMAnimatedNumber(this, aIndex, aSVGElement); NS_ADDREF(*aResult); return NS_OK; } -#ifdef MOZ_SMIL nsISMILAttr* nsSVGNumberPair::ToSMILAttr(nsSVGElement *aSVGElement) { return new SMILNumberPair(this, aSVGElement); } nsresult nsSVGNumberPair::SMILNumberPair::ValueFromString(const nsAString& aStr, @@ -250,9 +241,8 @@ nsSVGNumberPair::SMILNumberPair::SetAnim { NS_ASSERTION(aValue.mType == &SVGNumberPairSMILType::sSingleton, "Unexpected type to assign animated value"); if (aValue.mType == &SVGNumberPairSMILType::sSingleton) { mVal->SetAnimValue(aValue.mU.mNumberPair, mSVGElement); } return NS_OK; } -#endif // MOZ_SMIL
--- a/content/svg/content/src/nsSVGNumberPair.h +++ b/content/svg/content/src/nsSVGNumberPair.h @@ -38,21 +38,19 @@ #define __NS_SVGNUMBERPAIR_H__ #include "nsIDOMSVGNumber.h" #include "nsIDOMSVGAnimatedNumber.h" #include "nsSVGElement.h" #include "nsDOMError.h" #include "nsMathUtils.h" -#ifdef MOZ_SMIL #include "nsISMILAttr.h" class nsSMILValue; class nsISMILType; -#endif // MOZ_SMIL class nsSVGNumberPair { public: enum PairIndex { eFirst, eSecond @@ -84,20 +82,18 @@ public: // If this returns false, the animated value is still valid, that is, // useable, and represents the default base value of the attribute. bool IsExplicitlySet() const { return mIsAnimated || mIsBaseSet; } nsresult ToDOMAnimatedNumber(nsIDOMSVGAnimatedNumber **aResult, PairIndex aIndex, nsSVGElement* aSVGElement); -#ifdef MOZ_SMIL // Returns a new nsISMILAttr object that the caller must delete nsISMILAttr* ToSMILAttr(nsSVGElement* aSVGElement); -#endif // MOZ_SMIL private: float mAnimVal[2]; float mBaseVal[2]; PRUint8 mAttrEnum; // element specified tracking for attribute bool mIsAnimated; bool mIsBaseSet; @@ -125,25 +121,22 @@ public: mVal->SetBaseValue(aValue, mIndex, mSVGElement); return NS_OK; } // Script may have modified animation parameters or timeline -- DOM getters // need to flush any resample requests to reflect these modifications. NS_IMETHOD GetAnimVal(float* aResult) { -#ifdef MOZ_SMIL mSVGElement->FlushAnimations(); -#endif *aResult = mVal->GetAnimValue(mIndex); return NS_OK; } }; -#ifdef MOZ_SMIL struct SMILNumberPair : public nsISMILAttr { public: SMILNumberPair(nsSVGNumberPair* aVal, nsSVGElement* aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} // These will stay alive because a nsISMILAttr only lives as long // as the Compositing step, and DOM elements don't get a chance to @@ -155,12 +148,11 @@ public: virtual nsresult ValueFromString(const nsAString& aStr, const nsISMILAnimationElement* aSrcElement, nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const; virtual nsSMILValue GetBaseValue() const; virtual void ClearAnimValue(); virtual nsresult SetAnimValue(const nsSMILValue& aValue); }; -#endif // MOZ_SMIL }; #endif //__NS_SVGNUMBERPAIR_H__
--- a/content/svg/content/src/nsSVGSVGElement.cpp +++ b/content/svg/content/src/nsSVGSVGElement.cpp @@ -58,25 +58,23 @@ #include "nsDOMError.h" #include "nsISVGChildFrame.h" #include "nsGUIEvent.h" #include "nsSVGUtils.h" #include "nsSVGSVGElement.h" #include "nsContentErrors.h" // For NS_PROPTABLE_PROP_OVERWRITTEN #include "nsContentUtils.h" -#ifdef MOZ_SMIL #include "nsEventDispatcher.h" #include "nsSMILTimeContainer.h" #include "nsSMILAnimationController.h" #include "nsSMILTypes.h" #include "nsIContentIterator.h" nsresult NS_NewContentIterator(nsIContentIterator** aInstancePtrResult); -#endif // MOZ_SMIL using namespace mozilla; using namespace mozilla::dom; NS_SVG_VAL_IMPL_CYCLE_COLLECTION(nsSVGTranslatePoint::DOMVal, mElement) NS_IMPL_CYCLE_COLLECTING_ADDREF(nsSVGTranslatePoint::DOMVal) NS_IMPL_CYCLE_COLLECTING_RELEASE(nsSVGTranslatePoint::DOMVal) @@ -158,42 +156,36 @@ nsSVGElement::EnumInfo nsSVGSVGElement:: } }; NS_IMPL_NS_NEW_SVG_ELEMENT_CHECK_PARSER(SVG) //---------------------------------------------------------------------- // nsISupports methods -#ifdef MOZ_SMIL NS_IMPL_CYCLE_COLLECTION_CLASS(nsSVGSVGElement) NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsSVGSVGElement, nsSVGSVGElementBase) if (tmp->mTimedDocumentRoot) { tmp->mTimedDocumentRoot->Unlink(); } NS_IMPL_CYCLE_COLLECTION_UNLINK_END NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsSVGSVGElement, nsSVGSVGElementBase) if (tmp->mTimedDocumentRoot) { tmp->mTimedDocumentRoot->Traverse(&cb); } NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END -#endif // MOZ_SMIL NS_IMPL_ADDREF_INHERITED(nsSVGSVGElement,nsSVGSVGElementBase) NS_IMPL_RELEASE_INHERITED(nsSVGSVGElement,nsSVGSVGElementBase) DOMCI_NODE_DATA(SVGSVGElement, nsSVGSVGElement) -#ifdef MOZ_SMIL NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsSVGSVGElement) -#else -NS_INTERFACE_TABLE_HEAD(nsSVGSVGElement) -#endif NS_NODE_INTERFACE_TABLE7(nsSVGSVGElement, nsIDOMNode, nsIDOMElement, nsIDOMSVGElement, nsIDOMSVGSVGElement, nsIDOMSVGFitToViewBox, nsIDOMSVGLocatable, nsIDOMSVGZoomAndPan) NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGSVGElement) NS_INTERFACE_MAP_END_INHERITING(nsSVGSVGElementBase) //---------------------------------------------------------------------- @@ -204,22 +196,20 @@ nsSVGSVGElement::nsSVGSVGElement(already : nsSVGSVGElementBase(aNodeInfo), mCoordCtx(nsnull), mViewportWidth(0), mViewportHeight(0), mCurrentTranslate(0.0f, 0.0f), mCurrentScale(1.0f), mPreviousTranslate(0.0f, 0.0f), mPreviousScale(1.0f), - mRedrawSuspendCount(0) -#ifdef MOZ_SMIL - , mStartAnimationOnBindToTree(!aFromParser) -#endif // MOZ_SMIL - , mImageNeedsTransformInvalidation(false) - , mIsPaintingSVGImageElement(false) + mRedrawSuspendCount(0), + mStartAnimationOnBindToTree(!aFromParser), + mImageNeedsTransformInvalidation(false), + mIsPaintingSVGImageElement(false) { } //---------------------------------------------------------------------- // nsIDOMNode methods // From NS_IMPL_ELEMENT_CLONE_WITH_INIT(nsSVGSVGElement) nsresult @@ -449,87 +439,78 @@ nsSVGSVGElement::ForceRedraw() return NS_OK; } /* void pauseAnimations (); */ NS_IMETHODIMP nsSVGSVGElement::PauseAnimations() { -#ifdef MOZ_SMIL if (NS_SMILEnabled()) { if (mTimedDocumentRoot) { mTimedDocumentRoot->Pause(nsSMILTimeContainer::PAUSE_SCRIPT); } // else we're not the outermost <svg> or not bound to a tree, so silently fail return NS_OK; } -#endif // MOZ_SMIL NS_NOTYETIMPLEMENTED("nsSVGSVGElement::PauseAnimations"); return NS_ERROR_NOT_IMPLEMENTED; } /* void unpauseAnimations (); */ NS_IMETHODIMP nsSVGSVGElement::UnpauseAnimations() { -#ifdef MOZ_SMIL if (NS_SMILEnabled()) { if (mTimedDocumentRoot) { mTimedDocumentRoot->Resume(nsSMILTimeContainer::PAUSE_SCRIPT); } // else we're not the outermost <svg> or not bound to a tree, so silently fail return NS_OK; } -#endif // MOZ_SMIL NS_NOTYETIMPLEMENTED("nsSVGSVGElement::UnpauseAnimations"); return NS_ERROR_NOT_IMPLEMENTED; } /* boolean animationsPaused (); */ NS_IMETHODIMP nsSVGSVGElement::AnimationsPaused(bool *_retval) { -#ifdef MOZ_SMIL if (NS_SMILEnabled()) { nsSMILTimeContainer* root = GetTimedDocumentRoot(); *_retval = root && root->IsPausedByType(nsSMILTimeContainer::PAUSE_SCRIPT); return NS_OK; } -#endif // MOZ_SMIL NS_NOTYETIMPLEMENTED("nsSVGSVGElement::AnimationsPaused"); return NS_ERROR_NOT_IMPLEMENTED; } /* float getCurrentTime (); */ NS_IMETHODIMP nsSVGSVGElement::GetCurrentTime(float *_retval) { -#ifdef MOZ_SMIL if (NS_SMILEnabled()) { nsSMILTimeContainer* root = GetTimedDocumentRoot(); if (root) { double fCurrentTimeMs = double(root->GetCurrentTime()); *_retval = (float)(fCurrentTimeMs / PR_MSEC_PER_SEC); } else { *_retval = 0.f; } return NS_OK; } -#endif // MOZ_SMIL NS_NOTYETIMPLEMENTED("nsSVGSVGElement::GetCurrentTime"); return NS_ERROR_NOT_IMPLEMENTED; } /* void setCurrentTime (in float seconds); */ NS_IMETHODIMP nsSVGSVGElement::SetCurrentTime(float seconds) { NS_ENSURE_FINITE(seconds, NS_ERROR_ILLEGAL_VALUE); -#ifdef MOZ_SMIL if (NS_SMILEnabled()) { if (mTimedDocumentRoot) { // Make sure the timegraph is up-to-date FlushAnimations(); double fMilliseconds = double(seconds) * PR_MSEC_PER_SEC; // Round to nearest whole number before converting, to avoid precision // errors nsSMILTime lMilliseconds = PRInt64(NS_round(fMilliseconds)); @@ -540,17 +521,16 @@ nsSVGSVGElement::SetCurrentTime(float se // - re-enable event firing (it got disabled during seeking, and it // doesn't get re-enabled until the first sample after the seek -- so // let's make that happen now.) FlushAnimations(); } // else we're not the outermost <svg> or not bound to a tree, so silently // fail return NS_OK; } -#endif // MOZ_SMIL NS_NOTYETIMPLEMENTED("nsSVGSVGElement::SetCurrentTime"); return NS_ERROR_NOT_IMPLEMENTED; } /* nsIDOMNodeList getIntersectionList (in nsIDOMSVGRect rect, in nsIDOMSVGElement referenceElement); */ NS_IMETHODIMP nsSVGSVGElement::GetIntersectionList(nsIDOMSVGRect *rect, nsIDOMSVGElement *referenceElement, @@ -863,17 +843,16 @@ nsSVGSVGElement::SetCurrentScaleTranslat } NS_IMETHODIMP nsSVGSVGElement::SetCurrentTranslate(float x, float y) { return SetCurrentScaleTranslate(mCurrentScale, x, y); } -#ifdef MOZ_SMIL nsSMILTimeContainer* nsSVGSVGElement::GetTimedDocumentRoot() { if (mTimedDocumentRoot) { return mTimedDocumentRoot; } // We must not be the outermost <svg> element, try to find it @@ -881,17 +860,16 @@ nsSVGSVGElement::GetTimedDocumentRoot() nsSVGUtils::GetOuterSVGElement(this); if (outerSVGElement) { return outerSVGElement->GetTimedDocumentRoot(); } // invalid structure return nsnull; } -#endif // MOZ_SMIL //---------------------------------------------------------------------- // nsIContent methods NS_IMETHODIMP_(bool) nsSVGSVGElement::IsAttributeMapped(const nsIAtom* name) const { static const MappedAttributeEntry* const map[] = { @@ -910,32 +888,30 @@ nsSVGSVGElement::IsAttributeMapped(const return FindAttributeDependence(name, map, ArrayLength(map)) || nsSVGSVGElementBase::IsAttributeMapped(name); } //---------------------------------------------------------------------- // nsIContent methods: -#ifdef MOZ_SMIL nsresult nsSVGSVGElement::PreHandleEvent(nsEventChainPreVisitor& aVisitor) { if (aVisitor.mEvent->message == NS_SVG_LOAD) { if (mTimedDocumentRoot) { mTimedDocumentRoot->Begin(); // Set 'resample needed' flag, so that if any script calls a DOM method // that requires up-to-date animations before our first sample callback, // we'll force a synchronous sample. AnimationNeedsResample(); } } return nsSVGSVGElementBase::PreHandleEvent(aVisitor); } -#endif // MOZ_SMIL //---------------------------------------------------------------------- // nsSVGElement overrides bool nsSVGSVGElement::IsEventName(nsIAtom* aName) { /* The events in EventNameType_SVGSVG are for events that are only @@ -1031,17 +1007,16 @@ nsSVGSVGElement::GetViewBoxTransform() c return nsSVGUtils::GetViewBoxTransform(this, viewportWidth, viewportHeight, viewBox.x, viewBox.y, viewBox.width, viewBox.height, overridePARPtr ? *overridePARPtr : mPreserveAspectRatio.GetAnimValue()); } -#ifdef MOZ_SMIL nsresult nsSVGSVGElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent, nsIContent* aBindingParent, bool aCompileEventHandlers) { nsSMILAnimationController* smilController = nsnull; @@ -1085,22 +1060,20 @@ void nsSVGSVGElement::UnbindFromTree(bool aDeep, bool aNullParent) { if (mTimedDocumentRoot) { mTimedDocumentRoot->SetParent(nsnull); } nsSVGSVGElementBase::UnbindFromTree(aDeep, aNullParent); } -#endif // MOZ_SMIL //---------------------------------------------------------------------- // implementation helpers -#ifdef MOZ_SMIL bool nsSVGSVGElement::WillBeOutermostSVG(nsIContent* aParent, nsIContent* aBindingParent) const { nsIContent* parent = aBindingParent ? aBindingParent : aParent; while (parent && parent->GetNameSpaceID() == kNameSpaceID_SVG) { nsIAtom* tag = parent->Tag(); @@ -1111,17 +1084,16 @@ nsSVGSVGElement::WillBeOutermostSVG(nsIC if (tag == nsGkAtoms::svg) { return false; } parent = parent->GetParent(); } return true; } -#endif // MOZ_SMIL void nsSVGSVGElement::InvalidateTransformNotifyFrame() { nsIFrame* frame = GetPrimaryFrame(); if (frame) { nsISVGSVGFrame* svgframe = do_QueryFrame(frame); // might fail this check if we've failed conditional processing
--- a/content/svg/content/src/nsSVGSVGElement.h +++ b/content/svg/content/src/nsSVGSVGElement.h @@ -48,19 +48,17 @@ #include "nsIDOMSVGMatrix.h" #include "nsIDOMSVGPoint.h" #include "nsSVGLength2.h" #include "nsSVGEnum.h" #include "nsSVGViewBox.h" #include "SVGAnimatedPreserveAspectRatio.h" #include "mozilla/dom/FromParser.h" -#ifdef MOZ_SMIL class nsSMILTimeContainer; -#endif // MOZ_SMIL typedef nsSVGStylableElement nsSVGSVGElementBase; class nsSVGSVGElement; class nsSVGTranslatePoint { public: nsSVGTranslatePoint(float aX, float aY) : @@ -136,19 +134,17 @@ protected: mozilla::dom::FromParser aFromParser); public: typedef mozilla::SVGAnimatedPreserveAspectRatio SVGAnimatedPreserveAspectRatio; typedef mozilla::SVGPreserveAspectRatio SVGPreserveAspectRatio; // interfaces: NS_DECL_ISUPPORTS_INHERITED -#ifdef MOZ_SMIL NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsSVGSVGElement, nsSVGSVGElementBase) -#endif // MOZ_SMIL NS_DECL_NSIDOMSVGSVGELEMENT NS_DECL_NSIDOMSVGFITTOVIEWBOX NS_DECL_NSIDOMSVGLOCATABLE NS_DECL_NSIDOMSVGZOOMANDPAN // xxx I wish we could use virtual inheritance NS_FORWARD_NSIDOMNODE(nsSVGSVGElementBase::) NS_FORWARD_NSIDOMELEMENT(nsSVGSVGElementBase::) @@ -176,25 +172,21 @@ public: /** * Retrieve the value of currentScale, currentTranslate.x or * currentTranslate.y prior to the last change made to any one of them. */ const nsSVGTranslatePoint& GetPreviousTranslate() { return mPreviousTranslate; } float GetPreviousScale() { return mPreviousScale; } -#ifdef MOZ_SMIL nsSMILTimeContainer* GetTimedDocumentRoot(); -#endif // MOZ_SMIL // nsIContent interface NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const; -#ifdef MOZ_SMIL virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor); -#endif // MOZ_SMIL // nsSVGElement specializations: virtual gfxMatrix PrependLocalTransformTo(const gfxMatrix &aMatrix) const; // nsSVGSVGElement methods: float GetLength(PRUint8 mCtxType); // public helpers: @@ -232,22 +224,20 @@ private: // being painted by an <svg:image> element). This method also assumes that we // lack a valid viewBox attribute. bool ShouldSynthesizeViewBox() const; protected: // nsSVGElement overrides bool IsEventName(nsIAtom* aName); -#ifdef MOZ_SMIL virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent, nsIContent* aBindingParent, bool aCompileEventHandlers); virtual void UnbindFromTree(bool aDeep, bool aNullParent); -#endif // MOZ_SMIL // implementation helpers: bool IsRoot() const { NS_ASSERTION((IsInDoc() && !GetParent()) == (OwnerDoc() && (OwnerDoc()->GetRootElement() == this)), "Can't determine if we're root"); return IsInDoc() && !GetParent(); @@ -258,29 +248,27 @@ protected: * another non-foreignObject SVG element. */ bool IsInner() const { const nsIContent *parent = GetFlattenedTreeParent(); return parent && parent->GetNameSpaceID() == kNameSpaceID_SVG && parent->Tag() != nsGkAtoms::foreignObject; } -#ifdef MOZ_SMIL /* * While binding to the tree we need to determine if we will be the outermost * <svg> element _before_ the children are bound (as they want to know what * timed document root to register with) and therefore _before_ our parent is * set (both actions are performed by nsGenericElement::BindToTree) so we * can't use GetOwnerSVGElement() as it relies on GetParent(). This code is * basically a simplified version of GetOwnerSVGElement that uses the parent * parameters passed in instead. */ bool WillBeOutermostSVG(nsIContent* aParent, nsIContent* aBindingParent) const; -#endif // MOZ_SMIL // invalidate viewbox -> viewport xform & inform frames void InvalidateTransformNotifyFrame(); // Returns true if we have at least one of the following: // - a (valid or invalid) value for the preserveAspectRatio attribute // - a SMIL-animated value for the preserveAspectRatio attribute bool HasPreserveAspectRatio(); @@ -311,35 +299,31 @@ protected: // // http://www.w3.org/TR/SVG11/coords.html#ViewportSpace // // XXXjwatt Currently only used for outer <svg>, but maybe we could use -1 to // flag this as an inner <svg> to save the overhead of GetCtx calls? // XXXjwatt our frame should probably reset these when it's destroyed. float mViewportWidth, mViewportHeight; -#ifdef MOZ_SMIL // The time container for animations within this SVG document fragment. Set // for all outermost <svg> elements (not nested <svg> elements). nsAutoPtr<nsSMILTimeContainer> mTimedDocumentRoot; -#endif // MOZ_SMIL // zoom and pan // IMPORTANT: see the comment in RecordCurrentScaleTranslate before writing // code to change any of these! nsSVGTranslatePoint mCurrentTranslate; float mCurrentScale; nsSVGTranslatePoint mPreviousTranslate; float mPreviousScale; PRInt32 mRedrawSuspendCount; -#ifdef MOZ_SMIL // For outermost <svg> elements created from parsing, animation is started by // the onload event in accordance with the SVG spec, but for <svg> elements // created by script or promoted from inner <svg> to outermost <svg> we need // to manually kick off animation when they are bound to the tree. bool mStartAnimationOnBindToTree; -#endif // MOZ_SMIL bool mImageNeedsTransformInvalidation; bool mIsPaintingSVGImageElement; }; #endif
--- a/content/svg/content/src/nsSVGString.cpp +++ b/content/svg/content/src/nsSVGString.cpp @@ -30,20 +30,18 @@ * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ #include "nsSVGString.h" -#ifdef MOZ_SMIL #include "nsSMILValue.h" #include "SMILStringType.h" -#endif // MOZ_SMIL using namespace mozilla; NS_SVG_VAL_IMPL_CYCLE_COLLECTION(nsSVGString::DOMAnimatedString, mSVGElement) NS_IMPL_CYCLE_COLLECTING_ADDREF(nsSVGString::DOMAnimatedString) NS_IMPL_CYCLE_COLLECTING_RELEASE(nsSVGString::DOMAnimatedString) @@ -63,21 +61,19 @@ nsSVGString::SetBaseValue(const nsAStrin bool aDoSetAttr) { NS_ASSERTION(aSVGElement, "Null element passed to SetBaseValue"); mIsBaseSet = true; if (aDoSetAttr) { aSVGElement->SetStringBaseValue(mAttrEnum, aValue); } -#ifdef MOZ_SMIL if (mAnimVal) { aSVGElement->AnimationNeedsResample(); } -#endif aSVGElement->DidChangeString(mAttrEnum); } void nsSVGString::GetAnimValue(nsAString& aResult, const nsSVGElement *aSVGElement) const { if (mAnimVal) { @@ -107,17 +103,16 @@ nsSVGString::ToDOMAnimatedString(nsIDOMS *aResult = new DOMAnimatedString(this, aSVGElement); if (!*aResult) return NS_ERROR_OUT_OF_MEMORY; NS_ADDREF(*aResult); return NS_OK; } -#ifdef MOZ_SMIL nsISMILAttr* nsSVGString::ToSMILAttr(nsSVGElement *aSVGElement) { return new SMILString(this, aSVGElement); } nsresult nsSVGString::SMILString::ValueFromString(const nsAString& aStr, @@ -155,9 +150,8 @@ nsSVGString::SMILString::SetAnimValue(co { NS_ASSERTION(aValue.mType == &SMILStringType::sSingleton, "Unexpected type to assign animated value"); if (aValue.mType == &SMILStringType::sSingleton) { mVal->SetAnimValue(*static_cast<nsAString*>(aValue.mU.mPtr), mSVGElement); } return NS_OK; } -#endif // MOZ_SMIL
--- a/content/svg/content/src/nsSVGString.h +++ b/content/svg/content/src/nsSVGString.h @@ -65,20 +65,18 @@ public: // explicitly set by markup or a DOM call), false otherwise. // If this returns false, the animated value is still valid, that is, // useable, and represents the default base value of the attribute. bool IsExplicitlySet() const { return !!mAnimVal || mIsBaseSet; } nsresult ToDOMAnimatedString(nsIDOMSVGAnimatedString **aResult, nsSVGElement *aSVGElement); -#ifdef MOZ_SMIL // Returns a new nsISMILAttr object that the caller must delete nsISMILAttr* ToSMILAttr(nsSVGElement *aSVGElement); -#endif // MOZ_SMIL private: nsAutoPtr<nsString> mAnimVal; PRUint8 mAttrEnum; // element specified tracking for attribute bool mIsBaseSet; public: @@ -95,24 +93,21 @@ public: NS_IMETHOD GetBaseVal(nsAString & aResult) { mVal->GetBaseValue(aResult, mSVGElement); return NS_OK; } NS_IMETHOD SetBaseVal(const nsAString & aValue) { mVal->SetBaseValue(aValue, mSVGElement, true); return NS_OK; } NS_IMETHOD GetAnimVal(nsAString & aResult) { -#ifdef MOZ_SMIL mSVGElement->FlushAnimations(); -#endif mVal->GetAnimValue(aResult, mSVGElement); return NS_OK; } }; -#ifdef MOZ_SMIL struct SMILString : public nsISMILAttr { public: SMILString(nsSVGString *aVal, nsSVGElement *aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} // These will stay alive because a nsISMILAttr only lives as long // as the Compositing step, and DOM elements don't get a chance to @@ -124,11 +119,10 @@ public: virtual nsresult ValueFromString(const nsAString& aStr, const nsISMILAnimationElement *aSrcElement, nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const; virtual nsSMILValue GetBaseValue() const; virtual void ClearAnimValue(); virtual nsresult SetAnimValue(const nsSMILValue& aValue); }; -#endif // MOZ_SMIL }; #endif //__NS_SVGSTRING_H__
--- a/content/svg/content/src/nsSVGStylableElement.cpp +++ b/content/svg/content/src/nsSVGStylableElement.cpp @@ -144,19 +144,17 @@ nsSVGStylableElement::DidAnimateClass() mClassAnimAttr->ParseAtomArray(src); nsIPresShell* shell = OwnerDoc()->GetShell(); if (shell) { shell->RestyleForAnimation(this, eRestyle_Self); } } -#ifdef MOZ_SMIL nsISMILAttr* nsSVGStylableElement::GetAnimatedAttr(PRInt32 aNamespaceID, nsIAtom* aName) { if (aNamespaceID == kNameSpaceID_None && aName == nsGkAtoms::_class) { return mClassAttribute.ToSMILAttr(this); } return nsSVGStylableElementBase::GetAnimatedAttr(aNamespaceID, aName); } -#endif // MOZ_SMIL
--- a/content/svg/content/src/nsSVGStylableElement.h +++ b/content/svg/content/src/nsSVGStylableElement.h @@ -64,19 +64,17 @@ public: { return nsSVGStylableElementBase::GetStyle(retval); } virtual bool ParseAttribute(PRInt32 aNamespaceID, nsIAtom* aAttribute, const nsAString& aValue, nsAttrValue& aResult); virtual nsresult UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute, bool aNotify); -#ifdef MOZ_SMIL virtual nsISMILAttr* GetAnimatedAttr(PRInt32 aNamespaceID, nsIAtom* aName); -#endif void DidAnimateClass(); protected: nsSVGClass mClassAttribute; nsAutoPtr<nsAttrValue> mClassAnimAttr; };
--- a/content/svg/content/src/nsSVGViewBox.cpp +++ b/content/svg/content/src/nsSVGViewBox.cpp @@ -37,20 +37,18 @@ * ***** END LICENSE BLOCK ***** */ #include "nsSVGViewBox.h" #include "nsSVGUtils.h" #include "prdtoa.h" #include "nsTextFormatter.h" #include "nsCharSeparatedTokenizer.h" #include "nsMathUtils.h" -#ifdef MOZ_SMIL #include "nsSMILValue.h" #include "SVGViewBoxSMILType.h" -#endif // MOZ_SMIL #define NUM_VIEWBOX_COMPONENTS 4 using namespace mozilla; /* Implementation of nsSVGViewBoxRect methods */ bool nsSVGViewBoxRect::operator==(const nsSVGViewBoxRect& aOther) const @@ -128,21 +126,19 @@ nsSVGViewBox::SetAnimValue(float aX, flo void nsSVGViewBox::SetBaseValue(float aX, float aY, float aWidth, float aHeight, nsSVGElement *aSVGElement) { mBaseVal = nsSVGViewBoxRect(aX, aY, aWidth, aHeight); mHasBaseVal = true; aSVGElement->DidChangeViewBox(true); -#ifdef MOZ_SMIL if (mAnimVal) { aSVGElement->AnimationNeedsResample(); } -#endif } static nsresult ToSVGViewBoxRect(const nsAString& aStr, nsSVGViewBoxRect *aViewBox) { nsCharSeparatedTokenizerTemplate<IsSVGWhitespace> tokenizer(aStr, ',', nsCharSeparatedTokenizer::SEPARATOR_OPTIONAL); @@ -181,21 +177,19 @@ nsSVGViewBox::SetBaseValueString(const n nsSVGElement *aSVGElement) { nsSVGViewBoxRect viewBox; nsresult res = ToSVGViewBoxRect(aValue, &viewBox); if (NS_SUCCEEDED(res)) { mBaseVal = nsSVGViewBoxRect(viewBox.x, viewBox.y, viewBox.width, viewBox.height); mHasBaseVal = true; -#ifdef MOZ_SMIL if (mAnimVal) { aSVGElement->AnimationNeedsResample(); } -#endif // We don't need to call DidChange* here - we're only called by // nsSVGElement::ParseAttribute under nsGenericElement::SetAttr, // which takes care of notifying. } return res; } void @@ -275,17 +269,16 @@ nsSVGViewBox::DOMBaseVal::SetHeight(floa { nsSVGViewBoxRect rect = mVal->GetBaseValue(); rect.height = aHeight; mVal->SetBaseValue(rect.x, rect.y, rect.width, rect.height, mSVGElement); return NS_OK; } -#ifdef MOZ_SMIL nsISMILAttr* nsSVGViewBox::ToSMILAttr(nsSVGElement *aSVGElement) { return new SMILViewBox(this, aSVGElement); } nsresult nsSVGViewBox::SMILViewBox @@ -330,9 +323,8 @@ nsSVGViewBox::SMILViewBox::SetAnimValue( NS_ASSERTION(aValue.mType == &SVGViewBoxSMILType::sSingleton, "Unexpected type to assign animated value"); if (aValue.mType == &SVGViewBoxSMILType::sSingleton) { nsSVGViewBoxRect &vb = *static_cast<nsSVGViewBoxRect*>(aValue.mU.mPtr); mVal->SetAnimValue(vb.x, vb.y, vb.width, vb.height, mSVGElement); } return NS_OK; } -#endif // MOZ_SMIL
--- a/content/svg/content/src/nsSVGViewBox.h +++ b/content/svg/content/src/nsSVGViewBox.h @@ -79,20 +79,18 @@ public: nsSVGElement *aSVGElement); nsresult SetBaseValueString(const nsAString& aValue, nsSVGElement *aSVGElement); void GetBaseValueString(nsAString& aValue) const; nsresult ToDOMAnimatedRect(nsIDOMSVGAnimatedRect **aResult, nsSVGElement *aSVGElement); -#ifdef MOZ_SMIL // Returns a new nsISMILAttr object that the caller must delete nsISMILAttr* ToSMILAttr(nsSVGElement* aSVGElement); -#endif // MOZ_SMIL private: nsSVGViewBoxRect mBaseVal; nsAutoPtr<nsSVGViewBoxRect> mAnimVal; bool mHasBaseVal; struct DOMBaseVal : public nsIDOMSVGRect @@ -131,43 +129,35 @@ private: nsSVGViewBox* mVal; // kept alive because it belongs to content nsRefPtr<nsSVGElement> mSVGElement; // Script may have modified animation parameters or timeline -- DOM getters // need to flush any resample requests to reflect these modifications. NS_IMETHOD GetX(float *aX) { -#ifdef MOZ_SMIL mSVGElement->FlushAnimations(); -#endif *aX = mVal->GetAnimValue().x; return NS_OK; } NS_IMETHOD GetY(float *aY) { -#ifdef MOZ_SMIL mSVGElement->FlushAnimations(); -#endif *aY = mVal->GetAnimValue().y; return NS_OK; } NS_IMETHOD GetWidth(float *aWidth) { -#ifdef MOZ_SMIL mSVGElement->FlushAnimations(); -#endif *aWidth = mVal->GetAnimValue().width; return NS_OK; } NS_IMETHOD GetHeight(float *aHeight) { -#ifdef MOZ_SMIL mSVGElement->FlushAnimations(); -#endif *aHeight = mVal->GetAnimValue().height; return NS_OK; } NS_IMETHOD SetX(float aX) { return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR; } NS_IMETHOD SetY(float aY) { return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR; } @@ -188,17 +178,16 @@ public: nsSVGViewBox* mVal; // kept alive because it belongs to content nsRefPtr<nsSVGElement> mSVGElement; NS_IMETHOD GetBaseVal(nsIDOMSVGRect **aResult); NS_IMETHOD GetAnimVal(nsIDOMSVGRect **aResult); }; -#ifdef MOZ_SMIL struct SMILViewBox : public nsISMILAttr { public: SMILViewBox(nsSVGViewBox* aVal, nsSVGElement* aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} // These will stay alive because a nsISMILAttr only lives as long // as the Compositing step, and DOM elements don't get a chance to @@ -210,12 +199,11 @@ public: virtual nsresult ValueFromString(const nsAString& aStr, const nsISMILAnimationElement* aSrcElement, nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const; virtual nsSMILValue GetBaseValue() const; virtual void ClearAnimValue(); virtual nsresult SetAnimValue(const nsSMILValue& aValue); }; -#endif // MOZ_SMIL }; #endif // __NS_SVGVIEWBOX_H__
--- a/dom/Makefile.in +++ b/dom/Makefile.in @@ -38,16 +38,17 @@ DEPTH = .. topsrcdir = @top_srcdir@ srcdir = @srcdir@ VPATH = @srcdir@ include $(DEPTH)/config/autoconf.mk MODULE = dom + DIRS = \ interfaces/base \ interfaces/canvas \ interfaces/core \ interfaces/html \ interfaces/events \ interfaces/stylesheets \ interfaces/sidebar \ @@ -59,22 +60,19 @@ DIRS = \ interfaces/load-save \ interfaces/xul \ interfaces/storage \ interfaces/json \ interfaces/offline \ interfaces/geolocation \ interfaces/notification \ interfaces/svg \ + interfaces/smil \ $(NULL) -ifdef MOZ_SMIL -DIRS += interfaces/smil -endif - DIRS += \ base \ battery \ src \ locales \ plugins/base \ plugins/ipc \ indexedDB \ @@ -90,9 +88,8 @@ DIRS += tests # buildable on other non-GTK unix builds ifneq (,$(filter gtk2 cocoa windows android qt os2,$(MOZ_WIDGET_TOOLKIT))) DIRS += plugins/test endif endif include $(topsrcdir)/config/rules.mk -
--- a/dom/base/nsDOMClassInfo.cpp +++ b/dom/base/nsDOMClassInfo.cpp @@ -367,26 +367,24 @@ #include "nsIDOMSVGAnimatedLengthList.h" #include "nsIDOMSVGAnimatedNumber.h" #include "nsIDOMSVGAnimatedNumberList.h" #include "nsIDOMSVGAnimatedPathData.h" #include "nsIDOMSVGAnimatedPoints.h" #include "nsIDOMSVGAnimatedRect.h" #include "nsIDOMSVGAnimatedString.h" #include "nsIDOMSVGAnimPresAspRatio.h" -#ifdef MOZ_SMIL #include "nsIDOMSVGAnimateElement.h" #include "nsIDOMSVGAnimateTransformElement.h" #include "nsIDOMSVGAnimateMotionElement.h" #include "nsIDOMSVGMpathElement.h" #include "nsIDOMSVGSetElement.h" #include "nsIDOMSVGAnimationElement.h" #include "nsIDOMElementTimeControl.h" #include "nsIDOMTimeEvent.h" -#endif // MOZ_SMIL #include "nsIDOMSVGAnimTransformList.h" #include "nsIDOMSVGCircleElement.h" #include "nsIDOMSVGClipPathElement.h" #include "nsIDOMSVGDefsElement.h" #include "nsIDOMSVGDescElement.h" #include "nsIDOMSVGDocument.h" #include "nsIDOMSVGElement.h" #include "nsIDOMSVGEllipseElement.h" @@ -1027,30 +1025,28 @@ static nsDOMClassInfoData sClassInfoData NS_DEFINE_CLASSINFO_DATA(SVGDocument, nsDocumentSH, DOCUMENT_SCRIPTABLE_FLAGS) // SVG element classes NS_DEFINE_CLASSINFO_DATA(SVGAElement, nsElementSH, ELEMENT_SCRIPTABLE_FLAGS) NS_DEFINE_CLASSINFO_DATA(SVGAltGlyphElement, nsElementSH, ELEMENT_SCRIPTABLE_FLAGS) -#ifdef MOZ_SMIL NS_DEFINE_CLASSINFO_DATA(SVGAnimateElement, nsElementSH, ELEMENT_SCRIPTABLE_FLAGS) NS_DEFINE_CLASSINFO_DATA(SVGAnimateTransformElement, nsElementSH, ELEMENT_SCRIPTABLE_FLAGS) NS_DEFINE_CLASSINFO_DATA(SVGAnimateMotionElement, nsElementSH, ELEMENT_SCRIPTABLE_FLAGS) NS_DEFINE_CLASSINFO_DATA(SVGMpathElement, nsElementSH, ELEMENT_SCRIPTABLE_FLAGS) NS_DEFINE_CLASSINFO_DATA(SVGSetElement, nsElementSH, ELEMENT_SCRIPTABLE_FLAGS) NS_DEFINE_CLASSINFO_DATA(TimeEvent, nsDOMGenericSH, DOM_DEFAULT_SCRIPTABLE_FLAGS) -#endif // MOZ_SMIL NS_DEFINE_CLASSINFO_DATA(SVGCircleElement, nsElementSH, ELEMENT_SCRIPTABLE_FLAGS) NS_DEFINE_CLASSINFO_DATA(SVGClipPathElement, nsElementSH, ELEMENT_SCRIPTABLE_FLAGS) NS_DEFINE_CLASSINFO_DATA(SVGDefsElement, nsElementSH, ELEMENT_SCRIPTABLE_FLAGS) NS_DEFINE_CLASSINFO_DATA(SVGDescElement, nsElementSH, ELEMENT_SCRIPTABLE_FLAGS) @@ -3058,17 +3054,16 @@ nsDOMClassInfo::Init() DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGTextPositioningElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGTextContentElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGURIReference) DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable) DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES DOM_CLASSINFO_MAP_END -#ifdef MOZ_SMIL DOM_CLASSINFO_MAP_BEGIN(SVGAnimateElement, nsIDOMSVGAnimateElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGAnimationElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGAnimateElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMElementTimeControl) DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES DOM_CLASSINFO_MAP_END DOM_CLASSINFO_MAP_BEGIN(SVGAnimateTransformElement, @@ -3099,17 +3094,16 @@ nsDOMClassInfo::Init() DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGURIReference) DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES DOM_CLASSINFO_MAP_END DOM_CLASSINFO_MAP_BEGIN(TimeEvent, nsIDOMTimeEvent) DOM_CLASSINFO_MAP_ENTRY(nsIDOMTimeEvent) DOM_CLASSINFO_EVENT_MAP_ENTRIES DOM_CLASSINFO_MAP_END -#endif // MOZ_SMIL DOM_CLASSINFO_MAP_BEGIN(SVGCircleElement, nsIDOMSVGCircleElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGCircleElement) DOM_CLASSINFO_SVG_GRAPHIC_ELEMENT_MAP_ENTRIES DOM_CLASSINFO_MAP_END DOM_CLASSINFO_MAP_BEGIN(SVGClipPathElement, nsIDOMSVGClipPathElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGClipPathElement)
--- a/dom/base/nsDOMClassInfoClasses.h +++ b/dom/base/nsDOMClassInfoClasses.h @@ -229,24 +229,22 @@ DOMCI_CLASS(CSSMozDocumentRule) DOMCI_CLASS(BeforeUnloadEvent) // The SVG document DOMCI_CLASS(SVGDocument) // SVG element classes DOMCI_CLASS(SVGAElement) DOMCI_CLASS(SVGAltGlyphElement) -#ifdef MOZ_SMIL DOMCI_CLASS(SVGAnimateElement) DOMCI_CLASS(SVGAnimateTransformElement) DOMCI_CLASS(SVGAnimateMotionElement) DOMCI_CLASS(SVGMpathElement) DOMCI_CLASS(SVGSetElement) DOMCI_CLASS(TimeEvent) -#endif // MOZ_SMIL DOMCI_CLASS(SVGCircleElement) DOMCI_CLASS(SVGClipPathElement) DOMCI_CLASS(SVGDefsElement) DOMCI_CLASS(SVGDescElement) DOMCI_CLASS(SVGEllipseElement) DOMCI_CLASS(SVGFEBlendElement) DOMCI_CLASS(SVGFEColorMatrixElement) DOMCI_CLASS(SVGFEComponentTransferElement)
--- a/dom/interfaces/svg/Makefile.in +++ b/dom/interfaces/svg/Makefile.in @@ -43,17 +43,16 @@ topsrcdir = @top_srcdir@ srcdir = @srcdir@ VPATH = @srcdir@ include $(DEPTH)/config/autoconf.mk MODULE = dom XPIDL_MODULE = dom_svg - XPIDLSRCS = \ nsIDOMGetSVGDocument.idl \ nsIDOMSVGAElement.idl \ nsIDOMSVGAltGlyphElement.idl \ nsIDOMSVGAngle.idl \ nsIDOMSVGAnimatedAngle.idl \ nsIDOMSVGAnimatedBoolean.idl \ nsIDOMSVGAnimatedEnum.idl \ @@ -61,16 +60,20 @@ XPIDLSRCS = \ nsIDOMSVGAnimatedLength.idl \ nsIDOMSVGAnimatedLengthList.idl \ nsIDOMSVGAnimatedNumber.idl \ nsIDOMSVGAnimatedNumberList.idl \ nsIDOMSVGAnimatedPathData.idl \ nsIDOMSVGAnimatedPoints.idl \ nsIDOMSVGAnimatedRect.idl \ nsIDOMSVGAnimatedString.idl \ + nsIDOMSVGAnimateElement.idl \ + nsIDOMSVGAnimateMotionElement.idl \ + nsIDOMSVGAnimateTransformElement.idl \ + nsIDOMSVGAnimationElement.idl \ nsIDOMSVGAnimPresAspRatio.idl \ nsIDOMSVGAnimTransformList.idl \ nsIDOMSVGCircleElement.idl \ nsIDOMSVGClipPathElement.idl \ nsIDOMSVGDefsElement.idl \ nsIDOMSVGDescElement.idl \ nsIDOMSVGDocument.idl \ nsIDOMSVGElement.idl \ @@ -87,30 +90,32 @@ XPIDLSRCS = \ nsIDOMSVGLength.idl \ nsIDOMSVGLengthList.idl \ nsIDOMSVGLineElement.idl \ nsIDOMSVGLocatable.idl \ nsIDOMSVGMarkerElement.idl \ nsIDOMSVGMaskElement.idl \ nsIDOMSVGMatrix.idl \ nsIDOMSVGMetadataElement.idl \ + nsIDOMSVGMpathElement.idl \ nsIDOMSVGNumber.idl \ nsIDOMSVGNumberList.idl \ nsIDOMSVGPathElement.idl \ nsIDOMSVGPathSeg.idl \ nsIDOMSVGPathSegList.idl \ nsIDOMSVGPatternElement.idl \ nsIDOMSVGPoint.idl \ nsIDOMSVGPointList.idl \ nsIDOMSVGPolygonElement.idl \ nsIDOMSVGPolylineElement.idl \ nsIDOMSVGPresAspectRatio.idl \ nsIDOMSVGRect.idl \ nsIDOMSVGRectElement.idl \ nsIDOMSVGScriptElement.idl \ + nsIDOMSVGSetElement.idl \ nsIDOMSVGSVGElement.idl \ nsIDOMSVGStopElement.idl \ nsIDOMSVGStylable.idl \ nsIDOMSVGStyleElement.idl \ nsIDOMSVGSwitchElement.idl \ nsIDOMSVGSymbolElement.idl \ nsIDOMSVGTextContentElement.idl \ nsIDOMSVGTextElement.idl \ @@ -124,20 +129,9 @@ XPIDLSRCS = \ nsIDOMSVGURIReference.idl \ nsIDOMSVGUnitTypes.idl \ nsIDOMSVGUseElement.idl \ nsIDOMSVGViewSpec.idl \ nsIDOMSVGZoomAndPan.idl \ nsIDOMSVGZoomEvent.idl \ $(NULL) -ifdef MOZ_SMIL -XPIDLSRCS += \ - nsIDOMSVGAnimateElement.idl \ - nsIDOMSVGAnimateTransformElement.idl \ - nsIDOMSVGAnimateMotionElement.idl \ - nsIDOMSVGAnimationElement.idl \ - nsIDOMSVGMpathElement.idl \ - nsIDOMSVGSetElement.idl \ - $(NULL) -endif - include $(topsrcdir)/config/rules.mk
--- a/image/src/SVGDocumentWrapper.cpp +++ b/image/src/SVGDocumentWrapper.cpp @@ -180,61 +180,53 @@ SVGDocumentWrapper::FlushImageTransformI svgElem->FlushImageTransformInvalidation(); FlushLayout(); mIgnoreInvalidation = false; } bool SVGDocumentWrapper::IsAnimated() { -#ifdef MOZ_SMIL nsIDocument* doc = mViewer->GetDocument(); return doc && doc->HasAnimationController() && doc->GetAnimationController()->HasRegisteredAnimations(); -#else - return false; -#endif // MOZ_SMIL } void SVGDocumentWrapper::StartAnimation() { // Can be called for animated images during shutdown, after we've // already Observe()'d XPCOM shutdown and cleared out our mViewer pointer. if (!mViewer) return; nsIDocument* doc = mViewer->GetDocument(); if (doc) { -#ifdef MOZ_SMIL nsSMILAnimationController* controller = doc->GetAnimationController(); if (controller) { controller->Resume(nsSMILTimeContainer::PAUSE_IMAGE); } -#endif // MOZ_SMIL doc->SetImagesNeedAnimating(true); } } void SVGDocumentWrapper::StopAnimation() { // Can be called for animated images during shutdown, after we've // already Observe()'d XPCOM shutdown and cleared out our mViewer pointer. if (!mViewer) return; nsIDocument* doc = mViewer->GetDocument(); if (doc) { -#ifdef MOZ_SMIL nsSMILAnimationController* controller = doc->GetAnimationController(); if (controller) { controller->Pause(nsSMILTimeContainer::PAUSE_IMAGE); } -#endif // MOZ_SMIL doc->SetImagesNeedAnimating(false); } } void SVGDocumentWrapper::ResetAnimation() { nsSVGSVGElement* svgElem = GetRootSVGElem();
--- a/layout/base/nsPresContext.cpp +++ b/layout/base/nsPresContext.cpp @@ -92,20 +92,17 @@ #include "nsIDOMEventTarget.h" #include "nsObjectFrame.h" #include "nsTransitionManager.h" #include "nsAnimationManager.h" #include "mozilla/dom/Element.h" #include "nsIFrameMessageManager.h" #include "FrameLayerBuilder.h" #include "nsDOMMediaQueryList.h" - -#ifdef MOZ_SMIL #include "nsSMILAnimationController.h" -#endif // MOZ_SMIL #ifdef IBMBIDI #include "nsBidiPresUtils.h" #endif // IBMBIDI #include "nsContentUtils.h" #include "nsPIWindowRoot.h" #include "mozilla/Preferences.h" @@ -1203,17 +1200,16 @@ void nsPresContext::SetImgAnimations(nsI } PRUint32 count = aParent->GetChildCount(); for (PRUint32 i = 0; i < count; ++i) { SetImgAnimations(aParent->GetChildAt(i), aMode); } } -#ifdef MOZ_SMIL void nsPresContext::SetSMILAnimations(nsIDocument *aDoc, PRUint16 aNewMode, PRUint16 aOldMode) { if (aDoc->HasAnimationController()) { nsSMILAnimationController* controller = aDoc->GetAnimationController(); switch (aNewMode) { @@ -1225,17 +1221,16 @@ nsPresContext::SetSMILAnimations(nsIDocu case imgIContainer::kDontAnimMode: if (aOldMode != imgIContainer::kDontAnimMode) controller->Pause(nsSMILTimeContainer::PAUSE_USERPREF); break; } } } -#endif // MOZ_SMIL void nsPresContext::SetImageAnimationModeInternal(PRUint16 aMode) { NS_ASSERTION(aMode == imgIContainer::kNormalAnimMode || aMode == imgIContainer::kDontAnimMode || aMode == imgIContainer::kLoopOnceAnimMode, "Wrong Animation Mode is being set!"); @@ -1251,20 +1246,17 @@ nsPresContext::SetImageAnimationModeInte // on all the images. if (mShell != nsnull) { nsIDocument *doc = mShell->GetDocument(); if (doc) { Element *rootElement = doc->GetRootElement(); if (rootElement) { SetImgAnimations(rootElement, aMode); } - -#ifdef MOZ_SMIL SetSMILAnimations(doc, aMode, mImageAnimationMode); -#endif // MOZ_SMIL } } mImageAnimationMode = aMode; } void nsPresContext::SetImageAnimationModeExternal(PRUint16 aMode)
--- a/layout/base/nsPresContext.h +++ b/layout/base/nsPresContext.h @@ -987,20 +987,18 @@ public: bool IsRootContentDocument(); protected: friend class nsRunnableMethod<nsPresContext>; NS_HIDDEN_(void) ThemeChangedInternal(); NS_HIDDEN_(void) SysColorChangedInternal(); NS_HIDDEN_(void) SetImgAnimations(nsIContent *aParent, PRUint16 aMode); -#ifdef MOZ_SMIL NS_HIDDEN_(void) SetSMILAnimations(nsIDocument *aDoc, PRUint16 aNewMode, PRUint16 aOldMode); -#endif // MOZ_SMIL NS_HIDDEN_(void) GetDocumentColorPreferences(); NS_HIDDEN_(void) PreferenceChanged(const char* aPrefName); static NS_HIDDEN_(int) PrefChangedCallback(const char*, void*); NS_HIDDEN_(void) UpdateAfterPreferencesChanged(); static NS_HIDDEN_(void) PrefChangedUpdateTimerCallback(nsITimer *aTimer, void *aClosure);
--- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -144,19 +144,17 @@ #include "nsEventDispatcher.h" #include "nsThreadUtils.h" #include "nsStyleSheetService.h" #include "gfxImageSurface.h" #include "gfxContext.h" #ifdef MOZ_MEDIA #include "nsHTMLMediaElement.h" #endif -#ifdef MOZ_SMIL #include "nsSMILAnimationController.h" -#endif #include "nsRefreshDriver.h" // Drag & Drop, Clipboard #include "nsWidgetsCID.h" #include "nsIClipboard.h" #include "nsIClipboardHelper.h" #include "nsIDocShellTreeItem.h" @@ -1119,22 +1117,20 @@ PresShell::Init(nsIDocument* aDocument, Preferences::GetBool("layout.reflow.dumpframebyframecounts"); mReflowCountMgr->SetDumpFrameCounts(dumpFrameCounts); mReflowCountMgr->SetDumpFrameByFrameCounts(dumpFrameByFrameCounts); mReflowCountMgr->SetPaintFrameCounts(paintFrameCounts); } #endif -#ifdef MOZ_SMIL if (mDocument->HasAnimationController()) { nsSMILAnimationController* animCtrl = mDocument->GetAnimationController(); animCtrl->NotifyRefreshDriverCreated(GetPresContext()->RefreshDriver()); } -#endif // MOZ_SMIL // Get our activeness from the docShell. QueryIsActive(); return NS_OK; } void @@ -1249,21 +1245,19 @@ PresShell::Destroy() // This shell must be removed from the document before the frame // hierarchy is torn down to avoid finding deleted frames through // this presshell while the frames are being torn down if (mDocument) { NS_ASSERTION(mDocument->GetShell() == this, "Wrong shell?"); mDocument->DeleteShell(); -#ifdef MOZ_SMIL if (mDocument->HasAnimationController()) { mDocument->GetAnimationController()->NotifyRefreshDriverDestroying(rd); } -#endif // MOZ_SMIL } // Revoke any pending events. We need to do this and cancel pending reflows // before we destroy the frame manager, since apparently frame destruction // sometimes spins the event queue when plug-ins are involved(!). rd->RemoveLayoutFlushObserver(this); mResizeEvent.Revoke(); if (mAsyncResizeTimerIsActive) { @@ -4039,22 +4033,20 @@ PresShell::FlushPendingNotifications(moz mViewManager->FlushDelayedResize(false); mPresContext->FlushPendingMediaFeatureValuesChanged(); // Flush any pending update of the user font set, since that could // cause style changes (for updating ex/ch units, and to cause a // reflow). mPresContext->FlushUserFontSet(); -#ifdef MOZ_SMIL // Flush any requested SMIL samples. if (mDocument->HasAnimationController()) { mDocument->GetAnimationController()->FlushResampleRequests(); } -#endif // MOZ_SMIL nsAutoScriptBlocker scriptBlocker; mFrameConstructor->CreateNeededFrames(); mFrameConstructor->ProcessPendingRestyles(); } // Dispatch any 'animationstart' events those (or earlier) restyles // queued up.
--- a/layout/style/nsDOMCSSAttrDeclaration.cpp +++ b/layout/style/nsDOMCSSAttrDeclaration.cpp @@ -48,25 +48,20 @@ #include "nsIDOMMutationEvent.h" #include "nsIPrincipal.h" #include "nsIURI.h" #include "nsNodeUtils.h" namespace css = mozilla::css; namespace dom = mozilla::dom; -nsDOMCSSAttributeDeclaration::nsDOMCSSAttributeDeclaration(dom::Element* aElement -#ifdef MOZ_SMIL - , bool aIsSMILOverride -#endif // MOZ_SMIL - ) +nsDOMCSSAttributeDeclaration::nsDOMCSSAttributeDeclaration(dom::Element* aElement, + bool aIsSMILOverride) : mElement(aElement) -#ifdef MOZ_SMIL , mIsSMILOverride(aIsSMILOverride) -#endif // MOZ_SMIL { MOZ_COUNT_CTOR(nsDOMCSSAttributeDeclaration); NS_ASSERTION(aElement, "Inline style for a NULL element?"); } nsDOMCSSAttributeDeclaration::~nsDOMCSSAttributeDeclaration() { @@ -83,46 +78,39 @@ NS_IMPL_QUERY_TAIL_INHERITING(nsDOMCSSDe NS_IMPL_CYCLE_COLLECTING_ADDREF(nsDOMCSSAttributeDeclaration) NS_IMPL_CYCLE_COLLECTING_RELEASE(nsDOMCSSAttributeDeclaration) nsresult nsDOMCSSAttributeDeclaration::SetCSSDeclaration(css::Declaration* aDecl) { NS_ASSERTION(mElement, "Must have Element to set the declaration!"); css::StyleRule* oldRule = -#ifdef MOZ_SMIL mIsSMILOverride ? mElement->GetSMILOverrideStyleRule() : -#endif // MOZ_SMIL mElement->GetInlineStyleRule(); NS_ASSERTION(oldRule, "Element must have rule"); nsRefPtr<css::StyleRule> newRule = oldRule->DeclarationChanged(aDecl, false); if (!newRule) { return NS_ERROR_OUT_OF_MEMORY; } return -#ifdef MOZ_SMIL mIsSMILOverride ? mElement->SetSMILOverrideStyleRule(newRule, true) : -#endif // MOZ_SMIL mElement->SetInlineStyleRule(newRule, true); } nsIDocument* nsDOMCSSAttributeDeclaration::DocToUpdate() { // XXXbz this is a bit of a hack, especially doing it before the // BeginUpdate(), but this is a good chokepoint where we know we // plan to modify the CSSDeclaration, so need to notify // AttributeWillChange if this is inline style. -#ifdef MOZ_SMIL - if (!mIsSMILOverride) -#endif - { + if (!mIsSMILOverride) { nsNodeUtils::AttributeWillChange(mElement, kNameSpaceID_None, nsGkAtoms::style, nsIDOMMutationEvent::MODIFICATION); } // We need OwnerDoc() rather than GetCurrentDoc() because it might // be the BeginUpdate call that inserts mElement into the document. return mElement->OwnerDoc(); @@ -130,42 +118,38 @@ nsDOMCSSAttributeDeclaration::DocToUpdat css::Declaration* nsDOMCSSAttributeDeclaration::GetCSSDeclaration(bool aAllocate) { if (!mElement) return nsnull; css::StyleRule* cssRule; -#ifdef MOZ_SMIL if (mIsSMILOverride) cssRule = mElement->GetSMILOverrideStyleRule(); else -#endif // MOZ_SMIL cssRule = mElement->GetInlineStyleRule(); if (cssRule) { return cssRule->GetDeclaration(); } if (!aAllocate) { return nsnull; } // cannot fail css::Declaration *decl = new css::Declaration(); decl->InitializeEmpty(); nsRefPtr<css::StyleRule> newRule = new css::StyleRule(nsnull, decl); // this *can* fail (inside SetAttrAndNotify, at least). nsresult rv; -#ifdef MOZ_SMIL if (mIsSMILOverride) rv = mElement->SetSMILOverrideStyleRule(newRule, false); else -#endif // MOZ_SMIL rv = mElement->SetInlineStyleRule(newRule, false); if (NS_FAILED(rv)) { return nsnull; // the decl will be destroyed along with the style rule } return decl; }
--- a/layout/style/nsDOMCSSAttrDeclaration.h +++ b/layout/style/nsDOMCSSAttrDeclaration.h @@ -57,21 +57,17 @@ class Element; } } class nsDOMCSSAttributeDeclaration : public nsDOMCSSDeclaration, public nsWrapperCache { public: typedef mozilla::dom::Element Element; - nsDOMCSSAttributeDeclaration(Element* aContent -#ifdef MOZ_SMIL - , bool aIsSMILOverride -#endif // MOZ_SMIL - ); + nsDOMCSSAttributeDeclaration(Element* aContent, bool aIsSMILOverride); ~nsDOMCSSAttributeDeclaration(); NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsDOMCSSAttributeDeclaration, nsICSSDeclaration) // If GetCSSDeclaration returns non-null, then the decl it returns // is owned by our current style rule. @@ -82,18 +78,16 @@ public: virtual nsINode* GetParentObject(); protected: virtual nsresult SetCSSDeclaration(mozilla::css::Declaration* aDecl); virtual nsIDocument* DocToUpdate(); nsRefPtr<Element> mElement; -#ifdef MOZ_SMIL /* If true, this indicates that this nsDOMCSSAttributeDeclaration * should interact with mContent's SMIL override style rule (rather * than the inline style rule). */ const bool mIsSMILOverride; -#endif // MOZ_SMIL }; #endif /* nsDOMCSSAttributeDeclaration_h */
--- a/layout/style/nsHTMLCSSStyleSheet.cpp +++ b/layout/style/nsHTMLCSSStyleSheet.cpp @@ -76,34 +76,32 @@ nsHTMLCSSStyleSheet::RulesMatching(Eleme // just get the one and only style rule from the content's STYLE attribute css::StyleRule* rule = element->GetInlineStyleRule(); if (rule) { rule->RuleMatched(); aData->mRuleWalker->Forward(rule); } -#ifdef MOZ_SMIL rule = element->GetSMILOverrideStyleRule(); if (rule) { if (aData->mPresContext->IsProcessingRestyles() && !aData->mPresContext->IsProcessingAnimationStyleChange()) { // Non-animation restyle -- don't process SMIL override style, because we // don't want SMIL animation to trigger new CSS transitions. Instead, // request an Animation restyle, so we still get noticed. aData->mPresContext->PresShell()->RestyleForAnimation(element, eRestyle_Self); } else { // Animation restyle (or non-restyle traversal of rules) // Now we can walk SMIL overrride style, without triggering transitions. rule->RuleMatched(); aData->mRuleWalker->Forward(rule); } } -#endif // MOZ_SMIL } /* virtual */ void nsHTMLCSSStyleSheet::RulesMatching(PseudoElementRuleProcessorData* aData) { } /* virtual */ void
--- a/layout/svg/base/src/nsSVGUtils.cpp +++ b/layout/svg/base/src/nsSVGUtils.cpp @@ -161,22 +161,19 @@ 147, 149, 151, 152, 154, 156, 157, 159, 161, 163, 164, 166, 168, 170, 171, 173, 175, 177, 179, 181, 183, 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, 224, 226, 229, 231, 233, 235, 237, 239, 242, 244, 246, 248, 250, 253, 255 }; -#ifdef MOZ_SMIL static bool gSMILEnabled; static const char SMIL_PREF_STR[] = "svg.smil.enabled"; -#endif // MOZ_SMIL -#ifdef MOZ_SMIL static int SMILPrefChanged(const char *aPref, void *aClosure) { bool prefVal = Preferences::GetBool(SMIL_PREF_STR); gSMILEnabled = prefVal; return 0; } @@ -190,17 +187,16 @@ NS_SMILEnabled() gSMILEnabled = Preferences::GetBool(SMIL_PREF_STR); Preferences::RegisterCallback(SMILPrefChanged, SMIL_PREF_STR); sInitialized = true; } return gSMILEnabled; } -#endif // MOZ_SMIL nsSVGSVGElement* nsSVGUtils::GetOuterSVGElement(nsSVGElement *aSVGElement) { nsIContent *element = nsnull; nsIContent *ancestor = aSVGElement->GetFlattenedTreeParent(); while (ancestor && ancestor->GetNameSpaceID() == kNameSpaceID_SVG &&
--- a/layout/svg/base/src/nsSVGUtils.h +++ b/layout/svg/base/src/nsSVGUtils.h @@ -134,23 +134,21 @@ IsSVGWhitespace(char aChar) inline bool IsSVGWhitespace(PRUnichar aChar) { return aChar == PRUnichar('\x20') || aChar == PRUnichar('\x9') || aChar == PRUnichar('\xD') || aChar == PRUnichar('\xA'); } -#ifdef MOZ_SMIL /* * Checks the smil enabled preference. Declared as a function to match * NS_SVGEnabled(). */ bool NS_SMILEnabled(); -#endif // MOZ_SMIL // GRRR WINDOWS HATE HATE HATE #undef CLIP_MASK class nsSVGRenderState { public: enum RenderMode { NORMAL, CLIP, CLIP_MASK };
--- a/mobile/installer/package-manifest.in +++ b/mobile/installer/package-manifest.in @@ -503,19 +503,17 @@ @BINPATH@/res/entityTables/* #ifdef XP_MACOSX @BINPATH@/res/MainMenu.nib/ #endif ; svg @BINPATH@/res/svg.css @BINPATH@/components/dom_svg.xpt -#ifdef MOZ_SMIL @BINPATH@/components/dom_smil.xpt -#endif ; [Personal Security Manager] ; @BINPATH@/@DLL_PREFIX@nssckbi@DLL_SUFFIX@ @BINPATH@/components/pipboot.xpt @BINPATH@/components/pipnss.xpt @BINPATH@/components/pippki.xpt @BINPATH@/@DLL_PREFIX@nss3@DLL_SUFFIX@
--- a/toolkit/toolkit-makefiles.sh +++ b/toolkit/toolkit-makefiles.sh @@ -261,16 +261,21 @@ MAKEFILES_content=" content/xslt/public/Makefile content/xslt/src/Makefile content/xslt/src/base/Makefile content/xslt/src/xml/Makefile content/xslt/src/xpath/Makefile content/xslt/src/xslt/Makefile " +MAKEFILES_smil=" + content/smil/Makefile + dom/interfaces/smil/Makefile +" + MAKEFILES_layout=" layout/Makefile layout/base/Makefile layout/base/tests/Makefile layout/build/Makefile layout/forms/Makefile layout/generic/Makefile layout/inspector/public/Makefile @@ -735,16 +740,17 @@ add_makefiles " $MAKEFILES_intl $MAKEFILES_xpconnect $MAKEFILES_jsipc $MAKEFILES_jsdebugger $MAKEFILES_jsctypes $MAKEFILES_jsreflect $MAKEFILES_jsductwork $MAKEFILES_content + $MAKEFILES_smil $MAKEFILES_layout $MAKEFILES_libjar $MAKEFILES_libreg $MAKEFILES_libpref $MAKEFILES_mathml $MAKEFILES_plugin $MAKEFILES_netwerk $MAKEFILES_storage @@ -1077,23 +1083,16 @@ if [ "$NS_TRACE_MALLOC" ]; then fi if [ "$MOZ_MAPINFO" ]; then add_makefiles " tools/codesighs/Makefile " fi -if [ "$MOZ_SMIL" ]; then - add_makefiles " - content/smil/Makefile - dom/interfaces/smil/Makefile - " -fi - if [ "$MOZ_XTF" ]; then add_makefiles " content/xtf/Makefile content/xtf/public/Makefile content/xtf/src/Makefile " fi
--- a/widget/public/nsGUIEvent.h +++ b/widget/public/nsGUIEvent.h @@ -106,19 +106,17 @@ class nsHashKey; #define NS_COMMAND_EVENT 24 #define NS_SCROLLAREA_EVENT 25 #define NS_TRANSITION_EVENT 26 #define NS_ANIMATION_EVENT 27 #define NS_UI_EVENT 28 #define NS_SVG_EVENT 30 #define NS_SVGZOOM_EVENT 31 -#ifdef MOZ_SMIL #define NS_SMIL_TIME_EVENT 32 -#endif // MOZ_SMIL #define NS_QUERY_CONTENT_EVENT 33 #define NS_DRAG_EVENT 35 #define NS_NOTIFYPAINT_EVENT 36 #define NS_SIMPLE_GESTURE_EVENT 37 #define NS_SELECTION_EVENT 38 #define NS_CONTENT_COMMAND_EVENT 39 @@ -505,22 +503,20 @@ class nsHashKey; #define NS_TRANSITION_EVENT_START 4200 #define NS_TRANSITION_END (NS_TRANSITION_EVENT_START) #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) -#ifdef MOZ_SMIL #define NS_SMIL_TIME_EVENT_START 4300 #define NS_SMIL_BEGIN (NS_SMIL_TIME_EVENT_START) #define NS_SMIL_END (NS_SMIL_TIME_EVENT_START + 1) #define NS_SMIL_REPEAT (NS_SMIL_TIME_EVENT_START + 2) -#endif // MOZ_SMIL #define NS_MOZTOUCH_EVENT_START 4400 #define NS_MOZTOUCH_DOWN (NS_MOZTOUCH_EVENT_START) #define NS_MOZTOUCH_MOVE (NS_MOZTOUCH_EVENT_START+1) #define NS_MOZTOUCH_UP (NS_MOZTOUCH_EVENT_START+2) // script notification events #define NS_NOTIFYSCRIPT_START 4500