Summary: | INPUT_MULTIPLE_FIELDS_UI: Mouse click not on sub-fields in multiple fields input should not move focus | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Kent Tamura <tkent> | ||||||||
Component: | Forms | Assignee: | Kent Tamura <tkent> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | haraken, mifenton, morrita, nbarth, ojan.autocc, webkit.review.bot | ||||||||
Priority: | P2 | ||||||||||
Version: | 528+ (Nightly build) | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
Attachments: |
|
Description
Kent Tamura
2013-02-11 21:53:48 PST
Created attachment 187773 [details]
Patch
Comment on attachment 187773 [details] Patch Attachment 187773 [details] did not pass mac-ews (mac): Output: http://queues.webkit.org/results/16496635 Created attachment 187781 [details]
Patch 2
Fix mac build
Comment on attachment 187781 [details]
Patch 2
Looks OK
Comment on attachment 187781 [details] Patch 2 Clearing flags on attachment: 187781 Committed r142592: <http://trac.webkit.org/changeset/142592> All reviewed patches have been landed. Closing bug. Created attachment 187803 [details] INPUT_MULTIPLE_FIELDS_UI: Mouse click not on sub-fields in multiple fields input should not move focus https://bugs.webkit.org/show_bug.cgi?id=109544 Reviewed by Kentaro Hara. Source/WebCore: This is similar to Bug 108914, "Should not move focus if the element already has focus." We fixed a focus() case in Bug 108914. However we still have the problem in a case of focusing by mouse click. The fix for Bug 108914 intercepted focus() function to change the behavior. However focus-by-click doesn't call focus(), but calls FocusController::setFocusedNode. To fix this problem, we introduce oldFocusedNode argument to handleFocusEvent, and BaseMultipleFieldsDateAndTimeInputType::handleFocusEvent restores the focus to oldFocusedNode if oldFocusedNode is one of sub-fields. handleFocusEvent is called whenever the focused node is changed. We don't need InputType::willCancelFocus any more because the new code in handleFocusEvent covers it. Tests: Update fast/forms/time-multiple-fields/time-multiple-fields-focus.html. * html/HTMLTextFormControlElement.h: (WebCore::HTMLTextFormControlElement::handleFocusEvent): Add oldFocusedNode argument. * html/HTMLTextFormControlElement.cpp: (WebCore::HTMLTextFormControlElement::dispatchFocusEvent): Pass oldFocusedNode to handleFocusEvent. * html/HTMLInputElement.h: (HTMLInputElement): - Add oldFocusedNode argument to handleFocusEvent. - Remove focus() override. * html/HTMLInputElement.cpp: Remove focus() override. (WebCore::HTMLInputElement::handleFocusEvent): Pass oldFocusedNode to InputType::handleFocusEvent. * html/InputType.cpp: Remove willCancelFocus. (WebCore::InputType::handleFocusEvent): Add oldFocusedNode argument. * html/InputType.h: (InputType): Ditto. * html/PasswordInputType.cpp: (WebCore::PasswordInputType::handleFocusEvent): Ditto. * html/PasswordInputType.h: (PasswordInputType): Ditto. * html/BaseMultipleFieldsDateAndTimeInputType.h: (BaseMultipleFieldsDateAndTimeInputType): Remove willCancelFocus, and add oldFocusedNode argument to handleFocusEvent. * html/BaseMultipleFieldsDateAndTimeInputType.cpp: (WebCore::BaseMultipleFieldsDateAndTimeInputType::handleFocusEvent): Pass oldFocusedNode to DateTimeEditElement::focusByOwner if the direction is FocusDirectionNone. * html/shadow/DateTimeEditElement.h: (DateTimeEditElement): Add oldFocusedNode argument to focusByOwner. * html/shadow/DateTimeEditElement.cpp: (WebCore::DateTimeEditElement::focusByOwner): If oldFocusedNode is one of sub-fields, focus on it again. LayoutTests: * fast/forms/time-multiple-fields/time-multiple-fields-focus-expected.txt: * fast/forms/time-multiple-fields/time-multiple-fields-focus.html: Add test to click a delimiter. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142592 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- 16 files changed, 118 insertions(+), 45 deletions(-) (In reply to comment #7) > Created an attachment (id=187803) [details] Sorry sorry -- webkit-patch accidentally uploaded to wrong bug number. Please ignore. |