Bug 1515707 - Reformat the files touched in the previous commit. r=Ehsan
authorEmilio Cobos Álvarez <emilio@crisal.io>
Thu, 20 Dec 2018 19:33:09 +0000
changeset 495311 a6dedc3746e62e4165edcedea43cedb6e57fba43
parent 495310 1cd2c6c217949d0b1d06f15046eba45ff4517044
child 495312 47b081238ac7be87c4fa4f2b9bcdcba9d443dcc4
push idunknown
push userunknown
push dateunknown
reviewersEhsan
bugs1515707
milestone66.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 1515707 - Reformat the files touched in the previous commit. r=Ehsan Depends on D15125 Differential Revision: https://phabricator.services.mozilla.com/D15126
layout/style/CSSPageRule.cpp
layout/style/CSSStyleRule.cpp
layout/style/nsDOMCSSAttrDeclaration.cpp
--- a/layout/style/CSSPageRule.cpp
+++ b/layout/style/CSSPageRule.cpp
@@ -29,130 +29,130 @@ NS_INTERFACE_MAP_BEGIN(CSSPageRuleDeclar
   // We forward the cycle collection interfaces to Rule(), which is
   // never null (in fact, we're part of that object!)
   if (aIID.Equals(NS_GET_IID(nsCycleCollectionISupports)) ||
       aIID.Equals(NS_GET_IID(nsXPCOMCycleCollectionParticipant))) {
     return Rule()->QueryInterface(aIID, aInstancePtr);
   }
 NS_INTERFACE_MAP_END_INHERITING(nsDOMCSSDeclaration)
 
-  NS_IMPL_ADDREF_USING_AGGREGATOR(CSSPageRuleDeclaration, Rule())
-  NS_IMPL_RELEASE_USING_AGGREGATOR(CSSPageRuleDeclaration, Rule())
+NS_IMPL_ADDREF_USING_AGGREGATOR(CSSPageRuleDeclaration, Rule())
+NS_IMPL_RELEASE_USING_AGGREGATOR(CSSPageRuleDeclaration, Rule())
 
-  /* nsDOMCSSDeclaration implementation */
-
-  css::Rule* CSSPageRuleDeclaration::GetParentRule() { return Rule(); }
+/* nsDOMCSSDeclaration implementation */
 
-  nsINode* CSSPageRuleDeclaration::GetParentObject() {
-    return Rule()->GetParentObject();
-  }
+css::Rule* CSSPageRuleDeclaration::GetParentRule() { return Rule(); }
 
-  DeclarationBlock* CSSPageRuleDeclaration::GetOrCreateCSSDeclaration(
-      Operation aOperation, DeclarationBlock * *aCreated) {
-    return mDecls;
-  }
+nsINode* CSSPageRuleDeclaration::GetParentObject() {
+  return Rule()->GetParentObject();
+}
 
-  nsresult CSSPageRuleDeclaration::SetCSSDeclaration(
-      DeclarationBlock * aDecl, MutationClosureData * aClosureData) {
-    MOZ_ASSERT(aDecl, "must be non-null");
-    CSSPageRule* rule = Rule();
+DeclarationBlock* CSSPageRuleDeclaration::GetOrCreateCSSDeclaration(
+    Operation aOperation, DeclarationBlock** aCreated) {
+  return mDecls;
+}
 
-    if (aDecl != mDecls) {
-      mDecls->SetOwningRule(nullptr);
-      RefPtr<DeclarationBlock> decls = aDecl;
-      Servo_PageRule_SetStyle(rule->Raw(), decls->Raw());
-      mDecls = decls.forget();
-      mDecls->SetOwningRule(rule);
-    }
+nsresult CSSPageRuleDeclaration::SetCSSDeclaration(
+    DeclarationBlock* aDecl, MutationClosureData* aClosureData) {
+  MOZ_ASSERT(aDecl, "must be non-null");
+  CSSPageRule* rule = Rule();
 
-    return NS_OK;
-  }
-
-  nsIDocument* CSSPageRuleDeclaration::DocToUpdate() { return nullptr; }
-
-  nsDOMCSSDeclaration::ParsingEnvironment
-  CSSPageRuleDeclaration::GetParsingEnvironment(nsIPrincipal *
-                                                aSubjectPrincipal) const {
-    return GetParsingEnvironmentForRule(Rule());
+  if (aDecl != mDecls) {
+    mDecls->SetOwningRule(nullptr);
+    RefPtr<DeclarationBlock> decls = aDecl;
+    Servo_PageRule_SetStyle(rule->Raw(), decls->Raw());
+    mDecls = decls.forget();
+    mDecls->SetOwningRule(rule);
   }
 
-  // -- CSSPageRule --------------------------------------------------
+  return NS_OK;
+}
+
+nsIDocument* CSSPageRuleDeclaration::DocToUpdate() { return nullptr; }
 
-  CSSPageRule::CSSPageRule(RefPtr<RawServoPageRule> aRawRule,
-                           StyleSheet * aSheet, css::Rule * aParentRule,
-                           uint32_t aLine, uint32_t aColumn)
-      : css::Rule(aSheet, aParentRule, aLine, aColumn),
-        mRawRule(std::move(aRawRule)),
-        mDecls(Servo_PageRule_GetStyle(mRawRule).Consume()) {}
+nsDOMCSSDeclaration::ParsingEnvironment
+CSSPageRuleDeclaration::GetParsingEnvironment(
+    nsIPrincipal* aSubjectPrincipal) const {
+  return GetParsingEnvironmentForRule(Rule());
+}
+
+// -- CSSPageRule --------------------------------------------------
 
-  NS_IMPL_ADDREF_INHERITED(CSSPageRule, css::Rule)
-  NS_IMPL_RELEASE_INHERITED(CSSPageRule, css::Rule)
+CSSPageRule::CSSPageRule(RefPtr<RawServoPageRule> aRawRule, StyleSheet* aSheet,
+                         css::Rule* aParentRule, uint32_t aLine,
+                         uint32_t aColumn)
+    : css::Rule(aSheet, aParentRule, aLine, aColumn),
+      mRawRule(std::move(aRawRule)),
+      mDecls(Servo_PageRule_GetStyle(mRawRule).Consume()) {}
 
-  // QueryInterface implementation for PageRule
-  NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(CSSPageRule)
-  NS_INTERFACE_MAP_END_INHERITING(css::Rule)
+NS_IMPL_ADDREF_INHERITED(CSSPageRule, css::Rule)
+NS_IMPL_RELEASE_INHERITED(CSSPageRule, css::Rule)
 
-  NS_IMPL_CYCLE_COLLECTION_CLASS(CSSPageRule)
-
-  NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(CSSPageRule, css::Rule)
-    // Keep this in sync with IsCCLeaf.
+// QueryInterface implementation for PageRule
+NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(CSSPageRule)
+NS_INTERFACE_MAP_END_INHERITING(css::Rule)
 
-    // Trace the wrapper for our declaration.  This just expands out
-    // NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER which we can't use
-    // directly because the wrapper is on the declaration, not on us.
-    tmp->mDecls.TraceWrapper(aCallbacks, aClosure);
-  NS_IMPL_CYCLE_COLLECTION_TRACE_END
+NS_IMPL_CYCLE_COLLECTION_CLASS(CSSPageRule)
+
+NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(CSSPageRule, css::Rule)
+  // Keep this in sync with IsCCLeaf.
 
-  NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(CSSPageRule, css::Rule)
-    // Keep this in sync with IsCCLeaf.
+  // Trace the wrapper for our declaration.  This just expands out
+  // NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER which we can't use
+  // directly because the wrapper is on the declaration, not on us.
+  tmp->mDecls.TraceWrapper(aCallbacks, aClosure);
+NS_IMPL_CYCLE_COLLECTION_TRACE_END
+
+NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(CSSPageRule, css::Rule)
+  // Keep this in sync with IsCCLeaf.
 
-    // Unlink the wrapper for our declaraton.  This just expands out
-    // NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER which we can't use
-    // directly because the wrapper is on the declaration, not on us.
-    tmp->mDecls.ReleaseWrapper(static_cast<nsISupports*>(p));
-    tmp->mDecls.mDecls->SetOwningRule(nullptr);
-  NS_IMPL_CYCLE_COLLECTION_UNLINK_END
+  // Unlink the wrapper for our declaraton.  This just expands out
+  // NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER which we can't use
+  // directly because the wrapper is on the declaration, not on us.
+  tmp->mDecls.ReleaseWrapper(static_cast<nsISupports*>(p));
+  tmp->mDecls.mDecls->SetOwningRule(nullptr);
+NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
-  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(CSSPageRule, css::Rule)
-    // Keep this in sync with IsCCLeaf.
-  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
+NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(CSSPageRule, css::Rule)
+  // Keep this in sync with IsCCLeaf.
+NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-  bool CSSPageRule::IsCCLeaf() const {
-    if (!Rule::IsCCLeaf()) {
-      return false;
-    }
-
-    return !mDecls.PreservingWrapper();
+bool CSSPageRule::IsCCLeaf() const {
+  if (!Rule::IsCCLeaf()) {
+    return false;
   }
 
-  size_t CSSPageRule::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const {
-    // TODO Implement this!
-    return aMallocSizeOf(this);
-  }
+  return !mDecls.PreservingWrapper();
+}
+
+size_t CSSPageRule::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const {
+  // TODO Implement this!
+  return aMallocSizeOf(this);
+}
 
 #ifdef DEBUG
-  void CSSPageRule::List(FILE * out, int32_t aIndent) const {
-    nsAutoCString str;
-    for (int32_t i = 0; i < aIndent; i++) {
-      str.AppendLiteral("  ");
-    }
-    Servo_PageRule_Debug(mRawRule, &str);
-    fprintf_stderr(out, "%s\n", str.get());
+void CSSPageRule::List(FILE* out, int32_t aIndent) const {
+  nsAutoCString str;
+  for (int32_t i = 0; i < aIndent; i++) {
+    str.AppendLiteral("  ");
   }
+  Servo_PageRule_Debug(mRawRule, &str);
+  fprintf_stderr(out, "%s\n", str.get());
+}
 #endif
 
-  /* CSSRule implementation */
+/* CSSRule implementation */
 
-  void CSSPageRule::GetCssText(nsAString & aCssText) const {
-    Servo_PageRule_GetCssText(mRawRule, &aCssText);
-  }
+void CSSPageRule::GetCssText(nsAString& aCssText) const {
+  Servo_PageRule_GetCssText(mRawRule, &aCssText);
+}
 
-  /* CSSPageRule implementation */
+/* CSSPageRule implementation */
 
-  nsICSSDeclaration* CSSPageRule::Style() { return &mDecls; }
+nsICSSDeclaration* CSSPageRule::Style() { return &mDecls; }
 
-  JSObject* CSSPageRule::WrapObject(JSContext * aCx,
-                                    JS::Handle<JSObject*> aGivenProto) {
-    return CSSPageRule_Binding::Wrap(aCx, this, aGivenProto);
-  }
+JSObject* CSSPageRule::WrapObject(JSContext* aCx,
+                                  JS::Handle<JSObject*> aGivenProto) {
+  return CSSPageRule_Binding::Wrap(aCx, this, aGivenProto);
+}
 
 }  // namespace dom
 }  // namespace mozilla
--- a/layout/style/CSSStyleRule.cpp
+++ b/layout/style/CSSStyleRule.cpp
@@ -33,187 +33,187 @@ NS_INTERFACE_MAP_BEGIN(CSSStyleRuleDecla
   // We forward the cycle collection interfaces to Rule(), which is
   // never null (in fact, we're part of that object!)
   if (aIID.Equals(NS_GET_IID(nsCycleCollectionISupports)) ||
       aIID.Equals(NS_GET_IID(nsXPCOMCycleCollectionParticipant))) {
     return Rule()->QueryInterface(aIID, aInstancePtr);
   }
 NS_INTERFACE_MAP_END_INHERITING(nsDOMCSSDeclaration)
 
-  NS_IMPL_ADDREF_USING_AGGREGATOR(CSSStyleRuleDeclaration, Rule())
-  NS_IMPL_RELEASE_USING_AGGREGATOR(CSSStyleRuleDeclaration, Rule())
+NS_IMPL_ADDREF_USING_AGGREGATOR(CSSStyleRuleDeclaration, Rule())
+NS_IMPL_RELEASE_USING_AGGREGATOR(CSSStyleRuleDeclaration, Rule())
+
+/* nsDOMCSSDeclaration implementation */
+
+css::Rule* CSSStyleRuleDeclaration::GetParentRule() { return Rule(); }
 
-  /* nsDOMCSSDeclaration implementation */
+nsINode* CSSStyleRuleDeclaration::GetParentObject() {
+  return Rule()->GetParentObject();
+}
 
-  css::Rule* CSSStyleRuleDeclaration::GetParentRule() { return Rule(); }
+DeclarationBlock* CSSStyleRuleDeclaration::GetOrCreateCSSDeclaration(
+    Operation aOperation, DeclarationBlock** aCreated) {
+  return mDecls;
+}
 
-  nsINode* CSSStyleRuleDeclaration::GetParentObject() {
-    return Rule()->GetParentObject();
+nsresult CSSStyleRuleDeclaration::SetCSSDeclaration(
+    DeclarationBlock* aDecl, MutationClosureData* aClosureData) {
+  CSSStyleRule* rule = Rule();
+  if (RefPtr<StyleSheet> sheet = rule->GetStyleSheet()) {
+    if (aDecl != mDecls) {
+      mDecls->SetOwningRule(nullptr);
+      RefPtr<DeclarationBlock> decls = aDecl;
+      Servo_StyleRule_SetStyle(rule->Raw(), decls->Raw());
+      mDecls = decls.forget();
+      mDecls->SetOwningRule(rule);
+    }
+    sheet->RuleChanged(rule);
   }
+  return NS_OK;
+}
 
-  DeclarationBlock* CSSStyleRuleDeclaration::GetOrCreateCSSDeclaration(
-      Operation aOperation, DeclarationBlock * *aCreated) {
-    return mDecls;
-  }
+nsIDocument* CSSStyleRuleDeclaration::DocToUpdate() { return nullptr; }
 
-  nsresult CSSStyleRuleDeclaration::SetCSSDeclaration(
-      DeclarationBlock * aDecl, MutationClosureData * aClosureData) {
-    CSSStyleRule* rule = Rule();
-    if (RefPtr<StyleSheet> sheet = rule->GetStyleSheet()) {
-      if (aDecl != mDecls) {
-        mDecls->SetOwningRule(nullptr);
-        RefPtr<DeclarationBlock> decls = aDecl;
-        Servo_StyleRule_SetStyle(rule->Raw(), decls->Raw());
-        mDecls = decls.forget();
-        mDecls->SetOwningRule(rule);
-      }
-      sheet->RuleChanged(rule);
-    }
-    return NS_OK;
-  }
+nsDOMCSSDeclaration::ParsingEnvironment
+CSSStyleRuleDeclaration::GetParsingEnvironment(
+    nsIPrincipal* aSubjectPrincipal) const {
+  return GetParsingEnvironmentForRule(Rule());
+}
+
+// -- CSSStyleRule --------------------------------------------------
+
+CSSStyleRule::CSSStyleRule(already_AddRefed<RawServoStyleRule> aRawRule,
+                           StyleSheet* aSheet, css::Rule* aParentRule,
+                           uint32_t aLine, uint32_t aColumn)
+    : BindingStyleRule(aSheet, aParentRule, aLine, aColumn),
+      mRawRule(aRawRule),
+      mDecls(Servo_StyleRule_GetStyle(mRawRule).Consume()) {}
+
+NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED_0(CSSStyleRule, css::Rule)
+
+NS_IMPL_CYCLE_COLLECTION_CLASS(CSSStyleRule)
+
+NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(CSSStyleRule, css::Rule)
+  // Keep this in sync with IsCCLeaf.
 
-  nsIDocument* CSSStyleRuleDeclaration::DocToUpdate() { return nullptr; }
+  // Trace the wrapper for our declaration.  This just expands out
+  // NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER which we can't use
+  // directly because the wrapper is on the declaration, not on us.
+  tmp->mDecls.TraceWrapper(aCallbacks, aClosure);
+NS_IMPL_CYCLE_COLLECTION_TRACE_END
+
+NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(CSSStyleRule, css::Rule)
+  // Keep this in sync with IsCCLeaf.
 
-  nsDOMCSSDeclaration::ParsingEnvironment
-  CSSStyleRuleDeclaration::GetParsingEnvironment(nsIPrincipal *
-                                                 aSubjectPrincipal) const {
-    return GetParsingEnvironmentForRule(Rule());
+  // Unlink the wrapper for our declaraton.  This just expands out
+  // NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER which we can't use
+  // directly because the wrapper is on the declaration, not on us.
+  tmp->mDecls.ReleaseWrapper(static_cast<nsISupports*>(p));
+NS_IMPL_CYCLE_COLLECTION_UNLINK_END
+
+NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(CSSStyleRule, css::Rule)
+  // Keep this in sync with IsCCLeaf.
+NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
+
+bool CSSStyleRule::IsCCLeaf() const {
+  if (!Rule::IsCCLeaf()) {
+    return false;
   }
 
-  // -- CSSStyleRule --------------------------------------------------
-
-  CSSStyleRule::CSSStyleRule(already_AddRefed<RawServoStyleRule> aRawRule,
-                             StyleSheet * aSheet, css::Rule * aParentRule,
-                             uint32_t aLine, uint32_t aColumn)
-      : BindingStyleRule(aSheet, aParentRule, aLine, aColumn),
-        mRawRule(aRawRule),
-        mDecls(Servo_StyleRule_GetStyle(mRawRule).Consume()) {}
-
-  NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED_0(CSSStyleRule, css::Rule)
+  return !mDecls.PreservingWrapper();
+}
 
-  NS_IMPL_CYCLE_COLLECTION_CLASS(CSSStyleRule)
-
-  NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(CSSStyleRule, css::Rule)
-    // Keep this in sync with IsCCLeaf.
-
-    // Trace the wrapper for our declaration.  This just expands out
-    // NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER which we can't use
-    // directly because the wrapper is on the declaration, not on us.
-    tmp->mDecls.TraceWrapper(aCallbacks, aClosure);
-  NS_IMPL_CYCLE_COLLECTION_TRACE_END
-
-  NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(CSSStyleRule, css::Rule)
-    // Keep this in sync with IsCCLeaf.
+size_t CSSStyleRule::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const {
+  size_t n = aMallocSizeOf(this);
 
-    // Unlink the wrapper for our declaraton.  This just expands out
-    // NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER which we can't use
-    // directly because the wrapper is on the declaration, not on us.
-    tmp->mDecls.ReleaseWrapper(static_cast<nsISupports*>(p));
-  NS_IMPL_CYCLE_COLLECTION_UNLINK_END
-
-  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(CSSStyleRule, css::Rule)
-    // Keep this in sync with IsCCLeaf.
-  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
+  // Measurement of the following members may be added later if DMD finds it
+  // is worthwhile:
+  // - mRawRule
+  // - mDecls
 
-  bool CSSStyleRule::IsCCLeaf() const {
-    if (!Rule::IsCCLeaf()) {
-      return false;
-    }
-
-    return !mDecls.PreservingWrapper();
-  }
-
-  size_t CSSStyleRule::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const {
-    size_t n = aMallocSizeOf(this);
-
-    // Measurement of the following members may be added later if DMD finds it
-    // is worthwhile:
-    // - mRawRule
-    // - mDecls
-
-    return n;
-  }
+  return n;
+}
 
 #ifdef DEBUG
-  void CSSStyleRule::List(FILE * out, int32_t aIndent) const {
-    nsAutoCString str;
-    for (int32_t i = 0; i < aIndent; i++) {
-      str.AppendLiteral("  ");
-    }
-    Servo_StyleRule_Debug(mRawRule, &str);
-    fprintf_stderr(out, "%s\n", str.get());
+void CSSStyleRule::List(FILE* out, int32_t aIndent) const {
+  nsAutoCString str;
+  for (int32_t i = 0; i < aIndent; i++) {
+    str.AppendLiteral("  ");
   }
+  Servo_StyleRule_Debug(mRawRule, &str);
+  fprintf_stderr(out, "%s\n", str.get());
+}
 #endif
 
-  /* CSSRule implementation */
+/* CSSRule implementation */
 
-  void CSSStyleRule::GetCssText(nsAString & aCssText) const {
-    Servo_StyleRule_GetCssText(mRawRule, &aCssText);
-  }
+void CSSStyleRule::GetCssText(nsAString& aCssText) const {
+  Servo_StyleRule_GetCssText(mRawRule, &aCssText);
+}
+
+nsICSSDeclaration* CSSStyleRule::Style() { return &mDecls; }
+
+/* CSSStyleRule implementation */
 
-  nsICSSDeclaration* CSSStyleRule::Style() { return &mDecls; }
+void CSSStyleRule::GetSelectorText(nsAString& aSelectorText) {
+  Servo_StyleRule_GetSelectorText(mRawRule, &aSelectorText);
+}
 
-  /* CSSStyleRule implementation */
+void CSSStyleRule::SetSelectorText(const nsAString& aSelectorText) {
+  if (RefPtr<StyleSheet> sheet = GetStyleSheet()) {
+    // StyleRule lives inside of the Inner, it is unsafe to call WillDirty
+    // if sheet does not already have a unique Inner.
+    sheet->AssertHasUniqueInner();
+    sheet->WillDirty();
 
-  void CSSStyleRule::GetSelectorText(nsAString & aSelectorText) {
-    Servo_StyleRule_GetSelectorText(mRawRule, &aSelectorText);
+    const RawServoStyleSheetContents* contents = sheet->RawContents();
+    if (Servo_StyleRule_SetSelectorText(contents, mRawRule, &aSelectorText)) {
+      sheet->RuleChanged(this);
+    }
   }
+}
 
-  void CSSStyleRule::SetSelectorText(const nsAString& aSelectorText) {
-    if (RefPtr<StyleSheet> sheet = GetStyleSheet()) {
-      // StyleRule lives inside of the Inner, it is unsafe to call WillDirty
-      // if sheet does not already have a unique Inner.
-      sheet->AssertHasUniqueInner();
-      sheet->WillDirty();
+uint32_t CSSStyleRule::GetSelectorCount() {
+  uint32_t aCount;
+  Servo_StyleRule_GetSelectorCount(mRawRule, &aCount);
+  return aCount;
+}
+
+nsresult CSSStyleRule::GetSelectorText(uint32_t aSelectorIndex,
+                                       nsAString& aText) {
+  Servo_StyleRule_GetSelectorTextAtIndex(mRawRule, aSelectorIndex, &aText);
+  return NS_OK;
+}
 
-      const RawServoStyleSheetContents* contents = sheet->RawContents();
-      if (Servo_StyleRule_SetSelectorText(contents, mRawRule, &aSelectorText)) {
-        sheet->RuleChanged(this);
-      }
+nsresult CSSStyleRule::GetSpecificity(uint32_t aSelectorIndex,
+                                      uint64_t* aSpecificity) {
+  Servo_StyleRule_GetSpecificityAtIndex(mRawRule, aSelectorIndex, aSpecificity);
+  return NS_OK;
+}
+
+nsresult CSSStyleRule::SelectorMatchesElement(Element* aElement,
+                                              uint32_t aSelectorIndex,
+                                              const nsAString& aPseudo,
+                                              bool* aMatches) {
+  CSSPseudoElementType pseudoType = CSSPseudoElementType::NotPseudo;
+  if (!aPseudo.IsEmpty()) {
+    RefPtr<nsAtom> pseudoElt = NS_Atomize(aPseudo);
+    pseudoType = nsCSSPseudoElements::GetPseudoType(
+        pseudoElt, CSSEnabledState::eIgnoreEnabledState);
+
+    if (pseudoType == CSSPseudoElementType::NotPseudo) {
+      *aMatches = false;
+      return NS_OK;
     }
   }
 
-  uint32_t CSSStyleRule::GetSelectorCount() {
-    uint32_t aCount;
-    Servo_StyleRule_GetSelectorCount(mRawRule, &aCount);
-    return aCount;
-  }
-
-  nsresult CSSStyleRule::GetSelectorText(uint32_t aSelectorIndex,
-                                         nsAString & aText) {
-    Servo_StyleRule_GetSelectorTextAtIndex(mRawRule, aSelectorIndex, &aText);
-    return NS_OK;
-  }
-
-  nsresult CSSStyleRule::GetSpecificity(uint32_t aSelectorIndex,
-                                        uint64_t * aSpecificity) {
-    Servo_StyleRule_GetSpecificityAtIndex(mRawRule, aSelectorIndex,
-                                          aSpecificity);
-    return NS_OK;
-  }
+  *aMatches = Servo_StyleRule_SelectorMatchesElement(
+      mRawRule, aElement, aSelectorIndex, pseudoType);
 
-  nsresult CSSStyleRule::SelectorMatchesElement(
-      Element * aElement, uint32_t aSelectorIndex, const nsAString& aPseudo,
-      bool* aMatches) {
-    CSSPseudoElementType pseudoType = CSSPseudoElementType::NotPseudo;
-    if (!aPseudo.IsEmpty()) {
-      RefPtr<nsAtom> pseudoElt = NS_Atomize(aPseudo);
-      pseudoType = nsCSSPseudoElements::GetPseudoType(
-          pseudoElt, CSSEnabledState::eIgnoreEnabledState);
+  return NS_OK;
+}
 
-      if (pseudoType == CSSPseudoElementType::NotPseudo) {
-        *aMatches = false;
-        return NS_OK;
-      }
-    }
-
-    *aMatches = Servo_StyleRule_SelectorMatchesElement(
-        mRawRule, aElement, aSelectorIndex, pseudoType);
-
-    return NS_OK;
-  }
-
-  NotNull<DeclarationBlock*> CSSStyleRule::GetDeclarationBlock() const {
-    return WrapNotNull(mDecls.mDecls);
-  }
+NotNull<DeclarationBlock*> CSSStyleRule::GetDeclarationBlock() const {
+  return WrapNotNull(mDecls.mDecls);
+}
 
 }  // namespace dom
 }  // namespace mozilla
--- a/layout/style/nsDOMCSSAttrDeclaration.cpp
+++ b/layout/style/nsDOMCSSAttrDeclaration.cpp
@@ -55,133 +55,133 @@ NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_B
   return tmp->HasKnownLiveWrapper() ||
          (tmp->mElement && Element::CanSkipThis(tmp->mElement));
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_END
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsDOMCSSAttributeDeclaration)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
 NS_INTERFACE_MAP_END_INHERITING(nsDOMCSSDeclaration)
 
-  NS_IMPL_CYCLE_COLLECTING_ADDREF(nsDOMCSSAttributeDeclaration)
-  NS_IMPL_CYCLE_COLLECTING_RELEASE(nsDOMCSSAttributeDeclaration)
+NS_IMPL_CYCLE_COLLECTING_ADDREF(nsDOMCSSAttributeDeclaration)
+NS_IMPL_CYCLE_COLLECTING_RELEASE(nsDOMCSSAttributeDeclaration)
+
+nsresult nsDOMCSSAttributeDeclaration::SetCSSDeclaration(
+    DeclarationBlock* aDecl, MutationClosureData* aClosureData) {
+  NS_ASSERTION(mElement, "Must have Element to set the declaration!");
 
-  nsresult nsDOMCSSAttributeDeclaration::SetCSSDeclaration(
-      DeclarationBlock * aDecl, MutationClosureData * aClosureData) {
-    NS_ASSERTION(mElement, "Must have Element to set the declaration!");
+  // Whenever changing element.style values, aClosureData must be non-null.
+  // SMIL doesn't update Element's attribute values, so closure data isn't
+  // needed.
+  MOZ_ASSERT_IF(!mIsSMILOverride, aClosureData);
 
-    // Whenever changing element.style values, aClosureData must be non-null.
-    // SMIL doesn't update Element's attribute values, so closure data isn't
-    // needed.
-    MOZ_ASSERT_IF(!mIsSMILOverride, aClosureData);
+  // The closure needs to have been called by now, otherwise we shouldn't be
+  // getting here when the attribute hasn't changed.
+  MOZ_ASSERT_IF(aClosureData, !aClosureData->mClosure);
 
-    // The closure needs to have been called by now, otherwise we shouldn't be
-    // getting here when the attribute hasn't changed.
-    MOZ_ASSERT_IF(aClosureData, !aClosureData->mClosure);
+  aDecl->SetDirty();
+  return mIsSMILOverride
+             ? mElement->SetSMILOverrideStyleDeclaration(aDecl, true)
+             : mElement->SetInlineStyleDeclaration(*aDecl, *aClosureData);
+}
+
+nsIDocument* nsDOMCSSAttributeDeclaration::DocToUpdate() {
+  // We need OwnerDoc() rather than GetUncomposedDoc() because it might
+  // be the BeginUpdate call that inserts mElement into the document.
+  return mElement->OwnerDoc();
+}
 
-    aDecl->SetDirty();
-    return mIsSMILOverride
-               ? mElement->SetSMILOverrideStyleDeclaration(aDecl, true)
-               : mElement->SetInlineStyleDeclaration(*aDecl, *aClosureData);
-  }
+DeclarationBlock* nsDOMCSSAttributeDeclaration::GetOrCreateCSSDeclaration(
+    Operation aOperation, DeclarationBlock** aCreated) {
+  MOZ_ASSERT(aOperation != eOperation_Modify || aCreated);
+
+  if (!mElement) return nullptr;
 
-  nsIDocument* nsDOMCSSAttributeDeclaration::DocToUpdate() {
-    // We need OwnerDoc() rather than GetUncomposedDoc() because it might
-    // be the BeginUpdate call that inserts mElement into the document.
-    return mElement->OwnerDoc();
+  DeclarationBlock* declaration;
+  if (mIsSMILOverride) {
+    declaration = mElement->GetSMILOverrideStyleDeclaration();
+  } else {
+    declaration = mElement->GetInlineStyleDeclaration();
   }
 
-  DeclarationBlock* nsDOMCSSAttributeDeclaration::GetOrCreateCSSDeclaration(
-      Operation aOperation, DeclarationBlock * *aCreated) {
-    MOZ_ASSERT(aOperation != eOperation_Modify || aCreated);
-
-    if (!mElement) return nullptr;
-
-    DeclarationBlock* declaration;
-    if (mIsSMILOverride) {
-      declaration = mElement->GetSMILOverrideStyleDeclaration();
-    } else {
-      declaration = mElement->GetInlineStyleDeclaration();
-    }
+  if (declaration) {
+    return declaration;
+  }
 
-    if (declaration) {
-      return declaration;
-    }
-
-    if (aOperation != eOperation_Modify) {
-      return nullptr;
-    }
-
-    // cannot fail
-    RefPtr<DeclarationBlock> decl = new DeclarationBlock();
-    // Mark the declaration dirty so that it can be reused by the caller.
-    // Normally SetDirty is called later in SetCSSDeclaration.
-    decl->SetDirty();
-#ifdef DEBUG
-    RefPtr<DeclarationBlock> mutableDecl = decl->EnsureMutable();
-    MOZ_ASSERT(mutableDecl == decl);
-#endif
-    decl.swap(*aCreated);
-    return *aCreated;
+  if (aOperation != eOperation_Modify) {
+    return nullptr;
   }
 
-  nsDOMCSSDeclaration::ParsingEnvironment
-  nsDOMCSSAttributeDeclaration::GetParsingEnvironment(nsIPrincipal *
-                                                      aSubjectPrincipal) const {
-    return {
-        mElement->GetURLDataForStyleAttr(aSubjectPrincipal),
-        mElement->OwnerDoc()->GetCompatibilityMode(),
-        mElement->OwnerDoc()->CSSLoader(),
-    };
-  }
+  // cannot fail
+  RefPtr<DeclarationBlock> decl = new DeclarationBlock();
+  // Mark the declaration dirty so that it can be reused by the caller.
+  // Normally SetDirty is called later in SetCSSDeclaration.
+  decl->SetDirty();
+#ifdef DEBUG
+  RefPtr<DeclarationBlock> mutableDecl = decl->EnsureMutable();
+  MOZ_ASSERT(mutableDecl == decl);
+#endif
+  decl.swap(*aCreated);
+  return *aCreated;
+}
 
-  nsresult nsDOMCSSAttributeDeclaration::SetSMILValue(
-      const nsCSSPropertyID aPropID, const nsSMILValue& aValue) {
-    MOZ_ASSERT(mIsSMILOverride);
-    // No need to do the ActiveLayerTracker / ScrollLinkedEffectDetector bits,
-    // since we're in a SMIL animation anyway, no need to try to detect we're a
-    // scripted animation.
-    RefPtr<DeclarationBlock> created;
-    DeclarationBlock* olddecl =
-        GetOrCreateCSSDeclaration(eOperation_Modify, getter_AddRefs(created));
-    if (!olddecl) {
-      return NS_ERROR_NOT_AVAILABLE;
-    }
-    mozAutoDocUpdate autoUpdate(DocToUpdate(), true);
-    RefPtr<DeclarationBlock> decl = olddecl->EnsureMutable();
-    bool changed = nsSMILCSSValueType::SetPropertyValues(aValue, *decl);
-    if (changed) {
-      // We can pass nullptr as the latter param, since this is
-      // mIsSMILOverride == true case.
-      SetCSSDeclaration(decl, nullptr);
-    }
-    return NS_OK;
+nsDOMCSSDeclaration::ParsingEnvironment
+nsDOMCSSAttributeDeclaration::GetParsingEnvironment(
+    nsIPrincipal* aSubjectPrincipal) const {
+  return {
+      mElement->GetURLDataForStyleAttr(aSubjectPrincipal),
+      mElement->OwnerDoc()->GetCompatibilityMode(),
+      mElement->OwnerDoc()->CSSLoader(),
+  };
+}
+
+nsresult nsDOMCSSAttributeDeclaration::SetSMILValue(
+    const nsCSSPropertyID aPropID, const nsSMILValue& aValue) {
+  MOZ_ASSERT(mIsSMILOverride);
+  // No need to do the ActiveLayerTracker / ScrollLinkedEffectDetector bits,
+  // since we're in a SMIL animation anyway, no need to try to detect we're a
+  // scripted animation.
+  RefPtr<DeclarationBlock> created;
+  DeclarationBlock* olddecl =
+      GetOrCreateCSSDeclaration(eOperation_Modify, getter_AddRefs(created));
+  if (!olddecl) {
+    return NS_ERROR_NOT_AVAILABLE;
   }
+  mozAutoDocUpdate autoUpdate(DocToUpdate(), true);
+  RefPtr<DeclarationBlock> decl = olddecl->EnsureMutable();
+  bool changed = nsSMILCSSValueType::SetPropertyValues(aValue, *decl);
+  if (changed) {
+    // We can pass nullptr as the latter param, since this is
+    // mIsSMILOverride == true case.
+    SetCSSDeclaration(decl, nullptr);
+  }
+  return NS_OK;
+}
 
-  nsresult nsDOMCSSAttributeDeclaration::SetPropertyValue(
-      const nsCSSPropertyID aPropID, const nsAString& aValue,
-      nsIPrincipal* aSubjectPrincipal) {
-    // Scripted modifications to style.opacity or style.transform
-    // could immediately force us into the animated state if heuristics suggest
-    // this is scripted animation.
-    // FIXME: This is missing the margin shorthand and the logical versions of
-    // the margin properties, see bug 1266287.
-    if (aPropID == eCSSProperty_opacity || aPropID == eCSSProperty_transform ||
-        aPropID == eCSSProperty_left || aPropID == eCSSProperty_top ||
-        aPropID == eCSSProperty_right || aPropID == eCSSProperty_bottom ||
-        aPropID == eCSSProperty_background_position_x ||
-        aPropID == eCSSProperty_background_position_y ||
-        aPropID == eCSSProperty_background_position) {
-      nsIFrame* frame = mElement->GetPrimaryFrame();
-      if (frame) {
-        ActiveLayerTracker::NotifyInlineStyleRuleModified(frame, aPropID,
-                                                          aValue, this);
-      }
+nsresult nsDOMCSSAttributeDeclaration::SetPropertyValue(
+    const nsCSSPropertyID aPropID, const nsAString& aValue,
+    nsIPrincipal* aSubjectPrincipal) {
+  // Scripted modifications to style.opacity or style.transform
+  // could immediately force us into the animated state if heuristics suggest
+  // this is scripted animation.
+  // FIXME: This is missing the margin shorthand and the logical versions of
+  // the margin properties, see bug 1266287.
+  if (aPropID == eCSSProperty_opacity || aPropID == eCSSProperty_transform ||
+      aPropID == eCSSProperty_left || aPropID == eCSSProperty_top ||
+      aPropID == eCSSProperty_right || aPropID == eCSSProperty_bottom ||
+      aPropID == eCSSProperty_background_position_x ||
+      aPropID == eCSSProperty_background_position_y ||
+      aPropID == eCSSProperty_background_position) {
+    nsIFrame* frame = mElement->GetPrimaryFrame();
+    if (frame) {
+      ActiveLayerTracker::NotifyInlineStyleRuleModified(frame, aPropID, aValue,
+                                                        this);
     }
-    return nsDOMCSSDeclaration::SetPropertyValue(aPropID, aValue,
-                                                 aSubjectPrincipal);
   }
+  return nsDOMCSSDeclaration::SetPropertyValue(aPropID, aValue,
+                                               aSubjectPrincipal);
+}
 
-  void nsDOMCSSAttributeDeclaration::MutationClosureFunction(void* aData) {
-    MutationClosureData* data = static_cast<MutationClosureData*>(aData);
-    // Clear mClosure pointer so that it doesn't get called again.
-    data->mClosure = nullptr;
-    data->mElement->InlineStyleDeclarationWillChange(*data);
-  }
+void nsDOMCSSAttributeDeclaration::MutationClosureFunction(void* aData) {
+  MutationClosureData* data = static_cast<MutationClosureData*>(aData);
+  // Clear mClosure pointer so that it doesn't get called again.
+  data->mClosure = nullptr;
+  data->mElement->InlineStyleDeclarationWillChange(*data);
+}