Bug 1250377 - Part 1: Use MOZ_STYLO environment variable to switch on Servo-backed style system. r=bholley
authorCameron McCormack <cam@mcc.id.au>
Wed, 24 Feb 2016 18:01:12 +1100
changeset 321697 18a340cceaf3e17849346aa30d7d836377b1140e
parent 321696 06bc3102b90004470fba71fcaff4ba7b437ebfd7
child 321698 008aa54d8df6a986840a0ac87753de6c5779ff8f
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
bugs1250377
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 1250377 - Part 1: Use MOZ_STYLO environment variable to switch on Servo-backed style system. r=bholley
layout/base/nsPresContext.h
--- a/layout/base/nsPresContext.h
+++ b/layout/base/nsPresContext.h
@@ -35,16 +35,17 @@
 #include "mozilla/AppUnits.h"
 #include "prclist.h"
 #include "nsThreadUtils.h"
 #include "ScrollbarStyles.h"
 #include "nsIMessageManager.h"
 #include "mozilla/RestyleLogging.h"
 #include "Units.h"
 #include "mozilla/RestyleManagerHandle.h"
+#include "prenv.h"
 
 class nsAString;
 class nsIPrintSettings;
 class nsDocShell;
 class nsIDocShell;
 class nsIDocument;
 class nsILanguageAtomService;
 class nsITheme;
@@ -1063,16 +1064,26 @@ public:
   bool HasWarnedAboutPositionedTableParts() const {
     return mHasWarnedAboutPositionedTableParts;
   }
 
   void SetHasWarnedAboutPositionedTableParts() {
     mHasWarnedAboutPositionedTableParts = true;
   }
 
+  static bool StyloEnabled()
+  {
+#ifdef MOZ_STYLO
+    static bool enabled = PR_GetEnv("MOZ_STYLO");
+    return enabled;
+#else
+    return false;
+#endif
+  }
+
 protected:
   friend class nsRunnableMethod<nsPresContext>;
   void ThemeChangedInternal();
   void SysColorChangedInternal();
   void UIResolutionChangedInternal();
 
   static bool
   UIResolutionChangedSubdocumentCallback(nsIDocument* aDocument, void* aData);