diff options
-rw-r--r-- | components/script/dom/location.rs | 6 | ||||
-rw-r--r-- | components/script/dom/webidls/Location.webidl | 2 | ||||
-rw-r--r-- | tests/wpt/metadata/html/dom/interfaces.html.ini | 9 |
3 files changed, 7 insertions, 10 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(); }; diff --git a/tests/wpt/metadata/html/dom/interfaces.html.ini b/tests/wpt/metadata/html/dom/interfaces.html.ini index b9c8eff57bf..35f198ddf2d 100644 --- a/tests/wpt/metadata/html/dom/interfaces.html.ini +++ b/tests/wpt/metadata/html/dom/interfaces.html.ini @@ -8646,21 +8646,12 @@ [Location interface object length] expected: FAIL - [Location interface: operation assign(DOMString)] - expected: FAIL - [Location interface: operation replace(DOMString)] expected: FAIL [Location interface: operation reload()] expected: FAIL - [Location interface: window.location must inherit property "assign" with the proper type (0)] - expected: FAIL - - [Location interface: calling assign(DOMString) on window.location with too few arguments must throw TypeError] - expected: FAIL - [Location interface: window.location must inherit property "replace" with the proper type (1)] expected: FAIL |