Summary: | [Chromium-Win] Implement LocaleWin::dateFormat | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Kent Tamura <tkent> | ||||||||
Component: | Platform | Assignee: | Kent Tamura <tkent> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | haraken, morrita, webkit.review.bot | ||||||||
Priority: | P2 | ||||||||||
Version: | 528+ (Nightly build) | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
Bug Depends on: | 98109 | ||||||||||
Bug Blocks: | 97997 | ||||||||||
Attachments: |
|
Description
Kent Tamura
2012-10-01 22:53:33 PDT
Created attachment 166642 [details]
Patch
Created attachment 166644 [details]
Patch 2
Comment on attachment 166644 [details] Patch 2 View in context: https://bugs.webkit.org/attachment.cgi?id=166644&action=review > Source/WebCore/ChangeLog:13 > + No new tests. The function is not used yet. Isn't there any way to add a test? At least I want a manual test. > Source/WebCore/platform/text/LocaleWin.cpp:703 > + for (unsigned i = 0; i < literal.length(); ++i) { > + if (literal[i] == '\'') > + buffer.append("''"); > + else { > + String escaped = literal.substring(i); > + escaped.replace(ASCIILiteral("'"), ASCIILiteral("''")); > + buffer.append("'"); > + buffer.append(escaped); > + buffer.append("'"); > + return; > + } > + } I don't fully understand the behavior: '' => '''''' 'abc' => '''abc''' a'bc' => 'a''bc''' ? Created attachment 166657 [details]
Patch 3
Add test
Comment on attachment 166644 [details] Patch 2 View in context: https://bugs.webkit.org/attachment.cgi?id=166644&action=review >> Source/WebCore/ChangeLog:13 >> + No new tests. The function is not used yet. > > Isn't there any way to add a test? At least I want a manual test. I exposed a function of LocaleWin, and added a test to LocaleWinTest.cpp. >> Source/WebCore/platform/text/LocaleWin.cpp:703 >> + } > > I don't fully understand the behavior: > > '' => '''''' > 'abc' => '''abc''' > a'bc' => 'a''bc''' > > ? | '' => '''''' This should be: '' => '''' | 'abc' => '''abc''' | a'bc' => 'a''bc''' Right. - ' is always represented as '' - other letters are always quoted by ' and '. - If a source string starts with ', we need special handling. If the source string was ' and we replaced it with '' then wrap with ' and ', the function would produce '''', which will be recognized as two quotes. Comment on attachment 166657 [details]
Patch 3
Looks OK.
Comment on attachment 166657 [details] Patch 3 Clearing flags on attachment: 166657 Committed r130242: <http://trac.webkit.org/changeset/130242> All reviewed patches have been landed. Closing bug. |