Closed Bug 1635914 Opened 6 years ago Closed 5 years ago

browser.docShellIsActive is false by default

Categories

(GeckoView :: General, defect, P2)

Unspecified
All
defect

Tracking

(firefox85 fixed)

RESOLVED FIXED
85 Branch
Tracking Status
firefox85 --- fixed

People

(Reporter: agi, Assigned: emilio)

References

Details

Attachments

(3 files)

Looks like docShellIsActive is false by default which breaks our expectation that sessions are active by default. We should try to fix this in docShell directly if we can.

Assignee: nobody → agi
Status: NEW → ASSIGNED
Keywords: leave-open
Pushed by asferro@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1122e0d6545e Add workaround for docShellIsActive. r=snorp
Severity: -- → S3
Priority: -- → P2

This is actually somewhat complicated, and a bit weird and buggy. A few notes:

  1. The flag in the parent process mDocShellIsActive is initialized to false in ContentParent.cpp, which is wrong. The "real" initial state for a BrowsingContext/DocShell is true
  • to be even more correct it should probably just directly read and set the BrowsingContext::{Get,Set}IsActive synced field.
  1. The flag is set from the content process by sending a BrowsingContext::SendSetDocShellIsActive message, and then the content process setting the flag on the BC.
  • We should be directly setting it on the BC from the parent process, and not exposing the flag on BrowserParent or nsDocShell
  1. The actual side effects of setting IsActive are only occurring in the nsDocShell setter method, and aren't happening in a consistent way across all processes. This means that, e.g. after a process switch, the 3 different states (BrowserParent, BrowsingContext, and in-process state) don't necessarily match at all.

This entire setup probably needs to be reworked to instead work with isActive being set on a frame from the parent process, and the state being correctly set and the callbacks being correctly fired in every content process including after process switches.

ni? :emilio, as they've worked on issues like this one before.

Flags: needinfo?(emilio)
Assignee: agi → emilio
Depends on: 1673707

And have it mirror in the parent process more automatically.

The docShellIsActive setter in the browser-custom-element side needs to
be there rather than in the usual DidSet() calls because the
AsyncTabSwitcher code relies on getting an exact amount of notifications
as response to that specific setter. Not pretty, but...

Sorry I slacked a bit on this, I saw a lot of orange and I tried to fix the tab switcher in more elegant ways, oh well!

Flags: needinfo?(emilio)
Depends on: 1676932
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6ef67464ede7 Move active flag handling explicitly to BrowsingContext. r=nika
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Blocks: 1679521
Regressions: 1682917
Regressions: 1685163
Regressions: 1683188
Keywords: leave-open
Target Milestone: --- → 85 Branch
See Also: → 1717983
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: