diff options
author | Achal Shah <achals@gmail.com> | 2016-06-05 23:27:45 -0700 |
---|---|---|
committer | Achal Shah <achal@uber.com> | 2016-06-06 10:58:37 -0700 |
commit | a727fd2d6207fc9cf1215d0031b2c904f396590c (patch) | |
tree | ef3a9fc1bc12391a241f661304f482137506e45b /components/script/dom | |
parent | 1bc94c132e6820293c2178bf95991518b1e8a677 (diff) | |
download | servo-a727fd2d6207fc9cf1215d0031b2c904f396590c.tar.gz servo-a727fd2d6207fc9cf1215d0031b2c904f396590c.zip |
Implement URL.domainToUnicode
Diffstat (limited to 'components/script/dom')
-rw-r--r-- | components/script/dom/url.rs | 5 | ||||
-rw-r--r-- | components/script/dom/webidls/URL.webidl | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/components/script/dom/url.rs b/components/script/dom/url.rs index 1553e8b5b0a..8ecffe60b33 100644 --- a/components/script/dom/url.rs +++ b/components/script/dom/url.rs @@ -13,6 +13,7 @@ use dom::urlhelper::UrlHelper; use dom::urlsearchparams::URLSearchParams; use std::borrow::ToOwned; use std::default::Default; +use url::quirks::domain_to_unicode; use url::{Host, Url}; // https://url.spec.whatwg.org/#url @@ -100,6 +101,10 @@ impl URL { USVString("".to_owned()) } } + + pub fn DomainToUnicode(_: GlobalRef, origin: USVString) -> USVString { + USVString(domain_to_unicode(&origin.0)) + } } impl URLMethods for URL { diff --git a/components/script/dom/webidls/URL.webidl b/components/script/dom/webidls/URL.webidl index 6843bd8b6c2..dc4c71f512e 100644 --- a/components/script/dom/webidls/URL.webidl +++ b/components/script/dom/webidls/URL.webidl @@ -7,7 +7,7 @@ Exposed=(Window,Worker)*/] interface URL { static USVString domainToASCII(USVString domain); - // static USVString domainToUnicode(USVString domain); + static USVString domainToUnicode(USVString domain); [SetterThrows] /*stringifier*/ attribute USVString href; |