WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 208969
REGRESSION(
r254389
): Cordova throws an exception because it expects a hyphen inside navigator.locale
https://bugs.webkit.org/show_bug.cgi?id=208969
Summary
REGRESSION(r254389): Cordova throws an exception because it expects a hyphen ...
Myles C. Maxfield
Reported
2020-03-11 19:27:33 PDT
REGRESSION(
r254389
): Cordova throws an exception because it expects a hyphen inside navigator.locale
Attachments
Patch
(1.85 KB, patch)
2020-03-11 19:29 PDT
,
Myles C. Maxfield
no flags
Details
Formatted Diff
Diff
WIP
(2.18 KB, patch)
2020-03-13 16:49 PDT
,
Myles C. Maxfield
no flags
Details
Formatted Diff
Diff
Patch
(1.95 KB, patch)
2020-03-13 18:07 PDT
,
Myles C. Maxfield
darin
: review+
Details
Formatted Diff
Diff
Patch for committing
(1.98 KB, patch)
2020-03-17 19:17 PDT
,
Myles C. Maxfield
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Myles C. Maxfield
Comment 1
2020-03-11 19:29:15 PDT
Created
attachment 393329
[details]
Patch
Myles C. Maxfield
Comment 2
2020-03-11 19:29:18 PDT
<
rdar://problem/59845517
>
Keith Rollin
Comment 3
2020-03-11 20:52:42 PDT
Comment on
attachment 393329
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=393329&action=review
> Source/WTF/wtf/cocoa/LanguageCocoa.mm:40 > +#elif PLATFORM(IOS_FAMILY) > + static bool applicationVersionCheck = dyld_get_program_sdk_version() >= DYLD_IOS_VERSION_13_4;
I want to make sure this platform and version checking is correct. The PLATFORM(IOS_FAMILY) check will be True for tvOS and watchOS, as well as iOS. But that DYLD_IOS_VERSION_13_4 seems to be iOS-only. So should the pre-processor conditional actually be just PLATFORM(IOS)? And what should happen with macCatalyst? PLATFORM(IOS) will return False for macCatalyst, so if we want to support that platform, we'd also need a PLATFORM(MACCATALYST) check (I assume the iOS version number would be appropriate for that platform?).
Chris Dumez
Comment 4
2020-03-12 07:41:54 PDT
Comment on
attachment 393329
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=393329&action=review
> Source/WTF/wtf/cocoa/LanguageCocoa.mm:38 > + static bool applicationVersionCheck = dyld_get_program_sdk_version() >= DYLD_MACOSX_VERSION_10_15_4;
I don't think calling dyld_get_program_sdk_version() in the WebKit2 WebContent process will do what you want. AFAIK, dyld_get_program_sdk_version() will only do what you want in the wK2 UIProcess or WK1.
Myles C. Maxfield
Comment 5
2020-03-12 18:04:27 PDT
Comment on
attachment 393329
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=393329&action=review
>> Source/WTF/wtf/cocoa/LanguageCocoa.mm:38 >> + static bool applicationVersionCheck = dyld_get_program_sdk_version() >= DYLD_MACOSX_VERSION_10_15_4; > > I don't think calling dyld_get_program_sdk_version() in the WebKit2 WebContent process will do what you want. AFAIK, dyld_get_program_sdk_version() will only do what you want in the wK2 UIProcess or WK1.
Good catch! I'm pursuing this in
https://bugs.webkit.org/show_bug.cgi?id=209030
.
Myles C. Maxfield
Comment 6
2020-03-13 13:52:21 PDT
Comment on
attachment 393329
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=393329&action=review
>> Source/WTF/wtf/cocoa/LanguageCocoa.mm:40 >> + static bool applicationVersionCheck = dyld_get_program_sdk_version() >= DYLD_IOS_VERSION_13_4; > > I want to make sure this platform and version checking is correct. The PLATFORM(IOS_FAMILY) check will be True for tvOS and watchOS, as well as iOS. But that DYLD_IOS_VERSION_13_4 seems to be iOS-only. So should the pre-processor conditional actually be just PLATFORM(IOS)? And what should happen with macCatalyst? PLATFORM(IOS) will return False for macCatalyst, so if we want to support that platform, we'd also need a PLATFORM(MACCATALYST) check (I assume the iOS version number would be appropriate for that platform?).
From my testing: tvOS: 0xD0400 watchOS: 0xD0200 macOS: 0xA0F04 iOS: 0xD0400
Myles C. Maxfield
Comment 7
2020-03-13 16:49:00 PDT
Created
attachment 393557
[details]
WIP
Myles C. Maxfield
Comment 8
2020-03-13 18:07:35 PDT
Created
attachment 393565
[details]
Patch
Darin Adler
Comment 9
2020-03-15 17:31:24 PDT
Comment on
attachment 393565
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=393565&action=review
> Source/WTF/wtf/cocoa/LanguageCocoa.mm:44 > +#if PLATFORM(MAC) > + static bool applicationVersionCheck = applicationSDKVersion() >= DYLD_MACOSX_VERSION_10_15_4; > +#elif PLATFORM(IOS) > + static bool applicationVersionCheck = applicationSDKVersion() >= DYLD_IOS_VERSION_13_4; > +#elif > + static bool applicationVersionCheck = true; > +#endif > + static bool result = applicationVersionCheck && [NSLocale respondsToSelector:@selector(minimizedLanguagesFromLanguages:)];
I suggest static const bool or static constexpr for all of these. But also, not elegant to have two globals since the first is only used to compute the second. So write it like this: static const bool result = [] { #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; #elif return [NSLocale respondsToSelector:@selector(minimizedLanguagesFromLanguages:)]; }();
Myles C. Maxfield
Comment 10
2020-03-17 19:17:08 PDT
Created
attachment 393810
[details]
Patch for committing
EWS
Comment 11
2020-03-18 12:28:44 PDT
Committed
r258658
: <
https://trac.webkit.org/changeset/258658
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 393810
[details]
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug