diff options
author | Corey Farwell <coreyf@rwell.org> | 2015-04-11 11:35:40 -0700 |
---|---|---|
committer | Corey Farwell <coreyf@rwell.org> | 2015-04-14 18:03:13 -0400 |
commit | cc4a64e1feb4e4a94621374f993ba548ab3681ff (patch) | |
tree | ac9041361e143795e170ce026c334745475ac8b9 /components/script/dom/urlhelper.rs | |
parent | 7f422e2076e7ebc9949e9fb2ffc3f09c653130c0 (diff) | |
download | servo-cc4a64e1feb4e4a94621374f993ba548ab3681ff.tar.gz servo-cc4a64e1feb4e4a94621374f993ba548ab3681ff.zip |
Add/update comments with links to spec
Extracted out of #5649
* add more hyperlinks to associated specification for structs/methods
* follow redirects and update links
* replace broken links
* removal of WHATWG multipage page name since the page name is not
guaranteed to be stable
Diffstat (limited to 'components/script/dom/urlhelper.rs')
-rw-r--r-- | components/script/dom/urlhelper.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/components/script/dom/urlhelper.rs b/components/script/dom/urlhelper.rs index a9d29521579..4a86c75a722 100644 --- a/components/script/dom/urlhelper.rs +++ b/components/script/dom/urlhelper.rs @@ -11,10 +11,12 @@ use std::borrow::ToOwned; pub struct UrlHelper; impl UrlHelper { + // https://url.spec.whatwg.org/#dom-urlutils-href pub fn Href(url: &Url) -> USVString { USVString(url.serialize()) } + // https://url.spec.whatwg.org/#dom-urlutils-search pub fn Search(url: &Url) -> USVString { USVString(match url.query { None => "".to_owned(), @@ -23,6 +25,7 @@ impl UrlHelper { }) } + // https://url.spec.whatwg.org/#dom-urlutils-hash pub fn Hash(url: &Url) -> USVString { USVString(match url.fragment { None => "".to_owned(), @@ -31,8 +34,8 @@ impl UrlHelper { }) } + // https://url.spec.whatwg.org/#dom-urlutils-pathname pub fn Pathname(url: &Url) -> USVString { - // https://url.spec.whatwg.org/#dom-urlutils-pathname // FIXME: Url null check is skipped for now USVString(match url.scheme_data { SchemeData::NonRelative(ref scheme_data) => scheme_data.clone(), @@ -40,7 +43,7 @@ impl UrlHelper { }) } - /// https://html.spec.whatwg.org/multipage/#same-origin + // https://html.spec.whatwg.org/multipage/#same-origin pub fn SameOrigin(urlA: &Url, urlB: &Url) -> bool { if urlA.host() != urlB.host() { return false |