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

Issue 541993003: Generate focusin for input type=date/time when selected by tab (Closed)

Created:
6 years, 3 months ago by Habib Virji
Modified:
6 years, 3 months ago
Reviewers:
keishi, tkent
CC:
blink-reviews, dglazkov+blink, blink-reviews-html_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Project:
blink
Visibility:
Public.

Description

Generate focusin for input type=date/time when selected by tab setFocusedElement fails to generate focusin event as the element in focus changes. This patch creates new handler for focusin event, which gets generated from handleFocusInEvent. * Source/core/dom/Document.cpp * Source/core/dom/Element.h * Source/core/dom/Element.cpp * Souce/core/page/FocusController.cpp dispatchFocusInEvent passes extra parameter FocusType, as handleFocusInEvent needs this. * Source/core/html/HTMLInputElement.h * Source/core/html/HTMLInputElement.cpp dispatchFocusInEvent, calls handleFocusInEvent handler when event is DOMFocusIn. Name of the function is handlerFocusInEvent, just in case if DOMFocusIn is deprecated only event used before dispatching handleFocusInEvent needs to be changed. * Source/core/html/forms/InputTypeView.h * Source/core/html/forms/InputTypeView.cpp handleFocusInEvent call pass to the form. * Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.h * Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp Removed handleFocusEvent and moved its code to handleFocusInEvent handler. BUG=408107 R=tkent, keishi TEST=Test covering date and time field when moved into by pressing tab, generates focusin event. Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=182023

Patch Set 1 #

Patch Set 2 : Added handleFocusInEvent handler for handling focus event for date/time input type #

Total comments: 6

Patch Set 3 : Moved code out of HTMLTextFormControlElement to HTMLInputElement #

Patch Set 4 : Moved code to HTMLInputElement #

Total comments: 6

Patch Set 5 : Updated tests and removed handleFocusInEvent handler #

Total comments: 14

Patch Set 6 : Updated to latest master and updated test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+90 lines, -10 lines) Patch
A LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-focusin-event.html View 1 2 3 4 5 1 chunk +47 lines, -0 lines 0 comments Download
A LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-focusin-event-expected.txt View 1 2 3 4 1 chunk +20 lines, -0 lines 0 comments Download
M Source/core/dom/Document.cpp View 1 2 3 4 5 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/dom/Element.h View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/Element.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLInputElement.h View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/html/HTMLInputElement.cpp View 1 2 3 4 5 1 chunk +7 lines, -0 lines 0 comments Download
M Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/forms/InputTypeView.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/html/forms/InputTypeView.cpp View 1 1 chunk +4 lines, -0 lines 0 comments Download
M Source/core/page/FocusController.cpp View 1 2 chunks +4 lines, -4 lines 0 comments Download

Messages

Total messages: 17 (3 generated)
Habib Virji
Please have a look.
6 years, 3 months ago (2014-09-08 08:35:07 UTC) #1
tkent
This is not a correct fix. We need to take care of "DOMFocusIn" event too. ...
6 years, 3 months ago (2014-09-08 08:45:42 UTC) #2
Habib Virji
Thanks for quick review. "Now we move the focus to a shadow element in "focus' ...
6 years, 3 months ago (2014-09-08 09:22:49 UTC) #3
tkent
On 2014/09/08 09:22:49, Habib Virji wrote: > Thanks for quick review. > > "Now we ...
6 years, 3 months ago (2014-09-09 01:12:50 UTC) #4
Habib Virji
Your suggestion makes sense, but sorry did not fathom comment#2 correctly. * Source/core/dom/Document.cpp * Source/core/dom/Element.h ...
6 years, 3 months ago (2014-09-09 16:21:14 UTC) #5
tkent
https://codereview.chromium.org/541993003/diff/20001/Source/core/html/HTMLTextFormControlElement.cpp File Source/core/html/HTMLTextFormControlElement.cpp (right): https://codereview.chromium.org/541993003/diff/20001/Source/core/html/HTMLTextFormControlElement.cpp#newcode98 Source/core/html/HTMLTextFormControlElement.cpp:98: void HTMLTextFormControlElement::dispatchFocusInEvent(const AtomicString& eventType, Element* oldFocusedElement, FocusType type) This ...
6 years, 3 months ago (2014-09-09 23:00:08 UTC) #6
Habib Virji
Thanks, code updated. https://codereview.chromium.org/541993003/diff/20001/Source/core/html/HTMLTextFormControlElement.cpp File Source/core/html/HTMLTextFormControlElement.cpp (right): https://codereview.chromium.org/541993003/diff/20001/Source/core/html/HTMLTextFormControlElement.cpp#newcode98 Source/core/html/HTMLTextFormControlElement.cpp:98: void HTMLTextFormControlElement::dispatchFocusInEvent(const AtomicString& eventType, Element* oldFocusedElement, ...
6 years, 3 months ago (2014-09-10 10:00:48 UTC) #7
tkent
https://codereview.chromium.org/541993003/diff/20001/Source/core/html/HTMLTextFormControlElement.cpp File Source/core/html/HTMLTextFormControlElement.cpp (right): https://codereview.chromium.org/541993003/diff/20001/Source/core/html/HTMLTextFormControlElement.cpp#newcode101 Source/core/html/HTMLTextFormControlElement.cpp:101: handleFocusInEvent(oldFocusedElement, type); On 2014/09/10 10:00:48, Habib Virji wrote: > ...
6 years, 3 months ago (2014-09-10 23:47:11 UTC) #8
Habib Virji
Thanks and apologise for being short sighted, handleFocusInEvent was not needed did not see it. ...
6 years, 3 months ago (2014-09-11 09:12:22 UTC) #9
tkent
https://codereview.chromium.org/541993003/diff/80001/LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-focusin-event.html File LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-focusin-event.html (right): https://codereview.chromium.org/541993003/diff/80001/LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-focusin-event.html#newcode11 LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-focusin-event.html:11: var input = document.querySelector('input'); This is not used. https://codereview.chromium.org/541993003/diff/80001/LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-focusin-event.html#newcode34 ...
6 years, 3 months ago (2014-09-11 23:52:55 UTC) #10
Habib Virji
Thanks, updated as suggested. https://codereview.chromium.org/541993003/diff/80001/LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-focusin-event.html File LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-focusin-event.html (right): https://codereview.chromium.org/541993003/diff/80001/LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-focusin-event.html#newcode11 LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-focusin-event.html:11: var input = document.querySelector('input'); On ...
6 years, 3 months ago (2014-09-12 08:18:26 UTC) #11
tkent
lgtm
6 years, 3 months ago (2014-09-15 23:33:19 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patchset/541993003/140001
6 years, 3 months ago (2014-09-15 23:33:34 UTC) #16
commit-bot: I haz the power
6 years, 3 months ago (2014-09-16 00:21:57 UTC) #17
Message was sent while issue was closed.
Committed patchset #6 (id:140001) as 182023

Powered by Google App Engine
This is Rietveld 408576698