diff options
Diffstat (limited to 'components/script/dom/location.rs')
-rw-r--r-- | components/script/dom/location.rs | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/components/script/dom/location.rs b/components/script/dom/location.rs index 3bde73d6f73..1d9f291c057 100644 --- a/components/script/dom/location.rs +++ b/components/script/dom/location.rs @@ -42,16 +42,46 @@ impl<'a> LocationMethods for &'a Location { self.window.root().r().load_url(url); } + // https://url.spec.whatwg.org/#dom-urlutils-hash + fn Hash(self) -> USVString { + UrlHelper::Hash(&self.get_url()) + } + // https://url.spec.whatwg.org/#dom-urlutils-href fn Href(self) -> USVString { UrlHelper::Href(&self.get_url()) } + // https://url.spec.whatwg.org/#dom-urlutils-host + fn Host(self) -> USVString { + UrlHelper::Host(&self.get_url()) + } + + // https://url.spec.whatwg.org/#dom-urlutils-hostname + fn Hostname(self) -> USVString { + UrlHelper::Hostname(&self.get_url()) + } + + // https://url.spec.whatwg.org/#dom-urlutils-password + fn Password(self) -> USVString { + UrlHelper::Password(&self.get_url()) + } + // https://url.spec.whatwg.org/#dom-urlutils-pathname fn Pathname(self) -> USVString { UrlHelper::Pathname(&self.get_url()) } + // https://url.spec.whatwg.org/#dom-urlutils-port + fn Port(self) -> USVString { + UrlHelper::Port(&self.get_url()) + } + + // https://url.spec.whatwg.org/#dom-urlutils-protocol + fn Protocol(self) -> USVString { + UrlHelper::Protocol(&self.get_url()) + } + // https://url.spec.whatwg.org/#URLUtils-stringification-behavior fn Stringifier(self) -> DOMString { self.Href().0 @@ -62,9 +92,9 @@ impl<'a> LocationMethods for &'a Location { UrlHelper::Search(&self.get_url()) } - // https://url.spec.whatwg.org/#dom-urlutils-hash - fn Hash(self) -> USVString { - UrlHelper::Hash(&self.get_url()) + // https://url.spec.whatwg.org/#dom-urlutils-username + fn Username(self) -> USVString { + UrlHelper::Username(&self.get_url()) } } |