Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Issue 11420033: Merge 134390 - Unable to set valid time value to input[type=time] with user interaction in some cas… (Closed)

Created:
8 years, 1 month ago by tkent
Modified:
8 years, 1 month ago
Reviewers:
tkent
CC:
chromium-reviews
Base URL:
http://svn.webkit.org/repository/webkit/branches/chromium/1312/
Visibility:
Public.

Description

Merge 134390 - Unable to set valid time value to input[type=time] with user interaction in some cases https://bugs.webkit.org/show_bug.cgi?id=102048 Reviewed by Kentaro Hara. Source/WebCore: The implementations of shouldMillisecondFieldReadOnly, shouldMinuteFieldReadOnly, and shouldSecondFieldReadOnly were incorrect. We need to check if a part of the minimum value matches to the corresponding part of the current value. Also, we had better check hour field editability. Test: fast/forms/time-multiple-fields/time-multiple-fields-readonly-subfield.html * html/BaseMultipleFieldsDateAndTimeInputType.cpp: (WebCore::BaseMultipleFieldsDateAndTimeInputType::shouldHaveSecondField): Fix a problem that hh:mm:00.sss didn't create a seconds field. * html/shadow/DateTimeEditElement.cpp: (DateTimeEditBuilder): Add shouldHourFieldReadOnly declaration. (WebCore::DateTimeEditBuilder::visitField): Add shouldHourFieldReadOnly check to Hour11/Hour12/Hour23/Hour24/Period fields. (WebCore::DateTimeEditBuilder::shouldHourFieldReadOnly): Added. An hour field should be read-only if the step value is a multiple of a day and the hour part of the minimum value matches to the hour part of the value. (WebCore::DateTimeEditBuilder::shouldMillisecondFieldReadOnly): A millisecond field should be read-only if the step value is a multiple of one second and the millisecond part of the minimum value matches to the millisecond part of the value. (WebCore::DateTimeEditBuilder::shouldMinuteFieldReadOnly): A minute field should be read-only if the step value is a multiple of one hour and the minute part of the minimum value matches to the minute part of the value. (WebCore::DateTimeEditBuilder::shouldSecondFieldReadOnly): A second field should be read-only if the step value is a multiple of one minute and the second part of the minimum value matches to the second part of the value. * platform/Decimal.cpp: (WebCore::Decimal::remainder): Fix a bug in case that the fractional part of quotient is >= 0.5. Also make this matches to C99, C++11, ECMAScript behavior. Source/WebKit/chromium: * tests/DecimalTest.cpp: (TEST_F): Update and add tests. 2.1 % 3 should be 2.1 10 % -3 should be 1 -10 % -3 should be -1 3.6 % 1.3 should be 1 500 % 1000 should be 500 -500 % 1000 should be -500 LayoutTests: * fast/forms/time-multiple-fields/time-multiple-fields-readonly-subfield-expected.txt: Added. * fast/forms/time-multiple-fields/time-multiple-fields-readonly-subfield.html: Added. TBR=tkent@chromium.org BUG=crbug.com/160501 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=134892

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+63 lines, -16 lines) Patch
A + LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-readonly-subfield.html View 0 chunks +-1 lines, --1 lines 0 comments Download
A + LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-readonly-subfield-expected.txt View 0 chunks +-1 lines, --1 lines 0 comments Download
M Source/WebCore/html/BaseMultipleFieldsDateAndTimeInputType.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/WebCore/html/shadow/DateTimeEditElement.cpp View 4 chunks +56 lines, -13 lines 0 comments Download
M Source/WebCore/platform/Decimal.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/WebKit/chromium/tests/DecimalTest.cpp View 1 chunk +6 lines, -2 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
tkent
8 years, 1 month ago (2012-11-16 05:49:22 UTC) #1
tkent
8 years, 1 month ago (2012-11-16 05:55:12 UTC) #2
LGTM

Powered by Google App Engine
This is Rietveld 408576698