active browsing context is not set when process is reused immediately after window is lowered
Categories
(Core :: DOM: Navigation, defect)
Tracking
()
People
(Reporter: sefeng211, Unassigned)
Details
I stumbled this bug while investigating bug 1889406.
STR:
- Load https://sefeng211.github.io/testfiles/pageA.html (site A)
- After 1 second, it'll navigate to pageB.html (site B). Notices that b embeds an iframe which is has the same-origin as pageA.
- Click the back button to navigate back to pageA.html
- Click the forward button to navigate back to pageB.html
- Try click focus the <input> element in the embedded iframe.
Notice clicking the <input> element doesn't work. After some investigation, I think this is what happened.
At step 4, since we are lowering the window, the active bc for that content process will be set to null. In the meantime, pageB is restored from session history, but it doesn't set the active bc to the process that site A belongs to.
I see we have two options here.
- We could get the
ContentParent
for site A, and then callSendSetupFocusedAndActive
to here at where we select processes for session history restored pages. - We could ask pageB to set it descendants, maybe at
nsFocusManager::WindowRaised
for pageB? Right now we exit early at https://searchfox.org/mozilla-central/rev/90dc3743ea284c258148124dc54dfd123e82586f/dom/base/nsFocusManager.cpp#720-724
Reporter | ||
Comment 1•1 year ago
|
||
Since this relates to Focusing and SH...henri, peter, thoughts on this?
Comment 2•1 year ago
|
||
Disclaimer: It's been long enough since I worked on this code that I don't really remember things on the level of detail that's required for an informed answer.
My feeling is that as an architectural matter, we're supposed to prefer option 2: I.e. a content process that has an iframe element is responsible for asking for what's inside the iframe to get its status right.
However, SHIP happened after I worked on this code, and there may well be valid reasons to prefer option 1 now.
Reporter | ||
Comment 3•11 months ago
|
||
Thans Henri, I am investigating to see if there's a solution that can fix this one and also bug 1889406.
Description
•