[Webkit-unassigned] [Bug 22261] Clicking on a non-text input element does not give it focus

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Oct 4 12:23:36 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=22261





--- Comment #49 from Maciej Stachowiak <mjs at apple.com>  2012-10-04 12:24:02 PST ---
(In reply to comment #46)
> (In reply to comment #45)
> > (In reply to comment #44)
> > > Related issue: http://code.google.com/p/chromium/issues/detail?id=142188
> > > 
> > > Maybe we need to tie this due to editing behavior. I'm pretty certain we want it be focusable on all non-Mac platforms.
> > 
> > Perhaps it should depend on tab-focus policy. My feeling is that this behavior is appropriate if and only if buttons are tab-focusable. In Safari on Mac (and probably other Mac browsers) they are not by default, but can be set to be in the tab cycle (via both System Preferences and Safari Preferences).
> 
> So, to be clear, you're disagreeing with Darin's preference to avoid Mac vs Windows differences? I'm OK with making this a Setting. I'd rather do that than an editing behavior since Chrome will want to do this on Mac as well.

My suggestion is not to make it any of a hardcoded Mac vs Windows difference, a Setting, or an editing behavior. My suggestion is that non-text form controls such as buttons should be focusable by click if and only if they are focusable in the tab cycle. And likewise for links.

This could be achieved by making HTMLFormControlElement::isMouseFocusable() check document()->frame()->eventHandler()->tabsToAllFormControls(), which has platform-specific implementations, some of which always return true, and others of which (Mac in particular) make it a runtime setting and others which might return always false.

For clarity it may make sense to add EventHandler::allFormControlsAcceptMouseFocus() which just calls tabsToAllFormControls.

It is true that this will create a web-content-observable difference that is partly a platform difference. However, we already have such a difference for tab-focus. It seems sensible to me to make mouse-focus consistent with tab-focus, even though it slightly expands the scope of the difference.

This would also allow removing the hardcoded special case for Gtk and Qt.

[...snip specific issue report because I agree with Ryosuke that it's actually a different bug...]

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list