Tab occasionally steals focus
Categories
(Core :: DOM: UI Events & Focus Handling, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox86 | --- | fixed |
People
(Reporter: annevk, Assigned: hsivonen)
References
(Blocks 2 open bugs, )
Details
Attachments
(1 file)
When I have https://www.nintendo.de/Spiele/Nintendo-Switch-Download-Software/The-Talos-Principle-Deluxe-Edition-1695266.html open (I'm also logged in, but haven't really interacted with it that I recall) it seems to occasionally steal focus. It's an [F 4404, 72719, 6183, 6186, 4525] tab.
Cannot figure out precise steps to reproduce, but it happened twice now and I'm positive I didn't do any other action that might cause a tab switch.
Assignee | ||
Comment 1•4 years ago
|
||
I left this page open for a while in a background tab in a debug build with the build on the background in the OS, but when I checked back, it was still in a background tab. I wonder if the window needs to be the frontmost window in the OS for this to happen.
Reporter | ||
Comment 2•4 years ago
|
||
I've had this happen with https://www.nintendo.co.uk/Super-Mario-Bros-35th-Anniversary-hub/Super-Mario-Bros-35th-Anniversary-Prize-Days-Day-1-1876606.html too. (Less processes involved there it seems and no overlap with the tab focus got stolen from.)
Assignee | ||
Comment 3•4 years ago
|
||
If the tab is in the background, how does the focus stealing manifest? Does the tab become the active tab without clicking the tab title?
Reporter | ||
Comment 4•4 years ago
|
||
Yeah, while interacting with another tab, sometimes even when typing in a textarea, iirc, it would suddenly make that tab the active tab as if you had accidentally clicked it with the mouse.
Assignee | ||
Comment 5•4 years ago
|
||
(In reply to Anne (:annevk) from comment #2)
I've had this happen with https://www.nintendo.co.uk/Super-Mario-Bros-35th-Anniversary-hub/Super-Mario-Bros-35th-Anniversary-Prize-Days-Day-1-1876606.html too. (Less processes involved there it seems and no overlap with the tab focus got stolen from.)
I've now witnessed this on that page when logged into a Nintendo account.
Updated•4 years ago
|
Assignee | ||
Comment 6•4 years ago
|
||
It looks like it's a matter of the page calling .focus()
on a window object whose C++ delegate is BrowsingContext
rather than nsGlobalWindowInner
. In the latter case, we call FocusOuter
which runs checks to see if the focusing is allowed. In the former case we just go ahead and assume that the focusing is allowed.
We need to duplicate some of those permission checks on the code path beginning from BrowsingContext::Focus
.
Assignee | ||
Comment 7•4 years ago
|
||
Assignee | ||
Comment 8•4 years ago
|
||
Assignee | ||
Comment 9•4 years ago
|
||
Simple repro: https://hsivonen.fi/iframe-focuses-parent.html
Assignee | ||
Comment 10•4 years ago
|
||
Assignee | ||
Comment 11•4 years ago
|
||
Comment 12•4 years ago
|
||
Comment 14•4 years ago
|
||
Backed out for failures on iframe-focuses-parent-different-site.html
backout: https://hg.mozilla.org/integration/autoland/rev/70b4a36723e904470b52d837a0661428bf14e3c9
push where tier 1 failures appeared: https://treeherder.mozilla.org/jobs?repo=autoland&group_state=expanded&revision=59bc879e3bc635c14b5dde45bd2d68d74da9dde1&searchStr=wpt13&selectedTaskRun=awhOgm9TTquH7Ur0kawpvQ.0
failure log: https://treeherder.mozilla.org/logviewer?job_id=326995670&repo=autoland&lineNumber=3285
[task 2021-01-18T09:43:55.538Z] 09:43:55 INFO - TEST-START | /focus/iframe-focuses-parent-different-site.html
[task 2021-01-18T09:43:55.543Z] 09:43:55 INFO - Closing window 75
[task 2021-01-18T09:44:35.948Z] 09:44:35 INFO - TEST-UNEXPECTED-TIMEOUT | /focus/iframe-focuses-parent-different-site.html | expected OK
[task 2021-01-18T09:44:35.948Z] 09:44:35 INFO - TEST-INFO took 40410ms
[task 2021-01-18T09:44:36.329Z] 09:44:36 INFO - STDOUT: cleanup aborted: Unable to remount device
[task 2021-01-18T09:44:36.459Z] 09:44:36 INFO - STDOUT: cleanup aborted: Unable to remount device
[task 2021-01-18T09:44:36.460Z] 09:44:36 INFO - Closing logging queue
Assignee | ||
Comment 15•4 years ago
|
||
Strange. Things were OK in the try run from comment 11.
Comment 16•4 years ago
|
||
(In reply to Henri Sivonen (:hsivonen) from comment #15)
Strange. Things were OK in the try run from comment 11.
The failures have appeared on Android 7.0 x86-64
Assignee | ||
Comment 17•4 years ago
|
||
Assignee | ||
Comment 18•4 years ago
|
||
Comment 19•4 years ago
|
||
Comment 21•4 years ago
|
||
bugherder |
Comment 22•4 years ago
|
||
Henri, the changes here seem to have turned bug 1677899 into a perma fail.
Could you, please, take a look?
Assignee | ||
Comment 23•4 years ago
|
||
Thanks. I'll take a look over in bug 1677899 .
Description
•