Bug 100471

Summary: [Chromium-Win] Support shortTimeFormat
Product: WebKit Reporter: Kent Tamura <tkent>
Component: PlatformAssignee: Kent Tamura <tkent>
Status: RESOLVED FIXED    
Severity: Normal CC: haraken, morrita, yutak
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch haraken: review+

Description Kent Tamura 2012-10-25 23:59:33 PDT
LocaleWin haven't supported shortTimeFormat(), and it have returned the same format as timeFormat().
Comment 1 Kent Tamura 2012-10-26 00:08:45 PDT
Created attachment 170835 [details]
Patch
Comment 2 Kent Tamura 2012-10-26 00:21:12 PDT
Comment on attachment 170835 [details]
Patch

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

> Source/WebCore/ChangeLog:14
> +        (WebCore::LocaleWin::shortTimeFormat):
> +        Gets a format by LOCALE_SSHORTTIME. If it fails, remove "<delimiter>ss"
> +        from the format by LOCALE_STIMEFORMAT.

Note that I verified that this algorithm worked well for all supported locales on Windows XP.
Comment 3 Kentaro Hara 2012-10-26 00:34:00 PDT
Comment on attachment 170835 [details]
Patch

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

> Source/WebCore/platform/text/LocaleWin.cpp:709
> +    if (!m_timeFormatWithoutSeconds.isNull())

I'm a bit confused that you're sometimes using isNull() and sometimes isEmpty(). Here m_timeFormatWithoutSeconds can be an Empty string, which is one of valid results, so you are using isNull(), right?
Comment 4 Kent Tamura 2012-10-26 00:40:24 PDT
Comment on attachment 170835 [details]
Patch

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

>> Source/WebCore/platform/text/LocaleWin.cpp:709
>> +    if (!m_timeFormatWithoutSeconds.isNull())
> 
> I'm a bit confused that you're sometimes using isNull() and sometimes isEmpty(). Here m_timeFormatWithoutSeconds can be an Empty string, which is one of valid results, so you are using isNull(), right?

Yeah, isNull is more appropriate than isEmpty in these functions because we'd like to know initialized-or-not.  isEmpty also works well in usual cases, but isNull is faster than isEmpty.
Comment 5 Kent Tamura 2012-10-26 00:43:45 PDT
Committed r132579: <http://trac.webkit.org/changeset/132579>