aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom')
-rw-r--r--components/script/dom/document.rs5
-rw-r--r--components/script/dom/webidls/Document.webidl2
-rw-r--r--components/script/dom/window.rs2
-rw-r--r--components/script/dom/xmldocument.rs4
4 files changed, 6 insertions, 7 deletions
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs
index 367ffb11d0c..f10c04ab828 100644
--- a/components/script/dom/document.rs
+++ b/components/script/dom/document.rs
@@ -2423,8 +2423,8 @@ impl DocumentMethods for Document {
}
// https://html.spec.whatwg.org/multipage/#dom-document-location
- fn Location(&self) -> Root<Location> {
- self.location.or_init(|| Location::new(&self.window))
+ fn GetLocation(&self) -> Option<Root<Location>> {
+ self.browsing_context().map(|_| self.location.or_init(|| Location::new(&self.window)))
}
// https://dom.spec.whatwg.org/#dom-parentnode-children
@@ -2777,4 +2777,3 @@ pub enum FocusEventType {
Focus, // Element gained focus. Doesn't bubble.
Blur, // Element lost focus. Doesn't bubble.
}
-
diff --git a/components/script/dom/webidls/Document.webidl b/components/script/dom/webidls/Document.webidl
index 7ca1dec527f..1d12bc7aabb 100644
--- a/components/script/dom/webidls/Document.webidl
+++ b/components/script/dom/webidls/Document.webidl
@@ -81,7 +81,7 @@ enum DocumentReadyState { "loading", "interactive", "complete" };
partial /*sealed*/ interface Document {
// resource metadata management
[/*PutForwards=href, */Unforgeable]
- readonly attribute Location/*?*/ location;
+ readonly attribute Location? location;
readonly attribute DOMString domain;
// readonly attribute DOMString referrer;
[Throws]
diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs
index bd8ae5b9f39..da415c5d0f2 100644
--- a/components/script/dom/window.rs
+++ b/components/script/dom/window.rs
@@ -441,7 +441,7 @@ impl WindowMethods for Window {
// https://html.spec.whatwg.org/multipage/#dom-location
fn Location(&self) -> Root<Location> {
- self.Document().Location()
+ self.Document().GetLocation().unwrap()
}
// https://html.spec.whatwg.org/multipage/#dom-sessionstorage
diff --git a/components/script/dom/xmldocument.rs b/components/script/dom/xmldocument.rs
index 6fc1ebfd267..8f614a0442c 100644
--- a/components/script/dom/xmldocument.rs
+++ b/components/script/dom/xmldocument.rs
@@ -76,8 +76,8 @@ impl XMLDocument {
impl XMLDocumentMethods for XMLDocument {
// https://html.spec.whatwg.org/multipage/#dom-document-location
- fn Location(&self) -> Root<Location> {
- self.document.Location()
+ fn GetLocation(&self) -> Option<Root<Location>> {
+ self.document.GetLocation()
}
// https://html.spec.whatwg.org/multipage/#dom-tree-accessors:supported-property-names