Bug 847120: Convert SVGFEColorMatrixElement to WebIDL r=Ms2ger
authorDavid Zbarsky <dzbarsky@gmail.com>
Mon, 18 Mar 2013 19:14:40 -0400
changeset 131762 1a4518e6fdb82ba8e643220351c7ed8938c1a01c
parent 131761 1de3ed642b6d8ac52c8a979011a20b6b9e196dbc
child 131763 8b5889e318d6a511aa26492511629f588457219c
push idunknown
push userunknown
push dateunknown
reviewersMs2ger
bugs847120
milestone22.0a1
Bug 847120: Convert SVGFEColorMatrixElement to WebIDL r=Ms2ger
content/svg/content/src/SVGFEColorMatrixElement.cpp
content/svg/content/src/SVGFEColorMatrixElement.h
content/svg/content/src/nsSVGFilters.cpp
dom/base/nsDOMClassInfo.cpp
dom/base/nsDOMClassInfoClasses.h
dom/interfaces/svg/nsIDOMSVGFilters.idl
dom/webidl/SVGFEColorMatrixElement.webidl
dom/webidl/WebIDL.mk
--- a/content/svg/content/src/SVGFEColorMatrixElement.cpp
+++ b/content/svg/content/src/SVGFEColorMatrixElement.cpp
@@ -1,117 +1,121 @@
 /* a*- 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 "DOMSVGAnimatedNumberList.h"
 #include "mozilla/dom/SVGFEColorMatrixElement.h"
+#include "mozilla/dom/SVGFEColorMatrixElementBinding.h"
+#include "nsSVGUtils.h"
+
+#define NUM_ENTRIES_IN_4x5_MATRIX 20
+
+NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(FEColorMatrix)
 
 namespace mozilla {
 namespace dom {
 
-nsSVGEnumMapping nsSVGFEColorMatrixElement::sTypeMap[] = {
-  {&nsGkAtoms::matrix, nsSVGFEColorMatrixElement::SVG_FECOLORMATRIX_TYPE_MATRIX},
-  {&nsGkAtoms::saturate, nsSVGFEColorMatrixElement::SVG_FECOLORMATRIX_TYPE_SATURATE},
-  {&nsGkAtoms::hueRotate, nsSVGFEColorMatrixElement::SVG_FECOLORMATRIX_TYPE_HUE_ROTATE},
-  {&nsGkAtoms::luminanceToAlpha, nsSVGFEColorMatrixElement::SVG_FECOLORMATRIX_TYPE_LUMINANCE_TO_ALPHA},
+JSObject*
+SVGFEColorMatrixElement::WrapNode(JSContext* aCx, JSObject* aScope)
+{
+  return SVGFEColorMatrixElementBinding::Wrap(aCx, aScope, this);
+}
+
+nsSVGEnumMapping SVGFEColorMatrixElement::sTypeMap[] = {
+  {&nsGkAtoms::matrix, SVG_FECOLORMATRIX_TYPE_MATRIX},
+  {&nsGkAtoms::saturate, SVG_FECOLORMATRIX_TYPE_SATURATE},
+  {&nsGkAtoms::hueRotate, SVG_FECOLORMATRIX_TYPE_HUE_ROTATE},
+  {&nsGkAtoms::luminanceToAlpha, SVG_FECOLORMATRIX_TYPE_LUMINANCE_TO_ALPHA},
   {nullptr, 0}
 };
 
-nsSVGElement::EnumInfo nsSVGFEColorMatrixElement::sEnumInfo[1] =
+nsSVGElement::EnumInfo SVGFEColorMatrixElement::sEnumInfo[1] =
 {
   { &nsGkAtoms::type,
     sTypeMap,
-    nsSVGFEColorMatrixElement::SVG_FECOLORMATRIX_TYPE_MATRIX
+    SVG_FECOLORMATRIX_TYPE_MATRIX
   }
 };
 
-nsSVGElement::StringInfo nsSVGFEColorMatrixElement::sStringInfo[2] =
+nsSVGElement::StringInfo SVGFEColorMatrixElement::sStringInfo[2] =
 {
   { &nsGkAtoms::result, kNameSpaceID_None, true },
   { &nsGkAtoms::in, kNameSpaceID_None, true }
 };
 
-nsSVGElement::NumberListInfo nsSVGFEColorMatrixElement::sNumberListInfo[1] =
+nsSVGElement::NumberListInfo SVGFEColorMatrixElement::sNumberListInfo[1] =
 {
   { &nsGkAtoms::values }
 };
 
-NS_IMPL_NS_NEW_SVG_ELEMENT(FEColorMatrix)
-
 //----------------------------------------------------------------------
 // nsISupports methods
 
-NS_IMPL_ADDREF_INHERITED(nsSVGFEColorMatrixElement,nsSVGFEColorMatrixElementBase)
-NS_IMPL_RELEASE_INHERITED(nsSVGFEColorMatrixElement,nsSVGFEColorMatrixElementBase)
-
-DOMCI_NODE_DATA(SVGFEColorMatrixElement, nsSVGFEColorMatrixElement)
+NS_IMPL_ADDREF_INHERITED(SVGFEColorMatrixElement,SVGFEColorMatrixElementBase)
+NS_IMPL_RELEASE_INHERITED(SVGFEColorMatrixElement,SVGFEColorMatrixElementBase)
 
-NS_INTERFACE_TABLE_HEAD(nsSVGFEColorMatrixElement)
-  NS_NODE_INTERFACE_TABLE5(nsSVGFEColorMatrixElement, nsIDOMNode, nsIDOMElement,
-                           nsIDOMSVGElement,
-                           nsIDOMSVGFilterPrimitiveStandardAttributes,
-                           nsIDOMSVGFEColorMatrixElement)
-  NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGFEColorMatrixElement)
-NS_INTERFACE_MAP_END_INHERITING(nsSVGFEColorMatrixElementBase)
+NS_INTERFACE_TABLE_HEAD(SVGFEColorMatrixElement)
+  NS_NODE_INTERFACE_TABLE3(SVGFEColorMatrixElement, nsIDOMNode, nsIDOMElement,
+                           nsIDOMSVGElement)
+NS_INTERFACE_MAP_END_INHERITING(SVGFEColorMatrixElementBase)
 
 
 //----------------------------------------------------------------------
 // nsIDOMNode methods
 
 
-NS_IMPL_ELEMENT_CLONE_WITH_INIT(nsSVGFEColorMatrixElement)
+NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEColorMatrixElement)
 
 
 //----------------------------------------------------------------------
-// nsSVGFEColorMatrixElement methods
 
-/* readonly attribute nsIDOMSVGAnimatedString in1; */
-NS_IMETHODIMP nsSVGFEColorMatrixElement::GetIn1(nsIDOMSVGAnimatedString * *aIn)
+already_AddRefed<nsIDOMSVGAnimatedString>
+SVGFEColorMatrixElement::In1()
 {
-  return mStringAttributes[IN1].ToDOMAnimatedString(aIn, this);
+  return mStringAttributes[IN1].ToDOMAnimatedString(this);
 }
 
-/* readonly attribute nsIDOMSVGAnimatedEnumeration type; */
-NS_IMETHODIMP nsSVGFEColorMatrixElement::GetType(nsIDOMSVGAnimatedEnumeration * *aType)
+already_AddRefed<nsIDOMSVGAnimatedEnumeration>
+SVGFEColorMatrixElement::Type()
 {
-  return mEnumAttributes[TYPE].ToDOMAnimatedEnum(aType, this);
+  return mEnumAttributes[TYPE].ToDOMAnimatedEnum(this);
 }
 
-/* readonly attribute DOMSVGAnimatedNumberList values; */
-NS_IMETHODIMP nsSVGFEColorMatrixElement::GetValues(nsISupports * *aValues)
+already_AddRefed<DOMSVGAnimatedNumberList>
+SVGFEColorMatrixElement::Values()
 {
-  *aValues = DOMSVGAnimatedNumberList::GetDOMWrapper(&mNumberListAttributes[VALUES],
-                                                     this, VALUES).get();
-  return NS_OK;
+  return DOMSVGAnimatedNumberList::GetDOMWrapper(&mNumberListAttributes[VALUES],
+                                                 this, VALUES);
 }
 
 void
-nsSVGFEColorMatrixElement::GetSourceImageNames(nsTArray<nsSVGStringInfo>& aSources)
+SVGFEColorMatrixElement::GetSourceImageNames(nsTArray<nsSVGStringInfo>& aSources)
 {
   aSources.AppendElement(nsSVGStringInfo(&mStringAttributes[IN1], this));
 }
 
 nsresult
-nsSVGFEColorMatrixElement::Filter(nsSVGFilterInstance *instance,
-                                  const nsTArray<const Image*>& aSources,
-                                  const Image* aTarget,
-                                  const nsIntRect& rect)
+SVGFEColorMatrixElement::Filter(nsSVGFilterInstance* instance,
+                                const nsTArray<const Image*>& aSources,
+                                const Image* aTarget,
+                                const nsIntRect& rect)
 {
   uint8_t* sourceData = aSources[0]->mImage->Data();
   uint8_t* targetData = aTarget->mImage->Data();
   uint32_t stride = aTarget->mImage->Stride();
 
   uint16_t type = mEnumAttributes[TYPE].GetAnimValue();
   const SVGNumberList &values = mNumberListAttributes[VALUES].GetAnimValue();
 
   if (!mNumberListAttributes[VALUES].IsExplicitlySet() &&
-      (type == nsSVGFEColorMatrixElement::SVG_FECOLORMATRIX_TYPE_MATRIX ||
-       type == nsSVGFEColorMatrixElement::SVG_FECOLORMATRIX_TYPE_SATURATE ||
-       type == nsSVGFEColorMatrixElement::SVG_FECOLORMATRIX_TYPE_HUE_ROTATE)) {
+      (type == SVG_FECOLORMATRIX_TYPE_MATRIX ||
+       type == SVG_FECOLORMATRIX_TYPE_SATURATE ||
+       type == SVG_FECOLORMATRIX_TYPE_HUE_ROTATE)) {
     // identity matrix filter
     CopyRect(aTarget, aSources[0], rect);
     return NS_OK;
   }
 
   static const float identityMatrix[] = 
     { 1, 0, 0, 0, 0,
       0, 1, 0, 0, 0,
@@ -123,26 +127,26 @@ nsSVGFEColorMatrixElement::Filter(nsSVGF
       0,       0,       0,       0, 0,
       0,       0,       0,       0, 0,
       0.2125f, 0.7154f, 0.0721f, 0, 0 };
 
   float colorMatrix[NUM_ENTRIES_IN_4x5_MATRIX];
   float s, c;
 
   switch (type) {
-  case nsSVGFEColorMatrixElement::SVG_FECOLORMATRIX_TYPE_MATRIX:
+  case SVG_FECOLORMATRIX_TYPE_MATRIX:
 
     if (values.Length() != NUM_ENTRIES_IN_4x5_MATRIX)
       return NS_ERROR_FAILURE;
 
     for(uint32_t j = 0; j < values.Length(); j++) {
       colorMatrix[j] = values[j];
     }
     break;
-  case nsSVGFEColorMatrixElement::SVG_FECOLORMATRIX_TYPE_SATURATE:
+  case SVG_FECOLORMATRIX_TYPE_SATURATE:
 
     if (values.Length() != 1)
       return NS_ERROR_FAILURE;
 
     s = values[0];
 
     if (s > 1 || s < 0)
       return NS_ERROR_FAILURE;
@@ -158,17 +162,17 @@ nsSVGFEColorMatrixElement::Filter(nsSVGF
     colorMatrix[7] = 0.072f - 0.072f * s;
 
     colorMatrix[10] = 0.213f - 0.213f * s;
     colorMatrix[11] = 0.715f - 0.715f * s;
     colorMatrix[12] = 0.072f + 0.928f * s;
 
     break;
 
-  case nsSVGFEColorMatrixElement::SVG_FECOLORMATRIX_TYPE_HUE_ROTATE:
+  case SVG_FECOLORMATRIX_TYPE_HUE_ROTATE:
   {
     memcpy(colorMatrix, identityMatrix, sizeof(colorMatrix));
 
     if (values.Length() != 1)
       return NS_ERROR_FAILURE;
 
     float hueRotateValue = values[0];
 
@@ -187,17 +191,17 @@ nsSVGFEColorMatrixElement::Filter(nsSVGF
 
     colorMatrix[10] = 0.213f - 0.213f * c - 0.787f * s;
     colorMatrix[11] = 0.715f - 0.715f * c + 0.715f * s;
     colorMatrix[12] = 0.072f + 0.928f * c + 0.072f * s;
 
     break;
   }
 
-  case nsSVGFEColorMatrixElement::SVG_FECOLORMATRIX_TYPE_LUMINANCE_TO_ALPHA:
+  case SVG_FECOLORMATRIX_TYPE_LUMINANCE_TO_ALPHA:
 
     memcpy(colorMatrix, luminanceToAlphaMatrix, sizeof(colorMatrix));
     break;
 
   default:
     return NS_ERROR_FAILURE;
   }
 
@@ -224,44 +228,44 @@ nsSVGFEColorMatrixElement::Filter(nsSVGF
       targetData[targIndex + GFX_ARGB32_OFFSET_A] =
         static_cast<uint8_t>(col[3]);
     }
   }
   return NS_OK;
 }
 
 bool
-nsSVGFEColorMatrixElement::AttributeAffectsRendering(int32_t aNameSpaceID,
-                                                     nsIAtom* aAttribute) const
+SVGFEColorMatrixElement::AttributeAffectsRendering(int32_t aNameSpaceID,
+                                                   nsIAtom* aAttribute) const
 {
-  return nsSVGFEColorMatrixElementBase::AttributeAffectsRendering(aNameSpaceID, aAttribute) ||
+  return SVGFEColorMatrixElementBase::AttributeAffectsRendering(aNameSpaceID, aAttribute) ||
          (aNameSpaceID == kNameSpaceID_None &&
           (aAttribute == nsGkAtoms::in ||
            aAttribute == nsGkAtoms::type ||
            aAttribute == nsGkAtoms::values));
 }
 
 //----------------------------------------------------------------------
 // nsSVGElement methods
 
 nsSVGElement::EnumAttributesInfo
-nsSVGFEColorMatrixElement::GetEnumInfo()
+SVGFEColorMatrixElement::GetEnumInfo()
 {
   return EnumAttributesInfo(mEnumAttributes, sEnumInfo,
                             ArrayLength(sEnumInfo));
 }
 
 nsSVGElement::StringAttributesInfo
-nsSVGFEColorMatrixElement::GetStringInfo()
+SVGFEColorMatrixElement::GetStringInfo()
 {
   return StringAttributesInfo(mStringAttributes, sStringInfo,
                               ArrayLength(sStringInfo));
 }
 
 nsSVGElement::NumberListAttributesInfo
-nsSVGFEColorMatrixElement::GetNumberListInfo()
+SVGFEColorMatrixElement::GetNumberListInfo()
 {
   return NumberListAttributesInfo(mNumberListAttributes, sNumberListInfo,
                                   ArrayLength(sNumberListInfo));
 }
 
 } // namespace dom
 } // namespace mozilla
--- a/content/svg/content/src/SVGFEColorMatrixElement.h
+++ b/content/svg/content/src/SVGFEColorMatrixElement.h
@@ -1,60 +1,75 @@
 /* a*- 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 mozilla_dom_SVGFEColorMatrixElement_h
 #define mozilla_dom_SVGFEColorMatrixElement_h
 
-typedef nsSVGFE nsSVGFEColorMatrixElementBase;
+#include "nsSVGEnum.h"
+#include "nsSVGFilters.h"
+#include "SVGAnimatedNumberList.h"
+
+nsresult NS_NewSVGFEColorMatrixElement(nsIContent **aResult,
+                                       already_AddRefed<nsINodeInfo> aNodeInfo);
 
 namespace mozilla {
 namespace dom {
 
-class nsSVGFEColorMatrixElement : public nsSVGFEColorMatrixElementBase,
-                                  public nsIDOMSVGFEColorMatrixElement
+typedef nsSVGFE SVGFEColorMatrixElementBase;
+
+static const unsigned short SVG_FECOLORMATRIX_TYPE_UNKNOWN = 0;
+static const unsigned short SVG_FECOLORMATRIX_TYPE_MATRIX = 1;
+static const unsigned short SVG_FECOLORMATRIX_TYPE_SATURATE = 2;
+static const unsigned short SVG_FECOLORMATRIX_TYPE_HUE_ROTATE = 3;
+static const unsigned short SVG_FECOLORMATRIX_TYPE_LUMINANCE_TO_ALPHA = 4;
+
+class SVGFEColorMatrixElement : public SVGFEColorMatrixElementBase,
+                                public nsIDOMSVGElement
 {
-  friend nsresult NS_NewSVGFEColorMatrixElement(nsIContent **aResult,
-                                                already_AddRefed<nsINodeInfo> aNodeInfo);
+  friend nsresult (::NS_NewSVGFEColorMatrixElement(nsIContent **aResult,
+                                                   already_AddRefed<nsINodeInfo> aNodeInfo));
 protected:
-  nsSVGFEColorMatrixElement(already_AddRefed<nsINodeInfo> aNodeInfo)
-    : nsSVGFEColorMatrixElementBase(aNodeInfo) {}
+  SVGFEColorMatrixElement(already_AddRefed<nsINodeInfo> aNodeInfo)
+    : SVGFEColorMatrixElementBase(aNodeInfo)
+  {
+    SetIsDOMBinding();
+  }
+  virtual JSObject* WrapNode(JSContext* aCx, JSObject* aScope) MOZ_OVERRIDE;
 
 public:
   // interfaces:
   NS_DECL_ISUPPORTS_INHERITED
 
-  // FE Base
-  NS_FORWARD_NSIDOMSVGFILTERPRIMITIVESTANDARDATTRIBUTES(nsSVGFEColorMatrixElementBase::)
-
   virtual nsresult Filter(nsSVGFilterInstance* aInstance,
                           const nsTArray<const Image*>& aSources,
                           const Image* aTarget,
                           const nsIntRect& aDataRect);
   virtual bool AttributeAffectsRendering(
           int32_t aNameSpaceID, nsIAtom* aAttribute) const;
   virtual nsSVGString& GetResultImageName() { return mStringAttributes[RESULT]; }
   virtual void GetSourceImageNames(nsTArray<nsSVGStringInfo>& aSources);
 
-  // Color Matrix
-  NS_DECL_NSIDOMSVGFECOLORMATRIXELEMENT
-
-  NS_FORWARD_NSIDOMSVGELEMENT(nsSVGFEColorMatrixElementBase::)
+  NS_FORWARD_NSIDOMSVGELEMENT(SVGFEColorMatrixElementBase::)
 
   NS_FORWARD_NSIDOMNODE_TO_NSINODE
   NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
 
   virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
-  virtual nsXPCClassInfo* GetClassInfo();
+  virtual nsIDOMNode* AsDOMNode() { return this; }
 
-  virtual nsIDOMNode* AsDOMNode() { return this; }
-protected:
+  // WebIDL
+  already_AddRefed<nsIDOMSVGAnimatedString> In1();
+  already_AddRefed<nsIDOMSVGAnimatedEnumeration> Type();
+  already_AddRefed<DOMSVGAnimatedNumberList> Values();
+
+ protected:
   virtual bool OperatesOnPremultipledAlpha(int32_t) { return false; }
 
   virtual EnumAttributesInfo GetEnumInfo();
   virtual StringAttributesInfo GetStringInfo();
   virtual NumberListAttributesInfo GetNumberListInfo();
 
   enum { TYPE };
   nsSVGEnum mEnumAttributes[1];
--- a/content/svg/content/src/nsSVGFilters.cpp
+++ b/content/svg/content/src/nsSVGFilters.cpp
@@ -43,18 +43,16 @@
 #include "mozilla/dom/SVGFEFuncRElementBinding.h"
 #include "mozilla/dom/SVGFEPointLightElement.h"
 
 #if defined(XP_WIN) 
 // Prevent Windows redefining LoadImage
 #undef LoadImage
 #endif
 
-#define NUM_ENTRIES_IN_4x5_MATRIX 20
-
 using namespace mozilla;
 using namespace mozilla::dom;
 
 static const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN  = 0;
 static const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY = 1;
 static const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_TABLE    = 2;
 static const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE = 3;
 static const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_LINEAR   = 4;
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -804,18 +804,16 @@ static nsDOMClassInfoData sClassInfoData
 
   // SVG document
   NS_DEFINE_CLASSINFO_DATA(SVGDocument, nsDocumentSH,
                            DOCUMENT_SCRIPTABLE_FLAGS)
 
   // SVG element classes
   NS_DEFINE_CLASSINFO_DATA(TimeEvent, nsEventSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
-  NS_DEFINE_CLASSINFO_DATA(SVGFEColorMatrixElement, nsElementSH,
-                           ELEMENT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(SVGFECompositeElement, nsElementSH,
                            ELEMENT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(SVGFEConvolveMatrixElement, nsElementSH,
                            ELEMENT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(SVGFEDiffuseLightingElement, nsElementSH,
                            ELEMENT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(SVGFEDisplacementMapElement, nsElementSH,
                            ELEMENT_SCRIPTABLE_FLAGS)
@@ -2231,22 +2229,16 @@ nsDOMClassInfo::Init()
   DOM_CLASSINFO_MAP_END
 
   // SVG element classes
   DOM_CLASSINFO_MAP_BEGIN(TimeEvent, nsIDOMTimeEvent)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMTimeEvent)
     DOM_CLASSINFO_EVENT_MAP_ENTRIES
   DOM_CLASSINFO_MAP_END
 
-  DOM_CLASSINFO_MAP_BEGIN(SVGFEColorMatrixElement, nsIDOMSVGFEColorMatrixElement)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFEColorMatrixElement)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFilterPrimitiveStandardAttributes)
-    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_SVG_ELEMENT_MAP_ENTRIES
   DOM_CLASSINFO_MAP_END
 
   DOM_CLASSINFO_MAP_BEGIN(SVGFEConvolveMatrixElement, nsIDOMSVGFEConvolveMatrixElement)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFEConvolveMatrixElement)
--- a/dom/base/nsDOMClassInfoClasses.h
+++ b/dom/base/nsDOMClassInfoClasses.h
@@ -117,17 +117,16 @@ DOMCI_CLASS(CSSSupportsRule)
 
 DOMCI_CLASS(BeforeUnloadEvent)
 
 // The SVG document
 DOMCI_CLASS(SVGDocument)
 
 // SVG element classes
 DOMCI_CLASS(TimeEvent)
-DOMCI_CLASS(SVGFEColorMatrixElement)
 DOMCI_CLASS(SVGFECompositeElement)
 DOMCI_CLASS(SVGFEConvolveMatrixElement)
 DOMCI_CLASS(SVGFEDiffuseLightingElement)
 DOMCI_CLASS(SVGFEDisplacementMapElement)
 DOMCI_CLASS(SVGFEGaussianBlurElement)
 DOMCI_CLASS(SVGFEMorphologyElement)
 DOMCI_CLASS(SVGFEOffsetElement)
 DOMCI_CLASS(SVGFESpecularLightingElement)
--- a/dom/interfaces/svg/nsIDOMSVGFilters.idl
+++ b/dom/interfaces/svg/nsIDOMSVGFilters.idl
@@ -16,32 +16,16 @@ interface nsIDOMSVGFilterPrimitiveStanda
 { 
     readonly attribute nsIDOMSVGAnimatedLength      x;
     readonly attribute nsIDOMSVGAnimatedLength      y;
     readonly attribute nsIDOMSVGAnimatedLength      width;
     readonly attribute nsIDOMSVGAnimatedLength      height;
     readonly attribute nsIDOMSVGAnimatedString      result;
 };
 
-[scriptable, uuid(a73ab3fb-05fa-4153-95e7-b2194b90e57c)]
-interface nsIDOMSVGFEColorMatrixElement : nsIDOMSVGFilterPrimitiveStandardAttributes
-{
-    // Color Matrix Types
-    const unsigned short SVG_FECOLORMATRIX_TYPE_UNKNOWN            = 0;
-    const unsigned short SVG_FECOLORMATRIX_TYPE_MATRIX             = 1;
-    const unsigned short SVG_FECOLORMATRIX_TYPE_SATURATE           = 2;
-    const unsigned short SVG_FECOLORMATRIX_TYPE_HUE_ROTATE         = 3;
-    const unsigned short SVG_FECOLORMATRIX_TYPE_LUMINANCE_TO_ALPHA = 4;
-
-    readonly attribute nsIDOMSVGAnimatedString in1;
-    readonly attribute nsIDOMSVGAnimatedEnumeration type;
-    // SVGAnimatedNumberList
-    readonly attribute nsISupports  values;
-};
-
 [scriptable, uuid(f264fd1f-b272-4796-99b5-68c90cbd030c)]
 interface nsIDOMSVGFECompositeElement : nsIDOMSVGFilterPrimitiveStandardAttributes
 {
     // Operator Types
     const unsigned short SVG_OPERATOR_UNKNOWN    = 0;
     const unsigned short SVG_OPERATOR_OVER       = 1;
     const unsigned short SVG_OPERATOR_IN         = 2;
     const unsigned short SVG_OPERATOR_OUT        = 3;
new file mode 100644
--- /dev/null
+++ b/dom/webidl/SVGFEColorMatrixElement.webidl
@@ -0,0 +1,30 @@
+/* -*- 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/.
+ *
+ * The origin of this IDL file is
+ * http://www.w3.org/TR/SVG2/
+ *
+ * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
+ * liability, trademark and document use rules apply.
+ */
+
+interface SVGAnimatedEnumeration;
+interface SVGAnimatedString;
+
+interface SVGFEColorMatrixElement : SVGElement {
+
+  // Color Matrix Types
+  const unsigned short SVG_FECOLORMATRIX_TYPE_UNKNOWN = 0;
+  const unsigned short SVG_FECOLORMATRIX_TYPE_MATRIX = 1;
+  const unsigned short SVG_FECOLORMATRIX_TYPE_SATURATE = 2;
+  const unsigned short SVG_FECOLORMATRIX_TYPE_HUEROTATE = 3;
+  const unsigned short SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA = 4;
+
+  readonly attribute SVGAnimatedString in1;
+  readonly attribute SVGAnimatedEnumeration type;
+  readonly attribute SVGAnimatedNumberList values;
+};
+
+SVGFEColorMatrixElement implements SVGFilterPrimitiveStandardAttributes;
--- a/dom/webidl/WebIDL.mk
+++ b/dom/webidl/WebIDL.mk
@@ -177,16 +177,17 @@ webidl_files = \
   SVGComponentTransferFunctionElement.webidl \
   SVGDefsElement.webidl \
   SVGDescElement.webidl \
   SVGElement.webidl \
   SVGEllipseElement.webidl \
   SVGFilterElement.webidl \
   SVGFilterPrimitiveStandardAttributes.webidl \
   SVGFEBlendElement.webidl \
+  SVGFEColorMatrixElement.webidl \
   SVGFEComponentTransferElement.webidl \
   SVGFEDistantLightElement.webidl \
   SVGFEFloodElement.webidl \
   SVGFEFuncAElement.webidl \
   SVGFEFuncBElement.webidl \
   SVGFEFuncGElement.webidl \
   SVGFEFuncRElement.webidl \
   SVGFEImageElement.webidl \