Auto merge of #13912 - ddrmanxbxfr:remove-deprecated-url-methods, r=Ms2ger

Remove URL.domainToASCII and URL.domainToUnicode

Modifications

- Removed URL.domainToASCII method
- Removed URL.domainToUnicode method
- Added test in wpt to make sure both method are undefined.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #13835  (github issue number if applicable).
- [X] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13912)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-10-25 19:46:54 -05:00 committed by GitHub
commit 4b28750b9a
7 changed files with 20 additions and 48 deletions

View file

@ -26,4 +26,12 @@ test(function() {
url.href = "./bar";
});
}, "Setting URL's href attribute and base URLs");
test(function() {
assert_equals(URL.domainToASCII, undefined);
}, "URL.domainToASCII should be undefined");
test(function() {
assert_equals(URL.domainToUnicode, undefined);
}, "URL.domainToUnicode should be undefined");
</script>

View file

@ -13,4 +13,12 @@ test(function() {
});
}, "Setting URL's href attribute and base URLs");
test(function() {
assert_equals(URL.domainToASCII, undefined);
}, "URL.domainToASCII should be undefined");
test(function() {
assert_equals(URL.domainToUnicode, undefined);
}, "URL.domainToUnicode should be undefined");
done();

View file

@ -12,9 +12,6 @@
[Constructor(USVString url, optional USVString base),
Exposed=(Window,Worker)]
interface URL {
static USVString domainToASCII(USVString domain);
static USVString domainToUnicode(USVString domain);
stringifier attribute USVString href;
readonly attribute USVString origin;
attribute USVString protocol;

View file

@ -1,21 +0,0 @@
<!doctype html>
<meta charset="utf-8">
<title></title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(function() {
var domain = 'example.org'
assert_true(URL.domainToUnicode(domain) === domain, 'Ascii domain should be parsed correctly.')
}, 'URL.domainToUnicode valid input')
test(function() {
var domain = 'xn--maana-pta.com'
assert_true(URL.domainToUnicode(domain) === 'mañana.com', ' Ascii encoded domain should be parsed correctly.')
}, 'URL.domainToUnicode valid encoded input')
test(function() {
var domain = 'http://not.a.domain'
assert_true(URL.domainToUnicode(domain) === "", 'Invalid domain should be return an empty string.')
}, 'URL.domainToUnicode invalid input')
</script>