Bug 1386865 part 1 - Have GetServoStyleSet return non-const ServoStyleSet. r?TYLin draft
authorXidorn Quan <me@upsuper.org>
Thu, 03 Aug 2017 16:58:23 +1000
changeset 620175 c0aba3ee494cc39c595bbecb148a30bad728bef4
parent 620083 8f4d1916f25057f237df0ef44f00444d9f7cc88c
child 620176 91c6d65cbd49832b1ffde76cfb9664d76940b8a7
child 620280 d902a98bad7bc040cfa2edc967ac4fd3fa8f52df
push id71951
push userxquan@mozilla.com
push dateThu, 03 Aug 2017 06:59:49 +0000
reviewersTYLin
bugs1386865
milestone57.0a1
Bug 1386865 part 1 - Have GetServoStyleSet return non-const ServoStyleSet. r?TYLin MozReview-Commit-ID: IOlcThK3PAr
dom/xbl/nsXBLBinding.cpp
dom/xbl/nsXBLBinding.h
dom/xbl/nsXBLPrototypeBinding.cpp
dom/xbl/nsXBLPrototypeBinding.h
dom/xbl/nsXBLPrototypeResources.h
--- a/dom/xbl/nsXBLBinding.cpp
+++ b/dom/xbl/nsXBLBinding.cpp
@@ -864,17 +864,17 @@ nsXBLBinding::WalkRules(nsIStyleRuleProc
   if (mNextBinding)
     mNextBinding->WalkRules(aFunc, aData);
 
   nsIStyleRuleProcessor *rules = mPrototypeBinding->GetRuleProcessor();
   if (rules)
     (*aFunc)(rules, aData);
 }
 
-const ServoStyleSet*
+ServoStyleSet*
 nsXBLBinding::GetServoStyleSet() const
 {
   return mPrototypeBinding->GetServoStyleSet();
 }
 
 // Internal helper methods ////////////////////////////////////////////////////////////////
 
 // Get or create a WeakMap object on a given XBL-hosting global.
--- a/dom/xbl/nsXBLBinding.h
+++ b/dom/xbl/nsXBLBinding.h
@@ -125,17 +125,17 @@ public:
 
   void AttributeChanged(nsIAtom* aAttribute, int32_t aNameSpaceID,
                         bool aRemoveFlag, bool aNotify);
 
   void ChangeDocument(nsIDocument* aOldDocument, nsIDocument* aNewDocument);
 
   void WalkRules(nsIStyleRuleProcessor::EnumFunc aFunc, void* aData);
 
-  const mozilla::ServoStyleSet* GetServoStyleSet() const;
+  mozilla::ServoStyleSet* GetServoStyleSet() const;
 
   static nsresult DoInitJSClass(JSContext *cx, JS::Handle<JSObject*> obj,
                                 const nsString& aClassName,
                                 nsXBLPrototypeBinding* aProtoBinding,
                                 JS::MutableHandle<JSObject*> aClassObject,
                                 bool* aNew);
 
   bool AllowScripts();
--- a/dom/xbl/nsXBLPrototypeBinding.cpp
+++ b/dom/xbl/nsXBLPrototypeBinding.cpp
@@ -564,17 +564,17 @@ nsXBLPrototypeBinding::GetRuleProcessor(
 {
   if (mResources) {
     return mResources->GetRuleProcessor();
   }
 
   return nullptr;
 }
 
-const ServoStyleSet*
+ServoStyleSet*
 nsXBLPrototypeBinding::GetServoStyleSet() const
 {
   return mResources ? mResources->GetServoStyleSet() : nullptr;
 }
 
 void
 nsXBLPrototypeBinding::EnsureAttributeTable()
 {
--- a/dom/xbl/nsXBLPrototypeBinding.h
+++ b/dom/xbl/nsXBLPrototypeBinding.h
@@ -126,17 +126,17 @@ public:
   void RemoveStyleSheet(mozilla::StyleSheet* aSheet);
   void InsertStyleSheetAt(size_t aIndex, mozilla::StyleSheet* aSheet);
   mozilla::StyleSheet* StyleSheetAt(size_t aIndex) const;
   size_t SheetCount() const;
   bool HasStyleSheets() const;
   void AppendStyleSheetsTo(nsTArray<mozilla::StyleSheet*>& aResult) const;
 
   nsIStyleRuleProcessor* GetRuleProcessor();
-  const mozilla::ServoStyleSet* GetServoStyleSet() const;
+  mozilla::ServoStyleSet* GetServoStyleSet() const;
 
   nsresult FlushSkinSheets();
 
   nsIAtom* GetBaseTag(int32_t* aNamespaceID);
   void SetBaseTag(int32_t aNamespaceID, nsIAtom* aTag);
 
   bool ImplementsInterface(REFNSIID aIID) const;
 
--- a/dom/xbl/nsXBLPrototypeResources.h
+++ b/dom/xbl/nsXBLPrototypeResources.h
@@ -59,17 +59,17 @@ public:
 
   nsCSSRuleProcessor* GetRuleProcessor() const { return mRuleProcessor; }
 
   // Updates the ServoStyleSet object that holds the result of cascading the
   // sheets in mStyleSheetList. Equivalent to GatherRuleProcessor(), but for
   // the Servo style backend.
   void ComputeServoStyleSet(nsPresContext* aPresContext);
 
-  const mozilla::ServoStyleSet* GetServoStyleSet() const { return mServoStyleSet.get(); }
+  mozilla::ServoStyleSet* GetServoStyleSet() const { return mServoStyleSet.get(); }
 
 private:
   // A loader object. Exists only long enough to load resources, and then it dies.
   RefPtr<nsXBLResourceLoader> mLoader;
 
   // A list of loaded stylesheets for this binding.
   nsTArray<RefPtr<mozilla::StyleSheet>> mStyleSheetList;