Bug 1290218 Part 1: Uplift IsModified into StyleSheet from CSSStyleSheet, and provide empty implementation for ServoStyleSheet.
MozReview-Commit-ID: IU733JoNVyC
--- 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