Bug 1427512 - Part 4: Remove nsIDOMCSSConditionRule. r=xidorn
authorCameron McCormack <cam@mcc.id.au>
Thu, 11 Jan 2018 16:17:55 +0800
changeset 453058 5e4f6cdbfbbe3a2fb219c4702123f7c23fdf649f
parent 453057 b6965c0e0e562b0633a3da30958f450b9b99549e
child 453059 1084f7d6faee94c30f3f8eb792b509bd31888eac
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
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 4: Remove nsIDOMCSSConditionRule. r=xidorn MozReview-Commit-ID: GRB39ehkA4p
dom/interfaces/css/moz.build
dom/interfaces/css/nsIDOMCSSConditionRule.idl
layout/style/CSSMediaRule.cpp
layout/style/CSSMediaRule.h
layout/style/CSSMozDocumentRule.cpp
layout/style/CSSMozDocumentRule.h
layout/style/CSSSupportsRule.cpp
layout/style/CSSSupportsRule.h
layout/style/GroupRule.h
layout/style/ServoDocumentRule.cpp
layout/style/ServoDocumentRule.h
layout/style/ServoMediaRule.cpp
layout/style/ServoMediaRule.h
layout/style/ServoSupportsRule.cpp
layout/style/ServoSupportsRule.h
layout/style/nsCSSRules.cpp
layout/style/nsCSSRules.h
--- a/dom/interfaces/css/moz.build
+++ b/dom/interfaces/css/moz.build
@@ -4,17 +4,16 @@
 # 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',
-    'nsIDOMCSSConditionRule.idl',
     'nsIDOMCSSCounterStyleRule.idl',
     'nsIDOMCSSFontFaceRule.idl',
     'nsIDOMCSSFontFeatureValuesRule.idl',
     'nsIDOMCSSGroupingRule.idl',
     'nsIDOMCSSImportRule.idl',
     'nsIDOMCSSKeyframeRule.idl',
     'nsIDOMCSSKeyframesRule.idl',
     'nsIDOMCSSPageRule.idl',
deleted file mode 100644
--- a/dom/interfaces/css/nsIDOMCSSConditionRule.idl
+++ /dev/null
@@ -1,16 +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 "nsIDOMCSSGroupingRule.idl"
-
-/**
- * Interface in the CSS OM for at-rules that conditionally apply their
- * child rules.
- */
-[scriptable, uuid(44da41b2-5660-415d-8692-eae805776103)]
-interface nsIDOMCSSConditionRule : nsIDOMCSSGroupingRule
-{
-  attribute DOMString conditionText;
-};
--- a/layout/style/CSSMediaRule.cpp
+++ b/layout/style/CSSMediaRule.cpp
@@ -13,17 +13,16 @@ namespace mozilla {
 namespace dom {
 
 NS_IMPL_ADDREF_INHERITED(CSSMediaRule, css::ConditionRule)
 NS_IMPL_RELEASE_INHERITED(CSSMediaRule, css::ConditionRule)
 
 // QueryInterface implementation for CSSMediaRule
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(CSSMediaRule)
   NS_INTERFACE_MAP_ENTRY(nsIDOMCSSGroupingRule)
-  NS_INTERFACE_MAP_ENTRY(nsIDOMCSSConditionRule)
 NS_INTERFACE_MAP_END_INHERITING(css::ConditionRule)
 
 // nsIDOMCSSGroupingRule methods
 NS_IMETHODIMP
 CSSMediaRule::GetCssRules(nsIDOMCSSRuleList** aRuleList)
 {
   return GroupRule::GetCssRules(aRuleList);
 }
@@ -36,27 +35,16 @@ CSSMediaRule::InsertRule(const nsAString
 }
 
 NS_IMETHODIMP
 CSSMediaRule::DeleteRule(uint32_t aIndex)
 {
   return GroupRule::DeleteRule(aIndex);
 }
 
-void
-CSSMediaRule::SetConditionText(const nsAString& aConditionText,
-                               ErrorResult& aRv)
-{
-  nsresult rv = static_cast<nsIDOMCSSConditionRule*>(this)->
-    SetConditionText(aConditionText);
-  if (NS_FAILED(rv)) {
-    aRv.Throw(rv);
-  }
-}
-
 /* virtual */ JSObject*
 CSSMediaRule::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
   return CSSMediaRuleBinding::Wrap(aCx, this, aGivenProto);
 }
 
 } // namespace dom
 } // namespace mozilla
--- a/layout/style/CSSMediaRule.h
+++ b/layout/style/CSSMediaRule.h
@@ -3,47 +3,41 @@
 /* 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 mozilla_dom_CSSMediaRule_h
 #define mozilla_dom_CSSMediaRule_h
 
 #include "mozilla/css/GroupRule.h"
-#include "nsIDOMCSSConditionRule.h"
+#include "nsIDOMCSSGroupingRule.h"
 
 namespace mozilla {
 namespace dom {
 
 class CSSMediaRule : public css::ConditionRule
-                   , public nsIDOMCSSConditionRule
+                   , public nsIDOMCSSGroupingRule
 {
 protected:
   using ConditionRule::ConditionRule;
   virtual ~CSSMediaRule() {}
 
 public:
   NS_DECL_ISUPPORTS_INHERITED
 
   int32_t GetType() const override { return css::Rule::MEDIA_RULE; }
 
   // XPCOM interface
   using Rule::GetType;
 
   // nsIDOMCSSGroupingRule interface
   NS_DECL_NSIDOMCSSGROUPINGRULE
 
-  // nsIDOMCSSConditionRule interface
-  NS_IMETHOD SetConditionText(const nsAString& aConditionText) override = 0;
-
   // WebIDL interface
   uint16_t Type() const override { return nsIDOMCSSRule::MEDIA_RULE; }
-  // Our XPCOM GetConditionText is OK
-  void SetConditionText(const nsAString& aConditionText,
-                        ErrorResult& aRv) final;
   virtual MediaList* Media() = 0;
 
   JSObject* WrapObject(JSContext* aCx,
                        JS::Handle<JSObject*> aGivenProto) override;
 };
 
 } // namespace dom
 } // namespace mozilla
--- a/layout/style/CSSMozDocumentRule.cpp
+++ b/layout/style/CSSMozDocumentRule.cpp
@@ -13,17 +13,16 @@ namespace dom {
 using namespace mozilla::css;
 
 NS_IMPL_ADDREF_INHERITED(CSSMozDocumentRule, css::ConditionRule)
 NS_IMPL_RELEASE_INHERITED(CSSMozDocumentRule, css::ConditionRule)
 
 // QueryInterface implementation for CSSMozDocumentRule
 NS_INTERFACE_MAP_BEGIN(CSSMozDocumentRule)
   NS_INTERFACE_MAP_ENTRY(nsIDOMCSSGroupingRule)
-  NS_INTERFACE_MAP_ENTRY(nsIDOMCSSConditionRule)
 NS_INTERFACE_MAP_END_INHERITING(ConditionRule)
 
 // nsIDOMCSSGroupingRule methods
 NS_IMETHODIMP
 CSSMozDocumentRule::GetCssRules(nsIDOMCSSRuleList** aRuleList)
 {
   return GroupRule::GetCssRules(aRuleList);
 }
@@ -36,23 +35,16 @@ CSSMozDocumentRule::InsertRule(const nsA
 }
 
 NS_IMETHODIMP
 CSSMozDocumentRule::DeleteRule(uint32_t aIndex)
 {
   return GroupRule::DeleteRule(aIndex);
 }
 
-void
-CSSMozDocumentRule::SetConditionText(const nsAString& aConditionText,
-                                     ErrorResult& aRv)
-{
-  aRv = SetConditionText(aConditionText);
-}
-
 /* virtual */ JSObject*
 CSSMozDocumentRule::WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aGivenProto)
 {
   return CSSMozDocumentRuleBinding::Wrap(aCx, this, aGivenProto);
 }
 
 bool
--- a/layout/style/CSSMozDocumentRule.h
+++ b/layout/style/CSSMozDocumentRule.h
@@ -9,17 +9,17 @@
 
 #include "mozilla/css/GroupRule.h"
 #include "mozilla/css/URLMatchingFunction.h"
 
 namespace mozilla {
 namespace dom {
 
 class CSSMozDocumentRule : public css::ConditionRule
-                         , public nsIDOMCSSConditionRule
+                         , public nsIDOMCSSGroupingRule
 {
 protected:
   using ConditionRule::ConditionRule;
   virtual ~CSSMozDocumentRule() {}
 
 public:
   NS_DECL_ISUPPORTS_INHERITED
 
@@ -30,26 +30,20 @@ public:
                     nsIURI* aDocURI,
                     const nsACString& aDocURISpec,
                     const nsACString& aPattern,
                     css::URLMatchingFunction aUrlMatchingFunction);
 
   // nsIDOMCSSGroupingRule interface
   NS_DECL_NSIDOMCSSGROUPINGRULE
 
-  // nsIDOMCSSConditionRule interface
-  NS_IMETHOD SetConditionText(const nsAString& aConditionText) override = 0;
-
   // WebIDL interface
   uint16_t Type() const final override {
     return nsIDOMCSSRule::DOCUMENT_RULE;
   }
-  // Our XPCOM GetConditionText is OK
-  void SetConditionText(const nsAString& aConditionText,
-                        ErrorResult& aRv) final;
 
   JSObject* WrapObject(JSContext* aCx,
                        JS::Handle<JSObject*> aGivenProto) override;
 };
 
 } // namespace dom
 } // namespace mozilla
 
--- a/layout/style/CSSSupportsRule.cpp
+++ b/layout/style/CSSSupportsRule.cpp
@@ -14,17 +14,16 @@ namespace mozilla {
 namespace dom {
 
 NS_IMPL_ADDREF_INHERITED(mozilla::dom::CSSSupportsRule, css::ConditionRule)
 NS_IMPL_RELEASE_INHERITED(mozilla::dom::CSSSupportsRule, css::ConditionRule)
 
 // QueryInterface implementation for CSSSupportsRule
 NS_INTERFACE_MAP_BEGIN(CSSSupportsRule)
   NS_INTERFACE_MAP_ENTRY(nsIDOMCSSGroupingRule)
-  NS_INTERFACE_MAP_ENTRY(nsIDOMCSSConditionRule)
 NS_INTERFACE_MAP_END_INHERITING(ConditionRule)
 
 // nsIDOMCSSGroupingRule methods
 NS_IMETHODIMP
 CSSSupportsRule::GetCssRules(nsIDOMCSSRuleList** aRuleList)
 {
   return GroupRule::GetCssRules(aRuleList);
 }
@@ -36,23 +35,16 @@ CSSSupportsRule::InsertRule(const nsAStr
 }
 
 NS_IMETHODIMP
 CSSSupportsRule::DeleteRule(uint32_t aIndex)
 {
   return GroupRule::DeleteRule(aIndex);
 }
 
-void
-CSSSupportsRule::SetConditionText(const nsAString& aConditionText,
-                                  ErrorResult& aRv)
-{
-  aRv = SetConditionText(aConditionText);
-}
-
 /* virtual */ JSObject*
 CSSSupportsRule::WrapObject(JSContext* aCx,
                             JS::Handle<JSObject*> aGivenProto)
 {
   return CSSSupportsRuleBinding::Wrap(aCx, this, aGivenProto);
 }
 
 } // namespace dom
--- a/layout/style/CSSSupportsRule.h
+++ b/layout/style/CSSSupportsRule.h
@@ -3,45 +3,39 @@
 /* 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 mozilla_dom_CSSSupportsRule_h
 #define mozilla_dom_CSSSupportsRule_h
 
 #include "mozilla/css/GroupRule.h"
-#include "nsIDOMCSSConditionRule.h"
+#include "nsIDOMCSSGroupingRule.h"
 
 namespace mozilla {
 namespace dom {
 
 class CSSSupportsRule : public css::ConditionRule
-                      , public nsIDOMCSSConditionRule
+                      , public nsIDOMCSSGroupingRule
 {
 protected:
   using ConditionRule::ConditionRule;
   virtual ~CSSSupportsRule() {}
 
 public:
   NS_DECL_ISUPPORTS_INHERITED
 
   int32_t GetType() const override { return css::Rule::SUPPORTS_RULE; }
   using Rule::GetType;
 
   // nsIDOMCSSGroupingRule interface
   NS_DECL_NSIDOMCSSGROUPINGRULE
 
-  // nsIDOMCSSConditionRule interface
-  NS_IMETHOD SetConditionText(const nsAString& aConditionText) override = 0;
-
   // WebIDL interface
   uint16_t Type() const override { return nsIDOMCSSRule::SUPPORTS_RULE; }
-  // Our XPCOM GetConditionText is OK
-  void SetConditionText(const nsAString& aConditionText,
-                        ErrorResult& aRv) final;
 
   JSObject* WrapObject(JSContext* aCx,
                        JS::Handle<JSObject*> aGivenProto) override;
 };
 
 } // namespace dom
 } // namespace mozilla
 
--- a/layout/style/GroupRule.h
+++ b/layout/style/GroupRule.h
@@ -226,20 +226,17 @@ private:
 
 // Implementation of WebIDL CSSConditionRule.
 class ConditionRule : public GroupRule
 {
 protected:
   using GroupRule::GroupRule;
 
 public:
-  // GetConditionText signature matches nsIDOMCSSConditionRule, so subclasses
-  // can implement this easily.  The implementations should never return
-  // anything other than NS_OK.
-  NS_IMETHOD GetConditionText(nsAString& aConditionText) = 0;
+  virtual void GetConditionText(nsAString& aConditionText) = 0;
   virtual void SetConditionText(const nsAString& aConditionText,
                                 ErrorResult& aRv) = 0;
 };
 
 } // namespace css
 } // namespace mozilla
 
 #endif /* mozilla_css_GroupRule_h__ */
--- a/layout/style/ServoDocumentRule.cpp
+++ b/layout/style/ServoDocumentRule.cpp
@@ -60,29 +60,27 @@ ServoDocumentRule::List(FILE* out, int32
   for (int32_t i = 0; i < aIndent; i++) {
     str.AppendLiteral("  ");
   }
   Servo_DocumentRule_Debug(mRawRule, &str);
   fprintf_stderr(out, "%s\n", str.get());
 }
 #endif
 
-// nsIDOMCSSConditionRule methods
-
-NS_IMETHODIMP
+void
 ServoDocumentRule::GetConditionText(nsAString& aConditionText)
 {
   Servo_DocumentRule_GetConditionText(mRawRule, &aConditionText);
-  return NS_OK;
 }
 
-NS_IMETHODIMP
-ServoDocumentRule::SetConditionText(const nsAString& aConditionText)
+void
+ServoDocumentRule::SetConditionText(const nsAString& aConditionText,
+                                    ErrorResult& aRv)
 {
-  return NS_ERROR_NOT_IMPLEMENTED;
+  aRv.Throw(NS_ERROR_NOT_IMPLEMENTED);
 }
 
 /* virtual */ void
 ServoDocumentRule::GetCssTextImpl(nsAString& aCssText) const
 {
   Servo_DocumentRule_GetCssText(mRawRule, &aCssText);
 }
 
--- a/layout/style/ServoDocumentRule.h
+++ b/layout/style/ServoDocumentRule.h
@@ -26,22 +26,21 @@ public:
   bool UseForPresentation(nsPresContext* aPresContext,
                           nsMediaQueryResultCacheKey& aKey) final;
 #ifdef DEBUG
   void List(FILE* out = stdout, int32_t aIndent = 0) const final;
 #endif
 
   RawServoDocumentRule* Raw() const { return mRawRule; }
 
-  // nsIDOMCSSConditionRule interface
-  NS_DECL_NSIDOMCSSCONDITIONRULE
-
   // WebIDL interface
-  void GetCssTextImpl(nsAString& aCssText) const override;
-  using CSSMozDocumentRule::SetConditionText;
+  void GetCssTextImpl(nsAString& aCssText) const final;
+  void GetConditionText(nsAString& aConditionText) final;
+  void SetConditionText(const nsAString& aConditionText,
+                        ErrorResult& aRv) final;
 
   size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf)
     const override;
 
 private:
   virtual ~ServoDocumentRule();
 
   RefPtr<RawServoDocumentRule> mRawRule;
--- a/layout/style/ServoMediaRule.cpp
+++ b/layout/style/ServoMediaRule.cpp
@@ -86,28 +86,27 @@ ServoMediaRule::List(FILE* out, int32_t 
   for (int32_t i = 0; i < aIndent; i++) {
     str.AppendLiteral("  ");
   }
   Servo_MediaRule_Debug(mRawRule, &str);
   fprintf_stderr(out, "%s\n", str.get());
 }
 #endif
 
-// nsIDOMCSSConditionRule methods
-
-NS_IMETHODIMP
+void
 ServoMediaRule::GetConditionText(nsAString& aConditionText)
 {
-  return Media()->GetMediaText(aConditionText);
+  Media()->GetMediaText(aConditionText);
 }
 
-NS_IMETHODIMP
-ServoMediaRule::SetConditionText(const nsAString& aConditionText)
+void
+ServoMediaRule::SetConditionText(const nsAString& aConditionText,
+                                 ErrorResult& aRv)
 {
-  return Media()->SetMediaText(aConditionText);
+  aRv = Media()->SetMediaText(aConditionText);
 }
 
 /* virtual */ void
 ServoMediaRule::GetCssTextImpl(nsAString& aCssText) const
 {
   Servo_MediaRule_GetCssText(mRawRule, &aCssText);
 }
 
--- a/layout/style/ServoMediaRule.h
+++ b/layout/style/ServoMediaRule.h
@@ -30,23 +30,22 @@ public:
                           nsMediaQueryResultCacheKey& aKey) final;
   void SetStyleSheet(StyleSheet* aSheet) override;
 #ifdef DEBUG
   void List(FILE* out = stdout, int32_t aIndent = 0) const final;
 #endif
 
   RawServoMediaRule* Raw() const { return mRawRule; }
 
-  // nsIDOMCSSConditionRule interface
-  NS_DECL_NSIDOMCSSCONDITIONRULE
-
   // WebIDL interface
-  void GetCssTextImpl(nsAString& aCssText) const override;
-  using CSSMediaRule::SetConditionText;
-  dom::MediaList* Media() override;
+  void GetCssTextImpl(nsAString& aCssText) const final;
+  void GetConditionText(nsAString& aConditionText) final;
+  void SetConditionText(const nsAString& aConditionText,
+                        ErrorResult& aRv) final;
+  dom::MediaList* Media() final;
 
   size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf)
     const override;
 
 private:
   virtual ~ServoMediaRule();
 
   RefPtr<RawServoMediaRule> mRawRule;
--- a/layout/style/ServoSupportsRule.cpp
+++ b/layout/style/ServoSupportsRule.cpp
@@ -61,29 +61,27 @@ ServoSupportsRule::List(FILE* out, int32
   for (int32_t i = 0; i < aIndent; i++) {
     str.AppendLiteral("  ");
   }
   Servo_SupportsRule_Debug(mRawRule, &str);
   fprintf_stderr(out, "%s\n", str.get());
 }
 #endif
 
-// nsIDOMCSSConditionRule methods
-
-NS_IMETHODIMP
+void
 ServoSupportsRule::GetConditionText(nsAString& aConditionText)
 {
   Servo_SupportsRule_GetConditionText(mRawRule, &aConditionText);
-  return NS_OK;
 }
 
-NS_IMETHODIMP
-ServoSupportsRule::SetConditionText(const nsAString& aConditionText)
+void
+ServoSupportsRule::SetConditionText(const nsAString& aConditionText,
+                                    ErrorResult& aRv)
 {
-  return NS_ERROR_NOT_IMPLEMENTED;
+  aRv.Throw(NS_ERROR_NOT_IMPLEMENTED);
 }
 
 /* virtual */ void
 ServoSupportsRule::GetCssTextImpl(nsAString& aCssText) const
 {
   Servo_SupportsRule_GetCssText(mRawRule, &aCssText);
 }
 
--- a/layout/style/ServoSupportsRule.h
+++ b/layout/style/ServoSupportsRule.h
@@ -26,22 +26,21 @@ public:
   bool UseForPresentation(nsPresContext* aPresContext,
                           nsMediaQueryResultCacheKey& aKey) final;
 #ifdef DEBUG
   void List(FILE* out = stdout, int32_t aIndent = 0) const final;
 #endif
 
   RawServoSupportsRule* Raw() const { return mRawRule; }
 
-  // nsIDOMCSSConditionRule interface
-  NS_DECL_NSIDOMCSSCONDITIONRULE
-
   // WebIDL interface
-  void GetCssTextImpl(nsAString& aCssText) const override;
-  using CSSSupportsRule::SetConditionText;
+  void GetCssTextImpl(nsAString& aCssText) const final;
+  void GetConditionText(nsAString& aConditionText) final;
+  void SetConditionText(const nsAString& aConditionText,
+                        ErrorResult& aRv) final;
 
   size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf)
     const override;
 
 private:
   virtual ~ServoSupportsRule();
 
   RefPtr<RawServoSupportsRule> mRawRule;
--- a/layout/style/nsCSSRules.cpp
+++ b/layout/style/nsCSSRules.cpp
@@ -318,39 +318,40 @@ MediaRule::Media()
 void
 MediaRule::GetCssTextImpl(nsAString& aCssText) const
 {
   aCssText.AssignLiteral("@media ");
   AppendConditionText(aCssText);
   GroupRule::AppendRulesToCssText(aCssText);
 }
 
-// nsIDOMCSSConditionRule methods
-NS_IMETHODIMP
+void
 MediaRule::GetConditionText(nsAString& aConditionText)
 {
   aConditionText.Truncate(0);
   AppendConditionText(aConditionText);
-  return NS_OK;
 }
 
-NS_IMETHODIMP
-MediaRule::SetConditionText(const nsAString& aConditionText)
+void
+MediaRule::SetConditionText(const nsAString& aConditionText,
+                            ErrorResult& aRv)
 {
   if (!mMedia) {
     RefPtr<nsMediaList> media = new nsMediaList();
     media->SetStyleSheet(GetStyleSheet());
     nsresult rv = media->SetMediaText(aConditionText);
     if (NS_SUCCEEDED(rv)) {
       mMedia = media;
+    } else {
+      aRv.Throw(rv);
     }
-    return rv;
+    return;
   }
 
-  return mMedia->SetMediaText(aConditionText);
+  aRv = mMedia->SetMediaText(aConditionText);
 }
 
 // GroupRule interface
 /* virtual */ bool
 MediaRule::UseForPresentation(nsPresContext* aPresContext,
                               nsMediaQueryResultCacheKey& aKey)
 {
   if (mMedia) {
@@ -455,29 +456,28 @@ DocumentRule::Clone() const
 void
 DocumentRule::GetCssTextImpl(nsAString& aCssText) const
 {
   aCssText.AssignLiteral("@-moz-document ");
   AppendConditionText(aCssText);
   GroupRule::AppendRulesToCssText(aCssText);
 }
 
-// nsIDOMCSSConditionRule methods
-NS_IMETHODIMP
+void
 DocumentRule::GetConditionText(nsAString& aConditionText)
 {
   aConditionText.Truncate(0);
   AppendConditionText(aConditionText);
-  return NS_OK;
 }
 
-NS_IMETHODIMP
-DocumentRule::SetConditionText(const nsAString& aConditionText)
+void
+DocumentRule::SetConditionText(const nsAString& aConditionText,
+                               ErrorResult& aRv)
 {
-  return NS_ERROR_NOT_IMPLEMENTED;
+  aRv.Throw(NS_ERROR_NOT_IMPLEMENTED);
 }
 
 // GroupRule interface
 /* virtual */ bool
 DocumentRule::UseForPresentation(nsPresContext* aPresContext,
                                  nsMediaQueryResultCacheKey& aKey)
 {
   return UseForPresentation(aPresContext);
@@ -1541,28 +1541,27 @@ NS_INTERFACE_MAP_END_INHERITING(dom::CSS
 void
 CSSSupportsRule::GetCssTextImpl(nsAString& aCssText) const
 {
   aCssText.AssignLiteral("@supports ");
   aCssText.Append(mCondition);
   css::GroupRule::AppendRulesToCssText(aCssText);
 }
 
-// nsIDOMCSSConditionRule methods
-NS_IMETHODIMP
+void
 CSSSupportsRule::GetConditionText(nsAString& aConditionText)
 {
   aConditionText.Assign(mCondition);
-  return NS_OK;
 }
 
-NS_IMETHODIMP
-CSSSupportsRule::SetConditionText(const nsAString& aConditionText)
+void
+CSSSupportsRule::SetConditionText(const nsAString& aConditionText,
+                                  ErrorResult& aRv)
 {
-  return NS_ERROR_NOT_IMPLEMENTED;
+  aRv.Throw(NS_ERROR_NOT_IMPLEMENTED);
 }
 
 /* virtual */ size_t
 CSSSupportsRule::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
 {
   size_t n = aMallocSizeOf(this);
   n += css::GroupRule::SizeOfExcludingThis(aMallocSizeOf);
   n += mCondition.SizeOfExcludingThisIfUnshared(aMallocSizeOf);
--- a/layout/style/nsCSSRules.h
+++ b/layout/style/nsCSSRules.h
@@ -24,17 +24,16 @@
 #include "mozilla/dom/CSSMediaRule.h"
 #include "mozilla/dom/CSSPageRule.h"
 #include "mozilla/dom/CSSSupportsRule.h"
 #include "mozilla/dom/CSSMozDocumentRule.h"
 #include "nsAutoPtr.h"
 #include "nsCSSPropertyID.h"
 #include "nsCSSValue.h"
 #include "nsDOMCSSDeclaration.h"
-#include "nsIDOMCSSConditionRule.h"
 #include "nsIDOMCSSFontFeatureValuesRule.h"
 #include "nsIDOMCSSGroupingRule.h"
 #include "nsTArray.h"
 
 class nsMediaList;
 
 namespace mozilla {
 
@@ -65,30 +64,29 @@ public:
   virtual void SetStyleSheet(mozilla::StyleSheet* aSheet) override; //override GroupRule
   mozilla::CSSStyleSheet* GetStyleSheet() const
   {
     mozilla::StyleSheet* sheet = GroupRule::GetStyleSheet();
     return sheet ? sheet->AsGecko() : nullptr;
   }
   virtual already_AddRefed<Rule> Clone() const override;
 
-  // nsIDOMCSSConditionRule interface
-  NS_DECL_NSIDOMCSSCONDITIONRULE
-
   // rest of GroupRule
   virtual bool UseForPresentation(nsPresContext* aPresContext,
                                     nsMediaQueryResultCacheKey& aKey) override;
 
   // @media rule methods
   nsresult SetMedia(nsMediaList* aMedia);
 
   // WebIDL interface
-  void GetCssTextImpl(nsAString& aCssText) const override;
-  using CSSMediaRule::SetConditionText;
-  dom::MediaList* Media() override;
+  void GetCssTextImpl(nsAString& aCssText) const final;
+  void GetConditionText(nsAString& aConditionText) final;
+  void SetConditionText(const nsAString& aConditionText,
+                        ErrorResult& aRv) final;
+  dom::MediaList* Media() final;
 
   virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf)
     const override MOZ_MUST_OVERRIDE;
 
 protected:
   void AppendConditionText(nsAString& aOutput) const;
 
   RefPtr<nsMediaList> mMedia;
@@ -106,19 +104,16 @@ public:
   NS_DECL_ISUPPORTS_INHERITED
 
   // Rule methods
 #ifdef DEBUG
   virtual void List(FILE* out = stdout, int32_t aIndent = 0) const override;
 #endif
   virtual already_AddRefed<Rule> Clone() const override;
 
-  // nsIDOMCSSConditionRule interface
-  NS_DECL_NSIDOMCSSCONDITIONRULE
-
   // rest of GroupRule
   virtual bool UseForPresentation(nsPresContext* aPresContext,
                                   nsMediaQueryResultCacheKey& aKey) override;
 
   bool UseForPresentation(nsPresContext* aPresContext);
 
   struct URL {
     URLMatchingFunction func;
@@ -133,18 +128,20 @@ public:
     {
     }
     ~URL();
   };
 
   void SetURLs(URL *aURLs) { mURLs = aURLs; }
 
   // WebIDL interface
-  void GetCssTextImpl(nsAString& aCssText) const override;
-  using dom::CSSMozDocumentRule::SetConditionText;
+  void GetCssTextImpl(nsAString& aCssText) const final;
+  void GetConditionText(nsAString& aConditionText) final;
+  void SetConditionText(const nsAString& aConditionText,
+                        ErrorResult& aRv) final;
 
   virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf)
     const override MOZ_MUST_OVERRIDE;
 
 protected:
   void AppendConditionText(nsAString& aOutput) const;
 
   nsAutoPtr<URL> mURLs; // linked list of |struct URL| above.
@@ -417,22 +414,21 @@ public:
   virtual void List(FILE* out = stdout, int32_t aIndent = 0) const override;
 #endif
   virtual already_AddRefed<mozilla::css::Rule> Clone() const override;
   virtual bool UseForPresentation(nsPresContext* aPresContext,
                                   nsMediaQueryResultCacheKey& aKey) override;
 
   NS_DECL_ISUPPORTS_INHERITED
 
-  // nsIDOMCSSConditionRule interface
-  NS_DECL_NSIDOMCSSCONDITIONRULE
-
   // WebIDL interface
-  void GetCssTextImpl(nsAString& aCssText) const override;
-  using dom::CSSSupportsRule::SetConditionText;
+  void GetCssTextImpl(nsAString& aCssText) const final;
+  void GetConditionText(nsAString& aConditionText) final;
+  void SetConditionText(const nsAString& aConditionText,
+                        ErrorResult& aRv) final;
 
   virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const override;
 
 protected:
   virtual ~CSSSupportsRule();
 
   bool mUseGroup;
   nsString mCondition;