Bug 108428

Summary: Click on a label element won't select input[type=date]
Product: WebKit Reporter: Kent Tamura <tkent>
Component: FormsAssignee: Kent Tamura <tkent>
Status: RESOLVED FIXED    
Severity: Normal CC: haraken, mifenton, morrita, ojan.autocc, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch 2
none
Patch 3
none
Patch 4 none

Description Kent Tamura 2013-01-30 22:27:59 PST
INPUT_MULTIPLE_FIELDS_UI: Click on a label element won't select input[type=date]

https://code.google.com/p/chromium/issues/detail?id=172850

<label>Date: <input type=date></label>

Click on the "Date:" label should focus on the date input.  If it was type=test, the click would focus on it.
Comment 1 Kent Tamura 2013-01-30 22:45:44 PST
Created attachment 185680 [details]
Patch
Comment 2 Kent Tamura 2013-01-31 00:19:52 PST
Created attachment 185700 [details]
Patch 2
Comment 3 Kentaro Hara 2013-01-31 00:49:49 PST
Comment on attachment 185700 [details]
Patch 2

View in context: https://bugs.webkit.org/attachment.cgi?id=185700&action=review

> LayoutTests/fast/forms/date/date-click-on-label.html:2
> +<body id=body>

Nit: id=body is not necessary.

> LayoutTests/fast/forms/date/date-click-on-label.html:7
> +document.body.offsetLeft; 

Nit: What is it for?

> LayoutTests/fast/forms/date/date-click-on-label.html:11
> +shouldBeEqualToString('document.activeElement.id', 'date1');

Shall we also check the value of document.activeElement.id before dispatching the click event?
Comment 4 Kent Tamura 2013-01-31 01:14:43 PST
Created attachment 185711 [details]
Patch 3

Follow review comments
Comment 5 Kent Tamura 2013-01-31 01:16:33 PST
Created attachment 185712 [details]
Patch 4

remove unrelated change
Comment 6 Kentaro Hara 2013-01-31 01:19:30 PST
Comment on attachment 185712 [details]
Patch 4

Looks better.
Comment 7 WebKit Review Bot 2013-01-31 03:19:12 PST
Comment on attachment 185712 [details]
Patch 4

Clearing flags on attachment: 185712

Committed r141395: <http://trac.webkit.org/changeset/141395>
Comment 8 WebKit Review Bot 2013-01-31 03:19:16 PST
All reviewed patches have been landed.  Closing bug.