mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
issue #10141 : Document::location set null for documents without a browsing context. r=Ms2ger
This commit is contained in:
parent
32e53b80e2
commit
6626c5cfd4
9 changed files with 6 additions and 27 deletions
|
@ -2423,8 +2423,8 @@ impl DocumentMethods for Document {
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/#dom-document-location
|
// https://html.spec.whatwg.org/multipage/#dom-document-location
|
||||||
fn Location(&self) -> Root<Location> {
|
fn GetLocation(&self) -> Option<Root<Location>> {
|
||||||
self.location.or_init(|| Location::new(&self.window))
|
self.browsing_context().map(|_| self.location.or_init(|| Location::new(&self.window)))
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://dom.spec.whatwg.org/#dom-parentnode-children
|
// https://dom.spec.whatwg.org/#dom-parentnode-children
|
||||||
|
@ -2777,4 +2777,3 @@ pub enum FocusEventType {
|
||||||
Focus, // Element gained focus. Doesn't bubble.
|
Focus, // Element gained focus. Doesn't bubble.
|
||||||
Blur, // Element lost focus. Doesn't bubble.
|
Blur, // Element lost focus. Doesn't bubble.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,7 @@ enum DocumentReadyState { "loading", "interactive", "complete" };
|
||||||
partial /*sealed*/ interface Document {
|
partial /*sealed*/ interface Document {
|
||||||
// resource metadata management
|
// resource metadata management
|
||||||
[/*PutForwards=href, */Unforgeable]
|
[/*PutForwards=href, */Unforgeable]
|
||||||
readonly attribute Location/*?*/ location;
|
readonly attribute Location? location;
|
||||||
readonly attribute DOMString domain;
|
readonly attribute DOMString domain;
|
||||||
// readonly attribute DOMString referrer;
|
// readonly attribute DOMString referrer;
|
||||||
[Throws]
|
[Throws]
|
||||||
|
|
|
@ -441,7 +441,7 @@ impl WindowMethods for Window {
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/#dom-location
|
// https://html.spec.whatwg.org/multipage/#dom-location
|
||||||
fn Location(&self) -> Root<Location> {
|
fn Location(&self) -> Root<Location> {
|
||||||
self.Document().Location()
|
self.Document().GetLocation().unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/#dom-sessionstorage
|
// https://html.spec.whatwg.org/multipage/#dom-sessionstorage
|
||||||
|
|
|
@ -76,8 +76,8 @@ impl XMLDocument {
|
||||||
|
|
||||||
impl XMLDocumentMethods for XMLDocument {
|
impl XMLDocumentMethods for XMLDocument {
|
||||||
// https://html.spec.whatwg.org/multipage/#dom-document-location
|
// https://html.spec.whatwg.org/multipage/#dom-document-location
|
||||||
fn Location(&self) -> Root<Location> {
|
fn GetLocation(&self) -> Option<Root<Location>> {
|
||||||
self.document.Location()
|
self.document.GetLocation()
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/#dom-tree-accessors:supported-property-names
|
// https://html.spec.whatwg.org/multipage/#dom-tree-accessors:supported-property-names
|
||||||
|
|
|
@ -9,9 +9,6 @@
|
||||||
[readyState]
|
[readyState]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[location]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[defaultView]
|
[defaultView]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1 @@
|
||||||
[DOMParser-parseFromString-html.html]
|
|
||||||
type: testharness
|
|
||||||
[Location value]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
[DOMParser-parseFromString-xml.html]
|
[DOMParser-parseFromString-xml.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
expected: TIMEOUT
|
expected: TIMEOUT
|
||||||
[Should parse correctly in type text/xml]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Should return an error document for XML wellformedness errors in type text/xml]
|
[Should return an error document for XML wellformedness errors in type text/xml]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
[document_location.html]
|
|
||||||
type: testharness
|
|
||||||
[document not in a browsing context]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
[windowproxy.html]
|
|
||||||
type: testharness
|
|
||||||
[document.location is the right thing on non-rendered document]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue