<?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>152715</bug_id>
          
          <creation_ts>2016-01-04 15:24:46 -0800</creation_ts>
          <short_desc>TextBreakIterator uses an internal implementation detail of NSLocale</short_desc>
          <delta_ts>2016-01-13 22:22:59 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>New Bugs</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Myles C. Maxfield">mmaxfield</reporter>
          <assigned_to name="Myles C. Maxfield">mmaxfield</assigned_to>
          <cc>commit-queue</cc>
    
    <cc>darin</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1152543</commentid>
    <comment_count>0</comment_count>
    <who name="Myles C. Maxfield">mmaxfield</who>
    <bug_when>2016-01-04 15:24:46 -0800</bug_when>
    <thetext>TextBreakIterator uses an internal implementation detail of NSLocale</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1152544</commentid>
    <comment_count>1</comment_count>
      <attachid>268241</attachid>
    <who name="Myles C. Maxfield">mmaxfield</who>
    <bug_when>2016-01-04 15:25:37 -0800</bug_when>
    <thetext>Created attachment 268241
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1152545</commentid>
    <comment_count>2</comment_count>
      <attachid>268242</attachid>
    <who name="Myles C. Maxfield">mmaxfield</who>
    <bug_when>2016-01-04 15:26:10 -0800</bug_when>
    <thetext>Created attachment 268242
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1152547</commentid>
    <comment_count>3</comment_count>
    <who name="Myles C. Maxfield">mmaxfield</who>
    <bug_when>2016-01-04 15:26:39 -0800</bug_when>
    <thetext>&lt;rdar://problem/23775121&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1152571</commentid>
    <comment_count>4</comment_count>
      <attachid>268242</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2016-01-04 16:42:59 -0800</bug_when>
    <thetext>Comment on attachment 268242
Patch

Clearing flags on attachment: 268242

Committed r194566: &lt;http://trac.webkit.org/changeset/194566&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1152572</commentid>
    <comment_count>5</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2016-01-04 16:43:03 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1155082</commentid>
    <comment_count>6</comment_count>
      <attachid>268242</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2016-01-13 08:53:58 -0800</bug_when>
    <thetext>Comment on attachment 268242
Patch

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

&gt; Source/WebCore/platform/text/mac/TextBreakIteratorInternalICUMac.mm:41
&gt; +    NSArray *languagesArray = [NSLocale preferredLanguages];

To be consistent with the usage in the rest of this file it would be better to call CFLocaleCopyPreferredLanguages rather than [NSLocale preferredLanguages].

There is a change in behavior here: the NSLocale/CFLocale functions create a new array with the result of CFLocaleCreateCanonicalLanguageIdentifierFromString on each item in the array. That means that:

1) The code in this function that checks if the item from the array is an NSString is no longer needed since the NSLocale/CFLocale function guarantees it will return an array of strings, with no objects of other types.
2) The code below in two different functions that calls canonicalLanguageIdentifier on the result of this function is no longer needed; the result of this function is already guaranteed to be a canonical language identifier. I suggest moving the call to CFLocaleCreateCanonicalLanguageIdentifierFromString into the textBreakLocalePreference function and removing the canonicalLanguageIdentifier function entirely.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1155287</commentid>
    <comment_count>7</comment_count>
      <attachid>268242</attachid>
    <who name="Myles C. Maxfield">mmaxfield</who>
    <bug_when>2016-01-13 16:30:30 -0800</bug_when>
    <thetext>Comment on attachment 268242
Patch

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

&gt;&gt; Source/WebCore/platform/text/mac/TextBreakIteratorInternalICUMac.mm:41
&gt;&gt; +    NSArray *languagesArray = [NSLocale preferredLanguages];
&gt; 
&gt; To be consistent with the usage in the rest of this file it would be better to call CFLocaleCopyPreferredLanguages rather than [NSLocale preferredLanguages].
&gt; 
&gt; There is a change in behavior here: the NSLocale/CFLocale functions create a new array with the result of CFLocaleCreateCanonicalLanguageIdentifierFromString on each item in the array. That means that:
&gt; 
&gt; 1) The code in this function that checks if the item from the array is an NSString is no longer needed since the NSLocale/CFLocale function guarantees it will return an array of strings, with no objects of other types.
&gt; 2) The code below in two different functions that calls canonicalLanguageIdentifier on the result of this function is no longer needed; the result of this function is already guaranteed to be a canonical language identifier. I suggest moving the call to CFLocaleCreateCanonicalLanguageIdentifierFromString into the textBreakLocalePreference function and removing the canonicalLanguageIdentifier function entirely.

http://trac.webkit.org/changeset/195001</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1155371</commentid>
    <comment_count>8</comment_count>
      <attachid>268242</attachid>
    <who name="Myles C. Maxfield">mmaxfield</who>
    <bug_when>2016-01-13 22:22:59 -0800</bug_when>
    <thetext>Comment on attachment 268242
Patch

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

&gt;&gt;&gt; Source/WebCore/platform/text/mac/TextBreakIteratorInternalICUMac.mm:41
&gt;&gt;&gt; +    NSArray *languagesArray = [NSLocale preferredLanguages];
&gt;&gt; 
&gt;&gt; To be consistent with the usage in the rest of this file it would be better to call CFLocaleCopyPreferredLanguages rather than [NSLocale preferredLanguages].
&gt;&gt; 
&gt;&gt; There is a change in behavior here: the NSLocale/CFLocale functions create a new array with the result of CFLocaleCreateCanonicalLanguageIdentifierFromString on each item in the array. That means that:
&gt;&gt; 
&gt;&gt; 1) The code in this function that checks if the item from the array is an NSString is no longer needed since the NSLocale/CFLocale function guarantees it will return an array of strings, with no objects of other types.
&gt;&gt; 2) The code below in two different functions that calls canonicalLanguageIdentifier on the result of this function is no longer needed; the result of this function is already guaranteed to be a canonical language identifier. I suggest moving the call to CFLocaleCreateCanonicalLanguageIdentifierFromString into the textBreakLocalePreference function and removing the canonicalLanguageIdentifier function entirely.
&gt; 
&gt; http://trac.webkit.org/changeset/195001

http://trac.webkit.org/changeset/195006</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>268241</attachid>
            <date>2016-01-04 15:25:37 -0800</date>
            <delta_ts>2016-01-04 15:26:08 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-152715-20160104152504.patch</filename>
            <type>text/plain</type>
            <size>1710</size>
            <attacher name="Myles C. Maxfield">mmaxfield</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTk0NTUxCmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViQ29yZS9D
aGFuZ2VMb2cgYi9Tb3VyY2UvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXggODljNTlkOGUxNmEyYjUy
NTg3NzE0MzBiOTZjYzBiOTU0M2U0ZmE5My4uODAzMTI3YjVmYmU0YTlmYTMzZTM3YzJjOTVjYmVj
MGY3NGQzMTRkMCAxMDA2NDQKLS0tIGEvU291cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCisrKyBiL1Nv
dXJjZS9XZWJDb3JlL0NoYW5nZUxvZw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cmVha0l0ZXJhdG9ySW50ZXJuYWxJQ1VNYWMubW0KaW5kZXgg
NTkwMWQ4MzcwMTI0NjY5Y2RmZjYxN2FhYzUxMmZmMzU4NjI0NmFlNi4uMWRlMzgyMTM4Y2VmNzRi
ZGQ0NTMwMjdmNDQxOGI2ZGVmZTg0MGExYyAxMDA2NDQKLS0tIGEvU291cmNlL1dlYkNvcmUvcGxh
dGZvcm0vdGV4dC9tYWMvVGV4dEJyZWFrSXRlcmF0b3JJbnRlcm5hbElDVU1hYy5tbQorKysgYi9T
b3VyY2UvV2ViQ29yZS9wbGF0Zm9ybS90ZXh0L21hYy9UZXh0QnJlYWtJdGVyYXRvckludGVybmFs
SUNVTWFjLm1tCkBAIC0zOCw3ICszOCw3IEBAIHN0YXRpYyBpbmxpbmUgUmV0YWluUHRyPENGU3Ry
aW5nUmVmPiB0ZXh0QnJlYWtMb2NhbGVQcmVmZXJlbmNlKCkKIAogc3RhdGljIFJldGFpblB0cjxD
RlN0cmluZ1JlZj4gdG9wTGFuZ3VhZ2VQcmVmZXJlbmNlKCkKIHsKLSAgICBOU0FycmF5ICpsYW5n
dWFnZXNBcnJheSA9IFtbTlNVc2VyRGVmYXVsdHMgc3RhbmRhcmRVc2VyRGVmYXVsdHNdIGFycmF5
Rm9yS2V5OkAiQXBwbGVMYW5ndWFnZXMiXTsKKyAgICBOU0FycmF5ICpsYW5ndWFnZXNBcnJheSA9
IFtOU0xvY2FsZSBwcmVmZXJyZWRMYW5ndWFnZXNdOwogICAgIGlmICghbGFuZ3VhZ2VzQXJyYXkp
CiAgICAgICAgIHJldHVybiAwOwogICAgIGlmIChbbGFuZ3VhZ2VzQXJyYXkgY291bnRdIDwgMSkK
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>268242</attachid>
            <date>2016-01-04 15:26:10 -0800</date>
            <delta_ts>2016-01-04 16:42:59 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-152715-20160104152536.patch</filename>
            <type>text/plain</type>
            <size>1745</size>
            <attacher name="Myles C. Maxfield">mmaxfield</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTk0NTUxCmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViQ29yZS9D
aGFuZ2VMb2cgYi9Tb3VyY2UvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXggODljNTlkOGUxNmEyYjUy
NTg3NzE0MzBiOTZjYzBiOTU0M2U0ZmE5My4uODliMzliMzBlMDI2NWYwNjA2YzZjNWM1ZWI2Mjgx
MzQyMTQ0MzZmZCAxMDA2NDQKLS0tIGEvU291cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCisrKyBiL1Nv
dXJjZS9XZWJDb3JlL0NoYW5nZUxvZwpAQCAtMSw1ICsxLDIwIEBACiAyMDE2LTAxLTA0ICBNeWxl
cyBDLiBNYXhmaWVsZCAgPG1tYXhmaWVsZEBhcHBsZS5jb20+CiAKKyAgICAgICAgVGV4dEJyZWFr
SXRlcmF0b3IgdXNlcyBhbiBpbnRlcm5hbCBpbXBsZW1lbnRhdGlvbiBkZXRhaWwgb2YgTlNMb2Nh
bGUKKyAgICAgICAgaHR0cHM6Ly9idWdzLndlYmtpdC5vcmcvc2hvd19idWcuY2dpP2lkPTE1Mjcx
NQorICAgICAgICA8cmRhcjovL3Byb2JsZW0vMjM3NzUxMjE+CisKKyAgICAgICAgUmV2aWV3ZWQg
YnkgTk9CT0RZIChPT1BTISkuCisKKyAgICAgICAgSW5zdGVhZCBvZiBkaXJlY3RseSBxdWVyeWlu
ZyBBcHBsZUxhbmd1YWdlcywgd2Ugc2hvdWxkIHVzZSBbTlNMb2NhbGUgcHJlZmVycmVkTGFuZ3Vh
Z2VzXS4KKworICAgICAgICBObyBuZXcgdGVzdHMgYmVjYXVzZSB0aGVyZSBpcyBubyBiZWhhdmlv
ciBjaGFuZ2UuCisKKyAgICAgICAgKiBwbGF0Zm9ybS90ZXh0L21hYy9UZXh0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