diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-06-06 13:03:57 -0500 |
---|---|---|
committer | bors-servo <lbergstrom+bors@mozilla.com> | 2016-06-06 13:03:57 -0500 |
commit | 21687b0f30dc6ebcfe1b1a499e978bf356f4698b (patch) | |
tree | e617bb21da26b691918fb80550ea25834e6a66af /components/script/dom | |
parent | 9fae4b18d1293101ecc17342e433bb1b0fff8398 (diff) | |
parent | a727fd2d6207fc9cf1215d0031b2c904f396590c (diff) | |
download | servo-21687b0f30dc6ebcfe1b1a499e978bf356f4698b.tar.gz servo-21687b0f30dc6ebcfe1b1a499e978bf356f4698b.zip |
Auto merge of #11632 - achals:master, r=KiChjang
Implement URL.domainToUnicode
Fixes #11629
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #11629 (github issue number if applicable).
<!-- Either: -->
- [X] There are tests for these changes: Some expected test failures have been removed.
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11632)
<!-- Reviewable:end -->
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; |