Figure out what to do if SetFocus ends up being called for an iframe element hosting an out-of-process iframe
Categories
(Core :: DOM: UI Events & Focus Handling, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox82 | --- | fixed |
People
(Reporter: hsivonen, Assigned: hsivonen)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
The patch for bug 1556627 doesn't deal with this case. Figure out if more work is needed here.
Assignee | ||
Comment 2•5 years ago
|
||
As seen in bug 1580618, we need a call to .focus()
on an OOP iframe synchronously make the iframe
element the focused element of the DOM inner window that the element is in. Then, we can have the process hosting the iframe content do its focus setting asynchronously.
This start going wrong when elementToFocus
is set to nullptr
in SetFocusInner
, because the focus-taking element inside the iframe is not in the current process.
Assignee | ||
Comment 3•5 years ago
|
||
My attempt to eagerly set the iframe as the focused element fails, because it's composed doc doesn't match the expected doc at
https://searchfox.org/mozilla-central/rev/4d2a9d5dc8f0e65807ee66e2b04c64596c643b7a/dom/base/nsGlobalWindowInner.cpp#4079
and
https://searchfox.org/mozilla-central/rev/4d2a9d5dc8f0e65807ee66e2b04c64596c643b7a/dom/base/nsFocusManager.cpp#2333
Neil, what's the significance of these checks? How should I adjust these checks to allow an iframe aElement
in these cases without breaking something else?
Assignee | ||
Comment 4•5 years ago
|
||
Comment 5•5 years ago
|
||
(In reply to Henri Sivonen (:hsivonen) from comment #3)
My attempt to eagerly set the iframe as the focused element fails, because it's composed doc doesn't match the expected doc at
https://searchfox.org/mozilla-central/rev/4d2a9d5dc8f0e65807ee66e2b04c64596c643b7a/dom/base/nsGlobalWindowInner.cpp#4079
You can't set the focused element to an element from a different document. If the documents don't match, then something is calling SetFocusedElement on the wrong window.
This check can fail some if the element was moved or the focus was adjusted during the focus event that was fired earlier within Focus(). If so, we don't want to continue focusing the element. It isn't perfect but we try to handle some situations where script might try to adjust the focus during a focus/blur event listener.
Comment 6•5 years ago
|
||
This bug is a Fission Nightly blocker (milestone M6c).
Assignee | ||
Comment 7•4 years ago
|
||
Bug 1649099 shows that things are OK after the iframe has loaded. The problem with the test here is that the iframe still reports having an inner window at the time of the focus()
call. We should probably make the inner window of an iframe that's about to navigate to a different side go away sooner.
Before doing that I should test Chrome some more.
Updated•4 years ago
|
Assignee | ||
Comment 8•4 years ago
|
||
Updated•4 years ago
|
Assignee | ||
Comment 9•4 years ago
|
||
Assignee | ||
Updated•4 years ago
|
Comment 10•4 years ago
|
||
Comment 11•4 years ago
|
||
bugherder |
Assignee | ||
Comment 12•4 years ago
|
||
Diagnostic try run to figure out why we can create an initial-looking about:blank when it clearly isn't initial:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=54cdcd82323ab99fd5618926321348662290d039
Assignee | ||
Comment 13•4 years ago
|
||
Try run with release asserting that we don't run the about:blank creation path that fires events:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=26a4bca3366ad159c4c8a4fa695b3e7ec2d3b650
Assignee | ||
Comment 14•4 years ago
|
||
Try run with script blocker:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=5470a183653f32c10d21a453b85e8865aff474f2
Assignee | ||
Comment 15•4 years ago
|
||
Filed bug 1663853 as a follow-up.
Assignee | ||
Comment 16•4 years ago
|
||
(In reply to Henri Sivonen (:hsivonen) from comment #14)
Try run with script blocker:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=5470a183653f32c10d21a453b85e8865aff474f2
Sigh. This doesn't work:
https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=315178499&repo=try&lineNumber=112788
Comment 17•4 years ago
|
||
Assignee | ||
Updated•4 years ago
|
Comment 18•4 years ago
|
||
Backed out changeset 73f6874cb3dd (Bug 1613054) for causing bc failures in browser_abort_visibility.js
Backout link: https://hg.mozilla.org/integration/autoland/rev/f22c20641704d783097b1b128d826c8460de7354
Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=315208206&repo=autoland&lineNumber=3658
Assignee | ||
Comment 19•4 years ago
|
||
Landing requeued with edit per discussion with Nika.
Comment 20•4 years ago
|
||
Comment 21•4 years ago
|
||
Backed out for perma failures.
Log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=315227233&repo=autoland&lineNumber=17482
Backout: https://hg.mozilla.org/integration/autoland/rev/2e060dffb1c85dcad897939be1cd53c4e076f858
Assignee | ||
Comment 22•4 years ago
|
||
(In reply to Razvan Maries from comment #21)
Log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=315227233&repo=autoland&lineNumber=17482
Sigh. This test was a pre-existing intermittent, which I why I didn't look into in more in the context of a try push.
Updated•4 years ago
|
Assignee | ||
Comment 23•4 years ago
|
||
Try run with XUL excluded from the new behavior:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=9f83f96ec3ff794b0fde62d2093ada96e1055229
Comment 24•4 years ago
|
||
Comment 25•4 years ago
|
||
bugherder |
Description
•