merge fx-team to m-c

This commit is contained in:
Rob Campbell 2011-11-07 10:46:26 -04:00
commit 49029ab022
157 changed files with 544 additions and 1203 deletions

View File

@ -1108,6 +1108,7 @@
<![CDATA[
var aFromExternal;
var aRelatedToCurrent;
var aIsUTF8;
if (arguments.length == 2 &&
typeof arguments[1] == "object" &&
!(arguments[1] instanceof Ci.nsIURI)) {
@ -1119,6 +1120,7 @@
aAllowThirdPartyFixup = params.allowThirdPartyFixup;
aFromExternal = params.fromExternal;
aRelatedToCurrent = params.relatedToCurrent;
aIsUTF8 = params.isUTF8;
}
var bgLoad = (aLoadInBackground != null) ? aLoadInBackground :
@ -1131,7 +1133,8 @@
ownerTab: owner,
allowThirdPartyFixup: aAllowThirdPartyFixup,
fromExternal: aFromExternal,
relatedToCurrent: aRelatedToCurrent});
relatedToCurrent: aRelatedToCurrent,
isUTF8: aIsUTF8});
if (!bgLoad)
this.selectedTab = tab;
@ -1204,6 +1207,7 @@
var aFromExternal;
var aRelatedToCurrent;
var aSkipAnimation;
var aIsUTF8;
if (arguments.length == 2 &&
typeof arguments[1] == "object" &&
!(arguments[1] instanceof Ci.nsIURI)) {
@ -1216,6 +1220,7 @@
aFromExternal = params.fromExternal;
aRelatedToCurrent = params.relatedToCurrent;
aSkipAnimation = params.skipAnimation;
aIsUTF8 = params.isUTF8;
}
this._browsers = null; // invalidate cache
@ -1363,6 +1368,8 @@
flags |= Ci.nsIWebNavigation.LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP;
if (aFromExternal)
flags |= Ci.nsIWebNavigation.LOAD_FLAGS_FROM_EXTERNAL;
if (aIsUTF8)
flags |= Ci.nsIWebNavigation.LOAD_FLAGS_URI_IS_UTF8;
try {
b.loadURIWithFlags(aURI, flags, aReferrerURI, aCharset, aPostData);
} catch (ex) {

View File

@ -206,6 +206,7 @@ _BROWSER_FILES = \
browser_tabs_isActive.js \
browser_tabs_owner.js \
browser_urlbarCopying.js \
browser_urlbarEnter.js \
browser_urlbarTrimURLs.js \
browser_urlHighlight.js \
browser_visibleFindSelection.js \

View File

@ -0,0 +1,69 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
const TEST_VALUE = "example.com/\xF7?\xF7";
const START_VALUE = "example.com/%C3%B7?%C3%B7";
function test() {
waitForExplicitFinish();
runNextTest();
}
function locationBarEnter(aEvent, aClosure) {
executeSoon(function() {
gURLBar.focus();
EventUtils.synthesizeKey("VK_RETURN", aEvent);
addPageShowListener(aClosure);
});
}
function runNextTest() {
let test = gTests.shift();
if (!test) {
finish();
return;
}
info("Running test: " + test.desc);
let tab = gBrowser.selectedTab = gBrowser.addTab(START_VALUE);
addPageShowListener(function() {
locationBarEnter(test.event, function() {
test.check(tab);
// Clean up
while (gBrowser.tabs.length > 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();
});
}

View File

@ -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 {

View File

@ -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;
}

View File

@ -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]
;

View File

@ -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

View File

@ -0,0 +1,8 @@
#T gmake skip
CMD = %pycmd asplode
PYCOMMANDPATH = $(TESTPATH) $(TESTPATH)/subdir
all:
$(CMD) 0
@echo TEST-PASS

View File

@ -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

View File

@ -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@

View File

@ -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)))

View File

@ -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)

View File

@ -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;

View File

@ -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<nsTHashtable<nsPtrHashKey<nsIContent> > > mFreezableElements;
#ifdef MOZ_SMIL
// SMIL Animation Controller, lazily-initialized in GetAnimationController
nsRefPtr<nsSMILAnimationController> mAnimationController;
#endif // MOZ_SMIL
// Table of element properties for this document.
nsPropertyTable mPropertyTable;

View File

@ -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 \

View File

@ -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);

View File

@ -865,11 +865,9 @@ public:
nsTArray<nsCString> mFileDataUris;
#ifdef MOZ_SMIL
// Returns our (lazily-initialized) animation controller.
// If HasAnimationController is true, this is guaranteed to return non-null.
nsSMILAnimationController* GetAnimationController();
#endif // MOZ_SMIL
void SetImagesNeedAnimating(bool aAnimating);

View File

@ -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()

View File

@ -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;

View File

@ -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()

View File

@ -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

View File

@ -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_

View File

@ -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();
}

View File

@ -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
};

View File

@ -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,

View File

@ -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

View File

@ -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<nsSimpleGestureEvent*>(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];

View File

@ -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,

View File

@ -792,10 +792,8 @@ nsEventDispatcher::CreateEvent(nsPresContext* aPresContext,
case NS_SVGZOOM_EVENT:
return NS_NewDOMSVGZoomEvent(aDOMEvent, aPresContext,
static_cast<nsGUIEvent*>(aEvent));
#ifdef MOZ_SMIL
case NS_SMIL_TIME_EVENT:
return NS_NewDOMTimeEvent(aDOMEvent, aPresContext, aEvent);
#endif // MOZ_SMIL
case NS_COMMAND_EVENT:
return NS_NewDOMCommandEvent(aDOMEvent, aPresContext,
@ -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);

View File

@ -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;

View File

@ -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

View File

@ -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);

View File

@ -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;
}

View File

@ -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;

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;

View File

@ -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;
}

View File

@ -345,11 +345,9 @@ DOMSVGTransform::NotifyElementOfChange()
{
if (HasOwner()) {
Element()->DidChangeTransformList(true);
#ifdef MOZ_SMIL
if (mList->mAList->IsAnimating()) {
Element()->AnimationNeedsResample();
}
#endif // MOZ_SMIL
}
}

View File

@ -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;
}

View File

@ -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

View File

@ -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

View File

@ -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<SVGLengthList> 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

View File

@ -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

View File

@ -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<SVGNumberList> 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

View File

@ -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

View File

@ -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<SVGPathData> 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

View File

@ -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

View File

@ -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<SVGPointList> 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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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<SVGTransformList> 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

View File

@ -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

View File

@ -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 <angle> 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

View File

@ -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

View File

@ -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__

View File

@ -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

View File

@ -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__

View File

@ -86,10 +86,8 @@
#include "nsIFrame.h"
#include "prdtoa.h"
#include <stdarg.h>
#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

View File

@ -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);

View File

@ -223,7 +223,6 @@ nsresult
NS_NewSVGFEDisplacementMapElement(nsIContent **aResult,
already_AddRefed<nsINodeInfo> aNodeInfo);
#ifdef MOZ_SMIL
nsresult
NS_NewSVGAnimateElement(nsIContent **aResult,
already_AddRefed<nsINodeInfo> aNodeInfo);
@ -239,7 +238,6 @@ NS_NewSVGMpathElement(nsIContent **aResult,
nsresult
NS_NewSVGSetElement(nsIContent **aResult,
already_AddRefed<nsINodeInfo> aNodeInfo);
#endif // MOZ_SMIL
nsresult
NS_NewSVGElement(nsIContent** aResult, already_AddRefed<nsINodeInfo> aNodeInfo,
@ -368,7 +366,6 @@ NS_NewSVGElement(nsIContent** aResult, already_AddRefed<nsINodeInfo> 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<nsINodeInfo> 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);

View File

@ -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

View File

@ -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__

View File

@ -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

View File

@ -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__

View File

@ -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

View File

@ -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__

View File

@ -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

View File

@ -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__

View File

@ -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

View File

@ -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__

View File

@ -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

View File

@ -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__

View File

@ -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<nsINodeInfo> 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 <svg> or not bound to a tree, so silently fail
return NS_OK;
}
#endif // MOZ_SMIL
NS_NOTYETIMPLEMENTED("nsSVGSVGElement::PauseAnimations");
return NS_ERROR_NOT_IMPLEMENTED;
}
@ -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 <svg> or not bound to a tree, so silently fail
return NS_OK;
}
#endif // MOZ_SMIL
NS_NOTYETIMPLEMENTED("nsSVGSVGElement::UnpauseAnimations");
return NS_ERROR_NOT_IMPLEMENTED;
}
@ -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()

View File

@ -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
* <svg> 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 <svg> elements (not nested <svg> elements).
nsAutoPtr<nsSMILTimeContainer> 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 <svg> elements created from parsing, animation is started by
// the onload event in accordance with the SVG spec, but for <svg> elements
// created by script or promoted from inner <svg> to outermost <svg> we need
// to manually kick off animation when they are bound to the tree.
bool mStartAnimationOnBindToTree;
#endif // MOZ_SMIL
bool mImageNeedsTransformInvalidation;
bool mIsPaintingSVGImageElement;
};

View File

@ -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

View File

@ -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__

View File

@ -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

View File

@ -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();

View File

@ -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

View File

@ -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__

View File

@ -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));
}

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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)

View File

@ -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

View File

@ -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.

View File

@ -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) {

View File

@ -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) {

View File

@ -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

View File

@ -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); }
};

View File

@ -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.
*

View File

@ -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;

View File

@ -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<nsPNGDecoder*>(mContainedDecoder.get())->HasValidInfo() &&
static_cast<nsPNGDecoder*>(mContainedDecoder.get())->GetPixelDepth() != 32) {
if (!static_cast<nsPNGDecoder*>(mContainedDecoder.get())->IsValidICO()) {
PostDataError();
}
return;

View File

@ -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:

View File

@ -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);
}
}

View File

@ -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

View File

@ -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);
}

Some files were not shown because too many files have changed in this diff Show More