Enforce focused BrowsingContext ordering by action id
Categories
(Core :: DOM: UI Events & Focus Handling, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox89 | --- | fixed |
People
(Reporter: hsivonen, Assigned: hsivonen)
References
(Blocks 1 open bug, Regressed 1 open bug)
Details
Attachments
(1 file)
We know that out-of-order attempts to set the active BrowsingContext
must be rejected by action id or things go wrong.
While we don't have a concrete demonstration of things going wrong in an analogous way with the focused BrowsingContext
it seems prudent to implement the same mechanism for focused BrowsingContext
in the hope of solving mystery problems in this general area.
Assignee | ||
Comment 1•4 years ago
|
||
Updated•4 years ago
|
Assignee | ||
Comment 2•4 years ago
|
||
Assignee | ||
Comment 3•4 years ago
|
||
Assignee | ||
Comment 4•4 years ago
|
||
Updated•4 years ago
|
Comment 5•4 years ago
|
||
I found bug 1695135 is fixed by this, Henri, do you want to add the test in bug 1695135 here? Or I could post a patch for the test in bug 1695135 and land it there.
Assignee | ||
Comment 6•4 years ago
|
||
Let's land the test as part of that other bug.
Pushed by hsivonen@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e072b56f8518 Ensure parent-managed order of setting the focused browsing context. r=nika
Comment 8•4 years ago
•
|
||
Backed out changeset e072b56f8518 (bug 1696908) for causing bc failures in browser_bug1303838.js
Backout link: https://hg.mozilla.org/integration/autoland/rev/0fbb2d7f53d500f374dc43465fbb8308827f99e3
Push with failures, failure log.
(Update): There were also bc failures caused by these changes.
(Update 2): Also looks to have caused mochitest plain failures.
Assignee | ||
Comment 9•4 years ago
|
||
Hmm. Looks like all the failures were previously-known intermittents.
Assignee | ||
Comment 10•4 years ago
|
||
It looks like we reject nsFocusManager::SetFocusedWindowInternal
due to stale action id:
https://pernos.co/debug/bdobZfU_AhZJAcJOM8bfNA/index.html#f{m[AfLx,CFKC_,t[Zw,CKg_,f{e[AfLx,CFHM_,s{af4284PAA,bAXo,uAWxF1A,oAW5ILg___
For some reason, that Pernosco trace is broken in the sense that local variable cannot be inspected, so it's hard to make progress on getting closer to the root cause before that's resolved.
Assignee | ||
Comment 11•4 years ago
|
||
Found this comment:
// Sync the window for a newly-created OOP iframe
// The actionID will be unused, so pass 0 to trigger assertions
// in case code is later changed to use it accidentally.
And this patch changed the code that way.
Assignee | ||
Comment 12•4 years ago
|
||
Assignee | ||
Comment 13•4 years ago
|
||
Findings so far:
The assumption that for a given action id there is at most one focused BrowsingContext
may be violated when we focus a remote iframe: In that case, we may set a focused BrowsingContext
in the process hosting the iframe element and a second BrowsingContext
in the process hosting the iframe contents.
Assignee | ||
Comment 14•4 years ago
|
||
Assignee | ||
Comment 15•4 years ago
|
||
It seems that the problem here is that a content process starts focusing stuff due to a load finishing before a parent-initiated focusing process happens, but the IPC message that makes the content process-initiated action take its place in the queue happens after the parent-initiated action has taken its place in the queue. This leads to the content process-initiated focusing messing up the parent-initiated focusing action (which takes many IPC round trips to complete.)
One option to explore would be making parent-initiated actions always complete.
Assignee | ||
Comment 16•4 years ago
|
||
I think I'm going to still pursue examining the test itself. Adding more logging makes the failure happen less often...
Assignee | ||
Comment 17•4 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=b108ec53072d3b8682e94039811d3416d9ba6a65
When opening links that contain iframes in a background tab, the focusing of the iframe races with chrome-initiated focusing and I failed to come up with a nice way to make the test wait for the iframe getting focused first.
Assignee | ||
Comment 18•4 years ago
|
||
Assignee | ||
Comment 19•4 years ago
|
||
Comment 20•4 years ago
|
||
Pushed by hsivonen@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/27d3d97f875f Ensure parent-managed order of setting the focused browsing context. r=nika
Comment 21•4 years ago
|
||
Backed out for build bustage at nsFocusManager.cpp
Failure log: https://treeherder.mozilla.org/logviewer?job_id=335050304&repo=autoland&lineNumber=33535
Backout: https://hg.mozilla.org/integration/autoland/rev/02618acdb118bf277fcc3302980e2b52c3513734
Comment 22•4 years ago
|
||
Pushed by hsivonen@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/562969cdeb6d Ensure parent-managed order of setting the focused browsing context. r=nika
Assignee | ||
Updated•4 years ago
|
Comment 23•4 years ago
|
||
bugherder |
Description
•