<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>213488</bug_id>
          
          <creation_ts>2020-06-22 13:59:32 -0700</creation_ts>
          <short_desc>[Cocoa] Avoid copying the default AppleLanguage preference to the WebContent process</short_desc>
          <delta_ts>2020-06-22 16:04:17 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKit Misc.</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=213214</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Per Arne Vollan">pvollan</reporter>
          <assigned_to name="Per Arne Vollan">pvollan</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>cdumez</cc>
    
    <cc>ggaren</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1665172</commentid>
    <comment_count>0</comment_count>
    <who name="Per Arne Vollan">pvollan</who>
    <bug_when>2020-06-22 13:59:32 -0700</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1665178</commentid>
    <comment_count>1</comment_count>
      <attachid>402512</attachid>
    <who name="Per Arne Vollan">pvollan</who>
    <bug_when>2020-06-22 14:06:26 -0700</bug_when>
    <thetext>Created attachment 402512
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1665201</commentid>
    <comment_count>2</comment_count>
      <attachid>402512</attachid>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2020-06-22 15:52:10 -0700</bug_when>
    <thetext>Comment on attachment 402512
Patch

r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1665206</commentid>
    <comment_count>3</comment_count>
    <who name="Per Arne Vollan">pvollan</who>
    <bug_when>2020-06-22 15:56:24 -0700</bug_when>
    <thetext>(In reply to Geoffrey Garen from comment #2)
&gt; Comment on attachment 402512 [details]
&gt; Patch
&gt; 
&gt; r=me

Thanks for reviewing!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1665207</commentid>
    <comment_count>4</comment_count>
      <attachid>402512</attachid>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2020-06-22 15:56:43 -0700</bug_when>
    <thetext>Comment on attachment 402512
Patch

It looks like you are reverting my fix from a few days ago.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1665213</commentid>
    <comment_count>5</comment_count>
      <attachid>402512</attachid>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2020-06-22 16:02:39 -0700</bug_when>
    <thetext>Comment on attachment 402512
Patch

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

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

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

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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1665214</commentid>
    <comment_count>6</comment_count>
    <who name="Per Arne Vollan">pvollan</who>
    <bug_when>2020-06-22 16:03:50 -0700</bug_when>
    <thetext>(In reply to Chris Dumez from comment #5)
&gt; Comment on attachment 402512 [details]
&gt; Patch
&gt; 
&gt; View in context:
&gt; https://bugs.webkit.org/attachment.cgi?id=402512&amp;action=review
&gt; 
&gt; &gt; Source/WebKit/UIProcess/WebProcessProxy.cpp:-321
&gt; &gt; -        overrideLanguages = platformOverrideLanguages();
&gt; 
&gt; With this change, if a user did:
&gt; dvdo defaults write com.apple.Safari AppleLanguages &apos;(&quot;en-US&quot;, &quot;fr-FR&quot;)&apos;
&gt; 
&gt; navigator.languages would not be impacted by the Safari user default
&gt; anymore. We need to read the UIProcess UserDefault for AppleLanguages here,
&gt; 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!</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>402512</attachid>
            <date>2020-06-22 14:06:26 -0700</date>
            <delta_ts>2020-06-22 15:56:43 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-213488-20200622140625.patch</filename>
            <type>text/plain</type>
            <size>1784</size>
            <attacher name="Per Arne Vollan">pvollan</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJLaXQvQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFNvdXJjZS9XZWJL
aXQvQ2hhbmdlTG9nCShyZXZpc2lvbiAyNjMzNjQpCisrKyBTb3VyY2UvV2ViS2l0L0NoYW5nZUxv
Zwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDE5IEBACisyMDIwLTA2LTIyICBQZXIgQXJuZSBW
b2xsYW4gIDxwdm9sbGFuQGFwcGxlLmNvbT4KKworICAgICAgICBbQ29jb2FdIEF2b2lkIGNvcHlp
bmcgdGhlIGRlZmF1bHQgQXBwbGVMYW5ndWFnZSBwcmVmZXJlbmNlIHRvIHRoZSBXZWJDb250ZW50
IH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T09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gU291cmNl
L1dlYktpdC9VSVByb2Nlc3MvV2ViUHJvY2Vzc1Byb3h5LmNwcAkocmV2aXNpb24gMjYzMzUxKQor
KysgU291cmNlL1dlYktpdC9VSVByb2Nlc3MvV2ViUHJvY2Vzc1Byb3h5LmNwcAkod29ya2luZyBj
b3B5KQpAQCAtMzE3LDggKzMxNyw2IEBAIHZvaWQgV2ViUHJvY2Vzc1Byb3h5OjpnZXRMYXVuY2hP
cHRpb25zKFAKICAgICAgICAgbGF1bmNoT3B0aW9ucy5leHRyYUluaXRpYWxpemF0aW9uRGF0YS5h
ZGQoImluc3BlY3Rvci1wcm9jZXNzIl9zLCAiMSJfcyk7CiAKICAgICBhdXRvIG92ZXJyaWRlTGFu
Z3VhZ2VzID0gbV9wcm9jZXNzUG9vbC0+Y29uZmlndXJhdGlvbigpLm92ZXJyaWRlTGFuZ3VhZ2Vz
KCk7Ci0gICAgaWYgKG92ZXJyaWRlTGFuZ3VhZ2VzLmlzRW1wdHkoKSkKLSAgICAgICAgb3ZlcnJp
ZGVMYW5ndWFnZXMgPSBwbGF0Zm9ybU92ZXJyaWRlTGFuZ3VhZ2VzKCk7CiAgICAgaWYgKCFvdmVy
cmlkZUxhbmd1YWdlcy5pc0VtcHR5KCkpIHsKICAgICAgICAgU3RyaW5nQnVpbGRlciBsYW5ndWFn
ZVN0cmluZzsKICAgICAgICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCBvdmVycmlkZUxhbmd1YWdl
cy5zaXplKCk7ICsraSkgewo=
</data>
<flag name="review"
          id="417936"
          type_id="1"
          status="-"
          setter="cdumez"
    />
          </attachment>
      

    </bug>

</bugzilla>