bug 798567 - convert css values to webidl r=bz
authorTrevor Saunders <trev.saunders@gmail.com>
Mon, 01 Oct 2012 12:49:41 -0400
changeset 125031 5aed5087fb7be3f5fd7e3ec18262fa765197bb67
parent 125001 93beff102db235fcf61d8760bb97cbfb365879a9
child 125032 744b40b75241df99854246d769b6ba1039c91e58
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs798567
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 798567 - convert css values to webidl r=bz
dom/base/nsDOMClassInfo.cpp
dom/base/nsDOMClassInfo.h
dom/base/nsDOMClassInfoClasses.h
dom/bindings/Bindings.conf
dom/interfaces/base/domstubs.idl
dom/interfaces/css/Makefile.in
dom/interfaces/css/nsIDOMCSSValueList.idl
dom/webidl/CSSPrimitiveValue.webidl
dom/webidl/CSSStyleDeclaration.webidl
dom/webidl/CSSValue.webidl
dom/webidl/CSSValueList.webidl
dom/webidl/WebIDL.mk
layout/style/CSSValue.h
layout/style/Makefile.in
layout/style/nsCSSRules.cpp
layout/style/nsCSSRules.h
layout/style/nsComputedDOMStyle.cpp
layout/style/nsComputedDOMStyle.h
layout/style/nsDOMCSSDeclaration.cpp
layout/style/nsDOMCSSDeclaration.h
layout/style/nsDOMCSSValueList.cpp
layout/style/nsDOMCSSValueList.h
layout/style/nsICSSDeclaration.h
layout/style/nsROCSSPrimitiveValue.cpp
layout/style/nsROCSSPrimitiveValue.h
layout/style/test/Makefile.in
layout/style/test/test_bug798567.html
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -277,20 +277,18 @@
 #include "nsIDOMCSSImportRule.h"
 #include "nsIDOMCSSMediaRule.h"
 #include "nsIDOMCSSFontFaceRule.h"
 #include "nsIDOMCSSMozDocumentRule.h"
 #include "nsIDOMCSSSupportsRule.h"
 #include "nsIDOMMozCSSKeyframeRule.h"
 #include "nsIDOMMozCSSKeyframesRule.h"
 #include "nsIDOMCSSPageRule.h"
-#include "nsIDOMCSSPrimitiveValue.h"
 #include "nsIDOMCSSStyleRule.h"
 #include "nsIDOMCSSStyleSheet.h"
-#include "nsDOMCSSValueList.h"
 #define MOZ_GENERATED_EVENTS_INCLUDES
 #include "GeneratedEvents.h"
 #undef MOZ_GENERATED_EVENTS_INCLUDES
 #include "nsIDOMDeviceMotionEvent.h"
 #include "nsIDOMRange.h"
 #include "nsIDOMNodeIterator.h"
 #include "nsIDOMTreeWalker.h"
 #include "nsIDOMXULDocument.h"
@@ -1012,18 +1010,16 @@ static nsDOMClassInfoData sClassInfoData
   NS_DEFINE_CLASSINFO_DATA(CSSGroupRuleRuleList, nsCSSRuleListSH,
                            ARRAY_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(MediaList, nsMediaListSH,
                            ARRAY_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(StyleSheetList, nsStyleSheetListSH,
                            ARRAY_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(CSSStyleSheet, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
-  NS_DEFINE_CLASSINFO_DATA(ROCSSPrimitiveValue, nsDOMGenericSH,
-                           DOM_DEFAULT_SCRIPTABLE_FLAGS)
 
   // Range classes
   NS_DEFINE_CLASSINFO_DATA(Range, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(Selection, nsDOMGenericSH,
                            DEFAULT_SCRIPTABLE_FLAGS)
 
   // XUL classes
@@ -1065,19 +1061,16 @@ static nsDOMClassInfoData sClassInfoData
   // DOM Chrome Window class.
   NS_DEFINE_CLASSINFO_DATA(ChromeWindow, nsWindowSH,
                            DEFAULT_SCRIPTABLE_FLAGS |
                            WINDOW_SCRIPTABLE_FLAGS)
 
   NS_DEFINE_CLASSINFO_DATA(CSSRGBColor, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
 
-  NS_DEFINE_CLASSINFO_DATA(CSSValueList, nsCSSValueListSH,
-                           ARRAY_SCRIPTABLE_FLAGS)
-
   NS_DEFINE_CLASSINFO_DATA_WITH_NAME(ContentList, HTMLCollection,
                                      nsDOMGenericSH,
                                      DOM_DEFAULT_SCRIPTABLE_FLAGS)
 
   NS_DEFINE_CLASSINFO_DATA(XMLStylesheetProcessingInstruction, nsNodeSH,
                            NODE_SCRIPTABLE_FLAGS)
 
   NS_DEFINE_CLASSINFO_DATA(ImageDocument, nsHTMLDocumentSH,
@@ -3001,24 +2994,16 @@ nsDOMClassInfo::Init()
   DOM_CLASSINFO_MAP_BEGIN(StyleSheetList, nsIDOMStyleSheetList)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMStyleSheetList)
   DOM_CLASSINFO_MAP_END
 
   DOM_CLASSINFO_MAP_BEGIN(CSSStyleSheet, nsIDOMCSSStyleSheet)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSStyleSheet)
   DOM_CLASSINFO_MAP_END
 
-  DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(ROCSSPrimitiveValue,
-                                      nsIDOMCSSPrimitiveValue)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSPrimitiveValue)
-  DOM_CLASSINFO_MAP_END
-
-  DOM_CLASSINFO_MAP_BEGIN(CSSValueList, nsIDOMCSSValueList)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSValueList)
-  DOM_CLASSINFO_MAP_END
 
   DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(CSSRect, nsIDOMRect)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMRect)
   DOM_CLASSINFO_MAP_END
 
   DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(CSSRGBColor, nsIDOMRGBColor)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMRGBColor)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSRGBAColor)
@@ -10069,27 +10054,16 @@ nsStyleSheetListSH::GetItemAt(nsISupport
                               nsWrapperCache **aCache, nsresult *rv)
 {
   nsDOMStyleSheetList* list = nsDOMStyleSheetList::FromSupports(aNative);
 
   return list->GetItemAt(aIndex);
 }
 
 
-// CSSValueList helper
-
-nsISupports*
-nsCSSValueListSH::GetItemAt(nsISupports *aNative, uint32_t aIndex,
-                            nsWrapperCache **aCache, nsresult *aResult)
-{
-  nsDOMCSSValueList* list = nsDOMCSSValueList::FromSupports(aNative);
-
-  return list->GetItemAt(aIndex);
-}
-
 // CSSRuleList scriptable helper
 
 nsISupports*
 nsCSSRuleListSH::GetItemAt(nsISupports *aNative, uint32_t aIndex,
                            nsWrapperCache **aCache, nsresult *aResult)
 {
   nsICSSRuleList* list = static_cast<nsICSSRuleList*>(aNative);
 #ifdef DEBUG
--- a/dom/base/nsDOMClassInfo.h
+++ b/dom/base/nsDOMClassInfo.h
@@ -1094,39 +1094,16 @@ protected:
 public:
   static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
   {
     return new nsStyleSheetListSH(aData);
   }
 };
 
 
-// CSSValueList helper
-
-class nsCSSValueListSH : public nsArraySH
-{
-protected:
-  nsCSSValueListSH(nsDOMClassInfoData* aData) : nsArraySH(aData)
-  {
-  }
-
-  virtual ~nsCSSValueListSH()
-  {
-  }
-
-  virtual nsISupports* GetItemAt(nsISupports *aNative, uint32_t aIndex,
-                                 nsWrapperCache **aCache, nsresult *aResult);
-
-public:
-  static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
-  {
-    return new nsCSSValueListSH(aData);
-  }
-};
-
 // CSSRuleList helper
 
 class nsCSSRuleListSH : public nsArraySH
 {
 protected:
   nsCSSRuleListSH(nsDOMClassInfoData* aData) : nsArraySH(aData)
   {
   }
--- a/dom/base/nsDOMClassInfoClasses.h
+++ b/dom/base/nsDOMClassInfoClasses.h
@@ -123,17 +123,16 @@ DOMCI_CLASS(CSSCharsetRule)
 DOMCI_CLASS(CSSImportRule)
 DOMCI_CLASS(CSSMediaRule)
 DOMCI_CLASS(CSSNameSpaceRule)
 DOMCI_CLASS(CSSRuleList)
 DOMCI_CLASS(CSSGroupRuleRuleList)
 DOMCI_CLASS(MediaList)
 DOMCI_CLASS(StyleSheetList)
 DOMCI_CLASS(CSSStyleSheet)
-DOMCI_CLASS(ROCSSPrimitiveValue)
 
 // Range classes
 DOMCI_CLASS(Range)
 DOMCI_CLASS(Selection)
 
 // XUL classes
 #ifdef MOZ_XUL
 DOMCI_CLASS(XULDocument)
@@ -158,20 +157,16 @@ DOMCI_CLASS(TreeWalker)
 DOMCI_CLASS(CSSRect)
 
 // DOM Chrome Window class, almost identical to Window
 DOMCI_CLASS(ChromeWindow)
 
 // RGBColor object used by getComputedStyle
 DOMCI_CLASS(CSSRGBColor)
 
-// CSSValueList object that represents an nsIDOMCSSValueList, used
-// by DOM CSS
-DOMCI_CLASS(CSSValueList)
-
 // ContentList object used for various live NodeLists
 DOMCI_CLASS(ContentList)
   
 // Processing-instruction with target "xml-stylesheet"
 DOMCI_CLASS(XMLStylesheetProcessingInstruction)
   
 DOMCI_CLASS(ImageDocument)
 
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -143,20 +143,32 @@ DOMInterfaces = {
     'headerFile': 'nsClientRect.h',
     'resultNotAddRefed': [ 'item' ]
 },
 
 'CSS2Properties': {
   'nativeType': 'nsDOMCSSDeclaration'
 },
 
+"CSSPrimitiveValue": {
+  "nativeType": "nsROCSSPrimitiveValue"
+},
+
 'CSSStyleDeclaration': {
   'nativeType': 'nsICSSDeclaration'
 },
 
+"CSSValue": {
+  "concrete": False
+},
+
+"CSSValueList": {
+  "nativeType": "nsDOMCSSValueList",
+},
+
 'DelayNode': [
 {
     'resultNotAddRefed': [ 'delayTime' ],
 }],
 
 'Document': [
 {
     'nativeType': 'nsIDocument',
@@ -753,18 +765,18 @@ addExternalHTMLElement('HTMLImageElement
 addExternalHTMLElement('HTMLMenuElement')
 addExternalHTMLElement('HTMLOptionElement')
 addExternalHTMLElement('HTMLOptGroupElement')
 addExternalHTMLElement('HTMLVideoElement')
 addExternalIface('Attr')
 addExternalIface('CanvasGradient', headerFile='nsIDOMCanvasRenderingContext2D.h')
 addExternalIface('CanvasPattern', headerFile='nsIDOMCanvasRenderingContext2D.h')
 addExternalIface('ClientRect')
+addExternalIface("Counter")
 addExternalIface('CSSRule')
-addExternalIface('CSSValue')
 addExternalIface('DocumentType', nativeType='nsIDOMDocumentType')
 addExternalIface('DOMRequest')
 addExternalIface('DOMStringList', nativeType='nsDOMStringList',
                  headerFile='nsDOMLists.h')
 addExternalIface('File')
 addExternalIface('HitRegionOptions', nativeType='nsISupports')
 addExternalIface('LockedFile')
 addExternalIface('MediaStream')
@@ -775,15 +787,17 @@ addExternalIface('PaintRequest')
 addExternalIface('Principal', nativeType='nsIPrincipal',
                  headerFile='nsIPrincipal.h', notflattened=True)
 addExternalIface('SVGLength')
 addExternalIface('SVGMatrix')
 addExternalIface('SVGNumber')
 addExternalIface('SVGPathSeg')
 addExternalIface('SVGPoint')
 addExternalIface('SVGTransform')
+addExternalIface("Rect")
+addExternalIface("RGBColor")
 addExternalIface('TextMetrics', headerFile='nsIDOMCanvasRenderingContext2D.h')
 addExternalIface('Touch', headerFile='nsIDOMTouchEvent.h')
 addExternalIface('URI', nativeType='nsIURI', headerFile='nsIURI.h',
                  notflattened=True)
 addExternalIface('UserDataHandler')
 addExternalIface('Window')
 addExternalIface('XULElement')
--- a/dom/interfaces/base/domstubs.idl
+++ b/dom/interfaces/base/domstubs.idl
@@ -62,17 +62,16 @@ interface nsIDOMEventListener;
 // HTML
 interface nsIDOMHTMLElement;
 interface nsIDOMHTMLFormElement;
 interface nsIDOMHTMLCollection;
 interface nsIDOMHTMLHeadElement;
 
 // CSS
 interface nsIDOMCSSValue;
-interface nsIDOMCSSValueList;
 interface nsIDOMCSSPrimitiveValue;
 interface nsIDOMCSSRule;
 interface nsIDOMCSSRuleList;
 interface nsIDOMMozCSSKeyframeRule;
 interface nsIDOMCSSStyleSheet;
 interface nsIDOMCSSStyleDeclaration;
 interface nsIDOMCounter;
 interface nsIDOMRect;
--- a/dom/interfaces/css/Makefile.in
+++ b/dom/interfaces/css/Makefile.in
@@ -16,17 +16,16 @@ GRE_MODULE	= 1
 
 SDK_XPIDLSRCS = 				\
 	nsIDOMCSSPrimitiveValue.idl		\
 	nsIDOMCSSRule.idl			\
 	nsIDOMCSSRuleList.idl			\
 	nsIDOMCSSStyleDeclaration.idl		\
 	nsIDOMCSSStyleSheet.idl			\
 	nsIDOMCSSValue.idl			\
-	nsIDOMCSSValueList.idl			\
 	nsIDOMElementCSSInlineStyle.idl		\
 	$(NULL)
 
 XPIDLSRCS =					\
 	nsIDOMCSSCharsetRule.idl		\
 	nsIDOMCSSConditionRule.idl		\
 	nsIDOMCSSFontFaceRule.idl		\
 	nsIDOMCSSGroupingRule.idl		\
deleted file mode 100644
--- a/dom/interfaces/css/nsIDOMCSSValueList.idl
+++ /dev/null
@@ -1,20 +0,0 @@
-/* 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 "nsIDOMCSSValue.idl"
-
-/**
- * The nsIDOMCSSValueList interface is a datatype for a list of CSS
- * values in the Document Object Model.
- *
- * For more information on this interface please see
- * http://www.w3.org/TR/DOM-Level-2-Style
- */
-
-[scriptable, uuid(8f09fa84-39b9-4dca-9b2f-db0eeb186286)]
-interface nsIDOMCSSValueList : nsIDOMCSSValue
-{
-  readonly attribute unsigned long    length;
-  nsIDOMCSSValue     item(in unsigned long index);
-};
new file mode 100644
--- /dev/null
+++ b/dom/webidl/CSSPrimitiveValue.webidl
@@ -0,0 +1,58 @@
+/* -*- 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/.
+ */
+
+interface Counter;
+interface Rect;
+interface RGBColor;
+
+interface CSSPrimitiveValue : CSSValue {
+
+  // UnitTypes
+  const unsigned short      CSS_UNKNOWN                    = 0;
+  const unsigned short      CSS_NUMBER                     = 1;
+  const unsigned short      CSS_PERCENTAGE                 = 2;
+  const unsigned short      CSS_EMS                        = 3;
+  const unsigned short      CSS_EXS                        = 4;
+  const unsigned short      CSS_PX                         = 5;
+  const unsigned short      CSS_CM                         = 6;
+  const unsigned short      CSS_MM                         = 7;
+  const unsigned short      CSS_IN                         = 8;
+  const unsigned short      CSS_PT                         = 9;
+  const unsigned short      CSS_PC                         = 10;
+  const unsigned short      CSS_DEG                        = 11;
+  const unsigned short      CSS_RAD                        = 12;
+  const unsigned short      CSS_GRAD                       = 13;
+  const unsigned short      CSS_MS                         = 14;
+  const unsigned short      CSS_S                          = 15;
+  const unsigned short      CSS_HZ                         = 16;
+  const unsigned short      CSS_KHZ                        = 17;
+  const unsigned short      CSS_DIMENSION                  = 18;
+  const unsigned short      CSS_STRING                     = 19;
+  const unsigned short      CSS_URI                        = 20;
+  const unsigned short      CSS_IDENT                      = 21;
+  const unsigned short      CSS_ATTR                       = 22;
+  const unsigned short      CSS_COUNTER                    = 23;
+  const unsigned short      CSS_RECT                       = 24;
+  const unsigned short      CSS_RGBCOLOR                   = 25;
+
+  readonly attribute unsigned short   primitiveType;
+  [Throws]
+  void               setFloatValue(unsigned short unitType,
+                                   float floatValue);
+  [Throws]
+  float              getFloatValue(unsigned short unitType);
+  [Throws]
+  void               setStringValue(unsigned short stringType,
+                                    DOMString stringValue);
+  [Throws]
+  DOMString          getStringValue();
+  [Throws]
+  Counter            getCounterValue();
+  [Throws]
+  Rect               getRectValue();
+  [Throws]
+  RGBColor           getRGBColorValue();
+};
--- a/dom/webidl/CSSStyleDeclaration.webidl
+++ b/dom/webidl/CSSStyleDeclaration.webidl
@@ -3,30 +3,29 @@
  * 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://dev.w3.org/csswg/cssom/
  */
 
 interface CSSRule;
-interface CSSValue;
 
 interface CSSStyleDeclaration {
   [SetterThrows]
   attribute DOMString cssText;
 
   readonly attribute unsigned long length;
   getter DOMString item(unsigned long index);
 
   [Throws]
   DOMString getPropertyValue(DOMString property);
   // Mozilla extension, sort of
   [Throws]
-  CSSValue getPropertyCSSValue(DOMString property);
+  CSSValue? getPropertyCSSValue(DOMString property);
   DOMString getPropertyPriority(DOMString property);
   // This would be nicer if it used a string default value of "".
   // See bug 759622.
   [Throws]
   void setProperty(DOMString property, DOMString value, [TreatNullAs=EmptyString] optional DOMString priority);
   [Throws]
   DOMString removeProperty(DOMString property);
 
new file mode 100644
--- /dev/null
+++ b/dom/webidl/CSSValue.webidl
@@ -0,0 +1,19 @@
+/* -*- 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/.
+ */
+
+interface CSSValue {
+
+  // UnitTypes
+  const unsigned short      CSS_INHERIT                    = 0;
+  const unsigned short      CSS_PRIMITIVE_VALUE            = 1;
+  const unsigned short      CSS_VALUE_LIST                 = 2;
+  const unsigned short      CSS_CUSTOM                     = 3;
+
+           [Throws]
+           attribute DOMString        cssText;
+
+  readonly attribute unsigned short   cssValueType;
+};
new file mode 100644
--- /dev/null
+++ b/dom/webidl/CSSValueList.webidl
@@ -0,0 +1,10 @@
+/* -*- 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/.
+ */
+
+interface CSSValueList : CSSValue {
+         readonly attribute unsigned long    length;
+  getter CSSValue           item(unsigned long index);
+};
--- a/dom/webidl/WebIDL.mk
+++ b/dom/webidl/WebIDL.mk
@@ -16,17 +16,20 @@ webidl_files = \
   AudioListener.webidl \
   AudioNode.webidl \
   AudioParam.webidl \
   AudioSourceNode.webidl \
   BiquadFilterNode.webidl \
   Blob.webidl \
   CanvasRenderingContext2D.webidl \
   ClientRectList.webidl \
+  CSSPrimitiveValue.webidl \
   CSSStyleDeclaration.webidl \
+  CSSValue.webidl \
+  CSSValueList.webidl \
   DelayNode.webidl \
   DOMImplementation.webidl \
   DOMParser.webidl \
   DOMSettableTokenList.webidl \
   DOMStringMap.webidl \
   DOMTokenList.webidl \
   DynamicsCompressorNode.webidl \
   Element.webidl \
new file mode 100644
--- /dev/null
+++ b/layout/style/CSSValue.h
@@ -0,0 +1,39 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set ts=2 et sw=2 tw=80: */
+/* 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/. */
+
+/* DOM object representing values in DOM computed style */
+
+#ifndef mozilla_dom_CSSValue_h_
+#define mozilla_dom_CSSValue_h_
+
+#include "nsWrapperCache.h"
+
+#include "mozilla/ErrorResult.h"
+#include "nsString.h"
+
+class nsIDOMCSSValue;
+class nsROCSSPrimitiveValue;
+
+namespace mozilla {
+namespace dom {
+
+/**
+ * CSSValue - a DOM object representing values in DOM computed style.
+ */
+class CSSValue : public nsISupports,
+                 public nsWrapperCache
+{
+public:
+  // CSSValue
+  virtual void GetCssText(nsString& aText, mozilla::ErrorResult& aRv) = 0;
+  virtual void SetCssText(const nsAString& aText, mozilla::ErrorResult& aRv) = 0;
+  virtual uint16_t CssValueType() const = 0;
+};
+
+}
+}
+
+#endif
--- a/layout/style/Makefile.in
+++ b/layout/style/Makefile.in
@@ -14,17 +14,17 @@ DIRS		= xbl-marquee
 ifdef ENABLE_TESTS
 TOOL_DIRS	= test
 endif
 
 MODULE		= layout
 LIBRARY_NAME	= gkstyle_s
 LIBXUL_LIBRARY	= 1
 
-EXPORTS_NAMESPACES = mozilla/css
+EXPORTS_NAMESPACES = mozilla/css mozilla/dom
 
 EXPORTS		= \
 		AnimationCommon.h \
 		nsAnimationManager.h \
 		nsCSSAnonBoxList.h \
 		nsCSSAnonBoxes.h \
 		nsCSSFontDescList.h \
 		nsCSSKeywordList.h \
@@ -76,16 +76,20 @@ EXPORTS_mozilla/css = \
 		ImageLoader.h \
 		ImportRule.h \
 		Loader.h \
 		NameSpaceRule.h \
 		Rule.h \
 		StyleRule.h \
 		$(NULL)
 
+EXPORTS_mozilla/dom = \
+  CSSValue.h \
+  $(null)
+
 CPPSRCS		= \
 		AnimationCommon.cpp \
 		nsCSSAnonBoxes.cpp \
 		nsCSSDataBlock.cpp \
 		Declaration.cpp \
 		ErrorReporter.cpp \
 		nsCSSKeywords.cpp \
 		ImageLoader.cpp \
--- a/layout/style/nsCSSRules.cpp
+++ b/layout/style/nsCSSRules.cpp
@@ -33,17 +33,17 @@
 #include "nsStyleUtil.h"
 #include "mozilla/css/Declaration.h"
 #include "nsCSSParser.h"
 #include "nsPrintfCString.h"
 #include "nsDOMClassInfoID.h"
 #include "mozilla/dom/CSSStyleDeclarationBinding.h"
 #include "StyleRule.h"
 
-namespace css = mozilla::css;
+using namespace mozilla;
 
 #define IMPL_STYLE_RULE_INHERIT_GET_DOM_RULE_WEAK(class_, super_) \
   /* virtual */ nsIDOMCSSRule* class_::GetDOMRule()               \
   { return this; }                                                \
   /* virtual */ nsIDOMCSSRule* class_::GetExistingDOMRule()       \
   { return this; }
 #define IMPL_STYLE_RULE_INHERIT_MAP_RULE_INFO_INTO(class_, super_) \
 /* virtual */ void class_::MapRuleInfoInto(nsRuleData* aRuleData) \
@@ -1614,22 +1614,23 @@ nsCSSFontFaceStyleDecl::SetCssText(const
 NS_IMETHODIMP
 nsCSSFontFaceStyleDecl::GetPropertyValue(const nsAString & propertyName,
                                          nsAString & aResult)
 {
   return GetPropertyValue(nsCSSProps::LookupFontDesc(propertyName), aResult);
 }
 
 // nsIDOMCSSValue getPropertyCSSValue (in DOMString propertyName);
-NS_IMETHODIMP
+already_AddRefed<dom::CSSValue>
 nsCSSFontFaceStyleDecl::GetPropertyCSSValue(const nsAString & propertyName,
-                                            nsIDOMCSSValue **aResult)
+                                            ErrorResult& aRv)
 {
   // ??? nsDOMCSSDeclaration returns null/NS_OK, but that seems wrong.
-  return NS_ERROR_NOT_IMPLEMENTED;
+  aRv.Throw(NS_ERROR_NOT_IMPLEMENTED);
+  return nullptr;
 }
 
 // DOMString removeProperty (in DOMString propertyName) raises (DOMException);
 NS_IMETHODIMP
 nsCSSFontFaceStyleDecl::RemoveProperty(const nsAString & propertyName,
                                        nsAString & aResult)
 {
   nsCSSFontDesc descID = nsCSSProps::LookupFontDesc(propertyName);
--- a/layout/style/nsCSSRules.h
+++ b/layout/style/nsCSSRules.h
@@ -7,16 +7,17 @@
 /* rules in a CSS stylesheet other than style rules (e.g., @import rules) */
 
 #ifndef nsCSSRules_h_
 #define nsCSSRules_h_
 
 #include "mozilla/Attributes.h"
 
 #include "mozilla/css/GroupRule.h"
+#include "mozilla/ErrorResult.h"
 #include "mozilla/Preferences.h"
 #include "nsIDOMCSSConditionRule.h"
 #include "nsIDOMCSSFontFaceRule.h"
 #include "nsIDOMCSSGroupingRule.h"
 #include "nsIDOMCSSMediaRule.h"
 #include "nsIDOMCSSMozDocumentRule.h"
 #include "nsIDOMCSSSupportsRule.h"
 #include "nsIDOMMozCSSKeyframeRule.h"
@@ -178,18 +179,22 @@ protected:
 } // namespace mozilla
 
 // A nsCSSFontFaceStyleDecl is always embedded in a nsCSSFontFaceRule.
 class nsCSSFontFaceRule;
 class nsCSSFontFaceStyleDecl : public nsICSSDeclaration
 {
 public:
   NS_DECL_ISUPPORTS_INHERITED
-  NS_DECL_NSIDOMCSSSTYLEDECLARATION
+  NS_DECL_NSIDOMCSSSTYLEDECLARATION_HELPER
   NS_DECL_NSICSSDECLARATION
+  virtual already_AddRefed<mozilla::dom::CSSValue>
+  GetPropertyCSSValue(const nsAString& aProp, mozilla::ErrorResult& aRv)
+    MOZ_OVERRIDE;
+  using nsICSSDeclaration::GetPropertyCSSValue;
 
   nsCSSFontFaceStyleDecl()
   {
     SetIsDOMBinding();
   }
 
   virtual nsINode *GetParentObject() MOZ_OVERRIDE;
   virtual void IndexedGetter(uint32_t aIndex, bool& aFound, nsAString& aPropName) MOZ_OVERRIDE;
--- a/layout/style/nsComputedDOMStyle.cpp
+++ b/layout/style/nsComputedDOMStyle.cpp
@@ -17,22 +17,24 @@
 #include "nsStyleContext.h"
 #include "nsIScrollableFrame.h"
 #include "nsContentUtils.h"
 #include "prprf.h"
 
 #include "nsCSSProps.h"
 #include "nsCSSKeywords.h"
 #include "nsDOMCSSRect.h"
+#include "nsDOMCSSValueList.h"
 #include "nsFlexContainerFrame.h"
 #include "nsGkAtoms.h"
 #include "nsHTMLReflowState.h"
 #include "nsThemeConstants.h"
 #include "nsStyleUtil.h"
 #include "nsStyleStructInlines.h"
+#include "nsROCSSPrimitiveValue.h"
 
 #include "nsPresContext.h"
 #include "nsIDocument.h"
 
 #include "nsCSSPseudoElements.h"
 #include "nsStyleSet.h"
 #include "imgIRequest.h"
 #include "nsLayoutUtils.h"
@@ -247,28 +249,32 @@ nsComputedDOMStyle::GetParentRule(nsIDOM
   return NS_OK;
 }
 
 
 NS_IMETHODIMP
 nsComputedDOMStyle::GetPropertyValue(const nsAString& aPropertyName,
                                      nsAString& aReturn)
 {
-  nsCOMPtr<nsIDOMCSSValue> val;
-
   aReturn.Truncate();
 
-  nsresult rv = GetPropertyCSSValue(aPropertyName, getter_AddRefs(val));
-  NS_ENSURE_SUCCESS(rv, rv);
+  ErrorResult error;
+  nsRefPtr<CSSValue> val = GetPropertyCSSValue(aPropertyName, error);
+  if (error.Failed()) {
+    return error.ErrorCode();
+  }
 
   if (val) {
-    rv = val->GetCssText(aReturn);
+    nsString text;
+    val->GetCssText(text, error);
+    aReturn.Assign(text);
+    return error.ErrorCode();
   }
 
-  return rv;
+  return NS_OK;
 }
 
 /* static */
 already_AddRefed<nsStyleContext>
 nsComputedDOMStyle::GetStyleContextForElement(Element* aElement,
                                               nsIAtom* aPseudo,
                                               nsIPresShell* aPresShell,
                                               StyleType aStyleType)
@@ -419,26 +425,27 @@ nsComputedDOMStyle::DocToUpdate()
 void
 nsComputedDOMStyle::GetCSSParsingEnvironment(CSSParsingEnvironment& aCSSParseEnv)
 {
   NS_RUNTIMEABORT("called nsComputedDOMStyle::GetCSSParsingEnvironment");
   // Just in case NS_RUNTIMEABORT ever stops killing us for some reason
   aCSSParseEnv.mPrincipal = nullptr;
 }
 
-NS_IMETHODIMP
-nsComputedDOMStyle::GetPropertyCSSValue(const nsAString& aPropertyName,
-                                        nsIDOMCSSValue** aReturn)
+already_AddRefed<CSSValue>
+nsComputedDOMStyle::GetPropertyCSSValue(const nsAString& aPropertyName, ErrorResult& aRv)
 {
   NS_ASSERTION(!mStyleContextHolder, "bad state");
 
-  *aReturn = nullptr;
-
   nsCOMPtr<nsIDocument> document = do_QueryReferent(mDocumentWeak);
-  NS_ENSURE_TRUE(document, NS_ERROR_NOT_AVAILABLE);
+  if (!document) {
+    aRv.Throw(NS_ERROR_NOT_AVAILABLE);
+    return nullptr;
+  }
+
   document->FlushPendingLinkUpdates();
 
   nsCSSProperty prop = nsCSSProps::LookupProperty(aPropertyName,
                                                   nsCSSProps::eEnabled);
 
   // We don't (for now, anyway, though it may make sense to change it
   // for all aliases, including those in nsCSSPropAliasList) want
   // aliases to be enumerable (via GetLength and IndexedGetter), so
@@ -465,32 +472,34 @@ nsComputedDOMStyle::GetPropertyCSSValue(
   }
   if (!propEntry) {
 #ifdef DEBUG_ComputedDOMStyle
     NS_WARNING(PromiseFlatCString(NS_ConvertUTF16toUTF8(aPropertyName) +
                                   NS_LITERAL_CSTRING(" is not queryable!")).get());
 #endif
 
     // NOTE:  For branches, we should flush here for compatibility!
-    return NS_OK;
+    return nullptr;
   }
 
   // Flush _before_ getting the presshell, since that could create a new
   // presshell.  Also note that we want to flush the style on the document
   // we're computing style in, not on the document mContent is in -- the two
   // may be different.
   document->FlushPendingNotifications(
     propEntry->mNeedsLayoutFlush ? Flush_Layout : Flush_Style);
 #ifdef DEBUG
   mFlushedPendingReflows = propEntry->mNeedsLayoutFlush;
 #endif
 
   mPresShell = document->GetShell();
-  NS_ENSURE_TRUE(mPresShell && mPresShell->GetPresContext(),
-                 NS_ERROR_NOT_AVAILABLE);
+  if (!mPresShell || !mPresShell->GetPresContext()) {
+    aRv.Throw(NS_ERROR_NOT_AVAILABLE);
+    return nullptr;
+  }
 
   if (!mPseudo && mStyleType == eAll) {
     mOuterFrame = mContent->GetPrimaryFrame();
     mInnerFrame = mOuterFrame;
     if (mOuterFrame) {
       nsIAtom* type = mOuterFrame->GetType();
       if (type == nsGkAtoms::tableOuterFrame) {
         // If the frame is an outer table frame then we should get the style
@@ -525,17 +534,21 @@ nsComputedDOMStyle::GetPropertyCSSValue(
     }
 #endif
     // Need to resolve a style context
     mStyleContextHolder =
       nsComputedDOMStyle::GetStyleContextForElement(mContent->AsElement(),
                                                     mPseudo,
                                                     mPresShell,
                                                     mStyleType);
-    NS_ENSURE_TRUE(mStyleContextHolder, NS_ERROR_OUT_OF_MEMORY);
+    if (!mStyleContextHolder) {
+      aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
+      return nullptr;
+    }
+
     NS_ASSERTION(mPseudo || !mStyleContextHolder->HasPseudoElementData(),
                  "should not have pseudo-element data");
   }
 
   // mExposeVisitedStyle is set to true only by testing APIs that
   // require chrome privilege.
   NS_ABORT_IF_FALSE(!mExposeVisitedStyle ||
                     nsContentUtils::IsCallerChrome(),
@@ -543,28 +556,27 @@ nsComputedDOMStyle::GetPropertyCSSValue(
   if (mExposeVisitedStyle && mStyleContextHolder->RelevantLinkVisited()) {
     nsStyleContext *styleIfVisited = mStyleContextHolder->GetStyleIfVisited();
     if (styleIfVisited) {
       mStyleContextHolder = styleIfVisited;
     }
   }
 
   // Call our pointer-to-member-function.
-  *aReturn = (this->*(propEntry->mGetter))();
-  NS_IF_ADDREF(*aReturn); // property getter gives us an object with refcount of 0
+  nsRefPtr<CSSValue> val = (this->*(propEntry->mGetter))();
 
   mOuterFrame = nullptr;
   mInnerFrame = nullptr;
   mPresShell = nullptr;
 
   // Release the current style context for it should be re-resolved
   // whenever a frame is not available.
   mStyleContextHolder = nullptr;
 
-  return NS_OK;
+  return val.forget();
 }
 
 
 NS_IMETHODIMP
 nsComputedDOMStyle::RemoveProperty(const nsAString& aPropertyName,
                                    nsAString& aReturn)
 {
   return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR;
@@ -606,57 +618,57 @@ nsComputedDOMStyle::IndexedGetter(uint32
   if (aFound) {
     CopyASCIItoUTF16(nsCSSProps::GetStringValue(propMap[aIndex].mProperty),
                      aPropName);
   }
 }
 
 // Property getters...
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetBinding()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
 
   const nsStyleDisplay* display = GetStyleDisplay();
 
   if (display->mBinding) {
     val->SetURI(display->mBinding->GetURI());
   } else {
     val->SetIdent(eCSSKeyword_none);
   }
 
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetClear()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(nsCSSProps::ValueToKeywordEnum(GetStyleDisplay()->mBreakType,
                                                nsCSSProps::kClearKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetCssFloat()
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
   val->SetIdent(nsCSSProps::ValueToKeywordEnum(GetStyleDisplay()->mFloats,
                                                nsCSSProps::kFloatKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetBottom()
 {
   return GetOffsetWidthFor(NS_SIDE_BOTTOM);
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetStackSizing()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(GetStyleXUL()->mStretchStack ? eCSSKeyword_stretch_to_fit :
                 eCSSKeyword_ignore);
   return val;
 }
 
@@ -681,120 +693,120 @@ nsComputedDOMStyle::SetToRGBAColor(nsROC
   red->SetNumber(NS_GET_R(aColor));
   green->SetNumber(NS_GET_G(aColor));
   blue->SetNumber(NS_GET_B(aColor));
   alpha->SetNumber(nsStyleUtil::ColorComponentToFloat(a));
 
   aValue->SetColor(rgbColor);
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetColor()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   SetToRGBAColor(val, GetStyleColor()->mColor);
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetOpacity()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetNumber(GetStyleDisplay()->mOpacity);
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetColumnCount()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
 
   const nsStyleColumn* column = GetStyleColumn();
 
   if (column->mColumnCount == NS_STYLE_COLUMN_COUNT_AUTO) {
     val->SetIdent(eCSSKeyword_auto);
   } else {
     val->SetNumber(column->mColumnCount);
   }
 
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetColumnWidth()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
 
   // XXX fix the auto case. When we actually have a column frame, I think
   // we should return the computed column width.
   SetValueToCoord(val, GetStyleColumn()->mColumnWidth, true);
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetColumnGap()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
 
   const nsStyleColumn* column = GetStyleColumn();
   if (column->mColumnGap.GetUnit() == eStyleUnit_Normal) {
     val->SetAppUnits(GetStyleFont()->mFont.size);
   } else {
     SetValueToCoord(val, GetStyleColumn()->mColumnGap, true);
   }
 
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetColumnFill()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(GetStyleColumn()->mColumnFill,
                                    nsCSSProps::kColumnFillKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetColumnRuleWidth()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetAppUnits(GetStyleColumn()->GetComputedColumnRuleWidth());
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetColumnRuleStyle()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(GetStyleColumn()->mColumnRuleStyle,
                                    nsCSSProps::kBorderStyleKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetColumnRuleColor()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
 
   const nsStyleColumn* column = GetStyleColumn();
   nscolor ruleColor;
   if (column->mColumnRuleColorIsForeground) {
     ruleColor = GetStyleColor()->mColor;
   } else {
     ruleColor = column->mColumnRuleColor;
   }
 
   SetToRGBAColor(val, ruleColor);
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetContent()
 {
   const nsStyleContent *content = GetStyleContent();
 
   if (content->ContentCount() == 0) {
     nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
     val->SetIdent(eCSSKeyword_none);
     return val;
@@ -894,17 +906,17 @@ nsComputedDOMStyle::DoGetContent()
         NS_NOTREACHED("unexpected type");
         break;
     }
   }
 
   return valueList;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetCounterIncrement()
 {
   const nsStyleContent *content = GetStyleContent();
 
   if (content->CounterIncrementCount() == 0) {
     nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
     val->SetIdent(eCSSKeyword_none);
     return val;
@@ -927,17 +939,17 @@ nsComputedDOMStyle::DoGetCounterIncremen
   }
 
   return valueList;
 }
 
 /* Convert the stored representation into a list of two values and then hand
  * it back.
  */
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetTransformOrigin()
 {
   /* We need to build up a list of two values.  We'll call them
    * width and height.
    */
 
   /* Store things as a value list */
   nsDOMCSSValueList* valueList = GetROCSSValueList(false);
@@ -964,17 +976,17 @@ nsComputedDOMStyle::DoGetTransformOrigin
   }
 
   return valueList;
 }
 
 /* Convert the stored representation into a list of two values and then hand
  * it back.
  */
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetPerspectiveOrigin()
 {
   /* We need to build up a list of two values.  We'll call them
    * width and height.
    */
 
   /* Store things as a value list */
   nsDOMCSSValueList* valueList = GetROCSSValueList(false);
@@ -990,54 +1002,54 @@ nsComputedDOMStyle::DoGetPerspectiveOrig
   nsROCSSPrimitiveValue* height = GetROCSSPrimitiveValue();
   SetValueToCoord(height, display->mPerspectiveOrigin[1], false,
                   &nsComputedDOMStyle::GetFrameBoundsHeightForTransform);
   valueList->AppendCSSValue(height);
 
   return valueList;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetPerspective()
 {
     nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
     if (GetStyleDisplay()->mChildPerspective.GetUnit() == eStyleUnit_Coord &&
         GetStyleDisplay()->mChildPerspective.GetCoordValue() == 0.0) {
         val->SetIdent(eCSSKeyword_none);
     } else {
         SetValueToCoord(val, GetStyleDisplay()->mChildPerspective, false);
     }
     return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetBackfaceVisibility()
 {
     nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
     val->SetIdent(
         nsCSSProps::ValueToKeywordEnum(GetStyleDisplay()->mBackfaceVisibility,
                                        nsCSSProps::kBackfaceVisibilityKTable));
     return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetTransformStyle()
 {
     nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
     val->SetIdent(
         nsCSSProps::ValueToKeywordEnum(GetStyleDisplay()->mTransformStyle,
                                        nsCSSProps::kTransformStyleKTable));
     return val;
 }
 
 /* If the property is "none", hand back "none" wrapped in a value.
  * Otherwise, compute the aggregate transform matrix and hands it back in a
  * "matrix" wrapper.
  */
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetTransform()
 {
   /* First, get the display data.  We'll need it. */
   const nsStyleDisplay* display = GetStyleDisplay();
 
   /* If there are no transforms, then we should construct a single-element
    * entry and hand it back.
    */
@@ -1124,17 +1136,17 @@ nsComputedDOMStyle::DoGetTransform()
 
   /* Create a value to hold our result. */
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
 
   val->SetString(resultString);
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetCounterReset()
 {
   const nsStyleContent *content = GetStyleContent();
 
   if (content->CounterResetCount() == 0) {
     nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
     val->SetIdent(eCSSKeyword_none);
     return val;
@@ -1154,17 +1166,17 @@ nsComputedDOMStyle::DoGetCounterReset()
     nsStyleUtil::AppendEscapedCSSIdent(data->mCounter, escaped);
     name->SetString(escaped);
     value->SetNumber(data->mValue); // XXX This should really be integer
   }
 
   return valueList;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetQuotes()
 {
   const nsStyleQuotes *quotes = GetStyleQuotes();
 
   if (quotes->QuotesCount() == 0) {
     nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
     val->SetIdent(eCSSKeyword_none);
     return val;
@@ -1185,17 +1197,17 @@ nsComputedDOMStyle::DoGetQuotes()
     s.Truncate();
     nsStyleUtil::AppendEscapedCSSString(*quotes->CloseQuoteAt(i), s);
     closeVal->SetString(s);
   }
 
   return valueList;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetFontFamily()
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
 
   const nsStyleFont* font = GetStyleFont();
 
   nsCOMPtr<nsIDocument> doc = do_QueryReferent(mDocumentWeak);
   NS_ASSERTION(doc, "document is required");
@@ -1218,121 +1230,121 @@ nsComputedDOMStyle::DoGetFontFamily()
     }
   } else {
     val->SetString(fontName);
   }
 
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetFontSize()
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
 
   // Note: GetStyleFont()->mSize is the 'computed size';
   // GetStyleFont()->mFont.size is the 'actual size'
   val->SetAppUnits(GetStyleFont()->mSize);
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetFontSizeAdjust()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
 
   const nsStyleFont *font = GetStyleFont();
 
   if (font->mFont.sizeAdjust) {
     val->SetNumber(font->mFont.sizeAdjust);
   } else {
     val->SetIdent(eCSSKeyword_none);
   }
 
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetFontStretch()
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
 
   val->SetIdent(nsCSSProps::ValueToKeywordEnum(GetStyleFont()->mFont.stretch,
                                                nsCSSProps::kFontStretchKTable));
 
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetFontStyle()
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
   val->SetIdent(nsCSSProps::ValueToKeywordEnum(GetStyleFont()->mFont.style,
                                                nsCSSProps::kFontStyleKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetFontWeight()
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
 
   const nsStyleFont* font = GetStyleFont();
 
   uint16_t weight = font->mFont.weight;
   NS_ASSERTION(weight % 100 == 0, "unexpected value of font-weight");
   val->SetNumber(weight);
 
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetFontVariant()
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(GetStyleFont()->mFont.variant,
                                    nsCSSProps::kFontVariantKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetFontFeatureSettings()
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
 
   const nsStyleFont* font = GetStyleFont();
   if (font->mFont.fontFeatureSettings.IsEmpty()) {
     val->SetIdent(eCSSKeyword_normal);
   } else {
     nsAutoString result;
     nsStyleUtil::AppendFontFeatureSettings(font->mFont.fontFeatureSettings,
                                            result);
     val->SetString(result);
   }
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetFontLanguageOverride()
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
 
   const nsStyleFont* font = GetStyleFont();
   if (font->mFont.languageOverride.IsEmpty()) {
     val->SetIdent(eCSSKeyword_normal);
   } else {
     nsString str;
     nsStyleUtil::AppendEscapedCSSString(font->mFont.languageOverride, str);
     val->SetString(str);
   }
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::GetBackgroundList(uint8_t nsStyleBackground::Layer::* aMember,
                                       uint32_t nsStyleBackground::* aCount,
                                       const int32_t aTable[])
 {
   const nsStyleBackground* bg = GetStyleBackground();
 
   nsDOMCSSValueList *valueList = GetROCSSValueList(true);
 
@@ -1341,45 +1353,45 @@ nsComputedDOMStyle::GetBackgroundList(ui
     valueList->AppendCSSValue(val);
     val->SetIdent(nsCSSProps::ValueToKeywordEnum(bg->mLayers[i].*aMember,
                                                  aTable));
   }
 
   return valueList;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetBackgroundAttachment()
 {
   return GetBackgroundList(&nsStyleBackground::Layer::mAttachment,
                            &nsStyleBackground::mAttachmentCount,
                            nsCSSProps::kBackgroundAttachmentKTable);
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetBackgroundClip()
 {
   return GetBackgroundList(&nsStyleBackground::Layer::mClip,
                            &nsStyleBackground::mClipCount,
                            nsCSSProps::kBackgroundOriginKTable);
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetBackgroundColor()
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
   SetToRGBAColor(val, GetStyleBackground()->mBackgroundColor);
   return val;
 }
 
 
 static void
 SetValueToCalc(const nsStyleCoord::Calc *aCalc, nsROCSSPrimitiveValue *aValue)
 {
-  nsRefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue();
+  nsRefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
   nsAutoString tmp, result;
 
   result.AppendLiteral("calc(");
 
   val->SetAppUnits(aCalc->mLength);
   val->GetCssText(tmp);
   result.Append(tmp);
 
@@ -1654,17 +1666,17 @@ nsComputedDOMStyle::SetValueToStyleImage
       aValue->SetIdent(eCSSKeyword_none);
       break;
     default:
       NS_NOTREACHED("unexpected image type");
       break;
   }
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetBackgroundImage()
 {
   const nsStyleBackground* bg = GetStyleBackground();
 
   nsDOMCSSValueList *valueList = GetROCSSValueList(true);
 
   for (uint32_t i = 0, i_end = bg->mImageCount; i < i_end; ++i) {
     nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
@@ -1672,35 +1684,35 @@ nsComputedDOMStyle::DoGetBackgroundImage
 
     const nsStyleImage& image = bg->mLayers[i].mImage;
     SetValueToStyleImage(image, val);
   }
 
   return valueList;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetBackgroundInlinePolicy()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(nsCSSProps::ValueToKeywordEnum(
                   GetStyleBackground()->mBackgroundInlinePolicy,
                   nsCSSProps::kBackgroundInlinePolicyKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetBackgroundOrigin()
 {
   return GetBackgroundList(&nsStyleBackground::Layer::mOrigin,
                            &nsStyleBackground::mOriginCount,
                            nsCSSProps::kBackgroundOriginKTable);
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetBackgroundPosition()
 {
   const nsStyleBackground* bg = GetStyleBackground();
 
   nsDOMCSSValueList *valueList = GetROCSSValueList(true);
 
   for (uint32_t i = 0, i_end = bg->mPositionCount; i < i_end; ++i) {
     nsDOMCSSValueList *itemList = GetROCSSValueList(false);
@@ -1733,17 +1745,17 @@ nsComputedDOMStyle::DoGetBackgroundPosit
     } else {
       SetValueToCalc(&pos.mYPosition, valY);
     }
   }
 
   return valueList;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetBackgroundRepeat()
 {
   const nsStyleBackground* bg = GetStyleBackground();
 
   nsDOMCSSValueList *valueList = GetROCSSValueList(true);
 
   for (uint32_t i = 0, i_end = bg->mRepeatCount; i < i_end; ++i) {
     nsDOMCSSValueList *itemList = GetROCSSValueList(false);
@@ -1781,17 +1793,17 @@ nsComputedDOMStyle::DoGetBackgroundRepea
       valY->SetIdent(nsCSSProps::ValueToKeywordEnum(yRepeat,
                                           nsCSSProps::kBackgroundRepeatKTable));
     }
   }
 
   return valueList;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetBackgroundSize()
 {
   const nsStyleBackground* bg = GetStyleBackground();
 
   nsDOMCSSValueList *valueList = GetROCSSValueList(true);
 
   for (uint32_t i = 0, i_end = bg->mSizeCount; i < i_end; ++i) {
     const nsStyleBackground::Size &size = bg->mLayers[i].mSize;
@@ -1862,51 +1874,51 @@ nsComputedDOMStyle::DoGetBackgroundSize(
         break;
       }
     }
   }
 
   return valueList;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetPaddingTop()
 {
   return GetPaddingWidthFor(NS_SIDE_TOP);
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetPaddingBottom()
 {
   return GetPaddingWidthFor(NS_SIDE_BOTTOM);
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetPaddingLeft()
 {
   return GetPaddingWidthFor(NS_SIDE_LEFT);
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetPaddingRight()
 {
   return GetPaddingWidthFor(NS_SIDE_RIGHT);
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetBorderCollapse()
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(GetStyleTableBorder()->mBorderCollapse,
                                    nsCSSProps::kBorderCollapseKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetBorderSpacing()
 {
   nsDOMCSSValueList *valueList = GetROCSSValueList(false);
 
   nsROCSSPrimitiveValue* xSpacing = GetROCSSPrimitiveValue();
   valueList->AppendCSSValue(xSpacing);
 
   nsROCSSPrimitiveValue* ySpacing = GetROCSSPrimitiveValue();
@@ -1914,214 +1926,214 @@ nsComputedDOMStyle::DoGetBorderSpacing()
 
   const nsStyleTableBorder *border = GetStyleTableBorder();
   xSpacing->SetAppUnits(border->mBorderSpacingX);
   ySpacing->SetAppUnits(border->mBorderSpacingY);
 
   return valueList;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetCaptionSide()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(GetStyleTableBorder()->mCaptionSide,
                                    nsCSSProps::kCaptionSideKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetEmptyCells()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(GetStyleTableBorder()->mEmptyCells,
                                    nsCSSProps::kEmptyCellsKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetTableLayout()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(GetStyleTable()->mLayoutStrategy,
                                    nsCSSProps::kTableLayoutKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetBorderTopStyle()
 {
   return GetBorderStyleFor(NS_SIDE_TOP);
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetBorderBottomStyle()
 {
   return GetBorderStyleFor(NS_SIDE_BOTTOM);
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetBorderLeftStyle()
 {
   return GetBorderStyleFor(NS_SIDE_LEFT);
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetBorderRightStyle()
 {
   return GetBorderStyleFor(NS_SIDE_RIGHT);
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetBorderBottomColors()
 {
   return GetBorderColorsFor(NS_SIDE_BOTTOM);
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetBorderLeftColors()
 {
   return GetBorderColorsFor(NS_SIDE_LEFT);
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetBorderRightColors()
 {
   return GetBorderColorsFor(NS_SIDE_RIGHT);
 }
 
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetBorderTopColors()
 {
   return GetBorderColorsFor(NS_SIDE_TOP);
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetBorderBottomLeftRadius()
 {
   return GetEllipseRadii(GetStyleBorder()->mBorderRadius,
                          NS_CORNER_BOTTOM_LEFT, true);
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetBorderBottomRightRadius()
 {
   return GetEllipseRadii(GetStyleBorder()->mBorderRadius,
                          NS_CORNER_BOTTOM_RIGHT, true);
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetBorderTopLeftRadius()
 {
   return GetEllipseRadii(GetStyleBorder()->mBorderRadius,
                          NS_CORNER_TOP_LEFT, true);
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetBorderTopRightRadius()
 {
   return GetEllipseRadii(GetStyleBorder()->mBorderRadius,
                          NS_CORNER_TOP_RIGHT, true);
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetBorderTopWidth()
 {
   return GetBorderWidthFor(NS_SIDE_TOP);
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetBorderBottomWidth()
 {
   return GetBorderWidthFor(NS_SIDE_BOTTOM);
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetBorderLeftWidth()
 {
   return GetBorderWidthFor(NS_SIDE_LEFT);
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetBorderRightWidth()
 {
   return GetBorderWidthFor(NS_SIDE_RIGHT);
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetBorderTopColor()
 {
   return GetBorderColorFor(NS_SIDE_TOP);
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetBorderBottomColor()
 {
   return GetBorderColorFor(NS_SIDE_BOTTOM);
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetBorderLeftColor()
 {
   return GetBorderColorFor(NS_SIDE_LEFT);
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetBorderRightColor()
 {
   return GetBorderColorFor(NS_SIDE_RIGHT);
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetMarginTopWidth()
 {
   return GetMarginWidthFor(NS_SIDE_TOP);
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetMarginBottomWidth()
 {
   return GetMarginWidthFor(NS_SIDE_BOTTOM);
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetMarginLeftWidth()
 {
   return GetMarginWidthFor(NS_SIDE_LEFT);
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetMarginRightWidth()
 {
   return GetMarginWidthFor(NS_SIDE_RIGHT);
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetMarkerOffset()
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
   SetValueToCoord(val, GetStyleContent()->mMarkerOffset, false);
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetOrient()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(GetStyleDisplay()->mOrient,
                                    nsCSSProps::kOrientKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetOutlineWidth()
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
 
   const nsStyleOutline* outline = GetStyleOutline();
 
   nscoord width;
   if (outline->GetOutlineStyle() == NS_STYLE_BORDER_STYLE_NONE) {
@@ -2135,76 +2147,76 @@ nsComputedDOMStyle::DoGetOutlineWidth()
       outline->GetOutlineWidth(width);
     NS_ASSERTION(res, "percent outline doesn't exist");
   }
   val->SetAppUnits(width);
 
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetOutlineStyle()
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(GetStyleOutline()->GetOutlineStyle(),
                                    nsCSSProps::kOutlineStyleKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetOutlineOffset()
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
   val->SetAppUnits(GetStyleOutline()->mOutlineOffset);
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetOutlineRadiusBottomLeft()
 {
   return GetEllipseRadii(GetStyleOutline()->mOutlineRadius,
                          NS_CORNER_BOTTOM_LEFT, false);
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetOutlineRadiusBottomRight()
 {
   return GetEllipseRadii(GetStyleOutline()->mOutlineRadius,
                          NS_CORNER_BOTTOM_RIGHT, false);
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetOutlineRadiusTopLeft()
 {
   return GetEllipseRadii(GetStyleOutline()->mOutlineRadius,
                          NS_CORNER_TOP_LEFT, false);
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetOutlineRadiusTopRight()
 {
   return GetEllipseRadii(GetStyleOutline()->mOutlineRadius,
                          NS_CORNER_TOP_RIGHT, false);
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetOutlineColor()
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
 
   nscolor color;
   if (!GetStyleOutline()->GetOutlineColor(color))
     color = GetStyleColor()->mColor;
 
   SetToRGBAColor(val, color);
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::GetEllipseRadii(const nsStyleCorners& aRadius,
                                     uint8_t aFullCorner,
                                     bool aIsBorder) // else outline
 {
   nsStyleCoord radiusX, radiusY;
   if (mInnerFrame && aIsBorder) {
     nscoord radii[8];
     mInnerFrame->GetBorderRadii(radii);
@@ -2249,17 +2261,17 @@ nsComputedDOMStyle::GetEllipseRadii(cons
   valueList->AppendCSSValue(valY);
 
   SetValueToCoord(valX, radiusX, true);
   SetValueToCoord(valY, radiusY, true);
 
   return valueList;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::GetCSSShadowArray(nsCSSShadowArray* aArray,
                                       const nscolor& aDefaultColor,
                                       bool aIsBoxShadow)
 {
   if (!aArray) {
     nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
     val->SetIdent(eCSSKeyword_none);
     return val;
@@ -2322,33 +2334,33 @@ nsComputedDOMStyle::GetCSSShadowArray(ns
         nsCSSProps::ValueToKeywordEnum(NS_STYLE_BOX_SHADOW_INSET,
                                        nsCSSProps::kBoxShadowTypeKTable));
     }
   }
 
   return valueList;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetBoxShadow()
 {
   return GetCSSShadowArray(GetStyleBorder()->mBoxShadow,
                            GetStyleColor()->mColor,
                            true);
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetZIndex()
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
   SetValueToCoord(val, GetStylePosition()->mZIndex, false);
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetListStyleImage()
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
 
   const nsStyleList* list = GetStyleList();
 
   if (!list->GetListStyleImage()) {
     val->SetIdent(eCSSKeyword_none);
@@ -2358,37 +2370,37 @@ nsComputedDOMStyle::DoGetListStyleImage(
       list->GetListStyleImage()->GetURI(getter_AddRefs(uri));
     }
     val->SetURI(uri);
   }
 
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetListStylePosition()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(GetStyleList()->mListStylePosition,
                                    nsCSSProps::kListStylePositionKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetListStyleType()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(GetStyleList()->mListStyleType,
                                    nsCSSProps::kListStyleKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetImageRegion()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
 
   const nsStyleList* list = GetStyleList();
 
   if (list->mImageRegion.width <= 0 || list->mImageRegion.height <= 0) {
     val->SetIdent(eCSSKeyword_auto);
@@ -2405,75 +2417,75 @@ nsComputedDOMStyle::DoGetImageRegion()
     bottomVal->SetAppUnits(list->mImageRegion.height + list->mImageRegion.y);
     leftVal->SetAppUnits(list->mImageRegion.x);
     val->SetRect(domRect);
   }
 
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetLineHeight()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
 
   nscoord lineHeight;
   if (GetLineHeightCoord(lineHeight)) {
     val->SetAppUnits(lineHeight);
   } else {
     SetValueToCoord(val, GetStyleText()->mLineHeight, true,
                     nullptr, nsCSSProps::kLineHeightKTable);
   }
 
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetVerticalAlign()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   SetValueToCoord(val, GetStyleTextReset()->mVerticalAlign, false,
                   &nsComputedDOMStyle::GetLineHeightCoord,
                   nsCSSProps::kVerticalAlignKTable);
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetTextAlign()
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(GetStyleText()->mTextAlign,
                                    nsCSSProps::kTextAlignKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetTextAlignLast()
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(GetStyleText()->mTextAlignLast,
                                    nsCSSProps::kTextAlignLastKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetMozTextBlink()
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
 
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(GetStyleTextReset()->mTextBlink,
                                    nsCSSProps::kTextBlinkKTable));
 
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetTextDecoration()
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
 
   const nsStyleTextReset* textReset = GetStyleTextReset();
 
   // If decoration style or color wasn't initial value, the author knew the
   // text-decoration is a shorthand property in CSS 3.
@@ -2518,34 +2530,34 @@ nsComputedDOMStyle::DoGetTextDecoration(
         NS_STYLE_TEXT_BLINK_BLINK, NS_STYLE_TEXT_BLINK_BLINK, str);
     }
     val->SetString(str);
   }
 
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetTextDecorationColor()
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
 
   nscolor color;
   bool isForeground;
   GetStyleTextReset()->GetDecorationColor(color, isForeground);
   if (isForeground) {
     color = GetStyleColor()->mColor;
   }
 
   SetToRGBAColor(val, color);
 
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetTextDecorationLine()
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
 
   int32_t intValue = GetStyleTextReset()->mTextDecorationLine;
 
   if (NS_STYLE_TEXT_DECORATION_LINE_NONE == intValue) {
     val->SetIdent(eCSSKeyword_none);
@@ -2559,38 +2571,38 @@ nsComputedDOMStyle::DoGetTextDecorationL
       intValue, NS_STYLE_TEXT_DECORATION_LINE_UNDERLINE,
       NS_STYLE_TEXT_DECORATION_LINE_LINE_THROUGH, decorationLineString);
     val->SetString(decorationLineString);
   }
 
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetTextDecorationStyle()
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
 
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(GetStyleTextReset()->GetDecorationStyle(),
                                    nsCSSProps::kTextDecorationStyleKTable));
 
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetTextIndent()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   SetValueToCoord(val, GetStyleText()->mTextIndent, false,
                   &nsComputedDOMStyle::GetCBContentWidth);
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetTextOverflow()
 {
   const nsStyleTextReset *style = GetStyleTextReset();
   nsROCSSPrimitiveValue *first = GetROCSSPrimitiveValue();
   const nsStyleTextOverflowSide *side = style->mTextOverflow.GetFirstValue();
   if (side->mType == NS_STYLE_TEXT_OVERFLOW_STRING) {
     nsString str;
     nsStyleUtil::AppendEscapedCSSString(side->mString, str);
@@ -2616,109 +2628,109 @@ nsComputedDOMStyle::DoGetTextOverflow()
   }
 
   nsDOMCSSValueList *valueList = GetROCSSValueList(false);
   valueList->AppendCSSValue(first);
   valueList->AppendCSSValue(second);
   return valueList;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetTextShadow()
 {
   return GetCSSShadowArray(GetStyleText()->mTextShadow,
                            GetStyleColor()->mColor,
                            false);
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetTextTransform()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(GetStyleText()->mTextTransform,
                                    nsCSSProps::kTextTransformKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetTabSize()
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
   val->SetNumber(GetStyleText()->mTabSize);
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetLetterSpacing()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   SetValueToCoord(val, GetStyleText()->mLetterSpacing, false);
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetWordSpacing()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetAppUnits(GetStyleText()->mWordSpacing);
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetWhiteSpace()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(GetStyleText()->mWhiteSpace,
                                    nsCSSProps::kWhitespaceKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetWindowShadow()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(GetStyleUIReset()->mWindowShadow,
                                    nsCSSProps::kWindowShadowKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetWordBreak()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(GetStyleText()->mWordBreak,
                                    nsCSSProps::kWordBreakKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetWordWrap()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(GetStyleText()->mWordWrap,
                                    nsCSSProps::kWordWrapKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetHyphens()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(GetStyleText()->mHyphens,
                                    nsCSSProps::kHyphensKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetTextSizeAdjust()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   switch (GetStyleText()->mTextSizeAdjust) {
     default:
       NS_NOTREACHED("unexpected value");
       // fall through
     case NS_STYLE_TEXT_SIZE_ADJUST_AUTO:
@@ -2726,59 +2738,59 @@ nsComputedDOMStyle::DoGetTextSizeAdjust(
       break;
     case NS_STYLE_TEXT_SIZE_ADJUST_NONE:
       val->SetIdent(eCSSKeyword_none);
       break;
   }
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetPointerEvents()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(GetStyleVisibility()->mPointerEvents,
                                    nsCSSProps::kPointerEventsKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetVisibility()
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
   val->SetIdent(nsCSSProps::ValueToKeywordEnum(GetStyleVisibility()->mVisible,
                                                nsCSSProps::kVisibilityKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetDirection()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(GetStyleVisibility()->mDirection,
                                    nsCSSProps::kDirectionKTable));
   return val;
 }
 
 MOZ_STATIC_ASSERT(NS_STYLE_UNICODE_BIDI_NORMAL == 0,
                   "unicode-bidi style constants not as expected");
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetUnicodeBidi()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(GetStyleTextReset()->mUnicodeBidi,
                                    nsCSSProps::kUnicodeBidiKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetCursor()
 {
   nsDOMCSSValueList *valueList = GetROCSSValueList(true);
 
   const nsStyleUserInterface *ui = GetStyleUserInterface();
 
   for (nsCursorImage *item = ui->mCursorArray,
          *item_end = ui->mCursorArray + ui->mCursorArrayLength;
@@ -2806,93 +2818,93 @@ nsComputedDOMStyle::DoGetCursor()
 
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(nsCSSProps::ValueToKeywordEnum(ui->mCursor,
                                                nsCSSProps::kCursorKTable));
   valueList->AppendCSSValue(val);
   return valueList;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetAppearance()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(nsCSSProps::ValueToKeywordEnum(GetStyleDisplay()->mAppearance,
                                                nsCSSProps::kAppearanceKTable));
   return val;
 }
 
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetBoxAlign()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(nsCSSProps::ValueToKeywordEnum(GetStyleXUL()->mBoxAlign,
                                                nsCSSProps::kBoxAlignKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetBoxDirection()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(GetStyleXUL()->mBoxDirection,
                                    nsCSSProps::kBoxDirectionKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetBoxFlex()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetNumber(GetStyleXUL()->mBoxFlex);
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetBoxOrdinalGroup()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetNumber(GetStyleXUL()->mBoxOrdinal);
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetBoxOrient()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(GetStyleXUL()->mBoxOrient,
                                    nsCSSProps::kBoxOrientKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetBoxPack()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(nsCSSProps::ValueToKeywordEnum(GetStyleXUL()->mBoxPack,
                                                nsCSSProps::kBoxPackKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetBoxSizing()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(GetStylePosition()->mBoxSizing,
                                    nsCSSProps::kBoxSizingKTable));
   return val;
 }
 
 /* Border image properties */
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetBorderImageSource()
 {
   const nsStyleBorder* border = GetStyleBorder();
 
   imgIRequest* imgSrc = border->GetBorderImage();
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
   if (imgSrc) {
     nsCOMPtr<nsIURI> uri;
@@ -2900,17 +2912,17 @@ nsComputedDOMStyle::DoGetBorderImageSour
     val->SetURI(uri);
   } else {
     val->SetIdent(eCSSKeyword_none);
   }
 
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetBorderImageSlice()
 {
   nsDOMCSSValueList* valueList = GetROCSSValueList(false);
 
   const nsStyleBorder* border = GetStyleBorder();
   // Four slice numbers.
   NS_FOR_CSS_SIDES (side) {
     nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
@@ -2923,49 +2935,49 @@ nsComputedDOMStyle::DoGetBorderImageSlic
     nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
     valueList->AppendCSSValue(val);
     val->SetIdent(eCSSKeyword_fill);
   }
 
   return valueList;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetBorderImageWidth()
 {
   const nsStyleBorder* border = GetStyleBorder();
   nsDOMCSSValueList* valueList = GetROCSSValueList(false);
   NS_FOR_CSS_SIDES (side) {
     nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
     valueList->AppendCSSValue(val);
     SetValueToCoord(val, border->mBorderImageWidth.Get(side),
                     true, nullptr);
   }
 
   return valueList;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetBorderImageOutset()
 {
   nsDOMCSSValueList *valueList = GetROCSSValueList(false);
 
   const nsStyleBorder* border = GetStyleBorder();
   // four slice numbers
   NS_FOR_CSS_SIDES (side) {
     nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
     valueList->AppendCSSValue(val);
     SetValueToCoord(val, border->mBorderImageOutset.Get(side),
                     true, nullptr);
   }
 
   return valueList;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetBorderImageRepeat()
 {
   nsDOMCSSValueList* valueList = GetROCSSValueList(false);
 
   const nsStyleBorder* border = GetStyleBorder();
 
   // horizontal repeat
   nsROCSSPrimitiveValue* valX = GetROCSSPrimitiveValue();
@@ -2979,27 +2991,27 @@ nsComputedDOMStyle::DoGetBorderImageRepe
   valueList->AppendCSSValue(valY);
   valY->SetIdent(
     nsCSSProps::ValueToKeywordEnum(border->mBorderImageRepeatV,
                                    nsCSSProps::kBorderImageRepeatKTable));
   return valueList;
 }
 
 #ifdef MOZ_FLEXBOX
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetAlignItems()
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(GetStylePosition()->mAlignItems,
                                    nsCSSProps::kAlignItemsKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetAlignSelf()
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
   uint8_t computedAlignSelf = GetStylePosition()->mAlignSelf;
 
   if (computedAlignSelf == NS_STYLE_ALIGN_SELF_AUTO) {
     // "align-self: auto" needs to compute to parent's align-items value.
     nsStyleContext* parentStyleContext = mStyleContextHolder->GetParent();
@@ -3015,17 +3027,17 @@ nsComputedDOMStyle::DoGetAlignSelf()
   NS_ABORT_IF_FALSE(computedAlignSelf != NS_STYLE_ALIGN_SELF_AUTO,
                     "Should have swapped out 'auto' for something non-auto");
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(computedAlignSelf,
                                    nsCSSProps::kAlignSelfKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetFlexBasis()
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
 
   // XXXdholbert We could make this more automagic and resolve percentages
   // if we wanted, by passing in a PercentageBaseGetter instead of nullptr
   // below.  Logic would go like this:
   //   if (i'm a flex item) {
@@ -3036,148 +3048,148 @@ nsComputedDOMStyle::DoGetFlexBasis()
   //     }
   //   }
 
   SetValueToCoord(val, GetStylePosition()->mFlexBasis, true,
                   nullptr, nsCSSProps::kWidthKTable);
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetFlexDirection()
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(GetStylePosition()->mFlexDirection,
                                    nsCSSProps::kFlexDirectionKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetFlexGrow()
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
   val->SetNumber(GetStylePosition()->mFlexGrow);
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetFlexShrink()
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
   val->SetNumber(GetStylePosition()->mFlexShrink);
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetOrder()
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
   val->SetNumber(GetStylePosition()->mOrder);
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetJustifyContent()
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(GetStylePosition()->mJustifyContent,
                                    nsCSSProps::kJustifyContentKTable));
   return val;
 }
 #endif // MOZ_FLEXBOX
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetFloatEdge()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(GetStyleBorder()->mFloatEdge,
                                    nsCSSProps::kFloatEdgeKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetForceBrokenImageIcon()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetNumber(GetStyleUIReset()->mForceBrokenImageIcon);
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetIMEMode()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(GetStyleUIReset()->mIMEMode,
                                    nsCSSProps::kIMEModeKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetUserFocus()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(GetStyleUserInterface()->mUserFocus,
                                    nsCSSProps::kUserFocusKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetUserInput()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(GetStyleUserInterface()->mUserInput,
                                    nsCSSProps::kUserInputKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetUserModify()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(GetStyleUserInterface()->mUserModify,
                                    nsCSSProps::kUserModifyKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetUserSelect()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(GetStyleUIReset()->mUserSelect,
                                    nsCSSProps::kUserSelectKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetDisplay()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(nsCSSProps::ValueToKeywordEnum(GetStyleDisplay()->mDisplay,
                                                nsCSSProps::kDisplayKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetPosition()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(nsCSSProps::ValueToKeywordEnum(GetStyleDisplay()->mPosition,
                                                nsCSSProps::kPositionKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetClip()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
 
   const nsStyleDisplay* display = GetStyleDisplay();
 
   if (display->mClipFlags == NS_STYLE_CLIP_AUTO) {
     val->SetIdent(eCSSKeyword_auto);
@@ -3213,105 +3225,105 @@ nsComputedDOMStyle::DoGetClip()
       leftVal->SetAppUnits(display->mClip.x);
     }
     val->SetRect(domRect);
   }
 
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetOverflow()
 {
   const nsStyleDisplay* display = GetStyleDisplay();
 
   if (display->mOverflowX != display->mOverflowY) {
     // No value to return.  We can't express this combination of
     // values as a shorthand.
     return nullptr;
   }
 
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
   val->SetIdent(nsCSSProps::ValueToKeywordEnum(display->mOverflowX,
                                                nsCSSProps::kOverflowKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetOverflowX()
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(GetStyleDisplay()->mOverflowX,
                                    nsCSSProps::kOverflowSubKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetOverflowY()
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(GetStyleDisplay()->mOverflowY,
                                    nsCSSProps::kOverflowSubKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetResize()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(nsCSSProps::ValueToKeywordEnum(GetStyleDisplay()->mResize,
                                                nsCSSProps::kResizeKTable));
   return val;
 }
 
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetPageBreakAfter()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
 
   const nsStyleDisplay *display = GetStyleDisplay();
 
   if (display->mBreakAfter) {
     val->SetIdent(eCSSKeyword_always);
   } else {
     val->SetIdent(eCSSKeyword_auto);
   }
 
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetPageBreakBefore()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
 
   const nsStyleDisplay *display = GetStyleDisplay();
 
   if (display->mBreakBefore) {
     val->SetIdent(eCSSKeyword_always);
   } else {
     val->SetIdent(eCSSKeyword_auto);
   }
 
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetPageBreakInside()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(nsCSSProps::ValueToKeywordEnum(GetStyleDisplay()->mBreakInside,
                                                nsCSSProps::kPageBreakInsideKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetHeight()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
 
   bool calcHeight = false;
 
   if (mInnerFrame) {
     calcHeight = true;
@@ -3341,17 +3353,17 @@ nsComputedDOMStyle::DoGetHeight()
 
     SetValueToCoord(val, positionData->mHeight, true, nullptr, nullptr,
                     minHeight, maxHeight);
   }
 
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetWidth()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
 
   bool calcWidth = false;
 
   if (mInnerFrame) {
     calcWidth = true;
@@ -3381,36 +3393,36 @@ nsComputedDOMStyle::DoGetWidth()
 
     SetValueToCoord(val, positionData->mWidth, true, nullptr,
                     nsCSSProps::kWidthKTable, minWidth, maxWidth);
   }
 
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetMaxHeight()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   SetValueToCoord(val, GetStylePosition()->mMaxHeight, true,
                   &nsComputedDOMStyle::GetCBContentHeight);
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetMaxWidth()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   SetValueToCoord(val, GetStylePosition()->mMaxWidth, true,
                   &nsComputedDOMStyle::GetCBContentWidth,
                   nsCSSProps::kWidthKTable);
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetMinHeight()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   nsStyleCoord minHeight = GetStylePosition()->mMinHeight;
 
   if (eStyleUnit_Auto == minHeight.GetUnit()) {
     // In non-flexbox contexts, "min-height: auto" means "min-height: 0"
     // XXXdholbert For flex items, we should set |minHeight| to the
@@ -3419,17 +3431,17 @@ nsComputedDOMStyle::DoGetMinHeight()
     minHeight.SetCoordValue(0);
   }
 
   SetValueToCoord(val, minHeight, true,
                   &nsComputedDOMStyle::GetCBContentHeight);
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetMinWidth()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
 
   nsStyleCoord minWidth = GetStylePosition()->mMinWidth;
 
   if (eStyleUnit_Auto == minWidth.GetUnit()) {
     // "min-width: auto" means "0", unless we're a flex item in a horizontal
@@ -3449,55 +3461,54 @@ nsComputedDOMStyle::DoGetMinWidth()
 #endif // MOZ_FLEXBOX
   }
   SetValueToCoord(val, minWidth, true,
                   &nsComputedDOMStyle::GetCBContentWidth,
                   nsCSSProps::kWidthKTable);
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetLeft()
 {
   return GetOffsetWidthFor(NS_SIDE_LEFT);
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetRight()
 {
   return GetOffsetWidthFor(NS_SIDE_RIGHT);
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetTop()
 {
   return GetOffsetWidthFor(NS_SIDE_TOP);
 }
 
 nsROCSSPrimitiveValue*
 nsComputedDOMStyle::GetROCSSPrimitiveValue()
 {
-  nsROCSSPrimitiveValue *primitiveValue = new nsROCSSPrimitiveValue();
+  nsROCSSPrimitiveValue *primitiveValue = new nsROCSSPrimitiveValue;
 
   NS_ASSERTION(primitiveValue != 0, "ran out of memory");
 
   return primitiveValue;
 }
 
 nsDOMCSSValueList*
 nsComputedDOMStyle::GetROCSSValueList(bool aCommaDelimited)
 {
-  nsDOMCSSValueList *valueList = new nsDOMCSSValueList(aCommaDelimited,
-                                                       true);
+  nsDOMCSSValueList *valueList = new nsDOMCSSValueList(aCommaDelimited, true);
   NS_ASSERTION(valueList != 0, "ran out of memory");
 
   return valueList;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::GetOffsetWidthFor(mozilla::css::Side aSide)
 {
   const nsStyleDisplay* display = GetStyleDisplay();
 
   AssertFlushedPendingReflows();
 
   uint8_t position = display->mPosition;
   if (!mOuterFrame) {
@@ -3516,17 +3527,17 @@ nsComputedDOMStyle::GetOffsetWidthFor(mo
     case NS_STYLE_POSITION_FIXED:
       return GetAbsoluteOffset(aSide);
     default:
       NS_ERROR("Invalid position");
       return nullptr;
   }
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::GetAbsoluteOffset(mozilla::css::Side aSide)
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
 
   nsIFrame* container = GetContainingBlockFor(mOuterFrame);
   if (container) {
     nsMargin margin = mOuterFrame->GetUsedMargin();
     nsMargin border = container->GetUsedBorder();
@@ -3581,17 +3592,17 @@ nsComputedDOMStyle::GetAbsoluteOffset(mo
   return val;
 }
 
 MOZ_STATIC_ASSERT(NS_SIDE_TOP == 0 && NS_SIDE_RIGHT == 1 &&
                   NS_SIDE_BOTTOM == 2 && NS_SIDE_LEFT == 3,
                   "box side constants not as expected for NS_OPPOSITE_SIDE");
 #define NS_OPPOSITE_SIDE(s_) mozilla::css::Side(((s_) + 2) & 3)
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::GetRelativeOffset(mozilla::css::Side aSide)
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
 
   const nsStylePosition* positionData = GetStylePosition();
   int32_t sign = 1;
   nsStyleCoord coord = positionData->mOffset.Get(aSide);
 
@@ -3611,26 +3622,26 @@ nsComputedDOMStyle::GetRelativeOffset(mo
   } else {
     baseGetter = &nsComputedDOMStyle::GetCBContentHeight;
   }
 
   val->SetAppUnits(sign * StyleCoordToNSCoord(coord, baseGetter, 0, false));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::GetStaticOffset(mozilla::css::Side aSide)
 
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   SetValueToCoord(val, GetStylePosition()->mOffset.Get(aSide), false);
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::GetPaddingWidthFor(mozilla::css::Side aSide)
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
 
   if (!mInnerFrame) {
     SetValueToCoord(val, GetStylePadding()->mPadding.Get(aSide), true);
   } else {
     AssertFlushedPendingReflows();
@@ -3671,17 +3682,17 @@ nsComputedDOMStyle::GetLineHeightCoord(n
   if (font->mFont.size != font->mSize) {
     fCoord = fCoord * (float(font->mSize) / float(font->mFont.size));
   }
   aCoord = NSToCoordRound(fCoord);
 
   return true;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::GetBorderColorsFor(mozilla::css::Side aSide)
 {
   const nsStyleBorder *border = GetStyleBorder();
 
   if (border->mBorderColors) {
     nsBorderColors* borderColors = border->mBorderColors[aSide];
     if (borderColors) {
       nsDOMCSSValueList *valueList = GetROCSSValueList(false);
@@ -3699,50 +3710,50 @@ nsComputedDOMStyle::GetBorderColorsFor(m
     }
   }
 
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(eCSSKeyword_none);
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::GetBorderWidthFor(mozilla::css::Side aSide)
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
 
   nscoord width;
   if (mInnerFrame) {
     AssertFlushedPendingReflows();
     width = mInnerFrame->GetUsedBorder().Side(aSide);
   } else {
     width = GetStyleBorder()->GetComputedBorderWidth(aSide);
   }
   val->SetAppUnits(width);
 
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::GetBorderColorFor(mozilla::css::Side aSide)
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
 
   nscolor color;
   bool foreground;
   GetStyleBorder()->GetBorderColor(aSide, color, foreground);
   if (foreground) {
     color = GetStyleColor()->mColor;
   }
 
   SetToRGBAColor(val, color);
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::GetMarginWidthFor(mozilla::css::Side aSide)
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
 
   if (!mInnerFrame) {
     SetValueToCoord(val, GetStyleMargin()->mMargin.Get(aSide), false);
   } else {
     AssertFlushedPendingReflows();
@@ -3753,17 +3764,17 @@ nsComputedDOMStyle::GetMarginWidthFor(mo
     NS_ASSERTION(mOuterFrame == mInnerFrame ||
                  mInnerFrame->GetUsedMargin() == nsMargin(0, 0, 0, 0),
                  "Inner tables must have zero margins");
   }
 
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::GetBorderStyleFor(mozilla::css::Side aSide)
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(GetStyleBorder()->GetBorderStyle(aSide),
                                    nsCSSProps::kBorderStyleKTable));
   return val;
 }
@@ -3971,17 +3982,17 @@ nsComputedDOMStyle::GetFrameBoundsHeight
   }
 
   AssertFlushedPendingReflows();
 
   aHeight = nsDisplayTransform::GetFrameBoundsForTransform(mInnerFrame).height;
   return true;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::GetSVGPaintFor(bool aFill)
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
 
   const nsStyleSVG* svg = GetStyleSVG();
   const nsStyleSVGPaint* paint = nullptr;
 
   if (aFill)
@@ -4024,74 +4035,74 @@ nsComputedDOMStyle::GetSVGPaintFor(bool 
       val->SetIdent(eCSSKeyword__moz_objectstroke);
       break;
     }
   }
 
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetFill()
 {
   return GetSVGPaintFor(true);
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetStroke()
 {
   return GetSVGPaintFor(false);
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetMarkerEnd()
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
 
   const nsStyleSVG* svg = GetStyleSVG();
 
   if (svg->mMarkerEnd)
     val->SetURI(svg->mMarkerEnd);
   else
     val->SetIdent(eCSSKeyword_none);
 
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetMarkerMid()
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
 
   const nsStyleSVG* svg = GetStyleSVG();
 
   if (svg->mMarkerMid)
     val->SetURI(svg->mMarkerMid);
   else
     val->SetIdent(eCSSKeyword_none);
 
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetMarkerStart()
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
 
   const nsStyleSVG* svg = GetStyleSVG();
 
   if (svg->mMarkerStart)
     val->SetURI(svg->mMarkerStart);
   else
     val->SetIdent(eCSSKeyword_none);
 
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetStrokeDasharray()
 {
   const nsStyleSVG* svg = GetStyleSVG();
 
   if (!svg->mStrokeDasharrayLength || !svg->mStrokeDasharray) {
     nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
     val->SetIdent(eCSSKeyword_none);
     return val;
@@ -4104,259 +4115,259 @@ nsComputedDOMStyle::DoGetStrokeDasharray
     valueList->AppendCSSValue(dash);
 
     SetValueToCoord(dash, svg->mStrokeDasharray[i], true);
   }
 
   return valueList;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetStrokeDashoffset()
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
   SetValueToCoord(val, GetStyleSVG()->mStrokeDashoffset, false);
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetStrokeWidth()
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
   SetValueToCoord(val, GetStyleSVG()->mStrokeWidth, true);
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetVectorEffect()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(nsCSSProps::ValueToKeywordEnum(GetStyleSVGReset()->mVectorEffect,
                                                nsCSSProps::kVectorEffectKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetFillOpacity()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetNumber(GetStyleSVG()->mFillOpacity);
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetFloodOpacity()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetNumber(GetStyleSVGReset()->mFloodOpacity);
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetStopOpacity()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetNumber(GetStyleSVGReset()->mStopOpacity);
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetStrokeMiterlimit()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetNumber(GetStyleSVG()->mStrokeMiterlimit);
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetStrokeOpacity()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetNumber(GetStyleSVG()->mStrokeOpacity);
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetClipRule()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(nsCSSProps::ValueToKeywordEnum(
                   GetStyleSVG()->mClipRule, nsCSSProps::kFillRuleKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetFillRule()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(nsCSSProps::ValueToKeywordEnum(
                   GetStyleSVG()->mFillRule, nsCSSProps::kFillRuleKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetStrokeLinecap()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(GetStyleSVG()->mStrokeLinecap,
                                    nsCSSProps::kStrokeLinecapKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetStrokeLinejoin()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(GetStyleSVG()->mStrokeLinejoin,
                                    nsCSSProps::kStrokeLinejoinKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetTextAnchor()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(GetStyleSVG()->mTextAnchor,
                                    nsCSSProps::kTextAnchorKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetColorInterpolation()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(GetStyleSVG()->mColorInterpolation,
                                    nsCSSProps::kColorInterpolationKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetColorInterpolationFilters()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(GetStyleSVG()->mColorInterpolationFilters,
                                    nsCSSProps::kColorInterpolationKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetDominantBaseline()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(GetStyleSVGReset()->mDominantBaseline,
                                    nsCSSProps::kDominantBaselineKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetImageRendering()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(GetStyleSVG()->mImageRendering,
                                    nsCSSProps::kImageRenderingKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetShapeRendering()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(GetStyleSVG()->mShapeRendering,
                                    nsCSSProps::kShapeRenderingKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetTextRendering()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(GetStyleSVG()->mTextRendering,
                                    nsCSSProps::kTextRenderingKTable));
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetFloodColor()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   SetToRGBAColor(val, GetStyleSVGReset()->mFloodColor);
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetLightingColor()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   SetToRGBAColor(val, GetStyleSVGReset()->mLightingColor);
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetStopColor()
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   SetToRGBAColor(val, GetStyleSVGReset()->mStopColor);
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetClipPath()
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
 
   const nsStyleSVGReset* svg = GetStyleSVGReset();
 
   if (svg->mClipPath)
     val->SetURI(svg->mClipPath);
   else
     val->SetIdent(eCSSKeyword_none);
 
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetFilter()
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
 
   const nsStyleSVGReset* svg = GetStyleSVGReset();
 
   if (svg->mFilter)
     val->SetURI(svg->mFilter);
   else
     val->SetIdent(eCSSKeyword_none);
 
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetMask()
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
 
   const nsStyleSVGReset* svg = GetStyleSVGReset();
 
   if (svg->mMask)
     val->SetURI(svg->mMask);
   else
     val->SetIdent(eCSSKeyword_none);
 
   return val;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetTransitionDelay()
 {
   const nsStyleDisplay* display = GetStyleDisplay();
 
   nsDOMCSSValueList *valueList = GetROCSSValueList(true);
 
   NS_ABORT_IF_FALSE(display->mTransitionDelayCount > 0,
                     "first item must be explicit");
@@ -4366,17 +4377,17 @@ nsComputedDOMStyle::DoGetTransitionDelay
     nsROCSSPrimitiveValue* delay = GetROCSSPrimitiveValue();
     valueList->AppendCSSValue(delay);
     delay->SetTime((float)transition->GetDelay() / (float)PR_MSEC_PER_SEC);
   } while (++i < display->mTransitionDelayCount);
 
   return valueList;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetTransitionDuration()
 {
   const nsStyleDisplay* display = GetStyleDisplay();
 
   nsDOMCSSValueList *valueList = GetROCSSValueList(true);
 
   NS_ABORT_IF_FALSE(display->mTransitionDurationCount > 0,
                     "first item must be explicit");
@@ -4387,17 +4398,17 @@ nsComputedDOMStyle::DoGetTransitionDurat
     valueList->AppendCSSValue(duration);
 
     duration->SetTime((float)transition->GetDuration() / (float)PR_MSEC_PER_SEC);
   } while (++i < display->mTransitionDurationCount);
 
   return valueList;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetTransitionProperty()
 {
   const nsStyleDisplay* display = GetStyleDisplay();
 
   nsDOMCSSValueList *valueList = GetROCSSValueList(true);
 
   NS_ABORT_IF_FALSE(display->mTransitionPropertyCount > 0,
                     "first item must be explicit");
@@ -4453,17 +4464,17 @@ nsComputedDOMStyle::AppendTimingFunction
       tmp.AppendLiteral(", start)");
     } else {
       tmp.AppendLiteral(", end)");
     }
   }
   timingFunction->SetString(tmp);
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetTransitionTimingFunction()
 {
   const nsStyleDisplay* display = GetStyleDisplay();
 
   nsDOMCSSValueList *valueList = GetROCSSValueList(true);
 
   NS_ABORT_IF_FALSE(display->mTransitionTimingFunctionCount > 0,
                     "first item must be explicit");
@@ -4471,17 +4482,17 @@ nsComputedDOMStyle::DoGetTransitionTimin
   do {
     AppendTimingFunction(valueList,
                          display->mTransitions[i].GetTimingFunction());
   } while (++i < display->mTransitionTimingFunctionCount);
 
   return valueList;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetAnimationName()
 {
   const nsStyleDisplay* display = GetStyleDisplay();
 
   nsDOMCSSValueList *valueList = GetROCSSValueList(true);
 
   NS_ABORT_IF_FALSE(display->mAnimationNameCount > 0,
                     "first item must be explicit");
@@ -4499,17 +4510,17 @@ nsComputedDOMStyle::DoGetAnimationName()
       nsStyleUtil::AppendEscapedCSSIdent(animation->GetName(), escaped);
       property->SetString(escaped); // really want SetIdent
     }
   } while (++i < display->mAnimationNameCount);
 
   return valueList;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetAnimationDelay()
 {
   const nsStyleDisplay* display = GetStyleDisplay();
 
   nsDOMCSSValueList *valueList = GetROCSSValueList(true);
 
   NS_ABORT_IF_FALSE(display->mAnimationDelayCount > 0,
                     "first item must be explicit");
@@ -4519,17 +4530,17 @@ nsComputedDOMStyle::DoGetAnimationDelay(
     nsROCSSPrimitiveValue* delay = GetROCSSPrimitiveValue();
     valueList->AppendCSSValue(delay);
     delay->SetTime((float)animation->GetDelay() / (float)PR_MSEC_PER_SEC);
   } while (++i < display->mAnimationDelayCount);
 
   return valueList;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetAnimationDuration()
 {
   const nsStyleDisplay* display = GetStyleDisplay();
 
   nsDOMCSSValueList *valueList = GetROCSSValueList(true);
 
   NS_ABORT_IF_FALSE(display->mAnimationDurationCount > 0,
                     "first item must be explicit");
@@ -4540,17 +4551,17 @@ nsComputedDOMStyle::DoGetAnimationDurati
     valueList->AppendCSSValue(duration);
 
     duration->SetTime((float)animation->GetDuration() / (float)PR_MSEC_PER_SEC);
   } while (++i < display->mAnimationDurationCount);
 
   return valueList;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetAnimationTimingFunction()
 {
   const nsStyleDisplay* display = GetStyleDisplay();
 
   nsDOMCSSValueList *valueList = GetROCSSValueList(true);
 
   NS_ABORT_IF_FALSE(display->mAnimationTimingFunctionCount > 0,
                     "first item must be explicit");
@@ -4558,17 +4569,17 @@ nsComputedDOMStyle::DoGetAnimationTiming
   do {
     AppendTimingFunction(valueList,
                          display->mAnimations[i].GetTimingFunction());
   } while (++i < display->mAnimationTimingFunctionCount);
 
   return valueList;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetAnimationDirection()
 {
   const nsStyleDisplay* display = GetStyleDisplay();
 
   nsDOMCSSValueList *valueList = GetROCSSValueList(true);
 
   NS_ABORT_IF_FALSE(display->mAnimationDirectionCount > 0,
                     "first item must be explicit");
@@ -4580,17 +4591,17 @@ nsComputedDOMStyle::DoGetAnimationDirect
     direction->SetIdent(
       nsCSSProps::ValueToKeywordEnum(animation->GetDirection(),
                                      nsCSSProps::kAnimationDirectionKTable));
   } while (++i < display->mAnimationDirectionCount);
 
   return valueList;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetAnimationFillMode()
 {
   const nsStyleDisplay* display = GetStyleDisplay();
 
   nsDOMCSSValueList *valueList = GetROCSSValueList(true);
 
   NS_ABORT_IF_FALSE(display->mAnimationFillModeCount > 0,
                     "first item must be explicit");
@@ -4602,17 +4613,17 @@ nsComputedDOMStyle::DoGetAnimationFillMo
     fillMode->SetIdent(
       nsCSSProps::ValueToKeywordEnum(animation->GetFillMode(),
                                      nsCSSProps::kAnimationFillModeKTable));
   } while (++i < display->mAnimationFillModeCount);
 
   return valueList;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetAnimationIterationCount()
 {
   const nsStyleDisplay* display = GetStyleDisplay();
 
   nsDOMCSSValueList *valueList = GetROCSSValueList(true);
 
   NS_ABORT_IF_FALSE(display->mAnimationIterationCountCount > 0,
                     "first item must be explicit");
@@ -4636,17 +4647,17 @@ nsComputedDOMStyle::DoGetAnimationIterat
     } else {
       iterationCount->SetNumber(f);
     }
   } while (++i < display->mAnimationIterationCountCount);
 
   return valueList;
 }
 
-nsIDOMCSSValue*
+CSSValue*
 nsComputedDOMStyle::DoGetAnimationPlayState()
 {
   const nsStyleDisplay* display = GetStyleDisplay();
 
   nsDOMCSSValueList *valueList = GetROCSSValueList(true);
 
   NS_ABORT_IF_FALSE(display->mAnimationPlayStateCount > 0,
                     "first item must be explicit");
--- a/layout/style/nsComputedDOMStyle.h
+++ b/layout/style/nsComputedDOMStyle.h
@@ -6,41 +6,45 @@
 /* DOM object returned from element.getComputedStyle() */
 
 #ifndef nsComputedDOMStyle_h__
 #define nsComputedDOMStyle_h__
 
 #include "mozilla/Attributes.h"
 #include "nsDOMCSSDeclaration.h"
 
-#include "nsROCSSPrimitiveValue.h"
 #include "nsDOMCSSRGBColor.h"
-#include "nsDOMCSSValueList.h"
 #include "nsCSSProps.h"
 
 #include "nsIContent.h"
 #include "nsCOMPtr.h"
 #include "nsWeakReference.h"
 #include "nsAutoPtr.h"
 #include "nsStyleStruct.h"
 #include "nsStyleContext.h"
 
 class nsIFrame;
 class nsIPresShell;
+class nsDOMCSSValueList;
+class nsROCSSPrimitiveValue;
 
 class nsComputedDOMStyle MOZ_FINAL : public nsDOMCSSDeclaration
 {
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsComputedDOMStyle,
                                                                    nsICSSDeclaration)
 
   NS_DECL_NSICSSDECLARATION
 
-  NS_DECL_NSIDOMCSSSTYLEDECLARATION
+  NS_DECL_NSIDOMCSSSTYLEDECLARATION_HELPER
+  virtual already_AddRefed<mozilla::dom::CSSValue>
+  GetPropertyCSSValue(const nsAString& aProp, mozilla::ErrorResult& aRv)
+    MOZ_OVERRIDE;
+  using nsIDOMCSSStyleDeclaration::GetPropertyCSSValue;
   virtual void IndexedGetter(uint32_t aIndex, bool& aFound, nsAString& aPropName);
 
   enum StyleType {
     eDefaultOnly, // Only includes UA and user sheets
     eAll // Includes all stylesheets
   };
 
   nsComputedDOMStyle(mozilla::dom::Element* aElement,
@@ -96,332 +100,332 @@ private:
   }
 #include "nsStyleStructList.h"
 #undef STYLE_STRUCT
 
   // All of the property getters below return a pointer to a refcounted object
   // that has just been created, but the refcount is still 0. Caller must take
   // ownership.
 
-  nsIDOMCSSValue* GetEllipseRadii(const nsStyleCorners& aRadius,
-                                  uint8_t aFullCorner,
-                                  bool aIsBorder); // else outline
+  mozilla::dom::CSSValue* GetEllipseRadii(const nsStyleCorners& aRadius,
+                                          uint8_t aFullCorner,
+                                          bool aIsBorder); // else outline
 
-  nsIDOMCSSValue* GetOffsetWidthFor(mozilla::css::Side aSide);
+  mozilla::dom::CSSValue* GetOffsetWidthFor(mozilla::css::Side aSide);
 
-  nsIDOMCSSValue* GetAbsoluteOffset(mozilla::css::Side aSide);
+  mozilla::dom::CSSValue* GetAbsoluteOffset(mozilla::css::Side aSide);
 
-  nsIDOMCSSValue* GetRelativeOffset(mozilla::css::Side aSide);
+  mozilla::dom::CSSValue* GetRelativeOffset(mozilla::css::Side aSide);
 
-  nsIDOMCSSValue* GetStaticOffset(mozilla::css::Side aSide);
+  mozilla::dom::CSSValue* GetStaticOffset(mozilla::css::Side aSide);
 
-  nsIDOMCSSValue* GetPaddingWidthFor(mozilla::css::Side aSide);
+  mozilla::dom::CSSValue* GetPaddingWidthFor(mozilla::css::Side aSide);
 
-  nsIDOMCSSValue* GetBorderColorsFor(mozilla::css::Side aSide);
+  mozilla::dom::CSSValue* GetBorderColorsFor(mozilla::css::Side aSide);
 
-  nsIDOMCSSValue* GetBorderStyleFor(mozilla::css::Side aSide);
+  mozilla::dom::CSSValue* GetBorderStyleFor(mozilla::css::Side aSide);
 
-  nsIDOMCSSValue* GetBorderWidthFor(mozilla::css::Side aSide);
+  mozilla::dom::CSSValue* GetBorderWidthFor(mozilla::css::Side aSide);
 
-  nsIDOMCSSValue* GetBorderColorFor(mozilla::css::Side aSide);
+  mozilla::dom::CSSValue* GetBorderColorFor(mozilla::css::Side aSide);
 
-  nsIDOMCSSValue* GetMarginWidthFor(mozilla::css::Side aSide);
+  mozilla::dom::CSSValue* GetMarginWidthFor(mozilla::css::Side aSide);
 
-  nsIDOMCSSValue* GetSVGPaintFor(bool aFill);
+  mozilla::dom::CSSValue* GetSVGPaintFor(bool aFill);
 
   bool GetLineHeightCoord(nscoord& aCoord);
 
-  nsIDOMCSSValue* GetCSSShadowArray(nsCSSShadowArray* aArray,
-                                    const nscolor& aDefaultColor,
-                                    bool aIsBoxShadow);
+  mozilla::dom::CSSValue* GetCSSShadowArray(nsCSSShadowArray* aArray,
+                                            const nscolor& aDefaultColor,
+                                            bool aIsBoxShadow);
 
-  nsIDOMCSSValue* GetBackgroundList(uint8_t nsStyleBackground::Layer::* aMember,
-                                    uint32_t nsStyleBackground::* aCount,
-                                    const int32_t aTable[]);
+  mozilla::dom::CSSValue* GetBackgroundList(uint8_t nsStyleBackground::Layer::* aMember,
+                                            uint32_t nsStyleBackground::* aCount,
+                                            const int32_t aTable[]);
 
   void GetCSSGradientString(const nsStyleGradient* aGradient,
                             nsAString& aString);
   void GetImageRectString(nsIURI* aURI,
                           const nsStyleSides& aCropRect,
                           nsString& aString);
   void AppendTimingFunction(nsDOMCSSValueList *aValueList,
                             const nsTimingFunction& aTimingFunction);
 
   /* Properties queryable as CSSValues.
    * To avoid a name conflict with nsIDOM*CSS2Properties, these are all
    * DoGetXXX instead of GetXXX.
    */
 
-  nsIDOMCSSValue* DoGetAppearance();
+  mozilla::dom::CSSValue* DoGetAppearance();
 
   /* Box properties */
-  nsIDOMCSSValue* DoGetBoxAlign();
-  nsIDOMCSSValue* DoGetBoxDirection();
-  nsIDOMCSSValue* DoGetBoxFlex();
-  nsIDOMCSSValue* DoGetBoxOrdinalGroup();
-  nsIDOMCSSValue* DoGetBoxOrient();
-  nsIDOMCSSValue* DoGetBoxPack();
-  nsIDOMCSSValue* DoGetBoxSizing();
+  mozilla::dom::CSSValue* DoGetBoxAlign();
+  mozilla::dom::CSSValue* DoGetBoxDirection();
+  mozilla::dom::CSSValue* DoGetBoxFlex();
+  mozilla::dom::CSSValue* DoGetBoxOrdinalGroup();
+  mozilla::dom::CSSValue* DoGetBoxOrient();
+  mozilla::dom::CSSValue* DoGetBoxPack();
+  mozilla::dom::CSSValue* DoGetBoxSizing();
 
-  nsIDOMCSSValue* DoGetWidth();
-  nsIDOMCSSValue* DoGetHeight();
-  nsIDOMCSSValue* DoGetMaxHeight();
-  nsIDOMCSSValue* DoGetMaxWidth();
-  nsIDOMCSSValue* DoGetMinHeight();
-  nsIDOMCSSValue* DoGetMinWidth();
-  nsIDOMCSSValue* DoGetLeft();
-  nsIDOMCSSValue* DoGetTop();
-  nsIDOMCSSValue* DoGetRight();
-  nsIDOMCSSValue* DoGetBottom();
-  nsIDOMCSSValue* DoGetStackSizing();
+  mozilla::dom::CSSValue* DoGetWidth();
+  mozilla::dom::CSSValue* DoGetHeight();
+  mozilla::dom::CSSValue* DoGetMaxHeight();
+  mozilla::dom::CSSValue* DoGetMaxWidth();
+  mozilla::dom::CSSValue* DoGetMinHeight();
+  mozilla::dom::CSSValue* DoGetMinWidth();
+  mozilla::dom::CSSValue* DoGetLeft();
+  mozilla::dom::CSSValue* DoGetTop();
+  mozilla::dom::CSSValue* DoGetRight();
+  mozilla::dom::CSSValue* DoGetBottom();
+  mozilla::dom::CSSValue* DoGetStackSizing();
 
   /* Font properties */
-  nsIDOMCSSValue* DoGetColor();
-  nsIDOMCSSValue* DoGetFontFamily();
-  nsIDOMCSSValue* DoGetFontFeatureSettings();
-  nsIDOMCSSValue* DoGetFontLanguageOverride();
-  nsIDOMCSSValue* DoGetFontSize();
-  nsIDOMCSSValue* DoGetFontSizeAdjust();
-  nsIDOMCSSValue* DoGetFontStretch();
-  nsIDOMCSSValue* DoGetFontStyle();
-  nsIDOMCSSValue* DoGetFontWeight();
-  nsIDOMCSSValue* DoGetFontVariant();
+  mozilla::dom::CSSValue* DoGetColor();
+  mozilla::dom::CSSValue* DoGetFontFamily();
+  mozilla::dom::CSSValue* DoGetFontFeatureSettings();
+  mozilla::dom::CSSValue* DoGetFontLanguageOverride();
+  mozilla::dom::CSSValue* DoGetFontSize();
+  mozilla::dom::CSSValue* DoGetFontSizeAdjust();
+  mozilla::dom::CSSValue* DoGetFontStretch();
+  mozilla::dom::CSSValue* DoGetFontStyle();
+  mozilla::dom::CSSValue* DoGetFontWeight();
+  mozilla::dom::CSSValue* DoGetFontVariant();
 
   /* Background properties */
-  nsIDOMCSSValue* DoGetBackgroundAttachment();
-  nsIDOMCSSValue* DoGetBackgroundColor();
-  nsIDOMCSSValue* DoGetBackgroundImage();
-  nsIDOMCSSValue* DoGetBackgroundPosition();
-  nsIDOMCSSValue* DoGetBackgroundRepeat();
-  nsIDOMCSSValue* DoGetBackgroundClip();
-  nsIDOMCSSValue* DoGetBackgroundInlinePolicy();
-  nsIDOMCSSValue* DoGetBackgroundOrigin();
-  nsIDOMCSSValue* DoGetBackgroundSize();
+  mozilla::dom::CSSValue* DoGetBackgroundAttachment();
+  mozilla::dom::CSSValue* DoGetBackgroundColor();
+  mozilla::dom::CSSValue* DoGetBackgroundImage();
+  mozilla::dom::CSSValue* DoGetBackgroundPosition();
+  mozilla::dom::CSSValue* DoGetBackgroundRepeat();
+  mozilla::dom::CSSValue* DoGetBackgroundClip();
+  mozilla::dom::CSSValue* DoGetBackgroundInlinePolicy();
+  mozilla::dom::CSSValue* DoGetBackgroundOrigin();
+  mozilla::dom::CSSValue* DoGetBackgroundSize();
 
   /* Padding properties */
-  nsIDOMCSSValue* DoGetPaddingTop();
-  nsIDOMCSSValue* DoGetPaddingBottom();
-  nsIDOMCSSValue* DoGetPaddingLeft();
-  nsIDOMCSSValue* DoGetPaddingRight();
+  mozilla::dom::CSSValue* DoGetPaddingTop();
+  mozilla::dom::CSSValue* DoGetPaddingBottom();
+  mozilla::dom::CSSValue* DoGetPaddingLeft();
+  mozilla::dom::CSSValue* DoGetPaddingRight();
 
   /* Table Properties */
-  nsIDOMCSSValue* DoGetBorderCollapse();
-  nsIDOMCSSValue* DoGetBorderSpacing();
-  nsIDOMCSSValue* DoGetCaptionSide();
-  nsIDOMCSSValue* DoGetEmptyCells();
-  nsIDOMCSSValue* DoGetTableLayout();
-  nsIDOMCSSValue* DoGetVerticalAlign();
+  mozilla::dom::CSSValue* DoGetBorderCollapse();
+  mozilla::dom::CSSValue* DoGetBorderSpacing();
+  mozilla::dom::CSSValue* DoGetCaptionSide();
+  mozilla::dom::CSSValue* DoGetEmptyCells();
+  mozilla::dom::CSSValue* DoGetTableLayout();
+  mozilla::dom::CSSValue* DoGetVerticalAlign();
 
   /* Border Properties */
-  nsIDOMCSSValue* DoGetBorderTopStyle();
-  nsIDOMCSSValue* DoGetBorderBottomStyle();
-  nsIDOMCSSValue* DoGetBorderLeftStyle();
-  nsIDOMCSSValue* DoGetBorderRightStyle();
-  nsIDOMCSSValue* DoGetBorderTopWidth();
-  nsIDOMCSSValue* DoGetBorderBottomWidth();
-  nsIDOMCSSValue* DoGetBorderLeftWidth();
-  nsIDOMCSSValue* DoGetBorderRightWidth();
-  nsIDOMCSSValue* DoGetBorderTopColor();
-  nsIDOMCSSValue* DoGetBorderBottomColor();
-  nsIDOMCSSValue* DoGetBorderLeftColor();
-  nsIDOMCSSValue* DoGetBorderRightColor();
-  nsIDOMCSSValue* DoGetBorderBottomColors();
-  nsIDOMCSSValue* DoGetBorderLeftColors();
-  nsIDOMCSSValue* DoGetBorderRightColors();
-  nsIDOMCSSValue* DoGetBorderTopColors();
-  nsIDOMCSSValue* DoGetBorderBottomLeftRadius();
-  nsIDOMCSSValue* DoGetBorderBottomRightRadius();
-  nsIDOMCSSValue* DoGetBorderTopLeftRadius();
-  nsIDOMCSSValue* DoGetBorderTopRightRadius();
-  nsIDOMCSSValue* DoGetFloatEdge();
+  mozilla::dom::CSSValue* DoGetBorderTopStyle();
+  mozilla::dom::CSSValue* DoGetBorderBottomStyle();
+  mozilla::dom::CSSValue* DoGetBorderLeftStyle();
+  mozilla::dom::CSSValue* DoGetBorderRightStyle();
+  mozilla::dom::CSSValue* DoGetBorderTopWidth();
+  mozilla::dom::CSSValue* DoGetBorderBottomWidth();
+  mozilla::dom::CSSValue* DoGetBorderLeftWidth();
+  mozilla::dom::CSSValue* DoGetBorderRightWidth();
+  mozilla::dom::CSSValue* DoGetBorderTopColor();
+  mozilla::dom::CSSValue* DoGetBorderBottomColor();
+  mozilla::dom::CSSValue* DoGetBorderLeftColor();
+  mozilla::dom::CSSValue* DoGetBorderRightColor();
+  mozilla::dom::CSSValue* DoGetBorderBottomColors();
+  mozilla::dom::CSSValue* DoGetBorderLeftColors();
+  mozilla::dom::CSSValue* DoGetBorderRightColors();
+  mozilla::dom::CSSValue* DoGetBorderTopColors();
+  mozilla::dom::CSSValue* DoGetBorderBottomLeftRadius();
+  mozilla::dom::CSSValue* DoGetBorderBottomRightRadius();
+  mozilla::dom::CSSValue* DoGetBorderTopLeftRadius();
+  mozilla::dom::CSSValue* DoGetBorderTopRightRadius();
+  mozilla::dom::CSSValue* DoGetFloatEdge();
 
   /* Border Image */
-  nsIDOMCSSValue* DoGetBorderImageSource();
-  nsIDOMCSSValue* DoGetBorderImageSlice();
-  nsIDOMCSSValue* DoGetBorderImageWidth();
-  nsIDOMCSSValue* DoGetBorderImageOutset();
-  nsIDOMCSSValue* DoGetBorderImageRepeat();
+  mozilla::dom::CSSValue* DoGetBorderImageSource();
+  mozilla::dom::CSSValue* DoGetBorderImageSlice();
+  mozilla::dom::CSSValue* DoGetBorderImageWidth();
+  mozilla::dom::CSSValue* DoGetBorderImageOutset();
+  mozilla::dom::CSSValue* DoGetBorderImageRepeat();
 
   /* Box Shadow */
-  nsIDOMCSSValue* DoGetBoxShadow();
+  mozilla::dom::CSSValue* DoGetBoxShadow();
 
   /* Window Shadow */
-  nsIDOMCSSValue* DoGetWindowShadow();
+  mozilla::dom::CSSValue* DoGetWindowShadow();
 
   /* Margin Properties */
-  nsIDOMCSSValue* DoGetMarginTopWidth();
-  nsIDOMCSSValue* DoGetMarginBottomWidth();
-  nsIDOMCSSValue* DoGetMarginLeftWidth();
-  nsIDOMCSSValue* DoGetMarginRightWidth();
+  mozilla::dom::CSSValue* DoGetMarginTopWidth();
+  mozilla::dom::CSSValue* DoGetMarginBottomWidth();
+  mozilla::dom::CSSValue* DoGetMarginLeftWidth();
+  mozilla::dom::CSSValue* DoGetMarginRightWidth();
 
   /* Outline Properties */
-  nsIDOMCSSValue* DoGetOutlineWidth();
-  nsIDOMCSSValue* DoGetOutlineStyle();
-  nsIDOMCSSValue* DoGetOutlineColor();
-  nsIDOMCSSValue* DoGetOutlineOffset();
-  nsIDOMCSSValue* DoGetOutlineRadiusBottomLeft();
-  nsIDOMCSSValue* DoGetOutlineRadiusBottomRight();
-  nsIDOMCSSValue* DoGetOutlineRadiusTopLeft();
-  nsIDOMCSSValue* DoGetOutlineRadiusTopRight();
+  mozilla::dom::CSSValue* DoGetOutlineWidth();
+  mozilla::dom::CSSValue* DoGetOutlineStyle();
+  mozilla::dom::CSSValue* DoGetOutlineColor();
+  mozilla::dom::CSSValue* DoGetOutlineOffset();
+  mozilla::dom::CSSValue* DoGetOutlineRadiusBottomLeft();
+  mozilla::dom::CSSValue* DoGetOutlineRadiusBottomRight();
+  mozilla::dom::CSSValue* DoGetOutlineRadiusTopLeft();
+  mozilla::dom::CSSValue* DoGetOutlineRadiusTopRight();
 
   /* Content Properties */
-  nsIDOMCSSValue* DoGetContent();
-  nsIDOMCSSValue* DoGetCounterIncrement();
-  nsIDOMCSSValue* DoGetCounterReset();
-  nsIDOMCSSValue* DoGetMarkerOffset();
+  mozilla::dom::CSSValue* DoGetContent();
+  mozilla::dom::CSSValue* DoGetCounterIncrement();
+  mozilla::dom::CSSValue* DoGetCounterReset();
+  mozilla::dom::CSSValue* DoGetMarkerOffset();
 
   /* Quotes Properties */
-  nsIDOMCSSValue* DoGetQuotes();
+  mozilla::dom::CSSValue* DoGetQuotes();
 
   /* z-index */
-  nsIDOMCSSValue* DoGetZIndex();
+  mozilla::dom::CSSValue* DoGetZIndex();
 
   /* List properties */
-  nsIDOMCSSValue* DoGetListStyleImage();
-  nsIDOMCSSValue* DoGetListStylePosition();
-  nsIDOMCSSValue* DoGetListStyleType();
-  nsIDOMCSSValue* DoGetImageRegion();
+  mozilla::dom::CSSValue* DoGetListStyleImage();
+  mozilla::dom::CSSValue* DoGetListStylePosition();
+  mozilla::dom::CSSValue* DoGetListStyleType();
+  mozilla::dom::CSSValue* DoGetImageRegion();
 
   /* Text Properties */
-  nsIDOMCSSValue* DoGetLineHeight();
-  nsIDOMCSSValue* DoGetTextAlign();
-  nsIDOMCSSValue* DoGetTextAlignLast();
-  nsIDOMCSSValue* DoGetMozTextBlink();
-  nsIDOMCSSValue* DoGetTextDecoration();
-  nsIDOMCSSValue* DoGetTextDecorationColor();
-  nsIDOMCSSValue* DoGetTextDecorationLine();
-  nsIDOMCSSValue* DoGetTextDecorationStyle();
-  nsIDOMCSSValue* DoGetTextIndent();
-  nsIDOMCSSValue* DoGetTextOverflow();
-  nsIDOMCSSValue* DoGetTextTransform();
-  nsIDOMCSSValue* DoGetTextShadow();
-  nsIDOMCSSValue* DoGetLetterSpacing();
-  nsIDOMCSSValue* DoGetWordSpacing();
-  nsIDOMCSSValue* DoGetWhiteSpace();
-  nsIDOMCSSValue* DoGetWordBreak();
-  nsIDOMCSSValue* DoGetWordWrap();
-  nsIDOMCSSValue* DoGetHyphens();
-  nsIDOMCSSValue* DoGetTabSize();
-  nsIDOMCSSValue* DoGetTextSizeAdjust();
+  mozilla::dom::CSSValue* DoGetLineHeight();
+  mozilla::dom::CSSValue* DoGetTextAlign();
+  mozilla::dom::CSSValue* DoGetTextAlignLast();
+  mozilla::dom::CSSValue* DoGetMozTextBlink();
+  mozilla::dom::CSSValue* DoGetTextDecoration();
+  mozilla::dom::CSSValue* DoGetTextDecorationColor();
+  mozilla::dom::CSSValue* DoGetTextDecorationLine();
+  mozilla::dom::CSSValue* DoGetTextDecorationStyle();
+  mozilla::dom::CSSValue* DoGetTextIndent();
+  mozilla::dom::CSSValue* DoGetTextOverflow();
+  mozilla::dom::CSSValue* DoGetTextTransform();
+  mozilla::dom::CSSValue* DoGetTextShadow();
+  mozilla::dom::CSSValue* DoGetLetterSpacing();
+  mozilla::dom::CSSValue* DoGetWordSpacing();
+  mozilla::dom::CSSValue* DoGetWhiteSpace();
+  mozilla::dom::CSSValue* DoGetWordBreak();
+  mozilla::dom::CSSValue* DoGetWordWrap();
+  mozilla::dom::CSSValue* DoGetHyphens();
+  mozilla::dom::CSSValue* DoGetTabSize();
+  mozilla::dom::CSSValue* DoGetTextSizeAdjust();
 
   /* Visibility properties */
-  nsIDOMCSSValue* DoGetOpacity();
-  nsIDOMCSSValue* DoGetPointerEvents();
-  nsIDOMCSSValue* DoGetVisibility();
+  mozilla::dom::CSSValue* DoGetOpacity();
+  mozilla::dom::CSSValue* DoGetPointerEvents();
+  mozilla::dom::CSSValue* DoGetVisibility();
 
   /* Direction properties */
-  nsIDOMCSSValue* DoGetDirection();
-  nsIDOMCSSValue* DoGetUnicodeBidi();
+  mozilla::dom::CSSValue* DoGetDirection();
+  mozilla::dom::CSSValue* DoGetUnicodeBidi();
 
   /* Display properties */
-  nsIDOMCSSValue* DoGetBinding();
-  nsIDOMCSSValue* DoGetClear();
-  nsIDOMCSSValue* DoGetCssFloat();
-  nsIDOMCSSValue* DoGetDisplay();
-  nsIDOMCSSValue* DoGetPosition();
-  nsIDOMCSSValue* DoGetClip();
-  nsIDOMCSSValue* DoGetOverflow();
-  nsIDOMCSSValue* DoGetOverflowX();
-  nsIDOMCSSValue* DoGetOverflowY();
-  nsIDOMCSSValue* DoGetResize();
-  nsIDOMCSSValue* DoGetPageBreakAfter();
-  nsIDOMCSSValue* DoGetPageBreakBefore();
-  nsIDOMCSSValue* DoGetPageBreakInside();
-  nsIDOMCSSValue* DoGetTransform();
-  nsIDOMCSSValue* DoGetTransformOrigin();
-  nsIDOMCSSValue* DoGetPerspective();
-  nsIDOMCSSValue* DoGetBackfaceVisibility();
-  nsIDOMCSSValue* DoGetPerspectiveOrigin();
-  nsIDOMCSSValue* DoGetTransformStyle();
-  nsIDOMCSSValue* DoGetOrient();
+  mozilla::dom::CSSValue* DoGetBinding();
+  mozilla::dom::CSSValue* DoGetClear();
+  mozilla::dom::CSSValue* DoGetCssFloat();
+  mozilla::dom::CSSValue* DoGetDisplay();
+  mozilla::dom::CSSValue* DoGetPosition();
+  mozilla::dom::CSSValue* DoGetClip();
+  mozilla::dom::CSSValue* DoGetOverflow();
+  mozilla::dom::CSSValue* DoGetOverflowX();
+  mozilla::dom::CSSValue* DoGetOverflowY();
+  mozilla::dom::CSSValue* DoGetResize();
+  mozilla::dom::CSSValue* DoGetPageBreakAfter();
+  mozilla::dom::CSSValue* DoGetPageBreakBefore();
+  mozilla::dom::CSSValue* DoGetPageBreakInside();
+  mozilla::dom::CSSValue* DoGetTransform();
+  mozilla::dom::CSSValue* DoGetTransformOrigin();
+  mozilla::dom::CSSValue* DoGetPerspective();
+  mozilla::dom::CSSValue* DoGetBackfaceVisibility();
+  mozilla::dom::CSSValue* DoGetPerspectiveOrigin();
+  mozilla::dom::CSSValue* DoGetTransformStyle();
+  mozilla::dom::CSSValue* DoGetOrient();
 
   /* User interface properties */
-  nsIDOMCSSValue* DoGetCursor();
-  nsIDOMCSSValue* DoGetForceBrokenImageIcon();
-  nsIDOMCSSValue* DoGetIMEMode();
-  nsIDOMCSSValue* DoGetUserFocus();
-  nsIDOMCSSValue* DoGetUserInput();
-  nsIDOMCSSValue* DoGetUserModify();
-  nsIDOMCSSValue* DoGetUserSelect();
+  mozilla::dom::CSSValue* DoGetCursor();
+  mozilla::dom::CSSValue* DoGetForceBrokenImageIcon();
+  mozilla::dom::CSSValue* DoGetIMEMode();
+  mozilla::dom::CSSValue* DoGetUserFocus();
+  mozilla::dom::CSSValue* DoGetUserInput();
+  mozilla::dom::CSSValue* DoGetUserModify();
+  mozilla::dom::CSSValue* DoGetUserSelect();
 
   /* Column properties */
-  nsIDOMCSSValue* DoGetColumnCount();
-  nsIDOMCSSValue* DoGetColumnFill();
-  nsIDOMCSSValue* DoGetColumnWidth();
-  nsIDOMCSSValue* DoGetColumnGap();
-  nsIDOMCSSValue* DoGetColumnRuleWidth();
-  nsIDOMCSSValue* DoGetColumnRuleStyle();
-  nsIDOMCSSValue* DoGetColumnRuleColor();
+  mozilla::dom::CSSValue* DoGetColumnCount();
+  mozilla::dom::CSSValue* DoGetColumnFill();
+  mozilla::dom::CSSValue* DoGetColumnWidth();
+  mozilla::dom::CSSValue* DoGetColumnGap();
+  mozilla::dom::CSSValue* DoGetColumnRuleWidth();
+  mozilla::dom::CSSValue* DoGetColumnRuleStyle();
+  mozilla::dom::CSSValue* DoGetColumnRuleColor();
 
   /* CSS Transitions */
-  nsIDOMCSSValue* DoGetTransitionProperty();
-  nsIDOMCSSValue* DoGetTransitionDuration();
-  nsIDOMCSSValue* DoGetTransitionDelay();
-  nsIDOMCSSValue* DoGetTransitionTimingFunction();
+  mozilla::dom::CSSValue* DoGetTransitionProperty();
+  mozilla::dom::CSSValue* DoGetTransitionDuration();
+  mozilla::dom::CSSValue* DoGetTransitionDelay();
+  mozilla::dom::CSSValue* DoGetTransitionTimingFunction();
 
   /* CSS Animations */
-  nsIDOMCSSValue* DoGetAnimationName();
-  nsIDOMCSSValue* DoGetAnimationDuration();
-  nsIDOMCSSValue* DoGetAnimationDelay();
-  nsIDOMCSSValue* DoGetAnimationTimingFunction();
-  nsIDOMCSSValue* DoGetAnimationDirection();
-  nsIDOMCSSValue* DoGetAnimationFillMode();
-  nsIDOMCSSValue* DoGetAnimationIterationCount();
-  nsIDOMCSSValue* DoGetAnimationPlayState();
+  mozilla::dom::CSSValue* DoGetAnimationName();
+  mozilla::dom::CSSValue* DoGetAnimationDuration();
+  mozilla::dom::CSSValue* DoGetAnimationDelay();
+  mozilla::dom::CSSValue* DoGetAnimationTimingFunction();
+  mozilla::dom::CSSValue* DoGetAnimationDirection();
+  mozilla::dom::CSSValue* DoGetAnimationFillMode();
+  mozilla::dom::CSSValue* DoGetAnimationIterationCount();
+  mozilla::dom::CSSValue* DoGetAnimationPlayState();
 
 #ifdef MOZ_FLEXBOX
   /* CSS Flexbox properties */
-  nsIDOMCSSValue* DoGetAlignItems();
-  nsIDOMCSSValue* DoGetAlignSelf();
-  nsIDOMCSSValue* DoGetFlexBasis();
-  nsIDOMCSSValue* DoGetFlexDirection();
-  nsIDOMCSSValue* DoGetFlexGrow();
-  nsIDOMCSSValue* DoGetFlexShrink();
-  nsIDOMCSSValue* DoGetOrder();
-  nsIDOMCSSValue* DoGetJustifyContent();
+  mozilla::dom::CSSValue* DoGetAlignItems();
+  mozilla::dom::CSSValue* DoGetAlignSelf();
+  mozilla::dom::CSSValue* DoGetFlexBasis();
+  mozilla::dom::CSSValue* DoGetFlexDirection();
+  mozilla::dom::CSSValue* DoGetFlexGrow();
+  mozilla::dom::CSSValue* DoGetFlexShrink();
+  mozilla::dom::CSSValue* DoGetOrder();
+  mozilla::dom::CSSValue* DoGetJustifyContent();
 #endif // MOZ_FLEXBOX
 
   /* SVG properties */
-  nsIDOMCSSValue* DoGetFill();
-  nsIDOMCSSValue* DoGetStroke();
-  nsIDOMCSSValue* DoGetMarkerEnd();
-  nsIDOMCSSValue* DoGetMarkerMid();
-  nsIDOMCSSValue* DoGetMarkerStart();
-  nsIDOMCSSValue* DoGetStrokeDasharray();
+  mozilla::dom::CSSValue* DoGetFill();
+  mozilla::dom::CSSValue* DoGetStroke();
+  mozilla::dom::CSSValue* DoGetMarkerEnd();
+  mozilla::dom::CSSValue* DoGetMarkerMid();
+  mozilla::dom::CSSValue* DoGetMarkerStart();
+  mozilla::dom::CSSValue* DoGetStrokeDasharray();
 
-  nsIDOMCSSValue* DoGetStrokeDashoffset();
-  nsIDOMCSSValue* DoGetStrokeWidth();
-  nsIDOMCSSValue* DoGetVectorEffect();
+  mozilla::dom::CSSValue* DoGetStrokeDashoffset();
+  mozilla::dom::CSSValue* DoGetStrokeWidth();
+  mozilla::dom::CSSValue* DoGetVectorEffect();
 
-  nsIDOMCSSValue* DoGetFillOpacity();
-  nsIDOMCSSValue* DoGetFloodOpacity();
-  nsIDOMCSSValue* DoGetStopOpacity();
-  nsIDOMCSSValue* DoGetStrokeMiterlimit();
-  nsIDOMCSSValue* DoGetStrokeOpacity();
+  mozilla::dom::CSSValue* DoGetFillOpacity();
+  mozilla::dom::CSSValue* DoGetFloodOpacity();
+  mozilla::dom::CSSValue* DoGetStopOpacity();
+  mozilla::dom::CSSValue* DoGetStrokeMiterlimit();
+  mozilla::dom::CSSValue* DoGetStrokeOpacity();
 
-  nsIDOMCSSValue* DoGetClipRule();
-  nsIDOMCSSValue* DoGetFillRule();
-  nsIDOMCSSValue* DoGetStrokeLinecap();
-  nsIDOMCSSValue* DoGetStrokeLinejoin();
-  nsIDOMCSSValue* DoGetTextAnchor();
+  mozilla::dom::CSSValue* DoGetClipRule();
+  mozilla::dom::CSSValue* DoGetFillRule();
+  mozilla::dom::CSSValue* DoGetStrokeLinecap();
+  mozilla::dom::CSSValue* DoGetStrokeLinejoin();
+  mozilla::dom::CSSValue* DoGetTextAnchor();
 
-  nsIDOMCSSValue* DoGetColorInterpolation();
-  nsIDOMCSSValue* DoGetColorInterpolationFilters();
-  nsIDOMCSSValue* DoGetDominantBaseline();
-  nsIDOMCSSValue* DoGetImageRendering();
-  nsIDOMCSSValue* DoGetShapeRendering();
-  nsIDOMCSSValue* DoGetTextRendering();
+  mozilla::dom::CSSValue* DoGetColorInterpolation();
+  mozilla::dom::CSSValue* DoGetColorInterpolationFilters();
+  mozilla::dom::CSSValue* DoGetDominantBaseline();
+  mozilla::dom::CSSValue* DoGetImageRendering();
+  mozilla::dom::CSSValue* DoGetShapeRendering();
+  mozilla::dom::CSSValue* DoGetTextRendering();
 
-  nsIDOMCSSValue* DoGetFloodColor();
-  nsIDOMCSSValue* DoGetLightingColor();
-  nsIDOMCSSValue* DoGetStopColor();
+  mozilla::dom::CSSValue* DoGetFloodColor();
+  mozilla::dom::CSSValue* DoGetLightingColor();
+  mozilla::dom::CSSValue* DoGetStopColor();
 
-  nsIDOMCSSValue* DoGetClipPath();
-  nsIDOMCSSValue* DoGetFilter();
-  nsIDOMCSSValue* DoGetMask();
+  mozilla::dom::CSSValue* DoGetClipPath();
+  mozilla::dom::CSSValue* DoGetFilter();
+  mozilla::dom::CSSValue* DoGetMask();
 
   nsROCSSPrimitiveValue* GetROCSSPrimitiveValue();
   nsDOMCSSValueList* GetROCSSValueList(bool aCommaDelimited);
   void SetToRGBAColor(nsROCSSPrimitiveValue* aValue, nscolor aColor);
   void SetValueToStyleImage(const nsStyleImage& aStyleImage,
                             nsROCSSPrimitiveValue* aValue);
 
   /**
@@ -468,17 +472,17 @@ private:
   bool GetFrameBoundsWidthForTransform(nscoord &aWidth);
   bool GetFrameBoundsHeightForTransform(nscoord &aHeight);
   bool GetFrameBorderRectWidth(nscoord& aWidth);
   bool GetFrameBorderRectHeight(nscoord& aHeight);
 
   struct ComputedStyleMapEntry
   {
     // Create a pointer-to-member-function type.
-    typedef nsIDOMCSSValue* (nsComputedDOMStyle::*ComputeMethod)();
+    typedef mozilla::dom::CSSValue* (nsComputedDOMStyle::*ComputeMethod)();
 
     nsCSSProperty mProperty;
     ComputeMethod mGetter;
     bool mNeedsLayoutFlush;
   };
 
   static const ComputedStyleMapEntry* GetQueryablePropertyMap(uint32_t* aLength);
 
--- a/layout/style/nsDOMCSSDeclaration.cpp
+++ b/layout/style/nsDOMCSSDeclaration.cpp
@@ -15,17 +15,17 @@
 #include "mozilla/css/Declaration.h"
 #include "nsCSSProps.h"
 #include "nsCOMPtr.h"
 #include "nsIURL.h"
 #include "nsReadableUtils.h"
 #include "nsIPrincipal.h"
 #include "mozAutoDocUpdate.h"
 
-namespace css = mozilla::css;
+using namespace mozilla;
 
 nsDOMCSSDeclaration::~nsDOMCSSDeclaration()
 {
 }
 
 NS_INTERFACE_TABLE_HEAD(nsDOMCSSDeclaration)
   NS_INTERFACE_TABLE2(nsDOMCSSDeclaration,
                       nsICSSDeclaration,
@@ -122,26 +122,22 @@ nsDOMCSSDeclaration::GetLength(uint32_t*
     *aLength = decl->Count();
   } else {
     *aLength = 0;
   }
 
   return NS_OK;
 }
 
-NS_IMETHODIMP
-nsDOMCSSDeclaration::GetPropertyCSSValue(const nsAString& aPropertyName,
-                                         nsIDOMCSSValue** aReturn)
+already_AddRefed<dom::CSSValue>
+nsDOMCSSDeclaration::GetPropertyCSSValue(const nsAString& aPropertyName, ErrorResult& aRv)
 {
-  NS_ENSURE_ARG_POINTER(aReturn);
+  // We don't support CSSValue yet so we'll just return null...
 
-  // We don't support CSSValue yet so we'll just return null...
-  *aReturn = nullptr;
-
-  return NS_OK;
+  return nullptr;
 }
 
 void
 nsDOMCSSDeclaration::IndexedGetter(uint32_t aIndex, bool& aFound, nsAString& aPropName)
 {
   css::Declaration* decl = GetCSSDeclaration(false);
   aFound = decl && decl->GetNthProperty(aIndex, aPropName);
 }
--- a/layout/style/nsDOMCSSDeclaration.h
+++ b/layout/style/nsDOMCSSDeclaration.h
@@ -43,18 +43,20 @@ public:
   using nsICSSDeclaration::GetLength;
 
   // Require subclasses to implement |GetParentRule|.
   //NS_DECL_NSIDOMCSSSTYLEDECLARATION
   NS_IMETHOD GetCssText(nsAString & aCssText);
   NS_IMETHOD SetCssText(const nsAString & aCssText) MOZ_OVERRIDE;
   NS_IMETHOD GetPropertyValue(const nsAString & propertyName,
                               nsAString & _retval) MOZ_OVERRIDE;
-  NS_IMETHOD GetPropertyCSSValue(const nsAString & propertyName,
-                                 nsIDOMCSSValue **_retval) MOZ_OVERRIDE;
+  virtual already_AddRefed<mozilla::dom::CSSValue>
+    GetPropertyCSSValue(const nsAString & propertyName,
+                        mozilla::ErrorResult& aRv) MOZ_OVERRIDE;
+  using nsICSSDeclaration::GetPropertyCSSValue;
   NS_IMETHOD RemoveProperty(const nsAString & propertyName,
                             nsAString & _retval);
   NS_IMETHOD GetPropertyPriority(const nsAString & propertyName,
                                  nsAString & _retval) MOZ_OVERRIDE;
   NS_IMETHOD SetProperty(const nsAString & propertyName,
                          const nsAString & value, const nsAString & priority) MOZ_OVERRIDE;
   NS_IMETHOD GetLength(uint32_t *aLength) MOZ_OVERRIDE;
   NS_IMETHOD GetParentRule(nsIDOMCSSRule * *aParentRule) MOZ_OVERRIDE = 0;
--- a/layout/style/nsDOMCSSValueList.cpp
+++ b/layout/style/nsDOMCSSValueList.cpp
@@ -1,66 +1,54 @@
 /* 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/. */
 
 /* DOM object representing lists of values in DOM computed style */
 
 #include "nsDOMCSSValueList.h"
 #include "nsCOMPtr.h"
+#include "mozilla/dom/CSSValueListBinding.h"
 #include "nsError.h"
 #include "nsContentUtils.h"
-#include "nsDOMClassInfoID.h"
+
+using namespace mozilla;
 
 nsDOMCSSValueList::nsDOMCSSValueList(bool aCommaDelimited, bool aReadonly)
-  : mCommaDelimited(aCommaDelimited), mReadonly(aReadonly)
+  : CSSValue(), mCommaDelimited(aCommaDelimited), mReadonly(aReadonly)
 {
+  SetIsDOMBinding();
 }
 
 nsDOMCSSValueList::~nsDOMCSSValueList()
 {
 }
 
-NS_IMPL_ADDREF(nsDOMCSSValueList)
-NS_IMPL_RELEASE(nsDOMCSSValueList)
-
-DOMCI_DATA(CSSValueList, nsDOMCSSValueList)
+NS_IMPL_CYCLE_COLLECTING_ADDREF(nsDOMCSSValueList)
+NS_IMPL_CYCLE_COLLECTING_RELEASE(nsDOMCSSValueList)
 
 // QueryInterface implementation for nsDOMCSSValueList
-NS_INTERFACE_MAP_BEGIN(nsDOMCSSValueList)
-  NS_INTERFACE_MAP_ENTRY(nsIDOMCSSValueList)
+NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsDOMCSSValueList)
+  NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsIDOMCSSValue)
-  NS_INTERFACE_MAP_ENTRY(nsISupports)
-  NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(CSSValueList)
+  NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, CSSValue)
 NS_INTERFACE_MAP_END
 
-void
-nsDOMCSSValueList::AppendCSSValue(nsIDOMCSSValue* aValue)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_1(nsDOMCSSValueList, mCSSValues)
+
+JSObject*
+nsDOMCSSValueList::WrapObject(JSContext *cx, JSObject *scope, bool *tried)
 {
-  mCSSValues.AppendElement(aValue);
+  return dom::CSSValueListBinding::Wrap(cx, scope, this, tried);
 }
 
-// nsIDOMCSSValueList
-
-NS_IMETHODIMP
-nsDOMCSSValueList::GetLength(uint32_t* aLength)
+void
+nsDOMCSSValueList::AppendCSSValue(CSSValue* aValue)
 {
-  *aLength = mCSSValues.Length();
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsDOMCSSValueList::Item(uint32_t aIndex, nsIDOMCSSValue **aReturn)
-{
-  NS_ENSURE_ARG_POINTER(aReturn);
-
-  NS_IF_ADDREF(*aReturn = GetItemAt(aIndex));
-
-  return NS_OK;
+  mCSSValues.AppendElement(aValue);
 }
 
 // nsIDOMCSSValue
 
 NS_IMETHODIMP
 nsDOMCSSValueList::GetCssText(nsAString& aCssText)
 {
   aCssText.Truncate();
@@ -70,23 +58,23 @@ nsDOMCSSValueList::GetCssText(nsAString&
   nsAutoString separator;
   if (mCommaDelimited) {
     separator.AssignLiteral(", ");
   }
   else {
     separator.Assign(PRUnichar(' '));
   }
 
-  nsCOMPtr<nsIDOMCSSValue> cssValue;
   nsAutoString tmpStr;
   for (uint32_t i = 0; i < count; ++i) {
-    cssValue = mCSSValues[i];
+    CSSValue *cssValue = mCSSValues[i];
     NS_ASSERTION(cssValue, "Eek!  Someone filled the value list with null CSSValues!");
+    ErrorResult dummy;
     if (cssValue) {
-      cssValue->GetCssText(tmpStr);
+      cssValue->GetCssText(tmpStr, dummy);
 
       if (tmpStr.IsEmpty()) {
 
 #ifdef DEBUG_caillon
         NS_ERROR("Eek!  An empty CSSValue!  Bad!");
 #endif
 
         continue;
@@ -99,28 +87,44 @@ nsDOMCSSValueList::GetCssText(nsAString&
       }
       aCssText.Append(tmpStr);
     }
   }
 
   return NS_OK;
 }
 
+void
+nsDOMCSSValueList::GetCssText(nsString& aText, ErrorResult& aRv)
+{
+  aRv = GetCssText(aText);
+}
+
 NS_IMETHODIMP
 nsDOMCSSValueList::SetCssText(const nsAString& aCssText)
 {
   if (mReadonly) {
     return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR;
   }
 
   NS_NOTYETIMPLEMENTED("Can't SetCssText yet: please write me!");
   return NS_OK;
 }
 
+void
+nsDOMCSSValueList::SetCssText(const nsAString& aText, ErrorResult& aRv)
+{
+  aRv = SetCssText(aText);
+}
 
 NS_IMETHODIMP
 nsDOMCSSValueList::GetCssValueType(uint16_t* aValueType)
 {
   NS_ENSURE_ARG_POINTER(aValueType);
   *aValueType = nsIDOMCSSValue::CSS_VALUE_LIST;
   return NS_OK;
 }
 
+uint16_t
+nsDOMCSSValueList::CssValueType() const
+{
+  return nsIDOMCSSValue::CSS_VALUE_LIST;
+}
--- a/layout/style/nsDOMCSSValueList.h
+++ b/layout/style/nsDOMCSSValueList.h
@@ -3,68 +3,73 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* DOM object representing lists of values in DOM computed style */
 
 #ifndef nsDOMCSSValueList_h___
 #define nsDOMCSSValueList_h___
 
 #include "nsIDOMCSSValue.h"
-#include "nsIDOMCSSValueList.h"
+#include "CSSValue.h"
+#include "nsAutoPtr.h"
 #include "nsTArray.h"
 
+class nsComputedDOMStyle;
 
-#include "nsCOMPtr.h"
-
-class nsDOMCSSValueList : public nsIDOMCSSValueList
+class nsDOMCSSValueList MOZ_FINAL : public mozilla::dom::CSSValue,
+  public nsIDOMCSSValue
 {
 public:
-  NS_DECL_ISUPPORTS
-
-  // nsIDOMCSSValueList
-  NS_DECL_NSIDOMCSSVALUELIST
+  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
+  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsDOMCSSValueList, mozilla::dom::CSSValue)
 
   // nsIDOMCSSValue
   NS_DECL_NSIDOMCSSVALUE
 
   // nsDOMCSSValueList
   nsDOMCSSValueList(bool aCommaDelimited, bool aReadonly);
-  virtual ~nsDOMCSSValueList();
+  ~nsDOMCSSValueList();
 
   /**
    * Adds a value to this list.
    */
-  void AppendCSSValue(nsIDOMCSSValue* aValue);
+  void AppendCSSValue(CSSValue* aValue);
 
-  nsIDOMCSSValue* GetItemAt(uint32_t aIndex)
+  virtual void GetCssText(nsString& aText, mozilla::ErrorResult& aRv)
+    MOZ_OVERRIDE MOZ_FINAL;
+  virtual void SetCssText(const nsAString& aText,
+                          mozilla::ErrorResult& aRv) MOZ_OVERRIDE MOZ_FINAL;
+  virtual uint16_t CssValueType() const MOZ_OVERRIDE MOZ_FINAL;
+
+  CSSValue* IndexedGetter(uint32_t aIdx, bool& aFound) const
   {
-    return mCSSValues.SafeElementAt(aIndex, nullptr);
+    aFound = aIdx <= Length();
+    return Item(aIdx);
   }
 
-  static nsDOMCSSValueList* FromSupports(nsISupports* aSupports)
+  CSSValue* Item(uint32_t aIndex) const
   {
-#ifdef DEBUG
-    {
-      nsCOMPtr<nsIDOMCSSValueList> list_qi = do_QueryInterface(aSupports);
+    return mCSSValues.SafeElementAt(aIndex);
+  }
 
-      // If this assertion fires the QI implementation for the object in
-      // question doesn't use the nsIDOMCSSValueList pointer as the nsISupports
-      // pointer. That must be fixed, or we'll crash...
-      NS_ASSERTION(list_qi == static_cast<nsIDOMCSSValueList*>(aSupports),
-                   "Uh, fix QI!");
-    }
-#endif
+  uint32_t Length() const
+  {
+    return mCSSValues.Length();
+  }
 
-    return static_cast<nsDOMCSSValueList*>(aSupports);
+  nsISupports* GetParentObject()
+  {
+    return nullptr;
   }
 
+  virtual JSObject *WrapObject(JSContext *cx, JSObject *scope, bool *triedToWrap);
+
 private:
   bool                        mCommaDelimited;  // some value lists use a comma
                                                 // as the delimiter, some just use
                                                 // spaces.
 
   bool                        mReadonly;    // Are we read-only?
 
-  InfallibleTArray<nsCOMPtr<nsIDOMCSSValue> > mCSSValues;
+  InfallibleTArray<nsRefPtr<CSSValue> > mCSSValues;
 };
 
-
 #endif /* nsDOMCSSValueList_h___ */
--- a/layout/style/nsICSSDeclaration.h
+++ b/layout/style/nsICSSDeclaration.h
@@ -16,16 +16,17 @@
  * nsIDOMCSSStyleDeclaration; the difference is that these use
  * nsCSSProperty enums for the prop names instead of using strings.
  * This is meant for use in performance-sensitive code only!  Most
  * consumers should continue to use nsIDOMCSSStyleDeclaration.
  */
 
 #include "nsIDOMCSSStyleDeclaration.h"
 #include "nsCSSProperty.h"
+#include "CSSValue.h"
 #include "nsWrapperCache.h"
 #include "mozilla/dom/BindingUtils.h"
 #include "nsString.h"
 #include "nsIDOMCSSRule.h"
 #include "nsIDOMCSSValue.h"
 #include "mozilla/ErrorResult.h"
 
 // dbeabbfa-6cb3-4f5c-aec2-dd558d9d681f
@@ -59,18 +60,31 @@ public:
   virtual nsINode *GetParentObject() = 0;
 
   // Also have to declare all the nsIDOMCSSStyleDeclaration methods,
   // since we want to be able to call them from the WebIDL versions.
   NS_IMETHOD GetCssText(nsAString& aCssText) = 0;
   NS_IMETHOD SetCssText(const nsAString& aCssText) = 0;
   NS_IMETHOD GetPropertyValue(const nsAString& aPropName,
                               nsAString& aValue) = 0;
-  NS_IMETHOD GetPropertyCSSValue(const nsAString& aPropertyName,
-                                 nsIDOMCSSValue** aReturn) = 0;
+  virtual already_AddRefed<mozilla::dom::CSSValue>
+    GetPropertyCSSValue(const nsAString& aPropertyName,
+                        mozilla::ErrorResult& aRv) = 0;
+  NS_IMETHOD GetPropertyCSSValue(const nsAString& aProp, nsIDOMCSSValue** aVal)
+  {
+    mozilla::ErrorResult error;
+    nsRefPtr<mozilla::dom::CSSValue> val = GetPropertyCSSValue(aProp, error);
+    if (error.Failed()) {
+      return error.ErrorCode();
+  }
+
+    nsCOMPtr<nsIDOMCSSValue> xpVal = do_QueryInterface(val);
+    xpVal.forget(aVal);
+    return NS_OK;
+  }
   NS_IMETHOD RemoveProperty(const nsAString& aPropertyName,
                             nsAString& aReturn) = 0;
   NS_IMETHOD GetPropertyPriority(const nsAString& aPropertyName,
                                  nsAString& aReturn) = 0;
   NS_IMETHOD SetProperty(const nsAString& aPropertyName,
                          const nsAString& aValue,
                          const nsAString& aPriority) = 0;
   NS_IMETHOD GetLength(uint32_t* aLength) = 0;
@@ -105,22 +119,16 @@ public:
 
   // The actual implementation of the Item method and the WebIDL indexed getter
   virtual void IndexedGetter(uint32_t aIndex, bool& aFound, nsAString& aPropName) = 0;
 
   void GetPropertyValue(const nsAString& aPropName, nsString& aValue,
                         mozilla::ErrorResult& rv) {
     rv = GetPropertyValue(aPropName, aValue);
   }
-  already_AddRefed<nsIDOMCSSValue>
-    GetPropertyCSSValue(const nsAString& aPropName, mozilla::ErrorResult& rv) {
-    nsCOMPtr<nsIDOMCSSValue> val;
-    rv = GetPropertyCSSValue(aPropName, getter_AddRefs(val));
-    return val.forget();
-  }
   void GetPropertyPriority(const nsAString& aPropName, nsString& aPriority) {
     GetPropertyPriority(aPropName, static_cast<nsAString&>(aPriority));
   }
   // XXXbz we should nix the Optional thing once bug 759622 is fixed.
   void SetProperty(const nsAString& aPropName, const nsAString& aValue,
                    const mozilla::dom::Optional<nsAString>& aPriority,
                    mozilla::ErrorResult& rv) {
     if (aPriority.WasPassed()) {
@@ -143,9 +151,20 @@ public:
 NS_DEFINE_STATIC_IID_ACCESSOR(nsICSSDeclaration, NS_ICSSDECLARATION_IID)
 
 #define NS_DECL_NSICSSDECLARATION                               \
   NS_IMETHOD GetPropertyValue(const nsCSSProperty aPropID,    \
                               nsAString& aValue);               \
   NS_IMETHOD SetPropertyValue(const nsCSSProperty aPropID,    \
                               const nsAString& aValue);
 
+#define NS_DECL_NSIDOMCSSSTYLEDECLARATION_HELPER \
+  NS_IMETHOD GetCssText(nsAString & aCssText); \
+  NS_IMETHOD SetCssText(const nsAString & aCssText); \
+  NS_IMETHOD GetPropertyValue(const nsAString & propertyName, nsAString & _retval); \
+  NS_IMETHOD RemoveProperty(const nsAString & propertyName, nsAString & _retval); \
+  NS_IMETHOD GetPropertyPriority(const nsAString & propertyName, nsAString & _retval); \
+  NS_IMETHOD SetProperty(const nsAString & propertyName, const nsAString & value, const nsAString & priority); \
+  NS_IMETHOD GetLength(uint32_t *aLength); \
+  NS_IMETHOD Item(uint32_t index, nsAString & _retval); \
+  NS_IMETHOD GetParentRule(nsIDOMCSSRule * *aParentRule);
+
 #endif // nsICSSDeclaration_h__
--- a/layout/style/nsROCSSPrimitiveValue.cpp
+++ b/layout/style/nsROCSSPrimitiveValue.cpp
@@ -2,50 +2,77 @@
 /* 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/. */
 
 /* DOM object representing values in DOM computed style */
 
 #include "nsROCSSPrimitiveValue.h"
 
+#include "nsContentUtils.h"
+#include "mozilla/dom/CSSPrimitiveValueBinding.h"
 #include "nsPresContext.h"
 #include "nsStyleUtil.h"
 #include "nsDOMCSSRGBColor.h"
 #include "nsIDOMRect.h"
-#include "nsDOMClassInfoID.h" // DOMCI_DATA
 #include "nsIURI.h"
 #include "nsError.h"
 
+using namespace mozilla;
+
 nsROCSSPrimitiveValue::nsROCSSPrimitiveValue()
-  : mType(CSS_PX)
+  : CSSValue(), mType(CSS_PX)
 {
   mValue.mAppUnits = 0;
+  SetIsDOMBinding();
 }
 
 
 nsROCSSPrimitiveValue::~nsROCSSPrimitiveValue()
 {
   Reset();
 }
 
-NS_IMPL_ADDREF(nsROCSSPrimitiveValue)
-NS_IMPL_RELEASE(nsROCSSPrimitiveValue)
+NS_IMPL_CYCLE_COLLECTING_ADDREF(nsROCSSPrimitiveValue)
+NS_IMPL_CYCLE_COLLECTING_RELEASE(nsROCSSPrimitiveValue)
 
 
-DOMCI_DATA(ROCSSPrimitiveValue, nsROCSSPrimitiveValue)
-
 // QueryInterface implementation for nsROCSSPrimitiveValue
-NS_INTERFACE_MAP_BEGIN(nsROCSSPrimitiveValue)
+NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsROCSSPrimitiveValue)
+  NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsIDOMCSSPrimitiveValue)
   NS_INTERFACE_MAP_ENTRY(nsIDOMCSSValue)
-  NS_INTERFACE_MAP_ENTRY(nsISupports)
-  NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(ROCSSPrimitiveValue)
+  NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, CSSValue)
 NS_INTERFACE_MAP_END
 
+NS_IMPL_CYCLE_COLLECTION_CLASS(nsROCSSPrimitiveValue)
+NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(nsROCSSPrimitiveValue)
+
+NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsROCSSPrimitiveValue)
+  if (tmp->mType == CSS_URI) {
+    NS_IMPL_CYCLE_COLLECTION_TRAVERSE_RAWPTR(mValue.mURI)
+  } else if (tmp->mType == CSS_RGBCOLOR) {
+    NS_IMPL_CYCLE_COLLECTION_TRAVERSE_RAWPTR(mValue.mColor)
+  } else if (tmp->mType == CSS_RECT) {
+    NS_IMPL_CYCLE_COLLECTION_TRAVERSE_RAWPTR(mValue.mRect)
+  }
+NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
+  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
+
+NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsROCSSPrimitiveValue)
+  NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
+  tmp->Reset();
+NS_IMPL_CYCLE_COLLECTION_UNLINK_END
+
+JSObject*
+nsROCSSPrimitiveValue::WrapObject(JSContext *cx, JSObject *scope,
+                                  bool *triedToWrap)
+{
+  return dom::CSSPrimitiveValueBinding::Wrap(cx, scope, this, triedToWrap);
+}
 
 // nsIDOMCSSValue
 
 
 NS_IMETHODIMP
 nsROCSSPrimitiveValue::GetCssText(nsAString& aCssText)
 {
   nsAutoString tmpStr;
@@ -230,32 +257,49 @@ nsROCSSPrimitiveValue::GetCssText(nsAStr
 
   if (NS_SUCCEEDED(result)) {
     aCssText.Assign(tmpStr);
   }
 
   return NS_OK;
 }
 
+void
+nsROCSSPrimitiveValue::GetCssText(nsString& aText, ErrorResult& aRv)
+{
+  aRv = GetCssText(aText);
+}
 
 NS_IMETHODIMP
 nsROCSSPrimitiveValue::SetCssText(const nsAString& aCssText)
 {
   return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR;
 }
 
+void
+nsROCSSPrimitiveValue::SetCssText(const nsAString& aText, ErrorResult& aRv)
+{
+  aRv = SetCssText(aText);
+}
+
 
 NS_IMETHODIMP
 nsROCSSPrimitiveValue::GetCssValueType(uint16_t* aValueType)
 {
   NS_ENSURE_ARG_POINTER(aValueType);
   *aValueType = nsIDOMCSSValue::CSS_PRIMITIVE_VALUE;
   return NS_OK;
 }
 
+uint16_t
+nsROCSSPrimitiveValue::CssValueType() const
+{
+  return nsIDOMCSSValue::CSS_PRIMITIVE_VALUE;
+}
+
 
 // nsIDOMCSSPrimitiveValue
 
 NS_IMETHODIMP
 nsROCSSPrimitiveValue::GetPrimitiveType(uint16_t* aPrimitiveType)
 {
   NS_ENSURE_ARG_POINTER(aPrimitiveType);
   *aPrimitiveType = mType;
@@ -265,67 +309,78 @@ nsROCSSPrimitiveValue::GetPrimitiveType(
 
 
 NS_IMETHODIMP
 nsROCSSPrimitiveValue::SetFloatValue(uint16_t aUnitType, float aFloatValue)
 {
   return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR;
 }
 
-
-NS_IMETHODIMP
-nsROCSSPrimitiveValue::GetFloatValue(uint16_t aUnitType, float* aReturn)
+void
+nsROCSSPrimitiveValue::SetFloatValue(uint16_t aType, float aVal,
+                                     ErrorResult& aRv)
 {
-  NS_ENSURE_ARG_POINTER(aReturn);
-  *aReturn = 0;
+  aRv = SetFloatValue(aType, aVal);
+}
 
+float
+nsROCSSPrimitiveValue::GetFloatValue(uint16_t aUnitType, ErrorResult& aRv)
+{
   switch(aUnitType) {
     case CSS_PX :
-      if (mType != CSS_PX)
-        return NS_ERROR_DOM_INVALID_ACCESS_ERR;
-      *aReturn = nsPresContext::AppUnitsToFloatCSSPixels(mValue.mAppUnits);
+      if (mType == CSS_PX) {
+        return nsPresContext::AppUnitsToFloatCSSPixels(mValue.mAppUnits);
+      }
+
       break;
     case CSS_CM :
-      if (mType != CSS_PX)
-        return NS_ERROR_DOM_INVALID_ACCESS_ERR;
-      *aReturn = mValue.mAppUnits * CM_PER_INCH_FLOAT /
-        nsPresContext::AppUnitsPerCSSInch();
+      if (mType == CSS_PX) {
+        return mValue.mAppUnits * CM_PER_INCH_FLOAT /
+          nsPresContext::AppUnitsPerCSSInch();
+      }
+
       break;
     case CSS_MM :
-      if (mType != CSS_PX)
-        return NS_ERROR_DOM_INVALID_ACCESS_ERR;
-      *aReturn = mValue.mAppUnits * MM_PER_INCH_FLOAT /
-        nsPresContext::AppUnitsPerCSSInch();
+      if (mType == CSS_PX) {
+        return mValue.mAppUnits * MM_PER_INCH_FLOAT /
+          nsPresContext::AppUnitsPerCSSInch();
+      }
+
       break;
     case CSS_IN :
-      if (mType != CSS_PX)
-        return NS_ERROR_DOM_INVALID_ACCESS_ERR;
-      *aReturn = mValue.mAppUnits / nsPresContext::AppUnitsPerCSSInch();
+      if (mType == CSS_PX) {
+        return mValue.mAppUnits / nsPresContext::AppUnitsPerCSSInch();
+      }
+
       break;
     case CSS_PT :
-      if (mType != CSS_PX)
-        return NS_ERROR_DOM_INVALID_ACCESS_ERR;
-      *aReturn = mValue.mAppUnits * POINTS_PER_INCH_FLOAT / 
-        nsPresContext::AppUnitsPerCSSInch();
+      if (mType == CSS_PX) {
+        return mValue.mAppUnits * POINTS_PER_INCH_FLOAT /
+          nsPresContext::AppUnitsPerCSSInch();
+      }
+
       break;
     case CSS_PC :
-      if (mType != CSS_PX)
-        return NS_ERROR_DOM_INVALID_ACCESS_ERR;
-      *aReturn = mValue.mAppUnits * 6.0f /
-        nsPresContext::AppUnitsPerCSSInch();
+      if (mType == CSS_PX) {
+        return mValue.mAppUnits * 6.0f /
+          nsPresContext::AppUnitsPerCSSInch();
+      }
+
       break;
     case CSS_PERCENTAGE :
-      if (mType != CSS_PERCENTAGE)
-        return NS_ERROR_DOM_INVALID_ACCESS_ERR;
-      *aReturn = mValue.mFloat * 100;
+      if (mType == CSS_PERCENTAGE) {
+        return mValue.mFloat * 100;
+      }
+
       break;
     case CSS_NUMBER :
-      if (mType != CSS_NUMBER)
-        return NS_ERROR_DOM_INVALID_ACCESS_ERR;
-      *aReturn = mValue.mFloat;
+      if (mType == CSS_NUMBER) {
+        return mValue.mFloat;
+      }
+
       break;
     case CSS_UNKNOWN :
     case CSS_EMS :
     case CSS_EXS :
     case CSS_DEG :
     case CSS_RAD :
     case CSS_GRAD :
     case CSS_MS :
@@ -335,30 +390,46 @@ nsROCSSPrimitiveValue::GetFloatValue(uin
     case CSS_DIMENSION :
     case CSS_STRING :
     case CSS_URI :
     case CSS_IDENT :
     case CSS_ATTR :
     case CSS_COUNTER :
     case CSS_RECT :
     case CSS_RGBCOLOR :
-      return NS_ERROR_DOM_INVALID_ACCESS_ERR;
+      break;
   }
 
-  return NS_OK;
+  aRv.Throw(NS_ERROR_DOM_INVALID_ACCESS_ERR);
+  return 0;
+}
+
+NS_IMETHODIMP
+nsROCSSPrimitiveValue::GetFloatValue(uint16_t aType, float *aVal)
+{
+  ErrorResult rv;
+  *aVal = GetFloatValue(aType, rv);
+  return rv.ErrorCode();
 }
 
 
 NS_IMETHODIMP
 nsROCSSPrimitiveValue::SetStringValue(uint16_t aStringType,
                                       const nsAString& aStringValue)
 {
   return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR;
 }
 
+void
+nsROCSSPrimitiveValue::SetStringValue(uint16_t aType, const nsAString& aString,
+                                      mozilla::ErrorResult& aRv)
+{
+  aRv.Throw(NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR);
+}
+
 
 NS_IMETHODIMP
 nsROCSSPrimitiveValue::GetStringValue(nsAString& aReturn)
 {
   switch (mType) {
     case CSS_IDENT:
       CopyUTF8toUTF16(nsCSSKeywords::GetStringValue(mValue.mKeyword), aReturn);
       break;
@@ -374,47 +445,75 @@ nsROCSSPrimitiveValue::GetStringValue(ns
       } break;
     default:
       aReturn.Truncate();
       return NS_ERROR_DOM_INVALID_ACCESS_ERR;
   }
   return NS_OK;
 }
 
+void
+nsROCSSPrimitiveValue::GetStringValue(nsString& aString, ErrorResult& aRv)
+{
+  aRv = GetStringValue(aString);
+}
+
 
 NS_IMETHODIMP
 nsROCSSPrimitiveValue::GetCounterValue(nsIDOMCounter** aReturn)
 {
   return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR;
 }
 
+already_AddRefed<nsIDOMCounter>
+nsROCSSPrimitiveValue::GetCounterValue(ErrorResult& aRv)
+{
+  aRv.Throw(NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR);
+  return nullptr;
+}
 
-NS_IMETHODIMP
-nsROCSSPrimitiveValue::GetRectValue(nsIDOMRect** aReturn)
+already_AddRefed<nsIDOMRect>
+nsROCSSPrimitiveValue::GetRectValue(ErrorResult& aRv)
 {
   if (mType != CSS_RECT) {
-    *aReturn = nullptr;
-    return NS_ERROR_DOM_INVALID_ACCESS_ERR;
+    aRv.Throw(NS_ERROR_DOM_INVALID_ACCESS_ERR);
+    return nullptr;
   }
+
   NS_ASSERTION(mValue.mRect, "mValue.mRect should never be null");
-  NS_ADDREF(*aReturn = mValue.mRect);
-  return NS_OK;
+  NS_ADDREF(mValue.mRect);
+  return mValue.mRect;
+}
+
+NS_IMETHODIMP
+nsROCSSPrimitiveValue::GetRectValue(nsIDOMRect** aRect)
+{
+  ErrorResult error;
+  *aRect = GetRectValue(error).get();
+  return error.ErrorCode();
 }
 
+NS_IMETHODIMP
+nsROCSSPrimitiveValue::GetRGBColorValue(nsIDOMRGBColor** aColor)
+{
+  ErrorResult error;
+  *aColor = GetRGBColorValue(error).get();
+  return error.ErrorCode();
+}
 
-NS_IMETHODIMP 
-nsROCSSPrimitiveValue::GetRGBColorValue(nsIDOMRGBColor** aReturn)
+already_AddRefed<nsIDOMRGBColor>
+nsROCSSPrimitiveValue::GetRGBColorValue(ErrorResult& aRv)
 {
   if (mType != CSS_RGBCOLOR) {
-    *aReturn = nullptr;
-    return NS_ERROR_DOM_INVALID_ACCESS_ERR;
+    aRv.Throw(NS_ERROR_DOM_INVALID_ACCESS_ERR);
+    return nullptr;
   }
   NS_ASSERTION(mValue.mColor, "mValue.mColor should never be null");
-  NS_ADDREF(*aReturn = mValue.mColor);
-  return NS_OK;
+  NS_ADDREF(mValue.mColor);
+  return mValue.mColor;
 }
 
 void
 nsROCSSPrimitiveValue::SetNumber(float aValue)
 {
     Reset();
     mValue.mFloat = aValue;
     mType = CSS_NUMBER;
--- a/layout/style/nsROCSSPrimitiveValue.h
+++ b/layout/style/nsROCSSPrimitiveValue.h
@@ -3,41 +3,68 @@
  * 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/. */
 
 /* DOM object representing values in DOM computed style */
 
 #ifndef nsROCSSPrimitiveValue_h___
 #define nsROCSSPrimitiveValue_h___
 
+#include "nsIDOMCSSValue.h"
 #include "nsIDOMCSSPrimitiveValue.h"
+#include "nsCSSKeywords.h"
+#include "CSSValue.h"
+#include "nsAutoPtr.h"
 #include "nsCoord.h"
-#include "nsCSSKeywords.h"
+#include "nsWrapperCache.h"
 
 class nsIURI;
+class nsComputedDOMStyle;
 class nsDOMCSSRGBColor;
 
 /**
  * Read-only CSS primitive value - a DOM object representing values in DOM
  * computed style.
  */
-class nsROCSSPrimitiveValue : public nsIDOMCSSPrimitiveValue
+class nsROCSSPrimitiveValue MOZ_FINAL : public mozilla::dom::CSSValue,
+  public nsIDOMCSSPrimitiveValue
 {
 public:
-  NS_DECL_ISUPPORTS
+  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
+  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsROCSSPrimitiveValue, mozilla::dom::CSSValue)
 
   // nsIDOMCSSPrimitiveValue
   NS_DECL_NSIDOMCSSPRIMITIVEVALUE
 
   // nsIDOMCSSValue
   NS_DECL_NSIDOMCSSVALUE
 
+  // CSSValue
+  virtual void GetCssText(nsString& aText, mozilla::ErrorResult& aRv) MOZ_OVERRIDE MOZ_FINAL;
+  virtual void SetCssText(const nsAString& aText, mozilla::ErrorResult& aRv) MOZ_OVERRIDE MOZ_FINAL;
+  virtual uint16_t CssValueType() const MOZ_OVERRIDE MOZ_FINAL;
+
+  // CSSPrimitiveValue
+  uint16_t PrimitiveType()
+  {
+    return mType;
+  }
+  void SetFloatValue(uint16_t aUnitType, float aValue,
+                     mozilla::ErrorResult& aRv);
+  float GetFloatValue(uint16_t aUnitType, mozilla::ErrorResult& aRv);
+  void GetStringValue(nsString& aString, mozilla::ErrorResult& aRv);
+  void SetStringValue(uint16_t aUnitType, const nsAString& aString,
+                      mozilla::ErrorResult& aRv);
+  already_AddRefed<nsIDOMCounter> GetCounterValue(mozilla::ErrorResult& aRv);
+  already_AddRefed<nsIDOMRect> GetRectValue(mozilla::ErrorResult& aRv);
+  already_AddRefed<nsIDOMRGBColor> GetRGBColorValue(mozilla::ErrorResult& aRv);
+
   // nsROCSSPrimitiveValue
   nsROCSSPrimitiveValue();
-  virtual ~nsROCSSPrimitiveValue();
+  ~nsROCSSPrimitiveValue();
 
   void SetNumber(float aValue);
   void SetNumber(int32_t aValue);
   void SetNumber(uint32_t aValue);
   void SetPercent(float aValue);
   void SetAppUnits(nscoord aValue);
   void SetAppUnits(float aValue);
   void SetIdent(nsCSSKeyword aKeyword);
@@ -46,16 +73,23 @@ public:
   // FIXME: CSS_STRING should imply a string with "" and a need for escaping.
   void SetString(const nsAString& aString, uint16_t aType = CSS_STRING);
   void SetURI(nsIURI *aURI);
   void SetColor(nsDOMCSSRGBColor* aColor);
   void SetRect(nsIDOMRect* aRect);
   void SetTime(float aValue);
   void Reset();
 
+  nsISupports* GetParentObject() const
+  {
+    return nullptr;
+  }
+
+  virtual JSObject *WrapObject(JSContext *cx, JSObject *scope, bool *triedToWrap);
+
 private:
   uint16_t mType;
 
   union {
     nscoord         mAppUnits;
     float           mFloat;
     nsDOMCSSRGBColor* mColor;
     nsIDOMRect*     mRect;
--- a/layout/style/test/Makefile.in
+++ b/layout/style/test/Makefile.in
@@ -82,16 +82,17 @@ MOCHITEST_FILES =	test_acid3_test46.html
 		test_bug657143.html \
 		test_bug664955.html \
 		test_bug667520.html \
 		test_bug645998.html \
 		file_bug645998-1.css \
 		file_bug645998-2.css \
 		test_bug716226.html \
 		test_bug765590.html \
+		test_bug798567.html \
 		test_cascade.html \
 		test_ch_ex_no_infloops.html \
 		test_compute_data_with_start_struct.html \
 		test_computed_style.html \
 		test_computed_style_no_pseudo.html \
 		test_condition_text.html \
 		test_condition_text_assignment.html \
 		test_default_computed_style.html \
new file mode 100644
--- /dev/null
+++ b/layout/style/test/test_bug798567.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=798567
+-->
+<head>
+  <title>Test for Bug 798567</title>
+  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+</head>
+<body>
+  <div id="some_div"  style="opacity: 0.5">bar</div>
+  <div style="cursor: crosshair" id="div_cursor">foobar</div>
+  <script type="application/javascript">
+    var elm = document.getElementById("some_div");
+    var cs = getComputedStyle(elm);
+    var cssValue = cs.getPropertyCSSValue("opacity");
+    is(cssValue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER), 0.5, "wrong opacity of some_div");
+
+    elm = document.getElementById("div_cursor");
+    cs = getComputedStyle(elm);
+    cssValue = cs.getPropertyCSSValue("cursor");
+    ok(cssValue[0], "element with set cursor should have a a computed style");
+  </script>
+</body>
+</html>