Closed Bug 1614297 Opened 4 years ago Closed 4 years ago

Out-of-process iframes don't deactivate when their top-level window is lowered

Categories

(Core :: DOM: UI Events & Focus Handling, defect, P2)

defect

Tracking

()

RESOLVED FIXED
Fission Milestone M6

People

(Reporter: hsivonen, Assigned: hsivonen)

References

Details

(Whiteboard: [fixed by bug 1615548])

Attachments

(1 obsolete file)

Spun off from bug 1556627: Out-of-process iframes don't deactivate when their top-level window is lowered. The easiest to observe symptom is that form controls don't appear dimmed.

Fission Milestone: --- → ?

Some observations:

If the chrome process broadcast deactivation to the whole BrowsingContext subtree when it deactivates the top-level Web content, the IPC messages would race as they'd reach the content processes.

When we are in a content process, we propagate deactivation only to the iframe in which the focus is. We should also propagate it to other iframes. However, at the relevant point in the code we don't have a BrowsingContext pointer to "this" BrowsingContext to find the right subtree.

I guess I'll look into what it would take to get the "this" BrowsingContext pointer to the right place.

Sigh. With multiple levels of iframes, it's even worse than that. Really the easiest thing would be doing the broadcast from the top, but that would arrive at leaves sooner than the current along-path handling of the iframes that are along the focus chain.

Maybe we can filter out the focused chain as we're doing the broadcast?

Priority: -- → P2

The attached patch appears to propagate deactivatedness properly, but still the rendering doesn't reflect the change.

(In reply to Henri Sivonen (:hsivonen) from comment #5)

The attached patch appears to propagate deactivatedness properly, but still the rendering doesn't reflect the change.

With the attached path there appears to be a call into Stylo to invalidate styles and there is a subsequent marking of the layer tree as needing an update.

I don't have immediate ideas for why the visuals don't actually update.

farre, do we have some optimizations not to repaint the layers of inactive OOP iframes?

Flags: needinfo?(afarre)

Tracking for Fission Nightly (M6), unless this is causing test failures.

Fission Milestone: ? → M6
Blocks: 1617222
Blocks: 1612839
Blocks: 1612842
Blocks: 1612844
Blocks: 1613031
Blocks: 1613717
Blocks: 1613899
Blocks: 1615544
Blocks: 1616772

With the attached patch OOP iframes seem to run the deactivation steps, but the OOP iframes continue to appear active. This is with other in-flight patches, including bug 1618152. My patch queue is available from https://github.com/hsivonen/gecko/tree/deactivate

Neil, do you have ideas what's wrong here? Also, does this patch look right (worth getting through review and landing) even if insufficient?

Flags: needinfo?(enndeakin)

Making progress in bug 1615548 in a way that reduces the need to understand this situation directly for now.

Flags: needinfo?(enndeakin)
Flags: needinfo?(afarre)

This was fixed as a side effect of bug 1615548. However, now there's a new bug: The out-of-process iframes don't return back to the right state when switching windows back.

Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Whiteboard: [fixed by bug 1615548]

(In reply to Henri Sivonen (:hsivonen) from comment #10)

However, now there's a new bug: The out-of-process iframes don't return back to the right state when switching windows back.

Filed as bug 1622738.

No longer blocks: 1613717
No longer blocks: 1616772
No longer blocks: 1615544
Attachment #9126650 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: