Focus does not change between the top document and IFRAME if an inactive Firefox window is clicked
Categories
(Core :: DOM: UI Events & Focus Handling, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr91 | --- | unaffected |
firefox99 | --- | wontfix |
firefox100 | --- | wontfix |
firefox101 | --- | wontfix |
firefox102 | --- | wontfix |
firefox103 | --- | fix-optional |
People
(Reporter: CoolCmd, Unassigned)
References
(Blocks 1 open bug, Regression)
Details
(Keywords: regression)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:99.0) Gecko/20100101 Firefox/99.0
Steps to reproduce:
there are two <textarea> elements in the document: the first in the top document and the second in the <iframe>.
- click the fist <textarea>.
- switch to another application.
- click the second <textarea>.
Actual results:
"click" event has been send to the second <textarea>. the first <textarea> is still focused.
Expected results:
the second <textarea> must be focused.
this is a bug because if you switch to another tab and return, the second <textarea> will be focused.
in practice, user clicks the <textarea> in the <iframe> and starts typing a message, but the keys are handled in the top document (with commands bound to alpha keys), leading to unpredictable results.
Comment 1•3 years ago
•
|
||
Dear reporter,
I am not sure I am seeing your issue here.
Here is how I tested:
- visit the link https://jsfiddle.net/smzhgLre/
- click the "1st textarea" bottom_right corner
- switch to another app, then switch back to Firefox
- click the textarea showing
<!DOCTYPE html> ...
in the iframe
The textarea from step 4) was focused.
It would be huge help if you can provide a simple test case to show your issue. Thank you.
Updated•3 years ago
|
(In reply to Hsin-Yi Tsai [:hsinyi] from comment #1)
- switch to another app, then switch back to Firefox
- click the textarea showing
<!DOCTYPE html> ...
in the iframe
no, you should activate Firefox by clicking the 2nd textarea
Comment 3•3 years ago
•
|
||
(In reply to CoolCmd from comment #2)
(In reply to Hsin-Yi Tsai [:hsinyi] from comment #1)
- switch to another app, then switch back to Firefox
- click the textarea showing
<!DOCTYPE html> ...
in the iframeno, you should activate Firefox by clicking the 2nd
textarea
Oh right, I can reproduce it.
It seems to be a fission regression; if I disable the preference, it's not reproducible. I'll see if I can get a narrower regression window. Thanks!
Comment 4•3 years ago
|
||
I could also reproduce this with the test page in comment #1.
In my case, after activating firefox by clicking textarea in child frame, neither textarea in parent frame nor textarea in child frame get focused.
And after switching to another tab and back, the textarea in child frame will be focused.
Comment 5•3 years ago
|
||
(In reply to Hsin-Yi Tsai [:hsinyi] from comment #3)
(In reply to CoolCmd from comment #2)
(In reply to Hsin-Yi Tsai [:hsinyi] from comment #1)
- switch to another app, then switch back to Firefox
- click the textarea showing
<!DOCTYPE html> ...
in the iframeno, you should activate Firefox by clicking the 2nd
textarea
Oh right, I can reproduce it.
It seems to be a fission regression; if I disable the preference, it's not reproducible. I'll see if I can get a narrower regression window. Thanks!
I haven't found a specific commit for this rather than turning on fission. However, during the bisection, the behavior had changed and had been weird in various ways, so I think this is just one more scenario that we haven't handled well in focus management for fission.
Comment 6•3 years ago
|
||
Set release status flags based on info from the regressing bug 1732358
Updated•3 years ago
|
Comment 7•3 years ago
|
||
Okay, there is a case that OOP iframe tries to focus the clicked element for mousedown event, however the activate browsing context isn't yet updated, so FocusManager ends up not send the focus event, https://searchfox.org/mozilla-central/rev/d34f9713ae128a3138c2b70d8041a535f1049d19/dom/base/nsFocusManager.cpp#1673-1674. I will give a shot to fix this.
Updated•3 years ago
|
Comment 8•3 years ago
|
||
When clicking a OOP iframe, the mousedown event might arrive before the nsFocusManager::mFocusedBrowsingContextInContent
get updated properly in iframe process, so focus event won't be fired in such case due to https://searchfox.org/mozilla-central/rev/4b3039b48c3cb67774270ebcc2a7d8624d888092/dom/base/nsFocusManager.cpp#1610-1613,1671-1674.
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•6 months ago
|
Comment 11•6 months ago
|
||
Since Bug 1860426 (Copy disabled despite selection existing in the content process)
has been closed and moved to a duplicate of this
some 10 months later this still isnt fixed
this is what happens when your dev's dont use your product
this should have been picked up within 10mins of the bad merge going live
and fixed the next release
you all need firing out of a cannon
Description
•