Bug 1517467. Handle us not having a subframe window in the contentDocument getter. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D15677
This commit is contained in:
@@ -76,7 +76,16 @@ nsIDocument* nsGenericHTMLFrameElement::GetContentDocument(
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsIDocument* doc = bc->GetDOMWindow()->GetDoc();
|
||||
nsPIDOMWindowOuter* window = bc->GetDOMWindow();
|
||||
if (!window) {
|
||||
// Either our browsing context contents are out-of-process (in which case
|
||||
// clearly this is a cross-origin call and we should return null), or our
|
||||
// browsing context is torn-down enough to no longer have a window or a
|
||||
// document, and we should still return null.
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsIDocument* doc = window->GetDoc();
|
||||
if (!doc) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user