Use min/max attributes of <input type=week> to limit values selectable by step-up/down. Related bug (for month/day fields): https://bugs.webkit.org/show_bug.cgi?id=106212
Created attachment 181847 [details] Patch
Comment on attachment 181847 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=181847&action=review > LayoutTests/fast/forms/week-multiple-fields/week-multiple-fields-readonly-subfield.html:46 > +shouldBeTrue('isReadOnlyField(createWeekInput("2012-W50", "2012-W50", ""), pseudoWeek)'); In this case, what does input.value return?
Comment on attachment 181847 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=181847&action=review >> LayoutTests/fast/forms/week-multiple-fields/week-multiple-fields-readonly-subfield.html:46 >> +shouldBeTrue('isReadOnlyField(createWeekInput("2012-W50", "2012-W50", ""), pseudoWeek)'); > > In this case, what does input.value return? Ah, good point! It returns empty, but user cannot change the value because it's readonly. Perhaps we shouldn't make the field readonly in such case?
Created attachment 181856 [details] Patch 2
Updated patch that not make week field readonly. In the case of value="" min="2012-W50" max="2012-W50", initial value of week field is now blank.
Comment on attachment 181856 [details] Patch 2 View in context: https://bugs.webkit.org/attachment.cgi?id=181856&action=review > Source/WebCore/html/shadow/DateTimeEditElement.cpp:261 > + RefPtr<DateTimeFieldElement> field = DateTimeWeekFieldElement::create(document, m_editElement, minWeek, maxWeek); > + m_editElement.addField(field); The variable 'field' is unnecessary.
Created attachment 181859 [details] Patch 3
Comment on attachment 181856 [details] Patch 2 View in context: https://bugs.webkit.org/attachment.cgi?id=181856&action=review >> Source/WebCore/html/shadow/DateTimeEditElement.cpp:261 >> + m_editElement.addField(field); > > The variable 'field' is unnecessary. Done.
Comment on attachment 181859 [details] Patch 3 ok
Comment on attachment 181859 [details] Patch 3 Clearing flags on attachment: 181859 Committed r139172: <http://trac.webkit.org/changeset/139172>
All reviewed patches have been landed. Closing bug.