Bug 213488 - [Cocoa] Avoid copying the default AppleLanguage preference to the WebContent process
Summary: [Cocoa] Avoid copying the default AppleLanguage preference to the WebContent ...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Per Arne Vollan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-22 13:59 PDT by Per Arne Vollan
Modified: 2020-06-22 16:04 PDT (History)
3 users (show)

See Also:


Attachments
Patch (1.74 KB, patch)
2020-06-22 14:06 PDT, Per Arne Vollan
cdumez: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Per Arne Vollan 2020-06-22 13:59:32 PDT
There is no need to copy the default AppleLanguage preference from the UI process to the WebContent process. The value of this key is available in the WebContent process using the preferences API.
Comment 1 Per Arne Vollan 2020-06-22 14:06:26 PDT
Created attachment 402512 [details]
Patch
Comment 2 Geoffrey Garen 2020-06-22 15:52:10 PDT
Comment on attachment 402512 [details]
Patch

r=me
Comment 3 Per Arne Vollan 2020-06-22 15:56:24 PDT
(In reply to Geoffrey Garen from comment #2)
> Comment on attachment 402512 [details]
> Patch
> 
> r=me

Thanks for reviewing!
Comment 4 Chris Dumez 2020-06-22 15:56:43 PDT
Comment on attachment 402512 [details]
Patch

It looks like you are reverting my fix from a few days ago.
Comment 5 Chris Dumez 2020-06-22 16:02:39 PDT
Comment on attachment 402512 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=402512&action=review

> Source/WebKit/UIProcess/WebProcessProxy.cpp:-321
> -        overrideLanguages = platformOverrideLanguages();

With this change, if a user did:
dvdo defaults write com.apple.Safari AppleLanguages '("en-US", "fr-FR")'

navigator.languages would not be impacted by the Safari user default anymore. We need to read the UIProcess UserDefault for AppleLanguages here, send it over XPC and then set AppleLanguages to this value in the WebProcess.
Comment 6 Per Arne Vollan 2020-06-22 16:03:50 PDT
(In reply to Chris Dumez from comment #5)
> Comment on attachment 402512 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=402512&action=review
> 
> > Source/WebKit/UIProcess/WebProcessProxy.cpp:-321
> > -        overrideLanguages = platformOverrideLanguages();
> 
> With this change, if a user did:
> dvdo defaults write com.apple.Safari AppleLanguages '("en-US", "fr-FR")'
> 
> navigator.languages would not be impacted by the Safari user default
> anymore. We need to read the UIProcess UserDefault for AppleLanguages here,
> send it over XPC and then set AppleLanguages to this value in the WebProcess.

Right, I see how this change would break that.

Thanks for reviewing!