diff --git a/browser/base/content/tabbrowser.xml b/browser/base/content/tabbrowser.xml index a5ac971e6ce..418f2b31e63 100644 --- a/browser/base/content/tabbrowser.xml +++ b/browser/base/content/tabbrowser.xml @@ -1108,6 +1108,7 @@ 1) + gBrowser.removeTab(gBrowser.selectedTab) + runNextTest(); + }); + }); +} + +let gTests = [ + { desc: "Simple return keypress", + event: {}, + check: checkCurrent + }, + + { desc: "Alt+Return keypress", + event: { altKey: true }, + check: checkNewTab, + }, +] + +function checkCurrent(aTab) { + is(gURLBar.value, TEST_VALUE, "Urlbar should preserve the value on return keypress"); + is(gBrowser.selectedTab, aTab, "New URL was loaded in the current tab"); +} + +function checkNewTab(aTab) { + is(gURLBar.value, TEST_VALUE, "Urlbar should preserve the value on return keypress"); + isnot(gBrowser.selectedTab, aTab, "New URL was loaded in a new tab"); +} + +function addPageShowListener(aFunc) { + gBrowser.selectedBrowser.addEventListener("pageshow", function loadListener() { + gBrowser.selectedBrowser.removeEventListener("pageshow", loadListener, false); + aFunc(); + }); +} + diff --git a/browser/base/content/urlbarBindings.xml b/browser/base/content/urlbarBindings.xml index d4f4ce2bd48..8232bf1c4d7 100644 --- a/browser/base/content/urlbarBindings.xml +++ b/browser/base/content/urlbarBindings.xml @@ -326,6 +326,10 @@ // keyword). if (!mayInheritPrincipal) flags |= Ci.nsIWebNavigation.LOAD_FLAGS_DISALLOW_INHERIT_OWNER; + // If the value wasn't typed, we know that we decoded the value as + // UTF-8 (see losslessDecodeURI) + if (!this.valueIsTyped) + flags |= Ci.nsIWebNavigation.LOAD_FLAGS_URI_IS_UTF8; gBrowser.loadURIWithFlags(url, flags, null, null, postData); } @@ -361,6 +365,8 @@ let params = { allowThirdPartyFixup: true, postData: postData }; if (altEnter) params.inBackground = false; + if (!this.valueIsTyped) + params.isUTF8 = true; openUILinkIn(url, where, params); } } else { diff --git a/browser/base/content/utilityOverlay.js b/browser/base/content/utilityOverlay.js index 5c99aff2e22..f1f7e40292b 100644 --- a/browser/base/content/utilityOverlay.js +++ b/browser/base/content/utilityOverlay.js @@ -199,6 +199,8 @@ function openLinkIn(url, where, params) { var aRelatedToCurrent = params.relatedToCurrent; var aInBackground = params.inBackground; var aDisallowInheritPrincipal = params.disallowInheritPrincipal; + // Currently, this parameter works only for where=="tab" or "current" + var aIsUTF8 = params.isUTF8; if (where == "save") { saveURL(url, null, null, true, null, aReferrerURI); @@ -272,6 +274,8 @@ function openLinkIn(url, where, params) { flags |= Ci.nsIWebNavigation.LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP; if (aDisallowInheritPrincipal) flags |= Ci.nsIWebNavigation.LOAD_FLAGS_DISALLOW_INHERIT_OWNER; + if (aIsUTF8) + flags |= Ci.nsIWebNavigation.LOAD_FLAGS_URI_IS_UTF8; w.gBrowser.loadURIWithFlags(url, flags, aReferrerURI, null, aPostData); break; case "tabshifted": @@ -285,7 +289,8 @@ function openLinkIn(url, where, params) { postData: aPostData, inBackground: loadInBackground, allowThirdPartyFixup: aAllowThirdPartyFixup, - relatedToCurrent: aRelatedToCurrent}); + relatedToCurrent: aRelatedToCurrent, + isUTF8: aIsUTF8}); break; } diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in index a79a45c22d4..60bfd61fc88 100644 --- a/browser/installer/package-manifest.in +++ b/browser/installer/package-manifest.in @@ -278,8 +278,6 @@ @BINPATH@/components/toolkitsearch.manifest @BINPATH@/components/nsSearchService.js @BINPATH@/components/nsSearchSuggestions.js -@BINPATH@/components/nsTryToClose.manifest -@BINPATH@/components/nsTryToClose.js @BINPATH@/components/passwordmgr.manifest @BINPATH@/components/nsLoginInfo.js @BINPATH@/components/nsLoginManager.js @@ -481,9 +479,7 @@ ; svg @BINPATH@/res/svg.css @BINPATH@/components/dom_svg.xpt -#ifdef MOZ_SMIL @BINPATH@/components/dom_smil.xpt -#endif ; [Personal Security Manager] ; diff --git a/build/pymake/pymake/process.py b/build/pymake/pymake/process.py index 2f2114dac0f..0fdd68bdbca 100644 --- a/build/pymake/pymake/process.py +++ b/build/pymake/pymake/process.py @@ -215,9 +215,13 @@ class PythonJob(Job): print >>sys.stderr, e return e.exitcode except: - print >>sys.stderr, sys.exc_info()[1] - print >>sys.stderr, traceback.print_exc() - return -127 + e = sys.exc_info()[1] + if isinstance(e, SystemExit) and (e.code == 0 or e.code == '0'): + pass # sys.exit(0) is not a failure + else: + print >>sys.stderr, e + print >>sys.stderr, traceback.print_exc() + return -127 finally: os.environ = oldenv return 0 diff --git a/build/pymake/tests/native-command-sys-exit.mk b/build/pymake/tests/native-command-sys-exit.mk new file mode 100644 index 00000000000..085027c293a --- /dev/null +++ b/build/pymake/tests/native-command-sys-exit.mk @@ -0,0 +1,8 @@ +#T gmake skip + +CMD = %pycmd asplode +PYCOMMANDPATH = $(TESTPATH) $(TESTPATH)/subdir + +all: + $(CMD) 0 + @echo TEST-PASS diff --git a/build/pymake/tests/pycmd.py b/build/pymake/tests/pycmd.py index 0bd57133e21..33af55d6d3e 100644 --- a/build/pymake/tests/pycmd.py +++ b/build/pymake/tests/pycmd.py @@ -1,4 +1,4 @@ -import os +import os, sys def writetofile(args): with open(args[0], 'w') as f: @@ -7,3 +7,7 @@ def writetofile(args): def writeenvtofile(args): with open(args[0], 'w') as f: f.write(os.environ[args[1]]) + +def asplode(args): + sys.exit(args[0]) + return 0 diff --git a/config/autoconf.mk.in b/config/autoconf.mk.in index dd64d098d4b..2dc0bad69e4 100644 --- a/config/autoconf.mk.in +++ b/config/autoconf.mk.in @@ -253,7 +253,6 @@ 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@ diff --git a/config/rules.mk b/config/rules.mk index 01b64bda246..d1b969becd4 100644 --- a/config/rules.mk +++ b/config/rules.mk @@ -1469,7 +1469,7 @@ $(XPIDL_GEN_DIR)/%.h: %.idl $(XPIDL_DEPS) $(XPIDL_GEN_DIR)/.done $(PYTHON_PATH) \ -I$(topsrcdir)/other-licenses/ply \ -I$(topsrcdir)/xpcom/idl-parser \ - $(topsrcdir)/xpcom/idl-parser/header.py --cachedir=$(topsrcdir)/xpcom/idl-parser $(XPIDL_FLAGS) $(_VPATH_SRCS) -d $(MDDEPDIR)/$(@F).pp -o $@ + $(topsrcdir)/xpcom/idl-parser/header.py --cachedir=$(DEPTH)/xpcom/idl-parser $(XPIDL_FLAGS) $(_VPATH_SRCS) -d $(MDDEPDIR)/$(@F).pp -o $@ @if test -n "$(findstring $*.h, $(EXPORTS))"; \ then echo "*** WARNING: file $*.h generated from $*.idl overrides $(srcdir)/$*.h"; else true; fi @@ -1482,7 +1482,7 @@ $(XPIDL_GEN_DIR)/%.xpt: %.idl $(XPIDL_DEPS) $(XPIDL_GEN_DIR)/.done -I$(topsrcdir)/other-licenses/ply \ -I$(topsrcdir)/xpcom/idl-parser \ -I$(topsrcdir)/xpcom/typelib/xpt/tools \ - $(topsrcdir)/xpcom/idl-parser/typelib.py --cachedir=$(topsrcdir)/xpcom/idl-parser $(XPIDL_FLAGS) $(_VPATH_SRCS) -d $(MDDEPDIR)/$(@F).pp -o $@ + $(topsrcdir)/xpcom/idl-parser/typelib.py --cachedir=$(DEPTH)/xpcom/idl-parser $(XPIDL_FLAGS) $(_VPATH_SRCS) -d $(MDDEPDIR)/$(@F).pp -o $@ # no need to link together if XPIDLSRCS contains only XPIDL_MODULE ifneq ($(XPIDL_MODULE).idl,$(strip $(XPIDLSRCS))) diff --git a/configure.in b/configure.in index 154af03b518..d7d353c0231 100644 --- a/configure.in +++ b/configure.in @@ -6189,18 +6189,6 @@ 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 ======================================================== @@ -8293,7 +8281,6 @@ 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) diff --git a/content/base/public/nsIContent.h b/content/base/public/nsIContent.h index 911c5394efb..dae882c92d6 100644 --- a/content/base/public/nsIContent.h +++ b/content/base/public/nsIContent.h @@ -57,10 +57,8 @@ class nsAttrName; class nsTextFragment; class nsIDocShell; class nsIFrame; -#ifdef MOZ_SMIL class nsISMILAttr; class nsIDOMCSSStyleDeclaration; -#endif // MOZ_SMIL namespace mozilla { namespace css { @@ -891,7 +889,6 @@ public: mPrimaryFrame = aFrame; } -#ifdef MOZ_SMIL /* * Returns a new nsISMILAttr that allows the caller to animate the given * attribute on this element. @@ -924,7 +921,6 @@ public: */ virtual nsresult SetSMILOverrideStyleRule(mozilla::css::StyleRule* aStyleRule, bool aNotify) = 0; -#endif // MOZ_SMIL nsresult LookupNamespaceURI(const nsAString& aNamespacePrefix, nsAString& aNamespaceURI) const; diff --git a/content/base/public/nsIDocument.h b/content/base/public/nsIDocument.h index 18b5e397993..70925c18b71 100644 --- a/content/base/public/nsIDocument.h +++ b/content/base/public/nsIDocument.h @@ -61,9 +61,7 @@ #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" @@ -1326,7 +1324,6 @@ public: 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. @@ -1336,7 +1333,6 @@ public: // 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 @@ -1649,10 +1645,8 @@ protected: // themselves when they go away. nsAutoPtr > > mFreezableElements; -#ifdef MOZ_SMIL // SMIL Animation Controller, lazily-initialized in GetAnimationController nsRefPtr mAnimationController; -#endif // MOZ_SMIL // Table of element properties for this document. nsPropertyTable mPropertyTable; diff --git a/content/base/public/nsINode.h b/content/base/public/nsINode.h index 354c787320a..80e157922f8 100644 --- a/content/base/public/nsINode.h +++ b/content/base/public/nsINode.h @@ -284,9 +284,7 @@ private: // 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 \ diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index e58277f46a5..f41896c918d 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -185,11 +185,9 @@ #include "nsDOMNavigationTiming.h" #include "nsEventStateManager.h" -#ifdef MOZ_SMIL #include "nsSMILAnimationController.h" #include "imgIContainer.h" #include "nsSVGUtils.h" -#endif // MOZ_SMIL #include "nsRefreshDriver.h" @@ -1591,11 +1589,9 @@ nsDocument::~nsDocument() mStyleSheetSetList->Disconnect(); } -#ifdef MOZ_SMIL if (mAnimationController) { mAnimationController->Disconnect(); } -#endif // MOZ_SMIL mParentDocument = nsnull; @@ -1878,12 +1874,10 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsDocument) 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); @@ -1955,11 +1949,9 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsDocument) tmp->mIdentifierMap.Clear(); -#ifdef MOZ_SMIL if (tmp->mAnimationController) { tmp->mAnimationController->Unlink(); } -#endif // MOZ_SMIL tmp->mInUnlinkOrDeletion = false; NS_IMPL_CYCLE_COLLECTION_UNLINK_END @@ -3768,13 +3760,11 @@ nsDocument::SetScriptGlobalObject(nsIScriptGlobalObject *aScriptGlobalObject) "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 @@ -5535,7 +5525,6 @@ nsDocument::EnumerateExternalResources(nsSubDocEnumFunc aCallback, void* aData) mExternalResourceMap.EnumerateResources(aCallback, aData); } -#ifdef MOZ_SMIL nsSMILAnimationController* nsDocument::GetAnimationController() { @@ -5570,7 +5559,6 @@ nsDocument::GetAnimationController() return mAnimationController; } -#endif // MOZ_SMIL struct DirTable { const char* mName; @@ -7279,11 +7267,9 @@ nsDocument::OnPageShow(bool aPersisted, mIsShowing = true; } -#ifdef MOZ_SMIL if (mAnimationController) { mAnimationController->OnPageShow(); } -#endif if (aPersisted) { SetImagesNeedAnimating(true); @@ -7349,11 +7335,9 @@ nsDocument::OnPageHide(bool aPersisted, mIsShowing = false; } -#ifdef MOZ_SMIL if (mAnimationController) { mAnimationController->OnPageHide(); } -#endif if (aPersisted) { SetImagesNeedAnimating(false); @@ -8544,18 +8528,18 @@ GetCommonAncestor(nsIDocument* aDoc1, nsIDocument* aDoc2) 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 { @@ -8588,7 +8572,7 @@ nsDocument::AsyncRequestFullScreen(Element* aElement) // Request full-screen asynchronously. nsCOMPtr event(new nsCallRequestFullScreen(aElement)); NS_DispatchToCurrentThread(event); -} +} void nsDocument::RequestFullScreen(Element* aElement, bool aWasCallerChrome) diff --git a/content/base/src/nsDocument.h b/content/base/src/nsDocument.h index bd541def4d9..b0a60ae7522 100644 --- a/content/base/src/nsDocument.h +++ b/content/base/src/nsDocument.h @@ -865,11 +865,9 @@ public: nsTArray 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); diff --git a/content/base/src/nsGenericDOMDataNode.cpp b/content/base/src/nsGenericDOMDataNode.cpp index e08c2950dc8..d3fbc413fbc 100644 --- a/content/base/src/nsGenericDOMDataNode.cpp +++ b/content/base/src/nsGenericDOMDataNode.cpp @@ -928,7 +928,6 @@ nsGenericDOMDataNode::WalkContentStyleRules(nsRuleWalker* aRuleWalker) return NS_OK; } -#ifdef MOZ_SMIL nsIDOMCSSStyleDeclaration* nsGenericDOMDataNode::GetSMILOverrideStyle() { @@ -948,7 +947,6 @@ nsGenericDOMDataNode::SetSMILOverrideStyleRule(css::StyleRule* aStyleRule, NS_NOTREACHED("How come we're setting SMILOverrideStyle on a non-element?"); return NS_ERROR_UNEXPECTED; } -#endif // MOZ_SMIL css::StyleRule* nsGenericDOMDataNode::GetInlineStyleRule() diff --git a/content/base/src/nsGenericDOMDataNode.h b/content/base/src/nsGenericDOMDataNode.h index 1034b26fe54..d656aed38a6 100644 --- a/content/base/src/nsGenericDOMDataNode.h +++ b/content/base/src/nsGenericDOMDataNode.h @@ -52,9 +52,7 @@ #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 @@ -228,7 +226,6 @@ public: virtual void DestroyContent(); virtual void SaveSubtreeState(); -#ifdef MOZ_SMIL virtual nsISMILAttr* GetAnimatedAttr(PRInt32 /*aNamespaceID*/, nsIAtom* /*aName*/) { return nsnull; @@ -237,7 +234,6 @@ public: 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; diff --git a/content/base/src/nsGenericElement.cpp b/content/base/src/nsGenericElement.cpp index 7a37d375094..975662ac689 100644 --- a/content/base/src/nsGenericElement.cpp +++ b/content/base/src/nsGenericElement.cpp @@ -2293,10 +2293,8 @@ nsGenericElement::nsDOMSlots::Traverse(nsCycleCollectionTraversalCallback &cb, b 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()); @@ -2314,9 +2312,7 @@ void nsGenericElement::nsDOMSlots::Unlink(bool aIsXUL) { mStyle = nsnull; -#ifdef MOZ_SMIL mSMILOverrideStyle = nsnull; -#endif // MOZ_SMIL if (mAttributeMap) { mAttributeMap->DropReference(); mAttributeMap = nsnull; @@ -2456,13 +2452,11 @@ nsGenericElement::InternalIsSupported(nsISupports* aObject, *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; } @@ -3355,7 +3349,6 @@ nsGenericElement::WalkContentStyleRules(nsRuleWalker* aRuleWalker) return NS_OK; } -#ifdef MOZ_SMIL nsIDOMCSSStyleDeclaration* nsGenericElement::GetSMILOverrideStyle() { @@ -3398,7 +3391,6 @@ nsGenericElement::SetSMILOverrideStyleRule(css::StyleRule* aStyleRule, return NS_OK; } -#endif // MOZ_SMIL css::StyleRule* nsGenericElement::GetInlineStyleRule() diff --git a/content/base/src/nsGenericElement.h b/content/base/src/nsGenericElement.h index 6ab843b020c..0098db61e74 100644 --- a/content/base/src/nsGenericElement.h +++ b/content/base/src/nsGenericElement.h @@ -67,9 +67,7 @@ #include "nsIDOMTouchEvent.h" #include "nsIInlineEventHandlers.h" -#ifdef MOZ_SMIL #include "nsISMILAttr.h" -#endif // MOZ_SMIL class nsIDOMAttr; class nsIDOMEventListener; @@ -349,7 +347,6 @@ public: virtual void DestroyContent(); virtual void SaveSubtreeState(); -#ifdef MOZ_SMIL virtual nsISMILAttr* GetAnimatedAttr(PRInt32 /*aNamespaceID*/, nsIAtom* /*aName*/) { return nsnull; @@ -358,7 +355,6 @@ public: 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 diff --git a/content/base/src/nsGkAtomList.h b/content/base/src/nsGkAtomList.h index 39171d5b71e..1742fb571b9 100644 --- a/content/base/src/nsGkAtomList.h +++ b/content/base/src/nsGkAtomList.h @@ -1368,7 +1368,6 @@ 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") @@ -1395,7 +1394,6 @@ 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_ diff --git a/content/base/src/nsStyledElement.cpp b/content/base/src/nsStyledElement.cpp index 8af63ed9dee..e4f000fd412 100644 --- a/content/base/src/nsStyledElement.cpp +++ b/content/base/src/nsStyledElement.cpp @@ -271,11 +271,7 @@ nsStyledElementNotElementCSSInlineStyle::GetStyle(nsresult* retval) // Just in case... ReparseStyleAttribute(true); - slots->mStyle = new nsDOMCSSAttributeDeclaration(this -#ifdef MOZ_SMIL - , false -#endif // MOZ_SMIL - ); + slots->mStyle = new nsDOMCSSAttributeDeclaration(this, false); SetMayHaveStyle(); } diff --git a/content/base/src/nsTreeSanitizer.cpp b/content/base/src/nsTreeSanitizer.cpp index f922b6ad546..1222d732f76 100644 --- a/content/base/src/nsTreeSanitizer.cpp +++ b/content/base/src/nsTreeSanitizer.cpp @@ -323,7 +323,6 @@ nsIAtom** const kURLAttributesHTML[] = { }; nsIAtom** const kElementsSVG[] = { -#ifdef MOZ_SVG &nsGkAtoms::a, // a &nsGkAtoms::altGlyph, // altGlyph &nsGkAtoms::altGlyphDef, // altGlyphDef @@ -407,39 +406,29 @@ nsIAtom** const kElementsSVG[] = { &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 @@ -460,17 +449,13 @@ nsIAtom** const kAttributesSVG[] = { &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 @@ -518,11 +503,9 @@ nsIAtom** const kAttributesSVG[] = { &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 @@ -575,15 +558,11 @@ nsIAtom** const kAttributesSVG[] = { &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 @@ -625,9 +604,7 @@ nsIAtom** const kAttributesSVG[] = { // textLength &nsGkAtoms::text_rendering, // text-rendering &nsGkAtoms::title, // title -#ifdef MOZ_SMIL &nsGkAtoms::to, // to -#endif &nsGkAtoms::transform, // transform &nsGkAtoms::type, // type // u1 @@ -664,7 +641,6 @@ nsIAtom** const kAttributesSVG[] = { &nsGkAtoms::yChannelSelector, // yChannelSelector &nsGkAtoms::z, // z &nsGkAtoms::zoomAndPan, // zoomAndPan -#endif nsnull }; diff --git a/content/events/public/nsEventNameList.h b/content/events/public/nsEventNameList.h index a202dbc68ff..7b6e5fe88f7 100644 --- a/content/events/public/nsEventNameList.h +++ b/content/events/public/nsEventNameList.h @@ -648,7 +648,6 @@ NON_IDL_EVENT(zoom, NS_SVG_ZOOM, EventNameType_SVGSVG, NS_EVENT_NULL) -#ifdef MOZ_SMIL NON_IDL_EVENT(begin, NS_SMIL_BEGIN, EventNameType_SMIL, @@ -673,7 +672,6 @@ NON_IDL_EVENT(repeatEvent, NS_SMIL_REPEAT, EventNameType_None, NS_SMIL_TIME_EVENT) -#endif // MOZ_SMIL NON_IDL_EVENT(MozAudioAvailable, NS_MOZAUDIOAVAILABLE, diff --git a/content/events/public/nsIPrivateDOMEvent.h b/content/events/public/nsIPrivateDOMEvent.h index a0cb1e7d852..0a4c447c21f 100644 --- a/content/events/public/nsIPrivateDOMEvent.h +++ b/content/events/public/nsIPrivateDOMEvent.h @@ -105,10 +105,8 @@ 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 diff --git a/content/events/src/nsDOMEvent.cpp b/content/events/src/nsDOMEvent.cpp index 6252eee1fb4..059b6e747c1 100644 --- a/content/events/src/nsDOMEvent.cpp +++ b/content/events/src/nsDOMEvent.cpp @@ -85,9 +85,7 @@ static const char* const sEventNames[] = { "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", @@ -804,7 +802,6 @@ NS_METHOD nsDOMEvent::DuplicatePrivateData() newEvent->eventStructType = NS_SVGZOOM_EVENT; break; } -#ifdef MOZ_SMIL case NS_SMIL_TIME_EVENT: { newEvent = new nsUIEvent(false, msg, 0); @@ -812,7 +809,6 @@ NS_METHOD nsDOMEvent::DuplicatePrivateData() newEvent->eventStructType = NS_SMIL_TIME_EVENT; break; } -#endif // MOZ_SMIL case NS_SIMPLE_GESTURE_EVENT: { nsSimpleGestureEvent* oldSimpleGestureEvent = static_cast(mEvent); @@ -1295,14 +1291,12 @@ const char* nsDOMEvent::GetEventName(PRUint32 aEventType) 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]; diff --git a/content/events/src/nsDOMEvent.h b/content/events/src/nsDOMEvent.h index 4455a088b26..dd6c63d4db4 100644 --- a/content/events/src/nsDOMEvent.h +++ b/content/events/src/nsDOMEvent.h @@ -149,11 +149,9 @@ public: 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, diff --git a/content/events/src/nsEventDispatcher.cpp b/content/events/src/nsEventDispatcher.cpp index 69e7154e393..00f1188c894 100644 --- a/content/events/src/nsEventDispatcher.cpp +++ b/content/events/src/nsEventDispatcher.cpp @@ -792,10 +792,8 @@ nsEventDispatcher::CreateEvent(nsPresContext* aPresContext, case NS_SVGZOOM_EVENT: return NS_NewDOMSVGZoomEvent(aDOMEvent, aPresContext, static_cast(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, @@ -859,11 +857,9 @@ nsEventDispatcher::CreateEvent(nsPresContext* aPresContext, 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); diff --git a/content/events/src/nsEventListenerManager.cpp b/content/events/src/nsEventListenerManager.cpp index 84f509bad0f..0d9a752e1a8 100644 --- a/content/events/src/nsEventListenerManager.cpp +++ b/content/events/src/nsEventListenerManager.cpp @@ -624,14 +624,12 @@ nsEventListenerManager::CompileEventHandlerInternal(nsListenerStruct *aListenerS 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; diff --git a/content/smil/Makefile.in b/content/smil/Makefile.in index a9de7ba9572..232791b4943 100644 --- a/content/smil/Makefile.in +++ b/content/smil/Makefile.in @@ -46,14 +46,21 @@ 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 \ @@ -63,6 +70,7 @@ CPPSRCS += \ nsSMILFloatType.cpp \ nsSMILInstanceTime.cpp \ nsSMILInterval.cpp \ + nsSMILKeySpline.cpp \ nsSMILMappedAttribute.cpp \ nsSMILNullType.cpp \ nsSMILParserUtils.cpp \ @@ -77,39 +85,22 @@ CPPSRCS += \ 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 diff --git a/content/svg/content/src/DOMSVGLength.cpp b/content/svg/content/src/DOMSVGLength.cpp index 1c1092ea58d..8e0de116e52 100644 --- a/content/svg/content/src/DOMSVGLength.cpp +++ b/content/svg/content/src/DOMSVGLength.cpp @@ -111,11 +111,9 @@ DOMSVGLength::DOMSVGLength() 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; } @@ -123,11 +121,9 @@ DOMSVGLength::GetUnitType(PRUint16* aUnit) 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)) { @@ -162,11 +158,9 @@ DOMSVGLength::SetValue(float aUserUnitValue) 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 || @@ -182,11 +176,9 @@ DOMSVGLength::SetValue(float aUserUnitValue) 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; } @@ -205,11 +197,9 @@ DOMSVGLength::SetValueInSpecifiedUnits(float aValue) if (HasOwner()) { InternalItem().SetValueInCurrentUnits(aValue); Element()->DidChangeLengthList(mAttrEnum, true); -#ifdef MOZ_SMIL if (mList->mAList->IsAnimating()) { Element()->AnimationNeedsResample(); } -#endif return NS_OK; } mValue = aValue; @@ -230,11 +220,9 @@ DOMSVGLength::SetValueAsString(const nsAString& aValue) if (HasOwner()) { InternalItem() = value; Element()->DidChangeLengthList(mAttrEnum, true); -#ifdef MOZ_SMIL if (mList->mAList->IsAnimating()) { Element()->AnimationNeedsResample(); } -#endif return NS_OK; } mValue = value.GetValueInCurrentUnits(); @@ -245,11 +233,9 @@ DOMSVGLength::SetValueAsString(const nsAString& aValue) 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; @@ -275,11 +261,9 @@ DOMSVGLength::NewValueSpecifiedUnits(PRUint16 aUnit, float aValue) 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); diff --git a/content/svg/content/src/DOMSVGLengthList.cpp b/content/svg/content/src/DOMSVGLengthList.cpp index 883bea78581..0fa07eba22b 100644 --- a/content/svg/content/src/DOMSVGLengthList.cpp +++ b/content/svg/content/src/DOMSVGLengthList.cpp @@ -95,11 +95,9 @@ 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]; @@ -158,11 +156,9 @@ DOMSVGLengthList::InternalList() NS_IMETHODIMP DOMSVGLengthList::GetNumberOfItems(PRUint32 *aNumberOfItems) { -#ifdef MOZ_SMIL if (IsAnimValList()) { Element()->FlushAnimations(); } -#endif *aNumberOfItems = Length(); return NS_OK; } @@ -183,11 +179,9 @@ DOMSVGLengthList::Clear() mItems.Clear(); InternalList().Clear(); Element()->DidChangeLengthList(AttrEnum(), true); -#ifdef MOZ_SMIL if (mAList->IsAnimating()) { Element()->AnimationNeedsResample(); } -#endif } return NS_OK; } @@ -276,11 +270,9 @@ DOMSVGLengthList::InsertItemBefore(nsIDOMSVGLength *newItem, UpdateListIndicesFromIndex(mItems, index + 1); Element()->DidChangeLengthList(AttrEnum(), true); -#ifdef MOZ_SMIL if (mAList->IsAnimating()) { Element()->AnimationNeedsResample(); } -#endif *_retval = domItem.forget().get(); return NS_OK; } @@ -320,11 +312,9 @@ DOMSVGLengthList::ReplaceItem(nsIDOMSVGLength *newItem, 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; } @@ -361,11 +351,9 @@ DOMSVGLengthList::RemoveItem(PRUint32 index, UpdateListIndicesFromIndex(mItems, index); Element()->DidChangeLengthList(AttrEnum(), true); -#ifdef MOZ_SMIL if (mAList->IsAnimating()) { Element()->AnimationNeedsResample(); } -#endif return NS_OK; } diff --git a/content/svg/content/src/DOMSVGNumber.cpp b/content/svg/content/src/DOMSVGNumber.cpp index 25c8d6f3a24..2648f32b1d4 100644 --- a/content/svg/content/src/DOMSVGNumber.cpp +++ b/content/svg/content/src/DOMSVGNumber.cpp @@ -106,11 +106,9 @@ DOMSVGNumber::DOMSVGNumber() 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; } @@ -127,11 +125,9 @@ DOMSVGNumber::SetValue(float aValue) if (HasOwner()) { InternalItem() = aValue; Element()->DidChangeNumberList(mAttrEnum, true); -#ifdef MOZ_SMIL if (mList->mAList->IsAnimating()) { Element()->AnimationNeedsResample(); } -#endif return NS_OK; } mValue = aValue; diff --git a/content/svg/content/src/DOMSVGNumberList.cpp b/content/svg/content/src/DOMSVGNumberList.cpp index 9abfb1d59c3..ca3a73c90e2 100644 --- a/content/svg/content/src/DOMSVGNumberList.cpp +++ b/content/svg/content/src/DOMSVGNumberList.cpp @@ -95,11 +95,9 @@ 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]; @@ -158,11 +156,9 @@ DOMSVGNumberList::InternalList() NS_IMETHODIMP DOMSVGNumberList::GetNumberOfItems(PRUint32 *aNumberOfItems) { -#ifdef MOZ_SMIL if (IsAnimValList()) { Element()->FlushAnimations(); } -#endif *aNumberOfItems = Length(); return NS_OK; } @@ -183,11 +179,9 @@ DOMSVGNumberList::Clear() mItems.Clear(); InternalList().Clear(); Element()->DidChangeNumberList(AttrEnum(), true); -#ifdef MOZ_SMIL if (mAList->IsAnimating()) { Element()->AnimationNeedsResample(); } -#endif } return NS_OK; } @@ -276,11 +270,9 @@ DOMSVGNumberList::InsertItemBefore(nsIDOMSVGNumber *newItem, UpdateListIndicesFromIndex(mItems, index + 1); Element()->DidChangeNumberList(AttrEnum(), true); -#ifdef MOZ_SMIL if (mAList->IsAnimating()) { Element()->AnimationNeedsResample(); } -#endif *_retval = domItem.forget().get(); return NS_OK; } @@ -320,11 +312,9 @@ DOMSVGNumberList::ReplaceItem(nsIDOMSVGNumber *newItem, 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; } @@ -361,11 +351,9 @@ DOMSVGNumberList::RemoveItem(PRUint32 index, UpdateListIndicesFromIndex(mItems, index); Element()->DidChangeNumberList(AttrEnum(), true); -#ifdef MOZ_SMIL if (mAList->IsAnimating()) { Element()->AnimationNeedsResample(); } -#endif return NS_OK; } diff --git a/content/svg/content/src/DOMSVGPathSegList.cpp b/content/svg/content/src/DOMSVGPathSegList.cpp index a38c99264c0..f8aa5f14db6 100644 --- a/content/svg/content/src/DOMSVGPathSegList.cpp +++ b/content/svg/content/src/DOMSVGPathSegList.cpp @@ -99,11 +99,9 @@ DOMSVGPathSegList::~DOMSVGPathSegList() nsIDOMSVGPathSeg* DOMSVGPathSegList::GetItemWithoutAddRef(PRUint32 aIndex) { -#ifdef MOZ_SMIL if (IsAnimValList()) { Element()->FlushAnimations(); } -#endif if (aIndex < Length()) { EnsureItemAt(aIndex); return ItemAt(aIndex); @@ -255,11 +253,9 @@ DOMSVGPathSegList::InternalAList() NS_IMETHODIMP DOMSVGPathSegList::GetNumberOfItems(PRUint32 *aNumberOfItems) { -#ifdef MOZ_SMIL if (IsAnimValList()) { Element()->FlushAnimations(); } -#endif *aNumberOfItems = Length(); return NS_OK; } @@ -289,11 +285,9 @@ DOMSVGPathSegList::Clear() InternalList().Clear(); Element()->DidChangePathSegList(true); -#ifdef MOZ_SMIL if (AttrIsAnimating()) { Element()->AnimationNeedsResample(); } -#endif } return NS_OK; } @@ -393,11 +387,9 @@ DOMSVGPathSegList::InsertItemBefore(nsIDOMSVGPathSeg *aNewItem, UpdateListIndicesFromIndex(aIndex + 1, argCount + 1); Element()->DidChangePathSegList(true); -#ifdef MOZ_SMIL if (AttrIsAnimating()) { Element()->AnimationNeedsResample(); } -#endif *_retval = domItem.forget().get(); return NS_OK; } @@ -459,11 +451,9 @@ DOMSVGPathSegList::ReplaceItem(nsIDOMSVGPathSeg *aNewItem, } Element()->DidChangePathSegList(true); -#ifdef MOZ_SMIL if (AttrIsAnimating()) { Element()->AnimationNeedsResample(); } -#endif NS_ADDREF(*_retval = domItem.get()); return NS_OK; } @@ -503,11 +493,9 @@ DOMSVGPathSegList::RemoveItem(PRUint32 aIndex, UpdateListIndicesFromIndex(aIndex, -(argCount + 1)); Element()->DidChangePathSegList(true); -#ifdef MOZ_SMIL if (AttrIsAnimating()) { Element()->AnimationNeedsResample(); } -#endif return NS_OK; } diff --git a/content/svg/content/src/DOMSVGPoint.cpp b/content/svg/content/src/DOMSVGPoint.cpp index 3f783016902..ba3d6ef946b 100644 --- a/content/svg/content/src/DOMSVGPoint.cpp +++ b/content/svg/content/src/DOMSVGPoint.cpp @@ -81,11 +81,9 @@ 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; } @@ -102,11 +100,9 @@ DOMSVGPoint::SetX(float aX) if (HasOwner()) { InternalItem().mX = aX; Element()->DidChangePointList(true); -#ifdef MOZ_SMIL if (mList->AttrIsAnimating()) { Element()->AnimationNeedsResample(); } -#endif return NS_OK; } mPt.mX = aX; @@ -116,11 +112,9 @@ DOMSVGPoint::SetX(float aX) 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; } @@ -137,11 +131,9 @@ DOMSVGPoint::SetY(float aY) if (HasOwner()) { InternalItem().mY = aY; Element()->DidChangePointList(true); -#ifdef MOZ_SMIL if (mList->AttrIsAnimating()) { Element()->AnimationNeedsResample(); } -#endif return NS_OK; } mPt.mY = aY; diff --git a/content/svg/content/src/DOMSVGPointList.cpp b/content/svg/content/src/DOMSVGPointList.cpp index 3b8b569aab9..d4b139ae867 100644 --- a/content/svg/content/src/DOMSVGPointList.cpp +++ b/content/svg/content/src/DOMSVGPointList.cpp @@ -119,11 +119,9 @@ DOMSVGPointList::~DOMSVGPointList() nsIDOMSVGPoint* DOMSVGPointList::GetItemWithoutAddRef(PRUint32 aIndex) { -#ifdef MOZ_SMIL if (IsAnimValList()) { Element()->FlushAnimations(); } -#endif if (aIndex < Length()) { EnsureItemAt(aIndex); return mItems[aIndex]; @@ -200,11 +198,9 @@ DOMSVGPointList::InternalAList() NS_IMETHODIMP DOMSVGPointList::GetNumberOfItems(PRUint32 *aNumberOfItems) { -#ifdef MOZ_SMIL if (IsAnimValList()) { Element()->FlushAnimations(); } -#endif *aNumberOfItems = Length(); return NS_OK; } @@ -234,11 +230,9 @@ DOMSVGPointList::Clear() InternalList().Clear(); Element()->DidChangePointList(true); -#ifdef MOZ_SMIL if (AttrIsAnimating()) { Element()->AnimationNeedsResample(); } -#endif } return NS_OK; } @@ -327,11 +321,9 @@ DOMSVGPointList::InsertItemBefore(nsIDOMSVGPoint *aNewItem, UpdateListIndicesFromIndex(mItems, aIndex + 1); Element()->DidChangePointList(true); -#ifdef MOZ_SMIL if (AttrIsAnimating()) { Element()->AnimationNeedsResample(); } -#endif *_retval = domItem.forget().get(); return NS_OK; } @@ -371,11 +363,9 @@ DOMSVGPointList::ReplaceItem(nsIDOMSVGPoint *aNewItem, domItem->InsertingIntoList(this, aIndex, IsAnimValList()); Element()->DidChangePointList(true); -#ifdef MOZ_SMIL if (AttrIsAnimating()) { Element()->AnimationNeedsResample(); } -#endif NS_ADDREF(*_retval = domItem.get()); return NS_OK; } @@ -412,11 +402,9 @@ DOMSVGPointList::RemoveItem(PRUint32 aIndex, UpdateListIndicesFromIndex(mItems, aIndex); Element()->DidChangePointList(true); -#ifdef MOZ_SMIL if (AttrIsAnimating()) { Element()->AnimationNeedsResample(); } -#endif return NS_OK; } diff --git a/content/svg/content/src/DOMSVGTransform.cpp b/content/svg/content/src/DOMSVGTransform.cpp index 67c85001c59..94d36007c25 100644 --- a/content/svg/content/src/DOMSVGTransform.cpp +++ b/content/svg/content/src/DOMSVGTransform.cpp @@ -345,11 +345,9 @@ DOMSVGTransform::NotifyElementOfChange() { if (HasOwner()) { Element()->DidChangeTransformList(true); -#ifdef MOZ_SMIL if (mList->mAList->IsAnimating()) { Element()->AnimationNeedsResample(); } -#endif // MOZ_SMIL } } diff --git a/content/svg/content/src/DOMSVGTransformList.cpp b/content/svg/content/src/DOMSVGTransformList.cpp index c47a6a7f7f6..b95a0f277ab 100644 --- a/content/svg/content/src/DOMSVGTransformList.cpp +++ b/content/svg/content/src/DOMSVGTransformList.cpp @@ -97,11 +97,9 @@ NS_INTERFACE_MAP_END nsIDOMSVGTransform* DOMSVGTransformList::GetItemWithoutAddRef(PRUint32 aIndex) { -#ifdef MOZ_SMIL if (IsAnimValList()) { Element()->FlushAnimations(); } -#endif if (aIndex < Length()) { EnsureItemAt(aIndex); return mItems[aIndex]; @@ -163,11 +161,9 @@ DOMSVGTransformList::InternalList() NS_IMETHODIMP DOMSVGTransformList::GetNumberOfItems(PRUint32 *aNumberOfItems) { -#ifdef MOZ_SMIL if (IsAnimValList()) { Element()->FlushAnimations(); } -#endif *aNumberOfItems = Length(); return NS_OK; } @@ -196,11 +192,9 @@ DOMSVGTransformList::Clear() mItems.Clear(); InternalList().Clear(); Element()->DidChangeTransformList(true); -#ifdef MOZ_SMIL if (mAList->IsAnimating()) { Element()->AnimationNeedsResample(); } -#endif } return NS_OK; } @@ -292,11 +286,9 @@ DOMSVGTransformList::InsertItemBefore(nsIDOMSVGTransform *newItem, UpdateListIndicesFromIndex(mItems, index + 1); Element()->DidChangeTransformList(true); -#ifdef MOZ_SMIL if (mAList->IsAnimating()) { Element()->AnimationNeedsResample(); } -#endif *_retval = domItem.forget().get(); return NS_OK; } @@ -338,11 +330,9 @@ DOMSVGTransformList::ReplaceItem(nsIDOMSVGTransform *newItem, 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; } @@ -379,11 +369,9 @@ DOMSVGTransformList::RemoveItem(PRUint32 index, nsIDOMSVGTransform **_retval) UpdateListIndicesFromIndex(mItems, index); Element()->DidChangeTransformList(true); -#ifdef MOZ_SMIL if (mAList->IsAnimating()) { Element()->AnimationNeedsResample(); } -#endif return NS_OK; } diff --git a/content/svg/content/src/Makefile.in b/content/svg/content/src/Makefile.in index e65ecaee909..57d5902e1e7 100644 --- a/content/svg/content/src/Makefile.in +++ b/content/svg/content/src/Makefile.in @@ -136,31 +136,27 @@ CPPSRCS = \ 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. @@ -186,12 +182,7 @@ INCLUDES += \ -I$(srcdir)/../../../events/src \ -I$(srcdir)/../../../html/content/src \ -I$(topsrcdir)/content/xbl/src \ - $(NULL) - -ifdef MOZ_SMIL -INCLUDES += \ -I$(srcdir)/../../../smil \ $(NULL) -endif DEFINES += -D_IMPL_NS_LAYOUT diff --git a/content/svg/content/src/SVGAnimatedLengthList.cpp b/content/svg/content/src/SVGAnimatedLengthList.cpp index 4027a4d509c..717efceadf4 100644 --- a/content/svg/content/src/SVGAnimatedLengthList.cpp +++ b/content/svg/content/src/SVGAnimatedLengthList.cpp @@ -38,10 +38,8 @@ #include "DOMSVGAnimatedLengthList.h" #include "nsSVGElement.h" #include "nsSVGAttrTearoffTable.h" -#ifdef MOZ_SMIL #include "nsSMILValue.h" #include "SVGLengthListSMILType.h" -#endif // MOZ_SMIL namespace mozilla { @@ -149,7 +147,6 @@ SVGAnimatedLengthList::ClearAnimValue(nsSVGElement *aElement, aElement->DidAnimateLengthList(aAttrEnum); } -#ifdef MOZ_SMIL nsISMILAttr* SVGAnimatedLengthList::ToSMILAttr(nsSVGElement *aSVGElement, PRUint8 aAttrEnum, @@ -239,6 +236,5 @@ SVGAnimatedLengthList::SMILAnimatedLengthList::ClearAnimValue() mVal->ClearAnimValue(mElement, mAttrEnum); } } -#endif // MOZ_SMIL } // namespace mozilla diff --git a/content/svg/content/src/SVGAnimatedLengthList.h b/content/svg/content/src/SVGAnimatedLengthList.h index 566177a75f4..7d1121adfa8 100644 --- a/content/svg/content/src/SVGAnimatedLengthList.h +++ b/content/svg/content/src/SVGAnimatedLengthList.h @@ -41,9 +41,7 @@ class nsSVGElement; -#ifdef MOZ_SMIL #include "nsISMILAttr.h" -#endif // MOZ_SMIL namespace mozilla { @@ -100,11 +98,9 @@ public: return !!mAnimVal; } -#ifdef MOZ_SMIL /// Callers own the returned nsISMILAttr nsISMILAttr* ToSMILAttr(nsSVGElement* aSVGElement, PRUint8 aAttrEnum, PRUint8 aAxis, bool aCanZeroPadList); -#endif // MOZ_SMIL private: @@ -116,7 +112,6 @@ private: SVGLengthList mBaseVal; nsAutoPtr mAnimVal; -#ifdef MOZ_SMIL struct SMILAnimatedLengthList : public nsISMILAttr { public: @@ -150,7 +145,6 @@ private: virtual void ClearAnimValue(); virtual nsresult SetAnimValue(const nsSMILValue& aValue); }; -#endif // MOZ_SMIL }; } // namespace mozilla diff --git a/content/svg/content/src/SVGAnimatedNumberList.cpp b/content/svg/content/src/SVGAnimatedNumberList.cpp index 23fcc09694d..7148c31402b 100644 --- a/content/svg/content/src/SVGAnimatedNumberList.cpp +++ b/content/svg/content/src/SVGAnimatedNumberList.cpp @@ -38,10 +38,8 @@ #include "DOMSVGAnimatedNumberList.h" #include "nsSVGElement.h" #include "nsSVGAttrTearoffTable.h" -#ifdef MOZ_SMIL #include "nsSMILValue.h" #include "SVGNumberListSMILType.h" -#endif // MOZ_SMIL namespace mozilla { @@ -151,7 +149,6 @@ SVGAnimatedNumberList::ClearAnimValue(nsSVGElement *aElement, aElement->DidAnimateNumberList(aAttrEnum); } -#ifdef MOZ_SMIL nsISMILAttr* SVGAnimatedNumberList::ToSMILAttr(nsSVGElement *aSVGElement, PRUint8 aAttrEnum) @@ -215,6 +212,5 @@ SVGAnimatedNumberList::SMILAnimatedNumberList::ClearAnimValue() mVal->ClearAnimValue(mElement, mAttrEnum); } } -#endif // MOZ_SMIL } // namespace mozilla diff --git a/content/svg/content/src/SVGAnimatedNumberList.h b/content/svg/content/src/SVGAnimatedNumberList.h index e807e703421..5ddbb148366 100644 --- a/content/svg/content/src/SVGAnimatedNumberList.h +++ b/content/svg/content/src/SVGAnimatedNumberList.h @@ -41,9 +41,7 @@ class nsSVGElement; -#ifdef MOZ_SMIL #include "nsISMILAttr.h" -#endif // MOZ_SMIL namespace mozilla { @@ -108,10 +106,8 @@ public: return !!mAnimVal; } -#ifdef MOZ_SMIL /// Callers own the returned nsISMILAttr nsISMILAttr* ToSMILAttr(nsSVGElement* aSVGElement, PRUint8 aAttrEnum); -#endif // MOZ_SMIL private: @@ -124,7 +120,6 @@ private: nsAutoPtr mAnimVal; bool mIsBaseSet; -#ifdef MOZ_SMIL struct SMILAnimatedNumberList : public nsISMILAttr { public: @@ -152,7 +147,6 @@ private: virtual void ClearAnimValue(); virtual nsresult SetAnimValue(const nsSMILValue& aValue); }; -#endif // MOZ_SMIL }; } // namespace mozilla diff --git a/content/svg/content/src/SVGAnimatedPathSegList.cpp b/content/svg/content/src/SVGAnimatedPathSegList.cpp index a5956d91cb5..85db998e8a8 100644 --- a/content/svg/content/src/SVGAnimatedPathSegList.cpp +++ b/content/svg/content/src/SVGAnimatedPathSegList.cpp @@ -38,10 +38,8 @@ #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! @@ -174,7 +172,6 @@ SVGAnimatedPathSegList::ClearAnimValue(nsSVGElement *aElement) aElement->DidAnimatePathSegList(); } -#ifdef MOZ_SMIL nsISMILAttr* SVGAnimatedPathSegList::ToSMILAttr(nsSVGElement *aElement) { @@ -236,6 +233,5 @@ SVGAnimatedPathSegList::SMILAnimatedPathSegList::ClearAnimValue() mVal->ClearAnimValue(mElement); } } -#endif // MOZ_SMIL } // namespace mozilla diff --git a/content/svg/content/src/SVGAnimatedPathSegList.h b/content/svg/content/src/SVGAnimatedPathSegList.h index 924518ebbca..8c514a714d3 100644 --- a/content/svg/content/src/SVGAnimatedPathSegList.h +++ b/content/svg/content/src/SVGAnimatedPathSegList.h @@ -41,9 +41,7 @@ class nsSVGElement; -#ifdef MOZ_SMIL #include "nsISMILAttr.h" -#endif // MOZ_SMIL namespace mozilla { @@ -112,10 +110,8 @@ public: return !!mAnimVal; } -#ifdef MOZ_SMIL /// Callers own the returned nsISMILAttr nsISMILAttr* ToSMILAttr(nsSVGElement* aElement); -#endif // MOZ_SMIL private: @@ -127,7 +123,6 @@ private: SVGPathData mBaseVal; nsAutoPtr mAnimVal; -#ifdef MOZ_SMIL struct SMILAnimatedPathSegList : public nsISMILAttr { public: @@ -152,7 +147,6 @@ private: virtual void ClearAnimValue(); virtual nsresult SetAnimValue(const nsSMILValue& aValue); }; -#endif // MOZ_SMIL }; } // namespace mozilla diff --git a/content/svg/content/src/SVGAnimatedPointList.cpp b/content/svg/content/src/SVGAnimatedPointList.cpp index 3012610891c..ece9f62f260 100644 --- a/content/svg/content/src/SVGAnimatedPointList.cpp +++ b/content/svg/content/src/SVGAnimatedPointList.cpp @@ -38,10 +38,8 @@ #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! @@ -177,7 +175,6 @@ SVGAnimatedPointList::ClearAnimValue(nsSVGElement *aElement) aElement->DidAnimatePointList(); } -#ifdef MOZ_SMIL nsISMILAttr* SVGAnimatedPointList::ToSMILAttr(nsSVGElement *aElement) { @@ -239,6 +236,5 @@ SVGAnimatedPointList::SMILAnimatedPointList::ClearAnimValue() mVal->ClearAnimValue(mElement); } } -#endif // MOZ_SMIL } // namespace mozilla diff --git a/content/svg/content/src/SVGAnimatedPointList.h b/content/svg/content/src/SVGAnimatedPointList.h index c5c6e24f77e..2589547b294 100644 --- a/content/svg/content/src/SVGAnimatedPointList.h +++ b/content/svg/content/src/SVGAnimatedPointList.h @@ -41,9 +41,7 @@ class nsSVGElement; -#ifdef MOZ_SMIL #include "nsISMILAttr.h" -#endif // MOZ_SMIL namespace mozilla { @@ -112,10 +110,8 @@ public: return !!mAnimVal; } -#ifdef MOZ_SMIL /// Callers own the returned nsISMILAttr nsISMILAttr* ToSMILAttr(nsSVGElement* aElement); -#endif // MOZ_SMIL private: @@ -127,7 +123,6 @@ private: SVGPointList mBaseVal; nsAutoPtr mAnimVal; -#ifdef MOZ_SMIL struct SMILAnimatedPointList : public nsISMILAttr { public: @@ -152,7 +147,6 @@ private: virtual void ClearAnimValue(); virtual nsresult SetAnimValue(const nsSMILValue& aValue); }; -#endif // MOZ_SMIL }; } // namespace mozilla diff --git a/content/svg/content/src/SVGAnimatedPreserveAspectRatio.cpp b/content/svg/content/src/SVGAnimatedPreserveAspectRatio.cpp index bdc189529b7..9905e3a4831 100644 --- a/content/svg/content/src/SVGAnimatedPreserveAspectRatio.cpp +++ b/content/svg/content/src/SVGAnimatedPreserveAspectRatio.cpp @@ -40,10 +40,8 @@ #include "SVGAnimatedPreserveAspectRatio.h" #include "nsWhitespaceTokenizer.h" -#ifdef MOZ_SMIL #include "nsSMILValue.h" #include "SMILEnumType.h" -#endif // MOZ_SMIL using namespace mozilla; @@ -241,11 +239,9 @@ SVGAnimatedPreserveAspectRatio::SetBaseValueString( 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, @@ -286,11 +282,9 @@ SVGAnimatedPreserveAspectRatio::SetBaseAlign(PRUint16 aAlign, mAnimVal.mAlign = mBaseVal.mAlign; aSVGElement->DidChangePreserveAspectRatio(true); -#ifdef MOZ_SMIL if (mIsAnimated) { aSVGElement->AnimationNeedsResample(); } -#endif return NS_OK; } @@ -305,11 +299,9 @@ SVGAnimatedPreserveAspectRatio::SetBaseMeetOrSlice(PRUint16 aMeetOrSlice, mAnimVal.mMeetOrSlice = mBaseVal.mMeetOrSlice; aSVGElement->DidChangePreserveAspectRatio(true); -#ifdef MOZ_SMIL if (mIsAnimated) { aSVGElement->AnimationNeedsResample(); } -#endif return NS_OK; } @@ -338,7 +330,6 @@ SVGAnimatedPreserveAspectRatio::ToDOMAnimatedPreserveAspectRatio( return NS_OK; } -#ifdef MOZ_SMIL nsISMILAttr* SVGAnimatedPreserveAspectRatio::ToSMILAttr(nsSVGElement *aSVGElement) { @@ -406,4 +397,3 @@ SMILPreserveAspectRatio::SetAnimValue(const nsSMILValue& aValue) } return NS_OK; } -#endif // MOZ_SMIL diff --git a/content/svg/content/src/SVGAnimatedPreserveAspectRatio.h b/content/svg/content/src/SVGAnimatedPreserveAspectRatio.h index e58b56d8c03..995cc67e60c 100644 --- a/content/svg/content/src/SVGAnimatedPreserveAspectRatio.h +++ b/content/svg/content/src/SVGAnimatedPreserveAspectRatio.h @@ -129,10 +129,8 @@ public: 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: @@ -184,9 +182,7 @@ public: // 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; } @@ -195,9 +191,7 @@ public: NS_IMETHOD GetMeetOrSlice(PRUint16* aMeetOrSlice) { -#ifdef MOZ_SMIL mSVGElement->FlushAnimations(); -#endif *aMeetOrSlice = mVal->GetAnimValue().GetMeetOrSlice(); return NS_OK; } @@ -226,7 +220,6 @@ public: { return mVal->ToDOMAnimVal(aAnimVal, mSVGElement); } }; -#ifdef MOZ_SMIL struct SMILPreserveAspectRatio : public nsISMILAttr { public: @@ -249,7 +242,6 @@ public: virtual void ClearAnimValue(); virtual nsresult SetAnimValue(const nsSMILValue& aValue); }; -#endif // MOZ_SMIL }; } // namespace mozilla diff --git a/content/svg/content/src/SVGAnimatedTransformList.cpp b/content/svg/content/src/SVGAnimatedTransformList.cpp index a8c276c21a7..7d8a1b3f604 100644 --- a/content/svg/content/src/SVGAnimatedTransformList.cpp +++ b/content/svg/content/src/SVGAnimatedTransformList.cpp @@ -37,13 +37,11 @@ #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 { @@ -169,7 +167,6 @@ SVGAnimatedTransformList::IsExplicitlySet() const return mIsAttrSet || !mBaseVal.IsEmpty() || mAnimVal; } -#ifdef MOZ_SMIL nsISMILAttr* SVGAnimatedTransformList::ToSMILAttr(nsSVGElement* aSVGElement) { @@ -350,6 +347,4 @@ SVGAnimatedTransformList::SMILAnimatedTransformList::ClearAnimValue() } } -#endif // MOZ_SMIL - } // namespace mozilla diff --git a/content/svg/content/src/SVGAnimatedTransformList.h b/content/svg/content/src/SVGAnimatedTransformList.h index 98961299efd..576e1b481a6 100644 --- a/content/svg/content/src/SVGAnimatedTransformList.h +++ b/content/svg/content/src/SVGAnimatedTransformList.h @@ -43,9 +43,7 @@ class nsSVGElement; -#ifdef MOZ_SMIL #include "nsISMILAttr.h" -#endif // MOZ_SMIL namespace mozilla { @@ -102,10 +100,8 @@ public: return !!mAnimVal; } -#ifdef MOZ_SMIL /// Callers own the returned nsISMILAttr nsISMILAttr* ToSMILAttr(nsSVGElement* aSVGElement); -#endif // MOZ_SMIL private: @@ -118,7 +114,6 @@ private: nsAutoPtr mAnimVal; bool mIsAttrSet; -#ifdef MOZ_SMIL struct SMILAnimatedTransformList : public nsISMILAttr { public: @@ -150,7 +145,6 @@ private: SVGAnimatedTransformList* mVal; nsSVGElement* mElement; }; -#endif // MOZ_SMIL }; } // namespace mozilla diff --git a/content/svg/content/src/nsSVGAngle.cpp b/content/svg/content/src/nsSVGAngle.cpp index 2f9e0167da8..087d00f2ee8 100644 --- a/content/svg/content/src/nsSVGAngle.cpp +++ b/content/svg/content/src/nsSVGAngle.cpp @@ -43,10 +43,8 @@ #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; @@ -264,11 +262,9 @@ nsSVGAngle::SetBaseValueInSpecifiedUnits(float aValue, if (!mIsAnimated) { mAnimVal = mBaseVal; } -#ifdef MOZ_SMIL else { aSVGElement->AnimationNeedsResample(); } -#endif aSVGElement->DidChangeAngle(mAttrEnum, true); } @@ -301,11 +297,9 @@ nsSVGAngle::NewValueSpecifiedUnits(PRUint16 unitType, mAnimVal = mBaseVal; mAnimValUnit = mBaseValUnit; } -#ifdef MOZ_SMIL else { aSVGElement->AnimationNeedsResample(); } -#endif if (aSVGElement) { aSVGElement->DidChangeAngle(mAttrEnum, true); } @@ -355,11 +349,9 @@ nsSVGAngle::SetBaseValueString(const nsAString &aValueAsString, 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, @@ -386,11 +378,9 @@ nsSVGAngle::SetBaseValue(float aValue, nsSVGElement *aSVGElement) if (!mIsAnimated) { mAnimVal = mBaseVal; } -#ifdef MOZ_SMIL else { aSVGElement->AnimationNeedsResample(); } -#endif if (aSVGElement) { aSVGElement->DidChangeAngle(mAttrEnum, true); } @@ -428,7 +418,6 @@ NS_NewDOMSVGAngle(nsIDOMSVGAngle** aResult) return NS_OK; } -#ifdef MOZ_SMIL nsISMILAttr* nsSVGAngle::ToSMILAttr(nsSVGElement *aSVGElement) { @@ -504,4 +493,3 @@ nsSVGAngle::SMILOrient::SetAnimValue(const nsSMILValue& aValue) } return NS_OK; } -#endif // MOZ_SMIL diff --git a/content/svg/content/src/nsSVGAngle.h b/content/svg/content/src/nsSVGAngle.h index fe63a52d321..4c51f8877ae 100644 --- a/content/svg/content/src/nsSVGAngle.h +++ b/content/svg/content/src/nsSVGAngle.h @@ -80,10 +80,8 @@ public: 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); @@ -198,7 +196,6 @@ public: { 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 is 'orient', on the // 'marker' element, and 'orient' must be special cased since it can also @@ -231,7 +228,6 @@ public: virtual void ClearAnimValue(); virtual nsresult SetAnimValue(const nsSMILValue& aValue); }; -#endif // MOZ_SMIL }; nsresult diff --git a/content/svg/content/src/nsSVGBoolean.cpp b/content/svg/content/src/nsSVGBoolean.cpp index 7a7596c7ff1..2b7db25d221 100644 --- a/content/svg/content/src/nsSVGBoolean.cpp +++ b/content/svg/content/src/nsSVGBoolean.cpp @@ -35,10 +35,8 @@ * ***** END LICENSE BLOCK ***** */ #include "nsSVGBoolean.h" -#ifdef MOZ_SMIL #include "nsSMILValue.h" #include "SMILBoolType.h" -#endif // MOZ_SMIL using namespace mozilla; @@ -87,11 +85,9 @@ nsSVGBoolean::SetBaseValueString(const nsAString &aValueAsString, 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, @@ -118,11 +114,9 @@ nsSVGBoolean::SetBaseValue(bool aValue, if (!mIsAnimated) { mAnimVal = mBaseVal; } -#ifdef MOZ_SMIL else { aSVGElement->AnimationNeedsResample(); } -#endif aSVGElement->DidChangeBoolean(mAttrEnum, true); } } @@ -147,7 +141,6 @@ nsSVGBoolean::ToDOMAnimatedBoolean(nsIDOMSVGAnimatedBoolean **aResult, return NS_OK; } -#ifdef MOZ_SMIL nsISMILAttr* nsSVGBoolean::ToSMILAttr(nsSVGElement *aSVGElement) { @@ -201,4 +194,3 @@ nsSVGBoolean::SMILBool::SetAnimValue(const nsSMILValue& aValue) } return NS_OK; } -#endif // MOZ_SMIL diff --git a/content/svg/content/src/nsSVGBoolean.h b/content/svg/content/src/nsSVGBoolean.h index 44933f4dd73..79428b748dd 100644 --- a/content/svg/content/src/nsSVGBoolean.h +++ b/content/svg/content/src/nsSVGBoolean.h @@ -65,10 +65,8 @@ public: 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: @@ -98,15 +96,12 @@ public: // 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: @@ -128,6 +123,5 @@ public: virtual void ClearAnimValue(); virtual nsresult SetAnimValue(const nsSMILValue& aValue); }; -#endif // MOZ_SMIL }; #endif //__NS_SVGBOOLEAN_H__ diff --git a/content/svg/content/src/nsSVGClass.cpp b/content/svg/content/src/nsSVGClass.cpp index f8a4b5078bb..db5597a43e3 100644 --- a/content/svg/content/src/nsSVGClass.cpp +++ b/content/svg/content/src/nsSVGClass.cpp @@ -36,10 +36,8 @@ #include "nsSVGClass.h" #include "nsSVGStylableElement.h" -#ifdef MOZ_SMIL #include "nsSMILValue.h" #include "SMILStringType.h" -#endif // MOZ_SMIL using namespace mozilla; @@ -69,11 +67,9 @@ nsSVGClass::SetBaseValue(const nsAString& aValue, if (aDoSetAttr) { aSVGElement->SetAttr(kNameSpaceID_None, nsGkAtoms::_class, aValue, true); } -#ifdef MOZ_SMIL if (mAnimVal) { aSVGElement->AnimationNeedsResample(); } -#endif } void @@ -116,14 +112,11 @@ nsSVGClass::ToDOMAnimatedString(nsIDOMSVGAnimatedString **aResult, 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) { @@ -172,4 +165,3 @@ nsSVGClass::SMILString::SetAnimValue(const nsSMILValue& aValue) } return NS_OK; } -#endif // MOZ_SMIL diff --git a/content/svg/content/src/nsSVGClass.h b/content/svg/content/src/nsSVGClass.h index 154075d6de3..4b414f16dc3 100644 --- a/content/svg/content/src/nsSVGClass.h +++ b/content/svg/content/src/nsSVGClass.h @@ -43,9 +43,7 @@ #include "nsString.h" #include "nsDOMError.h" -#ifdef MOZ_SMIL #include "nsISMILAttr.h" -#endif // MOZ_SMIL class nsSVGStylableElement; @@ -69,10 +67,8 @@ public: 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: @@ -97,7 +93,6 @@ public: NS_IMETHOD GetAnimVal(nsAString& aResult); }; -#ifdef MOZ_SMIL struct SMILString : public nsISMILAttr { public: @@ -119,6 +114,5 @@ public: virtual void ClearAnimValue(); virtual nsresult SetAnimValue(const nsSMILValue& aValue); }; -#endif // MOZ_SMIL }; #endif //__NS_SVGCLASS_H__ diff --git a/content/svg/content/src/nsSVGElement.cpp b/content/svg/content/src/nsSVGElement.cpp index af8bc1450c4..14e6a572161 100644 --- a/content/svg/content/src/nsSVGElement.cpp +++ b/content/svg/content/src/nsSVGElement.cpp @@ -86,10 +86,8 @@ #include "nsIFrame.h" #include "prdtoa.h" #include -#ifdef MOZ_SMIL #include "nsSMILMappedAttribute.h" #include "SVGMotionSMILAttr.h" -#endif // MOZ_SMIL using namespace mozilla; @@ -787,7 +785,6 @@ nsSVGElement::WalkContentStyleRules(nsRuleWalker* aRuleWalker) 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 @@ -816,7 +813,6 @@ nsSVGElement::WalkContentStyleRules(nsRuleWalker* aRuleWalker) aRuleWalker->Forward(animContentStyleRule); } } -#endif // MOZ_SMIL return NS_OK; } @@ -1123,7 +1119,6 @@ nsSVGElement::UpdateContentStyleRule() mContentStyleRule = mappedAttrParser.CreateStyleRule(); } -#ifdef MOZ_SMIL static void ParseMappedAttrAnimValueCallback(void* aObject, nsIAtom* aPropertyName, @@ -1202,7 +1197,6 @@ nsSVGElement::GetAnimatedContentStyleRule() SMIL_MAPPED_ATTR_STYLERULE_ATOM, nsnull)); } -#endif // MOZ_SMIL /* static */ nsIAtom* nsSVGElement::GetEventNameForAttr(nsIAtom* aAttr) @@ -1221,14 +1215,12 @@ nsIAtom* nsSVGElement::GetEventNameForAttr(nsIAtom* aAttr) 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; } @@ -2130,7 +2122,6 @@ nsSVGElement::RecompileScriptEventListeners() } } -#ifdef MOZ_SMIL nsISMILAttr* nsSVGElement::GetAnimatedAttr(PRInt32 aNamespaceID, nsIAtom* aName) { @@ -2327,4 +2318,3 @@ nsSVGElement::FlushAnimations() doc->GetAnimationController()->FlushResampleRequests(); } } -#endif // MOZ_SMIL diff --git a/content/svg/content/src/nsSVGElement.h b/content/svg/content/src/nsSVGElement.h index 60d0f9a76e1..1965e4348dd 100644 --- a/content/svg/content/src/nsSVGElement.h +++ b/content/svg/content/src/nsSVGElement.h @@ -51,10 +51,8 @@ #include "nsStyledElement.h" #include "mozilla/css/StyleRule.h" -#ifdef MOZ_SMIL #include "nsISMILAttr.h" #include "nsSMILAnimationController.h" -#endif class nsSVGSVGElement; class nsSVGLength2; @@ -220,14 +218,9 @@ public: 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(); @@ -257,10 +250,8 @@ protected: virtual bool IsEventName(nsIAtom* aName); void UpdateContentStyleRule(); -#ifdef MOZ_SMIL void UpdateAnimatedContentStyleRule(); mozilla::css::StyleRule* GetAnimatedContentStyleRule(); -#endif // MOZ_SMIL static nsIAtom* GetEventNameForAttr(nsIAtom* aAttr); diff --git a/content/svg/content/src/nsSVGElementFactory.cpp b/content/svg/content/src/nsSVGElementFactory.cpp index 4567d509696..e1861db5475 100644 --- a/content/svg/content/src/nsSVGElementFactory.cpp +++ b/content/svg/content/src/nsSVGElementFactory.cpp @@ -223,7 +223,6 @@ nsresult NS_NewSVGFEDisplacementMapElement(nsIContent **aResult, already_AddRefed aNodeInfo); -#ifdef MOZ_SMIL nsresult NS_NewSVGAnimateElement(nsIContent **aResult, already_AddRefed aNodeInfo); @@ -239,7 +238,6 @@ NS_NewSVGMpathElement(nsIContent **aResult, nsresult NS_NewSVGSetElement(nsIContent **aResult, already_AddRefed aNodeInfo); -#endif // MOZ_SMIL nsresult NS_NewSVGElement(nsIContent** aResult, already_AddRefed aNodeInfo, @@ -368,7 +366,6 @@ NS_NewSVGElement(nsIContent** aResult, already_AddRefed aNodeInfo, 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); @@ -381,7 +378,6 @@ NS_NewSVGElement(nsIContent** aResult, already_AddRefed 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); diff --git a/content/svg/content/src/nsSVGEnum.cpp b/content/svg/content/src/nsSVGEnum.cpp index 3ab46beabfe..696c436b3f8 100644 --- a/content/svg/content/src/nsSVGEnum.cpp +++ b/content/svg/content/src/nsSVGEnum.cpp @@ -37,10 +37,8 @@ #include "nsSVGEnum.h" #include "nsIAtom.h" #include "nsSVGElement.h" -#ifdef MOZ_SMIL #include "nsSMILValue.h" #include "SMILEnumType.h" -#endif // MOZ_SMIL using namespace mozilla; @@ -84,11 +82,9 @@ nsSVGEnum::SetBaseValueString(const nsAString& aValue, 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. @@ -132,11 +128,9 @@ nsSVGEnum::SetBaseValue(PRUint16 aValue, if (!mIsAnimated) { mAnimVal = mBaseVal; } -#ifdef MOZ_SMIL else { aSVGElement->AnimationNeedsResample(); } -#endif aSVGElement->DidChangeEnum(mAttrEnum, true); } return NS_OK; @@ -166,7 +160,6 @@ nsSVGEnum::ToDOMAnimatedEnum(nsIDOMSVGAnimatedEnumeration **aResult, return NS_OK; } -#ifdef MOZ_SMIL nsISMILAttr* nsSVGEnum::ToSMILAttr(nsSVGElement *aSVGElement) { @@ -227,4 +220,3 @@ nsSVGEnum::SMILEnum::SetAnimValue(const nsSMILValue& aValue) } return NS_OK; } -#endif // MOZ_SMIL diff --git a/content/svg/content/src/nsSVGEnum.h b/content/svg/content/src/nsSVGEnum.h index c867bfac021..8650f2d302d 100644 --- a/content/svg/content/src/nsSVGEnum.h +++ b/content/svg/content/src/nsSVGEnum.h @@ -76,10 +76,8 @@ public: 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; @@ -111,15 +109,12 @@ public: // 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: @@ -141,7 +136,6 @@ public: virtual void ClearAnimValue(); virtual nsresult SetAnimValue(const nsSMILValue& aValue); }; -#endif // MOZ_SMIL }; #endif //__NS_SVGENUM_H__ diff --git a/content/svg/content/src/nsSVGInteger.cpp b/content/svg/content/src/nsSVGInteger.cpp index 32b2e67196a..dced1e93840 100644 --- a/content/svg/content/src/nsSVGInteger.cpp +++ b/content/svg/content/src/nsSVGInteger.cpp @@ -35,10 +35,8 @@ * ***** END LICENSE BLOCK ***** */ #include "nsSVGInteger.h" -#ifdef MOZ_SMIL #include "nsSMILValue.h" #include "SMILIntegerType.h" -#endif // MOZ_SMIL using namespace mozilla; @@ -94,11 +92,9 @@ nsSVGInteger::SetBaseValueString(const nsAString &aValueAsString, if (!mIsAnimated) { mAnimVal = mBaseVal; } -#ifdef MOZ_SMIL else { aSVGElement->AnimationNeedsResample(); } -#endif return NS_OK; } @@ -118,11 +114,9 @@ nsSVGInteger::SetBaseValue(int aValue, if (!mIsAnimated) { mAnimVal = mBaseVal; } -#ifdef MOZ_SMIL else { aSVGElement->AnimationNeedsResample(); } -#endif aSVGElement->DidChangeInteger(mAttrEnum, true); } @@ -146,7 +140,6 @@ nsSVGInteger::ToDOMAnimatedInteger(nsIDOMSVGAnimatedInteger **aResult, return NS_OK; } -#ifdef MOZ_SMIL nsISMILAttr* nsSVGInteger::ToSMILAttr(nsSVGElement *aSVGElement) { @@ -200,4 +193,3 @@ nsSVGInteger::SMILInteger::SetAnimValue(const nsSMILValue& aValue) } return NS_OK; } -#endif // MOZ_SMIL diff --git a/content/svg/content/src/nsSVGInteger.h b/content/svg/content/src/nsSVGInteger.h index f084e2625f2..e2748b9c988 100644 --- a/content/svg/content/src/nsSVGInteger.h +++ b/content/svg/content/src/nsSVGInteger.h @@ -74,10 +74,8 @@ public: 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: @@ -108,15 +106,12 @@ public: // 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: @@ -138,7 +133,6 @@ public: virtual void ClearAnimValue(); virtual nsresult SetAnimValue(const nsSMILValue& aValue); }; -#endif // MOZ_SMIL }; #endif //__NS_SVGINTEGER_H__ diff --git a/content/svg/content/src/nsSVGIntegerPair.cpp b/content/svg/content/src/nsSVGIntegerPair.cpp index 05825e0be3b..b5f5d8b8596 100644 --- a/content/svg/content/src/nsSVGIntegerPair.cpp +++ b/content/svg/content/src/nsSVGIntegerPair.cpp @@ -39,10 +39,8 @@ #include "nsCharSeparatedTokenizer.h" #include "nsDOMError.h" #include "nsMathUtils.h" -#ifdef MOZ_SMIL #include "nsSMILValue.h" #include "SVGIntegerPairSMILType.h" -#endif // MOZ_SMIL using namespace mozilla; @@ -119,11 +117,9 @@ nsSVGIntegerPair::SetBaseValueString(const nsAString &aValueAsString, 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, @@ -152,11 +148,9 @@ nsSVGIntegerPair::SetBaseValue(PRInt32 aValue, PairIndex aPairIndex, if (!mIsAnimated) { mAnimVal[index] = aValue; } -#ifdef MOZ_SMIL else { aSVGElement->AnimationNeedsResample(); } -#endif aSVGElement->DidChangeIntegerPair(mAttrEnum, true); } @@ -171,11 +165,9 @@ nsSVGIntegerPair::SetBaseValues(PRInt32 aValue1, PRInt32 aValue2, mAnimVal[0] = aValue1; mAnimVal[1] = aValue2; } -#ifdef MOZ_SMIL else { aSVGElement->AnimationNeedsResample(); } -#endif aSVGElement->DidChangeIntegerPair(mAttrEnum, true); } @@ -198,7 +190,6 @@ nsSVGIntegerPair::ToDOMAnimatedInteger(nsIDOMSVGAnimatedInteger **aResult, return NS_OK; } -#ifdef MOZ_SMIL nsISMILAttr* nsSVGIntegerPair::ToSMILAttr(nsSVGElement *aSVGElement) { @@ -255,4 +246,3 @@ nsSVGIntegerPair::SMILIntegerPair::SetAnimValue(const nsSMILValue& aValue) } return NS_OK; } -#endif // MOZ_SMIL diff --git a/content/svg/content/src/nsSVGIntegerPair.h b/content/svg/content/src/nsSVGIntegerPair.h index 4e1d8f53ce6..cf27d3ea567 100644 --- a/content/svg/content/src/nsSVGIntegerPair.h +++ b/content/svg/content/src/nsSVGIntegerPair.h @@ -41,11 +41,9 @@ #include "nsSVGElement.h" #include "nsDOMError.h" -#ifdef MOZ_SMIL #include "nsISMILAttr.h" class nsSMILValue; class nsISMILType; -#endif // MOZ_SMIL class nsSVGIntegerPair { @@ -87,10 +85,8 @@ public: 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: @@ -125,15 +121,12 @@ public: // 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: @@ -155,7 +148,6 @@ public: virtual void ClearAnimValue(); virtual nsresult SetAnimValue(const nsSMILValue& aValue); }; -#endif // MOZ_SMIL }; #endif //__NS_SVGINTEGERPAIR_H__ diff --git a/content/svg/content/src/nsSVGLength2.cpp b/content/svg/content/src/nsSVGLength2.cpp index f3fda92db44..4709ae0e8ba 100644 --- a/content/svg/content/src/nsSVGLength2.cpp +++ b/content/svg/content/src/nsSVGLength2.cpp @@ -46,10 +46,8 @@ #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; @@ -316,11 +314,9 @@ nsSVGLength2::SetBaseValueInSpecifiedUnits(float aValue, if (!mIsAnimated) { mAnimVal = mBaseVal; } -#ifdef MOZ_SMIL else { aSVGElement->AnimationNeedsResample(); } -#endif aSVGElement->DidChangeLength(mAttrEnum, true); } @@ -355,11 +351,9 @@ nsSVGLength2::NewValueSpecifiedUnits(PRUint16 unitType, if (!mIsAnimated) { mAnimVal = mBaseVal; } -#ifdef MOZ_SMIL else { aSVGElement->AnimationNeedsResample(); } -#endif aSVGElement->DidChangeLength(mAttrEnum, true); return NS_OK; } @@ -425,11 +419,9 @@ nsSVGLength2::SetBaseValueString(const nsAString &aValueAsString, if (!mIsAnimated) { mAnimVal = mBaseVal; } -#ifdef MOZ_SMIL else { aSVGElement->AnimationNeedsResample(); } -#endif aSVGElement->DidChangeLength(mAttrEnum, aDoSetAttr); return NS_OK; @@ -493,7 +485,6 @@ nsSVGLength2::DOMAnimatedLength::~DOMAnimatedLength() sSVGAnimatedLengthTearoffTable.RemoveTearoff(mVal); } -#ifdef MOZ_SMIL nsISMILAttr* nsSVGLength2::ToSMILAttr(nsSVGElement *aSVGElement) { @@ -552,4 +543,3 @@ nsSVGLength2::SMILLength::SetAnimValue(const nsSMILValue& aValue) } return NS_OK; } -#endif // MOZ_SMIL diff --git a/content/svg/content/src/nsSVGLength2.h b/content/svg/content/src/nsSVGLength2.h index 78e1bf327eb..a2e557463e6 100644 --- a/content/svg/content/src/nsSVGLength2.h +++ b/content/svg/content/src/nsSVGLength2.h @@ -44,11 +44,9 @@ #include "nsDOMError.h" #include "nsMathUtils.h" -#ifdef MOZ_SMIL #include "nsISMILAttr.h" class nsSMILValue; class nsISMILType; -#endif // MOZ_SMIL class nsIFrame; @@ -112,10 +110,8 @@ public: 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: @@ -223,18 +219,14 @@ private: // 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; } @@ -243,9 +235,7 @@ private: NS_IMETHOD GetValueInSpecifiedUnits(float* aResult) { -#ifdef MOZ_SMIL mSVGElement->FlushAnimations(); -#endif *aResult = mVal->mAnimVal; return NS_OK; } @@ -256,9 +246,7 @@ private: { 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; } @@ -291,7 +279,6 @@ public: { return mVal->ToDOMAnimVal(aAnimVal, mSVGElement); } }; -#ifdef MOZ_SMIL struct SMILLength : public nsISMILAttr { public: @@ -313,7 +300,6 @@ public: virtual void ClearAnimValue(); virtual nsresult SetAnimValue(const nsSMILValue& aValue); }; -#endif // MOZ_SMIL }; #endif // __NS_SVGLENGTH2_H__ diff --git a/content/svg/content/src/nsSVGNumber2.cpp b/content/svg/content/src/nsSVGNumber2.cpp index 8b09bada7b4..db015bafc78 100644 --- a/content/svg/content/src/nsSVGNumber2.cpp +++ b/content/svg/content/src/nsSVGNumber2.cpp @@ -40,10 +40,8 @@ #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 { @@ -132,11 +130,9 @@ nsSVGNumber2::SetBaseValueString(const nsAString &aValueAsString, 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, @@ -160,11 +156,9 @@ nsSVGNumber2::SetBaseValue(float aValue, if (!mIsAnimated) { mAnimVal = mBaseVal; } -#ifdef MOZ_SMIL else { aSVGElement->AnimationNeedsResample(); } -#endif aSVGElement->DidChangeNumber(mAttrEnum, true); } @@ -188,7 +182,6 @@ nsSVGNumber2::ToDOMAnimatedNumber(nsIDOMSVGAnimatedNumber **aResult, return NS_OK; } -#ifdef MOZ_SMIL nsISMILAttr* nsSVGNumber2::ToSMILAttr(nsSVGElement *aSVGElement) { @@ -245,4 +238,3 @@ nsSVGNumber2::SMILNumber::SetAnimValue(const nsSMILValue& aValue) } return NS_OK; } -#endif // MOZ_SMIL diff --git a/content/svg/content/src/nsSVGNumber2.h b/content/svg/content/src/nsSVGNumber2.h index a171d8a5116..81bce3cfffd 100644 --- a/content/svg/content/src/nsSVGNumber2.h +++ b/content/svg/content/src/nsSVGNumber2.h @@ -43,11 +43,9 @@ #include "nsDOMError.h" #include "nsMathUtils.h" -#ifdef MOZ_SMIL #include "nsISMILAttr.h" class nsSMILValue; class nsISMILType; -#endif // MOZ_SMIL class nsSVGNumber2 { @@ -81,10 +79,8 @@ public: 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: @@ -121,15 +117,12 @@ public: // 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: @@ -151,7 +144,6 @@ public: virtual void ClearAnimValue(); virtual nsresult SetAnimValue(const nsSMILValue& aValue); }; -#endif // MOZ_SMIL }; #endif //__NS_SVGNUMBER2_H__ diff --git a/content/svg/content/src/nsSVGNumberPair.cpp b/content/svg/content/src/nsSVGNumberPair.cpp index 6bf74dc6d08..38254fbfcd0 100644 --- a/content/svg/content/src/nsSVGNumberPair.cpp +++ b/content/svg/content/src/nsSVGNumberPair.cpp @@ -40,10 +40,8 @@ #include "prdtoa.h" #include "nsDOMError.h" #include "nsMathUtils.h" -#ifdef MOZ_SMIL #include "nsSMILValue.h" #include "SVGNumberPairSMILType.h" -#endif // MOZ_SMIL using namespace mozilla; @@ -119,11 +117,9 @@ nsSVGNumberPair::SetBaseValueString(const nsAString &aValueAsString, 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, @@ -152,11 +148,9 @@ nsSVGNumberPair::SetBaseValue(float aValue, PairIndex aPairIndex, if (!mIsAnimated) { mAnimVal[index] = aValue; } -#ifdef MOZ_SMIL else { aSVGElement->AnimationNeedsResample(); } -#endif aSVGElement->DidChangeNumberPair(mAttrEnum, true); } @@ -171,11 +165,9 @@ nsSVGNumberPair::SetBaseValues(float aValue1, float aValue2, mAnimVal[0] = aValue1; mAnimVal[1] = aValue2; } -#ifdef MOZ_SMIL else { aSVGElement->AnimationNeedsResample(); } -#endif aSVGElement->DidChangeNumberPair(mAttrEnum, true); } @@ -198,7 +190,6 @@ nsSVGNumberPair::ToDOMAnimatedNumber(nsIDOMSVGAnimatedNumber **aResult, return NS_OK; } -#ifdef MOZ_SMIL nsISMILAttr* nsSVGNumberPair::ToSMILAttr(nsSVGElement *aSVGElement) { @@ -255,4 +246,3 @@ nsSVGNumberPair::SMILNumberPair::SetAnimValue(const nsSMILValue& aValue) } return NS_OK; } -#endif // MOZ_SMIL diff --git a/content/svg/content/src/nsSVGNumberPair.h b/content/svg/content/src/nsSVGNumberPair.h index 182deb135d5..60f723564cb 100644 --- a/content/svg/content/src/nsSVGNumberPair.h +++ b/content/svg/content/src/nsSVGNumberPair.h @@ -43,11 +43,9 @@ #include "nsDOMError.h" #include "nsMathUtils.h" -#ifdef MOZ_SMIL #include "nsISMILAttr.h" class nsSMILValue; class nsISMILType; -#endif // MOZ_SMIL class nsSVGNumberPair { @@ -89,10 +87,8 @@ public: 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: @@ -130,15 +126,12 @@ public: // 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: @@ -160,7 +153,6 @@ public: virtual void ClearAnimValue(); virtual nsresult SetAnimValue(const nsSMILValue& aValue); }; -#endif // MOZ_SMIL }; #endif //__NS_SVGNUMBERPAIR_H__ diff --git a/content/svg/content/src/nsSVGSVGElement.cpp b/content/svg/content/src/nsSVGSVGElement.cpp index cd9622ecb22..bda06d508a5 100644 --- a/content/svg/content/src/nsSVGSVGElement.cpp +++ b/content/svg/content/src/nsSVGSVGElement.cpp @@ -63,7 +63,6 @@ #include "nsContentErrors.h" // For NS_PROPTABLE_PROP_OVERWRITTEN #include "nsContentUtils.h" -#ifdef MOZ_SMIL #include "nsEventDispatcher.h" #include "nsSMILTimeContainer.h" #include "nsSMILAnimationController.h" @@ -71,7 +70,6 @@ #include "nsIContentIterator.h" nsresult NS_NewContentIterator(nsIContentIterator** aInstancePtrResult); -#endif // MOZ_SMIL using namespace mozilla; using namespace mozilla::dom; @@ -163,7 +161,6 @@ 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) @@ -177,18 +174,13 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsSVGSVGElement, 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, @@ -209,12 +201,10 @@ nsSVGSVGElement::nsSVGSVGElement(already_AddRefed aNodeInfo, 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) { } @@ -454,7 +444,6 @@ nsSVGSVGElement::ForceRedraw() NS_IMETHODIMP nsSVGSVGElement::PauseAnimations() { -#ifdef MOZ_SMIL if (NS_SMILEnabled()) { if (mTimedDocumentRoot) { mTimedDocumentRoot->Pause(nsSMILTimeContainer::PAUSE_SCRIPT); @@ -462,7 +451,6 @@ nsSVGSVGElement::PauseAnimations() // else we're not the outermost or not bound to a tree, so silently fail return NS_OK; } -#endif // MOZ_SMIL NS_NOTYETIMPLEMENTED("nsSVGSVGElement::PauseAnimations"); return NS_ERROR_NOT_IMPLEMENTED; } @@ -471,7 +459,6 @@ nsSVGSVGElement::PauseAnimations() NS_IMETHODIMP nsSVGSVGElement::UnpauseAnimations() { -#ifdef MOZ_SMIL if (NS_SMILEnabled()) { if (mTimedDocumentRoot) { mTimedDocumentRoot->Resume(nsSMILTimeContainer::PAUSE_SCRIPT); @@ -479,7 +466,6 @@ nsSVGSVGElement::UnpauseAnimations() // else we're not the outermost or not bound to a tree, so silently fail return NS_OK; } -#endif // MOZ_SMIL NS_NOTYETIMPLEMENTED("nsSVGSVGElement::UnpauseAnimations"); return NS_ERROR_NOT_IMPLEMENTED; } @@ -488,13 +474,11 @@ nsSVGSVGElement::UnpauseAnimations() 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; } @@ -503,7 +487,6 @@ nsSVGSVGElement::AnimationsPaused(bool *_retval) NS_IMETHODIMP nsSVGSVGElement::GetCurrentTime(float *_retval) { -#ifdef MOZ_SMIL if (NS_SMILEnabled()) { nsSMILTimeContainer* root = GetTimedDocumentRoot(); if (root) { @@ -514,7 +497,6 @@ nsSVGSVGElement::GetCurrentTime(float *_retval) } return NS_OK; } -#endif // MOZ_SMIL NS_NOTYETIMPLEMENTED("nsSVGSVGElement::GetCurrentTime"); return NS_ERROR_NOT_IMPLEMENTED; } @@ -524,7 +506,6 @@ 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 @@ -545,7 +526,6 @@ nsSVGSVGElement::SetCurrentTime(float seconds) // fail return NS_OK; } -#endif // MOZ_SMIL NS_NOTYETIMPLEMENTED("nsSVGSVGElement::SetCurrentTime"); return NS_ERROR_NOT_IMPLEMENTED; } @@ -868,7 +848,6 @@ nsSVGSVGElement::SetCurrentTranslate(float x, float y) return SetCurrentScaleTranslate(mCurrentScale, x, y); } -#ifdef MOZ_SMIL nsSMILTimeContainer* nsSVGSVGElement::GetTimedDocumentRoot() { @@ -886,7 +865,6 @@ nsSVGSVGElement::GetTimedDocumentRoot() // invalid structure return nsnull; } -#endif // MOZ_SMIL //---------------------------------------------------------------------- // nsIContent methods @@ -915,7 +893,6 @@ nsSVGSVGElement::IsAttributeMapped(const nsIAtom* name) const //---------------------------------------------------------------------- // nsIContent methods: -#ifdef MOZ_SMIL nsresult nsSVGSVGElement::PreHandleEvent(nsEventChainPreVisitor& aVisitor) { @@ -930,7 +907,6 @@ nsSVGSVGElement::PreHandleEvent(nsEventChainPreVisitor& aVisitor) } return nsSVGSVGElementBase::PreHandleEvent(aVisitor); } -#endif // MOZ_SMIL //---------------------------------------------------------------------- // nsSVGElement overrides @@ -1036,7 +1012,6 @@ nsSVGSVGElement::GetViewBoxTransform() const mPreserveAspectRatio.GetAnimValue()); } -#ifdef MOZ_SMIL nsresult nsSVGSVGElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent, @@ -1090,12 +1065,10 @@ nsSVGSVGElement::UnbindFromTree(bool aDeep, bool aNullParent) nsSVGSVGElementBase::UnbindFromTree(aDeep, aNullParent); } -#endif // MOZ_SMIL //---------------------------------------------------------------------- // implementation helpers -#ifdef MOZ_SMIL bool nsSVGSVGElement::WillBeOutermostSVG(nsIContent* aParent, nsIContent* aBindingParent) const @@ -1116,7 +1089,6 @@ nsSVGSVGElement::WillBeOutermostSVG(nsIContent* aParent, return true; } -#endif // MOZ_SMIL void nsSVGSVGElement::InvalidateTransformNotifyFrame() diff --git a/content/svg/content/src/nsSVGSVGElement.h b/content/svg/content/src/nsSVGSVGElement.h index ca207fe86a1..67154446824 100644 --- a/content/svg/content/src/nsSVGSVGElement.h +++ b/content/svg/content/src/nsSVGSVGElement.h @@ -53,9 +53,7 @@ #include "SVGAnimatedPreserveAspectRatio.h" #include "mozilla/dom/FromParser.h" -#ifdef MOZ_SMIL class nsSMILTimeContainer; -#endif // MOZ_SMIL typedef nsSVGStylableElement nsSVGSVGElementBase; @@ -141,9 +139,7 @@ public: // 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 @@ -181,15 +177,11 @@ public: 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; @@ -237,12 +229,10 @@ 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: @@ -263,7 +253,6 @@ protected: parent->Tag() != nsGkAtoms::foreignObject; } -#ifdef MOZ_SMIL /* * While binding to the tree we need to determine if we will be the outermost * element _before_ the children are bound (as they want to know what @@ -275,7 +264,6 @@ protected: */ bool WillBeOutermostSVG(nsIContent* aParent, nsIContent* aBindingParent) const; -#endif // MOZ_SMIL // invalidate viewbox -> viewport xform & inform frames void InvalidateTransformNotifyFrame(); @@ -316,11 +304,9 @@ protected: // 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 elements (not nested elements). nsAutoPtr mTimedDocumentRoot; -#endif // MOZ_SMIL // zoom and pan // IMPORTANT: see the comment in RecordCurrentScaleTranslate before writing @@ -331,13 +317,11 @@ protected: float mPreviousScale; PRInt32 mRedrawSuspendCount; -#ifdef MOZ_SMIL // For outermost elements created from parsing, animation is started by // the onload event in accordance with the SVG spec, but for elements // created by script or promoted from inner to outermost we need // to manually kick off animation when they are bound to the tree. bool mStartAnimationOnBindToTree; -#endif // MOZ_SMIL bool mImageNeedsTransformInvalidation; bool mIsPaintingSVGImageElement; }; diff --git a/content/svg/content/src/nsSVGString.cpp b/content/svg/content/src/nsSVGString.cpp index bd03566bfa4..703d572a33c 100644 --- a/content/svg/content/src/nsSVGString.cpp +++ b/content/svg/content/src/nsSVGString.cpp @@ -35,10 +35,8 @@ * ***** END LICENSE BLOCK ***** */ #include "nsSVGString.h" -#ifdef MOZ_SMIL #include "nsSMILValue.h" #include "SMILStringType.h" -#endif // MOZ_SMIL using namespace mozilla; @@ -68,11 +66,9 @@ nsSVGString::SetBaseValue(const nsAString& aValue, if (aDoSetAttr) { aSVGElement->SetStringBaseValue(mAttrEnum, aValue); } -#ifdef MOZ_SMIL if (mAnimVal) { aSVGElement->AnimationNeedsResample(); } -#endif aSVGElement->DidChangeString(mAttrEnum); } @@ -112,7 +108,6 @@ nsSVGString::ToDOMAnimatedString(nsIDOMSVGAnimatedString **aResult, return NS_OK; } -#ifdef MOZ_SMIL nsISMILAttr* nsSVGString::ToSMILAttr(nsSVGElement *aSVGElement) { @@ -160,4 +155,3 @@ nsSVGString::SMILString::SetAnimValue(const nsSMILValue& aValue) } return NS_OK; } -#endif // MOZ_SMIL diff --git a/content/svg/content/src/nsSVGString.h b/content/svg/content/src/nsSVGString.h index fdc0c1a3247..597dd5fd0c2 100644 --- a/content/svg/content/src/nsSVGString.h +++ b/content/svg/content/src/nsSVGString.h @@ -70,10 +70,8 @@ public: 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: @@ -100,14 +98,11 @@ public: 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: @@ -129,6 +124,5 @@ public: virtual void ClearAnimValue(); virtual nsresult SetAnimValue(const nsSMILValue& aValue); }; -#endif // MOZ_SMIL }; #endif //__NS_SVGSTRING_H__ diff --git a/content/svg/content/src/nsSVGStylableElement.cpp b/content/svg/content/src/nsSVGStylableElement.cpp index 346cb1dcf15..f15859547ef 100644 --- a/content/svg/content/src/nsSVGStylableElement.cpp +++ b/content/svg/content/src/nsSVGStylableElement.cpp @@ -149,7 +149,6 @@ nsSVGStylableElement::DidAnimateClass() } } -#ifdef MOZ_SMIL nsISMILAttr* nsSVGStylableElement::GetAnimatedAttr(PRInt32 aNamespaceID, nsIAtom* aName) { @@ -159,4 +158,3 @@ nsSVGStylableElement::GetAnimatedAttr(PRInt32 aNamespaceID, nsIAtom* aName) } return nsSVGStylableElementBase::GetAnimatedAttr(aNamespaceID, aName); } -#endif // MOZ_SMIL diff --git a/content/svg/content/src/nsSVGStylableElement.h b/content/svg/content/src/nsSVGStylableElement.h index 61735c5cdb7..1e61a518af9 100644 --- a/content/svg/content/src/nsSVGStylableElement.h +++ b/content/svg/content/src/nsSVGStylableElement.h @@ -69,9 +69,7 @@ public: virtual nsresult UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute, bool aNotify); -#ifdef MOZ_SMIL virtual nsISMILAttr* GetAnimatedAttr(PRInt32 aNamespaceID, nsIAtom* aName); -#endif void DidAnimateClass(); diff --git a/content/svg/content/src/nsSVGViewBox.cpp b/content/svg/content/src/nsSVGViewBox.cpp index 3a45c6f76d4..3c34bb5fa41 100644 --- a/content/svg/content/src/nsSVGViewBox.cpp +++ b/content/svg/content/src/nsSVGViewBox.cpp @@ -42,10 +42,8 @@ #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; @@ -133,11 +131,9 @@ nsSVGViewBox::SetBaseValue(float aX, float aY, float aWidth, float aHeight, mHasBaseVal = true; aSVGElement->DidChangeViewBox(true); -#ifdef MOZ_SMIL if (mAnimVal) { aSVGElement->AnimationNeedsResample(); } -#endif } static nsresult @@ -186,11 +182,9 @@ nsSVGViewBox::SetBaseValueString(const nsAString& aValue, 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. @@ -280,7 +274,6 @@ nsSVGViewBox::DOMBaseVal::SetHeight(float aHeight) return NS_OK; } -#ifdef MOZ_SMIL nsISMILAttr* nsSVGViewBox::ToSMILAttr(nsSVGElement *aSVGElement) { @@ -335,4 +328,3 @@ nsSVGViewBox::SMILViewBox::SetAnimValue(const nsSMILValue& aValue) } return NS_OK; } -#endif // MOZ_SMIL diff --git a/content/svg/content/src/nsSVGViewBox.h b/content/svg/content/src/nsSVGViewBox.h index 2e41e4039e0..c2bf45e766a 100644 --- a/content/svg/content/src/nsSVGViewBox.h +++ b/content/svg/content/src/nsSVGViewBox.h @@ -84,10 +84,8 @@ public: 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: @@ -136,33 +134,25 @@ private: // 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; } @@ -193,7 +183,6 @@ public: NS_IMETHOD GetAnimVal(nsIDOMSVGRect **aResult); }; -#ifdef MOZ_SMIL struct SMILViewBox : public nsISMILAttr { public: @@ -215,7 +204,6 @@ public: virtual void ClearAnimValue(); virtual nsresult SetAnimValue(const nsSMILValue& aValue); }; -#endif // MOZ_SMIL }; #endif // __NS_SVGVIEWBOX_H__ diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index 6b3e4f48a5a..342e4298f4d 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -3748,6 +3748,9 @@ nsDocShell::LoadURI(const PRUnichar * aURI, if (aLoadFlags & LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP) { fixupFlags |= nsIURIFixup::FIXUP_FLAG_ALLOW_KEYWORD_LOOKUP; } + if (aLoadFlags & LOAD_FLAGS_URI_IS_UTF8) { + fixupFlags |= nsIURIFixup::FIXUP_FLAG_USE_UTF8; + } rv = sURIFixup->CreateFixupURI(uriString, fixupFlags, getter_AddRefs(uri)); } diff --git a/docshell/base/nsIWebNavigation.idl b/docshell/base/nsIWebNavigation.idl index 0710e38f495..75ab19a29c8 100644 --- a/docshell/base/nsIWebNavigation.idl +++ b/docshell/base/nsIWebNavigation.idl @@ -219,6 +219,11 @@ interface nsIWebNavigation : nsISupports */ const unsigned long LOAD_FLAGS_DISALLOW_INHERIT_OWNER = 0x40000; + /** + * Assume the URI is encoded in UTF-8. + */ + const unsigned long LOAD_FLAGS_URI_IS_UTF8 = 0x80000; + /** * Loads a given URI. This will give priority to loading the requested URI * in the object implementing this interface. If it can't be loaded here diff --git a/dom/Makefile.in b/dom/Makefile.in index 16eeefd828a..af0fdabdba0 100644 --- a/dom/Makefile.in +++ b/dom/Makefile.in @@ -43,6 +43,7 @@ VPATH = @srcdir@ include $(DEPTH)/config/autoconf.mk MODULE = dom + DIRS = \ interfaces/base \ interfaces/canvas \ @@ -64,12 +65,9 @@ DIRS = \ interfaces/geolocation \ interfaces/notification \ interfaces/svg \ + interfaces/smil \ $(NULL) -ifdef MOZ_SMIL -DIRS += interfaces/smil -endif - DIRS += \ base \ battery \ @@ -95,4 +93,3 @@ endif endif include $(topsrcdir)/config/rules.mk - diff --git a/dom/base/nsDOMClassInfo.cpp b/dom/base/nsDOMClassInfo.cpp index cb445ec68fa..4c2a077f525 100644 --- a/dom/base/nsDOMClassInfo.cpp +++ b/dom/base/nsDOMClassInfo.cpp @@ -372,7 +372,6 @@ #include "nsIDOMSVGAnimatedRect.h" #include "nsIDOMSVGAnimatedString.h" #include "nsIDOMSVGAnimPresAspRatio.h" -#ifdef MOZ_SMIL #include "nsIDOMSVGAnimateElement.h" #include "nsIDOMSVGAnimateTransformElement.h" #include "nsIDOMSVGAnimateMotionElement.h" @@ -381,7 +380,6 @@ #include "nsIDOMSVGAnimationElement.h" #include "nsIDOMElementTimeControl.h" #include "nsIDOMTimeEvent.h" -#endif // MOZ_SMIL #include "nsIDOMSVGAnimTransformList.h" #include "nsIDOMSVGCircleElement.h" #include "nsIDOMSVGClipPathElement.h" @@ -1032,7 +1030,6 @@ static nsDOMClassInfoData sClassInfoData[] = { 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, @@ -1045,7 +1042,6 @@ static nsDOMClassInfoData sClassInfoData[] = { 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, @@ -3063,7 +3059,6 @@ nsDOMClassInfo::Init() 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) @@ -3104,7 +3099,6 @@ nsDOMClassInfo::Init() 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) diff --git a/dom/base/nsDOMClassInfoClasses.h b/dom/base/nsDOMClassInfoClasses.h index 506f5a173ce..893228bac28 100644 --- a/dom/base/nsDOMClassInfoClasses.h +++ b/dom/base/nsDOMClassInfoClasses.h @@ -234,14 +234,12 @@ 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) diff --git a/dom/interfaces/svg/Makefile.in b/dom/interfaces/svg/Makefile.in index c5d91f836c9..7e625ffd448 100644 --- a/dom/interfaces/svg/Makefile.in +++ b/dom/interfaces/svg/Makefile.in @@ -48,7 +48,6 @@ include $(DEPTH)/config/autoconf.mk MODULE = dom XPIDL_MODULE = dom_svg - XPIDLSRCS = \ nsIDOMGetSVGDocument.idl \ nsIDOMSVGAElement.idl \ @@ -66,6 +65,10 @@ XPIDLSRCS = \ nsIDOMSVGAnimatedPoints.idl \ nsIDOMSVGAnimatedRect.idl \ nsIDOMSVGAnimatedString.idl \ + nsIDOMSVGAnimateElement.idl \ + nsIDOMSVGAnimateMotionElement.idl \ + nsIDOMSVGAnimateTransformElement.idl \ + nsIDOMSVGAnimationElement.idl \ nsIDOMSVGAnimPresAspRatio.idl \ nsIDOMSVGAnimTransformList.idl \ nsIDOMSVGCircleElement.idl \ @@ -92,6 +95,7 @@ XPIDLSRCS = \ nsIDOMSVGMaskElement.idl \ nsIDOMSVGMatrix.idl \ nsIDOMSVGMetadataElement.idl \ + nsIDOMSVGMpathElement.idl \ nsIDOMSVGNumber.idl \ nsIDOMSVGNumberList.idl \ nsIDOMSVGPathElement.idl \ @@ -106,6 +110,7 @@ XPIDLSRCS = \ nsIDOMSVGRect.idl \ nsIDOMSVGRectElement.idl \ nsIDOMSVGScriptElement.idl \ + nsIDOMSVGSetElement.idl \ nsIDOMSVGSVGElement.idl \ nsIDOMSVGStopElement.idl \ nsIDOMSVGStylable.idl \ @@ -129,15 +134,4 @@ XPIDLSRCS = \ 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 diff --git a/dom/locales/en-US/chrome/layout/htmlparser.properties b/dom/locales/en-US/chrome/layout/htmlparser.properties index 0b61b1002d1..9b5d317b958 100644 --- a/dom/locales/en-US/chrome/layout/htmlparser.properties +++ b/dom/locales/en-US/chrome/layout/htmlparser.properties @@ -96,7 +96,6 @@ errEofInSystemId=End of file inside system identifier. errExpectedSystemId=Expected a system identifier but the doctype ended. errMissingSpaceBeforeDoctypeName=Missing space before doctype name. errHyphenHyphenBang=“--!” found in comment. -errNcrControlChar=Character reference expands to a control character. errNcrZero=Character reference expands to zero. errNoSpaceBetweenDoctypeSystemKeywordAndQuote=No space between the doctype “SYSTEM” keyword and the quote. errNoSpaceBetweenPublicAndSystemIds=No space between the doctype public and system identifiers. @@ -122,7 +121,7 @@ errStartTagWithoutDoctype=Start tag seen without seeing a doctype first. Expecte errNoSelectInTableScope=No “select” in table scope. errStartSelectWhereEndSelectExpected=“select” start tag where end tag expected. errStartTagWithSelectOpen=“%1$S” start tag with “select” open. -errBadStartTagInHead=Bad start tag in “%1$S” in “head”. +errBadStartTagInHead2=Bad start tag “%1$S” in “head”. errImage=Saw a start tag “image”. errIsindex=“isindex” seen. errFooSeenWhenFooOpen=An “%1$S” start tag seen but an element of the same type was already open. diff --git a/dom/plugins/base/nsPluginStreamListenerPeer.cpp b/dom/plugins/base/nsPluginStreamListenerPeer.cpp index 40904555dc4..f5b29aa45e8 100644 --- a/dom/plugins/base/nsPluginStreamListenerPeer.cpp +++ b/dom/plugins/base/nsPluginStreamListenerPeer.cpp @@ -556,11 +556,16 @@ nsPluginStreamListenerPeer::OnStartRequest(nsIRequest *request, if (responseCode > 206) { // not normal bool bWantsAllNetworkStreams = false; - rv = mPluginInstance->GetValueFromPlugin(NPPVpluginWantsAllNetworkStreams, - &bWantsAllNetworkStreams); - // If the call returned an error code make sure we still use our default value. - if (NS_FAILED(rv)) { - bWantsAllNetworkStreams = false; + + // We don't always have an instance here already, but if we do, check + // to see if it wants all streams. + if (mPluginInstance) { + rv = mPluginInstance->GetValueFromPlugin(NPPVpluginWantsAllNetworkStreams, + &bWantsAllNetworkStreams); + // If the call returned an error code make sure we still use our default value. + if (NS_FAILED(rv)) { + bWantsAllNetworkStreams = false; + } } if (!bWantsAllNetworkStreams) { diff --git a/dom/workers/Exceptions.cpp b/dom/workers/Exceptions.cpp index d2eaf6a2685..a2bf68da813 100644 --- a/dom/workers/Exceptions.cpp +++ b/dom/workers/Exceptions.cpp @@ -209,6 +209,9 @@ JSPropertySpec DOMException::sStaticProperties[] = { #define EXCEPTION_ENTRY(_name) \ { #_name, _name, CONSTANT_FLAGS, GetConstant, NULL }, + // Make sure this one is always first. + EXCEPTION_ENTRY(UNKNOWN_ERR) + EXCEPTION_ENTRY(INDEX_SIZE_ERR) EXCEPTION_ENTRY(DOMSTRING_SIZE_ERR) EXCEPTION_ENTRY(HIERARCHY_REQUEST_ERR) @@ -257,7 +260,9 @@ DOMException::Create(JSContext* aCx, intN aCode) } } - JS_ASSERT(foundIndex != size_t(-1)); + if (foundIndex == size_t(-1)) { + foundIndex = 0; + } JSString* name = JS_NewStringCopyZ(aCx, sStaticProperties[foundIndex].name); if (!name) { diff --git a/dom/workers/Exceptions.h b/dom/workers/Exceptions.h index 3f506cb3655..a6b9bc56b8b 100644 --- a/dom/workers/Exceptions.h +++ b/dom/workers/Exceptions.h @@ -71,6 +71,9 @@ #define INVALID_NODE_TYPE_ERR 24 #define DATA_CLONE_ERR 25 +// This one isn't actually spec'd anywhere, use it when we can't find a match. +#define UNKNOWN_ERR 0 + // FileException Codes #define FILE_NOT_FOUND_ERR 1 #define FILE_SECURITY_ERR 2 diff --git a/gfx/harfbuzz/src/hb-buffer-private.hh b/gfx/harfbuzz/src/hb-buffer-private.hh index a12916513d0..d8834c55046 100644 --- a/gfx/harfbuzz/src/hb-buffer-private.hh +++ b/gfx/harfbuzz/src/hb-buffer-private.hh @@ -99,7 +99,7 @@ struct _hb_buffer_t { unsigned int i; /* Cursor into ->info and ->pos arrays */ unsigned int len; /* Length of ->info and ->pos arrays */ - unsigned int out_len; /* Length of ->out array */ + unsigned int out_len; /* Length of ->out array if have_output */ hb_glyph_info_t *info; hb_glyph_info_t *out_info; @@ -111,6 +111,8 @@ struct _hb_buffer_t { /* Methods */ + inline unsigned int backtrack_len (void) const + { return this->have_output? this->out_len : this->i; } inline unsigned int next_serial (void) { return serial++; } inline void swap (void) { _hb_buffer_swap (this); } inline void clear_output (void) { _hb_buffer_clear_output (this); } @@ -137,7 +139,6 @@ struct _hb_buffer_t { unsigned int cluster_start, unsigned int cluster_end) { _hb_buffer_set_masks (this, value, mask, cluster_start, cluster_end); } - }; diff --git a/gfx/harfbuzz/src/hb-buffer.cc b/gfx/harfbuzz/src/hb-buffer.cc index ce55c6f042c..74a9530a637 100644 --- a/gfx/harfbuzz/src/hb-buffer.cc +++ b/gfx/harfbuzz/src/hb-buffer.cc @@ -45,7 +45,7 @@ static hb_buffer_t _hb_buffer_nil = { * * As an optimization, both info and out_info may point to the * same piece of memory, which is owned by info. This remains the - * case as long as out_len doesn't exceed len at any time. + * case as long as out_len doesn't exceed i at any time. * In that case, swap() is no-op and the glyph operations operate * mostly in-place. * diff --git a/gfx/harfbuzz/src/hb-ot-layout-gsubgpos-private.hh b/gfx/harfbuzz/src/hb-ot-layout-gsubgpos-private.hh index 1f1c88a5519..a66a981d648 100644 --- a/gfx/harfbuzz/src/hb-ot-layout-gsubgpos-private.hh +++ b/gfx/harfbuzz/src/hb-ot-layout-gsubgpos-private.hh @@ -155,10 +155,10 @@ static inline bool match_backtrack (hb_apply_context_t *c, match_func_t match_func, const void *match_data) { - if (unlikely (c->buffer->out_len < count)) + if (unlikely (c->buffer->backtrack_len () < count)) return false; - for (unsigned int i = 0, j = c->buffer->out_len - 1; i < count; i++, j--) + for (unsigned int i = 0, j = c->buffer->backtrack_len () - 1; i < count; i++, j--) { while (_hb_ot_layout_skip_mark (c->layout->face, &c->buffer->out_info[j], c->lookup_props, NULL)) { @@ -562,7 +562,7 @@ static inline bool chain_context_lookup (hb_apply_context_t *c, ChainContextLookupContext &lookup_context) { /* First guess */ - if (unlikely (c->buffer->out_len < backtrackCount || + if (unlikely (c->buffer->backtrack_len () < backtrackCount || c->buffer->i + inputCount + lookaheadCount > c->buffer->len || inputCount + lookaheadCount > c->context_length)) return false; diff --git a/image/decoders/nsICODecoder.cpp b/image/decoders/nsICODecoder.cpp index 6151d511f00..f907cd677d5 100644 --- a/image/decoders/nsICODecoder.cpp +++ b/image/decoders/nsICODecoder.cpp @@ -386,8 +386,7 @@ nsICODecoder::WriteInternal(const char* aBuffer, PRUint32 aCount) // Raymond Chen says that 32bpp only are valid PNG ICOs // http://blogs.msdn.com/b/oldnewthing/archive/2010/10/22/10079192.aspx - if (static_cast(mContainedDecoder.get())->HasValidInfo() && - static_cast(mContainedDecoder.get())->GetPixelDepth() != 32) { + if (!static_cast(mContainedDecoder.get())->IsValidICO()) { PostDataError(); } return; diff --git a/image/decoders/nsPNGDecoder.h b/image/decoders/nsPNGDecoder.h index 6824232c442..2a29a563e37 100644 --- a/image/decoders/nsPNGDecoder.h +++ b/image/decoders/nsPNGDecoder.h @@ -73,19 +73,25 @@ public: void EndImageFrame(); - // Checks if the info header contains valid information - bool HasValidInfo() const + // Check if PNG is valid ICO (32bpp RGBA) + // http://blogs.msdn.com/b/oldnewthing/archive/2010/10/22/10079192.aspx + bool IsValidICO() const { - return mInfo && mInfo->valid; - } + png_uint_32 + png_width, // Unused + png_height; // Unused - // Obtain the pixel depth if available or 0 otherwise - PRInt32 GetPixelDepth() const - { - if (!mInfo) { - return 0; + int png_bit_depth, + png_color_type; + + if (png_get_IHDR(mPNG, mInfo, &png_width, &png_height, &png_bit_depth, + &png_color_type, NULL, NULL, NULL)) { + + return (png_color_type == PNG_COLOR_TYPE_RGB_ALPHA && + png_bit_depth == 8); + } else { + return false; } - return mInfo->pixel_depth; } public: diff --git a/image/src/SVGDocumentWrapper.cpp b/image/src/SVGDocumentWrapper.cpp index e9f84d39b82..e2eabf2ca8d 100644 --- a/image/src/SVGDocumentWrapper.cpp +++ b/image/src/SVGDocumentWrapper.cpp @@ -185,13 +185,9 @@ SVGDocumentWrapper::FlushImageTransformInvalidation() bool SVGDocumentWrapper::IsAnimated() { -#ifdef MOZ_SMIL nsIDocument* doc = mViewer->GetDocument(); return doc && doc->HasAnimationController() && doc->GetAnimationController()->HasRegisteredAnimations(); -#else - return false; -#endif // MOZ_SMIL } void @@ -204,12 +200,10 @@ SVGDocumentWrapper::StartAnimation() 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); } } @@ -224,12 +218,10 @@ SVGDocumentWrapper::StopAnimation() 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); } } diff --git a/intl/uconv/idl/nsITextToSubURI.idl b/intl/uconv/idl/nsITextToSubURI.idl index 7baf1db536a..46a3ff4ac8e 100644 --- a/intl/uconv/idl/nsITextToSubURI.idl +++ b/intl/uconv/idl/nsITextToSubURI.idl @@ -69,8 +69,8 @@ interface nsITextToSubURI : nsISupports /** * Unescapes only non ASCII characters in the given URI fragment - * note: this method assumes the URI as UTF-8 and fallbacks to the given charset - * in case the data is not UTF-8 + * note: this method assumes the URI as UTF-8 and fallbacks to the given + * charset if the charset is an ASCII superset * * @param aCharset the charset to convert from * @param aURIFragment the URI (or URI fragment) to unescape diff --git a/intl/uconv/src/nsTextToSubURI.cpp b/intl/uconv/src/nsTextToSubURI.cpp index 483fdf4a30e..d5bee49979a 100644 --- a/intl/uconv/src/nsTextToSubURI.cpp +++ b/intl/uconv/src/nsTextToSubURI.cpp @@ -248,12 +248,24 @@ NS_IMETHODIMP nsTextToSubURI::UnEscapeURIForUI(const nsACString & aCharset, } NS_IMETHODIMP nsTextToSubURI::UnEscapeNonAsciiURI(const nsACString & aCharset, - const nsACString &aURIFragment, + const nsACString & aURIFragment, nsAString &_retval) { nsCAutoString unescapedSpec; NS_UnescapeURL(PromiseFlatCString(aURIFragment), esc_AlwaysCopy | esc_OnlyNonASCII, unescapedSpec); + // leave the URI as it is if it's not UTF-8 and aCharset is not a ASCII + // superset since converting "http:" with such an encoding is always a bad + // idea. + if (!IsUTF8(unescapedSpec) && + (aCharset.LowerCaseEqualsLiteral("utf-16") || + aCharset.LowerCaseEqualsLiteral("utf-16be") || + aCharset.LowerCaseEqualsLiteral("utf-16le") || + aCharset.LowerCaseEqualsLiteral("utf-7") || + aCharset.LowerCaseEqualsLiteral("x-imap4-modified-utf7"))){ + CopyASCIItoUTF16(aURIFragment, _retval); + return NS_OK; + } return convertURItoUnicode(PromiseFlatCString(aCharset), unescapedSpec, true, _retval); } diff --git a/intl/uconv/tests/unit/test_bug699673.js b/intl/uconv/tests/unit/test_bug699673.js new file mode 100644 index 00000000000..32dbefce36f --- /dev/null +++ b/intl/uconv/tests/unit/test_bug699673.js @@ -0,0 +1,7 @@ +// Tests whether nsTextToSubURI does UTF-16 unescaping (it shouldn't) + function run_test() +{ + var testURI = "data:text/html,%FE%FF"; + var textToSubURI = Components.classes["@mozilla.org/intl/texttosuburi;1"].getService(Components.interfaces.nsITextToSubURI); + do_check_eq(textToSubURI.unEscapeNonAsciiURI("UTF-16", testURI), testURI); +} diff --git a/intl/uconv/tests/unit/xpcshell.ini b/intl/uconv/tests/unit/xpcshell.ini index a9a34f6b66d..5150ebdc30d 100644 --- a/intl/uconv/tests/unit/xpcshell.ini +++ b/intl/uconv/tests/unit/xpcshell.ini @@ -26,6 +26,7 @@ tail = [test_bug563283.js] [test_bug563618.js] [test_bug601429.js] +[test_bug699673.js] [test_bug90411.js] [test_charset_conversion.js] [test_decode_8859-1.js] diff --git a/js/src/builtin/RegExp.cpp b/js/src/builtin/RegExp.cpp index 6b38e772988..6829db9d868 100644 --- a/js/src/builtin/RegExp.cpp +++ b/js/src/builtin/RegExp.cpp @@ -535,6 +535,8 @@ ExecuteRegExp(JSContext *cx, Native native, uintN argc, Value *vp) /* Step 3. */ JSLinearString *linearInput = input->ensureLinear(cx); + if (!linearInput) + return false; const jschar *chars = linearInput->chars(); size_t length = input->length(); diff --git a/js/src/config/rules.mk b/js/src/config/rules.mk index 01b64bda246..d1b969becd4 100644 --- a/js/src/config/rules.mk +++ b/js/src/config/rules.mk @@ -1469,7 +1469,7 @@ $(XPIDL_GEN_DIR)/%.h: %.idl $(XPIDL_DEPS) $(XPIDL_GEN_DIR)/.done $(PYTHON_PATH) \ -I$(topsrcdir)/other-licenses/ply \ -I$(topsrcdir)/xpcom/idl-parser \ - $(topsrcdir)/xpcom/idl-parser/header.py --cachedir=$(topsrcdir)/xpcom/idl-parser $(XPIDL_FLAGS) $(_VPATH_SRCS) -d $(MDDEPDIR)/$(@F).pp -o $@ + $(topsrcdir)/xpcom/idl-parser/header.py --cachedir=$(DEPTH)/xpcom/idl-parser $(XPIDL_FLAGS) $(_VPATH_SRCS) -d $(MDDEPDIR)/$(@F).pp -o $@ @if test -n "$(findstring $*.h, $(EXPORTS))"; \ then echo "*** WARNING: file $*.h generated from $*.idl overrides $(srcdir)/$*.h"; else true; fi @@ -1482,7 +1482,7 @@ $(XPIDL_GEN_DIR)/%.xpt: %.idl $(XPIDL_DEPS) $(XPIDL_GEN_DIR)/.done -I$(topsrcdir)/other-licenses/ply \ -I$(topsrcdir)/xpcom/idl-parser \ -I$(topsrcdir)/xpcom/typelib/xpt/tools \ - $(topsrcdir)/xpcom/idl-parser/typelib.py --cachedir=$(topsrcdir)/xpcom/idl-parser $(XPIDL_FLAGS) $(_VPATH_SRCS) -d $(MDDEPDIR)/$(@F).pp -o $@ + $(topsrcdir)/xpcom/idl-parser/typelib.py --cachedir=$(DEPTH)/xpcom/idl-parser $(XPIDL_FLAGS) $(_VPATH_SRCS) -d $(MDDEPDIR)/$(@F).pp -o $@ # no need to link together if XPIDLSRCS contains only XPIDL_MODULE ifneq ($(XPIDL_MODULE).idl,$(strip $(XPIDLSRCS))) diff --git a/js/src/jit-test/tests/basic/bug698584.js b/js/src/jit-test/tests/basic/bug698584.js new file mode 100644 index 00000000000..8a1c894043c --- /dev/null +++ b/js/src/jit-test/tests/basic/bug698584.js @@ -0,0 +1,14 @@ +// |jit-test| error: InternalError +/* + * Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/licenses/publicdomain/ + */ + +const MAX = 10000; +var str = ""; +for (var i = 0; i < MAX; ++i) { + /x/.test(str); + str += str + 'xxxxxxxxxxxxxx'; +} + +/* Don't crash */ diff --git a/js/xpconnect/src/Makefile.in b/js/xpconnect/src/Makefile.in index ec585f95376..c4d012b0e6a 100644 --- a/js/xpconnect/src/Makefile.in +++ b/js/xpconnect/src/Makefile.in @@ -167,7 +167,7 @@ dom_quickstubs.cpp: $(srcdir)/dom_quickstubs.qsconf \ -I$(topsrcdir)/xpcom/idl-parser \ $(srcdir)/qsgen.py \ --idlpath=$(DEPTH)/dist/idl \ - --cachedir=$(DEPTH)/xpcom/idl-parser/cache \ + --cachedir=$(DEPTH)/xpcom/idl-parser \ --header-output dom_quickstubs.h \ --stub-output dom_quickstubs.cpp \ --makedepend-output $(MDDEPDIR)/dom_qsgen.pp \ diff --git a/js/xpconnect/src/XPCConvert.cpp b/js/xpconnect/src/XPCConvert.cpp index 9f6bfb049df..de5a77ecb27 100644 --- a/js/xpconnect/src/XPCConvert.cpp +++ b/js/xpconnect/src/XPCConvert.cpp @@ -1783,9 +1783,8 @@ failure: // static JSBool XPCConvert::JSArray2Native(XPCCallContext& ccx, void** d, jsval s, - JSUint32 count, JSUint32 capacity, - const nsXPTType& type, const nsID* iid, - uintN* pErr) + JSUint32 count, const nsXPTType& type, + const nsID* iid, uintN* pErr) { NS_PRECONDITION(d, "bad param"); @@ -1812,11 +1811,6 @@ XPCConvert::JSArray2Native(XPCCallContext& ccx, void** d, jsval s, return JS_FALSE; } - // If a non-zero capacity was indicated then we build an - // empty array rather than return nsnull. - if (0 != capacity) - goto fill_array; - *d = nsnull; return JS_TRUE; } @@ -1835,7 +1829,7 @@ XPCConvert::JSArray2Native(XPCCallContext& ccx, void** d, jsval s, } jsuint len; - if (!JS_GetArrayLength(cx, jsarray, &len) || len < count || capacity < count) { + if (!JS_GetArrayLength(cx, jsarray, &len) || len < count) { if (pErr) *pErr = NS_ERROR_XPC_NOT_ENOUGH_ELEMENTS_IN_ARRAY; return JS_FALSE; @@ -1848,8 +1842,8 @@ XPCConvert::JSArray2Native(XPCCallContext& ccx, void** d, jsval s, PR_BEGIN_MACRO \ cleanupMode = _mode; \ size_t max = PR_UINT32_MAX / sizeof(_t); \ - if (capacity > max || \ - nsnull == (array = nsMemory::Alloc(capacity * sizeof(_t)))) { \ + if (count > max || \ + nsnull == (array = nsMemory::Alloc(count * sizeof(_t)))) { \ if (pErr) \ *pErr = NS_ERROR_OUT_OF_MEMORY; \ goto failure; \ @@ -1867,7 +1861,6 @@ XPCConvert::JSArray2Native(XPCCallContext& ccx, void** d, jsval s, // XXX make extra space at end of char* and wchar* and null termintate -fill_array: switch (type.TagPart()) { case nsXPTType::T_I8 : POPULATE(na, int8); break; case nsXPTType::T_I16 : POPULATE(na, int16); break; @@ -1975,8 +1968,7 @@ XPCConvert::NativeStringWithSize2JS(JSContext* cx, // static JSBool XPCConvert::JSStringWithSize2Native(XPCCallContext& ccx, void* d, jsval s, - JSUint32 count, JSUint32 capacity, - const nsXPTType& type, + JSUint32 count, const nsXPTType& type, uintN* pErr) { NS_PRECONDITION(!JSVAL_IS_NULL(s), "bad param"); @@ -1989,12 +1981,6 @@ XPCConvert::JSStringWithSize2Native(XPCCallContext& ccx, void* d, jsval s, if (pErr) *pErr = NS_ERROR_XPC_BAD_CONVERT_NATIVE; - if (capacity < count) { - if (pErr) - *pErr = NS_ERROR_XPC_NOT_ENOUGH_CHARS_IN_STRING; - return JS_FALSE; - } - if (!type.IsPointer()) { XPC_LOG_ERROR(("XPCConvert::JSStringWithSize2Native : unsupported type")); return JS_FALSE; @@ -2014,8 +2000,8 @@ XPCConvert::JSStringWithSize2Native(XPCCallContext& ccx, void* d, jsval s, return JS_FALSE; } - if (0 != capacity) { - len = (capacity + 1) * sizeof(char); + if (0 != count) { + len = (count + 1) * sizeof(char); if (!(*((void**)d) = nsMemory::Alloc(len))) return JS_FALSE; return JS_TRUE; @@ -2042,8 +2028,8 @@ XPCConvert::JSStringWithSize2Native(XPCCallContext& ccx, void* d, jsval s, } len = PRUint32(length); - if (len < capacity) - len = capacity; + if (len < count) + len = count; JSUint32 alloc_len = (len + 1) * sizeof(char); char *buffer = static_cast(nsMemory::Alloc(alloc_len)); @@ -2074,8 +2060,8 @@ XPCConvert::JSStringWithSize2Native(XPCCallContext& ccx, void* d, jsval s, return JS_FALSE; } - if (0 != capacity) { - len = (capacity + 1) * sizeof(jschar); + if (0 != count) { + len = (count + 1) * sizeof(jschar); if (!(*((void**)d) = nsMemory::Alloc(len))) return JS_FALSE; return JS_TRUE; @@ -2096,8 +2082,8 @@ XPCConvert::JSStringWithSize2Native(XPCCallContext& ccx, void* d, jsval s, *pErr = NS_ERROR_XPC_NOT_ENOUGH_CHARS_IN_STRING; return JS_FALSE; } - if (len < capacity) - len = capacity; + if (len < count) + len = count; if (!(chars = JS_GetStringCharsZ(cx, str))) { return JS_FALSE; diff --git a/js/xpconnect/src/XPCVariant.cpp b/js/xpconnect/src/XPCVariant.cpp index fdeed627882..e240634de27 100644 --- a/js/xpconnect/src/XPCVariant.cpp +++ b/js/xpconnect/src/XPCVariant.cpp @@ -375,8 +375,7 @@ JSBool XPCVariant::InitializeData(XPCCallContext& ccx) return JS_FALSE; if (!XPCConvert::JSArray2Native(ccx, &mData.u.array.mArrayValue, - val, len, len, - type, &id, nsnull)) + val, len, type, &id, nsnull)) return JS_FALSE; mData.mType = nsIDataType::VTYPE_ARRAY; diff --git a/js/xpconnect/src/XPCWrappedJSClass.cpp b/js/xpconnect/src/XPCWrappedJSClass.cpp index fabf1c541e3..c4cf53f7bb3 100644 --- a/js/xpconnect/src/XPCWrappedJSClass.cpp +++ b/js/xpconnect/src/XPCWrappedJSClass.cpp @@ -870,17 +870,13 @@ nsXPCWrappedJSClass::GetArraySizeFromParam(JSContext* cx, const nsXPTParamInfo& param, uint16 methodIndex, uint8 paramIndex, - SizeMode mode, nsXPTCMiniVariant* nativeParams, JSUint32* result) { uint8 argnum; nsresult rv; - if (mode == GET_SIZE) - rv = mInfo->GetSizeIsArgNumberForParam(methodIndex, ¶m, 0, &argnum); - else - rv = mInfo->GetLengthIsArgNumberForParam(methodIndex, ¶m, 0, &argnum); + rv = mInfo->GetSizeIsArgNumberForParam(methodIndex, ¶m, 0, &argnum); if (NS_FAILED(rv)) return JS_FALSE; @@ -1421,8 +1417,7 @@ nsXPCWrappedJSClass::CallMethod(nsXPCWrappedJS* wrapper, uint16 methodIndex, if (isArray || isSizedString) { if (!GetArraySizeFromParam(cx, info, param, methodIndex, - i, GET_LENGTH, nativeParams, - &array_count)) + i, nativeParams, &array_count)) goto pre_call_clean_up; } @@ -1495,10 +1490,12 @@ pre_call_clean_up: 1, &datum_type)) && datum_type.IsPointer() && GetArraySizeFromParam(cx, info, param, methodIndex, - i, GET_LENGTH, nativeParams, - &array_count) && array_count) { + i, nativeParams, &array_count) && + array_count) { + CleanupPointerArray(datum_type, array_count, pp); } + // always release the array if it is inout nsMemory::Free(pp); } @@ -1669,23 +1666,21 @@ pre_call_clean_up: if (isArray || isSizedString) { if (!GetArraySizeFromParam(cx, info, param, methodIndex, - i, GET_LENGTH, nativeParams, - &array_count)) + i, nativeParams, &array_count)) break; } if (isArray) { if (array_count && !XPCConvert::JSArray2Native(ccx, (void**)&pv->val, val, - array_count, array_count, - datum_type, ¶m_iid, - nsnull)) + array_count, datum_type, + ¶m_iid, nsnull)) break; } else if (isSizedString) { if (!XPCConvert::JSStringWithSize2Native(ccx, (void*)&pv->val, val, - array_count, array_count, - datum_type, nsnull)) + array_count, datum_type, + nsnull)) break; } else { if (!XPCConvert::JSData2Native(ccx, &pv->val, val, type, @@ -1722,8 +1717,9 @@ pre_call_clean_up: 1, &datum_type)) && datum_type.IsPointer() && GetArraySizeFromParam(cx, info, param, methodIndex, - k, GET_LENGTH, nativeParams, - &array_count) && array_count) { + k, nativeParams, &array_count) && + array_count) { + CleanupPointerArray(datum_type, array_count, pp); } nsMemory::Free(pp); diff --git a/js/xpconnect/src/XPCWrappedNative.cpp b/js/xpconnect/src/XPCWrappedNative.cpp index ad1acdcbe96..6743681e381 100644 --- a/js/xpconnect/src/XPCWrappedNative.cpp +++ b/js/xpconnect/src/XPCWrappedNative.cpp @@ -2026,26 +2026,8 @@ class CallMethodHelper jsval* const mArgv; const PRUint32 mArgc; - enum SizeMode { - eGetSize, - eGetLength - }; - JS_ALWAYS_INLINE JSBool - GetArrayInfoFromParam(uint8 paramIndex, SizeMode mode, - JSUint32* result) const; - - JSBool - GetArraySizeFromParam(uint8 paramIndex, JSUint32* result) const - { - return GetArrayInfoFromParam(paramIndex, eGetSize, result); - } - - JSBool - GetArrayLengthFromParam(uint8 paramIndex, JSUint32* result) const - { - return GetArrayInfoFromParam(paramIndex, eGetLength, result); - } + GetArraySizeFromParam(uint8 paramIndex, JSUint32* result) const; JS_ALWAYS_INLINE JSBool GetInterfaceTypeFromParam(uint8 paramIndex, @@ -2270,7 +2252,7 @@ CallMethodHelper::~CallMethodHelper() } JSBool -CallMethodHelper::GetArrayInfoFromParam(uint8 paramIndex, SizeMode mode, +CallMethodHelper::GetArraySizeFromParam(uint8 paramIndex, JSUint32* result) const { nsresult rv; @@ -2278,10 +2260,7 @@ CallMethodHelper::GetArrayInfoFromParam(uint8 paramIndex, SizeMode mode, // TODO fixup the various exceptions that are thrown - if (mode == eGetSize) - rv = mIFaceInfo->GetSizeIsArgNumberForParam(mVTableIndex, ¶mInfo, 0, ¶mIndex); - else - rv = mIFaceInfo->GetLengthIsArgNumberForParam(mVTableIndex, ¶mInfo, 0, ¶mIndex); + rv = mIFaceInfo->GetSizeIsArgNumberForParam(mVTableIndex, ¶mInfo, 0, ¶mIndex); if (NS_FAILED(rv)) return Throw(NS_ERROR_XPC_CANT_GET_ARRAY_INFO, mCallContext); @@ -2700,7 +2679,6 @@ CallMethodHelper::ConvertDependentParams() nsXPTType datum_type; JSUint32 array_count; - JSUint32 array_capacity; bool isArray = type.IsArray(); bool isSizedString = isArray ? @@ -2764,16 +2742,14 @@ CallMethodHelper::ConvertDependentParams() uintN err; if (isArray || isSizedString) { - if (!GetArraySizeFromParam(i, &array_capacity) || - !GetArrayLengthFromParam(i, &array_count)) + if (!GetArraySizeFromParam(i, &array_count)) return JS_FALSE; if (isArray) { if (array_count && !XPCConvert::JSArray2Native(mCallContext, (void**)&dp->val, src, - array_count, array_capacity, - datum_type, - ¶m_iid, &err)) { + array_count, datum_type, ¶m_iid, + &err)) { // XXX need exception scheme for arrays to indicate bad element ThrowBadParam(err, i, mCallContext); return JS_FALSE; @@ -2782,8 +2758,7 @@ CallMethodHelper::ConvertDependentParams() { if (!XPCConvert::JSStringWithSize2Native(mCallContext, (void*)&dp->val, - src, - array_count, array_capacity, + src, array_count, datum_type, &err)) { ThrowBadParam(err, i, mCallContext); return JS_FALSE; diff --git a/js/xpconnect/src/xpcprivate.h b/js/xpconnect/src/xpcprivate.h index 8bc15d22157..5ce3f9a51ee 100644 --- a/js/xpconnect/src/xpcprivate.h +++ b/js/xpconnect/src/xpcprivate.h @@ -2926,14 +2926,11 @@ private: {if (b) mDescriptors[i/32] |= (1 << (i%32)); else mDescriptors[i/32] &= ~(1 << (i%32));} - enum SizeMode {GET_SIZE, GET_LENGTH}; - JSBool GetArraySizeFromParam(JSContext* cx, const XPTMethodDescriptor* method, const nsXPTParamInfo& param, uint16 methodIndex, uint8 paramIndex, - SizeMode mode, nsXPTCMiniVariant* params, JSUint32* result); @@ -3319,9 +3316,8 @@ public: JSUint32 count, nsresult* pErr); static JSBool JSArray2Native(XPCCallContext& ccx, void** d, jsval s, - JSUint32 count, JSUint32 capacity, - const nsXPTType& type, const nsID* iid, - uintN* pErr); + JSUint32 count, const nsXPTType& type, + const nsID* iid, uintN* pErr); static JSBool NativeStringWithSize2JS(JSContext* cx, jsval* d, const void* s, @@ -3330,8 +3326,8 @@ public: nsresult* pErr); static JSBool JSStringWithSize2Native(XPCCallContext& ccx, void* d, jsval s, - JSUint32 count, JSUint32 capacity, - const nsXPTType& type, uintN* pErr); + JSUint32 count, const nsXPTType& type, + uintN* pErr); static nsresult JSValToXPCException(XPCCallContext& ccx, jsval s, diff --git a/layout/base/nsPresContext.cpp b/layout/base/nsPresContext.cpp index 60f370d2c19..e1587dbbcc1 100644 --- a/layout/base/nsPresContext.cpp +++ b/layout/base/nsPresContext.cpp @@ -97,10 +97,7 @@ #include "nsIFrameMessageManager.h" #include "FrameLayerBuilder.h" #include "nsDOMMediaQueryList.h" - -#ifdef MOZ_SMIL #include "nsSMILAnimationController.h" -#endif // MOZ_SMIL #ifdef IBMBIDI #include "nsBidiPresUtils.h" @@ -1208,7 +1205,6 @@ void nsPresContext::SetImgAnimations(nsIContent *aParent, PRUint16 aMode) } } -#ifdef MOZ_SMIL void nsPresContext::SetSMILAnimations(nsIDocument *aDoc, PRUint16 aNewMode, PRUint16 aOldMode) @@ -1230,7 +1226,6 @@ nsPresContext::SetSMILAnimations(nsIDocument *aDoc, PRUint16 aNewMode, } } } -#endif // MOZ_SMIL void nsPresContext::SetImageAnimationModeInternal(PRUint16 aMode) @@ -1256,10 +1251,7 @@ nsPresContext::SetImageAnimationModeInternal(PRUint16 aMode) if (rootElement) { SetImgAnimations(rootElement, aMode); } - -#ifdef MOZ_SMIL SetSMILAnimations(doc, aMode, mImageAnimationMode); -#endif // MOZ_SMIL } } diff --git a/layout/base/nsPresContext.h b/layout/base/nsPresContext.h index fa089302b1b..ecd01d831b3 100644 --- a/layout/base/nsPresContext.h +++ b/layout/base/nsPresContext.h @@ -992,10 +992,8 @@ protected: 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); diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index d09cef11145..86be9178375 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -149,9 +149,7 @@ #ifdef MOZ_MEDIA #include "nsHTMLMediaElement.h" #endif -#ifdef MOZ_SMIL #include "nsSMILAnimationController.h" -#endif #include "nsRefreshDriver.h" @@ -1124,12 +1122,10 @@ PresShell::Init(nsIDocument* aDocument, } #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(); @@ -1254,11 +1250,9 @@ PresShell::Destroy() 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 @@ -4044,12 +4038,10 @@ PresShell::FlushPendingNotifications(mozFlushType aType) // reflow). mPresContext->FlushUserFontSet(); -#ifdef MOZ_SMIL // Flush any requested SMIL samples. if (mDocument->HasAnimationController()) { mDocument->GetAnimationController()->FlushResampleRequests(); } -#endif // MOZ_SMIL nsAutoScriptBlocker scriptBlocker; mFrameConstructor->CreateNeededFrames(); diff --git a/layout/base/tests/Makefile.in b/layout/base/tests/Makefile.in index 16154bf6e3d..4b58fa5097a 100644 --- a/layout/base/tests/Makefile.in +++ b/layout/base/tests/Makefile.in @@ -162,9 +162,14 @@ _TEST_FILES = \ test_bug548545.xhtml \ test_bug558663.html \ test_bug559499.html \ + test_bug569520.html \ test_bug582181-1.html \ test_bug582181-2.html \ + test_bug588174.html \ + test_bug607529.html \ + file_bug607529.html \ test_bug677878.html \ + test_bug696020.html \ test_flush_on_paint.html \ test_mozPaintCount.html \ test_scroll_selection_into_view.html \ @@ -179,10 +184,17 @@ _TEST_FILES = \ # Tests for bugs 441782, 467672 and 570378 don't pass reliably on Windows, because of bug 469208 ifeq (,$(filter windows,$(MOZ_WIDGET_TOOLKIT))) +# THESE TESTS (BELOW) DO NOT RUN ON WINDOWS _TEST_FILES += \ bidi_numeral_test.js \ + $(NULL) +# THESE TESTS (ABOVE AND BELOW) DO NOT RUN ON WINDOWS +_TEST_FILES += \ test_bug332655-1.html \ test_bug332655-2.html \ + $(NULL) +# THESE TESTS (ABOVE AND BELOW) DO NOT RUN ON WINDOWS +_TEST_FILES += \ test_bug441782-1a.html \ test_bug441782-1b.html \ test_bug441782-1c.html \ @@ -218,6 +230,9 @@ _TEST_FILES += \ test_bug441782-5e.html \ bug441782-5.html \ bug441782-5-ref.html \ + $(NULL) +# THESE TESTS (ABOVE AND BELOW) DO NOT RUN ON WINDOWS +_TEST_FILES += \ test_bug467672-1a.html \ test_bug467672-1b.html \ test_bug467672-1c.html \ @@ -263,8 +278,13 @@ _TEST_FILES += \ test_bug467672-5g.html \ bug467672-5.html \ bug467672-5-ref.html \ + $(NULL) +# THESE TESTS (ABOVE AND BELOW) DO NOT RUN ON WINDOWS +_TEST_FILES += \ test_bug499538-1.html \ - test_bug569520.html \ + $(NULL) +# THESE TESTS (ABOVE AND BELOW) DO NOT RUN ON WINDOWS +_TEST_FILES += \ test_bug570378-arabic-1a.html \ test_bug570378-arabic-1b.html \ test_bug570378-arabic-1c.html \ @@ -345,12 +365,12 @@ _TEST_FILES += \ test_bug570378-persian-5g.html \ bug570378-persian-5.html \ bug570378-persian-5-ref.html \ - test_bug588174.html \ - test_bug607529.html \ - file_bug607529.html \ - test_bug644768.html \ - test_bug696020.html \ $(NULL) +# THESE TESTS (ABOVE AND BELOW) DO NOT RUN ON WINDOWS +_TEST_FILES += \ + test_bug644768.html \ + $(NULL) +# THESE TESTS (ABOVE) DO NOT RUN ON WINDOWS endif _BROWSER_FILES = \ diff --git a/layout/generic/nsHTMLReflowState.cpp b/layout/generic/nsHTMLReflowState.cpp index 59bf434d088..1aa9822f17d 100644 --- a/layout/generic/nsHTMLReflowState.cpp +++ b/layout/generic/nsHTMLReflowState.cpp @@ -55,8 +55,6 @@ #include "nsIServiceManager.h" #include "nsIPercentHeightObserver.h" #include "nsLayoutUtils.h" -#include "nsPlaceholderFrame.h" -#include "nsFrameManager.h" #include "mozilla/Preferences.h" #ifdef IBMBIDI #include "nsBidiUtils.h" @@ -851,7 +849,7 @@ static bool AreAllEarlierInFlowFramesEmpty(nsIFrame* aFrame, // cbrs->frame is the actual containing block void nsHTMLReflowState::CalculateHypotheticalBox(nsPresContext* aPresContext, - nsPlaceholderFrame* aPlaceholderFrame, + nsIFrame* aPlaceholderFrame, nsIFrame* aContainingBlock, nscoord aBlockLeftContentEdge, nscoord aBlockContentWidth, @@ -934,12 +932,17 @@ nsHTMLReflowState::CalculateHypotheticalBox(nsPresContext* aPresContext, nsLayoutUtils::GetAsBlock(aContainingBlock->GetContentInsertionFrame()); if (blockFrame) { nscoord blockYOffset = blockFrame->GetOffsetTo(aContainingBlock).y; - const nsLineBox* lineBox = aPlaceholderFrame->GetCachedLineBox(); - if (!lineBox) { + bool isValid; + nsBlockInFlowLineIterator iter(blockFrame, aPlaceholderFrame, &isValid); + if (!isValid) { // Give up. We're probably dealing with somebody using // position:absolute inside native-anonymous content anyway. aHypotheticalBox.mTop = placeholderOffset.y; } else { + NS_ASSERTION(iter.GetContainer() == blockFrame, + "Found placeholder in wrong block!"); + nsBlockFrame::line_iterator lineBox = iter.GetLine(); + // How we determine the hypothetical box depends on whether the element // would have been inline-level or block-level if (mStyleDisplay->IsOriginalDisplayInlineOutside()) { @@ -953,10 +956,10 @@ nsHTMLReflowState::CalculateHypotheticalBox(nsPresContext* aPresContext, // have been just before this line. // XXXbz the line box is not fully reflowed yet if our // containing block is relatively positioned... - bool allEmpty = true; - if (!lineBox->IsValidCachedIsEmpty() || !lineBox->CachedIsEmpty()) { + if (lineBox != iter.End()) { nsIFrame * firstFrame = lineBox->mFirstChild; bool found = false; + bool allEmpty = true; while (firstFrame) { // See bug 223064 allEmpty = AreAllEarlierInFlowFramesEmpty(firstFrame, aPlaceholderFrame, &found); @@ -965,17 +968,20 @@ nsHTMLReflowState::CalculateHypotheticalBox(nsPresContext* aPresContext, firstFrame = firstFrame->GetNextSibling(); } NS_ASSERTION(firstFrame, "Couldn't find placeholder!"); - } - if (allEmpty) { - // The top of the hypothetical box is the top of the line - // containing the placeholder, since there is nothing in the - // line before our placeholder except empty frames. - aHypotheticalBox.mTop = lineBox->mBounds.y + blockYOffset; + if (allEmpty) { + // The top of the hypothetical box is the top of the line + // containing the placeholder, since there is nothing in the + // line before our placeholder except empty frames. + aHypotheticalBox.mTop = lineBox->mBounds.y + blockYOffset; + } else { + // The top of the hypothetical box is just below the line + // containing the placeholder. + aHypotheticalBox.mTop = lineBox->mBounds.YMost() + blockYOffset; + } } else { - // The top of the hypothetical box is just below the line - // containing the placeholder. - aHypotheticalBox.mTop = lineBox->mBounds.YMost() + blockYOffset; + // Just use the placeholder's y-offset wrt the containing block + aHypotheticalBox.mTop = placeholderOffset.y; } } } @@ -1101,10 +1107,9 @@ nsHTMLReflowState::InitAbsoluteConstraints(nsPresContext* aPresContext, "Why are we here?"); // Get the placeholder frame - nsPlaceholderFrame* placeholderFrame; + nsIFrame* placeholderFrame; - placeholderFrame = - aPresContext->PresShell()->FrameManager()->GetPlaceholderFrameFor(frame); + placeholderFrame = aPresContext->PresShell()->GetPlaceholderFrameFor(frame); NS_ASSERTION(nsnull != placeholderFrame, "no placeholder frame"); // If both 'left' and 'right' are 'auto' or both 'top' and 'bottom' are diff --git a/layout/generic/nsHTMLReflowState.h b/layout/generic/nsHTMLReflowState.h index 3f0cdb09d96..5b9281c072a 100644 --- a/layout/generic/nsHTMLReflowState.h +++ b/layout/generic/nsHTMLReflowState.h @@ -49,7 +49,6 @@ class nsRenderingContext; class nsFloatManager; class nsLineLayout; class nsIPercentHeightObserver; -class nsPlaceholderFrame; struct nsStyleDisplay; struct nsStyleVisibility; @@ -512,7 +511,7 @@ protected: nscoord& aCBWidth); void CalculateHypotheticalBox(nsPresContext* aPresContext, - nsPlaceholderFrame* aPlaceholderFrame, + nsIFrame* aPlaceholderFrame, nsIFrame* aContainingBlock, nscoord aBlockLeftContentEdge, nscoord aBlockContentWidth, diff --git a/layout/generic/nsLineBox.cpp b/layout/generic/nsLineBox.cpp index f8542387d0d..6e4010c8c62 100644 --- a/layout/generic/nsLineBox.cpp +++ b/layout/generic/nsLineBox.cpp @@ -289,7 +289,7 @@ nsLineBox::IsEmpty() const } bool -nsLineBox::CachedIsEmpty() const +nsLineBox::CachedIsEmpty() { if (mFlags.mDirty) { return IsEmpty(); diff --git a/layout/generic/nsLineBox.h b/layout/generic/nsLineBox.h index 369c73858d5..82c63ff5caf 100644 --- a/layout/generic/nsLineBox.h +++ b/layout/generic/nsLineBox.h @@ -486,14 +486,14 @@ public: // Call this only while in Reflow() for the block the line belongs // to, only between reflowing the line (or sliding it, if we skip // reflowing it) and the end of reflowing the block. - bool CachedIsEmpty() const; + bool CachedIsEmpty(); void InvalidateCachedIsEmpty() { mFlags.mEmptyCacheValid = false; } // For debugging purposes - bool IsValidCachedIsEmpty() const { + bool IsValidCachedIsEmpty() { return mFlags.mEmptyCacheValid; } @@ -514,8 +514,8 @@ public: PRUint32 mLineWrapped: 1; PRUint32 mInvalidateTextRuns : 1; PRUint32 mResizeReflowOptimizationDisabled: 1; // default 0 = means that the opt potentially applies to this line. 1 = never skip reflowing this line for a resize reflow - mutable PRUint32 mEmptyCacheValid: 1; - mutable PRUint32 mEmptyCacheState: 1; + PRUint32 mEmptyCacheValid: 1; + PRUint32 mEmptyCacheState: 1; // mHasBullet indicates that this is an inline line whose block's // bullet is adjacent to this line and non-empty. PRUint32 mHasBullet : 1; diff --git a/layout/generic/nsPlaceholderFrame.cpp b/layout/generic/nsPlaceholderFrame.cpp index c86bcc9a9fa..6e7ec72759e 100644 --- a/layout/generic/nsPlaceholderFrame.cpp +++ b/layout/generic/nsPlaceholderFrame.cpp @@ -145,15 +145,6 @@ nsPlaceholderFrame::Reflow(nsPresContext* aPresContext, aDesiredSize.width = 0; aDesiredSize.height = 0; - // Cache our line box. - mCachedLineBox = nsnull; - if (aReflowState.mLineLayout) { - nsLineList::iterator* line = aReflowState.mLineLayout->GetLine(); - if (line) { - mCachedLineBox = line->get(); - } - } - aStatus = NS_FRAME_COMPLETE; NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize); return NS_OK; diff --git a/layout/generic/nsPlaceholderFrame.h b/layout/generic/nsPlaceholderFrame.h index 82e5c4e0246..e53d44e5af0 100644 --- a/layout/generic/nsPlaceholderFrame.h +++ b/layout/generic/nsPlaceholderFrame.h @@ -69,8 +69,6 @@ #include "nsFrame.h" #include "nsGkAtoms.h" -class nsLineBox; - nsIFrame* NS_NewPlaceholderFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsFrameState aTypeBit); @@ -202,17 +200,8 @@ public: return outOfFlow; } - // GetCachedLineBox is only OK to call if you're sure this - // placeholder has has Reflow() called since any changes to the - // frame tree that could have affected which line box the - // placeholder is in. - const nsLineBox* GetCachedLineBox() const { - return mCachedLineBox; - } - protected: nsIFrame* mOutOfFlowFrame; - nsLineBox* mCachedLineBox; }; #endif /* nsPlaceholderFrame_h___ */ diff --git a/layout/style/nsDOMCSSAttrDeclaration.cpp b/layout/style/nsDOMCSSAttrDeclaration.cpp index 70f44d54d96..ac9a50ee851 100644 --- a/layout/style/nsDOMCSSAttrDeclaration.cpp +++ b/layout/style/nsDOMCSSAttrDeclaration.cpp @@ -53,15 +53,10 @@ 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); @@ -88,9 +83,7 @@ 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"); @@ -101,9 +94,7 @@ nsDOMCSSAttributeDeclaration::SetCSSDeclaration(css::Declaration* aDecl) } return -#ifdef MOZ_SMIL mIsSMILOverride ? mElement->SetSMILOverrideStyleRule(newRule, true) : -#endif // MOZ_SMIL mElement->SetInlineStyleRule(newRule, true); } @@ -114,10 +105,7 @@ nsDOMCSSAttributeDeclaration::DocToUpdate() // 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); @@ -135,11 +123,9 @@ nsDOMCSSAttributeDeclaration::GetCSSDeclaration(bool aAllocate) return nsnull; css::StyleRule* cssRule; -#ifdef MOZ_SMIL if (mIsSMILOverride) cssRule = mElement->GetSMILOverrideStyleRule(); else -#endif // MOZ_SMIL cssRule = mElement->GetInlineStyleRule(); if (cssRule) { @@ -156,11 +142,9 @@ nsDOMCSSAttributeDeclaration::GetCSSDeclaration(bool aAllocate) // 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)) { diff --git a/layout/style/nsDOMCSSAttrDeclaration.h b/layout/style/nsDOMCSSAttrDeclaration.h index fb692839fc4..fbe96390ad9 100644 --- a/layout/style/nsDOMCSSAttrDeclaration.h +++ b/layout/style/nsDOMCSSAttrDeclaration.h @@ -62,11 +62,7 @@ class nsDOMCSSAttributeDeclaration : public nsDOMCSSDeclaration, { 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 @@ -87,13 +83,11 @@ protected: nsRefPtr 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 */ diff --git a/layout/style/nsHTMLCSSStyleSheet.cpp b/layout/style/nsHTMLCSSStyleSheet.cpp index a96475b7add..8877e5383ec 100644 --- a/layout/style/nsHTMLCSSStyleSheet.cpp +++ b/layout/style/nsHTMLCSSStyleSheet.cpp @@ -81,7 +81,6 @@ nsHTMLCSSStyleSheet::RulesMatching(ElementRuleProcessorData* aData) aData->mRuleWalker->Forward(rule); } -#ifdef MOZ_SMIL rule = element->GetSMILOverrideStyleRule(); if (rule) { if (aData->mPresContext->IsProcessingRestyles() && @@ -98,7 +97,6 @@ nsHTMLCSSStyleSheet::RulesMatching(ElementRuleProcessorData* aData) aData->mRuleWalker->Forward(rule); } } -#endif // MOZ_SMIL } /* virtual */ void diff --git a/layout/svg/base/src/nsSVGUtils.cpp b/layout/svg/base/src/nsSVGUtils.cpp index 40f4f659a78..4e94208dfc9 100644 --- a/layout/svg/base/src/nsSVGUtils.cpp +++ b/layout/svg/base/src/nsSVGUtils.cpp @@ -166,12 +166,9 @@ static const PRUint8 gsRGBToLinearRGBMap[256] = { 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) { @@ -195,7 +192,6 @@ NS_SMILEnabled() return gSMILEnabled; } -#endif // MOZ_SMIL nsSVGSVGElement* nsSVGUtils::GetOuterSVGElement(nsSVGElement *aSVGElement) diff --git a/layout/svg/base/src/nsSVGUtils.h b/layout/svg/base/src/nsSVGUtils.h index 7e7f621a912..9dafbd628b5 100644 --- a/layout/svg/base/src/nsSVGUtils.h +++ b/layout/svg/base/src/nsSVGUtils.h @@ -139,13 +139,11 @@ IsSVGWhitespace(PRUnichar aChar) 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 diff --git a/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp b/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp index c791012ddfd..f323f9ebcb0 100644 --- a/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp +++ b/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp @@ -1389,8 +1389,8 @@ nsTreeBodyFrame::AdjustForCellText(nsAutoString& aText, // Crop right. nscoord cwidth; nscoord twidth = 0; - int length = aText.Length(); - int i; + PRUint32 length = aText.Length(); + PRUint32 i; for (i = 0; i < length; ++i) { PRUnichar ch = aText[i]; // XXX this is horrible and doesn't handle clusters @@ -1408,8 +1408,8 @@ nsTreeBodyFrame::AdjustForCellText(nsAutoString& aText, // Crop left. nscoord cwidth; nscoord twidth = 0; - int length = aText.Length(); - int i; + PRInt32 length = aText.Length(); + PRInt32 i; for (i=length-1; i >= 0; --i) { PRUnichar ch = aText[i]; cwidth = aRenderingContext.GetWidth(ch); @@ -1430,9 +1430,9 @@ nsTreeBodyFrame::AdjustForCellText(nsAutoString& aText, // Crop center. nsAutoString leftStr, rightStr; nscoord cwidth, twidth = 0; - int length = aText.Length(); - int rightPos = length - 1; - for (int leftPos = 0; leftPos < rightPos; ++leftPos) { + PRInt32 length = aText.Length(); + PRInt32 rightPos = length - 1; + for (PRInt32 leftPos = 0; leftPos < rightPos; ++leftPos) { PRUnichar ch = aText[leftPos]; cwidth = aRenderingContext.GetWidth(ch); twidth += cwidth; diff --git a/mobile/chrome/content/BookmarkPopup.js b/mobile/chrome/content/BookmarkPopup.js index 2407c80370e..451dbf29715 100644 --- a/mobile/chrome/content/BookmarkPopup.js +++ b/mobile/chrome/content/BookmarkPopup.js @@ -47,6 +47,13 @@ var BookmarkPopup = { this.hide(); let browser = getBrowser(); - Util.createShortcut(browser.contentTitle, browser.currentURI.spec, browser.mIconURL, "bookmark"); + let itemId = PlacesUtils.getMostRecentBookmarkForURI(browser.currentURI); + let title = ""; + if (itemId == -1) + title = browser.contentTitle; + else + title = PlacesUtils.bookmarks.getItemTitle(itemId); + + Util.createShortcut(title, browser.currentURI.spec, browser.mIconURL, "bookmark"); } }; diff --git a/mobile/chrome/tests/Makefile.in b/mobile/chrome/tests/Makefile.in index 70d82341506..37a0cbd945c 100644 --- a/mobile/chrome/tests/Makefile.in +++ b/mobile/chrome/tests/Makefile.in @@ -58,8 +58,8 @@ _BROWSER_FILES = \ browser_addons.js \ browser_addons_locales.js \ browser_appmenu.js \ - browser_autocompletesearch.js\ - browser_awesomescreen.js \ + browser_autocompletesearch.js \ + $(info browser_awesomescreen.js is disabled because the localepicker is disabled (bug 693524)) \ browser_blank_01.html \ browser_blank_02.html \ browser_blank_03.html \ diff --git a/mobile/installer/package-manifest.in b/mobile/installer/package-manifest.in index 64a78adbc6e..36f73ddf081 100644 --- a/mobile/installer/package-manifest.in +++ b/mobile/installer/package-manifest.in @@ -300,8 +300,6 @@ @BINPATH@/components/toolkitsearch.manifest @BINPATH@/components/nsSearchService.js @BINPATH@/components/nsSearchSuggestions.js -@BINPATH@/components/nsTryToClose.manifest -@BINPATH@/components/nsTryToClose.js @BINPATH@/components/passwordmgr.manifest @BINPATH@/components/nsLoginInfo.js @BINPATH@/components/nsLoginManager.js @@ -510,9 +508,7 @@ ; svg @BINPATH@/res/svg.css @BINPATH@/components/dom_svg.xpt -#ifdef MOZ_SMIL @BINPATH@/components/dom_smil.xpt -#endif ; [Personal Security Manager] ; diff --git a/mobile/installer/removed-files.in b/mobile/installer/removed-files.in index 9aa1a4bf996..25a1e83f6e2 100644 --- a/mobile/installer/removed-files.in +++ b/mobile/installer/removed-files.in @@ -1,4 +1,5 @@ README.txt +components/nsTryToClose.js #if MOZ_UPDATE_CHANNEL != beta extensions/feedback@mobile.mozilla.org.xpi #endif diff --git a/modules/libpref/public/Preferences.h b/modules/libpref/public/Preferences.h index aa2cce97597..ad356efae94 100644 --- a/modules/libpref/public/Preferences.h +++ b/modules/libpref/public/Preferences.h @@ -369,7 +369,7 @@ private: /** * Init static members. TRUE if it succeeded. Otherwise, FALSE. */ - static bool InitStaticMembers(bool aForService = false); + static bool InitStaticMembers(); }; } // namespace mozilla diff --git a/modules/libpref/src/Preferences.cpp b/modules/libpref/src/Preferences.cpp index 45833c7fa64..c2bceeb7fa7 100644 --- a/modules/libpref/src/Preferences.cpp +++ b/modules/libpref/src/Preferences.cpp @@ -203,29 +203,6 @@ Preferences::GetInstanceForService() NS_ENSURE_TRUE(!sShutdown, nsnull); - InitStaticMembers(true); - NS_IF_ADDREF(sPreferences); - return sPreferences; -} - -// static -bool -Preferences::InitStaticMembers(bool aForService) -{ - if (sShutdown || sPreferences) { - return sPreferences != nsnull; - } - - // If InitStaticMembers() isn't called for getting nsIPrefService, - // some global components needed by Preferences::Init() may not have been - // initialized yet. Therefore, we must create the singleton instance via - // service manager. - if (!aForService) { - nsCOMPtr prefService = - do_GetService(NS_PREFSERVICE_CONTRACTID); - return sPreferences != nsnull; - } - sRootBranch = new nsPrefBranch("", false); NS_ADDREF(sRootBranch); sDefaultRootBranch = new nsPrefBranch("", true); @@ -237,7 +214,7 @@ Preferences::InitStaticMembers(bool aForService) if (NS_FAILED(sPreferences->Init())) { // The singleton instance will delete sRootBranch and sDefaultRootBranch. NS_RELEASE(sPreferences); - return false; + return nsnull; } gCacheData = new nsTArray >(); @@ -245,14 +222,27 @@ Preferences::InitStaticMembers(bool aForService) gObserverTable = new nsRefPtrHashtable(); gObserverTable->Init(); - return true; + NS_ADDREF(sPreferences); + return sPreferences; +} + +// static +bool +Preferences::InitStaticMembers() +{ + if (!sShutdown && !sPreferences) { + nsCOMPtr prefService = + do_GetService(NS_PREFSERVICE_CONTRACTID); + } + + return sPreferences != nsnull; } // static void Preferences::Shutdown() { - if (!sShutdown ) { + if (!sShutdown) { sShutdown = true; // Don't create the singleton instance after here. // Don't set NULL to sPreferences here. The instance may be grabbed by @@ -348,7 +338,7 @@ Preferences::Init() * category which will do the rest. */ - rv = sRootBranch->GetCharPref("general.config.filename", getter_Copies(lockFileName)); + rv = PREF_CopyCharPref("general.config.filename", getter_Copies(lockFileName), false); if (NS_SUCCEEDED(rv)) NS_CreateServicesFromCategory("pref-config-startup", static_cast(static_cast(this)), @@ -1129,7 +1119,7 @@ Preferences::GetBool(const char* aPref, bool* aResult) { NS_PRECONDITION(aResult, "aResult must not be NULL"); NS_ENSURE_TRUE(InitStaticMembers(), NS_ERROR_NOT_AVAILABLE); - return sRootBranch->GetBoolPref(aPref, aResult); + return PREF_GetBoolPref(aPref, aResult, false); } // static @@ -1138,7 +1128,7 @@ Preferences::GetInt(const char* aPref, PRInt32* aResult) { NS_PRECONDITION(aResult, "aResult must not be NULL"); NS_ENSURE_TRUE(InitStaticMembers(), NS_ERROR_NOT_AVAILABLE); - return sRootBranch->GetIntPref(aPref, aResult); + return PREF_GetIntPref(aPref, aResult, false); } // static @@ -1146,7 +1136,7 @@ nsAdoptingCString Preferences::GetCString(const char* aPref) { nsAdoptingCString result; - GetCString(aPref, &result); + PREF_CopyCharPref(aPref, getter_Copies(result), false); return result; } @@ -1166,7 +1156,7 @@ Preferences::GetCString(const char* aPref, nsACString* aResult) NS_PRECONDITION(aResult, "aResult must not be NULL"); NS_ENSURE_TRUE(InitStaticMembers(), NS_ERROR_NOT_AVAILABLE); nsCAutoString result; - nsresult rv = sRootBranch->GetCharPref(aPref, getter_Copies(result)); + nsresult rv = PREF_CopyCharPref(aPref, getter_Copies(result), false); if (NS_SUCCEEDED(rv)) { *aResult = result; } @@ -1180,7 +1170,7 @@ Preferences::GetString(const char* aPref, nsAString* aResult) NS_PRECONDITION(aResult, "aResult must not be NULL"); NS_ENSURE_TRUE(InitStaticMembers(), NS_ERROR_NOT_AVAILABLE); nsCAutoString result; - nsresult rv = sRootBranch->GetCharPref(aPref, getter_Copies(result)); + nsresult rv = PREF_CopyCharPref(aPref, getter_Copies(result), false); if (NS_SUCCEEDED(rv)) { CopyUTF8toUTF16(result, *aResult); } @@ -1247,47 +1237,54 @@ Preferences::GetComplex(const char* aPref, const nsIID &aType, void** aResult) nsresult Preferences::SetCString(const char* aPref, const char* aValue) { + NS_ENSURE_TRUE(XRE_GetProcessType() == GeckoProcessType_Default, NS_ERROR_NOT_AVAILABLE); NS_ENSURE_TRUE(InitStaticMembers(), NS_ERROR_NOT_AVAILABLE); - return sRootBranch->SetCharPref(aPref, aValue); + return PREF_SetCharPref(aPref, aValue, false); } // static nsresult Preferences::SetCString(const char* aPref, const nsACString &aValue) { - return SetCString(aPref, PromiseFlatCString(aValue).get()); + NS_ENSURE_TRUE(XRE_GetProcessType() == GeckoProcessType_Default, NS_ERROR_NOT_AVAILABLE); + NS_ENSURE_TRUE(InitStaticMembers(), NS_ERROR_NOT_AVAILABLE); + return PREF_SetCharPref(aPref, PromiseFlatCString(aValue).get(), false); } // static nsresult Preferences::SetString(const char* aPref, const PRUnichar* aValue) { - NS_ConvertUTF16toUTF8 utf8(aValue); - return SetCString(aPref, utf8.get()); + NS_ENSURE_TRUE(XRE_GetProcessType() == GeckoProcessType_Default, NS_ERROR_NOT_AVAILABLE); + NS_ENSURE_TRUE(InitStaticMembers(), NS_ERROR_NOT_AVAILABLE); + return PREF_SetCharPref(aPref, NS_ConvertUTF16toUTF8(aValue).get(), false); } // static nsresult Preferences::SetString(const char* aPref, const nsAString &aValue) { - NS_ConvertUTF16toUTF8 utf8(aValue); - return SetCString(aPref, utf8.get()); + NS_ENSURE_TRUE(XRE_GetProcessType() == GeckoProcessType_Default, NS_ERROR_NOT_AVAILABLE); + NS_ENSURE_TRUE(InitStaticMembers(), NS_ERROR_NOT_AVAILABLE); + return PREF_SetCharPref(aPref, NS_ConvertUTF16toUTF8(aValue).get(), false); } // static nsresult Preferences::SetBool(const char* aPref, bool aValue) { + NS_ENSURE_TRUE(XRE_GetProcessType() == GeckoProcessType_Default, NS_ERROR_NOT_AVAILABLE); NS_ENSURE_TRUE(InitStaticMembers(), NS_ERROR_NOT_AVAILABLE); - return sRootBranch->SetBoolPref(aPref, aValue); + return PREF_SetBoolPref(aPref, aValue, false); } // static nsresult Preferences::SetInt(const char* aPref, PRInt32 aValue) { + NS_ENSURE_TRUE(XRE_GetProcessType() == GeckoProcessType_Default, NS_ERROR_NOT_AVAILABLE); NS_ENSURE_TRUE(InitStaticMembers(), NS_ERROR_NOT_AVAILABLE); - return sRootBranch->SetIntPref(aPref, aValue); + return PREF_SetIntPref(aPref, aValue, false); } // static @@ -1303,8 +1300,9 @@ Preferences::SetComplex(const char* aPref, const nsIID &aType, nsresult Preferences::ClearUser(const char* aPref) { + NS_ENSURE_TRUE(XRE_GetProcessType() == GeckoProcessType_Default, NS_ERROR_NOT_AVAILABLE); NS_ENSURE_TRUE(InitStaticMembers(), NS_ERROR_NOT_AVAILABLE); - return sRootBranch->ClearUserPref(aPref); + return PREF_ClearUserPref(aPref); } // static @@ -1312,12 +1310,7 @@ bool Preferences::HasUserValue(const char* aPref) { NS_ENSURE_TRUE(InitStaticMembers(), false); - bool hasUserValue; - nsresult rv = sRootBranch->PrefHasUserValue(aPref, &hasUserValue); - if (NS_FAILED(rv)) { - return false; - } - return hasUserValue; + return PREF_HasUserPref(aPref); } // static @@ -1514,25 +1507,28 @@ Preferences::AddUintVarCache(PRUint32* aCache, nsresult Preferences::GetDefaultBool(const char* aPref, bool* aResult) { + NS_PRECONDITION(aResult, "aResult must not be NULL"); NS_ENSURE_TRUE(InitStaticMembers(), NS_ERROR_NOT_AVAILABLE); - return sDefaultRootBranch->GetBoolPref(aPref, aResult); + return PREF_GetBoolPref(aPref, aResult, true); } // static nsresult Preferences::GetDefaultInt(const char* aPref, PRInt32* aResult) { + NS_PRECONDITION(aResult, "aResult must not be NULL"); NS_ENSURE_TRUE(InitStaticMembers(), NS_ERROR_NOT_AVAILABLE); - return sDefaultRootBranch->GetIntPref(aPref, aResult); + return PREF_GetIntPref(aPref, aResult, true); } // static nsresult Preferences::GetDefaultCString(const char* aPref, nsACString* aResult) { + NS_PRECONDITION(aResult, "aResult must not be NULL"); NS_ENSURE_TRUE(InitStaticMembers(), NS_ERROR_NOT_AVAILABLE); nsCAutoString result; - nsresult rv = sDefaultRootBranch->GetCharPref(aPref, getter_Copies(result)); + nsresult rv = PREF_CopyCharPref(aPref, getter_Copies(result), true); if (NS_SUCCEEDED(rv)) { *aResult = result; } @@ -1543,9 +1539,10 @@ Preferences::GetDefaultCString(const char* aPref, nsACString* aResult) nsresult Preferences::GetDefaultString(const char* aPref, nsAString* aResult) { + NS_PRECONDITION(aResult, "aResult must not be NULL"); NS_ENSURE_TRUE(InitStaticMembers(), NS_ERROR_NOT_AVAILABLE); nsCAutoString result; - nsresult rv = sDefaultRootBranch->GetCharPref(aPref, getter_Copies(result)); + nsresult rv = PREF_CopyCharPref(aPref, getter_Copies(result), true); if (NS_SUCCEEDED(rv)) { CopyUTF8toUTF16(result, *aResult); } @@ -1597,7 +1594,7 @@ nsAdoptingCString Preferences::GetDefaultCString(const char* aPref) { nsAdoptingCString result; - GetDefaultCString(aPref, &result); + PREF_CopyCharPref(aPref, getter_Copies(result), true); return result; } diff --git a/parser/html/nsHtml5TokenizerCppSupplement.h b/parser/html/nsHtml5TokenizerCppSupplement.h index 2aac5f31b43..036a4be5003 100644 --- a/parser/html/nsHtml5TokenizerCppSupplement.h +++ b/parser/html/nsHtml5TokenizerCppSupplement.h @@ -176,7 +176,7 @@ nsHtml5Tokenizer::errNcrNonCharacter(PRUnichar ch) } void -nsHtml5Tokenizer::errAstralNonCharacter(int ch) +nsHtml5Tokenizer::errAstralNonCharacter(PRInt32 ch) { if (NS_UNLIKELY(mViewSource)) { mViewSource->AddErrorToCurrentNode("errNcrNonCharacter"); diff --git a/parser/html/nsHtml5TreeBuilderCppSupplement.h b/parser/html/nsHtml5TreeBuilderCppSupplement.h index d12a00b1f7c..6a2634161e2 100644 --- a/parser/html/nsHtml5TreeBuilderCppSupplement.h +++ b/parser/html/nsHtml5TreeBuilderCppSupplement.h @@ -884,7 +884,7 @@ void nsHtml5TreeBuilder::errBadStartTagInHead(nsIAtom* aName) { if (NS_UNLIKELY(mViewSource)) { - mViewSource->AddErrorToCurrentRun("errBadStartTagInHead", aName); + mViewSource->AddErrorToCurrentRun("errBadStartTagInHead2", aName); } } diff --git a/services/sync/tests/unit/test_errorhandler.js b/services/sync/tests/unit/test_errorhandler.js index 35732c654b2..666cbe4591f 100644 --- a/services/sync/tests/unit/test_errorhandler.js +++ b/services/sync/tests/unit/test_errorhandler.js @@ -120,6 +120,7 @@ function setUp() { Service.username = "johndoe"; Service.password = "ilovejane"; Service.passphrase = "abcdeabcdeabcdeabcdeabcdea"; + Service.serverURL = "http://localhost:8080/"; Service.clusterURL = "http://localhost:8080/"; return generateAndUploadKeys(); } diff --git a/services/sync/tests/unit/test_syncscheduler.js b/services/sync/tests/unit/test_syncscheduler.js index 8b9577d1741..2bad8597513 100644 --- a/services/sync/tests/unit/test_syncscheduler.js +++ b/services/sync/tests/unit/test_syncscheduler.js @@ -852,6 +852,7 @@ add_test(function test_loginError_recoverable_reschedules() { Service.username = "johndoe"; Service.password = "ilovejane"; Service.passphrase = "abcdeabcdeabcdeabcdeabcdea"; + Service.serverURL = "http://localhost:8080/"; Service.clusterURL = "http://localhost:8080/"; Service.persistLogin(); Status.resetSync(); // reset Status.login @@ -895,6 +896,7 @@ add_test(function test_loginError_fatal_clearsTriggers() { Service.username = "johndoe"; Service.password = "ilovejane"; Service.passphrase = "abcdeabcdeabcdeabcdeabcdea"; + Service.serverURL = "http://localhost:8080/"; Service.clusterURL = "http://localhost:8080/"; Service.persistLogin(); Status.resetSync(); // reset Status.login diff --git a/toolkit/components/places/tests/cpp/test_IHistory.cpp b/toolkit/components/places/tests/cpp/test_IHistory.cpp index 9560813eccb..07b19ec0ae9 100644 --- a/toolkit/components/places/tests/cpp/test_IHistory.cpp +++ b/toolkit/components/places/tests/cpp/test_IHistory.cpp @@ -363,9 +363,7 @@ namespace test_observer_topic_dispatched_helpers { do_check_true(visited || notVisited); // Check to make sure we got the state we expected. - if (visited != mExpectVisit) { - return NS_OK; - } + do_check_eq(visited, mExpectVisit); // Indicate that we've been notified. mNotified = true; diff --git a/toolkit/components/startup/Makefile.in b/toolkit/components/startup/Makefile.in index dc35a3d9557..ce24485be1e 100644 --- a/toolkit/components/startup/Makefile.in +++ b/toolkit/components/startup/Makefile.in @@ -66,8 +66,6 @@ endif endif endif -EXTRA_COMPONENTS = nsTryToClose.js nsTryToClose.manifest - ifdef ENABLE_TESTS ifneq (mobile,$(MOZ_BUILD_APP)) DIRS += tests/browser diff --git a/toolkit/components/startup/nsTryToClose.js b/toolkit/components/startup/nsTryToClose.js deleted file mode 100644 index ceca5f08c1b..00000000000 --- a/toolkit/components/startup/nsTryToClose.js +++ /dev/null @@ -1,75 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the nsTryToClose component. - * - * The Initial Developer of the Original Code is - * Mozilla Corporation - * Portions created by the Initial Developer are Copyright (C) 2006 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Michael Wu (original author) - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * 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 ***** */ - -const Cc = Components.classes; -const Ci = Components.interfaces; -const Cr = Components.results; - -Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); - -function TryToClose() {} - -TryToClose.prototype = { - observe: function (aSubject, aTopic, aData) { - switch (aTopic) { - case "app-startup": - var obsService = Cc["@mozilla.org/observer-service;1"]. - getService(Ci.nsIObserverService); - obsService.addObserver(this, "quit-application-requested", true); - break; - case "quit-application-requested": - var windowMediator = Cc['@mozilla.org/appshell/window-mediator;1']. - getService(Ci.nsIWindowMediator); - var enumerator = windowMediator.getEnumerator(null); - while (enumerator.hasMoreElements()) { - var domWindow = enumerator.getNext(); - if (("tryToClose" in domWindow) && !domWindow.tryToClose()) { - aSubject.QueryInterface(Ci.nsISupportsPRBool); - aSubject.data = true; - break; - } - } - break; - } - }, - - classID: Components.ID("{b69155f4-a8bf-453d-8653-91d1456e1d3d}"), - QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver, - Ci.nsISupportsWeakReference]), -}; - -var NSGetFactory = XPCOMUtils.generateNSGetFactory([TryToClose]); diff --git a/toolkit/components/startup/nsTryToClose.manifest b/toolkit/components/startup/nsTryToClose.manifest deleted file mode 100644 index 16d39e22050..00000000000 --- a/toolkit/components/startup/nsTryToClose.manifest +++ /dev/null @@ -1,3 +0,0 @@ -component {b69155f4-a8bf-453d-8653-91d1456e1d3d} nsTryToClose.js -contract @mozilla.org/appshell/trytoclose;1 {b69155f4-a8bf-453d-8653-91d1456e1d3d} -category app-startup nsTryToClose service,@mozilla.org/appshell/trytoclose;1 diff --git a/toolkit/mozapps/plugins/content/pluginProblemContent.css b/toolkit/mozapps/plugins/content/pluginProblemContent.css index 38076ab3c54..8f1fad30b53 100644 --- a/toolkit/mozapps/plugins/content/pluginProblemContent.css +++ b/toolkit/mozapps/plugins/content/pluginProblemContent.css @@ -46,7 +46,8 @@ html|applet:not([height]), html|applet[height=""] { :-moz-handler-disabled .msgDisabled, :-moz-handler-disabled .msgManagePlugins, :-moz-handler-blocked .msgBlocked, -:-moz-handler-crashed .msgCrashed { +:-moz-handler-crashed .msgCrashed, +:-moz-handler-crashed .msgReload { display: block; } @@ -59,8 +60,7 @@ html|applet:not([height]), html|applet[height=""] { .submitStatus[status="submitting"] .msgSubmitting, .submitStatus[status="success"] .msgSubmitted, .submitStatus[status="failed"] .msgSubmitFailed, -.submitStatus[status="please"] .msgSubmitPlease, -.submitStatus .msgReload { +.submitStatus[status="please"] .msgSubmitPlease { display: block; } diff --git a/toolkit/toolkit-makefiles.sh b/toolkit/toolkit-makefiles.sh index 6583ec6d16e..e873d87ca8a 100644 --- a/toolkit/toolkit-makefiles.sh +++ b/toolkit/toolkit-makefiles.sh @@ -266,6 +266,11 @@ MAKEFILES_content=" content/xslt/src/xslt/Makefile " +MAKEFILES_smil=" + content/smil/Makefile + dom/interfaces/smil/Makefile +" + MAKEFILES_layout=" layout/Makefile layout/base/Makefile @@ -513,6 +518,7 @@ MAKEFILES_xpcom=" xpcom/stub/Makefile xpcom/windbgdlg/Makefile xpcom/system/Makefile + xpcom/idl-parser/Makefile " MAKEFILES_xpcom_tests=" @@ -740,6 +746,7 @@ add_makefiles " $MAKEFILES_jsreflect $MAKEFILES_jsductwork $MAKEFILES_content + $MAKEFILES_smil $MAKEFILES_layout $MAKEFILES_libjar $MAKEFILES_libreg @@ -1082,13 +1089,6 @@ if [ "$MOZ_MAPINFO" ]; then " fi -if [ "$MOZ_SMIL" ]; then - add_makefiles " - content/smil/Makefile - dom/interfaces/smil/Makefile - " -fi - if [ "$MOZ_XTF" ]; then add_makefiles " content/xtf/Makefile diff --git a/widget/public/nsGUIEvent.h b/widget/public/nsGUIEvent.h index d622a09df20..da76932b2e5 100644 --- a/widget/public/nsGUIEvent.h +++ b/widget/public/nsGUIEvent.h @@ -111,9 +111,7 @@ class nsHashKey; #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 @@ -510,12 +508,10 @@ class nsHashKey; #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) diff --git a/widget/src/android/GfxInfo.cpp b/widget/src/android/GfxInfo.cpp index 46c9def8763..fd09ede2383 100644 --- a/widget/src/android/GfxInfo.cpp +++ b/widget/src/android/GfxInfo.cpp @@ -318,5 +318,7 @@ GfxInfo::GetFeatureStatusImpl(PRInt32 aFeature, if (aOS) *aOS = os; - return GfxInfoBase::GetFeatureStatusImpl(aFeature, aStatus, aSuggestedDriverVersion, aDriverInfo, &os); + // XXX disabled for now as this calls GetAdapterVendorID and friends, which currently crash on Android, see bug 700124 + // return GfxInfoBase::GetFeatureStatusImpl(aFeature, aStatus, aSuggestedDriverVersion, aDriverInfo, &os); + return NS_OK; } diff --git a/widget/src/xpwidgets/GfxInfoBase.cpp b/widget/src/xpwidgets/GfxInfoBase.cpp index 49db5245ba6..e39ef2f2bba 100644 --- a/widget/src/xpwidgets/GfxInfoBase.cpp +++ b/widget/src/xpwidgets/GfxInfoBase.cpp @@ -598,15 +598,11 @@ GfxInfoBase::GetFeatureStatusImpl(PRInt32 aFeature, NS_FAILED(GetAdapterDeviceID(&adapterDeviceID)) || NS_FAILED(GetAdapterDriverVersion(adapterDriverVersionString))) { - return NS_ERROR_FAILURE; + return NS_OK; } PRUint64 driverVersion; - if (!ParseDriverVersion(adapterDriverVersionString, &driverVersion)) { -#if !defined(XP_MACOSX) - return NS_ERROR_FAILURE; -#endif - } + ParseDriverVersion(adapterDriverVersionString, &driverVersion); // special-case the WinXP test slaves: they have out-of-date drivers, but we still want to // whitelist them, actually we do know that this combination of device and driver version diff --git a/xpcom/Makefile.in b/xpcom/Makefile.in index eed044b76bd..995d0cf7374 100644 --- a/xpcom/Makefile.in +++ b/xpcom/Makefile.in @@ -46,6 +46,7 @@ MODULE = xpcom GRE_MODULE = 1 DIRS = \ + idl-parser \ typelib \ string \ glue \ @@ -90,14 +91,3 @@ endif include $(topsrcdir)/config/rules.mk -regenerate-idl-parser: - $(PYTHON_PATH) \ - -I$(topsrcdir)/other-licenses/ply \ - -I$(topsrcdir)/xpcom/idl-parser \ - $(topsrcdir)/xpcom/idl-parser/header.py --cachedir=$(topsrcdir)/xpcom/idl-parser --regen - -check:: - $(PYTHON_PATH) \ - -I$(topsrcdir)/other-licenses/ply \ - -I$(topsrcdir)/xpcom/idl-parser \ - $(topsrcdir)/xpcom/idl-parser/runtests.py diff --git a/xpcom/idl-parser/Makefile.in b/xpcom/idl-parser/Makefile.in new file mode 100644 index 00000000000..20ca148ad25 --- /dev/null +++ b/xpcom/idl-parser/Makefile.in @@ -0,0 +1,76 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is Mozilla. +# Portions created by the Initial Developer are Copyright (C) 2011 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either of the GNU General Public License Version 2 or later (the "GPL"), +# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# 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 ***** + +DEPTH = ../.. +topsrcdir = @top_srcdir@ +srcdir = @srcdir@ +VPATH = @srcdir@ + +include $(DEPTH)/config/autoconf.mk + +PARSER_SRCS = \ + header.py \ + typelib.py \ + xpidl.py \ + $(NULL) + +PLY_PROGS = \ + $(topsrcdir)/other-licenses/ply/ply/lex.py \ + $(topsrcdir)/other-licenses/ply/ply/yacc.py \ + $(NULL) + +include $(topsrcdir)/config/rules.mk + +# Generate the PLY lexer and parser. +export:: $(PARSER_SRCS) $(PLY_PROGS) + $(PYTHON_PATH) \ + -I$(topsrcdir)/other-licenses/ply \ + -I$(topsrcdir)/xpcom/idl-parser \ + $(topsrcdir)/xpcom/idl-parser/header.py --cachedir=. --regen + +check:: + $(PYTHON_PATH) \ + -I$(topsrcdir)/other-licenses/ply \ + -I$(topsrcdir)/xpcom/idl-parser \ + $(topsrcdir)/xpcom/idl-parser/runtests.py + +GARBAGE += \ + xpidllex.py \ + xpidllex.pyc \ + xpidlyacc.py \ + xpidlyacc.pyc \ + xpidl_debug \ + $(NULL) diff --git a/xpcom/idl-parser/header.py b/xpcom/idl-parser/header.py index 8d43013134d..2f68e5f40ce 100644 --- a/xpcom/idl-parser/header.py +++ b/xpcom/idl-parser/header.py @@ -486,19 +486,20 @@ if __name__ == '__main__': o.add_option('--regen', action='store_true', dest='regen', default=False, help="Regenerate IDL Parser cache") options, args = o.parse_args() - file, = args + file = args[0] if args else None if options.cachedir is not None: if not os.path.isdir(options.cachedir): os.mkdir(options.cachedir) sys.path.append(options.cachedir) + # Instantiate the parser. + p = xpidl.IDLParser(outputdir=options.cachedir) + + # The only thing special about a regen is that there are no input files. if options.regen: if options.cachedir is None: - print >>sys.stderr, "--regen requires --cachedir" - sys.exit(1) - - p = xpidl.IDLParser(outputdir=options.cachedir, regen=True) + print >>sys.stderr, "--regen useless without --cachedir" sys.exit(0) if options.depfile is not None and options.outfile is None: @@ -512,7 +513,6 @@ if __name__ == '__main__': outfd = sys.stdout closeoutfd = False - p = xpidl.IDLParser(outputdir=options.cachedir) idl = p.parse(open(file).read(), filename=file) idl.resolve(options.incdirs, p) print_header(idl, outfd, file) diff --git a/xpcom/idl-parser/typelib.py b/xpcom/idl-parser/typelib.py index 5755080cd1f..893d6a8acb9 100644 --- a/xpcom/idl-parser/typelib.py +++ b/xpcom/idl-parser/typelib.py @@ -285,7 +285,7 @@ if __name__ == '__main__': o.add_option('--regen', action='store_true', dest='regen', default=False, help="Regenerate IDL Parser cache") options, args = o.parse_args() - file, = args + file = args[0] if args else None if options.cachedir is not None: if not os.path.isdir(options.cachedir): diff --git a/xpcom/idl-parser/xpidl.py b/xpcom/idl-parser/xpidl.py index e6af07d1b1a..f25ceb4b1d7 100644 --- a/xpcom/idl-parser/xpidl.py +++ b/xpcom/idl-parser/xpidl.py @@ -1445,17 +1445,17 @@ class IDLParser(object): location = Location(self.lexer, t.lineno, t.lexpos) raise IDLError("invalid syntax", location) - def __init__(self, outputdir='', regen=False): + def __init__(self, outputdir=''): self._doccomments = [] self.lexer = lex.lex(object=self, outputdir=outputdir, lextab='xpidllex', - optimize=0 if regen else 1) + optimize=1) self.parser = yacc.yacc(module=self, outputdir=outputdir, debugfile='xpidl_debug', tabmodule='xpidlyacc', - optimize=0 if regen else 1) + optimize=1) def clearComments(self): self._doccomments = [] diff --git a/xpcom/idl-parser/xpidllex.py b/xpcom/idl-parser/xpidllex.py deleted file mode 100644 index 982fb825e75..00000000000 --- a/xpcom/idl-parser/xpidllex.py +++ /dev/null @@ -1,9 +0,0 @@ -# xpidllex.py. This file automatically created by PLY (version 3.3). Don't edit! -_tabversion = '3.3' -_lextokens = {'TYPEDEF': 1, 'INCLUDE': 1, 'RSHIFT': 1, 'LSHIFT': 1, 'ATTRIBUTE': 1, 'NATIVEID': 1, 'NUMBER': 1, 'NATIVE': 1, 'IID': 1, 'READONLY': 1, 'RAISES': 1, 'CDATA': 1, 'IN': 1, 'INTERFACE': 1, 'CONST': 1, 'IDENTIFIER': 1, 'OUT': 1, 'INOUT': 1, 'HEXNUM': 1} -_lexreflags = 0 -_lexliterals = '"(){}[],;:=|+-*' -_lexstateinfo = {'nativeid': 'exclusive', 'INITIAL': 'inclusive'} -_lexstatere = {'nativeid': [('(?P[^()\\n]+(?=\\)))', [None, ('t_nativeid_NATIVEID', 'NATIVEID')])], 'INITIAL': [('(?P/\\*(?s).*?\\*/)|(?P(?m)//.*?$)|(?P[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12})|(?Punsigned\\ long\\ long|unsigned\\ short|unsigned\\ long|long\\ long|[A-Za-z][A-Za-z_0-9]*)|(?P(?s)%\\{[ ]*C\\+\\+[ ]*\\n(?P.*?\\n?)%\\}[ ]*(C\\+\\+)?)|(?P\\#include[ \\t]+"[^"\\n]+")|(?P\\#(?P[a-zA-Z]+)[^\\n]+)|(?P\\n+)|(?P0x[a-fA-F0-9]+)|(?P-?\\d+)|(?P<<)|(?P>>)', [None, ('t_multilinecomment', 'multilinecomment'), ('t_singlelinecomment', 'singlelinecomment'), ('t_IID', 'IID'), ('t_IDENTIFIER', 'IDENTIFIER'), ('t_LCDATA', 'LCDATA'), None, None, ('t_INCLUDE', 'INCLUDE'), ('t_directive', 'directive'), None, ('t_newline', 'newline'), (None, 'HEXNUM'), (None, 'NUMBER'), (None, 'LSHIFT'), (None, 'RSHIFT')])]} -_lexstateignore = {'nativeid': '', 'INITIAL': ' \t'} -_lexstateerrorf = {'nativeid': 't_ANY_error', 'INITIAL': 't_ANY_error'} diff --git a/xpcom/idl-parser/xpidlyacc.py b/xpcom/idl-parser/xpidlyacc.py deleted file mode 100644 index 679402ee34b..00000000000 --- a/xpcom/idl-parser/xpidlyacc.py +++ /dev/null @@ -1,85 +0,0 @@ - -# /src/trunk/mozilla/xpcom/idl-parser/xpidlyacc.py -# This file is automatically generated. Do not edit. -_tabversion = '3.2' - -_lr_method = 'LALR' - -_lr_signature = ',Q\xe7:m\xcf|\xa4\x8ad\x0f\x06\xc1Q\x1f\x99' - -_lr_action_items = {'CONST':([6,25,42,47,48,82,84,104,],[14,14,45,45,-28,-29,-41,-42,]),'NATIVEID':([43,],[50,]),'NUMBER':([62,65,66,77,78,79,80,81,83,],[68,68,68,68,68,68,68,68,68,]),'LSHIFT':([67,68,69,70,75,76,92,93,94,95,96,97,98,],[80,-30,-32,-31,80,-34,-33,-35,-37,-36,-38,-39,80,]),'RSHIFT':([67,68,69,70,75,76,92,93,94,95,96,97,98,],[81,-30,-32,-31,81,-34,-33,-35,-37,-36,-38,-39,81,]),'INOUT':([28,64,74,85,],[-13,-14,90,-14,]),'NATIVE':([0,2,5,7,8,9,10,28,31,44,61,],[-14,-14,-14,-14,-14,-14,23,-13,-8,-21,-9,]),')':([33,34,50,64,68,69,70,72,73,75,76,86,92,93,94,95,96,97,98,99,103,106,107,108,111,],[38,39,57,-44,-30,-32,-31,-45,87,92,-34,-43,-33,-35,-37,-36,-38,-39,-40,-45,-46,-47,109,-55,-56,]),'(':([14,16,17,30,37,60,62,65,66,77,78,79,80,81,83,101,],[-12,27,-11,-10,43,64,65,65,65,65,65,65,65,65,65,105,]),'+':([67,68,69,70,75,76,92,93,94,95,96,97,98,],[77,-30,-32,-31,77,-34,-33,-35,-37,-36,77,77,77,]),'*':([67,68,69,70,75,76,92,93,94,95,96,97,98,],[78,-30,-32,-31,78,-34,-33,78,-37,78,78,78,78,]),'-':([62,65,66,67,68,69,70,75,76,77,78,79,80,81,83,92,93,94,95,96,97,98,],[66,66,66,79,-30,-32,-31,79,-34,66,66,66,66,66,66,-33,-35,-37,-36,79,79,79,]),',':([14,15,16,17,26,38,39,72,99,106,108,],[-12,25,-20,-11,-17,-18,-19,85,85,-47,110,]),'IID':([27,],[34,]),'READONLY':([28,42,47,48,49,82,84,104,],[-13,-14,-14,-28,55,-29,-41,-42,]),';':([24,29,36,40,41,52,57,67,68,69,70,71,76,87,92,93,94,95,96,97,98,100,109,],[31,-25,-23,-24,44,-22,61,82,-30,-32,-31,84,-34,-54,-33,-35,-37,-36,-38,-39,-40,104,-53,]),'IDENTIFIER':([3,6,12,22,23,25,27,28,35,42,45,47,48,49,51,56,59,62,63,65,66,77,78,79,80,81,82,83,84,88,89,90,91,102,104,105,110,],[12,17,24,29,30,17,33,-13,40,-14,51,-14,-28,56,58,60,63,69,71,69,69,69,69,69,69,69,-29,69,-41,102,-48,-49,-50,106,-42,108,108,]),'=':([58,],[62,]),'OUT':([28,64,74,85,],[-13,-14,91,-14,]),'TYPEDEF':([0,2,5,7,8,9,31,44,61,],[3,3,3,3,3,3,-8,-21,-9,]),'RAISES':([87,],[101,]),'IN':([28,64,74,85,],[-13,-14,89,-14,]),'[':([0,2,5,7,8,9,31,42,44,47,48,61,64,82,84,85,104,],[6,6,6,6,6,6,-8,6,-21,6,-28,-9,6,-29,-41,6,-42,]),'INCLUDE':([0,2,5,7,8,9,31,44,61,],[7,7,7,7,7,7,-8,-21,-9,]),']':([14,15,16,17,18,26,32,38,39,],[-12,-15,-20,-11,28,-17,-16,-18,-19,]),':':([29,],[35,]),'ATTRIBUTE':([28,42,47,48,49,54,55,82,84,104,],[-13,-14,-14,-28,-52,59,-51,-29,-41,-42,]),'CDATA':([0,2,5,7,8,9,31,42,44,47,48,61,82,84,104,],[9,9,9,9,9,9,-8,48,-21,48,-28,-9,-29,-41,-42,]),'INTERFACE':([0,2,5,7,8,9,10,28,31,44,61,],[-14,-14,-14,-14,-14,-14,22,-13,-8,-21,-9,]),'{':([29,36,40,],[-25,42,-24,]),'$end':([0,1,2,4,5,7,8,9,11,13,19,20,21,31,44,61,],[-2,-1,-2,0,-2,-2,-2,-2,-6,-5,-4,-7,-3,-8,-21,-9,]),'}':([42,46,47,48,53,82,84,104,],[-26,52,-26,-28,-27,-29,-41,-42,]),'|':([67,68,69,70,75,76,92,93,94,95,96,97,98,],[83,-30,-32,-31,83,-34,-33,-35,-37,-36,-38,-39,-40,]),'HEXNUM':([62,65,66,77,78,79,80,81,83,],[70,70,70,70,70,70,70,70,70,]),} - -_lr_action = { } -for _k, _v in _lr_action_items.items(): - for _x,_y in zip(_v[0],_v[1]): - if not _x in _lr_action: _lr_action[_x] = { } - _lr_action[_x][_k] = _y -del _lr_action_items - -_lr_goto_items = {'members':([42,47,],[46,53,]),'attribute':([6,25,],[15,15,]),'number':([62,65,66,77,78,79,80,81,83,],[67,75,76,93,94,95,96,97,98,]),'productions':([0,2,5,7,8,9,],[1,11,13,19,20,21,]),'raises':([87,],[100,]),'ifacebody':([36,],[41,]),'attlist':([6,25,],[18,32,]),'native':([0,2,5,7,8,9,],[8,8,8,8,8,8,]),'typedef':([0,2,5,7,8,9,],[2,2,2,2,2,2,]),'attributeval':([16,],[26,]),'optreadonly':([49,],[54,]),'ifacebase':([29,],[36,]),'afternativeid':([30,],[37,]),'param':([64,85,],[72,99,]),'member':([42,47,],[47,47,]),'idlfile':([0,],[4,]),'paramlist':([64,],[73,]),'moreparams':([72,99,],[86,103,]),'interface':([0,2,5,7,8,9,],[5,5,5,5,5,5,]),'idlist':([105,110,],[107,111,]),'paramtype':([74,],[88,]),'anyident':([6,25,],[16,16,]),'attributes':([0,2,5,7,8,9,42,47,64,85,],[10,10,10,10,10,10,49,49,74,74,]),} - -_lr_goto = { } -for _k, _v in _lr_goto_items.items(): - for _x,_y in zip(_v[0],_v[1]): - if not _x in _lr_goto: _lr_goto[_x] = { } - _lr_goto[_x][_k] = _y -del _lr_goto_items -_lr_productions = [ - ("S' -> idlfile","S'",1,None,None,None), - ('idlfile -> productions','idlfile',1,'p_idlfile','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1088), - ('productions -> ','productions',0,'p_productions_start','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1092), - ('productions -> CDATA productions','productions',2,'p_productions_cdata','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1096), - ('productions -> INCLUDE productions','productions',2,'p_productions_include','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1101), - ('productions -> interface productions','productions',2,'p_productions_interface','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1106), - ('productions -> typedef productions','productions',2,'p_productions_interface','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1107), - ('productions -> native productions','productions',2,'p_productions_interface','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1108), - ('typedef -> TYPEDEF IDENTIFIER IDENTIFIER ;','typedef',4,'p_typedef','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1113), - ('native -> attributes NATIVE IDENTIFIER afternativeid ( NATIVEID ) ;','native',8,'p_native','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1120), - ('afternativeid -> ','afternativeid',0,'p_afternativeid','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1127), - ('anyident -> IDENTIFIER','anyident',1,'p_anyident','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1133), - ('anyident -> CONST','anyident',1,'p_anyident','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1134), - ('attributes -> [ attlist ]','attributes',3,'p_attributes','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1139), - ('attributes -> ','attributes',0,'p_attributes','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1140), - ('attlist -> attribute','attlist',1,'p_attlist_start','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1148), - ('attlist -> attribute , attlist','attlist',3,'p_attlist_continue','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1152), - ('attribute -> anyident attributeval','attribute',2,'p_attribute','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1157), - ('attributeval -> ( IDENTIFIER )','attributeval',3,'p_attributeval','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1161), - ('attributeval -> ( IID )','attributeval',3,'p_attributeval','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1162), - ('attributeval -> ','attributeval',0,'p_attributeval','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1163), - ('interface -> attributes INTERFACE IDENTIFIER ifacebase ifacebody ;','interface',6,'p_interface','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1168), - ('ifacebody -> { members }','ifacebody',3,'p_ifacebody','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1197), - ('ifacebody -> ','ifacebody',0,'p_ifacebody','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1198), - ('ifacebase -> : IDENTIFIER','ifacebase',2,'p_ifacebase','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1203), - ('ifacebase -> ','ifacebase',0,'p_ifacebase','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1204), - ('members -> ','members',0,'p_members_start','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1209), - ('members -> member members','members',2,'p_members_continue','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1213), - ('member -> CDATA','member',1,'p_member_cdata','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1218), - ('member -> CONST IDENTIFIER IDENTIFIER = number ;','member',6,'p_member_const','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1222), - ('number -> NUMBER','number',1,'p_number_decimal','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1230), - ('number -> HEXNUM','number',1,'p_number_hex','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1235), - ('number -> IDENTIFIER','number',1,'p_number_identifier','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1240), - ('number -> ( number )','number',3,'p_number_paren','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1246), - ('number -> - number','number',2,'p_number_neg','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1250), - ('number -> number + number','number',3,'p_number_add','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1255), - ('number -> number - number','number',3,'p_number_add','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1256), - ('number -> number * number','number',3,'p_number_add','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1257), - ('number -> number LSHIFT number','number',3,'p_number_shift','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1268), - ('number -> number RSHIFT number','number',3,'p_number_shift','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1269), - ('number -> number | number','number',3,'p_number_bitor','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1278), - ('member -> attributes optreadonly ATTRIBUTE IDENTIFIER IDENTIFIER ;','member',6,'p_member_att','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1284), - ('member -> attributes IDENTIFIER IDENTIFIER ( paramlist ) raises ;','member',8,'p_member_method','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1300), - ('paramlist -> param moreparams','paramlist',2,'p_paramlist','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1315), - ('paramlist -> ','paramlist',0,'p_paramlist','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1316), - ('moreparams -> ','moreparams',0,'p_moreparams_start','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1324), - ('moreparams -> , param moreparams','moreparams',3,'p_moreparams_continue','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1328), - ('param -> attributes paramtype IDENTIFIER IDENTIFIER','param',4,'p_param','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1333), - ('paramtype -> IN','paramtype',1,'p_paramtype','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1341), - ('paramtype -> INOUT','paramtype',1,'p_paramtype','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1342), - ('paramtype -> OUT','paramtype',1,'p_paramtype','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1343), - ('optreadonly -> READONLY','optreadonly',1,'p_optreadonly','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1347), - ('optreadonly -> ','optreadonly',0,'p_optreadonly','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1348), - ('raises -> RAISES ( idlist )','raises',4,'p_raises','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1355), - ('raises -> ','raises',0,'p_raises','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1356), - ('idlist -> IDENTIFIER','idlist',1,'p_idlist','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1363), - ('idlist -> IDENTIFIER , idlist','idlist',3,'p_idlist_continue','/src/trunk/mozilla/xpcom/idl-parser/xpidl.py',1367), -] diff --git a/xpcom/reflect/xptinfo/public/nsIInterfaceInfo.idl b/xpcom/reflect/xptinfo/public/nsIInterfaceInfo.idl index edad37eba3e..833fbc1b816 100644 --- a/xpcom/reflect/xptinfo/public/nsIInterfaceInfo.idl +++ b/xpcom/reflect/xptinfo/public/nsIInterfaceInfo.idl @@ -58,7 +58,7 @@ class nsXPTType; %} /* this is NOT intended to be scriptable */ -[uuid(7de126a2-ef4b-4e3b-a952-78ce4c133e38)] +[uuid(1affa260-8965-4612-869a-78af4ccfb287)] interface nsIInterfaceInfo : nsISupports { readonly attribute string name; @@ -115,10 +115,6 @@ interface nsIInterfaceInfo : nsISupports [const] in nsXPTParamInfoPtr param, in PRUint16 dimension); - PRUint8 getLengthIsArgNumberForParam(in PRUint16 methodIndex, - [const] in nsXPTParamInfoPtr param, - in PRUint16 dimension); - PRUint8 getInterfaceIsArgNumberForParam(in PRUint16 methodIndex, [const] in nsXPTParamInfoPtr param); diff --git a/xpcom/reflect/xptinfo/src/xptiInterfaceInfo.cpp b/xpcom/reflect/xptinfo/src/xptiInterfaceInfo.cpp index 2d3659bbf50..29289b357b1 100644 --- a/xpcom/reflect/xptinfo/src/xptiInterfaceInfo.cpp +++ b/xpcom/reflect/xptinfo/src/xptiInterfaceInfo.cpp @@ -484,52 +484,6 @@ xptiInterfaceEntry::GetSizeIsArgNumberForParam(uint16 methodIndex, return NS_OK; } -nsresult -xptiInterfaceEntry::GetLengthIsArgNumberForParam(uint16 methodIndex, - const nsXPTParamInfo* param, - uint16 dimension, - uint8* argnum) -{ - if(!EnsureResolved()) - return NS_ERROR_UNEXPECTED; - - if(methodIndex < mMethodBaseIndex) - return mParent-> - GetLengthIsArgNumberForParam(methodIndex, param, dimension, argnum); - - if(methodIndex >= mMethodBaseIndex + - mDescriptor->num_methods) - { - NS_ERROR("bad index"); - return NS_ERROR_INVALID_ARG; - } - - const XPTTypeDescriptor *td; - - if(dimension) { - nsresult rv = GetTypeInArray(param, dimension, &td); - if(NS_FAILED(rv)) { - return rv; - } - } - else - td = ¶m->type; - - // verify that this is a type that has length_is - switch (XPT_TDP_TAG(td->prefix)) { - case TD_ARRAY: - case TD_PSTRING_SIZE_IS: - case TD_PWSTRING_SIZE_IS: - break; - default: - NS_ERROR("not a length_is"); - return NS_ERROR_INVALID_ARG; - } - - *argnum = td->argnum2; - return NS_OK; -} - nsresult xptiInterfaceEntry::GetInterfaceIsArgNumberForParam(uint16 methodIndex, const nsXPTParamInfo* param, diff --git a/xpcom/reflect/xptinfo/src/xptiprivate.h b/xpcom/reflect/xptinfo/src/xptiprivate.h index c086e485b8d..806e2306953 100644 --- a/xpcom/reflect/xptinfo/src/xptiprivate.h +++ b/xpcom/reflect/xptinfo/src/xptiprivate.h @@ -307,7 +307,6 @@ public: nsresult GetIIDForParam(PRUint16 methodIndex, const nsXPTParamInfo * param, nsIID * *_retval); nsresult GetTypeForParam(PRUint16 methodIndex, const nsXPTParamInfo * param, PRUint16 dimension, nsXPTType *_retval); nsresult GetSizeIsArgNumberForParam(PRUint16 methodIndex, const nsXPTParamInfo * param, PRUint16 dimension, PRUint8 *_retval); - nsresult GetLengthIsArgNumberForParam(PRUint16 methodIndex, const nsXPTParamInfo * param, PRUint16 dimension, PRUint8 *_retval); nsresult GetInterfaceIsArgNumberForParam(PRUint16 methodIndex, const nsXPTParamInfo * param, PRUint8 *_retval); nsresult IsIID(const nsIID * IID, bool *_retval); nsresult GetNameShared(const char **name); @@ -389,7 +388,6 @@ public: NS_IMETHOD GetIIDForParam(PRUint16 methodIndex, const nsXPTParamInfo * param, nsIID * *_retval) { return !mEntry ? NS_ERROR_UNEXPECTED : mEntry->GetIIDForParam(methodIndex, param, _retval); } NS_IMETHOD GetTypeForParam(PRUint16 methodIndex, const nsXPTParamInfo * param, PRUint16 dimension, nsXPTType *_retval) { return !mEntry ? NS_ERROR_UNEXPECTED : mEntry->GetTypeForParam(methodIndex, param, dimension, _retval); } NS_IMETHOD GetSizeIsArgNumberForParam(PRUint16 methodIndex, const nsXPTParamInfo * param, PRUint16 dimension, PRUint8 *_retval) { return !mEntry ? NS_ERROR_UNEXPECTED : mEntry->GetSizeIsArgNumberForParam(methodIndex, param, dimension, _retval); } - NS_IMETHOD GetLengthIsArgNumberForParam(PRUint16 methodIndex, const nsXPTParamInfo * param, PRUint16 dimension, PRUint8 *_retval) { return !mEntry ? NS_ERROR_UNEXPECTED : mEntry->GetLengthIsArgNumberForParam(methodIndex, param, dimension, _retval); } NS_IMETHOD GetInterfaceIsArgNumberForParam(PRUint16 methodIndex, const nsXPTParamInfo * param, PRUint8 *_retval) { return !mEntry ? NS_ERROR_UNEXPECTED : mEntry->GetInterfaceIsArgNumberForParam(methodIndex, param, _retval); } NS_IMETHOD IsIID(const nsIID * IID, bool *_retval) { return !mEntry ? NS_ERROR_UNEXPECTED : mEntry->IsIID(IID, _retval); } NS_IMETHOD GetNameShared(const char **name) { return !mEntry ? NS_ERROR_UNEXPECTED : mEntry->GetNameShared(name); } diff --git a/xpcom/typelib/xpidl/Makefile.in b/xpcom/typelib/xpidl/Makefile.in index 4e0957441a5..cffceeea9c0 100644 --- a/xpcom/typelib/xpidl/Makefile.in +++ b/xpcom/typelib/xpidl/Makefile.in @@ -46,8 +46,6 @@ MODULE = xpcom SDK_BINARY = \ $(topsrcdir)/xpcom/idl-parser/xpidl.py \ - $(topsrcdir)/xpcom/idl-parser/xpidllex.py \ - $(topsrcdir)/xpcom/idl-parser/xpidlyacc.py \ $(topsrcdir)/xpcom/idl-parser/header.py \ $(topsrcdir)/xpcom/idl-parser/typelib.py \ $(NULL)