Bug 1290209 - Part 1: Move CSSStyleSheet::SetTitle up to StyleSheet. r?xidorn draft
authorCameron McCormack <cam@mcc.id.au>
Thu, 05 Jan 2017 11:51:13 +0800
changeset 456280 5e4714459ab0c8db3aec0cc55da6a9248fffc563
parent 455592 fc0633f43b5bde982c04cdf3a1aea8d43a150636
child 456281 96e4b9614fe7195678bf38a6750f2b72de4a4ec4
push id40445
push userbmo:cam@mcc.id.au
push dateThu, 05 Jan 2017 09:33:32 +0000
reviewersxidorn
bugs1290209
milestone53.0a1
Bug 1290209 - Part 1: Move CSSStyleSheet::SetTitle up to StyleSheet. r?xidorn MozReview-Commit-ID: 2rzn5gba7gw
layout/style/CSSStyleSheet.h
layout/style/Loader.cpp
layout/style/StyleSheet.h
--- a/layout/style/CSSStyleSheet.h
+++ b/layout/style/CSSStyleSheet.h
@@ -143,17 +143,16 @@ public:
   void AppendStyleRule(css::Rule* aRule);
 
   int32_t StyleRuleCount() const;
   css::Rule* GetStyleRuleAt(int32_t aIndex) const;
 
   nsresult DeleteRuleFromGroup(css::GroupRule* aGroup, uint32_t aIndex);
   nsresult InsertRuleIntoGroup(const nsAString& aRule, css::GroupRule* aGroup, uint32_t aIndex, uint32_t* _retval);
 
-  void SetTitle(const nsAString& aTitle) { mTitle = aTitle; }
   void SetMedia(nsMediaList* aMedia);
 
   void SetOwnerRule(css::ImportRule* aOwnerRule) { mOwnerRule = aOwnerRule; /* Not ref counted */ }
   css::ImportRule* GetOwnerRule() const { return mOwnerRule; }
   // Workaround overloaded-virtual warning in GCC.
   using StyleSheet::GetOwnerRule;
 
   nsXMLNameSpaceMap* GetNameSpaceMap() const { return mInner->mNameSpaceMap; }
--- a/layout/style/Loader.cpp
+++ b/layout/style/Loader.cpp
@@ -1301,17 +1301,17 @@ Loader::PrepareSheet(StyleSheet* aSheet,
 
     // We have aMediaString only when linked from link elements, style
     // elements, or PIs, so pass true.
     mediumParser.ParseMediaList(aMediaString, nullptr, 0, mediaList);
   }
 
   sheet->SetMedia(mediaList);
 
-  sheet->SetTitle(aTitle);
+  aSheet->SetTitle(aTitle);
   sheet->SetEnabled(!isAlternate);
   sheet->SetScopeElement(aScopeElement);
 }
 
 /**
  * InsertSheetInDoc handles ordering of sheets in the document.  Here
  * we have two types of sheets -- those with linking elements and
  * those without.  The latter are loaded by Link: headers.
--- a/layout/style/StyleSheet.h
+++ b/layout/style/StyleSheet.h
@@ -106,16 +106,18 @@ public:
   inline nsIPrincipal* Principal() const;
   /**
    * SetPrincipal should be called on all sheets before parsing into them.
    * This can only be called once with a non-null principal.  Calling this with
    * a null pointer is allowed and is treated as a no-op.
    */
   inline void SetPrincipal(nsIPrincipal* aPrincipal);
 
+  void SetTitle(const nsAString& aTitle) { mTitle = aTitle; }
+
   // Get this style sheet's CORS mode
   inline CORSMode GetCORSMode() const;
   // Get this style sheet's Referrer Policy
   inline net::ReferrerPolicy GetReferrerPolicy() const;
   // Get this style sheet's integrity metadata
   inline void GetIntegrity(dom::SRIMetadata& aResult) const;
 
   inline size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const;