Bug 995901 - Rename nsICSSRuleList to mozilla::dom::CSSRuleList. r=bz
authorGiovanni Sferro <agi.novanta@gmail.com>
Mon, 09 Jun 2014 22:11:00 -0400
changeset 187918 ddc9fdfcc8b6dd6279f3ef15734dc9057be1a5b0
parent 187917 1737dfde961b4aac5a801d171d98a78abb00aa4e
child 187919 ffc3c599d28e9aae697207881dedbd9984d54d89
push id44698
push userryanvm@gmail.com
push dateTue, 10 Jun 2014 17:53:48 +0000
treeherdermozilla-inbound@ddc9fdfcc8b6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs995901
milestone33.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 995901 - Rename nsICSSRuleList to mozilla::dom::CSSRuleList. r=bz
dom/bindings/Bindings.conf
layout/style/CSSRuleList.cpp
layout/style/CSSRuleList.h
layout/style/moz.build
layout/style/nsCSSRules.cpp
layout/style/nsCSSStyleSheet.cpp
layout/style/nsCSSStyleSheet.h
layout/style/nsICSSRuleList.cpp
layout/style/nsICSSRuleList.h
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -253,20 +253,16 @@ DOMInterfaces = {
     'nativeType': 'nsDOMCSSDeclaration'
 },
 
 'CSSPrimitiveValue': {
     'nativeType': 'nsROCSSPrimitiveValue',
     'resultNotAddRefed': ['getRGBColorValue', 'getRectValue']
 },
 
-'CSSRuleList': {
-    'nativeType': 'nsICSSRuleList',
-},
-
 'CSSStyleDeclaration': {
     'nativeType': 'nsICSSDeclaration'
 },
 
 'CSSStyleSheet': {
     'nativeType': 'nsCSSStyleSheet',
     'binaryNames': { 'ownerRule': 'DOMOwnerRule' },
 },
rename from layout/style/nsICSSRuleList.cpp
rename to layout/style/CSSRuleList.cpp
--- a/layout/style/nsICSSRuleList.cpp
+++ b/layout/style/CSSRuleList.cpp
@@ -1,30 +1,34 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=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/. */
 
-#include "nsICSSRuleList.h"
+#include "mozilla/dom/CSSRuleList.h"
 
 #include "mozilla/dom/CSSRuleListBinding.h"
 
-using namespace mozilla;
+namespace mozilla {
+namespace dom {
 
 
-NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(nsICSSRuleList)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(CSSRuleList)
 
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsICSSRuleList)
+NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(CSSRuleList)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
-  NS_INTERFACE_MAP_ENTRY(nsICSSRuleList)
+  NS_INTERFACE_MAP_ENTRY(CSSRuleList)
   NS_INTERFACE_MAP_ENTRY(nsIDOMCSSRuleList)
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
-NS_IMPL_CYCLE_COLLECTING_ADDREF(nsICSSRuleList)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(nsICSSRuleList)
+NS_IMPL_CYCLE_COLLECTING_ADDREF(CSSRuleList)
+NS_IMPL_CYCLE_COLLECTING_RELEASE(CSSRuleList)
 
 /* virtual */ JSObject*
-nsICSSRuleList::WrapObject(JSContext* aCx)
+CSSRuleList::WrapObject(JSContext* aCx)
 {
-  return dom::CSSRuleListBinding::Wrap(aCx, this);
+  return CSSRuleListBinding::Wrap(aCx, this);
 }
+
+} // namespace dom
+} // namespace mozilla
rename from layout/style/nsICSSRuleList.h
rename to layout/style/CSSRuleList.h
--- a/layout/style/nsICSSRuleList.h
+++ b/layout/style/CSSRuleList.h
@@ -1,41 +1,44 @@
 /* -*- Mode: C++; 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/. */
 
-#ifndef nsICSSRuleList_h
-#define nsICSSRuleList_h
+#ifndef mozilla_dom_CSSRuleList_h
+#define mozilla_dom_CSSRuleList_h
 
 #include "nsIDOMCSSRule.h"
 #include "nsIDOMCSSRuleList.h"
 #include "nsWrapperCache.h"
 
 class nsCSSStyleSheet;
 
-// IID for the nsICSSRuleList interface
+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 nsICSSRuleList : public nsIDOMCSSRuleList
-                     , public nsWrapperCache
+class CSSRuleList : public nsIDOMCSSRuleList
+                  , public nsWrapperCache
 {
 public:
-  nsICSSRuleList()
+  CSSRuleList()
   {
     SetIsDOMBinding();
   }
-  virtual ~nsICSSRuleList() {}
+  virtual ~CSSRuleList() {}
 
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICSSRULELIST_IID)
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsICSSRuleList)
+  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(CSSRuleList)
 
   virtual nsCSSStyleSheet* GetParentObject() = 0;
   virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE MOZ_FINAL;
 
   NS_IMETHOD
   GetLength(uint32_t* aLength) MOZ_OVERRIDE MOZ_FINAL
   {
     *aLength = Length();
@@ -54,11 +57,14 @@ public:
     bool unused;
     return IndexedGetter(aIndex, unused);
   }
 
   virtual nsIDOMCSSRule* IndexedGetter(uint32_t aIndex, bool& aFound) = 0;
   virtual uint32_t Length() = 0;
 };
 
-NS_DEFINE_STATIC_IID_ACCESSOR(nsICSSRuleList, NS_ICSSRULELIST_IID)
+NS_DEFINE_STATIC_IID_ACCESSOR(CSSRuleList, NS_ICSSRULELIST_IID)
 
-#endif /* nsICSSRuleList_h */
+} // namespace dom
+} // namespace mozilla
+
+#endif /* mozilla_dom_CSSRuleList_h */
--- a/layout/style/moz.build
+++ b/layout/style/moz.build
@@ -30,17 +30,16 @@ EXPORTS += [
     'nsCSSStyleSheet.h',
     'nsCSSValue.h',
     'nsDOMCSSAttrDeclaration.h',
     'nsDOMCSSDeclaration.h',
     'nsDOMCSSRGBColor.h',
     'nsICSSDeclaration.h',
     'nsICSSLoaderObserver.h',
     'nsICSSPseudoComparator.h',
-    'nsICSSRuleList.h',
     'nsICSSStyleRuleDOMWrapper.h',
     'nsIStyleRule.h',
     'nsIStyleRuleProcessor.h',
     'nsIStyleSheet.h',
     'nsLayoutStylesheetCache.h',
     'nsRuleData.h',
     'nsRuleNode.h',
     'nsRuleProcessorData.h',
@@ -60,16 +59,17 @@ EXPORTS += [
 EXPORTS.mozilla += [
     'CSSVariableDeclarations.h',
     'CSSVariableResolver.h',
     'CSSVariableValues.h',
 ]
 
 EXPORTS.mozilla.dom += [
     'CSS.h',
+    'CSSRuleList.h',
     'CSSValue.h',
     'MediaQueryList.h',
 ]
 
 EXPORTS.mozilla.css += [
     'Declaration.h',
     'ErrorReporter.h',
     'GroupRule.h',
@@ -79,16 +79,17 @@ EXPORTS.mozilla.css += [
     'NameSpaceRule.h',
     'Rule.h',
     'StyleRule.h',
 ]
 
 UNIFIED_SOURCES += [
     'AnimationCommon.cpp',
     'CSS.cpp',
+    'CSSRuleList.cpp',
     'CSSVariableDeclarations.cpp',
     'CSSVariableResolver.cpp',
     'CSSVariableValues.cpp',
     'Declaration.cpp',
     'ErrorReporter.cpp',
     'ImageLoader.cpp',
     'Loader.cpp',
     'MediaQueryList.cpp',
@@ -107,17 +108,16 @@ UNIFIED_SOURCES += [
     'nsCSSValue.cpp',
     'nsDOMCSSAttrDeclaration.cpp',
     'nsDOMCSSDeclaration.cpp',
     'nsDOMCSSRect.cpp',
     'nsDOMCSSRGBColor.cpp',
     'nsDOMCSSValueList.cpp',
     'nsHTMLCSSStyleSheet.cpp',
     'nsHTMLStyleSheet.cpp',
-    'nsICSSRuleList.cpp',
     'nsLayoutStylesheetCache.cpp',
     'nsMediaFeatures.cpp',
     'nsNthIndexCache.cpp',
     'nsROCSSPrimitiveValue.cpp',
     'nsRuleData.cpp',
     'nsRuleNode.cpp',
     'nsStyleAnimation.cpp',
     'nsStyleContext.cpp',
--- a/layout/style/nsCSSRules.cpp
+++ b/layout/style/nsCSSRules.cpp
@@ -17,17 +17,17 @@
 #include "nsIAtom.h"
 
 #include "nsCSSProps.h"
 #include "nsCSSStyleSheet.h"
 
 #include "nsCOMPtr.h"
 #include "nsIDOMCSSStyleSheet.h"
 #include "nsIMediaList.h"
-#include "nsICSSRuleList.h"
+#include "mozilla/dom/CSSRuleList.h"
 #include "nsIDocument.h"
 #include "nsPresContext.h"
 
 #include "nsContentUtils.h"
 #include "nsError.h"
 #include "nsStyleUtil.h"
 #include "mozilla/css/Declaration.h"
 #include "nsCSSParser.h"
@@ -125,17 +125,17 @@ Rule::SizeOfCOMArrayElementIncludingThis
 {
   return aElement->SizeOfIncludingThis(aMallocSizeOf);
 }
 
 // -------------------------------
 // Style Rule List for group rules
 //
 
-class GroupRuleRuleList MOZ_FINAL : public nsICSSRuleList
+class GroupRuleRuleList MOZ_FINAL : public dom::CSSRuleList
 {
 public:
   GroupRuleRuleList(GroupRule *aGroupRule);
 
   virtual nsCSSStyleSheet* GetParentObject() MOZ_OVERRIDE;
 
   virtual nsIDOMCSSRule*
   IndexedGetter(uint32_t aIndex, bool& aFound) MOZ_OVERRIDE;
--- a/layout/style/nsCSSStyleSheet.cpp
+++ b/layout/style/nsCSSStyleSheet.cpp
@@ -19,17 +19,17 @@
 #include "mozilla/css/ImportRule.h"
 #include "nsIMediaList.h"
 #include "nsIDocument.h"
 #include "nsPresContext.h"
 #include "nsGkAtoms.h"
 #include "nsString.h"
 #include "nsTArray.h"
 #include "nsIDOMCSSStyleSheet.h"
-#include "nsICSSRuleList.h"
+#include "mozilla/dom/CSSRuleList.h"
 #include "nsIDOMMediaList.h"
 #include "nsIDOMNode.h"
 #include "nsError.h"
 #include "nsCSSParser.h"
 #include "mozilla/css/Loader.h"
 #include "nsICSSLoaderObserver.h"
 #include "nsNameSpaceManager.h"
 #include "nsXMLNameSpaceMap.h"
@@ -46,17 +46,17 @@
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 
 // -------------------------------
 // Style Rule List for the DOM
 //
-class CSSRuleListImpl : public nsICSSRuleList
+class CSSRuleListImpl : public CSSRuleList
 {
 public:
   CSSRuleListImpl(nsCSSStyleSheet *aStyleSheet);
 
   virtual nsCSSStyleSheet* GetParentObject() MOZ_OVERRIDE;
 
   virtual nsIDOMCSSRule*
   IndexedGetter(uint32_t aIndex, bool& aFound) MOZ_OVERRIDE;
@@ -1764,17 +1764,17 @@ NS_IMETHODIMP
 nsCSSStyleSheet::GetCssRules(nsIDOMCSSRuleList** aCssRules)
 {
   ErrorResult rv;
   nsCOMPtr<nsIDOMCSSRuleList> rules = GetCssRules(rv);
   rules.forget(aCssRules);
   return rv.ErrorCode();
 }
 
-nsICSSRuleList*
+CSSRuleList*
 nsCSSStyleSheet::GetCssRules(ErrorResult& aRv)
 {
   // No doing this on incomplete sheets!
   if (!mInner->mComplete) {
     aRv.Throw(NS_ERROR_DOM_INVALID_ACCESS_ERR);
     return nullptr;
   }
   
--- a/layout/style/nsCSSStyleSheet.h
+++ b/layout/style/nsCSSStyleSheet.h
@@ -36,16 +36,19 @@ class nsCSSStyleSheet;
 class nsPresContext;
 
 namespace mozilla {
 namespace css {
 class Rule;
 class GroupRule;
 class ImportRule;
 }
+namespace dom {
+class CSSRuleList;
+}
 }
 
 // -------------------------------
 // CSS Style Sheet Inner Data Container
 //
 
 class nsCSSStyleSheetInner {
 public:
@@ -91,17 +94,16 @@ private:
 };
 
 
 // -------------------------------
 // CSS Style Sheet
 //
 
 class CSSRuleListImpl;
-class nsICSSRuleList;
 
 // CID for the nsCSSStyleSheet class
 // ca926f30-2a7e-477e-8467-803fb32af20a
 #define NS_CSS_STYLE_SHEET_IMPL_CID     \
 { 0xca926f30, 0x2a7e, 0x477e, \
  { 0x84, 0x67, 0x80, 0x3f, 0xb3, 0x2a, 0xf2, 0x0a } }
 
 
@@ -271,17 +273,17 @@ public:
   bool Disabled() const { return mDisabled; }
   // The XPCOM SetDisabled is fine for WebIDL
 
   // WebIDL CSSStyleSheet API
   // Can't be inline because we can't include ImportRule here.  And can't be
   // called GetOwnerRule because that would be ambiguous with the ImportRule
   // version.
   nsIDOMCSSRule* GetDOMOwnerRule() const;
-  nsICSSRuleList* GetCssRules(mozilla::ErrorResult& aRv);
+  mozilla::dom::CSSRuleList* GetCssRules(mozilla::ErrorResult& aRv);
   uint32_t InsertRule(const nsAString& aRule, uint32_t aIndex,
                       mozilla::ErrorResult& aRv) {
     uint32_t retval;
     aRv = InsertRule(aRule, aIndex, &retval);
     return retval;
   }
   void DeleteRule(uint32_t aIndex, mozilla::ErrorResult& aRv) {
     aRv = DeleteRule(aIndex);