Bug 1290218 Part 1: Uplift IsModified into StyleSheet from CSSStyleSheet, and provide empty implementation for ServoStyleSheet. draft
authorBrad Werth <bwerth@mozilla.com>
Mon, 13 Feb 2017 10:27:46 -0800
changeset 488211 e5e8e4541dd9b98c9e2000c9c6e59c5595f1451f
parent 488074 b06968288cff469814bf830aa90f1c84da490f61
child 488212 741672992dcd7b8128fd88698bfc9cb2663b41bc
push id46461
push userbwerth@mozilla.com
push dateWed, 22 Feb 2017 19:58:08 +0000
bugs1290218
milestone54.0a1
Bug 1290218 Part 1: Uplift IsModified into StyleSheet from CSSStyleSheet, and provide empty implementation for ServoStyleSheet. MozReview-Commit-ID: IU733JoNVyC
layout/style/CSSStyleSheet.h
layout/style/ServoStyleSheet.h
layout/style/StyleSheet.h
--- a/layout/style/CSSStyleSheet.h
+++ b/layout/style/CSSStyleSheet.h
@@ -130,17 +130,17 @@ public:
 
   nsXMLNameSpaceMap* GetNameSpaceMap() const { return mInner->mNameSpaceMap; }
 
   already_AddRefed<CSSStyleSheet> Clone(CSSStyleSheet* aCloneParent,
                                         css::ImportRule* aCloneOwnerRule,
                                         nsIDocument* aCloneDocument,
                                         nsINode* aCloneOwningNode) const;
 
-  bool IsModified() const { return mDirty; }
+  bool IsModified() const final { return mDirty; }
 
   void SetModifiedByChildRule() {
     NS_ASSERTION(mDirty,
                  "sheet must be marked dirty before handing out child rules");
     DidDirty();
   }
 
   nsresult AddRuleProcessor(nsCSSRuleProcessor* aProcessor);
--- a/layout/style/ServoStyleSheet.h
+++ b/layout/style/ServoStyleSheet.h
@@ -63,16 +63,18 @@ public:
   // Can't be inline because we can't include ImportRule here.  And can't be
   // called GetOwnerRule because that would be ambiguous with the ImportRule
   // version.
   css::Rule* GetDOMOwnerRule() const final;
 
   void WillDirty() {}
   void DidDirty() {}
 
+  bool IsModified() const final { return false; }
+
 protected:
   virtual ~ServoStyleSheet();
 
   // Internal methods which do not have security check and completeness check.
   dom::CSSRuleList* GetCssRulesInternal(ErrorResult& aRv);
   uint32_t InsertRuleInternal(const nsAString& aRule,
                               uint32_t aIndex, ErrorResult& aRv);
   void DeleteRuleInternal(uint32_t aIndex, ErrorResult& aRv);
--- a/layout/style/StyleSheet.h
+++ b/layout/style/StyleSheet.h
@@ -103,16 +103,18 @@ public:
    * Whether the sheet is applicable.  A sheet that is not applicable
    * should never be inserted into a style set.  A sheet may not be
    * applicable for a variety of reasons including being disabled and
    * being incomplete.
    */
   inline bool IsApplicable() const;
   inline bool HasRules() const;
 
+  virtual bool IsModified() const = 0;
+
   // style sheet owner info
   enum DocumentAssociationMode {
     // OwnedByDocument means mDocument owns us (possibly via a chain of other
     // stylesheets).
     OwnedByDocument,
     // NotOwnedByDocument means we're owned by something that might have a
     // different lifetime than mDocument.
     NotOwnedByDocument