Make test_bug238987.html pass with cross-origin and Fission enabled
Categories
(Core :: DOM: UI Events & Focus Handling, task, P2)
Tracking
()
People
(Reporter: edgar, Assigned: edgar)
References
Details
Attachments
(2 files)
Test got unexpected focus events before the first tab navigation. Look like there are timing changes in focus event.
Assignee | ||
Comment 1•5 years ago
|
||
(In reply to Edgar Chen [:edgar] from comment #0)
Test got unexpected focus events before the first tab navigation. Look like there are timing changes in focus event.
Here is the test page that shows the differences:
Fission
With fission enabled, the focus event is dispatched asynchronously.
onload
before calling window.focus()
after calling window.focus()
window.onfocus: target: [object HTMLDocument], eventPhase: 1
window.onfocus: target: [object Window], eventPhase: 2
window.onfocus: target: [object Window], eventPhase: 2
non-Fission
The focus event used to be dispatched synchronously while calling window.focus() of the iframe.
onload
before calling window.focus()
window.onfocus: target: [object HTMLDocument], eventPhase: 1
window.onfocus: target: [object Window], eventPhase: 2
window.onfocus: target: [object Window], eventPhase: 2
after calling window.focus()
Henri, is this something expected? If so, I will modify the test to make it compatible with fission.
Comment 2•5 years ago
|
||
.contentWindow.focus()
on an OOP iframe is known broken in general: Bug 1613054.
As for sync vs. async, I'm not yet sure where that part will settle.
Assignee | ||
Comment 3•5 years ago
|
||
(In reply to Henri Sivonen (:hsivonen) from comment #2)
.contentWindow.focus()
on an OOP iframe is known broken in general: Bug 1613054.As for sync vs. async, I'm not yet sure where that part will settle.
Thanks!
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Comment 4•5 years ago
|
||
Tracking for Fission Nightly M6c
Comment 5•4 years ago
|
||
Hi Chris, does M6c here mean, it should no longer block bug 1653457 (marked M6b) ?
Comment 6•4 years ago
|
||
(In reply to Jens Stutte [:jstutte] (REO for FF 81) from comment #5)
Hi Chris, does M6c here mean, it should no longer block bug 1653457 (marked M6b) ?
M6c means fixing the bug soon (in September, ideally) is important, but it doesn't block our Fission Nightly experiment (October 6).
Neha moved bug 1653457 from M6b to M6c. This bug can stay in M6c.
Comment 7•4 years ago
|
||
(In reply to Chris Peterson [:cpeterson] from comment #6)
Neha moved bug 1653457 from M6b to M6c. This bug can stay in M6c.
Correction: Neha had moved a different xorigin meta bug (bug 1652554) from M6b to M6c.
I will move bug 1653457 from M6b to M6c now.
Comment 8•4 years ago
|
||
Bug 1613054 wasn't sufficient for fixing this. The backout of bug 1649099 shows that the events being tested here don't fire deterministically. (I don't know why.)
Assignee | ||
Comment 9•4 years ago
|
||
I guess there might be some timing changes due to now parent window need to bounce an IPC message to the OOP iframe. I will take a look.
Assignee | ||
Comment 10•4 years ago
|
||
(In reply to Henri Sivonen (:hsivonen) from comment #2)
As for sync vs. async, I'm not yet sure where that part will settle.
window.focus() on a non-OOP iframe would call nsContentUtils::RequestFrameFocus synchronously, https://searchfox.org/mozilla-central/rev/7b07725fe9dc5d59a525990fc1dba78bc8b82af1/dom/base/nsGlobalWindowOuter.cpp#5143, and then dispatch focus event synchronously.
But window.focus() on an OOP iframe sends an IPC message to its parent frame instead, https://searchfox.org/mozilla-central/rev/7b07725fe9dc5d59a525990fc1dba78bc8b82af1/dom/base/nsGlobalWindowOuter.cpp#5131-5136, then wait for parent to send IPC back, the focus event is fired asynchronously due to the bounce of the IPC.
I also notice bug 1674702 that there is additional pair of blur and focus event gets fired while calling window.focus() on OOP iframe.
Assignee | ||
Comment 11•4 years ago
|
||
(In reply to Edgar Chen [:edgar] from comment #10)
(In reply to Henri Sivonen (:hsivonen) from comment #2)
As for sync vs. async, I'm not yet sure where that part will settle.
window.focus() on a non-OOP iframe would call nsContentUtils::RequestFrameFocus synchronously, https://searchfox.org/mozilla-central/rev/7b07725fe9dc5d59a525990fc1dba78bc8b82af1/dom/base/nsGlobalWindowOuter.cpp#5143, and then dispatch focus event synchronously.
But window.focus() on an OOP iframe sends an IPC message to its parent frame instead, https://searchfox.org/mozilla-central/rev/7b07725fe9dc5d59a525990fc1dba78bc8b82af1/dom/base/nsGlobalWindowOuter.cpp#5131-5136, then wait for parent to send IPC back, the focus event is fired asynchronously due to the bounce of the IPC.
Split this to bug 1674743.
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 12•4 years ago
|
||
Assignee | ||
Updated•4 years ago
|
Comment 13•4 years ago
|
||
Comment 15•4 years ago
|
||
bugherder |
Updated•4 years ago
|
Description
•