RESOLVED FIXED 93929
[Forms] Make input type "time" to use multiple field time input UI
https://bugs.webkit.org/show_bug.cgi?id=93929
Summary [Forms] Make input type "time" to use multiple field time input UI
yosin
Reported 2012-08-13 21:15:36 PDT
This feature is inside ENABLE_INPUT_TIME_MULTIPLE_FILED build flag.
Attachments
Patch 1 (13.29 KB, patch)
2012-08-13 21:31 PDT, yosin
no flags
Archive of layout-test-results from gce-cr-linux-06 (316.25 KB, application/zip)
2012-08-13 22:11 PDT, WebKit Review Bot
no flags
Patch 2 (17.34 KB, patch)
2012-08-13 23:45 PDT, yosin
no flags
Patch 3 (15.00 KB, patch)
2012-08-14 00:30 PDT, yosin
no flags
Patch 4 (16.15 KB, patch)
2012-08-14 03:23 PDT, yosin
no flags
Patch 5 (16.23 KB, patch)
2012-08-14 19:05 PDT, yosin
no flags
yosin
Comment 1 2012-08-13 21:31:09 PDT
yosin
Comment 2 2012-08-13 21:34:23 PDT
Comment on attachment 158204 [details] Patch 1 Could you review this patch? Thanks in advance.
WebKit Review Bot
Comment 3 2012-08-13 22:11:20 PDT
Comment on attachment 158204 [details] Patch 1 Attachment 158204 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/13492397 New failing tests: fast/forms/time/time-stepup-stepdown-from-renderer.html fast/forms/time/time-input-visible-string.html
WebKit Review Bot
Comment 4 2012-08-13 22:11:23 PDT
Created attachment 158211 [details] Archive of layout-test-results from gce-cr-linux-06 The attached test failures were seen while running run-webkit-tests on the chromium-ews. Bot: gce-cr-linux-06 Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'> Platform: Linux-2.6.39-gcg-201203291735-x86_64-with-Ubuntu-10.04-lucid
Kent Tamura
Comment 5 2012-08-13 23:27:31 PDT
Comment on attachment 158204 [details] Patch 1 View in context: https://bugs.webkit.org/attachment.cgi?id=158204&action=review > Source/WebCore/ChangeLog:16 > + * bindings/generic/RuntimeEnabledFeatures.cpp: > + (WebCore): Incorrect file entry > Source/WebCore/html/HTMLInputElement.cpp:728 > +#if ENABLE(INPUT_TYPE_TIME_MULTIPLE_FIELDS) > + if (attribute.name() == maxAttr || attribute.name() == minAttr || attribute.name() == stepAttr) > + m_inputType->stepRangeChanged(); > +#endif No need to introduce InputType::stepRangeChanged(). We should override InputType::minOrMaxAttributeChanged() and InputType::stepAttributeChanged(). > Source/WebCore/html/TimeInputType.cpp:146 > + ChromeClient* chromeClient = document->page() ? document->page()->chrome()->client() : 0; > + bool shouldAddDecorations = chromeClient && chromeClient->willAddTextFieldDecorationsTo(element()); > + > + if (shouldAddDecorations) > + chromeClient->addTextFieldDecorationsTo(element()); Remove this code. The time type is no longer a text field. So we don't care about TextFieldDecorations. > Source/WebCore/html/TimeInputType.cpp:154 > + DateComponents date; > + if (parseToDateComponents(element()->value(), &date)) > + m_dateTimeEditElement->setValueAsDate(date); > + else { > + setMillisecondToDateComponents(stepRange.minimum().toDouble(), &date); > + m_dateTimeEditElement->setEmptyValue(date); > + } should call updateInnerTextValue(). > Source/WebCore/html/TimeInputType.cpp:160 > + m_dateTimeEditElement->removeEditControlOwner(); > + m_dateTimeEditElement.clear(); We need to detach m_dateTimeEditElement from the oldest ShadowRoot. > Source/WebCore/html/TimeInputType.h:47 > +#if ENABLE(INPUT_TYPE_TIME_MULTIPLE_FIELDS) > +#include "DateTimeEditElement.h" > +#define TIME_INPUT_TYPE_BASE_CLASS_LIST public BaseDateAndTimeInputType, private DateTimeEditElement::EditControlOwner > +#else > +#define TIME_INPUT_TYPE_BASE_CLASS_LIST public BaseDateAndTimeInputType > +#endif > + > namespace WebCore { > > -class TimeInputType : public BaseDateAndTimeInputType { > +class TimeInputType : TIME_INPUT_TYPE_BASE_CLASS_LIST { This looks ugly. How about introducing a small proxy class implementing EditControlOwner? > Source/WebCore/html/TimeInputType.h:89 > + RefPtr<DateTimeEditElement> m_dateTimeEditElement; This should be a raw pointer instead of RefPtr<>.
yosin
Comment 6 2012-08-13 23:45:56 PDT
yosin
Comment 7 2012-08-14 00:30:03 PDT
yosin
Comment 8 2012-08-14 00:36:09 PDT
Comment on attachment 158244 [details] Patch 3 Could you review this patch? Thanks in advance. = Changes since the last review = * Add test expectations for Chromium * Remove InputType::stepRangeChanged() ** No changes for HTMLInputElement.cpp and InputType.{cpp,h} * Introduce DateTimeEditControlOwner class for avoiding ugly #ifdef on base class list.
Kent Tamura
Comment 9 2012-08-14 02:43:55 PDT
Comment on attachment 158244 [details] Patch 3 View in context: https://bugs.webkit.org/attachment.cgi?id=158244&action=review > Source/WebCore/html/TimeInputType.cpp:45 > +#include "Chrome.h" Do we need Chrome.h? > Source/WebCore/html/TimeInputType.cpp:135 > + Document* document = element()->document(); The local variable 'document' is used only once. We don't need it. > Source/WebCore/html/TimeInputType.h:52 > +#if ENABLE(INPUT_TYPE_TIME_MULTIPLE_FIELDS) > +class DateTimeEditElementOwner : protected DateTimeEditElement::EditControlOwner { > +}; > +#else > +class DateTimeEditElementOwner { > +}; > +#endif > + > +class TimeInputType : public BaseDateAndTimeInputType, private DateTimeEditElementOwner { Oh, I didn't mean it though this patch is better than "Patch 1" I meant we didn't change the base class list, but TimeInputType had an data member of DateTimeEditElementOwnerImpl class.
yosin
Comment 10 2012-08-14 03:23:25 PDT
yosin
Comment 11 2012-08-14 03:25:23 PDT
Comment on attachment 158276 [details] Patch 4 Could you review this patch? Thanks in advance. = Changes since the last review = * Introduce TimeInputType::DateTimeEditOwnerImpl class and TimeInputType::m_dateTimeEditOwnerImpl for keep base class list of TimeInputType class.
Kent Tamura
Comment 12 2012-08-14 03:47:48 PDT
Comment on attachment 158276 [details] Patch 4 View in context: https://bugs.webkit.org/attachment.cgi?id=158276&action=review > Source/WebCore/html/TimeInputType.cpp:283 > +#endif // ENABLE(INPUT_TYPE_TIME_MULTIPLE_FIELDS) The comment is confusing. I guess some people recognize the code just above the comment is enabled if ENABLE(INPUT_TYPE_TIME_MULTIPLE_FILEDS). We had better remove the comment because we don't have a common comment notation for the end of #else block.
yosin
Comment 13 2012-08-14 19:05:46 PDT
yosin
Comment 14 2012-08-14 19:08:14 PDT
Comment on attachment 158478 [details] Patch 5 Clearing flags on attachment: 158478 Committed r125634: <http://trac.webkit.org/changeset/125634>
yosin
Comment 15 2012-08-14 19:08:21 PDT
All reviewed patches have been landed. Closing bug.
Yuta Kitamura
Comment 16 2012-08-14 22:56:31 PDT
This change broke Chromium-android, and I landed a build fix: <http://trac.webkit.org/changeset/125649>. Please ping me in case this fix is not right.
Note You need to log in before you can comment on or make changes to this bug.