Bug 122793 - Make it possible to focus on 0-size form controls and anchors
Summary: Make it possible to focus on 0-size form controls and anchors
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: BlinkMergeCandidate, WebExposed
Depends on:
Blocks:
 
Reported: 2013-10-14 17:40 PDT by Ryosuke Niwa
Modified: 2022-12-20 12:01 PST (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2013-10-14 17:40:59 PDT
Consider merging https://chromium.googlesource.com/chromium/blink/+/53f8eba14b6362795bae47c02236ca93303264a6

We assumed form controls and anchor elements with 0-size were not
focusable. It's inconsistent with other elements with tabIndex or
contentEditable, and incompatible with IE11 and Firefox 23.

We remove rendererIsFocusable override of HTMLFormControlElement, and
remove renderer box check in HTMLAnchorElement::isKeyboardFocusable.

As for crbug.com/285595, when we removed focus from an input/textarea element by
0-size, the element kept the selection. So FrameSelection::setFocusedNodeIfNeeded
set focus on the element again when an editing command was invoked by a keyboard
input. This issue is revolved by this CL because we don't remove focus by
0-size.
Comment 1 Ryosuke Niwa 2013-10-14 17:41:45 PDT
It seems that we should probably match the behaviors of other browsers but maybe Sam, Alexey, or Darin have a different opinion here.
Comment 2 Ryosuke Niwa 2013-10-14 17:42:34 PDT
Add Chris & James since this impacts the accessibility.
Comment 3 chris fleizach 2013-10-14 17:46:03 PDT
I wonder what the use case for this is. Generally VoiceOver will ignore 0 sized based elements every where because they're much more likely to be left their erroneously by developers rather than be real elements the user is meant to interact with
Comment 4 James Craig 2013-10-20 17:16:53 PDT
I expect it’s okay to merge this, unless there is an informative comment in the source stating the reason for the strange current behavior. Only thing that comes to mind would to check if this affects elements with size but no rendering (e.g. visibility:hidden;) or elements that are rendered outside a clipped region. I wouldn’t expect either to apply, but I’ve been surprised before.
Comment 5 Ahmad Saleem 2022-12-20 11:44:58 PST
@pxlcoder & @rniwa - Is this from chrome patch - HTMLFormControlElement::rendererIsFocusable() equivalent of void HTMLFormControlElement::didAttachRenderers()?
Comment 6 Ryosuke Niwa 2022-12-20 12:01:08 PST
I'm pretty sure I've already fixed this.