Closed Bug 1699570 Opened 4 years ago Closed 4 years ago

Consider making focus not follow mouse in chrome UI

Categories

(Core :: DOM: UI Events & Focus Handling, enhancement)

All
macOS
enhancement

Tracking

()

RESOLVED FIXED
88 Branch
Tracking Status
firefox88 --- fixed

People

(Reporter: mstange, Assigned: emilio)

References

Details

(Whiteboard: [mac:integration])

Attachments

(1 file)

Bug 1614658 turned on accessibility.mouse_focuses_formcontrol on macOS. This affected both web content and the UI in our chrome, for example in the Preferences pages, the Downloads dialog and the "Clear Recent History" dialog.

I think this is a positive change for web content. However, I'm not so sure about making this change apply in our UI. For the latter two UI examples, we use native-looking UI, so it would be good to also follow the native focus model.

Emilio, how hard would it be to make this behavior per-document?

Flags: needinfo?(emilio)

As a point of reference, Safari also has different behavior in its UI and its web content.

It's not hard at all, will post a patch.

Flags: needinfo?(emilio)

For that, we make accessibility.mouse_focuses_formcontrol a static pref,
and make it work in all platforms because it's simpler and allows to
test mac-specific things on other platforms more easily.

Assignee: nobody → emilio
Status: NEW → ASSIGNED
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/3d36671abaec Make mouse_focuses_formcontrol on chrome documents match the old behavior. r=mstange
Pushed by emilio@crisal.io: https://hg.mozilla.org/integration/autoland/rev/0dc645366911 Fix merge conflict with another patch on autoland.
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 88 Branch

(In reply to Markus Stange [:mstange] from comment #1)

As a point of reference, Safari also has different behavior in its UI and its web content.

Hi Markus, could you provide some more information about what kind of differences you found on the Safari UI vs web content?
I'm working on :focus-visible on WebKit and dealing with focus stuff there, so I'd love to know more about these differences.

Thank you very much!

Flags: needinfo?(mstange.moz)

(In reply to Manuel Rego Casasnovas from comment #7)

Hi Markus, could you provide some more information about what kind of differences you found on the Safari UI vs web content?

Hi Manuel, here are two examples:

Safari UI: 1. Focus the location bar text field. 2. Click the "sidebar" toolbar button. The text field stays focused. But you can press shift+Tab to move focus to the sidebar button. Similar examples exist in the Safari Preferences window.
Web content: 1. In Safari, go to data:text/html,<input><input%20type="button"%20value="Button">. 2. Focus the text field. 3. Click the button. Now the text field is no longer focused.

Flags: needinfo?(mstange.moz)

Thanks for the info.

(In reply to Markus Stange [:mstange] from comment #8)

Safari UI: 1. Focus the location bar text field. 2. Click the "sidebar" toolbar button. The text field stays focused. But you can press shift+Tab to move focus to the sidebar button. Similar examples exist in the Safari Preferences window.
Web content: 1. In Safari, go to data:text/html,<input><input%20type="button"%20value="Button">. 2. Focus the text field. 3. Click the button. Now the text field is no longer focused.

About the 2nd one, it doesn't matter if you click a button, or just some random content outside of the input, the input gets unfocused in that case anyway, and the activeElement afterwards is the body.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: