Bug 108791 - Support setLangAttributeAwareFormControlUIEnabled on Chromium Windows XP
Summary: Support setLangAttributeAwareFormControlUIEnabled on Chromium Windows XP
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: 2013-02-03 22:14 PST by Kent Tamura
Modified: 2013-02-03 22:59 PST (History)
2 users (show)

See Also:


Attachments
Patch (8.59 KB, patch)
2013-02-03 22:24 PST, 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 2013-02-03 22:14:00 PST
Support setLangAttributeAwareFormControlUIEnabled on Chromium Windows
Comment 1 Kent Tamura 2013-02-03 22:24:51 PST
Created attachment 186307 [details]
Patch
Comment 2 Kentaro Hara 2013-02-03 22:40:48 PST
Comment on attachment 186307 [details]
Patch

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

> Source/WebCore/platform/text/win/LocaleWin.cpp:71
> +static void initializeNameToLCIDMapIfEmpty(NameToLCIDMap& map)

ensureNameToLCIDMap() ? (I'm not sure of naming convention around here though.)

> Source/WebCore/platform/text/win/LocaleWin.cpp:108
> +    if (!name || !name[0])

Is it safe to access name[0] without checking name.length ?

> Source/WebCore/platform/text/win/LocaleWin.cpp:136
> -        return LOCALE_USER_DEFAULT;
> +        localeNameToLCID = convertLocaleNameToLCID;

Is it OK to fall through the code when localeNameToLCID is LOCALE_USER_DEFAULT ?
Comment 3 Kent Tamura 2013-02-03 22:47:40 PST
Comment on attachment 186307 [details]
Patch

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

>> Source/WebCore/platform/text/win/LocaleWin.cpp:108
>> +    if (!name || !name[0])
> 
> Is it safe to access name[0] without checking name.length ?

Yes, it is.  We have no ways to check length of 'name' because it is null-terminated string.

>> Source/WebCore/platform/text/win/LocaleWin.cpp:136
>> +        localeNameToLCID = convertLocaleNameToLCID;
> 
> Is it OK to fall through the code when localeNameToLCID is LOCALE_USER_DEFAULT ?

Yes. localeNameToLCID is a function pointer, and convertLocaleNameToLCID and LocaleNameToLCID are compatible.
Comment 4 Kentaro Hara 2013-02-03 22:48:24 PST
Comment on attachment 186307 [details]
Patch

thanks for clarification!
Comment 5 Kent Tamura 2013-02-03 22:59:42 PST
Committed r141741: <http://trac.webkit.org/changeset/141741>