Bug 690486 - Kill nsISVGValue, nsSVGValue, nsISVGValueObserver, nsISVGValueUtils and nsSVGStringProxyValue. r=longsonr.
authorJonathan Watt <jwatt@jwatt.org>
Fri, 30 Sep 2011 10:25:34 +0100
changeset 77909 d74000e4f76a
parent 77908 831df43787ef
child 77910 8ddd09649e13
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewerslongsonr
bugs690486
milestone10.0a1
Bug 690486 - Kill nsISVGValue, nsSVGValue, nsISVGValueObserver, nsISVGValueUtils and nsSVGStringProxyValue. r=longsonr.
content/base/src/nsAttrValue.cpp
content/base/src/nsAttrValue.h
content/svg/content/src/Makefile.in
content/svg/content/src/SVGLengthList.cpp
content/svg/content/src/SVGNumberList.cpp
content/svg/content/src/SVGPathData.cpp
content/svg/content/src/SVGPointList.cpp
content/svg/content/src/nsISVGValue.h
content/svg/content/src/nsISVGValueObserver.h
content/svg/content/src/nsISVGValueUtils.h
content/svg/content/src/nsSVGElement.cpp
content/svg/content/src/nsSVGElement.h
content/svg/content/src/nsSVGFilters.cpp
content/svg/content/src/nsSVGMarkerElement.cpp
content/svg/content/src/nsSVGPathElement.cpp
content/svg/content/src/nsSVGRect.cpp
content/svg/content/src/nsSVGRect.h
content/svg/content/src/nsSVGSVGElement.cpp
content/svg/content/src/nsSVGStringProxyValue.cpp
content/svg/content/src/nsSVGValue.cpp
content/svg/content/src/nsSVGValue.h
layout/svg/base/src/nsSVGGradientFrame.h
layout/svg/base/src/nsSVGInnerSVGFrame.h
layout/svg/base/src/nsSVGPathGeometryFrame.h
layout/svg/base/src/nsSVGTextFrame.cpp
--- a/content/base/src/nsAttrValue.cpp
+++ b/content/base/src/nsAttrValue.cpp
@@ -46,17 +46,16 @@
 #include "nsUnicharUtils.h"
 #include "mozilla/css/StyleRule.h"
 #include "mozilla/css/Declaration.h"
 #include "nsIHTMLDocument.h"
 #include "nsIDocument.h"
 #include "nsContentUtils.h"
 #include "nsReadableUtils.h"
 #include "prprf.h"
-#include "nsISVGValue.h"
 
 namespace css = mozilla::css;
 
 #define MISC_STR_PTR(_cont) \
   reinterpret_cast<void*>((_cont)->mStringBits & NS_ATTRVALUE_POINTERVALUE_MASK)
 
 nsTArray<const nsAttrValue::EnumTable*>* nsAttrValue::sEnumTableArray = nsnull;
 
@@ -78,22 +77,16 @@ nsAttrValue::nsAttrValue(const nsAString
 }
 
 nsAttrValue::nsAttrValue(css::StyleRule* aValue, const nsAString* aSerialized)
     : mBits(0)
 {
   SetTo(aValue, aSerialized);
 }
 
-nsAttrValue::nsAttrValue(nsISVGValue* aValue)
-    : mBits(0)
-{
-  SetTo(aValue);
-}
-
 nsAttrValue::nsAttrValue(const nsIntMargin& aValue)
     : mBits(0)
 {
   SetTo(aValue);
 }
 
 nsAttrValue::~nsAttrValue()
 {
@@ -245,21 +238,16 @@ nsAttrValue::SetTo(const nsAttrValue& aO
     {
       if (!EnsureEmptyAtomArray() ||
           !GetAtomArrayValue()->AppendElements(*otherCont->mAtomArray)) {
         Reset();
         return;
       }
       break;
     }
-    case eSVGValue:
-    {
-      NS_ADDREF(cont->mSVGValue = otherCont->mSVGValue);
-      break;
-    }
     case eDoubleValue:
     {
       cont->mDoubleValue = otherCont->mDoubleValue;
       break;
     }
     case eIntMarginValue:
     {
       if (otherCont->mIntMargin)
@@ -312,26 +300,16 @@ nsAttrValue::SetTo(css::StyleRule* aValu
     MiscContainer* cont = GetMiscContainer();
     NS_ADDREF(cont->mCSSStyleRule = aValue);
     cont->mType = eCSSStyleRule;
     SetMiscAtomOrString(aSerialized);
   }
 }
 
 void
-nsAttrValue::SetTo(nsISVGValue* aValue)
-{
-  if (EnsureEmptyMiscContainer()) {
-    MiscContainer* cont = GetMiscContainer();
-    NS_ADDREF(cont->mSVGValue = aValue);
-    cont->mType = eSVGValue;
-  }
-}
-
-void
 nsAttrValue::SetTo(const nsIntMargin& aValue)
 {
   if (EnsureEmptyMiscContainer()) {
     MiscContainer* cont = GetMiscContainer();
     cont->mIntMargin = new nsIntMargin(aValue);
     cont->mType = eIntMarginValue;
   }
 }
@@ -422,21 +400,16 @@ nsAttrValue::ToString(nsAString& aResult
       css::Declaration *decl = container->mCSSStyleRule->GetDeclaration();
       if (decl) {
         decl->ToString(aResult);
       }
       const_cast<nsAttrValue*>(this)->SetMiscAtomOrString(&aResult);
 
       break;
     }
-    case eSVGValue:
-    {
-      GetMiscContainer()->mSVGValue->GetValueString(aResult);
-      break;
-    }
     case eDoubleValue:
     {
       aResult.Truncate();
       aResult.AppendFloat(GetDoubleValue());
       break;
     }
     default:
     {
@@ -585,20 +558,16 @@ nsAttrValue::HashValue() const
       PRUint32 count = cont->mAtomArray->Length();
       for (nsCOMPtr<nsIAtom> *cur = cont->mAtomArray->Elements(),
                              *end = cur + count;
            cur != end; ++cur) {
         retval ^= NS_PTR_TO_INT32(cur->get());
       }
       return retval;
     }
-    case eSVGValue:
-    {
-      return NS_PTR_TO_INT32(cont->mSVGValue);
-    }
     case eDoubleValue:
     {
       // XXX this is crappy, but oh well
       return cont->mDoubleValue;
     }
     case eIntMarginValue:
     {
       return NS_PTR_TO_INT32(cont->mIntMargin);
@@ -682,20 +651,16 @@ nsAttrValue::Equals(const nsAttrValue& a
 
       if (!(*thisCont->mAtomArray == *otherCont->mAtomArray)) {
         return PR_FALSE;
       }
 
       needsStringComparison = PR_TRUE;
       break;
     }
-    case eSVGValue:
-    {
-      return thisCont->mSVGValue == otherCont->mSVGValue;
-    }
     case eDoubleValue:
     {
       return thisCont->mDoubleValue == otherCont->mDoubleValue;
     }
     case eIntMarginValue:
     {
       return thisCont->mIntMargin == otherCont->mIntMargin;
     }
@@ -1302,21 +1267,16 @@ nsAttrValue::EnsureEmptyMiscContainer()
         NS_RELEASE(cont->mCSSStyleRule);
         break;
       }
       case eAtomArray:
       {
         delete cont->mAtomArray;
         break;
       }
-      case eSVGValue:
-      {
-        NS_RELEASE(cont->mSVGValue);
-        break;
-      }
       case eIntMarginValue:
       {
         delete cont->mIntMargin;
         break;
       }
       default:
       {
         break;
@@ -1492,24 +1452,21 @@ nsAttrValue::SizeOf() const
       if (otherPtr &&
           static_cast<ValueBaseType>(container->mStringBits & NS_ATTRVALUE_BASETYPE_MASK) == eStringBase) {
         // TODO: we might be counting the string size more than once.
         // This should be fixed with bug 677487.
         nsStringBuffer* str = static_cast<nsStringBuffer*>(otherPtr);
         size += str ? str->StorageSize() : 0;
       }
 
-      // TODO: mCSSStyleRule and mSVGValue might be owned by another object
+      // TODO: mCSSStyleRule might be owned by another object
       // which would make us count them twice, bug 677493.
       if (Type() == eCSSStyleRule && container->mCSSStyleRule) {
         // TODO: Add SizeOf() to StyleRule, bug 677503.
         size += sizeof(*container->mCSSStyleRule);
-      } else if (Type() == eSVGValue && container->mSVGValue) {
-        // TODO: Add SizeOf() to nsSVGValue, bug 677504.
-        size += sizeof(*container->mSVGValue);
       } else if (Type() == eAtomArray && container->mAtomArray) {
         size += sizeof(container->mAtomArray) + sizeof(nsTArrayHeader);
         size += container->mAtomArray->Capacity() * sizeof(nsCOMPtr<nsIAtom>);
         // Don't count the size of each nsIAtom, they are counted separatly.
       }
 
       break;
     }
--- a/content/base/src/nsAttrValue.h
+++ b/content/base/src/nsAttrValue.h
@@ -50,17 +50,16 @@
 #include "nsColor.h"
 #include "nsCaseTreatment.h"
 #include "nsMargin.h"
 #include "nsCOMPtr.h"
 
 typedef PRUptrdiff PtrBits;
 class nsAString;
 class nsIAtom;
-class nsISVGValue;
 class nsIDocument;
 template<class E, class A> class nsTArray;
 struct nsTArrayDefaultAllocator;
 
 namespace mozilla {
 namespace css {
 class StyleRule;
 }
@@ -99,17 +98,16 @@ public:
 class nsAttrValue {
 public:
   typedef nsTArray< nsCOMPtr<nsIAtom> > AtomArray;
 
   nsAttrValue();
   nsAttrValue(const nsAttrValue& aOther);
   explicit nsAttrValue(const nsAString& aValue);
   nsAttrValue(mozilla::css::StyleRule* aValue, const nsAString* aSerialized);
-  explicit nsAttrValue(nsISVGValue* aValue);
   explicit nsAttrValue(const nsIntMargin& aValue);
   ~nsAttrValue();
 
   static nsresult Init();
   static void Shutdown();
 
   // This has to be the same as in ValueBaseType
   enum ValueType {
@@ -117,32 +115,30 @@ public:
                           //   01  this value indicates an 'misc' struct
     eAtom =         0x02, //   10
     eInteger =      0x03, // 0011
     eColor =        0x07, // 0111
     eEnum =         0x0B, // 1011  This should eventually die
     ePercent =      0x0F, // 1111
     // Values below here won't matter, they'll be always stored in the 'misc'
     // struct.
-    eCSSStyleRule = 0x10,
-    eAtomArray =    0x11 
-    ,eSVGValue =    0x12
-    ,eDoubleValue  = 0x13
-    ,eIntMarginValue = 0x14
+    eCSSStyleRule =    0x10
+    ,eAtomArray =      0x11 
+    ,eDoubleValue  =   0x12
+    ,eIntMarginValue = 0x13
   };
 
   ValueType Type() const;
 
   void Reset();
 
   void SetTo(const nsAttrValue& aOther);
   void SetTo(const nsAString& aValue);
   void SetTo(PRInt16 aInt);
   void SetTo(mozilla::css::StyleRule* aValue, const nsAString* aSerialized);
-  void SetTo(nsISVGValue* aValue);
   void SetTo(const nsIntMargin& aValue);
 
   void SwapValueWith(nsAttrValue& aOther);
 
   void ToString(nsAString& aResult) const;
 
   // Methods to get value. These methods do not convert so only use them
   // to retrieve the datatype that this nsAttrValue has.
@@ -150,17 +146,16 @@ public:
   const nsCheapString GetStringValue() const;
   inline nsIAtom* GetAtomValue() const;
   inline PRInt32 GetIntegerValue() const;
   bool GetColorValue(nscolor& aColor) const;
   inline PRInt16 GetEnumValue() const;
   inline float GetPercentValue() const;
   inline AtomArray* GetAtomArrayValue() const;
   inline mozilla::css::StyleRule* GetCSSStyleRuleValue() const;
-  inline nsISVGValue* GetSVGValue() const;
   inline double GetDoubleValue() const;
   bool GetIntMarginValue(nsIntMargin& aMargin) const;
 
   /**
    * Returns the string corresponding to the stored enum value.
    *
    * @param aResult   the string representing the enum tag
    * @param aRealTag  wheter we want to have the real tag or the saved one
@@ -324,28 +319,27 @@ private:
     eAtomBase =      eAtom,      // 10
     eIntegerBase =   0x03        // 11
   };
 
   struct MiscContainer
   {
     ValueType mType;
     // mStringBits points to either nsIAtom* or nsStringBuffer* and is used when
-    // mType isn't mCSSStyleRule or eSVGValue.
+    // mType isn't mCSSStyleRule.
     // Note eStringBase and eAtomBase is used also to handle the type of
     // mStringBits.
     PtrBits mStringBits;
     union {
       PRInt32 mInteger;
       nscolor mColor;
       PRUint32 mEnumValue;
       PRInt32 mPercent;
       mozilla::css::StyleRule* mCSSStyleRule;
       AtomArray* mAtomArray;
-      nsISVGValue* mSVGValue;
       double mDoubleValue;
       nsIntMargin* mIntMargin;
     };
   };
 
   inline ValueBaseType BaseType() const;
 
   /**
@@ -441,23 +435,16 @@ nsAttrValue::GetAtomArrayValue() const
 
 inline mozilla::css::StyleRule*
 nsAttrValue::GetCSSStyleRuleValue() const
 {
   NS_PRECONDITION(Type() == eCSSStyleRule, "wrong type");
   return GetMiscContainer()->mCSSStyleRule;
 }
 
-inline nsISVGValue*
-nsAttrValue::GetSVGValue() const
-{
-  NS_PRECONDITION(Type() == eSVGValue, "wrong type");
-  return GetMiscContainer()->mSVGValue;
-}
-
 inline double
 nsAttrValue::GetDoubleValue() const
 {
   NS_PRECONDITION(Type() == eDoubleValue, "wrong type");
   return GetMiscContainer()->mDoubleValue;
 }
 
 inline bool
--- a/content/svg/content/src/Makefile.in
+++ b/content/svg/content/src/Makefile.in
@@ -100,33 +100,31 @@ CPPSRCS		= \
 		nsSVGPathElement.cpp \
 		nsSVGPathGeometryElement.cpp \
 		nsSVGPatternElement.cpp \
 		nsSVGPolyElement.cpp \
 		nsSVGPolygonElement.cpp \
 		nsSVGPolylineElement.cpp \
 		nsSVGScriptElement.cpp \
 		nsSVGString.cpp \
-		nsSVGStringProxyValue.cpp \
 		nsSVGStylableElement.cpp \
 		nsSVGRect.cpp \
 		nsSVGRectElement.cpp \
 		nsSVGSVGElement.cpp \
 		nsSVGStopElement.cpp \
 		nsSVGStyleElement.cpp \
 		nsSVGSwitchElement.cpp \
 		nsSVGSymbolElement.cpp \
 		nsSVGTSpanElement.cpp \
 		nsSVGTextContentElement.cpp \
 		nsSVGTextElement.cpp \
 		nsSVGTextPathElement.cpp \
 		nsSVGTextPositioningElement.cpp \
 		nsSVGTitleElement.cpp \
 		nsSVGUseElement.cpp \
-		nsSVGValue.cpp \
 		nsSVGViewBox.cpp \
 		SVGAnimatedLengthList.cpp \
 		SVGAnimatedNumberList.cpp \
 		SVGAnimatedPathSegList.cpp \
 		SVGAnimatedPointList.cpp \
 		SVGAnimatedPreserveAspectRatio.cpp \
 		SVGAnimatedTransformList.cpp \
 		SVGLength.cpp \
@@ -164,19 +162,16 @@ CPPSRCS += nsSVGAnimateElement.cpp \
 endif
 
 include $(topsrcdir)/config/config.mk
 
 # we don't want the shared lib, but we want to force the creation of a static lib.
 FORCE_STATIC_LIB = 1
 
 EXPORTS =  			\
-	nsISVGValue.h              \
-	nsISVGValueObserver.h      \
-	nsISVGValueUtils.h         \
 	nsSVGFeatures.h            \
 	nsSVGRect.h                \
 	$(NULL)
 
 include $(topsrcdir)/config/rules.mk
 
 INCLUDES += 	\
 		-I$(srcdir)/../../../shared/public \
--- a/content/svg/content/src/SVGLengthList.cpp
+++ b/content/svg/content/src/SVGLengthList.cpp
@@ -33,17 +33,16 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "SVGLengthList.h"
 #include "SVGAnimatedLengthList.h"
 #include "SVGLength.h"
 #include "nsSVGElement.h"
-#include "nsISVGValueUtils.h"
 #include "nsDOMError.h"
 #include "nsContentUtils.h"
 #include "nsString.h"
 #include "nsSVGUtils.h"
 #include "string.h"
 
 namespace mozilla {
 
--- a/content/svg/content/src/SVGNumberList.cpp
+++ b/content/svg/content/src/SVGNumberList.cpp
@@ -32,17 +32,16 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "SVGNumberList.h"
 #include "SVGAnimatedNumberList.h"
 #include "nsSVGElement.h"
-#include "nsISVGValueUtils.h"
 #include "nsDOMError.h"
 #include "nsString.h"
 #include "nsSVGUtils.h"
 #include "string.h"
 #include "prdtoa.h"
 #include "nsTextFormatter.h"
 #include "nsCharSeparatedTokenizer.h"
 #include "nsMathUtils.h"
--- a/content/svg/content/src/SVGPathData.cpp
+++ b/content/svg/content/src/SVGPathData.cpp
@@ -33,17 +33,16 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "SVGPathData.h"
 #include "SVGAnimatedPathSegList.h"
 #include "SVGPathSegUtils.h"
 #include "nsSVGElement.h"
-#include "nsISVGValueUtils.h"
 #include "nsDOMError.h"
 #include "nsContentUtils.h"
 #include "nsString.h"
 #include "nsSVGUtils.h"
 #include "string.h"
 #include "nsSVGPathDataParser.h"
 #include "nsSVGPathGeometryElement.h" // for nsSVGMark
 #include "gfxPlatform.h"
--- a/content/svg/content/src/SVGPointList.cpp
+++ b/content/svg/content/src/SVGPointList.cpp
@@ -32,17 +32,16 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "SVGPointList.h"
 #include "SVGAnimatedPointList.h"
 #include "nsSVGElement.h"
-#include "nsISVGValueUtils.h"
 #include "nsDOMError.h"
 #include "nsString.h"
 #include "nsSVGUtils.h"
 #include "string.h"
 #include "prdtoa.h"
 #include "nsTextFormatter.h"
 #include "nsCharSeparatedTokenizer.h"
 #include "nsMathUtils.h"
deleted file mode 100644
--- a/content/svg/content/src/nsISVGValue.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Mozilla SVG project.
- *
- * The Initial Developer of the Original Code is
- * Crocodile Clips Ltd..
- * Portions created by the Initial Developer are Copyright (C) 2001
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-
-#ifndef __NS_ISVGVALUE_H__
-#define __NS_ISVGVALUE_H__
-
-#include "nsISupports.h"
-#include "nsString.h"
-
-class nsISVGValueObserver;
-
-////////////////////////////////////////////////////////////////////////
-// nsISVGValue: private interface for svg values
-
-/* This interface is implemented by all value-types (e.g. coords,
-  pointlists, matrices) that can be parsed from/to strings. This is
-  used for element-properties that are also XML attributes. E.g. the
-  'polyline'-element has a 'points'-attribute and a property
-  'animatedPoints' in the DOM.
-
-  XXX Observers
-*/
-
-// {d8299a5e-af9a-4bad-9845-fb1b6e2eed19}
-#define NS_ISVGVALUE_IID \
-{ 0xd8299a5e, 0xaf9a, 0x4bad, { 0x98, 0x45, 0xfb, 0x1b, 0x6e, 0x2e, 0xed, 0x19 } }
-
-
-class nsISVGValue : public nsISupports
-{
-public:
-  enum modificationType {
-    mod_other = 0,
-    mod_context,
-    mod_die
-  };
-
-  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISVGVALUE_IID)
-
-  NS_IMETHOD SetValueString(const nsAString& aValue)=0;
-  NS_IMETHOD GetValueString(nsAString& aValue)=0;
-
-  NS_IMETHOD AddObserver(nsISVGValueObserver* observer)=0;
-  NS_IMETHOD RemoveObserver(nsISVGValueObserver* observer)=0;
-
-  NS_IMETHOD BeginBatchUpdate()=0;
-  NS_IMETHOD EndBatchUpdate()=0;
-};
-
-NS_DEFINE_STATIC_IID_ACCESSOR(nsISVGValue, NS_ISVGVALUE_IID)
-
-nsresult
-NS_CreateSVGGenericStringValue(const nsAString& aValue, nsISVGValue** aResult);
-
-nsresult
-NS_CreateSVGStringProxyValue(nsISVGValue* proxiedValue, nsISVGValue** aResult);
-
-#endif // __NS_ISVGVALUE_H__
-
deleted file mode 100644
--- a/content/svg/content/src/nsISVGValueObserver.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Mozilla SVG project.
- *
- * The Initial Developer of the Original Code is
- * Crocodile Clips Ltd..
- * Portions created by the Initial Developer are Copyright (C) 2001
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-
-#ifndef __NS_ISVGVALUEOBSERVER_H__
-#define __NS_ISVGVALUEOBSERVER_H__
-
-#include "nsWeakReference.h"
-#include "nsISVGValue.h"
-
-////////////////////////////////////////////////////////////////////////
-// nsISVGValueObserver
-
-// {485029a4-2449-45c1-9814-08f38132ca4c}
-#define NS_ISVGVALUEOBSERVER_IID \
-  { 0x485029a4, 0x2449, 0x45c1, \
-    { 0x98, 0x14, 0x08, 0xf3, 0x81, 0x32, 0xca, 0x4c } }
-
-class nsISVGValueObserver : public nsSupportsWeakReference
-{
-public:
-  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISVGVALUEOBSERVER_IID)
-  
-  NS_IMETHOD WillModifySVGObservable(nsISVGValue* observable,
-                                     nsISVGValue::modificationType)=0;
-  NS_IMETHOD DidModifySVGObservable (nsISVGValue* observable,
-                                     nsISVGValue::modificationType)=0;
-};
-
-NS_DEFINE_STATIC_IID_ACCESSOR(nsISVGValueObserver, NS_ISVGVALUEOBSERVER_IID)
-
-#endif // __NS_ISVGVALUEOBSERVER_H__
-
deleted file mode 100644
--- a/content/svg/content/src/nsISVGValueUtils.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Mozilla SVG project.
- *
- * The Initial Developer of the Original Code is
- * Crocodile Clips Ltd..
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#ifndef __NS_ISVGVALUEUTILS_H__
-#define __NS_ISVGVALUEUTILS_H__
-
-
-
-// NS_ADD_SVGVALUE_OBSERVER() : 
-// add *this* as an observer to 'value'
-
-#define NS_ADD_SVGVALUE_OBSERVER(value)                               \
-  PR_BEGIN_MACRO                                                      \
-  {                                                                   \
-    nsCOMPtr<nsISVGValue> v = do_QueryInterface(value);               \
-    NS_ASSERTION(v, "can't find nsISVGValue interface on " #value );  \
-    if (v)                                                            \
-      v->AddObserver(this);                                           \
-  }                                                                   \
-  PR_END_MACRO
-
-
-
-// NS_REMOVE_SVGVALUE_OBSERVER() :
-// remove *this* as an observer to 'value'
-
-#define NS_REMOVE_SVGVALUE_OBSERVER(value)                            \
-  PR_BEGIN_MACRO                                                      \
-  {                                                                   \
-    nsCOMPtr<nsISVGValue> v = do_QueryInterface(value);               \
-    NS_ASSERTION(v, "can't find nsISVGValue interface on " #value );  \
-    if (v)                                                            \
-      v->RemoveObserver(this);                                        \
-  }                                                                   \
-  PR_END_MACRO
-
-  
-
-#endif // __NS_ISVGVALUEUTILS_H__
--- a/content/svg/content/src/nsSVGElement.cpp
+++ b/content/svg/content/src/nsSVGElement.cpp
@@ -101,17 +101,17 @@ PR_STATIC_ASSERT(sizeof(void*) == sizeof
 
 nsSVGEnumMapping nsSVGElement::sSVGUnitTypesMap[] = {
   {&nsGkAtoms::userSpaceOnUse, nsIDOMSVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE},
   {&nsGkAtoms::objectBoundingBox, nsIDOMSVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX},
   {nsnull, 0}
 };
 
 nsSVGElement::nsSVGElement(already_AddRefed<nsINodeInfo> aNodeInfo)
-  : nsSVGElementBase(aNodeInfo), mSuppressNotification(PR_FALSE)
+  : nsSVGElementBase(aNodeInfo)
 {
 }
 
 nsresult
 nsSVGElement::Init()
 {
   // Set up length attributes - can't do this in the constructor
   // because we can't do a virtual call at that point
@@ -200,33 +200,23 @@ nsSVGElement::Init()
 
   for (i = 0; i < stringInfo.mStringCount; i++) {
     stringInfo.Reset(i);
   }
 
   return NS_OK;
 }
 
-nsSVGElement::~nsSVGElement()
-{
-  PRUint32 i, count = mMappedAttributes.AttrCount();
-  for (i = 0; i < count; ++i) {
-    mMappedAttributes.AttrAt(i)->GetSVGValue()->RemoveObserver(this);
-  }
-}
-
 //----------------------------------------------------------------------
 // nsISupports methods
 
 NS_IMPL_ADDREF_INHERITED(nsSVGElement, nsSVGElementBase)
 NS_IMPL_RELEASE_INHERITED(nsSVGElement, nsSVGElementBase)
 
 NS_INTERFACE_MAP_BEGIN(nsSVGElement)
-  NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
-  NS_INTERFACE_MAP_ENTRY(nsISVGValueObserver)
 // provided by nsGenericElement:
 //  NS_INTERFACE_MAP_ENTRY(nsIContent)
 NS_INTERFACE_MAP_END_INHERITING(nsSVGElementBase)
 
 //----------------------------------------------------------------------
 // Implementation
   
 //----------------------------------------------------------------------
@@ -303,62 +293,16 @@ nsSVGElement::AfterSetAttr(PRInt32 aName
 }
 
 bool
 nsSVGElement::ParseAttribute(PRInt32 aNamespaceID,
                              nsIAtom* aAttribute,
                              const nsAString& aValue,
                              nsAttrValue& aResult)
 {
-  // Parse value
-  nsCOMPtr<nsISVGValue> svg_value;
-  const nsAttrValue* val = mAttrsAndChildren.GetAttr(aAttribute, aNamespaceID);
-  if (val) {
-    // Found the attr in the list.
-    if (val->Type() == nsAttrValue::eSVGValue) {
-      svg_value = val->GetSVGValue();
-    }
-  }
-  else {
-    // Could be a mapped attribute.
-    svg_value = GetMappedAttribute(aNamespaceID, aAttribute);
-  }
-  
-  if (svg_value) {
-    // We want to prevent DidModifySVGObservable from running if we
-    // come in this route, otherwise AttributeChanged() gets called
-    // twice (once through DidMOdifySVGObservable, once through SetAttr).
-    mSuppressNotification = PR_TRUE;
-
-    if (NS_FAILED(svg_value->SetValueString(aValue))) {
-      // The value was rejected. This happens e.g. in a XUL template
-      // when trying to set a value like "?x" on a value object that
-      // expects a length.
-      // To accommodate this "erroneous" value, we'll insert a proxy
-      // object between ourselves and the actual value object:
-      ReportAttributeParseFailure(GetOwnerDoc(), aAttribute, aValue);
-      nsCOMPtr<nsISVGValue> proxy;
-      nsresult rv =
-        NS_CreateSVGStringProxyValue(svg_value, getter_AddRefs(proxy));
-      // Failure means we'll store this attr as a string, not an SVGValue, but
-      // that's the best we can do short of throwing outright.
-      NS_ENSURE_SUCCESS(rv, PR_FALSE);
-
-      svg_value->RemoveObserver(this);
-      proxy->SetValueString(aValue);
-      proxy->AddObserver(this);
-      aResult.SetTo(proxy);
-    }
-    else {
-      aResult.SetTo(svg_value);
-    }
-    mSuppressNotification = PR_FALSE;
-    return PR_TRUE;
-  }
-
   nsresult rv = NS_OK;
   bool foundMatch = false;
   if (aNamespaceID == kNameSpaceID_None) {
 
     // Check for nsSVGLength2 attribute
     LengthAttributesInfo lengthInfo = GetLengthInfo();
 
     PRUint32 i;
@@ -1064,100 +1008,16 @@ nsSVGElement::GetOwnerSVGElement(nsIDOMS
 /* readonly attribute nsIDOMSVGElement viewportElement; */
 NS_IMETHODIMP
 nsSVGElement::GetViewportElement(nsIDOMSVGElement * *aViewportElement)
 {
   *aViewportElement = nsSVGUtils::GetNearestViewportElement(this).get();
   return NS_OK;
 }
 
-//----------------------------------------------------------------------
-// nsISVGValueObserver methods:
-nsSVGElement::ObservableModificationData
-nsSVGElement::GetModificationDataForObservable(nsISVGValue* aObservable,
-                                               nsISVGValue::modificationType aModType)
-{
-  // Return without setting DOM attributes as markup attributes if the
-  // attribute's element is being inserted into an SVG document fragment,
-  // which provides a context which percentage lengths are relative to.
-  // Bug 274886
-  if (aModType == nsISVGValue::mod_context)
-    return ObservableModificationData(nsnull, 0);
-
-  // Return without setting DOM attribute 
-  if (mSuppressNotification)
-    return ObservableModificationData(nsnull, 0);
-
-  PRUint32 i, count = mMappedAttributes.AttrCount();
-  const nsAttrValue* attrValue = nsnull;
-  for (i = 0; i < count; ++i) {
-    attrValue = mMappedAttributes.AttrAt(i);
-    if (attrValue->GetSVGValue() == aObservable) {
-      break;
-    }
-  }
-
-  if (i == count) {
-    NS_NOTREACHED("unknown nsISVGValue");
-
-    return ObservableModificationData(nsnull, 1);
-  }
-  
-  const nsAttrName* attrName = mMappedAttributes.AttrNameAt(i);
-  bool modification = !!mAttrsAndChildren.GetAttr(attrName->LocalName(),
-                                                    attrName->NamespaceID());
-
-  PRUint8 modType = modification ?
-    static_cast<PRUint8>(nsIDOMMutationEvent::MODIFICATION) :
-    static_cast<PRUint8>(nsIDOMMutationEvent::ADDITION);
-
-  return ObservableModificationData(attrName, modType);
-}
-
-
-NS_IMETHODIMP
-nsSVGElement::WillModifySVGObservable(nsISVGValue* aObservable,
-                                      nsISVGValue::modificationType aModType)
-{
-  ObservableModificationData data =
-    GetModificationDataForObservable(aObservable, aModType);
-  const nsAttrName* attrName = data.name;
-  if (!attrName) {
-    return data.modType ? NS_ERROR_UNEXPECTED : NS_OK;
-  }
-
-  nsNodeUtils::AttributeWillChange(this, attrName->NamespaceID(),
-                                   attrName->LocalName(), data.modType);
-  return NS_OK;
-}
-
-
-NS_IMETHODIMP
-nsSVGElement::DidModifySVGObservable(nsISVGValue* aObservable,
-                                     nsISVGValue::modificationType aModType)
-{
-  ObservableModificationData data =
-    GetModificationDataForObservable(aObservable, aModType);
-  const nsAttrName* attrName = data.name;
-  if (!attrName) {
-    return data.modType ? NS_ERROR_UNEXPECTED : NS_OK;
-  }
-
-  bool hasListeners =
-    nsContentUtils::HasMutationListeners(this,
-                                         NS_EVENT_BITS_MUTATION_ATTRMODIFIED,
-                                         this);
-
-
-  nsAttrValue newValue(aObservable);
-  return SetAttrAndNotify(attrName->NamespaceID(), attrName->LocalName(),
-                          attrName->GetPrefix(), EmptyString(), newValue,
-                          data.modType, hasListeners, PR_TRUE, nsnull);
-}
-
 //------------------------------------------------------------------------
 // Helper class: MappedAttrParser, for parsing values of mapped attributes
 
 namespace {
 
 class MappedAttrParser {
 public:
   MappedAttrParser(css::Loader* aLoader,
@@ -1362,53 +1222,16 @@ nsSVGElement::GetAnimatedContentStyleRul
 {
   return
     static_cast<css::StyleRule*>(GetProperty(SMIL_MAPPED_ATTR_ANIMVAL,
                                              SMIL_MAPPED_ATTR_STYLERULE_ATOM,
                                              nsnull));
 }
 #endif // MOZ_SMIL
 
-nsISVGValue*
-nsSVGElement::GetMappedAttribute(PRInt32 aNamespaceID, nsIAtom* aName)
-{
-  const nsAttrValue* attrVal = mMappedAttributes.GetAttr(aName, aNamespaceID);
-  if (!attrVal)
-    return nsnull;
-
-  return attrVal->GetSVGValue();
-}
-
-nsresult
-nsSVGElement::AddMappedSVGValue(nsIAtom* aName, nsISupports* aValue,
-                                PRInt32 aNamespaceID)
-{
-  nsresult rv;
-  nsCOMPtr<nsISVGValue> svg_value = do_QueryInterface(aValue);
-  svg_value->AddObserver(this);
-  nsAttrValue attrVal(svg_value);
-
-  if (aNamespaceID == kNameSpaceID_None) {
-    rv = mMappedAttributes.SetAndTakeAttr(aName, attrVal);
-    NS_ENSURE_SUCCESS(rv, rv);
-  }
-  else {
-    nsCOMPtr<nsINodeInfo> ni;
-    ni = mNodeInfo->NodeInfoManager()->GetNodeInfo(aName, nsnull,
-                                                   aNamespaceID,
-                                                   nsIDOMNode::ATTRIBUTE_NODE);
-    NS_ENSURE_TRUE(ni, NS_ERROR_OUT_OF_MEMORY);
-
-    rv = mMappedAttributes.SetAndTakeAttr(ni, attrVal);
-    NS_ENSURE_SUCCESS(rv, rv);
-  }
-
-  return NS_OK;
-}
-
 /* static */
 nsIAtom* nsSVGElement::GetEventNameForAttr(nsIAtom* aAttr)
 {
   if (aAttr == nsGkAtoms::onload)
     return nsGkAtoms::onSVGLoad;
   if (aAttr == nsGkAtoms::onunload)
     return nsGkAtoms::onSVGUnload;
   if (aAttr == nsGkAtoms::onabort)
--- a/content/svg/content/src/nsSVGElement.h
+++ b/content/svg/content/src/nsSVGElement.h
@@ -44,19 +44,17 @@
   It implements all the common DOM interfaces and handles attributes.
 */
 
 #include "nsString.h"
 #include "nsCOMPtr.h"
 #include "nsIDOMSVGElement.h"
 #include "nsGenericElement.h"
 #include "nsStyledElement.h"
-#include "nsISVGValue.h"
-#include "nsISVGValueObserver.h"
-#include "nsWeakReference.h"
+#include "mozilla/css/StyleRule.h"
 
 #ifdef MOZ_SMIL
 #include "nsISMILAttr.h"
 #include "nsSMILAnimationController.h"
 #endif
 
 class nsSVGSVGElement;
 class nsSVGLength2;
@@ -80,23 +78,22 @@ class SVGUserUnitList;
 class SVGAnimatedPointList;
 class SVGAnimatedPathSegList;
 class SVGAnimatedPreserveAspectRatio;
 class SVGAnimatedTransformList;
 }
 
 typedef nsStyledElementNotElementCSSInlineStyle nsSVGElementBase;
 
-class nsSVGElement : public nsSVGElementBase,    // nsIContent
-                     public nsISVGValueObserver  // :nsISupportsWeakReference
+class nsSVGElement : public nsSVGElementBase    // nsIContent
 {
 protected:
   nsSVGElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   nsresult Init();
-  virtual ~nsSVGElement();
+  virtual ~nsSVGElement(){}
 
 public:
   typedef mozilla::SVGNumberList SVGNumberList;
   typedef mozilla::SVGAnimatedNumberList SVGAnimatedNumberList;
   typedef mozilla::SVGUserUnitList SVGUserUnitList;
   typedef mozilla::SVGAnimatedLengthList SVGAnimatedLengthList;
   typedef mozilla::SVGAnimatedPointList SVGAnimatedPointList;
   typedef mozilla::SVGAnimatedPathSegList SVGAnimatedPathSegList;
@@ -139,25 +136,16 @@ public:
                          bool* aReturn);
   
   // nsIDOMSVGElement
   NS_IMETHOD GetId(nsAString & aId);
   NS_IMETHOD SetId(const nsAString & aId);
   NS_IMETHOD GetOwnerSVGElement(nsIDOMSVGSVGElement** aOwnerSVGElement);
   NS_IMETHOD GetViewportElement(nsIDOMSVGElement** aViewportElement);
 
-  // nsISVGValueObserver
-  NS_IMETHOD WillModifySVGObservable(nsISVGValue* observable,
-                                     nsISVGValue::modificationType aModType);
-  NS_IMETHOD DidModifySVGObservable (nsISVGValue* observable,
-                                     nsISVGValue::modificationType aModType);
-
-  // nsISupportsWeakReference
-  // implementation inherited from nsSupportsWeakReference
-
   // Gets the element that establishes the rectangular viewport against which
   // we should resolve percentage lengths (our "coordinate context"). Returns
   // nsnull for outer <svg> or SVG without an <svg> parent (invalid SVG).
   nsSVGSVGElement* GetCtx() const;
 
   /**
    * Returns aMatrix post-multiplied by the transform from the userspace
    * established by this element to the userspace established by its parent.
@@ -271,20 +259,16 @@ protected:
   virtual bool IsEventName(nsIAtom* aName);
 
   void UpdateContentStyleRule();
 #ifdef MOZ_SMIL
   void UpdateAnimatedContentStyleRule();
   mozilla::css::StyleRule* GetAnimatedContentStyleRule();
 #endif // MOZ_SMIL
 
-  nsISVGValue* GetMappedAttribute(PRInt32 aNamespaceID, nsIAtom* aName);
-  nsresult AddMappedSVGValue(nsIAtom* aName, nsISupports* aValue,
-                             PRInt32 aNamespaceID = kNameSpaceID_None);
-  
   static nsIAtom* GetEventNameForAttr(nsIAtom* aAttr);
 
   struct LengthInfo {
     nsIAtom** mName;
     float     mDefaultValue;
     PRUint8   mDefaultUnitType;
     PRUint8   mCtxType;
   };
@@ -530,34 +514,17 @@ protected:
   virtual NumberListAttributesInfo GetNumberListInfo();
   virtual LengthListAttributesInfo GetLengthListInfo();
   virtual StringAttributesInfo GetStringInfo();
   virtual nsSVGClass *GetClass();
 
   static nsSVGEnumMapping sSVGUnitTypesMap[];
 
 private:
-  struct ObservableModificationData {
-    // Only to be used if |name| is non-null.  Otherwise, modType will
-    // be 0 to indicate NS_OK should be returned and 1 to indicate
-    // NS_ERROR_UNEXPECTED should be returned.
-    ObservableModificationData(const nsAttrName* aName, PRUint32 aModType):
-      name(aName), modType(aModType)
-    {}
-    const nsAttrName* name;
-    PRUint8 modType;
-  };
-  ObservableModificationData
-    GetModificationDataForObservable(nsISVGValue* aObservable,
-                                     nsISVGValue::modificationType aModType);
-
   nsRefPtr<mozilla::css::StyleRule> mContentStyleRule;
-  nsAttrAndChildArray mMappedAttributes;
-
-  bool mSuppressNotification;
 };
 
 /**
  * A macro to implement the NS_NewSVGXXXElement() functions.
  */
 #define NS_IMPL_NS_NEW_SVG_ELEMENT(_elementName)                             \
 nsresult                                                                     \
 NS_NewSVG##_elementName##Element(nsIContent **aResult,                       \
--- a/content/svg/content/src/nsSVGFilters.cpp
+++ b/content/svg/content/src/nsSVGFilters.cpp
@@ -39,25 +39,21 @@
 #include "nsSVGNumber2.h"
 #include "nsSVGNumberPair.h"
 #include "nsSVGInteger.h"
 #include "nsSVGIntegerPair.h"
 #include "nsSVGBoolean.h"
 #include "nsIDOMSVGFilters.h"
 #include "nsCOMPtr.h"
 #include "nsSVGFilterInstance.h"
-#include "nsSVGValue.h"
-#include "nsISVGValueObserver.h"
-#include "nsWeakReference.h"
 #include "nsIDOMSVGFilterElement.h"
 #include "nsSVGEnum.h"
 #include "SVGNumberList.h"
 #include "SVGAnimatedNumberList.h"
 #include "DOMSVGAnimatedNumberList.h"
-#include "nsISVGValueUtils.h"
 #include "nsSVGFilters.h"
 #include "nsLayoutUtils.h"
 #include "nsSVGUtils.h"
 #include "nsStyleContext.h"
 #include "nsIDocument.h"
 #include "nsIFrame.h"
 #include "gfxContext.h"
 #include "gfxMatrix.h"
--- a/content/svg/content/src/nsSVGMarkerElement.cpp
+++ b/content/svg/content/src/nsSVGMarkerElement.cpp
@@ -31,17 +31,16 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsGkAtoms.h"
 #include "nsCOMPtr.h"
-#include "nsISVGValueUtils.h"
 #include "SVGAnimatedPreserveAspectRatio.h"
 #include "nsDOMError.h"
 #include "nsSVGUtils.h"
 #include "nsSVGMarkerElement.h"
 #include "gfxMatrix.h"
 #include "nsContentUtils.h" // NS_ENSURE_FINITE
 
 using namespace mozilla;
--- a/content/svg/content/src/nsSVGPathElement.cpp
+++ b/content/svg/content/src/nsSVGPathElement.cpp
@@ -39,17 +39,16 @@
 #include "nsGkAtoms.h"
 #include "nsIDOMSVGPathSeg.h"
 #include "DOMSVGPathSeg.h"
 #include "DOMSVGPathSegList.h"
 #include "nsCOMPtr.h"
 #include "nsIFrame.h"
 #include "nsSVGPathDataParser.h"
 #include "nsSVGPathElement.h"
-#include "nsISVGValueUtils.h"
 #include "nsSVGUtils.h"
 #include "DOMSVGPoint.h"
 #include "gfxContext.h"
 #include "gfxPlatform.h"
 
 using namespace mozilla;
 
 nsSVGElement::NumberInfo nsSVGPathElement::sNumberInfo = 
--- a/content/svg/content/src/nsSVGRect.cpp
+++ b/content/svg/content/src/nsSVGRect.cpp
@@ -34,21 +34,18 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsSVGRect.h"
 #include "prdtoa.h"
-#include "nsSVGValue.h"
-#include "nsISVGValueUtils.h"
 #include "nsTextFormatter.h"
 #include "nsCRT.h"
-#include "nsWeakReference.h"
 #include "nsIDOMSVGLength.h"
 #include "nsContentUtils.h"
 #include "nsDOMError.h"
 
 //----------------------------------------------------------------------
 // implementation:
 
 nsSVGRect::nsSVGRect(float x, float y, float w, float h)
--- a/content/svg/content/src/nsSVGRect.h
+++ b/content/svg/content/src/nsSVGRect.h
@@ -36,17 +36,16 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef __NS_SVGRECT_H__
 #define __NS_SVGRECT_H__
 
 #include "nsIDOMSVGRect.h"
-#include "nsSVGValue.h"
 #include "gfxRect.h"
 
 nsresult
 NS_NewSVGRect(nsIDOMSVGRect** result,
               float x=0.0f, float y=0.0f,
               float width=0.0f, float height=0.0f);
 
 nsresult
--- a/content/svg/content/src/nsSVGSVGElement.cpp
+++ b/content/svg/content/src/nsSVGSVGElement.cpp
@@ -48,17 +48,16 @@
 #include "nsIDocument.h"
 #include "nsPresContext.h"
 #include "DOMSVGMatrix.h"
 #include "DOMSVGPoint.h"
 #include "nsIDOMEventTarget.h"
 #include "nsIFrame.h"
 #include "nsISVGSVGFrame.h" //XXX
 #include "nsSVGRect.h"
-#include "nsISVGValueUtils.h"
 #include "nsDOMError.h"
 #include "nsISVGChildFrame.h"
 #include "nsGUIEvent.h"
 #include "nsSVGUtils.h"
 #include "nsSVGSVGElement.h"
 #include "nsContentErrors.h" // For NS_PROPTABLE_PROP_OVERWRITTEN
 #include "nsContentUtils.h"
 
deleted file mode 100644
--- a/content/svg/content/src/nsSVGStringProxyValue.cpp
+++ /dev/null
@@ -1,200 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Mozilla SVG project.
- *
- * The Initial Developer of the Original Code is
- * Crocodile Clips Ltd..
- * Portions created by the Initial Developer are Copyright (C) 2004
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Alex Fritze <alex@croczilla.com> (original author)
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include "nsSVGValue.h"
-#include "nsWeakReference.h"
-
-////////////////////////////////////////////////////////////////////////
-// nsSVGStringProxyValue implementation
-//
-// This class is intended to sit between a client and an nsISVGValue object.
-// It is used to allow mapped SVG attributes (which store their value in parsed
-// form) to assume any string value. This is needed for SVG to work properly with
-// XUL templates, where we have XML like this: <svg:circle r="?r"/>.
-//
-// When nsSVGStringProxyValue::SetValueString() will attempt to call its
-// proxied object's SetValueString method. If that call fails, nsSVGStringProxyValue
-// will cache the string and return it for subsequent invocations of GetValueString().
-// If the call succeeds, however, invocations of GetValueString() will call the
-// proxied objects's GetValueString() method.
-// If the proxied object's data is changed internally, invocations of GetValueString()
-// will also return the proxied object's GetValueString().
-
-
-class nsSVGStringProxyValue : public nsSVGValue,
-                              public nsISVGValueObserver
-{
-protected:
-  friend nsresult
-  NS_CreateSVGStringProxyValue(nsISVGValue* proxiedValue, nsISVGValue** aResult);
-  
-  nsSVGStringProxyValue();
-  virtual ~nsSVGStringProxyValue();
-  bool Init(nsISVGValue* proxiedValue);
-  
-public:
-  NS_DECL_ISUPPORTS
-
-  // nsISVGValue interface: 
-  NS_IMETHOD SetValueString(const nsAString& aValue);
-  NS_IMETHOD GetValueString(nsAString& aValue);
-
-  // nsISVGValueObserver
-  NS_IMETHOD WillModifySVGObservable(nsISVGValue* observable,
-                                     modificationType aModType);
-  NS_IMETHOD DidModifySVGObservable (nsISVGValue* observable,
-                                     modificationType aModType);
-
-  // nsISupportsWeakReference
-  // implementation inherited from nsSupportsWeakReference
-
-protected:
-  nsString mCachedValue;
-  nsCOMPtr<nsISVGValue> mProxiedValue;
-  bool mUseCachedValue;
-};
-
-//----------------------------------------------------------------------
-
-nsresult
-NS_CreateSVGStringProxyValue(nsISVGValue* proxiedValue,
-                             nsISVGValue** aResult)
-{
-  *aResult = nsnull;
-  
-  nsSVGStringProxyValue *sp = new nsSVGStringProxyValue();
-  if(!sp) return NS_ERROR_OUT_OF_MEMORY;
-  NS_ADDREF(sp);
-  if (!sp->Init(proxiedValue)) {
-    NS_RELEASE(sp);
-    return NS_ERROR_FAILURE;
-  }
-  
-  *aResult = sp;
-  return NS_OK;
-}
-
-nsSVGStringProxyValue::nsSVGStringProxyValue()
-{
-#ifdef DEBUG
-  printf("nsSVGStringProxyValue CTOR\n");
-#endif
-}
-
-nsSVGStringProxyValue::~nsSVGStringProxyValue()
-{
-  mProxiedValue->RemoveObserver(this);
-#ifdef DEBUG
-  printf("nsSVGStringProxyValue DTOR\n");
-#endif
-}
-
-bool nsSVGStringProxyValue::Init(nsISVGValue* proxiedValue)
-{
-  mProxiedValue = proxiedValue;
-  mProxiedValue->AddObserver(this);
-  return PR_TRUE;
-}  
-
-//----------------------------------------------------------------------
-// nsISupports methods:
-
-NS_IMPL_ADDREF(nsSVGStringProxyValue)
-NS_IMPL_RELEASE(nsSVGStringProxyValue)
-
-NS_INTERFACE_MAP_BEGIN(nsSVGStringProxyValue)
-  NS_INTERFACE_MAP_ENTRY(nsISVGValue)
-  NS_INTERFACE_MAP_ENTRY(nsISVGValueObserver)
-  NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
-  NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsISVGValue)
-NS_INTERFACE_MAP_END
-
-//----------------------------------------------------------------------
-// nsISVGValue methods:
-
-NS_IMETHODIMP
-nsSVGStringProxyValue::SetValueString(const nsAString& aValue)
-{
-#ifdef DEBUG
-  printf("nsSVGStringProxyValue(%p)::SetValueString(%s)\n",
-         static_cast<void*>(this), NS_ConvertUTF16toUTF8(aValue).get());
-#endif
-  if (NS_FAILED(mProxiedValue->SetValueString(aValue))) {
-#ifdef DEBUG
-    printf("  -> call failed, now using cached value\n");
-#endif
-    mUseCachedValue = PR_TRUE; // mUseCachedValue will be reset in DidModifySVGObservable, 
-                               // should the inner object ever change state internally
-    mCachedValue = aValue;
-  }
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsSVGStringProxyValue::GetValueString(nsAString& aValue)
-{
-  if (!mUseCachedValue)
-    return mProxiedValue->GetValueString(aValue);
-
-  aValue = mCachedValue;
-  return NS_OK;
-}
-
-
-//----------------------------------------------------------------------
-// nsISVGValueObserver methods
-
-NS_IMETHODIMP
-nsSVGStringProxyValue::WillModifySVGObservable(nsISVGValue* observable,
-                                               modificationType aModType)
-{
-  WillModify(aModType);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsSVGStringProxyValue::DidModifySVGObservable (nsISVGValue* observable,
-                                               modificationType aModType)
-{
-  // Our internal proxied object has set its state internally.
-  // Make sure its new value takes priority over our cached string:
-  mUseCachedValue = PR_FALSE;
-  
-  DidModify(aModType);
-  return NS_OK;
-}
deleted file mode 100644
--- a/content/svg/content/src/nsSVGValue.cpp
+++ /dev/null
@@ -1,132 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Mozilla SVG project.
- *
- * The Initial Developer of the Original Code is
- * Crocodile Clips Ltd..
- * Portions created by the Initial Developer are Copyright (C) 2001
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include "nsSVGValue.h"
-
-nsSVGValue::nsSVGValue()
-    : mModifyNestCount(0)
-{
-}
-
-nsSVGValue::~nsSVGValue()
-{
-  ReleaseObservers();
-}
-
-void
-nsSVGValue::ReleaseObservers()
-{
-  mObservers.Clear();
-}
-
-void
-nsSVGValue::NotifyObservers(SVGObserverNotifyFunction f,
-                            modificationType aModType)
-{
-  PRInt32 count = mObservers.Length();
-
-  // Since notification might cause the listeners to remove themselves
-  // from the observer list (mod_die), walk backwards through the list
-  // to catch everyone.
-  for (PRInt32 i = count - 1; i >= 0; i--) {
-    nsIWeakReference* wr = mObservers.ElementAt(i);
-    nsCOMPtr<nsISVGValueObserver> observer = do_QueryReferent(wr);
-    if (observer)
-       (static_cast<nsISVGValueObserver*>(observer)->*f)(this, aModType);
-  }
-}
-
-void
-nsSVGValue::WillModify(modificationType aModType)
-{
-  if (++mModifyNestCount == 1)
-    NotifyObservers(&nsISVGValueObserver::WillModifySVGObservable, aModType);
-}
-
-void
-nsSVGValue::DidModify(modificationType aModType)
-{
-  NS_ASSERTION(mModifyNestCount>0, "unbalanced Will/DidModify calls");
-  if (--mModifyNestCount == 0) {
-    OnDidModify();
-    NotifyObservers(&nsISVGValueObserver::DidModifySVGObservable, aModType);
-  }
-}
-
-
-NS_IMETHODIMP
-nsSVGValue::AddObserver(nsISVGValueObserver* observer)
-{
-  nsWeakPtr wr = do_GetWeakReference(observer);
-  if (!wr) return NS_ERROR_FAILURE;
-
-  // Prevent duplicate observers - needed because geometry can attempt
-  // to add itself as an observer of a paint server for both the
-  // stroke and fill.  Safe, as on a style change we remove both, as
-  // the change notification isn't fine grained, and re-add as
-  // appropriate.
-  if (!mObservers.Contains(wr)) {
-    mObservers.AppendElement(wr);
-  }
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsSVGValue::RemoveObserver(nsISVGValueObserver* observer)
-{
-  nsWeakPtr wr = do_GetWeakReference(observer);
-  if (!wr) return NS_ERROR_FAILURE;
-  return mObservers.RemoveElement(wr) ? NS_OK : NS_ERROR_FAILURE;
-}
-
-NS_IMETHODIMP
-nsSVGValue::BeginBatchUpdate()
-{
-  WillModify();
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsSVGValue::EndBatchUpdate()
-{
-  DidModify();
-  return NS_OK;
-}
-
-  
deleted file mode 100644
--- a/content/svg/content/src/nsSVGValue.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Mozilla SVG project.
- *
- * The Initial Developer of the Original Code is
- * Crocodile Clips Ltd..
- * Portions created by the Initial Developer are Copyright (C) 2001
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#ifndef __NS_SVGVALUE_H__
-#define __NS_SVGVALUE_H__
-
-#include "nscore.h"
-#include "nsISVGValue.h"
-#include "nsAutoPtr.h"
-#include "nsTArray.h"
-#include "nsISVGValueObserver.h"
-#include "nsIWeakReference.h"
-#include "nsCOMPtr.h"
-
-class nsSVGValue : public nsISVGValue
-{
-protected:
-  nsSVGValue();
-  virtual ~nsSVGValue();
-
-  // to be called by subclass whenever value is being modified.
-  // nested calls will be ignored, so calls need to be balanced
-  void WillModify(modificationType aModType = mod_other);
-  void DidModify(modificationType aModType = mod_other);
-
-  friend class nsSVGValueAutoNotifier;
-  
-public:
-  // Partial Implementation of nsISVGValue interface:
-  NS_IMETHOD AddObserver(nsISVGValueObserver* observer);
-  NS_IMETHOD RemoveObserver(nsISVGValueObserver* observer);
-  NS_IMETHOD BeginBatchUpdate();
-  NS_IMETHOD EndBatchUpdate();
-
-  typedef
-  NS_STDCALL_FUNCPROTO(nsresult,
-                       SVGObserverNotifyFunction,
-                       nsISVGValueObserver, DidModifySVGObservable,
-                       (nsISVGValue*, nsISVGValue::modificationType));
-
-protected:
-  // implementation helpers
-  void ReleaseObservers();
-  void NotifyObservers(SVGObserverNotifyFunction f,
-                       modificationType aModType);
-  PRInt32 GetModifyNestCount() { return mModifyNestCount; }
-private:
-  virtual void OnDidModify(){} // hook that will be called before observers are notified
-  
-  nsAutoTArray<nsWeakPtr, 1> mObservers;
-  PRInt32 mModifyNestCount;
-};
-
-// Class that will automatically call WillModify and DidModify in its ctor
-// and dtor respectively (for functions that have multiple exit points).
-
-class NS_STACK_CLASS nsSVGValueAutoNotifier
-{
-public:
-  nsSVGValueAutoNotifier(nsSVGValue* aVal,
-                         nsISVGValue::modificationType aModType =
-                         nsISVGValue::mod_other)
-    : mVal(aVal)
-    , mModType(aModType)
-  {
-    mVal->WillModify(mModType);
-  }
-
-  ~nsSVGValueAutoNotifier()
-  {
-    mVal->DidModify(mModType);
-  }
-
-private:
-  nsRefPtr<nsSVGValue> mVal;
-  nsISVGValue::modificationType mModType;
-};
-
-#endif //__NS_SVGVALUE_H__
--- a/layout/svg/base/src/nsSVGGradientFrame.h
+++ b/layout/svg/base/src/nsSVGGradientFrame.h
@@ -35,17 +35,16 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef __NS_SVGGRADIENTFRAME_H__
 #define __NS_SVGGRADIENTFRAME_H__
 
 #include "nsSVGPaintServerFrame.h"
-#include "nsWeakReference.h"
 #include "nsSVGElement.h"
 #include "gfxPattern.h"
 
 class nsIDOMSVGStopElement;
 
 typedef nsSVGPaintServerFrame nsSVGGradientFrameBase;
 
 /**
--- a/layout/svg/base/src/nsSVGInnerSVGFrame.h
+++ b/layout/svg/base/src/nsSVGInnerSVGFrame.h
@@ -83,19 +83,16 @@ public:
   // nsISVGChildFrame interface:
   NS_IMETHOD PaintSVG(nsSVGRenderState *aContext, const nsIntRect *aDirtyRect);
   virtual void NotifySVGChanged(PRUint32 aFlags);
   NS_IMETHOD_(nsIFrame*) GetFrameForPoint(const nsPoint &aPoint);
 
   // nsSVGContainerFrame methods:
   virtual gfxMatrix GetCanvasTM();
 
-  // nsISupportsWeakReference
-  // implementation inherited from nsSupportsWeakReference
-
   // nsISVGSVGFrame interface:
   NS_IMETHOD SuspendRedraw();
   NS_IMETHOD UnsuspendRedraw();
   NS_IMETHOD NotifyViewportChange();
 
 protected:
 
   nsAutoPtr<gfxMatrix> mCanvasTM;
--- a/layout/svg/base/src/nsSVGPathGeometryFrame.h
+++ b/layout/svg/base/src/nsSVGPathGeometryFrame.h
@@ -36,17 +36,16 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef __NS_SVGPATHGEOMETRYFRAME_H__
 #define __NS_SVGPATHGEOMETRYFRAME_H__
 
 #include "nsFrame.h"
 #include "nsISVGChildFrame.h"
-#include "nsWeakReference.h"
 #include "nsGkAtoms.h"
 #include "nsSVGGeometryFrame.h"
 #include "gfxRect.h"
 #include "gfxMatrix.h"
 
 class nsSVGMarkerFrame;
 class nsSVGMarkerProperty;
 
--- a/layout/svg/base/src/nsSVGTextFrame.cpp
+++ b/layout/svg/base/src/nsSVGTextFrame.cpp
@@ -33,17 +33,16 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMSVGTextElement.h"
 #include "nsSVGTextFrame.h"
-#include "nsWeakReference.h"
 #include "SVGLengthList.h"
 #include "nsIDOMSVGLength.h"
 #include "nsIDOMSVGAnimatedNumber.h"
 #include "nsISVGGlyphFragmentNode.h"
 #include "nsSVGGlyphFrame.h"
 #include "nsSVGOuterSVGFrame.h"
 #include "nsIDOMSVGRect.h"
 #include "nsSVGRect.h"