add origin to location and url api

This commit is contained in:
Chandler Abraham 2016-01-21 11:06:41 -08:00
parent 1ba1fb0b7f
commit 1ee9ccba21
11 changed files with 62 additions and 607 deletions

View file

@ -81,6 +81,11 @@ impl LocationMethods for Location {
self.set_url_component(value, UrlHelper::SetHost);
}
// https://html.spec.whatwg.org/multipage/#dom-location-origin
fn Origin(&self) -> USVString {
UrlHelper::Origin(&self.get_url())
}
// https://html.spec.whatwg.org/multipage/#dom-location-hostname
fn Hostname(&self) -> USVString {
UrlHelper::Hostname(&self.get_url())