Bug 1290209 - Part 1: Move CSSStyleSheet::SetTitle up to StyleSheet. r?xidorn
MozReview-Commit-ID: 2rzn5gba7gw
--- 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;