Remove some focus calls in the front-end which shouldn't have an effect.
Categories
(Core :: DOM: UI Events & Focus Handling, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox135 | --- | fixed |
People
(Reporter: emilio, Assigned: emilio)
References
Details
Attachments
(3 files)
I tried to do this in bug 1933119 but got backed out due to a test failure.
I think the test failure is legit and uncovers a bug in nsFocusManager.
We're in a situation where:
- mActiveWindow = the top level window
- mFocusedWindow = nullptr
Front-end calls promiseFocus(), and document.hasFocus()
returns false. So it proceeds to call window.focus()
, but that bails out in RaiseWindow here:
I think bailing out is wrong and we should ensure the widget becomes focused as well. We already deal with this situation correctly here:
Furthermore, we no longer have the windows special-case of having child windows in the top level, so we can simplify a bit RaiseWindow.
Assignee | ||
Comment 1•3 months ago
|
||
Since bug 1823984, this focus() call has been a no-op on remote frames.
The previous patch also fixes the non-remote frame focus switch.
Assignee | ||
Comment 2•3 months ago
|
||
Windows no longer has child widgets since bug 1870512, where we removed
ShouldAttachToTopLevel() special-cases.
Assignee | ||
Comment 3•3 months ago
|
||
We're in a situation where:
mActiveWindow = the top level window
mFocusedWindow = nullptr
Front-end calls promiseFocus(), and document.hasFocus() returns false
(correctly).
So it proceeds to call window.focus(), but that bails out in RaiseWindow
here:
https://searchfox.org/mozilla-central/rev/234f91a9d3ebef0d514868701cfb022d5f199cb5/dom/base/nsFocusManager.cpp#3022
I think bailing out is wrong and we should ensure the widget becomes
focused as well. We already deal with this situation correctly here:
https://searchfox.org/mozilla-central/rev/234f91a9d3ebef0d514868701cfb022d5f199cb5/dom/base/nsFocusManager.cpp#699-708
Updated•3 months ago
|
Assignee | ||
Updated•3 months ago
|
Updated•3 months ago
|
Comment 7•3 months ago
|
||
Backed out changeset d6c7cfdf4e11 (Bug 1933769) for causing bv failures at outOfProcess/browser_controller.js
Updated•3 months ago
|
Assignee | ||
Updated•3 months ago
|
Comment 9•3 months ago
|
||
bugherder |
Assignee | ||
Updated•3 months ago
|
Comment 10•3 months ago
|
||
Comment 11•3 months ago
|
||
bugherder |
Description
•