diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-03-18 10:56:28 +0100 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-03-18 10:56:28 +0100 |
commit | 912aa47acf658ae26ac24bb3f6ca52b04919f2ee (patch) | |
tree | fd551c51c78df5ab60db9c97d2e5deb90aa4ff75 /dom/html/nsHTMLDocument.cpp | |
parent | a24511ca8e19afe4d19008ba903e1edab0af3223 (diff) | |
parent | ea1b2e81e4c092a3b871bed49e907fba20483bdc (diff) | |
download | UXP-912aa47acf658ae26ac24bb3f6ca52b04919f2ee.tar UXP-912aa47acf658ae26ac24bb3f6ca52b04919f2ee.tar.gz UXP-912aa47acf658ae26ac24bb3f6ca52b04919f2ee.tar.lz UXP-912aa47acf658ae26ac24bb3f6ca52b04919f2ee.tar.xz UXP-912aa47acf658ae26ac24bb3f6ca52b04919f2ee.zip |
Merge branch 'ported-upstream'
Diffstat (limited to 'dom/html/nsHTMLDocument.cpp')
-rw-r--r-- | dom/html/nsHTMLDocument.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/dom/html/nsHTMLDocument.cpp b/dom/html/nsHTMLDocument.cpp index fea78dc37..be5a34d41 100644 --- a/dom/html/nsHTMLDocument.cpp +++ b/dom/html/nsHTMLDocument.cpp @@ -1536,6 +1536,18 @@ nsHTMLDocument::Open(JSContext* cx, nsCOMPtr<nsIDocument> ret = this; return ret.forget(); } + + // Now double-check that our invariants still hold. + if (!mScriptGlobalObject) { + nsCOMPtr<nsIDocument> ret = this; + return ret.forget(); + } + + nsPIDOMWindowOuter* outer = GetWindow(); + if (!outer || (GetInnerWindow() != outer->GetCurrentInnerWindow())) { + nsCOMPtr<nsIDocument> ret = this; + return ret.forget(); + } } nsCOMPtr<nsIWebNavigation> webnav(do_QueryInterface(shell)); |