From eb5c3b0f3a7327d7dc94ab9dc58c89ac385d9b46 Mon Sep 17 00:00:00 2001 From: Cameron McCormack Date: Thu, 11 Jan 2018 16:17:57 +0800 Subject: [PATCH] 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 | 1 - dom/interfaces/base/domstubs.idl | 1 - dom/interfaces/css/moz.build | 1 - .../css/nsIDOMCSSPrimitiveValue.idl | 2 -- dom/interfaces/css/nsIDOMCounter.idl | 14 ------------- dom/webidl/CSSPrimitiveValue.webidl | 4 +--- layout/style/nsROCSSPrimitiveValue.cpp | 20 ++++++------------- layout/style/nsROCSSPrimitiveValue.h | 2 +- 8 files changed, 8 insertions(+), 37 deletions(-) delete mode 100644 dom/interfaces/css/nsIDOMCounter.idl diff --git a/dom/bindings/Bindings.conf b/dom/bindings/Bindings.conf index 9a5e3ba5e905..e29fd93bc777 100644 --- a/dom/bindings/Bindings.conf +++ b/dom/bindings/Bindings.conf @@ -1724,7 +1724,6 @@ def addExternalIface(iface, nativeType=None, headerFile=None, 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') diff --git a/dom/interfaces/base/domstubs.idl b/dom/interfaces/base/domstubs.idl index 89ec1b593595..98832a62aba2 100644 --- a/dom/interfaces/base/domstubs.idl +++ b/dom/interfaces/base/domstubs.idl @@ -60,7 +60,6 @@ interface nsIDOMHTMLHeadElement; interface nsIDOMCSSValue; interface nsIDOMCSSPrimitiveValue; interface nsIDOMCSSStyleDeclaration; -interface nsIDOMCounter; interface nsIDOMRect; // Range diff --git a/dom/interfaces/css/moz.build b/dom/interfaces/css/moz.build index d43c2cf8d362..07504580fb3b 100644 --- a/dom/interfaces/css/moz.build +++ b/dom/interfaces/css/moz.build @@ -8,7 +8,6 @@ with Files("**"): BUG_COMPONENT = ("Core", "DOM: CSS Object Model") XPIDL_SOURCES += [ - 'nsIDOMCounter.idl', 'nsIDOMCSSPrimitiveValue.idl', 'nsIDOMCSSStyleDeclaration.idl', 'nsIDOMCSSValue.idl', diff --git a/dom/interfaces/css/nsIDOMCSSPrimitiveValue.idl b/dom/interfaces/css/nsIDOMCSSPrimitiveValue.idl index 15253850595c..de6570f4f6a7 100644 --- a/dom/interfaces/css/nsIDOMCSSPrimitiveValue.idl +++ b/dom/interfaces/css/nsIDOMCSSPrimitiveValue.idl @@ -55,8 +55,6 @@ interface nsIDOMCSSPrimitiveValue : nsIDOMCSSValue raises(DOMException); DOMString getStringValue() raises(DOMException); - nsIDOMCounter getCounterValue() - raises(DOMException); nsIDOMRect getRectValue() raises(DOMException); }; diff --git a/dom/interfaces/css/nsIDOMCounter.idl b/dom/interfaces/css/nsIDOMCounter.idl deleted file mode 100644 index b5c408fbe492..000000000000 --- 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; -}; diff --git a/dom/webidl/CSSPrimitiveValue.webidl b/dom/webidl/CSSPrimitiveValue.webidl index 87141fee23fa..be979adcfef1 100644 --- a/dom/webidl/CSSPrimitiveValue.webidl +++ b/dom/webidl/CSSPrimitiveValue.webidl @@ -4,8 +4,6 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ -interface Counter; - interface CSSPrimitiveValue : CSSValue { // UnitTypes @@ -48,7 +46,7 @@ interface CSSPrimitiveValue : CSSValue { [Throws] DOMString getStringValue(); [Throws] - Counter getCounterValue(); + void getCounterValue(); // always throws [Throws] Rect getRectValue(); [Throws] diff --git a/layout/style/nsROCSSPrimitiveValue.cpp b/layout/style/nsROCSSPrimitiveValue.cpp index 2721bd609d59..5972b38d2afa 100644 --- a/layout/style/nsROCSSPrimitiveValue.cpp +++ b/layout/style/nsROCSSPrimitiveValue.cpp @@ -475,26 +475,18 @@ nsROCSSPrimitiveValue::GetStringValue(nsAString& aReturn) 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 -nsROCSSPrimitiveValue::GetCounterValue(ErrorResult& aRv) -{ - aRv.Throw(NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR); - return nullptr; -} - nsDOMCSSRect* nsROCSSPrimitiveValue::GetRectValue(ErrorResult& aRv) { diff --git a/layout/style/nsROCSSPrimitiveValue.h b/layout/style/nsROCSSPrimitiveValue.h index ded1c5b9232d..cff9b10f36c4 100644 --- a/layout/style/nsROCSSPrimitiveValue.h +++ b/layout/style/nsROCSSPrimitiveValue.h @@ -72,7 +72,7 @@ public: void GetStringValue(nsString& aString, mozilla::ErrorResult& aRv); void SetStringValue(uint16_t aUnitType, const nsAString& aString, mozilla::ErrorResult& aRv); - already_AddRefed GetCounterValue(mozilla::ErrorResult& aRv); + void GetCounterValue(mozilla::ErrorResult& aRv); nsDOMCSSRect* GetRectValue(mozilla::ErrorResult& aRv); nsDOMCSSRGBColor *GetRGBColorValue(mozilla::ErrorResult& aRv);