diff --git a/content/base/src/nsStyledElement.cpp b/content/base/src/nsStyledElement.cpp index 9f734056b350..8992b9f660fc 100644 --- a/content/base/src/nsStyledElement.cpp +++ b/content/base/src/nsStyledElement.cpp @@ -19,7 +19,6 @@ #include "mozilla/css/Loader.h" #include "nsIDOMMutationEvent.h" #include "nsXULElement.h" -#include "nsIDOMSVGStylable.h" #include "nsContentUtils.h" namespace css = mozilla::css; diff --git a/content/svg/content/src/Makefile.in b/content/svg/content/src/Makefile.in index 45cc2d4b9007..9b9847767d91 100644 --- a/content/svg/content/src/Makefile.in +++ b/content/svg/content/src/Makefile.in @@ -74,7 +74,6 @@ CPPSRCS = \ nsSVGPolylineElement.cpp \ nsSVGScriptElement.cpp \ nsSVGString.cpp \ - nsSVGStylableElement.cpp \ nsSVGRect.cpp \ nsSVGRectElement.cpp \ nsSVGSVGElement.cpp \ diff --git a/content/svg/content/src/nsSVGClass.cpp b/content/svg/content/src/nsSVGClass.cpp index c17e62c2cfc6..601031f937fb 100644 --- a/content/svg/content/src/nsSVGClass.cpp +++ b/content/svg/content/src/nsSVGClass.cpp @@ -4,7 +4,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "nsSVGClass.h" -#include "nsSVGStylableElement.h" +#include "nsSVGElement.h" #include "nsSMILValue.h" #include "SMILStringType.h" @@ -27,7 +27,7 @@ NS_INTERFACE_MAP_END void nsSVGClass::SetBaseValue(const nsAString& aValue, - nsSVGStylableElement *aSVGElement, + nsSVGElement *aSVGElement, bool aDoSetAttr) { NS_ASSERTION(aSVGElement, "Null element passed to SetBaseValue"); @@ -42,13 +42,13 @@ nsSVGClass::SetBaseValue(const nsAString& aValue, } void -nsSVGClass::GetBaseValue(nsAString& aValue, const nsSVGStylableElement *aSVGElement) const +nsSVGClass::GetBaseValue(nsAString& aValue, const nsSVGElement *aSVGElement) const { aSVGElement->GetAttr(kNameSpaceID_None, nsGkAtoms::_class, aValue); } void -nsSVGClass::GetAnimValue(nsAString& aResult, const nsSVGStylableElement *aSVGElement) const +nsSVGClass::GetAnimValue(nsAString& aResult, const nsSVGElement *aSVGElement) const { if (mAnimVal) { aResult = *mAnimVal; @@ -59,7 +59,7 @@ nsSVGClass::GetAnimValue(nsAString& aResult, const nsSVGStylableElement *aSVGEle } void -nsSVGClass::SetAnimValue(const nsAString& aValue, nsSVGStylableElement *aSVGElement) +nsSVGClass::SetAnimValue(const nsAString& aValue, nsSVGElement *aSVGElement) { if (mAnimVal && mAnimVal->Equals(aValue)) { return; @@ -74,7 +74,7 @@ nsSVGClass::SetAnimValue(const nsAString& aValue, nsSVGStylableElement *aSVGElem nsresult nsSVGClass::ToDOMAnimatedString(nsIDOMSVGAnimatedString **aResult, - nsSVGStylableElement *aSVGElement) + nsSVGElement *aSVGElement) { *aResult = new DOMAnimatedString(this, aSVGElement); NS_ADDREF(*aResult); @@ -90,7 +90,7 @@ nsSVGClass::DOMAnimatedString::GetAnimVal(nsAString& aResult) } nsISMILAttr* -nsSVGClass::ToSMILAttr(nsSVGStylableElement *aSVGElement) +nsSVGClass::ToSMILAttr(nsSVGElement *aSVGElement) { return new SMILString(this, aSVGElement); } diff --git a/content/svg/content/src/nsSVGClass.h b/content/svg/content/src/nsSVGClass.h index dbdcd5166c72..46e01c1671b3 100644 --- a/content/svg/content/src/nsSVGClass.h +++ b/content/svg/content/src/nsSVGClass.h @@ -14,7 +14,7 @@ #include "nsString.h" #include "mozilla/Attributes.h" -class nsSVGStylableElement; +class nsSVGElement; class nsSVGClass { @@ -25,19 +25,19 @@ public: } void SetBaseValue(const nsAString& aValue, - nsSVGStylableElement *aSVGElement, + nsSVGElement *aSVGElement, bool aDoSetAttr); - void GetBaseValue(nsAString& aValue, const nsSVGStylableElement *aSVGElement) const; + void GetBaseValue(nsAString& aValue, const nsSVGElement *aSVGElement) const; - void SetAnimValue(const nsAString& aValue, nsSVGStylableElement *aSVGElement); - void GetAnimValue(nsAString& aValue, const nsSVGStylableElement *aSVGElement) const; + void SetAnimValue(const nsAString& aValue, nsSVGElement *aSVGElement); + void GetAnimValue(nsAString& aValue, const nsSVGElement *aSVGElement) const; bool IsAnimated() const { return !!mAnimVal; } nsresult ToDOMAnimatedString(nsIDOMSVGAnimatedString **aResult, - nsSVGStylableElement *aSVGElement); + nsSVGElement *aSVGElement); // Returns a new nsISMILAttr object that the caller must delete - nsISMILAttr* ToSMILAttr(nsSVGStylableElement *aSVGElement); + nsISMILAttr* ToSMILAttr(nsSVGElement *aSVGElement); private: @@ -49,11 +49,11 @@ public: NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedString) - DOMAnimatedString(nsSVGClass *aVal, nsSVGStylableElement *aSVGElement) + DOMAnimatedString(nsSVGClass *aVal, nsSVGElement *aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} nsSVGClass* mVal; // kept alive because it belongs to content - nsRefPtr mSVGElement; + nsRefPtr mSVGElement; NS_IMETHOD GetBaseVal(nsAString& aResult) { mVal->GetBaseValue(aResult, mSVGElement); return NS_OK; } @@ -65,14 +65,14 @@ public: struct SMILString : public nsISMILAttr { public: - SMILString(nsSVGClass *aVal, nsSVGStylableElement *aSVGElement) + SMILString(nsSVGClass *aVal, nsSVGElement *aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} // These will stay alive because a nsISMILAttr only lives as long // as the Compositing step, and DOM elements don't get a chance to // die during that. nsSVGClass* mVal; - nsSVGStylableElement* mSVGElement; + nsSVGElement* mSVGElement; // nsISMILAttr methods virtual nsresult ValueFromString(const nsAString& aStr, diff --git a/content/svg/content/src/nsSVGDescElement.cpp b/content/svg/content/src/nsSVGDescElement.cpp index 1f0b3aa07116..81c158ec49cf 100644 --- a/content/svg/content/src/nsSVGDescElement.cpp +++ b/content/svg/content/src/nsSVGDescElement.cpp @@ -3,10 +3,10 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "nsSVGStylableElement.h" +#include "nsSVGElement.h" #include "nsIDOMSVGDescElement.h" -typedef nsSVGStylableElement nsSVGDescElementBase; +typedef nsSVGElement nsSVGDescElementBase; class nsSVGDescElement : public nsSVGDescElementBase, public nsIDOMSVGDescElement diff --git a/content/svg/content/src/nsSVGElement.cpp b/content/svg/content/src/nsSVGElement.cpp index 758a291c13a9..8f7022b3ab1b 100644 --- a/content/svg/content/src/nsSVGElement.cpp +++ b/content/svg/content/src/nsSVGElement.cpp @@ -58,6 +58,7 @@ #include "SVGMotionSMILAttr.h" #include "nsAttrValueOrString.h" #include "nsSMILAnimationController.h" +#include "nsDOMCSSDeclaration.h" using namespace mozilla; using namespace mozilla::dom; @@ -80,6 +81,59 @@ nsSVGElement::nsSVGElement(already_AddRefed aNodeInfo) { } +//---------------------------------------------------------------------- + +/* readonly attribute nsIDOMSVGAnimatedString className; */ +NS_IMETHODIMP +nsSVGElement::GetClassName(nsIDOMSVGAnimatedString** aClassName) +{ + return mClassAttribute.ToDOMAnimatedString(aClassName, this); +} + +/* readonly attribute nsIDOMCSSStyleDeclaration style; */ +NS_IMETHODIMP +nsSVGElement::GetStyle(nsIDOMCSSStyleDeclaration** aStyle) +{ + nsresult rv; + *aStyle = nsSVGElementBase::GetStyle(&rv); + if (NS_FAILED(rv)) { + return rv; + } + NS_ADDREF(*aStyle); + return NS_OK; +} + +/* nsIDOMCSSValue getPresentationAttribute (in DOMString name); */ +NS_IMETHODIMP +nsSVGElement::GetPresentationAttribute(const nsAString& aName, + nsIDOMCSSValue** aReturn) +{ + // Let's not implement this just yet. The CSSValue interface has been + // deprecated by the CSS WG. + // http://lists.w3.org/Archives/Public/www-style/2003Oct/0347.html + + return NS_ERROR_NOT_IMPLEMENTED; +} + +//---------------------------------------------------------------------- +// nsSVGElement methods + +void +nsSVGElement::DidAnimateClass() +{ + nsAutoString src; + mClassAttribute.GetAnimValue(src, this); + if (!mClassAnimAttr) { + mClassAnimAttr = new nsAttrValue(); + } + mClassAnimAttr->ParseAtomArray(src); + + nsIPresShell* shell = OwnerDoc()->GetShell(); + if (shell) { + shell->RestyleForAnimation(this, eRestyle_Self); + } +} + nsresult nsSVGElement::Init() { @@ -192,6 +246,15 @@ NS_INTERFACE_MAP_END_INHERITING(nsSVGElementBase) //---------------------------------------------------------------------- // nsIContent methods +const nsAttrValue* +nsSVGElement::DoGetClasses() const +{ + if (mClassAttribute.IsAnimated()) { + return mClassAnimAttr; + } + return nsSVGElementBase::DoGetClasses(); +} + nsresult nsSVGElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent, nsIContent* aBindingParent, @@ -272,7 +335,6 @@ nsSVGElement::ParseAttribute(int32_t aNamespaceID, bool didSetResult = false; if (aNamespaceID == kNameSpaceID_None) { - // Check for nsSVGLength2 attribute LengthAttributesInfo lengthInfo = GetLengthInfo(); @@ -562,6 +624,12 @@ nsSVGElement::ParseAttribute(int32_t aNamespaceID, foundMatch = true; } } + + if (aAttribute == nsGkAtoms::_class) { + mClassAttribute.SetBaseValue(aValue, this, false); + aResult.ParseAtomArray(aValue); + return true; + } } if (!foundMatch) { @@ -788,6 +856,11 @@ nsSVGElement::UnsetAttrInternal(int32_t aNamespaceID, nsIAtom* aName, return; } } + + if (aName == nsGkAtoms::_class) { + mClassAttribute.Init(); + return; + } } // Check if this is a string attribute going away @@ -2618,6 +2691,10 @@ nsSVGElement::GetAnimatedAttr(int32_t aNamespaceID, nsIAtom* aName) } } } + + if (aName == nsGkAtoms::_class) { + return mClassAttribute.ToSMILAttr(this); + } } // Strings diff --git a/content/svg/content/src/nsSVGElement.h b/content/svg/content/src/nsSVGElement.h index d8ff8137b074..f803b45c6ec4 100644 --- a/content/svg/content/src/nsSVGElement.h +++ b/content/svg/content/src/nsSVGElement.h @@ -20,6 +20,7 @@ #include "mozilla/dom/Element.h" #include "nsISupportsImpl.h" #include "nsStyledElement.h" +#include "nsSVGClass.h" class nsIDOMSVGElement; class nsIDOMSVGSVGElement; @@ -74,6 +75,9 @@ public: // nsISupports NS_DECL_ISUPPORTS_INHERITED + virtual const nsAttrValue* DoGetClasses() const; + void DidAnimateClass(); + // nsIContent interface methods virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent, @@ -114,6 +118,9 @@ public: NS_IMETHOD SetId(const nsAString & aId); NS_IMETHOD GetOwnerSVGElement(nsIDOMSVGSVGElement** aOwnerSVGElement); NS_IMETHOD GetViewportElement(nsIDOMSVGElement** aViewportElement); + NS_IMETHOD GetClassName(nsIDOMSVGAnimatedString** aClassName); + NS_IMETHOD GetStyle(nsIDOMCSSStyleDeclaration** aStyle); + NS_IMETHOD GetPresentationAttribute(const nsAString& aName, nsIDOMCSSValue** aReturn); // Gets the element that establishes the rectangular viewport against which // we should resolve percentage lengths (our "coordinate context"). Returns @@ -597,6 +604,8 @@ private: void UnsetAttrInternal(int32_t aNameSpaceID, nsIAtom* aAttribute, bool aNotify); + nsSVGClass mClassAttribute; + nsAutoPtr mClassAnimAttr; nsRefPtr mContentStyleRule; }; diff --git a/content/svg/content/src/nsSVGFilters.h b/content/svg/content/src/nsSVGFilters.h index 2827328fde29..a6a76c55ee11 100644 --- a/content/svg/content/src/nsSVGFilters.h +++ b/content/svg/content/src/nsSVGFilters.h @@ -14,7 +14,7 @@ #include "nsImageLoadingContent.h" #include "nsSVGLength2.h" #include "nsSVGString.h" -#include "nsSVGStylableElement.h" +#include "nsSVGElement.h" #include "SVGAnimatedPreserveAspectRatio.h" class nsSVGFilterInstance; @@ -30,7 +30,7 @@ struct nsSVGStringInfo { nsSVGElement* mElement; }; -typedef nsSVGStylableElement nsSVGFEBase; +typedef nsSVGElement nsSVGFEBase; #define NS_SVG_FE_CID \ { 0x60483958, 0xd229, 0x4a77, \ diff --git a/content/svg/content/src/nsSVGGradientElement.cpp b/content/svg/content/src/nsSVGGradientElement.cpp index 2471c8856930..3dad01755ee2 100644 --- a/content/svg/content/src/nsSVGGradientElement.cpp +++ b/content/svg/content/src/nsSVGGradientElement.cpp @@ -11,7 +11,7 @@ #include "nsIDOMSVGGradientElement.h" #include "nsIDOMMutationEvent.h" #include "nsCOMPtr.h" -#include "nsSVGStylableElement.h" +#include "nsSVGElement.h" #include "nsGkAtoms.h" #include "nsSVGGradientElement.h" diff --git a/content/svg/content/src/nsSVGGradientElement.h b/content/svg/content/src/nsSVGGradientElement.h index b99d4461b0ee..d988cc37043c 100644 --- a/content/svg/content/src/nsSVGGradientElement.h +++ b/content/svg/content/src/nsSVGGradientElement.h @@ -10,7 +10,7 @@ #include "nsIDOMSVGGradientElement.h" #include "DOMSVGTests.h" #include "nsIDOMSVGUnitTypes.h" -#include "nsSVGStylableElement.h" +#include "nsSVGElement.h" #include "nsSVGLength2.h" #include "nsSVGEnum.h" #include "nsSVGString.h" @@ -18,7 +18,7 @@ //--------------------- Gradients------------------------ -typedef nsSVGStylableElement nsSVGGradientElementBase; +typedef nsSVGElement nsSVGGradientElementBase; class nsSVGGradientElement : public nsSVGGradientElementBase, public DOMSVGTests, diff --git a/content/svg/content/src/nsSVGGraphicElement.h b/content/svg/content/src/nsSVGGraphicElement.h index dbe5edb7f6da..f8b8dd26e8a2 100644 --- a/content/svg/content/src/nsSVGGraphicElement.h +++ b/content/svg/content/src/nsSVGGraphicElement.h @@ -9,10 +9,10 @@ #include "gfxMatrix.h" #include "nsIDOMSVGLocatable.h" #include "nsIDOMSVGTransformable.h" -#include "nsSVGStylableElement.h" +#include "nsSVGElement.h" #include "SVGAnimatedTransformList.h" -typedef nsSVGStylableElement nsSVGGraphicElementBase; +typedef nsSVGElement nsSVGGraphicElementBase; class nsSVGGraphicElement : public nsSVGGraphicElementBase, public nsIDOMSVGTransformable // : nsIDOMSVGLocatable diff --git a/content/svg/content/src/nsSVGMaskElement.h b/content/svg/content/src/nsSVGMaskElement.h index 56188b4645dc..74bab3c7b814 100644 --- a/content/svg/content/src/nsSVGMaskElement.h +++ b/content/svg/content/src/nsSVGMaskElement.h @@ -11,11 +11,11 @@ #include "nsIDOMSVGUnitTypes.h" #include "nsSVGEnum.h" #include "nsSVGLength2.h" -#include "nsSVGStylableElement.h" +#include "nsSVGElement.h" //--------------------- Masks ------------------------ -typedef nsSVGStylableElement nsSVGMaskElementBase; +typedef nsSVGElement nsSVGMaskElementBase; class nsSVGMaskElement : public nsSVGMaskElementBase, public nsIDOMSVGMaskElement, diff --git a/content/svg/content/src/nsSVGPatternElement.h b/content/svg/content/src/nsSVGPatternElement.h index f3fccbb8459c..879e2260d034 100644 --- a/content/svg/content/src/nsSVGPatternElement.h +++ b/content/svg/content/src/nsSVGPatternElement.h @@ -14,14 +14,14 @@ #include "nsSVGEnum.h" #include "nsSVGLength2.h" #include "nsSVGString.h" -#include "nsSVGStylableElement.h" +#include "nsSVGElement.h" #include "nsSVGViewBox.h" #include "SVGAnimatedPreserveAspectRatio.h" #include "SVGAnimatedTransformList.h" //--------------------- Patterns ------------------------ -typedef nsSVGStylableElement nsSVGPatternElementBase; +typedef nsSVGElement nsSVGPatternElementBase; class nsSVGPatternElement : public nsSVGPatternElementBase, public nsIDOMSVGPatternElement, diff --git a/content/svg/content/src/nsSVGSVGElement.h b/content/svg/content/src/nsSVGSVGElement.h index b66e30b33e0e..62ef05eb2218 100644 --- a/content/svg/content/src/nsSVGSVGElement.h +++ b/content/svg/content/src/nsSVGSVGElement.h @@ -15,7 +15,7 @@ #include "nsIDOMSVGZoomAndPan.h" #include "nsSVGEnum.h" #include "nsSVGLength2.h" -#include "nsSVGStylableElement.h" +#include "nsSVGElement.h" #include "nsSVGViewBox.h" #include "SVGPreserveAspectRatio.h" #include "SVGAnimatedPreserveAspectRatio.h" @@ -28,7 +28,7 @@ namespace mozilla { class SVGFragmentIdentifier; } -typedef nsSVGStylableElement nsSVGSVGElementBase; +typedef nsSVGElement nsSVGSVGElementBase; class nsSVGSVGElement; diff --git a/content/svg/content/src/nsSVGStopElement.cpp b/content/svg/content/src/nsSVGStopElement.cpp index 6efccecb9164..3c133cb81556 100644 --- a/content/svg/content/src/nsSVGStopElement.cpp +++ b/content/svg/content/src/nsSVGStopElement.cpp @@ -5,14 +5,14 @@ #include "mozilla/Util.h" -#include "nsSVGStylableElement.h" +#include "nsSVGElement.h" #include "nsIDOMSVGStopElement.h" #include "nsSVGNumber2.h" #include "nsGenericHTMLElement.h" using namespace mozilla; -typedef nsSVGStylableElement nsSVGStopElementBase; +typedef nsSVGElement nsSVGStopElementBase; class nsSVGStopElement : public nsSVGStopElementBase, public nsIDOMSVGStopElement diff --git a/content/svg/content/src/nsSVGStylableElement.cpp b/content/svg/content/src/nsSVGStylableElement.cpp deleted file mode 100644 index d70b900605b5..000000000000 --- a/content/svg/content/src/nsSVGStylableElement.cpp +++ /dev/null @@ -1,127 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "nsSVGStylableElement.h" -#include "nsGkAtoms.h" -#include "nsDOMCSSDeclaration.h" - -//---------------------------------------------------------------------- -// nsISupports methods - -NS_IMPL_ADDREF_INHERITED(nsSVGStylableElement, nsSVGStylableElementBase) -NS_IMPL_RELEASE_INHERITED(nsSVGStylableElement, nsSVGStylableElementBase) - -NS_INTERFACE_MAP_BEGIN(nsSVGStylableElement) - NS_INTERFACE_MAP_ENTRY(nsIDOMSVGStylable) -NS_INTERFACE_MAP_END_INHERITING(nsSVGStylableElementBase) - -//---------------------------------------------------------------------- -// Implementation - -nsSVGStylableElement::nsSVGStylableElement(already_AddRefed aNodeInfo) - : nsSVGStylableElementBase(aNodeInfo) -{ -} - -//---------------------------------------------------------------------- -// nsIContent methods - -const nsAttrValue* -nsSVGStylableElement::DoGetClasses() const -{ - if (mClassAttribute.IsAnimated()) { - return mClassAnimAttr; - } - return nsSVGStylableElementBase::DoGetClasses(); -} - -bool -nsSVGStylableElement::ParseAttribute(int32_t aNamespaceID, - nsIAtom* aAttribute, - const nsAString& aValue, - nsAttrValue& aResult) -{ - if (aNamespaceID == kNameSpaceID_None && aAttribute == nsGkAtoms::_class) { - mClassAttribute.SetBaseValue(aValue, this, false); - aResult.ParseAtomArray(aValue); - return true; - } - return nsSVGStylableElementBase::ParseAttribute(aNamespaceID, aAttribute, aValue, - aResult); -} - -nsresult -nsSVGStylableElement::UnsetAttr(int32_t aNamespaceID, nsIAtom* aName, - bool aNotify) -{ - if (aNamespaceID == kNameSpaceID_None && aName == nsGkAtoms::_class) { - mClassAttribute.Init(); - } - return nsSVGStylableElementBase::UnsetAttr(aNamespaceID, aName, aNotify); -} - -//---------------------------------------------------------------------- -// nsIDOMSVGStylable methods - -/* readonly attribute nsIDOMSVGAnimatedString className; */ -NS_IMETHODIMP -nsSVGStylableElement::GetClassName(nsIDOMSVGAnimatedString** aClassName) -{ - return mClassAttribute.ToDOMAnimatedString(aClassName, this); -} - -/* readonly attribute nsIDOMCSSStyleDeclaration style; */ -NS_IMETHODIMP -nsSVGStylableElement::GetStyle(nsIDOMCSSStyleDeclaration** aStyle) -{ - nsresult rv; - *aStyle = GetStyle(&rv); - if (NS_FAILED(rv)) { - return rv; - } - NS_ADDREF(*aStyle); - return NS_OK; -} - -/* nsIDOMCSSValue getPresentationAttribute (in DOMString name); */ -NS_IMETHODIMP -nsSVGStylableElement::GetPresentationAttribute(const nsAString& aName, - nsIDOMCSSValue** aReturn) -{ - // Let's not implement this just yet. The CSSValue interface has been - // deprecated by the CSS WG. - // http://lists.w3.org/Archives/Public/www-style/2003Oct/0347.html - - return NS_ERROR_NOT_IMPLEMENTED; -} - -//---------------------------------------------------------------------- -// nsSVGElement methods - -void -nsSVGStylableElement::DidAnimateClass() -{ - nsAutoString src; - mClassAttribute.GetAnimValue(src, this); - if (!mClassAnimAttr) { - mClassAnimAttr = new nsAttrValue(); - } - mClassAnimAttr->ParseAtomArray(src); - - nsIPresShell* shell = OwnerDoc()->GetShell(); - if (shell) { - shell->RestyleForAnimation(this, eRestyle_Self); - } -} - -nsISMILAttr* -nsSVGStylableElement::GetAnimatedAttr(int32_t aNamespaceID, nsIAtom* aName) -{ - if (aNamespaceID == kNameSpaceID_None && - aName == nsGkAtoms::_class) { - return mClassAttribute.ToSMILAttr(this); - } - return nsSVGStylableElementBase::GetAnimatedAttr(aNamespaceID, aName); -} diff --git a/content/svg/content/src/nsSVGStylableElement.h b/content/svg/content/src/nsSVGStylableElement.h deleted file mode 100644 index 5c839f4f130a..000000000000 --- a/content/svg/content/src/nsSVGStylableElement.h +++ /dev/null @@ -1,49 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef __NS_SVGSTYLABLEELEMENT_H__ -#define __NS_SVGSTYLABLEELEMENT_H__ - -#include "nsAutoPtr.h" -#include "nsIDOMSVGStylable.h" -#include "nsSVGClass.h" -#include "nsSVGElement.h" - -typedef nsSVGElement nsSVGStylableElementBase; - -class nsSVGStylableElement : public nsSVGStylableElementBase, - public nsIDOMSVGStylable -{ -protected: - nsSVGStylableElement(already_AddRefed aNodeInfo); - -public: - // interfaces: - NS_DECL_ISUPPORTS_INHERITED - NS_DECL_NSIDOMSVGSTYLABLE - - // nsIContent - virtual const nsAttrValue* DoGetClasses() const; - - nsICSSDeclaration* GetStyle(nsresult* retval) - { - return nsSVGStylableElementBase::GetStyle(retval); - } - virtual bool ParseAttribute(int32_t aNamespaceID, nsIAtom* aAttribute, - const nsAString& aValue, nsAttrValue& aResult); - virtual nsresult UnsetAttr(int32_t aNameSpaceID, nsIAtom* aAttribute, - bool aNotify); - - virtual nsISMILAttr* GetAnimatedAttr(int32_t aNamespaceID, nsIAtom* aName); - - void DidAnimateClass(); - -protected: - nsSVGClass mClassAttribute; - nsAutoPtr mClassAnimAttr; -}; - - -#endif // __NS_SVGSTYLABLEELEMENT_H__ diff --git a/content/svg/content/src/nsSVGSymbolElement.cpp b/content/svg/content/src/nsSVGSymbolElement.cpp index bdc9a3e60c29..3cfdc391a6d0 100644 --- a/content/svg/content/src/nsSVGSymbolElement.cpp +++ b/content/svg/content/src/nsSVGSymbolElement.cpp @@ -7,14 +7,14 @@ #include "nsIDOMSVGSymbolElement.h" #include "DOMSVGTests.h" -#include "nsSVGStylableElement.h" +#include "nsSVGElement.h" #include "nsSVGViewBox.h" #include "SVGAnimatedPreserveAspectRatio.h" #include "nsIDOMSVGFitToViewBox.h" #include "nsGkAtoms.h" using namespace mozilla; -typedef nsSVGStylableElement nsSVGSymbolElementBase; +typedef nsSVGElement nsSVGSymbolElementBase; class nsSVGSymbolElement : public nsSVGSymbolElementBase, public nsIDOMSVGSymbolElement, diff --git a/content/svg/content/src/nsSVGTextContentElement.h b/content/svg/content/src/nsSVGTextContentElement.h index ac976faa7036..feb0fc42b5e6 100644 --- a/content/svg/content/src/nsSVGTextContentElement.h +++ b/content/svg/content/src/nsSVGTextContentElement.h @@ -8,10 +8,10 @@ #include "DOMSVGTests.h" #include "nsIDOMSVGTextContentElement.h" -#include "nsSVGStylableElement.h" +#include "nsSVGElement.h" #include "nsSVGTextContainerFrame.h" -typedef nsSVGStylableElement nsSVGTextContentElementBase; +typedef nsSVGElement nsSVGTextContentElementBase; /** * Note that nsSVGTextElement does not inherit nsSVGTextPositioningElement, or diff --git a/content/svg/content/src/nsSVGTextPathElement.cpp b/content/svg/content/src/nsSVGTextPathElement.cpp index a92a9f9d3958..ebbce705dc81 100644 --- a/content/svg/content/src/nsSVGTextPathElement.cpp +++ b/content/svg/content/src/nsSVGTextPathElement.cpp @@ -5,7 +5,7 @@ #include "mozilla/Util.h" -#include "nsSVGStylableElement.h" +#include "nsSVGElement.h" #include "nsGkAtoms.h" #include "nsIDOMSVGTextPathElement.h" #include "nsIDOMSVGURIReference.h" diff --git a/content/svg/content/src/nsSVGTitleElement.cpp b/content/svg/content/src/nsSVGTitleElement.cpp index 54ee079640fb..e6a19bb299cf 100644 --- a/content/svg/content/src/nsSVGTitleElement.cpp +++ b/content/svg/content/src/nsSVGTitleElement.cpp @@ -3,11 +3,11 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "nsSVGStylableElement.h" +#include "nsSVGElement.h" #include "nsIDOMSVGTitleElement.h" #include "nsStubMutationObserver.h" -typedef nsSVGStylableElement nsSVGTitleElementBase; +typedef nsSVGElement nsSVGTitleElementBase; class nsSVGTitleElement : public nsSVGTitleElementBase, public nsIDOMSVGTitleElement, diff --git a/dom/base/nsDOMClassInfo.cpp b/dom/base/nsDOMClassInfo.cpp index 37d756ec83db..516480231723 100644 --- a/dom/base/nsDOMClassInfo.cpp +++ b/dom/base/nsDOMClassInfo.cpp @@ -358,7 +358,6 @@ #include "nsIDOMSVGRectElement.h" #include "nsIDOMSVGScriptElement.h" #include "nsIDOMSVGStopElement.h" -#include "nsIDOMSVGStylable.h" #include "nsIDOMSVGStyleElement.h" #include "nsIDOMSVGSVGElement.h" #include "nsIDOMSVGSwitchElement.h" @@ -2999,13 +2998,11 @@ nsDOMClassInfo::Init() #define DOM_CLASSINFO_SVG_TEXT_CONTENT_ELEMENT_MAP_ENTRIES \ DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGTextContentElement) \ DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGTests) \ - DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable) \ DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES #define DOM_CLASSINFO_SVG_GRAPHIC_ELEMENT_MAP_ENTRIES \ DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGLocatable) \ DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGTransformable) \ - DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable) \ DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES // XXX - the proto chain stuff is sort of hackish, because of the MI in @@ -3104,7 +3101,6 @@ nsDOMClassInfo::Init() DOM_CLASSINFO_MAP_BEGIN(SVGDescElement, nsIDOMSVGDescElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGDescElement) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable) DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES DOM_CLASSINFO_MAP_END @@ -3117,49 +3113,42 @@ nsDOMClassInfo::Init() DOM_CLASSINFO_MAP_BEGIN(SVGFEBlendElement, nsIDOMSVGFEBlendElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFEBlendElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFilterPrimitiveStandardAttributes) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable) DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES DOM_CLASSINFO_MAP_END DOM_CLASSINFO_MAP_BEGIN(SVGFEColorMatrixElement, nsIDOMSVGFEColorMatrixElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFEColorMatrixElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFilterPrimitiveStandardAttributes) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable) DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES DOM_CLASSINFO_MAP_END DOM_CLASSINFO_MAP_BEGIN(SVGFEComponentTransferElement, nsIDOMSVGFEComponentTransferElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFEComponentTransferElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFilterPrimitiveStandardAttributes) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable) DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES DOM_CLASSINFO_MAP_END DOM_CLASSINFO_MAP_BEGIN(SVGFECompositeElement, nsIDOMSVGFECompositeElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFECompositeElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFilterPrimitiveStandardAttributes) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable) DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES DOM_CLASSINFO_MAP_END DOM_CLASSINFO_MAP_BEGIN(SVGFEConvolveMatrixElement, nsIDOMSVGFEConvolveMatrixElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFEConvolveMatrixElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFilterPrimitiveStandardAttributes) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable) DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES DOM_CLASSINFO_MAP_END DOM_CLASSINFO_MAP_BEGIN(SVGFEDiffuseLightingElement, nsIDOMSVGFEDiffuseLightingElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFEDiffuseLightingElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFilterPrimitiveStandardAttributes) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable) DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES DOM_CLASSINFO_MAP_END DOM_CLASSINFO_MAP_BEGIN(SVGFEDisplacementMapElement, nsIDOMSVGFEDisplacementMapElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFEDisplacementMapElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFilterPrimitiveStandardAttributes) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable) DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES DOM_CLASSINFO_MAP_END @@ -3171,7 +3160,6 @@ nsDOMClassInfo::Init() DOM_CLASSINFO_MAP_BEGIN(SVGFEFloodElement, nsIDOMSVGFEFloodElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFEFloodElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFilterPrimitiveStandardAttributes) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable) DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES DOM_CLASSINFO_MAP_END @@ -3198,7 +3186,6 @@ nsDOMClassInfo::Init() DOM_CLASSINFO_MAP_BEGIN(SVGFEGaussianBlurElement, nsIDOMSVGFEGaussianBlurElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFEGaussianBlurElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFilterPrimitiveStandardAttributes) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable) DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES DOM_CLASSINFO_MAP_END @@ -3206,21 +3193,18 @@ nsDOMClassInfo::Init() DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFEImageElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFilterPrimitiveStandardAttributes) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGURIReference) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable) DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES DOM_CLASSINFO_MAP_END DOM_CLASSINFO_MAP_BEGIN(SVGFEMergeElement, nsIDOMSVGFEMergeElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFEMergeElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFilterPrimitiveStandardAttributes) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable) DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES DOM_CLASSINFO_MAP_END DOM_CLASSINFO_MAP_BEGIN(SVGFEMorphologyElement, nsIDOMSVGFEMorphologyElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFEMorphologyElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFilterPrimitiveStandardAttributes) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable) DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES DOM_CLASSINFO_MAP_END @@ -3232,7 +3216,6 @@ nsDOMClassInfo::Init() DOM_CLASSINFO_MAP_BEGIN(SVGFEOffsetElement, nsIDOMSVGFEOffsetElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFEOffsetElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFilterPrimitiveStandardAttributes) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable) DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES DOM_CLASSINFO_MAP_END @@ -3244,7 +3227,6 @@ nsDOMClassInfo::Init() DOM_CLASSINFO_MAP_BEGIN(SVGFESpecularLightingElement, nsIDOMSVGFESpecularLightingElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFESpecularLightingElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFilterPrimitiveStandardAttributes) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable) DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES DOM_CLASSINFO_MAP_END @@ -3256,14 +3238,12 @@ nsDOMClassInfo::Init() DOM_CLASSINFO_MAP_BEGIN(SVGFETileElement, nsIDOMSVGFETileElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFETileElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFilterPrimitiveStandardAttributes) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable) DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES DOM_CLASSINFO_MAP_END DOM_CLASSINFO_MAP_BEGIN(SVGFETurbulenceElement, nsIDOMSVGFETurbulenceElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFETurbulenceElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFilterPrimitiveStandardAttributes) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable) DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES DOM_CLASSINFO_MAP_END @@ -3271,7 +3251,6 @@ nsDOMClassInfo::Init() DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFilterElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGTests) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGURIReference) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGUnitTypes) DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES DOM_CLASSINFO_MAP_END @@ -3300,7 +3279,6 @@ nsDOMClassInfo::Init() DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGLinearGradientElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGTests) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGURIReference) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGUnitTypes) DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES DOM_CLASSINFO_MAP_END @@ -3313,7 +3291,6 @@ nsDOMClassInfo::Init() DOM_CLASSINFO_MAP_BEGIN(SVGMarkerElement, nsIDOMSVGMarkerElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGMarkerElement) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFitToViewBox) DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES DOM_CLASSINFO_MAP_END @@ -3321,7 +3298,6 @@ nsDOMClassInfo::Init() DOM_CLASSINFO_MAP_BEGIN(SVGMaskElement, nsIDOMSVGMaskElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGMaskElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGTests) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGUnitTypes) DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES DOM_CLASSINFO_MAP_END @@ -3343,7 +3319,6 @@ nsDOMClassInfo::Init() DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGTests) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFitToViewBox) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGURIReference) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGUnitTypes) DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES DOM_CLASSINFO_MAP_END @@ -3367,7 +3342,6 @@ nsDOMClassInfo::Init() DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGRadialGradientElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGTests) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGURIReference) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGUnitTypes) DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES DOM_CLASSINFO_MAP_END @@ -3386,7 +3360,6 @@ nsDOMClassInfo::Init() DOM_CLASSINFO_MAP_BEGIN(SVGStopElement, nsIDOMSVGStopElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStopElement) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable) DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES DOM_CLASSINFO_MAP_END @@ -3401,7 +3374,6 @@ nsDOMClassInfo::Init() DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFitToViewBox) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGLocatable) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGTests) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGZoomAndPan) DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES DOM_CLASSINFO_MAP_END @@ -3417,7 +3389,6 @@ nsDOMClassInfo::Init() DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGSymbolElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGTests) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFitToViewBox) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable) DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES DOM_CLASSINFO_MAP_END @@ -3435,7 +3406,6 @@ nsDOMClassInfo::Init() DOM_CLASSINFO_MAP_BEGIN(SVGTitleElement, nsIDOMSVGTitleElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGTitleElement) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable) DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES DOM_CLASSINFO_MAP_END diff --git a/dom/base/nsDOMClassInfoID.h b/dom/base/nsDOMClassInfoID.h index be303db8c4c4..097bc2eb290a 100644 --- a/dom/base/nsDOMClassInfoID.h +++ b/dom/base/nsDOMClassInfoID.h @@ -60,8 +60,8 @@ DOMCI_CASTABLE_INTERFACE(nsGenericHTMLElement, nsGenericHTMLElement, 6, \ _extra) \ DOMCI_CASTABLE_INTERFACE(nsHTMLDocument, nsIDocument, 7, _extra) \ DOMCI_CASTABLE_INTERFACE(nsStyledElement, nsStyledElement, 8, _extra) \ -DOMCI_CASTABLE_INTERFACE(nsSVGStylableElement, nsIContent, 9, _extra) - +DOMCI_CASTABLE_INTERFACE(nsSVGElement, nsIContent, 9, _extra) + // Make sure all classes mentioned in DOMCI_CASTABLE_INTERFACES // have been declared. #define DOMCI_CASTABLE_NODECL_INTERFACE(_interface, _u1, _u2, _u3) /* Nothing */ diff --git a/dom/interfaces/svg/Makefile.in b/dom/interfaces/svg/Makefile.in index 601a742b357e..16296b40735a 100644 --- a/dom/interfaces/svg/Makefile.in +++ b/dom/interfaces/svg/Makefile.in @@ -65,7 +65,6 @@ XPIDLSRCS = \ nsIDOMSVGSVGElement.idl \ nsIDOMSVGStopElement.idl \ nsIDOMSVGStringList.idl \ - nsIDOMSVGStylable.idl \ nsIDOMSVGStyleElement.idl \ nsIDOMSVGSwitchElement.idl \ nsIDOMSVGSymbolElement.idl \ diff --git a/dom/interfaces/svg/nsIDOMSVGElement.idl b/dom/interfaces/svg/nsIDOMSVGElement.idl index a29ae317bb27..894160df239f 100644 --- a/dom/interfaces/svg/nsIDOMSVGElement.idl +++ b/dom/interfaces/svg/nsIDOMSVGElement.idl @@ -6,12 +6,21 @@ #include "nsIDOMElement.idl" interface nsIDOMSVGSVGElement; +interface nsIDOMSVGAnimatedString; +interface nsIDOMCSSStyleDeclaration; +interface nsIDOMCSSValue; -[scriptable, uuid(9B16734D-DBFD-4465-8EAF-354694934A1D)] -interface nsIDOMSVGElement : nsIDOMElement -{ + +[scriptable, uuid(7ccf8faf-29b4-4113-bb23-bc187bac27cf)] +interface nsIDOMSVGElement : nsIDOMElement +{ attribute DOMString id; // raises DOMException on setting readonly attribute nsIDOMSVGSVGElement ownerSVGElement; readonly attribute nsIDOMSVGElement viewportElement; + + readonly attribute nsIDOMSVGAnimatedString className; + readonly attribute nsIDOMCSSStyleDeclaration style; + + nsIDOMCSSValue getPresentationAttribute(in DOMString name); }; diff --git a/dom/interfaces/svg/nsIDOMSVGFilters.idl b/dom/interfaces/svg/nsIDOMSVGFilters.idl index 9dd57f150c3b..3de94407e397 100644 --- a/dom/interfaces/svg/nsIDOMSVGFilters.idl +++ b/dom/interfaces/svg/nsIDOMSVGFilters.idl @@ -4,7 +4,6 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "nsIDOMSVGElement.idl" -#include "nsIDOMSVGStylable.idl" interface nsIDOMSVGAnimatedLength; interface nsIDOMSVGAnimatedString; diff --git a/dom/interfaces/svg/nsIDOMSVGStylable.idl b/dom/interfaces/svg/nsIDOMSVGStylable.idl deleted file mode 100644 index 48188f7972ff..000000000000 --- a/dom/interfaces/svg/nsIDOMSVGStylable.idl +++ /dev/null @@ -1,19 +0,0 @@ -/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "domstubs.idl" - -interface nsIDOMSVGAnimatedString; -interface nsIDOMCSSStyleDeclaration; -interface nsIDOMCSSValue; - -[scriptable, uuid(ea8a6cb1-9176-45db-989d-d0e89f563d7e)] -interface nsIDOMSVGStylable : nsISupports -{ - readonly attribute nsIDOMSVGAnimatedString className; - readonly attribute nsIDOMCSSStyleDeclaration style; - - nsIDOMCSSValue getPresentationAttribute(in DOMString name); -}; diff --git a/js/xpconnect/src/dom_quickstubs.qsconf b/js/xpconnect/src/dom_quickstubs.qsconf index d01429190e65..824b54ab9c0a 100644 --- a/js/xpconnect/src/dom_quickstubs.qsconf +++ b/js/xpconnect/src/dom_quickstubs.qsconf @@ -277,7 +277,8 @@ members = [ # dom/interfaces/stylesheets - None. # dom/interfaces/svg - None. - 'nsIDOMSVGStylable.*', + 'nsIDOMSVGElement.className', + 'nsIDOMSVGElement.style', # dom/interfaces/traversal 'nsIDOMNodeIterator.nextNode', @@ -377,7 +378,7 @@ customIncludes = [ 'nsGenericDOMDataNode.h', 'mozilla/dom/Element.h', 'nsGenericHTMLElement.h', - 'nsSVGStylableElement.h', + 'nsSVGElement.h', 'nsHTMLDocument.h', 'nsDOMQS.h', 'nsDOMStringMap.h', @@ -469,10 +470,10 @@ customMethodCalls = { ' nsIDOMCSSStyleDeclaration* result = ' 'self->GetStyle(&rv);' }, - 'nsIDOMSVGStylable_GetStyle': { - 'thisType': 'nsSVGStylableElement', + 'nsIDOMSVGElement_GetStyle': { + 'thisType': 'nsSVGElement', 'code': ' nsICSSDeclaration* result = ' - 'self->GetStyle(&rv);' + 'self->nsSVGElementBase::GetStyle(&rv);' }, 'nsIDOMWindow_GetOnmouseenter' : { 'thisType' : 'nsIDOMWindow', diff --git a/js/xpconnect/src/nsDOMQS.h b/js/xpconnect/src/nsDOMQS.h index 2459781e2381..b9dfed41096b 100644 --- a/js/xpconnect/src/nsDOMQS.h +++ b/js/xpconnect/src/nsDOMQS.h @@ -15,7 +15,7 @@ #include "nsHTMLVideoElement.h" #include "nsHTMLDocument.h" #include "nsICSSDeclaration.h" -#include "nsSVGStylableElement.h" +#include "nsSVGElement.h" #include "mozilla/dom/EventTargetBinding.h" #include "mozilla/dom/NodeBinding.h" #include "mozilla/dom/ElementBinding.h" diff --git a/layout/reftests/svg/reftest.list b/layout/reftests/svg/reftest.list index 90f7ae7a76f5..035415e49fc4 100644 --- a/layout/reftests/svg/reftest.list +++ b/layout/reftests/svg/reftest.list @@ -242,7 +242,7 @@ random-if(gtk2Widget) == objectBoundingBox-and-fePointLight-02.svg objectBoundin == script-empty-01.svg pass.svg == selector-01.svg pass.svg == stroke-width-percentage-01.svg pass.svg -== style-property-not-on-script-element-01.svg pass.svg +== style-property-on-script-element-01.svg pass.svg == style-without-type-attribute.svg pass.svg == svg-in-foreignObject-01.xhtml svg-in-foreignObject-01-ref.xhtml == svg-in-foreignObject-02.xhtml svg-in-foreignObject-01-ref.xhtml # reuse -01-ref.xhtml diff --git a/layout/reftests/svg/style-property-not-on-script-element-01.svg b/layout/reftests/svg/style-property-on-script-element-01.svg similarity index 64% rename from layout/reftests/svg/style-property-not-on-script-element-01.svg rename to layout/reftests/svg/style-property-on-script-element-01.svg index 40ce4ebd5699..f4f76157bd10 100644 --- a/layout/reftests/svg/style-property-not-on-script-element-01.svg +++ b/layout/reftests/svg/style-property-on-script-element-01.svg @@ -4,16 +4,16 @@ --> - Testcase ensuring 'style' is not a property of SVGScriptElement + Testcase ensuring 'style' is a property of SVGScriptElement - +