Bug 100471 - [Chromium-Win] Support shortTimeFormat
Summary: [Chromium-Win] Support shortTimeFormat
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kent Tamura
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-25 23:59 PDT by Kent Tamura
Modified: 2012-10-26 00:43 PDT (History)
3 users (show)

See Also:


Attachments
Patch (81.08 KB, patch)
2012-10-26 00:08 PDT, Kent Tamura
haraken: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>