diff options
author | Alan Jeffrey <ajeffrey@mozilla.com> | 2017-09-20 13:47:12 -0500 |
---|---|---|
committer | Alan Jeffrey <ajeffrey@mozilla.com> | 2017-09-20 14:20:04 -0500 |
commit | 3d00b0e2ac3920124df0820c09167dd741920717 (patch) | |
tree | 99ca132a4872eaece6459f105d66835e866da65a /components/script/dom/document.rs | |
parent | eefd59e9332ea054908548eaba63ac12ff4bf46c (diff) | |
download | servo-3d00b0e2ac3920124df0820c09167dd741920717.tar.gz servo-3d00b0e2ac3920124df0820c09167dd741920717.zip |
Window should own Location, Document shouldn't
Diffstat (limited to 'components/script/dom/document.rs')
-rw-r--r-- | components/script/dom/document.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index e3bb46bf5c0..e50ff071f6e 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -226,7 +226,6 @@ pub struct Document { node: Node, window: JS<Window>, implementation: MutNullableJS<DOMImplementation>, - location: MutNullableJS<Location>, content_type: DOMString, last_modified: Option<String>, encoding: Cell<EncodingRef>, @@ -2222,7 +2221,6 @@ impl Document { window: JS::from_ref(window), has_browsing_context: has_browsing_context == HasBrowsingContext::Yes, implementation: Default::default(), - location: Default::default(), content_type: match content_type { Some(string) => string, None => DOMString::from(match is_html_document { @@ -3438,7 +3436,11 @@ impl DocumentMethods for Document { // https://html.spec.whatwg.org/multipage/#dom-document-location fn GetLocation(&self) -> Option<Root<Location>> { - self.browsing_context().map(|_| self.location.or_init(|| Location::new(&self.window))) + if self.is_fully_active() { + Some(self.window.Location()) + } else { + None + } } // https://dom.spec.whatwg.org/#dom-parentnode-children @@ -3815,7 +3817,6 @@ impl DocumentMethods for Document { // Step 19. self.implementation.set(None); - self.location.set(None); self.images.set(None); self.embeds.set(None); self.links.set(None); |