diff options
Diffstat (limited to 'components/script/dom/document.rs')
-rw-r--r-- | components/script/dom/document.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index 6e4b4b030e8..4dfb484a301 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -2551,8 +2551,12 @@ impl DocumentMethods for Document { } // https://html.spec.whatwg.org/multipage/#dom-document-defaultview - fn DefaultView(&self) -> Root<Window> { - Root::from_ref(&*self.window) + fn GetDefaultView(&self) -> Option<Root<Window>> { + if self.browsing_context.is_none() { + None + } else { + Some(Root::from_ref(&*self.window)) + } } // https://html.spec.whatwg.org/multipage/#dom-document-cookie |