Bug 106416 - INPUT_MULTIPLE_FIELDS_UI: Step-up/-down of week field should respect min/max attributes
Summary: INPUT_MULTIPLE_FIELDS_UI: Step-up/-down of week field should respect min/max ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-08 22:01 PST by Kunihiko Sakamoto
Modified: 2013-01-09 00:54 PST (History)
6 users (show)

See Also:


Attachments
Patch (18.85 KB, patch)
2013-01-08 22:07 PST, Kunihiko Sakamoto
no flags Details | Formatted Diff | Diff
Patch 2 (18.79 KB, patch)
2013-01-08 23:33 PST, Kunihiko Sakamoto
no flags Details | Formatted Diff | Diff
Patch 3 (18.73 KB, patch)
2013-01-08 23:43 PST, Kunihiko Sakamoto
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kunihiko Sakamoto 2013-01-08 22:01:21 PST
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
Comment 1 Kunihiko Sakamoto 2013-01-08 22:07:20 PST
Created attachment 181847 [details]
Patch
Comment 2 Kent Tamura 2013-01-08 22:17:07 PST
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 3 Kunihiko Sakamoto 2013-01-08 22:55:42 PST
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?
Comment 4 Kunihiko Sakamoto 2013-01-08 23:33:45 PST
Created attachment 181856 [details]
Patch 2
Comment 5 Kunihiko Sakamoto 2013-01-08 23:36:53 PST
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 6 Kent Tamura 2013-01-08 23:39:11 PST
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.
Comment 7 Kunihiko Sakamoto 2013-01-08 23:43:14 PST
Created attachment 181859 [details]
Patch 3
Comment 8 Kunihiko Sakamoto 2013-01-08 23:43:51 PST
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 9 Kent Tamura 2013-01-08 23:50:37 PST
Comment on attachment 181859 [details]
Patch 3

ok
Comment 10 WebKit Review Bot 2013-01-09 00:54:23 PST
Comment on attachment 181859 [details]
Patch 3

Clearing flags on attachment: 181859

Committed r139172: <http://trac.webkit.org/changeset/139172>
Comment 11 WebKit Review Bot 2013-01-09 00:54:27 PST
All reviewed patches have been landed.  Closing bug.