aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-04-10 00:39:51 +0530
committerbors-servo <lbergstrom+bors@mozilla.com>2016-04-10 00:39:51 +0530
commitc33bf4987af3479c515351195a55c12dacfcc871 (patch)
treee10bc23b3a08299bf3e4c1dc08ec7fbaae0c97ec /components/script/dom
parent32e53b80e28731cd05ddbe561f99e9570a34ff07 (diff)
parent6626c5cfd492239aa716438a3b9d6b2e94999956 (diff)
downloadservo-c33bf4987af3479c515351195a55c12dacfcc871.tar.gz
servo-c33bf4987af3479c515351195a55c12dacfcc871.zip
Auto merge of #10257 - slayerjain:first_bug, r=KiChjang
Fixes #10141. <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10257) <!-- Reviewable:end -->
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