Bug 90236 - [Chromium-Windows] Implement functions for localized time format information
Summary: [Chromium-Windows] Implement functions for localized time format information
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: yosin
URL:
Keywords:
Depends on: 89963
Blocks: 88970
  Show dependency treegraph
 
Reported: 2012-06-28 19:09 PDT by yosin
Modified: 2012-07-10 23:52 PDT (History)
1 user (show)

See Also:


Attachments
Patch 1 (15.28 KB, patch)
2012-07-10 00:58 PDT, yosin
no flags Details | Formatted Diff | Diff
Patch 1 (15.28 KB, patch)
2012-07-10 01:00 PDT, yosin
no flags Details | Formatted Diff | Diff
Patch 3 (16.21 KB, patch)
2012-07-10 01:33 PDT, yosin
no flags Details | Formatted Diff | Diff
Patch 4 (16.48 KB, patch)
2012-07-10 22:20 PDT, yosin
no flags Details | Formatted Diff | Diff
Patch 5 (16.22 KB, patch)
2012-07-10 22:53 PDT, yosin
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description yosin 2012-06-28 19:09:13 PDT
To implement input type "time" multiple fields UI, we need following functions for Windows:
1. localizedTimeFormatText()
2. localizedShortTimeFormatText()
3. timeAMPMLables()
Comment 1 yosin 2012-07-10 00:58:30 PDT
Created attachment 151411 [details]
Patch 1
Comment 2 yosin 2012-07-10 01:00:34 PDT
Created attachment 151413 [details]
Patch 1
Comment 3 yosin 2012-07-10 01:00:58 PDT
Comment on attachment 151413 [details]
Patch 1

Could you review this patch?
Thanks in advance.
Comment 4 yosin 2012-07-10 01:33:15 PDT
Created attachment 151418 [details]
Patch 3
Comment 5 yosin 2012-07-10 01:33:44 PDT
Comment on attachment 151418 [details]
Patch 3

Could you review this patch?
Thanks in advance.
Comment 6 Kent Tamura 2012-07-10 02:39:10 PDT
Comment on attachment 151418 [details]
Patch 3

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

> Source/WebCore/platform/text/LocaleWin.cpp:624
> +// This class used for converting Windows time pattern format[1] into LDML[2]
> +// time format string.
> +// [1] http://msdn.microsoft.com/en-us/library/windows/desktop/dd318148(v=vs.85).aspx
> +// [2] LDML http://unicode.org/reports/tr35/tr35-6.html#Date_Format_Patterns
> +static String parseWindowsTimeFormat(const String& windowsTimeFormat)

So, the function name should convertWindowsTimeFormatToLDML() or something.

> Source/WebCore/platform/text/LocaleWin.cpp:641
> +        } else if (fieldType == lastFieldType) {
> +            ++counter;
> +            if (counter == 2 && lastFieldType != DateTimeFormat::FieldTypePeriod)
> +                builder.append(static_cast<UChar>(lastFieldType));
> +        } else {
> +            builder.append(static_cast<UChar>(lastFieldType));
> +            counter = 1;
> +        }
> +        lastFieldType = fieldType;

Is this code compilable?  lastFieldType is not declared.

> Source/WebCore/platform/text/LocaleWin.cpp:659
> +String LocaleWin::localizedShortTimeFormatText()
> +{
> +    if (m_shortTimeFormatText.isEmpty()) {
> +        // Note: LOCALE_SSHORTTIME is available for Windows 7 and later.
> +        m_shortTimeFormatText = parseWindowsTimeFormat(getLocaleInfoString(LOCALE_SSHORTTIME));
> +        if (m_shortTimeFormatText.isEmpty())
> +            m_shortTimeFormatText = localizedShortTimeFormatText();

Why calling this function recursively?

> Source/WebKit/chromium/tests/LocaleWinTest.cpp:63
> +        en_US = 0x409,
> +        fr_FR = 0x40C,
> +        ja_JP = 0x411,

Please follow naming rule for enum.
http://www.webkit.org/coding/coding-style.html#names-enum-members
Comment 7 yosin 2012-07-10 22:20:19 PDT
Created attachment 151597 [details]
Patch 4
Comment 8 yosin 2012-07-10 22:21:57 PDT
Comment on attachment 151597 [details]
Patch 4

Could you review this patch?
Thanks in advance.

= Changes since the last review =
* Fixed compilation error
* Update enum names in LocaleWinTest.cpp
* I uploaded wrong version of the files on Patch 3.
Comment 9 Kent Tamura 2012-07-10 22:42:04 PDT
Comment on attachment 151597 [details]
Patch 4

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

> Source/WebCore/platform/text/LocaleWin.cpp:662
> +        // Note: LOCALE_SSHORTTIME is available for Windows 7 and later.
> +        m_shortTimeFormatText = convertWindowsTimeFormatToLDML(getLocaleInfoString(LOCALE_SSHORTTIME));
> +        if (m_shortTimeFormatText.isEmpty())
> +            m_shortTimeFormatText = timeFormatText();

So, we always show a second field on Windows XP and Vista, and not show it on Windows 7 even though the HTML code is identical?  i don't think such difference is acceptable.
Comment 10 Kent Tamura 2012-07-10 22:43:26 PDT
(In reply to comment #8)
> * I uploaded wrong version of the files on Patch 3.

Please always re-review your patch before uploading.  Such patch wastes reviewer's time, and you made such mistakes many times.
Comment 11 yosin 2012-07-10 22:53:01 PDT
Created attachment 151605 [details]
Patch 5
Comment 12 yosin 2012-07-10 22:55:11 PDT
Comment on attachment 151605 [details]
Patch 5

Could you review this patch?
Thanks in advance.

= Changes since the last review =
* Make LocaleWin::shortTimeFormatText not to use LOCALE_SSHORTTIME
* Update LocaleWinTest/shortTimeFormatText
Comment 13 Kent Tamura 2012-07-10 23:50:36 PDT
Comment on attachment 151605 [details]
Patch 5

ok
Comment 14 yosin 2012-07-10 23:52:35 PDT
Comment on attachment 151605 [details]
Patch 5

Clearing flags on attachment: 151605

Committed r122303: <http://trac.webkit.org/changeset/122303>
Comment 15 yosin 2012-07-10 23:52:42 PDT
All reviewed patches have been landed.  Closing bug.