mirror of
https://github.com/servo/servo.git
synced 2025-08-01 11:40:30 +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();
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue