Bug 1463291: Move docShell getter from Document to Window. r=bz

DocShells are associated with outer DOM Windows, rather than Documents, so
having the getter on the document is a bit odd to begin with. But it's also
considerably less convenient, since most of the times when we want a docShell
from JS, we're dealing most directly with a window, and have to detour through
the document to get it.

MozReview-Commit-ID: LUj1H9nG3QL
This commit is contained in:
Kris Maglione
2018-05-21 16:58:23 -07:00
parent 9ba14892f2
commit e97c582e3f
91 changed files with 116 additions and 121 deletions

View File

@@ -89,7 +89,7 @@ var contentScripts = new DefaultWeakMap(matcher => {
});
function getMessageManager(window) {
let docShell = window.document.docShell.QueryInterface(Ci.nsIInterfaceRequestor);
let docShell = window.docShell.QueryInterface(Ci.nsIInterfaceRequestor);
try {
return docShell.getInterface(Ci.nsIContentFrameMessageManager);
} catch (e) {