Bug 1395322 Part 1: Enforce consistent use of nsIDOMCSSRule enums for Servo rule types. r=xidorn
authorBrad Werth <bwerth@mozilla.com>
Wed, 06 Sep 2017 16:58:42 -0700
changeset 428977 22af8e4748e3f69742b784451e44f16e825928fb
parent 428976 6c9ee8ca6b32d9e378bd256efb16bf9ecbad003b
child 428978 865d5faef4a7d034500efae76e66e5216541b3d9
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersxidorn
bugs1395322
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1395322 Part 1: Enforce consistent use of nsIDOMCSSRule enums for Servo rule types. r=xidorn MozReview-Commit-ID: DmfaYCe9QAY
layout/style/ServoCSSRuleList.cpp
layout/style/ServoCSSRuleList.h
layout/style/ServoStyleSheet.cpp
--- a/layout/style/ServoCSSRuleList.cpp
+++ b/layout/style/ServoCSSRuleList.cpp
@@ -218,17 +218,17 @@ ServoCSSRuleList::DeleteRule(uint32_t aI
       DropRule(already_AddRefed<css::Rule>(CastToPtr(rule)));
     }
     mRules.RemoveElementAt(aIndex);
   }
   return rv;
 }
 
 uint16_t
-ServoCSSRuleList::GetRuleType(uint32_t aIndex) const
+ServoCSSRuleList::GetDOMCSSRuleType(uint32_t aIndex) const
 {
   uintptr_t rule = mRules[aIndex];
   if (rule <= kMaxRuleType) {
     return rule;
   }
   return CastToPtr(rule)->Type();
 }
 
--- a/layout/style/ServoCSSRuleList.h
+++ b/layout/style/ServoCSSRuleList.h
@@ -44,17 +44,17 @@ public:
   uint32_t Length() final { return mRules.Length(); }
 
   void DropReference();
 
   css::Rule* GetRule(uint32_t aIndex);
   nsresult InsertRule(const nsAString& aRule, uint32_t aIndex);
   nsresult DeleteRule(uint32_t aIndex);
 
-  uint16_t GetRuleType(uint32_t aIndex) const;
+  uint16_t GetDOMCSSRuleType(uint32_t aIndex) const;
 
 private:
   virtual ~ServoCSSRuleList();
 
   // XXX Is it possible to have an address lower than or equal to 255?
   //     Is it possible to have more than 255 CSS rule types?
   static const uintptr_t kMaxRuleType = UINT8_MAX;
 
--- a/layout/style/ServoStyleSheet.cpp
+++ b/layout/style/ServoStyleSheet.cpp
@@ -407,17 +407,17 @@ ServoStyleSheet::InsertRuleInternal(cons
   GetCssRulesInternal();
 
   mozAutoDocUpdate updateBatch(mDocument, UPDATE_STYLE, true);
   aRv = mRuleList->InsertRule(aRule, aIndex);
   if (aRv.Failed()) {
     return 0;
   }
   if (mDocument) {
-    if (mRuleList->GetRuleType(aIndex) != css::Rule::IMPORT_RULE ||
+    if (mRuleList->GetDOMCSSRuleType(aIndex) != nsIDOMCSSRule::IMPORT_RULE ||
         !RuleHasPendingChildSheet(mRuleList->GetRule(aIndex))) {
       // XXX We may not want to get the rule when stylesheet change event
       // is not enabled.
       mDocument->StyleRuleAdded(this, mRuleList->GetRule(aIndex));
     }
   }
   return aIndex;
 }