diff options
9 files changed, 6 insertions, 27 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 diff --git a/tests/wpt/metadata/XMLHttpRequest/responsexml-document-properties.htm.ini b/tests/wpt/metadata/XMLHttpRequest/responsexml-document-properties.htm.ini index a74575c88e0..fd87c9906e8 100644 --- a/tests/wpt/metadata/XMLHttpRequest/responsexml-document-properties.htm.ini +++ b/tests/wpt/metadata/XMLHttpRequest/responsexml-document-properties.htm.ini @@ -9,9 +9,6 @@ [readyState] expected: FAIL - [location] - expected: FAIL - [defaultView] expected: FAIL diff --git a/tests/wpt/metadata/domparsing/DOMParser-parseFromString-html.html.ini b/tests/wpt/metadata/domparsing/DOMParser-parseFromString-html.html.ini index 064dfd76d81..8b137891791 100644 --- a/tests/wpt/metadata/domparsing/DOMParser-parseFromString-html.html.ini +++ b/tests/wpt/metadata/domparsing/DOMParser-parseFromString-html.html.ini @@ -1,5 +1 @@ -[DOMParser-parseFromString-html.html] - type: testharness - [Location value] - expected: FAIL diff --git a/tests/wpt/metadata/domparsing/DOMParser-parseFromString-xml.html.ini b/tests/wpt/metadata/domparsing/DOMParser-parseFromString-xml.html.ini index 144ce5489de..66597d94001 100644 --- a/tests/wpt/metadata/domparsing/DOMParser-parseFromString-xml.html.ini +++ b/tests/wpt/metadata/domparsing/DOMParser-parseFromString-xml.html.ini @@ -1,9 +1,6 @@ [DOMParser-parseFromString-xml.html] type: testharness expected: TIMEOUT - [Should parse correctly in type text/xml] - expected: FAIL - [Should return an error document for XML wellformedness errors in type text/xml] expected: FAIL diff --git a/tests/wpt/metadata/html/browsers/history/the-location-interface/document_location.html.ini b/tests/wpt/metadata/html/browsers/history/the-location-interface/document_location.html.ini index 4882ce9565e..e69de29bb2d 100644 --- a/tests/wpt/metadata/html/browsers/history/the-location-interface/document_location.html.ini +++ b/tests/wpt/metadata/html/browsers/history/the-location-interface/document_location.html.ini @@ -1,5 +0,0 @@ -[document_location.html] - type: testharness - [document not in a browsing context] - expected: FAIL - diff --git a/tests/wpt/mozilla/meta/mozilla/windowproxy.html.ini b/tests/wpt/mozilla/meta/mozilla/windowproxy.html.ini index b2d6e8a1da1..e69de29bb2d 100644 --- a/tests/wpt/mozilla/meta/mozilla/windowproxy.html.ini +++ b/tests/wpt/mozilla/meta/mozilla/windowproxy.html.ini @@ -1,5 +0,0 @@ -[windowproxy.html] - type: testharness - [document.location is the right thing on non-rendered document] - expected: FAIL - |