From a727fd2d6207fc9cf1215d0031b2c904f396590c Mon Sep 17 00:00:00 2001 From: Achal Shah Date: Sun, 5 Jun 2016 23:27:45 -0700 Subject: Implement URL.domainToUnicode --- components/script/dom/url.rs | 5 +++++ components/script/dom/webidls/URL.webidl | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'components/script/dom') 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; -- cgit v1.2.3