This is written by greening up the tree with the following patch:
https://hg.mozilla.org/try/rev/4f0388e9b8f76ff3008d3ec74ee793bb8f9fc364
All uses are effectively one of these categories:
* windowRoot.ownerGlobal usage. Replaced by an explicit .window
property.
* Things that accidentally were given a window when they expected an
element. Fixed by fixing callers as appropriate. Examples of these
are using isBrowserPrivate(window) or so, or various test methods
that expect a <browser> or <tabbrowser> and were given a Window.
* Things that had a window-or-node and used ownerGlobal to normalize to
a window. E.g. the AutoScrollChild or extensions code. Fixed by
checking explicitly for Window.
* Things that had a window and called ownerGlobal on it. Fixed by just
removing the ownerGlobal accessor.
Main idea after this is to replace all .ownerGlobal usage with
.documentGlobal, and remove .ownerGlobal from JS (maybe exposing
.relevantGlobal if absolutely needed).
Differential Revision: https://phabricator.services.mozilla.com/D295189