New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.
Starred by 31 users
Status: Fixed
Owner:
Closed: Jun 2013
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Feature



Sign in to add a comment
mouse should focus input controls
Reported by d.p.carl...@gmail.com, Jul 19 2011 Back to list
Chrome Version       :
Google Inc.
Copyright © 2006-2011 Google Inc. All Rights Reserved.
Google Chrome	14.0.825.0 (Official Build 92801) dev-m
OS	Windows
WebKit	535.1 (trunk@91062)
JavaScript	V8 3.4.12.1
Flash	10,3,181,36
User Agent	Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.825.0 Safari/535.1
Command Line	"C:\Users\davidc\AppData\Local\Google\Chrome\Application\chrome.exe" --restore-last-session --flag-switches-begin --flag-switches-end
Executable Path	C:\Users\davidc\AppData\Local\Google\Chrome\Application\chrome.exe
Profile Path	C:\Users\davidc\AppData\Local\Google\Chrome\User Data\Default

OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
URLs (if applicable) :
http://dpcarlisle.blogspot.com/2011/07/slinky-canvas.html

Other browsers tested:
Add OK or FAIL after other browsers where you have tested this issue:
Opera 11: OK

What steps will reproduce the problem?
1. click on slider at above URL
2. move left or right arrow key
3.

What is the expected result?
slider moves and steps value


What happens instead?
nothing.

Please provide any additional information below. Attach a screenshot if
possible.
as pointed out in  issue #89698  it is possible to focus the input control by repeatedly pressing tab, but this is unexpected (It would not have occurred to me to try stepping past all the links) and different to other input controls that can be focussed with the mouse click. It also differs from the other current implementation in Opera, and from the expectation of at least some other implementers on the whatwg channel
http://krijnhoetmer.nl/irc-logs/whatwg/20110719#l-488




 
Labels: -Area-Undefined Area-WebKit WebKit-Core
Comment 2 by tkent@chromium.org, Jul 20 2011
Labels: -Type-Bug -OS-Windows -WebKit-Core Type-Feature OS-All WebKit-Forms
Comment 3 by kareng@google.com, Jul 21 2011
Owner: tkent@chromium.org
Status: Assigned
please let me know if u need me to assign it to someone else :)
Comment 4 by yosin@chromium.org, Dec 21 2011
 Issue 102604  has been merged into this issue.
Please note that  issue #102604  was merged into this issue but this issue does not mention the other control types nor that IE and FF also include this functionality. All controls need to fire the "onfocus" event when focus is given to the control using the mouse.
Comment 6 by tkent@chromium.org, Oct 17 2012
 Issue 156075  has been merged into this issue.
Comment 7 by tkent@chromium.org, Nov 19 2012
 Issue 161505  has been merged into this issue.
Comment 8 by tkent@chromium.org, Jan 18 2013
Cc: srsridhar@chromium.org
 Issue 169253  has been merged into this issue.
Project Member Comment 9 by bugdroid1@chromium.org, Mar 10 2013
Labels: -Area-WebKit -WebKit-Forms Cr-Content Cr-Content-Forms
Comment 10 by tkent@chromium.org, Mar 20 2013
Cc: tkent@chromium.org
 Issue 142188  has been merged into this issue.
Comment 11 by tkent@chromium.org, Mar 20 2013
Labels: WebKit-ID-22261-NEW
Project Member Comment 12 by bugdroid1@chromium.org, Apr 6 2013
Labels: -Cr-Content Cr-Blink
Project Member Comment 13 by bugdroid1@chromium.org, Apr 6 2013
Labels: -Cr-Content-Forms Cr-Blink-Forms
Comment 14 by tkent@chromium.org, Apr 15 2013
Cc: -tkent@chromium.org
Status: Started
Cc: kenjibaheux@chromium.org
Labels: Hotlist-Fixit
Sounds annoying.
Comment 17 by tkent@chromium.org, May 16 2013
 Issue 240955  has been merged into this issue.
Project Member Comment 18 by bugdroid1@chromium.org, Jun 26 2013
The following revision refers to this bug:
    http://src.chromium.org/viewvc/blink?view=rev&rev=153039

------------------------------------------------------------------------
r153039 | tkent@chromium.org | 2013-06-26T02:01:58.636866Z

Changed paths:
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/submit/submit-focus-by-mouse.html?r1=153039&r2=153038&pathrev=153039
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/button/button-reset-focus-by-mouse.html?r1=153039&r2=153038&pathrev=153039
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/radio/radio-focus-by-mouse-then-keydown.html?r1=153039&r2=153038&pathrev=153039
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/page/FocusDirection.h?r1=153039&r2=153038&pathrev=153039
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/checkbox/checkbox-focus-by-mouse.html?r1=153039&r2=153038&pathrev=153039
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/InputType.cpp?r1=153039&r2=153038&pathrev=153039
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/BaseDateAndTimeInputType.h?r1=153039&r2=153038&pathrev=153039
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/submit/submit-focus-by-mouse-then-keydown-expected.html?r1=153039&r2=153038&pathrev=153039
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/button/button-reset-focus-by-mouse-then-keydown-expected.html?r1=153039&r2=153038&pathrev=153039
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/dom/EventDispatcher.cpp?r1=153039&r2=153038&pathrev=153039
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/HTMLFormControlElement.cpp?r1=153039&r2=153038&pathrev=153039
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/HTMLInputElement.h?r1=153039&r2=153038&pathrev=153039
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/BaseMultipleFieldsDateAndTimeInputType.h?r1=153039&r2=153038&pathrev=153039
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/dom/Node.h?r1=153039&r2=153038&pathrev=153039
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/checkbox/checkbox-focus-by-mouse-then-keydown-expected.html?r1=153039&r2=153038&pathrev=153039
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/rendering/RenderTheme.cpp?r1=153039&r2=153038&pathrev=153039
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/range/range-focus-by-mouse.html?r1=153039&r2=153038&pathrev=153039
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/TextFieldInputType.h?r1=153039&r2=153038&pathrev=153039
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/radio/radio-focus-by-mouse.html?r1=153039&r2=153038&pathrev=153039
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/button?r1=153039&r2=153038&pathrev=153039
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/BaseChooserOnlyDateAndTimeInputType.cpp?r1=153039&r2=153038&pathrev=153039
   D http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/events/click-focus-control-expected.txt?r1=153039&r2=153038&pathrev=153039
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/HTMLTextAreaElement.h?r1=153039&r2=153038&pathrev=153039
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/HTMLSelectElement.h?r1=153039&r2=153038&pathrev=153039
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/range/range-focus-by-mouse-then-keydown-expected.html?r1=153039&r2=153038&pathrev=153039
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/page/EventHandler.cpp?r1=153039&r2=153038&pathrev=153039
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/rendering/RenderInline.cpp?r1=153039&r2=153038&pathrev=153039
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/button/button-reset-focus-by-mouse-expected.html?r1=153039&r2=153038&pathrev=153039
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/submit/submit-focus-by-mouse-expected.html?r1=153039&r2=153038&pathrev=153039
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/radio/radio-focus-by-mouse-then-keydown-expected.html?r1=153039&r2=153038&pathrev=153039
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/TestExpectations?r1=153039&r2=153038&pathrev=153039
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/BaseDateAndTimeInputType.cpp?r1=153039&r2=153038&pathrev=153039
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/HTMLInputElement.cpp?r1=153039&r2=153038&pathrev=153039
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/checkbox/checkbox-focus-by-mouse-expected.html?r1=153039&r2=153038&pathrev=153039
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/BaseMultipleFieldsDateAndTimeInputType.cpp?r1=153039&r2=153038&pathrev=153039
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/dom/Node.cpp?r1=153039&r2=153038&pathrev=153039
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/button/button-reset-focus-by-mouse-then-keydown.html?r1=153039&r2=153038&pathrev=153039
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/submit/submit-focus-by-mouse-then-keydown.html?r1=153039&r2=153038&pathrev=153039
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/InputType.h?r1=153039&r2=153038&pathrev=153039
   D http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/events/click-focus-control.html?r1=153039&r2=153038&pathrev=153039
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/HTMLFormControlElement.h?r1=153039&r2=153038&pathrev=153039
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/checkbox/checkbox-focus-by-mouse-then-keydown.html?r1=153039&r2=153038&pathrev=153039
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/TextFieldInputType.cpp?r1=153039&r2=153038&pathrev=153039
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/range/range-focus-by-mouse-expected.html?r1=153039&r2=153038&pathrev=153039
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/HTMLTextAreaElement.cpp?r1=153039&r2=153038&pathrev=153039
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/HTMLSelectElement.cpp?r1=153039&r2=153038&pathrev=153039
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/rendering/RenderObject.cpp?r1=153039&r2=153038&pathrev=153039
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/radio/radio-focus-by-mouse-expected.html?r1=153039&r2=153038&pathrev=153039
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/rendering/RenderTheme.h?r1=153039&r2=153038&pathrev=153039
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/BaseChooserOnlyDateAndTimeInputType.h?r1=153039&r2=153038&pathrev=153039
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/range/range-focus-by-mouse-then-keydown.html?r1=153039&r2=153038&pathrev=153039

Mouse press should focus on any types of form controls.

* Background
In WebKit, form controls except text fields and <select> are not
mouse-focusable. This behavior is based on Cocoa native controls.
Though Firefox on Mac behaves same as WebKit, IE, Firefox (non-Mac),
and Opera(Presto) set focus by mouse press.

The WebKit behavior is not Web-compatible.

* Behavior change
We change the behavior so that mouse press sets focus to form controls
to improve web compatibility. However, We haven't set focus until now and
this behavior change might make existing users uncomfortable with focus
rings which appear on click. So, we don't draw focus rings if a form control
was focused by mouse press.

* Implementation
The main part of this CL is to remove HTMLFormControlElement::isMouseFocusable.
It means we use Node::isMouseFocusable, which is just isFocusable. We
can remove many isMouseFocusable implementations of
HTMLFormControlElement subclasses.

We change the followings to hide focus rings on mouse-focus:
 - Introduce FocusDirectionMouse so that form control can distinguish
   mouse focus from others.
 - HTMLFormControlElement has m_wasFocusedByMouse flag. It is cleared
   when a keydown event is delivered.
 - Introduce HTMLFormControlElement::shouldShowFocusRingOnMouseFocus,
    which represents differences between button controls and text/select
    controls.
 - RenderTheme, RenderObject, RenderInline don't draw focus rings if
    conditions match.

We introduced Node::willCallDefaultEventHandler to re-show focus rings
after keyboard operations.

Test changes:
 - Add many tests for new behavior.
 - Remove fast/events/click-focus-control.html because now it is covered
   by existing and new tests.
 - Need rebaseline for afast/repaint/slider-thumb-float.html. We show
    a focus ring for a control without -webkit-appearance.

BUG= 89708 
R=arv@chromium.org, keishi@chromium.org

Review URL: https://codereview.chromium.org/16194013
------------------------------------------------------------------------
Comment 19 by tkent@chromium.org, Jun 26 2013
Labels: M-30
Status: Fixed
Project Member Comment 20 by bugdroid1@chromium.org, Jun 28 2013
The following revision refers to this bug:
    http://src.chromium.org/viewvc/blink?view=rev&rev=153195

------------------------------------------------------------------------
r153195 | tkent@chromium.org | 2013-06-28T04:12:36.874282Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/platform/chromium-linux/fast/forms/select/listbox-appearance-basic-expected.png?r1=153195&r2=153194&pathrev=153195
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/platform/chromium-mac/fast/repaint/slider-thumb-float-expected.png?r1=153195&r2=153194&pathrev=153195
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/platform/chromium-mac-lion/fast/forms/select/listbox-appearance-basic-expected.png?r1=153195&r2=153194&pathrev=153195
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/platform/chromium-mac/fast/forms/select/listbox-appearance-basic-expected.png?r1=153195&r2=153194&pathrev=153195
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/TestExpectations?r1=153195&r2=153194&pathrev=153195
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/platform/chromium-win-xp/fast/repaint/slider-thumb-float-expected.png?r1=153195&r2=153194&pathrev=153195
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/platform/chromium-linux-x86/fast/repaint/slider-thumb-float-expected.png?r1=153195&r2=153194&pathrev=153195
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/platform/chromium-mac-snowleopard/fast/forms/select/listbox-appearance-basic-expected.txt?r1=153195&r2=153194&pathrev=153195
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/platform/chromium-win/fast/forms/select/listbox-appearance-basic-expected.txt?r1=153195&r2=153194&pathrev=153195
   D http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/repaint/slider-thumb-float-expected.png?r1=153195&r2=153194&pathrev=153195
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/platform/chromium-mac-snowleopard/fast/repaint/slider-thumb-float-expected.png?r1=153195&r2=153194&pathrev=153195
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/platform/chromium-mac/fast/forms/select/listbox-appearance-basic-expected.txt?r1=153195&r2=153194&pathrev=153195
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/platform/chromium-mac-snowleopard/fast/forms/select/listbox-appearance-basic-expected.png?r1=153195&r2=153194&pathrev=153195
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/platform/chromium-win/fast/repaint/slider-thumb-float-expected.png?r1=153195&r2=153194&pathrev=153195
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/platform/chromium-win/fast/forms/select/listbox-appearance-basic-expected.png?r1=153195&r2=153194&pathrev=153195
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/platform/chromium-linux/fast/repaint/slider-thumb-float-expected.png?r1=153195&r2=153194&pathrev=153195
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/platform/chromium-mac-lion/fast/repaint/slider-thumb-float-expected.png?r1=153195&r2=153194&pathrev=153195

Rebaseline for r153039 and r153132.

BUG= 82280 , 89708 
TBR=keishi@chromium.org

Review URL: https://codereview.chromium.org/18178002
------------------------------------------------------------------------
Curious question, will this (ever?) be backported to Webkit?
Comment 23 by tkent@chromium.org, Jun 30 2013
> Curious question, will this (ever?) be backported to Webkit?

An Apple engineer already filed a bug for this [1]. However I don't know if this change should be merged to WebKit and when it is merged because the new behavior is a little tricky.

[1] https://bugs.webkit.org/show_bug.cgi?id=118043

Comment 24 by tkent@chromium.org, May 27 2015
 Issue 15803  has been merged into this issue.
Sign in to add a comment