<?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>76714</bug_id>
          
          <creation_ts>2012-01-20 10:21:13 -0800</creation_ts>
          <short_desc>implement Date.toLocaleString() using ICU</short_desc>
          <delta_ts>2012-03-05 07:55:29 -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>JavaScriptCore</component>
          <version>528+ (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></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Eli Fidler">efidler</reporter>
          <assigned_to name="Eli Fidler">efidler</assigned_to>
          <cc>ap</cc>
    
    <cc>darin</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>539603</commentid>
    <comment_count>0</comment_count>
    <who name="Eli Fidler">efidler</who>
    <bug_when>2012-01-20 10:21:13 -0800</bug_when>
    <thetext>Some platforms don&apos;t localize strftime well, so use ICU to implement Date.toLocaleString()</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>539607</commentid>
    <comment_count>1</comment_count>
      <attachid>123341</attachid>
    <who name="Eli Fidler">efidler</who>
    <bug_when>2012-01-20 10:29:09 -0800</bug_when>
    <thetext>Created attachment 123341
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>539649</commentid>
    <comment_count>2</comment_count>
      <attachid>123341</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2012-01-20 11:29:13 -0800</bug_when>
    <thetext>Comment on attachment 123341
Patch

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

&gt; Source/JavaScriptCore/runtime/DatePrototype.cpp:210
&gt; +    UDateFormat* df = udat_open(timeStyle, dateStyle, 0, 0, -1, 0, 0, &amp;status);

Since the point of these functions is to format for the current locale, it seems critical to pass in a suitable locale string. See, for example, what is done for text break locales in the currentTextBreakLocaleID function.

I’m surprised that is OK to pass 0 for the locale string.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>539764</commentid>
    <comment_count>3</comment_count>
    <who name="Eli Fidler">efidler</who>
    <bug_when>2012-01-20 13:46:04 -0800</bug_when>
    <thetext>0 is the &quot;default locale&quot;. We rely on ICU for localization in many areas, so apps will have the default locale set appropriately to the desired locale.

I guess that&apos;s not true for OSX or IOS, but there&apos;s a different path here for that.

I could put the strftime path into HAVE(STRFTIME) or make a USE(ICU_DEFAULT_LOCALE) if you prefer.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>540207</commentid>
    <comment_count>4</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2012-01-21 19:02:02 -0800</bug_when>
    <thetext>(In reply to comment #3)
&gt; 0 is the &quot;default locale&quot;

Is that a general ICU feature, or one specific to RIM platforms? I ask because I don’t see it mentioned in ICU documentation.

&gt; We rely on ICU for localization in many areas

Sure, OS X and iOS do too. My question is about how the ICU API works.

&gt; I could put the strftime path into HAVE(STRFTIME) or make a USE(ICU_DEFAULT_LOCALE) if you prefer.

Since this code passes 0 for the locale it should be used only on platforms where that will do the right thing. To get the #if right we need to know how where that “0 means default locale” feature exists.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>540330</commentid>
    <comment_count>5</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2012-01-22 16:51:10 -0800</bug_when>
    <thetext>This may not be a regression from strftime, but the behavior would not be correct when locale changes at runtime, especially with WebKit2.

In Mac Safari, output of (new Date).toLocaleString() changes immediately after a user changes the format in system preferences.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>540616</commentid>
    <comment_count>6</comment_count>
    <who name="Eli Fidler">efidler</who>
    <bug_when>2012-01-23 09:45:21 -0800</bug_when>
    <thetext>NULL for default locale is an ICU-standard feature: &quot;Using the ICU C functions, NULL can be passed for a locale parameter to specify the default locale.&quot;

from: http://userguide.icu-project.org/locale#TOC-Default-Locales


For Alexey&apos;s point, Date.toLocaleString() will always use the current default locale. If that is changed using uloc_setDefault(), the new value should be immediately take effect.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>542280</commentid>
    <comment_count>7</comment_count>
      <attachid>123341</attachid>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2012-01-25 08:09:01 -0800</bug_when>
    <thetext>Comment on attachment 123341
Patch

Rejecting attachment 123341 from commit-queue.

New failing tests:
media/audio-garbage-collect.html
Full output: http://queues.webkit.org/results/11342538</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>542720</commentid>
    <comment_count>8</comment_count>
    <who name="Eli Fidler">efidler</who>
    <bug_when>2012-01-25 15:54:07 -0800</bug_when>
    <thetext>flaky test looks unrelated, so let&apos;s try cq+ again</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>542741</commentid>
    <comment_count>9</comment_count>
      <attachid>123341</attachid>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2012-01-25 16:11:50 -0800</bug_when>
    <thetext>Comment on attachment 123341
Patch

Clearing flags on attachment: 123341

Committed r105939: &lt;http://trac.webkit.org/changeset/105939&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>542742</commentid>
    <comment_count>10</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2012-01-25 16:11:54 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>542762</commentid>
    <comment_count>11</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2012-01-25 16:41:40 -0800</bug_when>
    <thetext>This broke all of the Mac builds on build.webkit.org as unicode/udat.h is not available.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>542768</commentid>
    <comment_count>12</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2012-01-25 16:48:19 -0800</bug_when>
    <thetext>I checked in a fix in r105943 to try and fix the Mac builds.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>570695</commentid>
    <comment_count>13</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2012-03-05 07:55:29 -0800</bug_when>
    <thetext>This has reportedly caused a regression, bug 80262.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>123341</attachid>
            <date>2012-01-20 10:29:09 -0800</date>
            <delta_ts>2012-01-25 16:11:50 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-76714-20120120132907.patch</filename>
            <type>text/plain</type>
            <size>2446</size>
            <attacher name="Eli Fidler">efidler</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTA1NDEwCmRpZmYgLS1naXQgYS9Tb3VyY2UvSmF2YVNjcmlw
dENvcmUvQ2hhbmdlTG9nIGIvU291cmNlL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwppbmRleCA0
NmMwM2RjN2M4NWYzY2M4ZWY1MGI0NDA3Y2EwYTk5NTI5Zjc0ZWM2Li5mNDY4MTViMzlmYWE2ZGVk
NmUwMGNhNWUzYTBiOWNiZTBiNzU4OGU4IDEwMDY0NAotLS0gYS9Tb3VyY2UvSmF2YVNjcmlwdENv
cmUvQ2hhbmdlTG9nCisrKyBiL1NvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKQEAgLTEs
MyArMSwxMyBAQAorMjAxMi0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