In file security/manager/ssl/nsSecureBrowserUIImpl.cpp
Checks ItemType of existing DocShell, and if it is content, returns the SameType root DocShell’s Document.
Related to mixed content BrowserContext state bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1580678
Returned documents are used here (see method calls on
Much of the state seems to be sensitive state that can be used to fingerprint out-of-process documents, and may not be easy to sync up.
Most uses seem to not be that perf sensitive, content-blocking checks on web-pages are rare.
Either change this to replicate state in BrowsingContext and use it directly (ask nika or someone else whether the state being accessed here is syncable), or change implementation to use BrowsingContext as is and change users to use IPC when root is out of process.