diff options
author | Kosov Eugene <claprix@yandex.ru> | 2016-06-04 23:42:43 +0300 |
---|---|---|
committer | Kosov Eugene <claprix@yandex.ru> | 2016-06-08 23:10:20 +0300 |
commit | 3bb093cc16875c6fcfe5e7de9c9f6760ff9e18fc (patch) | |
tree | 849084e169234cfdc0d40ce79c36dfdb12582b1d /components/script/dom/document.rs | |
parent | a80767993b6b2b885dfac9666f16fb1e1649ac99 (diff) | |
download | servo-3bb093cc16875c6fcfe5e7de9c9f6760ff9e18fc.tar.gz servo-3bb093cc16875c6fcfe5e7de9c9f6760ff9e18fc.zip |
Make Document::DefaultView return a null value when there's no browsing context
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 2a7466dc2eb..c142945d131 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 |