Title: [258853] branches/safari-609-branch/Source/WTF
Revision
258853
Author
[email protected]
Date
2020-03-23 10:00:04 -0700 (Mon, 23 Mar 2020)

Log Message

Cherry-pick r258658. rdar://problem/60756680

    REGRESSION(r254389): Cordova throws an exception because it expects a hyphen inside navigator.locale
    https://bugs.webkit.org/show_bug.cgi?id=208969
    <rdar://problem/59845517>

    Reviewed by Darin Adler.

    We want to thwart fingerprinting by minimizing the list of locales, but we also don't want to break existing apps.
    We can achieve both by a linked-on-or-after check.

    * wtf/cocoa/LanguageCocoa.mm:
    (WTF::canMinimizeLanguages):

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258658 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-609-branch/Source/WTF/ChangeLog (258852 => 258853)


--- branches/safari-609-branch/Source/WTF/ChangeLog	2020-03-23 16:52:48 UTC (rev 258852)
+++ branches/safari-609-branch/Source/WTF/ChangeLog	2020-03-23 17:00:04 UTC (rev 258853)
@@ -1,4 +1,4 @@
-2020-02-20  Russell Epstein  <[email protected]>
+b"2020-03-23  Russell Epstein  <[email protected]>\n\n        Cherry-pick r258658. rdar://problem/60756680\n\n    REGRESSION(r254389): Cordova throws an exception because it expects a hyphen inside navigator.locale\n    https://bugs.webkit.org/show_bug.cgi?id=208969\n    <rdar://problem/59845517>\n    \n    Reviewed by Darin Adler.\n    \n    We want to thwart fingerprinting by minimizing the list of locales, but we also don't want to break existing apps.\n    We can achieve both by a linked-on-or-after check.\n    \n    * wtf/cocoa/LanguageCocoa.mm:\n    (WTF::canMinimizeLanguages):\n    \n    \n    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258658 268f45cc-cd09-0410-ab3c-d52691b4dbfc\n\n    2020-03-18  Myles C. Maxfield  <[email protected]>\n\n            REGRESSION(r254389): Cordova throws an exception because it expects a hyphen inside navigator.locale\n            https://bugs.webkit.org/show_bug.cgi?id=208969\n            &l
 t;rdar://problem/59845517>\n\n            Reviewed by Darin Adler.\n\n            We want to thwart fingerprinting by minimizing the list of locales, but we also don't want to break existing apps.\n            We can achieve both by a linked-on-or-after check.\n\n            * wtf/cocoa/LanguageCocoa.mm:\n            (WTF::canMinimizeLanguages):\n\n"2020-02-20  Russell Epstein  <[email protected]>
 
         Cherry-pick r256806. rdar://problem/59576023
 

Modified: branches/safari-609-branch/Source/WTF/wtf/cocoa/LanguageCocoa.mm (258852 => 258853)


--- branches/safari-609-branch/Source/WTF/wtf/cocoa/LanguageCocoa.mm	2020-03-23 16:52:48 UTC (rev 258852)
+++ branches/safari-609-branch/Source/WTF/wtf/cocoa/LanguageCocoa.mm	2020-03-23 17:00:04 UTC (rev 258853)
@@ -27,6 +27,7 @@
 #import <wtf/Language.h>
 
 #import <wtf/NeverDestroyed.h>
+#import <wtf/cocoa/RuntimeApplicationChecksCocoa.h>
 #import <wtf/spi/cocoa/NSLocaleSPI.h>
 
 namespace WTF {
@@ -33,7 +34,17 @@
 
 bool canMinimizeLanguages()
 {
-    static bool result = [NSLocale respondsToSelector:@selector(minimizedLanguagesFromLanguages:)];
+    static const bool result = []() -> bool {
+#if PLATFORM(MAC)
+        if (applicationSDKVersion() < DYLD_MACOSX_VERSION_10_15_4)
+            return false;
+#endif
+#if PLATFORM(IOS)
+        if (applicationSDKVersion() < DYLD_IOS_VERSION_13_4)
+            return false;
+#endif
+        return [NSLocale respondsToSelector:@selector(minimizedLanguagesFromLanguages:)];
+    }();
     return result;
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to