Bug 1427512 - Part 19: Remove nsIDOMCSSRuleList. r=xidorn,jryans
authorCameron McCormack <cam@mcc.id.au>
Thu, 11 Jan 2018 16:17:56 +0800
changeset 453073 2d98dcab1d2be4820fa5859e4906b96c987d66ad
parent 453072 f8f26554780fec9cf4f5a61c6511aa226de38e7d
child 453074 8341390e084befdcc8805361b7f5a0001fc5721b
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersxidorn, jryans
bugs1427512
milestone59.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 1427512 - Part 19: Remove nsIDOMCSSRuleList. r=xidorn,jryans Also remove the QI to CSSRuleList, since it seems to be unused. MozReview-Commit-ID: 3mp7qu6hbeU
devtools/server/actors/object.js
dom/interfaces/base/domstubs.idl
dom/interfaces/css/moz.build
dom/interfaces/css/nsIDOMCSSRuleList.idl
layout/style/CSSRuleList.cpp
layout/style/CSSRuleList.h
layout/style/GroupRule.cpp
layout/style/GroupRule.h
--- a/devtools/server/actors/object.js
+++ b/devtools/server/actors/object.js
@@ -1761,18 +1761,18 @@ DebuggerServer.ObjectActorPreviewers.Obj
 
     return true;
   },
 
   function ArrayLike({obj, hooks}, grip, rawObj) {
     if (isWorker || !rawObj ||
         obj.class != "DOMStringList" &&
         obj.class != "DOMTokenList" &&
+        obj.class != "CSSRuleList" &&
         !(rawObj instanceof Ci.nsIDOMMozNamedAttrMap ||
-          rawObj instanceof Ci.nsIDOMCSSRuleList ||
           rawObj instanceof Ci.nsIDOMCSSValueList ||
           rawObj instanceof Ci.nsIDOMFileList ||
           rawObj instanceof Ci.nsIDOMMediaList ||
           rawObj instanceof Ci.nsIDOMNodeList ||
           rawObj instanceof Ci.nsIDOMStyleSheetList)) {
       return false;
     }
 
--- a/dom/interfaces/base/domstubs.idl
+++ b/dom/interfaces/base/domstubs.idl
@@ -59,17 +59,16 @@ interface nsIDOMEventListener;
 // HTML
 interface nsIDOMHTMLElement;
 interface nsIDOMHTMLFormElement;
 interface nsIDOMHTMLHeadElement;
 
 // CSS
 interface nsIDOMCSSValue;
 interface nsIDOMCSSPrimitiveValue;
-interface nsIDOMCSSRuleList;
 interface nsIDOMCSSStyleDeclaration;
 interface nsIDOMCounter;
 interface nsIDOMRect;
 
 // Range
 interface nsIDOMRange;
 
 // Crypto
--- a/dom/interfaces/css/moz.build
+++ b/dom/interfaces/css/moz.build
@@ -5,17 +5,16 @@
 # 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',
-    'nsIDOMCSSRuleList.idl',
     'nsIDOMCSSStyleDeclaration.idl',
     'nsIDOMCSSValue.idl',
     'nsIDOMCSSValueList.idl',
     'nsIDOMRect.idl',
 ]
 
 XPIDL_MODULE = 'dom_css'
 
deleted file mode 100644
--- a/dom/interfaces/css/nsIDOMCSSRuleList.idl
+++ /dev/null
@@ -1,20 +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"
-
-/**
- * The nsIDOMCSSRuleList interface is a datatype for a list of CSS
- * style rules in the Document Object Model.
- *
- * For more information on this interface please see
- * http://www.w3.org/TR/DOM-Level-2-Style
- */
-
-[scriptable, uuid(a6cf90c0-15b3-11d2-932e-00805f8add32)]
-interface nsIDOMCSSRuleList : nsISupports
-{
-  readonly attribute unsigned long    length;
-};
--- a/layout/style/CSSRuleList.cpp
+++ b/layout/style/CSSRuleList.cpp
@@ -11,18 +11,16 @@
 namespace mozilla {
 namespace dom {
 
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(CSSRuleList)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(CSSRuleList)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
-  NS_INTERFACE_MAP_ENTRY(CSSRuleList)
-  NS_INTERFACE_MAP_ENTRY(nsIDOMCSSRuleList)
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(CSSRuleList)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(CSSRuleList)
 
 /* virtual */ JSObject*
 CSSRuleList::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
--- a/layout/style/CSSRuleList.h
+++ b/layout/style/CSSRuleList.h
@@ -4,58 +4,41 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_dom_CSSRuleList_h
 #define mozilla_dom_CSSRuleList_h
 
 #include "mozilla/StyleSheetInlines.h"
 #include "mozilla/css/Rule.h"
-#include "nsIDOMCSSRuleList.h"
 #include "nsWrapperCache.h"
 
 namespace mozilla {
 namespace dom {
 
-// IID for the CSSRuleList interface
-#define NS_ICSSRULELIST_IID \
-{ 0x56ac8d1c, 0xc1ed, 0x45fe, \
-  { 0x9a, 0x4d, 0x3a, 0xdc, 0xf9, 0xd1, 0xb9, 0x3f } }
-
-class CSSRuleList : public nsIDOMCSSRuleList
+class CSSRuleList : public nsISupports
                   , public nsWrapperCache
 {
 public:
-  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICSSRULELIST_IID)
-
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(CSSRuleList)
 
   virtual StyleSheet* GetParentObject() = 0;
   virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override final;
 
-  NS_IMETHOD
-  GetLength(uint32_t* aLength) override final
-  {
-    *aLength = Length();
-    return NS_OK;
-  }
-
   // WebIDL API
   css::Rule* Item(uint32_t aIndex)
   {
     bool unused;
     return IndexedGetter(aIndex, unused);
   }
 
   virtual css::Rule* IndexedGetter(uint32_t aIndex, bool& aFound) = 0;
   virtual uint32_t Length() = 0;
 
 protected:
   virtual ~CSSRuleList() {}
 };
 
-NS_DEFINE_STATIC_IID_ACCESSOR(CSSRuleList, NS_ICSSRULELIST_IID)
-
 } // namespace dom
 } // namespace mozilla
 
 #endif /* mozilla_dom_CSSRuleList_h */
--- a/layout/style/GroupRule.cpp
+++ b/layout/style/GroupRule.cpp
@@ -339,37 +339,22 @@ GroupRule::AppendRulesToCssText(nsAStrin
     rule->GetCssText(cssText);
     aCssText.AppendLiteral("  ");
     aCssText.Append(cssText);
     aCssText.Append('\n');
   }
   aCssText.Append('}');
 }
 
-nsresult
-GroupRule::GetCssRules(nsIDOMCSSRuleList* *aRuleList)
-{
-  NS_ADDREF(*aRuleList = CssRules());
-  return NS_OK;
-}
-
 CSSRuleList*
 GroupRule::CssRules()
 {
   return CALL_INNER(mInner, CssRules(this));
 }
 
-nsresult
-GroupRule::InsertRule(const nsAString & aRule, uint32_t aIndex, uint32_t* _retval)
-{
-  ErrorResult rv;
-  *_retval = InsertRule(aRule, aIndex, rv);
-  return rv.StealNSResult();
-}
-
 uint32_t
 GroupRule::InsertRule(const nsAString& aRule, uint32_t aIndex, ErrorResult& aRv)
 {
   StyleSheet* sheet = GetStyleSheet();
   if (NS_WARN_IF(!sheet)) {
     aRv.Throw(NS_ERROR_FAILURE);
     return 0;
   }
@@ -385,24 +370,16 @@ GroupRule::InsertRule(const nsAString& a
   nsresult rv = sheet->InsertRuleIntoGroup(aRule, this, aIndex);
   if (NS_FAILED(rv)) {
     aRv.Throw(rv);
     return 0;
   }
   return aIndex;
 }
 
-nsresult
-GroupRule::DeleteRule(uint32_t aIndex)
-{
-  ErrorResult rv;
-  DeleteRule(aIndex, rv);
-  return rv.StealNSResult();
-}
-
 void
 GroupRule::DeleteRule(uint32_t aIndex, ErrorResult& aRv)
 {
   StyleSheet* sheet = GetStyleSheet();
   if (NS_WARN_IF(!sheet)) {
     aRv.Throw(NS_ERROR_FAILURE);
     return;
   }
--- a/layout/style/GroupRule.h
+++ b/layout/style/GroupRule.h
@@ -198,22 +198,16 @@ public:
   dom::CSSRuleList* CssRules();
   uint32_t InsertRule(const nsAString& aRule, uint32_t aIndex,
                       ErrorResult& aRv);
   void DeleteRule(uint32_t aIndex, ErrorResult& aRv);
 
 protected:
   void AppendRulesToCssText(nsAString& aCssText) const;
 
-  // to implement methods on nsIDOMCSSGroupingRule
-  nsresult GetCssRules(nsIDOMCSSRuleList* *aRuleList);
-  nsresult InsertRule(const nsAString & aRule, uint32_t aIndex,
-                      uint32_t* _retval);
-  nsresult DeleteRule(uint32_t aIndex);
-
   // Must only be called if this is a Gecko GroupRule.
   IncrementalClearCOMRuleArray& GeckoRules() {
     return mInner.as<GeckoGroupRuleRules>().mRules;
   }
   const IncrementalClearCOMRuleArray& GeckoRules() const {
     return mInner.as<GeckoGroupRuleRules>().mRules;
   }