aboutsummaryrefslogtreecommitdiffstats
path: root/components/script
diff options
context:
space:
mode:
Diffstat (limited to 'components/script')
-rw-r--r--components/script/dom/location.rs6
-rw-r--r--components/script/dom/webidls/Location.webidl2
2 files changed, 7 insertions, 1 deletions
diff --git a/components/script/dom/location.rs b/components/script/dom/location.rs
index b9f1867e923..4f4c44e4015 100644
--- a/components/script/dom/location.rs
+++ b/components/script/dom/location.rs
@@ -9,6 +9,7 @@ use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::utils::{Reflector, reflect_dom_object};
use dom::urlhelper::UrlHelper;
use dom::window::Window;
+use dom::window::WindowHelpers;
use page::Page;
use util::str::DOMString;
@@ -37,6 +38,11 @@ impl Location {
}
impl<'a> LocationMethods for JSRef<'a, Location> {
+ // https://html.spec.whatwg.org/multipage/browsers.html#dom-location-assign
+ fn Assign(self, url: DOMString) {
+ self.page.frame().as_ref().unwrap().window.root().r().load_url(url);
+ }
+
fn Href(self) -> DOMString {
UrlHelper::Href(&self.page.get_url())
}
diff --git a/components/script/dom/webidls/Location.webidl b/components/script/dom/webidls/Location.webidl
index 99076988122..95d5cf1872b 100644
--- a/components/script/dom/webidls/Location.webidl
+++ b/components/script/dom/webidls/Location.webidl
@@ -5,7 +5,7 @@
// http://www.whatwg.org/html/#location
/*[Unforgeable]*/ interface Location {
- //void assign(DOMString url);
+ void assign(DOMString url);
//void replace(DOMString url);
//void reload();
};