aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/location.rs
diff options
context:
space:
mode:
authorChandler Abraham <cabraham@twitter.com>2016-01-21 11:06:41 -0800
committerChandler Abraham <cabraham@twitter.com>2016-01-21 11:06:41 -0800
commit1ee9ccba215535dfc1af93a3579c5bca4a21706f (patch)
tree3381c3ec9b57ad8781987aad473eb48b3fdc4b04 /components/script/dom/location.rs
parent1ba1fb0b7f46472e1f37f4e3f2e7dde025fa9f1f (diff)
downloadservo-1ee9ccba215535dfc1af93a3579c5bca4a21706f.tar.gz
servo-1ee9ccba215535dfc1af93a3579c5bca4a21706f.zip
add origin to location and url api
Diffstat (limited to 'components/script/dom/location.rs')
-rw-r--r--components/script/dom/location.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/components/script/dom/location.rs b/components/script/dom/location.rs
index 0457da58618..08e23b15920 100644
--- a/components/script/dom/location.rs
+++ b/components/script/dom/location.rs
@@ -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())