Bug 1250788 - Part 2: Expose IsCSSSheetType method. r=bholley
authorCameron McCormack <cam@mcc.id.au>
Fri, 26 Feb 2016 12:51:01 +1100
changeset 322001 9471c9a842ef1710ae31c5b59d3e3c4393096f14
parent 322000 9da0d93d757dc9aaa3bd772b446b93c5aaba4f56
child 322002 a5003168dd68995070fffd4b2fc925153b1ff8d2
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley
bugs1250788
milestone47.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 1250788 - Part 2: Expose IsCSSSheetType method. r=bholley
layout/style/nsStyleSet.cpp
layout/style/nsStyleSet.h
--- a/layout/style/nsStyleSet.cpp
+++ b/layout/style/nsStyleSet.cpp
@@ -167,17 +167,18 @@ static const SheetType gCSSSheetTypes[] 
   // From lowest to highest in cascading order.
   SheetType::Agent,
   SheetType::User,
   SheetType::Doc,
   SheetType::ScopedDoc,
   SheetType::Override
 };
 
-static bool IsCSSSheetType(SheetType aSheetType)
+/* static */ bool
+nsStyleSet::IsCSSSheetType(SheetType aSheetType)
 {
   for (SheetType type : gCSSSheetTypes) {
     if (type == aSheetType) {
       return true;
     }
   }
   return false;
 }
--- a/layout/style/nsStyleSet.h
+++ b/layout/style/nsStyleSet.h
@@ -392,16 +392,21 @@ class nsStyleSet final
   nsIStyleRule* InitialStyleRule();
 
   bool HasRuleProcessorUsedByMultipleStyleSets(mozilla::SheetType aSheetType);
 
   // Tells the RestyleManager for the document using this style set
   // to drop any nsCSSSelector pointers it has.
   void ClearSelectors();
 
+  // Returns whether aSheetType represents a level of the cascade that uses
+  // CSSStyleSheets.  See gCSSSheetTypes in nsStyleSet.cpp for the list
+  // of CSS sheet types.
+  static bool IsCSSSheetType(mozilla::SheetType aSheetType);
+
 private:
   nsStyleSet(const nsStyleSet& aCopy) = delete;
   nsStyleSet& operator=(const nsStyleSet& aCopy) = delete;
 
   // Run mark-and-sweep GC on mRuleTree and mOldRuleTrees, based on mRoots.
   void GCRuleTrees();
 
   nsresult DirtyRuleProcessors(mozilla::SheetType aType);