Bug 108791

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

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>