Bug 1471950: Add nsCocoaFeatures::OnMojaveOrLater(). r=haik
authorStephen A Pohl <spohl.mozilla.bugs@gmail.com>
Thu, 28 Jun 2018 21:18:25 -0400
changeset 424388 0968fa15c1319d481398f8c54996b2b3b77e0ee6
parent 424387 f39c27cbd36d49279803fb47c845e08e955f7b63
child 424389 c30383f7cf2b6211e75f3f8a34b6294dbab54711
push id34203
push userebalazs@mozilla.com
push dateFri, 29 Jun 2018 09:42:22 +0000
treeherdermozilla-central@bf149090f6b5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershaik
bugs1471950
milestone63.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 1471950: Add nsCocoaFeatures::OnMojaveOrLater(). r=haik
widget/cocoa/nsCocoaFeatures.h
widget/cocoa/nsCocoaFeatures.mm
--- a/widget/cocoa/nsCocoaFeatures.h
+++ b/widget/cocoa/nsCocoaFeatures.h
@@ -15,19 +15,20 @@
 class nsCocoaFeatures {
 public:
   static int32_t OSXVersion();
   static int32_t OSXVersionMajor();
   static int32_t OSXVersionMinor();
   static int32_t OSXVersionBugFix();
   static bool OnYosemiteOrLater();
   static bool OnElCapitanOrLater();
+  static bool OnSierraExactly();
   static bool OnSierraOrLater();
   static bool OnHighSierraOrLater();
-  static bool OnSierraExactly();
+  static bool OnMojaveOrLater();
 
   static bool IsAtLeastVersion(int32_t aMajor, int32_t aMinor, int32_t aBugFix=0);
 
   // These are utilities that do not change or depend on the value of mOSXVersion
   // and instead just encapsulate the encoding algorithm.  Note that GetVersion
   // actually adjusts to the lowest supported OS, so it will always return
   // a "supported" version.  GetSystemVersion does not make any modifications.
   static void GetSystemVersion(int &aMajor, int &aMinor, int &aBugFix);
--- a/widget/cocoa/nsCocoaFeatures.mm
+++ b/widget/cocoa/nsCocoaFeatures.mm
@@ -15,16 +15,17 @@
 #define MAC_OS_X_VERSION_10_0_HEX  0x00001000
 #define MAC_OS_X_VERSION_10_7_HEX  0x00001070
 #define MAC_OS_X_VERSION_10_8_HEX  0x00001080
 #define MAC_OS_X_VERSION_10_9_HEX  0x00001090
 #define MAC_OS_X_VERSION_10_10_HEX 0x000010A0
 #define MAC_OS_X_VERSION_10_11_HEX 0x000010B0
 #define MAC_OS_X_VERSION_10_12_HEX 0x000010C0
 #define MAC_OS_X_VERSION_10_13_HEX 0x000010D0
+#define MAC_OS_X_VERSION_10_14_HEX 0x000010E0
 
 #include "nsCocoaFeatures.h"
 #include "nsCocoaUtils.h"
 #include "nsDebug.h"
 #include "nsObjCExceptions.h"
 
 #import <Cocoa/Cocoa.h>
 
@@ -158,44 +159,50 @@ nsCocoaFeatures::OnYosemiteOrLater()
 
 /* static */ bool
 nsCocoaFeatures::OnElCapitanOrLater()
 {
     return (OSXVersion() >= MAC_OS_X_VERSION_10_11_HEX);
 }
 
 /* static */ bool
-nsCocoaFeatures::OnSierraOrLater()
-{
-    return (OSXVersion() >= MAC_OS_X_VERSION_10_12_HEX);
-}
-
-/* static */ bool
-nsCocoaFeatures::OnHighSierraOrLater()
-{
-    return (OSXVersion() >= MAC_OS_X_VERSION_10_13_HEX);
-}
-
-/* static */ bool
 nsCocoaFeatures::OnSierraExactly()
 {
     return (OSXVersion() >= MAC_OS_X_VERSION_10_12_HEX) &&
            (OSXVersion() < MAC_OS_X_VERSION_10_13_HEX);
 }
 
 /* Version of OnSierraExactly as global function callable from cairo & skia */
 bool
 Gecko_OnSierraExactly()
 {
     return nsCocoaFeatures::OnSierraExactly();
 }
 
+/* static */ bool
+nsCocoaFeatures::OnSierraOrLater()
+{
+    return (OSXVersion() >= MAC_OS_X_VERSION_10_12_HEX);
+}
+
+/* static */ bool
+nsCocoaFeatures::OnHighSierraOrLater()
+{
+    return (OSXVersion() >= MAC_OS_X_VERSION_10_13_HEX);
+}
+
 bool
 Gecko_OnHighSierraOrLater()
 {
     return nsCocoaFeatures::OnHighSierraOrLater();
 }
 
 /* static */ bool
+nsCocoaFeatures::OnMojaveOrLater()
+{
+    return (OSXVersion() >= MAC_OS_X_VERSION_10_14_HEX);
+}
+
+/* static */ bool
 nsCocoaFeatures::IsAtLeastVersion(int32_t aMajor, int32_t aMinor, int32_t aBugFix)
 {
     return OSXVersion() >= GetVersion(aMajor, aMinor, aBugFix);
 }