mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Implemented Location.assign
This commit is contained in:
parent
c360b75e16
commit
75e5c6fcdb
3 changed files with 7 additions and 10 deletions
|
@ -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())
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
};
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue