Bug 896277 - Don't return nsresult from GroupRule::AppendRulesToCssText; r=dbaron
authorMs2ger <ms2ger@gmail.com>
Fri, 02 Aug 2013 09:04:31 +0200
changeset 153232 0151cd1dba75b357983543dc552ac724ee9d8827
parent 153231 6088be7ecfea76a298f88d5b8e475076d7fbfa24
child 153233 58a8748517f74df39bf4bb396131544cbe331731
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs896277
milestone25.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 896277 - Don't return nsresult from GroupRule::AppendRulesToCssText; r=dbaron
layout/style/GroupRule.h
layout/style/nsCSSRules.cpp
--- a/layout/style/GroupRule.h
+++ b/layout/style/GroupRule.h
@@ -70,17 +70,17 @@ public:
                                     nsMediaQueryResultCacheKey& aKey) = 0;
 
   // non-virtual -- it is only called by subclasses
   size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
   virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const = 0;
 
 protected:
   // to help implement nsIDOMCSSRule
-  nsresult AppendRulesToCssText(nsAString& aCssText);
+  void AppendRulesToCssText(nsAString& aCssText);
 
   // to implement common methods on nsIDOMCSSMediaRule and
   // nsIDOMCSSMozDocumentRule
   nsresult GetCssRules(nsIDOMCSSRuleList* *aRuleList);
   nsresult InsertRule(const nsAString & aRule, uint32_t aIndex,
                       uint32_t* _retval);
   nsresult DeleteRule(uint32_t aIndex);
 
--- a/layout/style/nsCSSRules.cpp
+++ b/layout/style/nsCSSRules.cpp
@@ -682,17 +682,17 @@ GroupRule::ReplaceStyleRule(Rule* aOld, 
   mRules.ReplaceObjectAt(aNew, index);
   aNew->SetStyleSheet(GetStyleSheet());
   aNew->SetParentRule(this);
   aOld->SetStyleSheet(nullptr);
   aOld->SetParentRule(nullptr);
   return NS_OK;
 }
 
-nsresult
+void
 GroupRule::AppendRulesToCssText(nsAString& aCssText)
 {
   aCssText.AppendLiteral(" {\n");
 
   // get all the rules
   for (int32_t index = 0, count = mRules.Count(); index < count; ++index) {
     Rule* rule = mRules.ObjectAt(index);
     nsIDOMCSSRule* domRule = rule->GetDOMRule();
@@ -701,18 +701,16 @@ GroupRule::AppendRulesToCssText(nsAStrin
       domRule->GetCssText(cssText);
       aCssText.Append(NS_LITERAL_STRING("  ") +
                       cssText +
                       NS_LITERAL_STRING("\n"));
     }
   }
 
   aCssText.AppendLiteral("}");
-
-  return NS_OK;
 }
 
 // nsIDOMCSSMediaRule or nsIDOMCSSMozDocumentRule methods
 nsresult
 GroupRule::GetCssRules(nsIDOMCSSRuleList* *aRuleList)
 {
   if (!mRuleCollection) {
     mRuleCollection = new css::GroupRuleRuleList(this);
@@ -866,17 +864,18 @@ MediaRule::GetType(uint16_t* aType)
   return NS_OK;
 }
 
 NS_IMETHODIMP
 MediaRule::GetCssText(nsAString& aCssText)
 {
   aCssText.AssignLiteral("@media ");
   AppendConditionText(aCssText);
-  return GroupRule::AppendRulesToCssText(aCssText);
+  GroupRule::AppendRulesToCssText(aCssText);
+  return NS_OK;
 }
 
 NS_IMETHODIMP
 MediaRule::SetCssText(const nsAString& aCssText)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
@@ -1073,17 +1072,18 @@ DocumentRule::GetType(uint16_t* aType)
   return NS_OK;
 }
 
 NS_IMETHODIMP
 DocumentRule::GetCssText(nsAString& aCssText)
 {
   aCssText.AssignLiteral("@-moz-document ");
   AppendConditionText(aCssText);
-  return GroupRule::AppendRulesToCssText(aCssText);
+  GroupRule::AppendRulesToCssText(aCssText);
+  return NS_OK;
 }
 
 NS_IMETHODIMP
 DocumentRule::SetCssText(const nsAString& aCssText)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
@@ -2932,17 +2932,18 @@ CSSSupportsRule::GetType(uint16_t* aType
   return NS_OK;
 }
 
 NS_IMETHODIMP
 CSSSupportsRule::GetCssText(nsAString& aCssText)
 {
   aCssText.AssignLiteral("@supports ");
   aCssText.Append(mCondition);
-  return css::GroupRule::AppendRulesToCssText(aCssText);
+  css::GroupRule::AppendRulesToCssText(aCssText);
+  return NS_OK;
 }
 
 NS_IMETHODIMP
 CSSSupportsRule::SetCssText(const nsAString& aCssText)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }