Implement value sanitization algorithm for type=datetime
https://bugs.webkit.org/show_bug.cgi?id=76893

Patch by Kunihiko Sakamoto <ksakamoto@chromium.org> on 2012-10-18
Reviewed by Kent Tamura.

Source/WebCore:

Implement the value sanitization algorithm for type=datetime that adjusts
the value to a valid normalized forced-UTC global date and time string.
See http://www.whatwg.org/specs/web-apps/current-work/multipage/common-microsyntaxes.html#valid-normalized-forced-utc-global-date-and-time-string

Test: fast/forms/datetime/datetime-value-sanitization.html

* html/DateTimeInputType.cpp:
(WebCore::DateTimeInputType::sanitizeValue): Implemented.
(WebCore):
* html/DateTimeInputType.h:
(DateTimeInputType): Add sanitizeValue.
* platform/DateComponents.cpp:
(WebCore::DateComponents::addMinute): Fixed a bug that caused wrong adjustment
of timezone offset (e.g. 2012-10-17T01:00+01:00 -> 2012-10-17T01:-60Z).

LayoutTests:

Added a test for the value sanitization algorithm for type=datetime.
Also updated affected tests.

* fast/forms/datetime/ValidityState-typeMismatch-datetime-expected.txt:
* fast/forms/datetime/ValidityState-typeMismatch-datetime.html:
'0001-01-01T00:00+01:00' is an invalid value because that is before
0001-01-01 00:00 UTC. '0001-01-01T00:00-01:00' is a valid value.
* fast/forms/datetime/datetime-value-sanitization-expected.txt: Added.
* fast/forms/datetime/datetime-value-sanitization.html: Added.
* fast/forms/datetime/input-valueasdate-datetime-expected.txt:
* fast/forms/datetime/input-valueasdate-datetime.html:
Setting valueAsDate should run the algorithm to convert a Date object to a
string, that returns valid normalized forced-UTC global date and time string.
See http://www.whatwg.org/specs/web-apps/current-work/multipage/common-input-element-attributes.html#dom-input-valueasdate
* fast/forms/datetime/input-valueasnumber-datetime-expected.txt:
* fast/forms/datetime/input-valueasnumber-datetime.html:
Setting valueAsNumber should run the algorithm to convert a number to a
string, that returns valid normalized forced-UTC global date and time string.
See http://www.whatwg.org/specs/web-apps/current-work/multipage/common-input-element-attributes.html#dom-input-valueasnumber

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131853 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add shortMonthLabels and shortStandAloneMonthLabels to Localizer
https://bugs.webkit.org/show_bug.cgi?id=99787

Reviewed by Kentaro Hara.

Source/WebCore:

This is going to be used for input[type=month] UI. This doesn't affect
any bahevior yet.

Tests: Add some tests to Source/WebKit/chromium/tests/, and will add
layout tests later.

* platform/text/Localizer.h:
(Localizer): Add shortMonthLabels and shortStandAloneMonthLabels as pure
virtual member functions.

* platform/text/LocaleICU.h:
(LocaleICU): Declare shortMonthLabels and shortStandAloneMonthLabels.
* platform/text/LocaleICU.cpp:
(WebCore::LocaleICU::shortMonthLabels): Added.
(WebCore::LocaleICU::shortStandAloneMonthLabels): Added.

* platform/text/LocaleNone.cpp:
(LocaleNone): Declare shortMonthLabels and shortStandAloneMonthLabels.
(WebCore::LocaleNone::shortMonthLabels):
Added. Always returns English labels.
(WebCore::LocaleNone::shortStandAloneMonthLabels):
Addes. Just calls shortMonthLabels.

* platform/text/LocaleWin.h:
(LocaleWin): Declare shortMonthLabels and shortStandAloneMonthLabels.
* platform/text/LocaleWin.cpp:
(WebCore::LocaleWin::shortMonthLabels): Added.
(WebCore::LocaleWin::shortStandAloneMonthLabels):
Added. Always returns shortMonthLabels.

* platform/text/mac/LocaleMac.h:
(LocaleMac): Declare shortMonthLabels and shortStandAloneMonthLabels.
* platform/text/mac/LocaleMac.mm:
(WebCore::LocaleMac::shortMonthLabels): Added.
(WebCore::LocaleMac::shortStandAloneMonthLabels): Added.

Source/WebKit/chromium:

* tests/LocaleMacTest.cpp:
(LocaleMacTest::shortMonthLabel): A helper.
(LocaleMacTest::shortStandAloneMonthLabel): Ditto.
(TEST_F): Added tests for some locales.
* tests/LocaleWinTest.cpp:
(LocaleWinTest::shortMonthLabel): A helper.
(TEST_F): Added tests for some locales. We don't test
LocaleWin::shortStandAloneMonthLabels because it is identical to
shortMonthLabels.
* tests/LocalizedDateICUTest.cpp:
(LocalizedDateICUTest::shortMonthLabel): A helper.
(LocalizedDateICUTest::shortStandAloneMonthLabel): Ditto.
(TEST_F): Added tests for some locales.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131854 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove entries for now-passing tests in chroum-mac-mountainlion.

Unreviewed, expectations change.

* platform/chromium-mac-mountainlion/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131855 268f45cc-cd09-0410-ab3c-d52691b4dbfc
make move_overwritten_baselines_to work again while rebaselining
https://bugs.webkit.org/show_bug.cgi?id=99793

Reviewed by Ojan Vafai.

We used to have code that would help when rebaselining results
for new ports (e.g., when moving from Lion to Mountain Lion) but
it appears that code bitrotted during all the refactoring since
the last time we needed this. This patch makes things work
again, adds more tests that will hopefully make clearer what
is supposed to work, and renames various parameters to be
consistent.

* Scripts/webkitpy/layout_tests/port/builders.py:
(move_overwritten_baselines_to):
(builder_path_for_port_name):
* Scripts/webkitpy/tool/commands/rebaseline.py:
(RebaselineTest.__init__):
(RebaselineTest._copy_existing_baseline):
(RebaselineTest._rebaseline_test):
(RebaselineTest.execute):
(AbstractParallelRebaselineCommand._rebaseline_commands):
* Scripts/webkitpy/tool/commands/rebaseline_unittest.py:
(test_rebaseline_json_with_move_overwritten_baselines_to):
(test_rebaseline_test_internal_with_move_overwritten_baselines_to):
* Scripts/webkitpy/tool/servers/gardeningserver_unittest.py:
(GardeningServerTest.test_rebaselineall):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131856 268f45cc-cd09-0410-ab3c-d52691b4dbfc