Bug 1427512 - Part 23: Remove nsIDOMCounter. r=xidorn,bz draft
authorCameron McCormack <cam@mcc.id.au>
Tue, 02 Jan 2018 18:54:36 +1100
changeset 717724 576601ef0861b2f6f8bf2cdda992ae0b9768f527
parent 717723 82e05be9dd3995205ea5543ccb8d4e92b9d1817f
child 717725 1d6e33efe9fb3efe6c34aedf735f033d4bdef5b0
push id94746
push userbmo:cam@mcc.id.au
push dateTue, 09 Jan 2018 10:21:54 +0000
reviewersxidorn, bz
bugs1427512
milestone59.0a1
Bug 1427512 - Part 23: Remove nsIDOMCounter. r=xidorn,bz It's not actually implemented. Since we never return any Counter object, and to avoid exposing a Counter Web IDL interface object, we declare getCounterValue() to return void (since it always throws). MozReview-Commit-ID: JGvYtPmyeSp
dom/bindings/Bindings.conf
dom/interfaces/base/domstubs.idl
dom/interfaces/css/moz.build
dom/interfaces/css/nsIDOMCSSPrimitiveValue.idl
dom/interfaces/css/nsIDOMCounter.idl
dom/webidl/CSSPrimitiveValue.webidl
layout/style/nsROCSSPrimitiveValue.cpp
layout/style/nsROCSSPrimitiveValue.h
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -1719,17 +1719,16 @@ def addExternalIface(iface, nativeType=N
     if not headerFile is None:
         domInterface['headerFile'] = headerFile
     domInterface['notflattened'] = notflattened
     DOMInterfaces[iface] = domInterface
 
 addExternalIface('ApplicationCache', nativeType='nsIDOMOfflineResourceList')
 addExternalIface('Cookie', nativeType='nsICookie2',
                  headerFile='nsICookie2.h', notflattened=True)
-addExternalIface('Counter')
 addExternalIface('RTCDataChannel', nativeType='nsIDOMDataChannel')
 addExternalIface('HitRegionOptions', nativeType='nsISupports')
 addExternalIface('imgINotificationObserver', nativeType='imgINotificationObserver')
 addExternalIface('imgIRequest', nativeType='imgIRequest', notflattened=True)
 addExternalIface('LoadContext', nativeType='nsILoadContext', notflattened=True)
 addExternalIface('LoadInfo', nativeType='nsILoadInfo',
                  headerFile='nsILoadInfo.h', notflattened=True)
 addExternalIface('MenuBuilder', nativeType='nsIMenuBuilder', notflattened=True)
--- a/dom/interfaces/base/domstubs.idl
+++ b/dom/interfaces/base/domstubs.idl
@@ -55,16 +55,15 @@ interface nsIDOMEventListener;
 interface nsIDOMHTMLElement;
 interface nsIDOMHTMLFormElement;
 interface nsIDOMHTMLHeadElement;
 
 // CSS
 interface nsIDOMCSSValue;
 interface nsIDOMCSSPrimitiveValue;
 interface nsIDOMCSSStyleDeclaration;
-interface nsIDOMCounter;
 interface nsIDOMRect;
 
 // Range
 interface nsIDOMRange;
 
 // Crypto
 interface nsIDOMCrypto;
--- a/dom/interfaces/css/moz.build
+++ b/dom/interfaces/css/moz.build
@@ -3,17 +3,16 @@
 # 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/.
 
 with Files("**"):
     BUG_COMPONENT = ("Core", "DOM: CSS Object Model")
 
 XPIDL_SOURCES += [
-    'nsIDOMCounter.idl',
     'nsIDOMCSSPrimitiveValue.idl',
     'nsIDOMCSSStyleDeclaration.idl',
     'nsIDOMCSSValue.idl',
     'nsIDOMCSSValueList.idl',
     'nsIDOMRect.idl',
 ]
 
 XPIDL_MODULE = 'dom_css'
--- a/dom/interfaces/css/nsIDOMCSSPrimitiveValue.idl
+++ b/dom/interfaces/css/nsIDOMCSSPrimitiveValue.idl
@@ -50,13 +50,11 @@ interface nsIDOMCSSPrimitiveValue : nsID
                                         raises(DOMException);
   float              getFloatValue(in unsigned short unitType)
                                         raises(DOMException);
   void               setStringValue(in unsigned short stringType, 
                                     in DOMString stringValue)
                                         raises(DOMException);
   DOMString          getStringValue()
                                         raises(DOMException);
-  nsIDOMCounter      getCounterValue()
-                                        raises(DOMException);
   nsIDOMRect         getRectValue()
                                         raises(DOMException);
 };
deleted file mode 100644
--- a/dom/interfaces/css/nsIDOMCounter.idl
+++ /dev/null
@@ -1,14 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "domstubs.idl"
-
-[scriptable, uuid(31adb439-0055-402d-9b1d-d5ca94f3f55b)]
-interface nsIDOMCounter : nsISupports
-{
-  readonly attribute DOMString        identifier;
-  readonly attribute DOMString        listStyle;
-  readonly attribute DOMString        separator;
-};
--- a/dom/webidl/CSSPrimitiveValue.webidl
+++ b/dom/webidl/CSSPrimitiveValue.webidl
@@ -1,16 +1,14 @@
 /* -*- 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 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;
@@ -43,14 +41,14 @@ interface CSSPrimitiveValue : CSSValue {
   [Throws]
   float              getFloatValue(unsigned short unitType);
   [Throws]
   void               setStringValue(unsigned short stringType,
                                     DOMString stringValue);
   [Throws]
   DOMString          getStringValue();
   [Throws]
-  Counter            getCounterValue();
+  void               getCounterValue();  // always throws
   [Throws]
   Rect               getRectValue();
   [Throws]
   RGBColor           getRGBColorValue();
 };
--- a/layout/style/nsROCSSPrimitiveValue.cpp
+++ b/layout/style/nsROCSSPrimitiveValue.cpp
@@ -471,35 +471,27 @@ nsROCSSPrimitiveValue::GetStringValue(ns
     default:
       aReturn.Truncate();
       return NS_ERROR_DOM_INVALID_ACCESS_ERR;
   }
   return NS_OK;
 }
 
 void
+nsROCSSPrimitiveValue::GetCounterValue(ErrorResult& aRv)
+{
+  aRv.Throw(NS_ERROR_NOT_IMPLEMENTED);
+}
+
+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;
-}
-
 nsDOMCSSRect*
 nsROCSSPrimitiveValue::GetRectValue(ErrorResult& aRv)
 {
   if (mType != CSS_RECT) {
     aRv.Throw(NS_ERROR_DOM_INVALID_ACCESS_ERR);
     return nullptr;
   }
 
--- a/layout/style/nsROCSSPrimitiveValue.h
+++ b/layout/style/nsROCSSPrimitiveValue.h
@@ -67,17 +67,17 @@ public:
     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);
+  void GetCounterValue(mozilla::ErrorResult& aRv);
   nsDOMCSSRect* GetRectValue(mozilla::ErrorResult& aRv);
   nsDOMCSSRGBColor *GetRGBColorValue(mozilla::ErrorResult& aRv);
 
   // nsROCSSPrimitiveValue
   nsROCSSPrimitiveValue();
 
   void SetNumber(float aValue);
   void SetNumber(int32_t aValue);