Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URL: ToASCII #5976

Merged
merged 6 commits into from
Jun 1, 2017
Merged

URL: ToASCII #5976

merged 6 commits into from
Jun 1, 2017

Conversation

annevk
Copy link
Member

@annevk annevk commented May 18, 2017

Tests for whatwg/url#53 and friends.

@annevk
Copy link
Member Author

annevk commented May 18, 2017

@rmisev would you be interested in reviewing this? I included tests you created for whatwg/url#309. I'll also go ahead and file issues against all browsers so we get ToASCII handling consistent, even when the input is just ASCII. I suppose I'll also file an issue against Node.js.

@annevk
Copy link
Member Author

annevk commented May 18, 2017

(This is basically a much simplified version of #4504, to get the high-level issues between implementations ironed out first.)

@ghost
Copy link

ghost commented May 18, 2017

*This report has been truncated because the total content is 252267 characters in length, which is in excess of GitHub.com's limit for comments (65536 characters).

View the complete job log.

Firefox (nightly)

Testing web-platform-tests at revision b5d96af
Using browser at version BuildID 20170601100220; SourceStamp bdb2387396b4a74dfefb7c983733eed3625e906a
Starting 10 test iterations
All results were stable

All results

1 test ran
/url/toascii.window.html
Subtest Results Messages
OK
Loading data� PASS
aa-- (using URL) PASS
aa-- (using URL.host) PASS
aa-- (using URL.hostname) PASS
aa-- (using <a>) PASS
aa-- (using <a>.host) PASS
aa-- (using <a>.hostname) PASS
aa-- (using <area>) PASS
aa-- (using <area>.host) PASS
aa-- (using <area>.hostname) PASS
a�-- (using URL) PASS
a�-- (using URL.host) PASS
a�-- (using URL.hostname) PASS
a�-- (using <a>) PASS
a�-- (using <a>.host) PASS
a�-- (using <a>.hostname) PASS
a�-- (using <area>) PASS
a�-- (using <area>.host) PASS
a�-- (using <area>.hostname) PASS
ab--c (using URL) PASS
ab--c (using URL.host) PASS
ab--c (using URL.hostname) PASS
ab--c (using <a>) PASS
ab--c (using <a>.host) PASS
ab--c (using <a>.hostname) PASS
ab--c (using <area>) PASS
ab--c (using <area>.host) PASS
ab--c (using <area>.hostname) PASS
-x (using URL) PASS
-x (using URL.host) PASS
-x (using URL.hostname) PASS
-x (using <a>) PASS
-x (using <a>.host) PASS
-x (using <a>.hostname) PASS
-x (using <area>) PASS
-x (using <area>.host) PASS
-x (using <area>.hostname) PASS
-� (using URL) PASS
-� (using URL.host) PASS
-� (using URL.hostname) PASS
-� (using <a>) PASS
-� (using <a>.host) PASS
-� (using <a>.hostname) PASS
-� (using <area>) PASS
-� (using <area>.host) PASS
-� (using <area>.hostname) PASS
-x.xn--nxa (using URL) FAIL assert_equals: expected "-x.xn--nxa" but got "-x.β"
-x.xn--nxa (using URL.host) FAIL assert_equals: expected "-x.xn--nxa" but got "-x.β"
-x.xn--nxa (using URL.hostname) FAIL assert_equals: expected "-x.xn--nxa" but got "-x.β"
-x.xn--nxa (using <a>) FAIL assert_equals: expected "-x.xn--nxa" but got "-x.β"
-x.xn--nxa (using <a>.host) FAIL assert_equals: expected "-x.xn--nxa" but got "-x.β"
-x.xn--nxa (using <a>.hostname) FAIL assert_equals: expected "-x.xn--nxa" but got "-x.β"
-x.xn--nxa (using <area>) FAIL assert_equals: expected "-x.xn--nxa" but got "-x.β"
-x.xn--nxa (using <area>.host) FAIL assert_equals: expected "-x.xn--nxa" but got "-x.β"
-x.xn--nxa (using <area>.hostname) FAIL assert_equals: expected "-x.xn--nxa" but got "-x.β"
-x.β (using URL) FAIL assert_equals: expected "-x.xn--nxa" but got "-x.β"
-x.β (using URL.host) FAIL assert_equals: expected "-x.xn--nxa" but got "-x.β"
-x.β (using URL.hostname) FAIL assert_equals: expected "-x.xn--nxa" but got "-x.β"
-x.β (using <a>) FAIL assert_equals: expected "-x.xn--nxa" but got "-x.β"
-x.β (using <a>.host) FAIL assert_equals: expected "-x.xn--nxa" but got "-x.β"
-x.β (using <a>.hostname) FAIL assert_equals: expected "-x.xn--nxa" but got "-x.β"
-x.β (using <area>) FAIL assert_equals: expected "-x.xn--nxa" but got "-x.β"
-x.β (using <area>.host) FAIL assert_equals: expected "-x.xn--nxa" but got "-x.β"
-x.β (using <area>.hostname) FAIL assert_equals: expected "-x.xn--nxa" but got "-x.β"
x-.xn--nxa (using URL) FAIL assert_equals: expected "x-.xn--nxa" but got "x-.β"
x-.xn--nxa (using URL.host) FAIL assert_equals: expected "x-.xn--nxa" but got "x-.β"
x-.xn--nxa (using URL.hostname) FAIL assert_equals: expected "x-.xn--nxa" but got "x-.β"
x-.xn--nxa (using <a>) FAIL assert_equals: expected "x-.xn--nxa" but got "x-.β"
x-.xn--nxa (using <a>.host) FAIL assert_equals: expected "x-.xn--nxa" but got "x-.β"
x-.xn--nxa (using <a>.hostname) FAIL assert_equals: expected "x-.xn--nxa" but got "x-.β"
x-.xn--nxa (using <area>) FAIL assert_equals: expected "x-.xn--nxa" but got "x-.β"
x-.xn--nxa (using <area>.host) FAIL assert_equals: expected "x-.xn--nxa" but got "x-.β"
x-.xn--nxa (using <area>.hostname)

@ghost
Copy link

ghost commented May 18, 2017

*This report has been truncated because the total content is 177786 characters in length, which is in excess of GitHub.com's limit for comments (65536 characters).

View the complete job log.

Sauce (safari)

Testing web-platform-tests at revision b5d96af
Using browser at version 10.0
Starting 10 test iterations
All results were stable

All results

1 test ran
/url/toascii.window.html
Subtest Results Messages
OK
Loading data� PASS
aa-- (using URL) PASS
aa-- (using URL.host) PASS
aa-- (using URL.hostname) PASS
aa-- (using <a>) PASS
aa-- (using <a>.host) PASS
aa-- (using <a>.hostname) PASS
aa-- (using <area>) PASS
aa-- (using <area>.host) PASS
aa-- (using <area>.hostname) PASS
a�-- (using URL) PASS
a�-- (using URL.host) PASS
a�-- (using URL.hostname) PASS
a�-- (using <a>) PASS
a�-- (using <a>.host) PASS
a�-- (using <a>.hostname) PASS
a�-- (using <area>) PASS
a�-- (using <area>.host) PASS
a�-- (using <area>.hostname) PASS
ab--c (using URL) PASS
ab--c (using URL.host) PASS
ab--c (using URL.hostname) PASS
ab--c (using <a>) PASS
ab--c (using <a>.host) PASS
ab--c (using <a>.hostname) PASS
ab--c (using <area>) PASS
ab--c (using <area>.host) PASS
ab--c (using <area>.hostname) PASS
-x (using URL) PASS
-x (using URL.host) PASS
-x (using URL.hostname) PASS
-x (using <a>) PASS
-x (using <a>.host) PASS
-x (using <a>.hostname) PASS
-x (using <area>) PASS
-x (using <area>.host) PASS
-x (using <area>.hostname) PASS
-� (using URL) PASS
-� (using URL.host) PASS
-� (using URL.hostname) PASS
-� (using <a>) PASS
-� (using <a>.host) PASS
-� (using <a>.hostname) PASS
-� (using <area>) PASS
-� (using <area>.host) PASS
-� (using <area>.hostname) PASS
-x.xn--nxa (using URL) PASS
-x.xn--nxa (using URL.host) PASS
-x.xn--nxa (using URL.hostname) PASS
-x.xn--nxa (using <a>) PASS
-x.xn--nxa (using <a>.host) PASS
-x.xn--nxa (using <a>.hostname) PASS
-x.xn--nxa (using <area>) PASS
-x.xn--nxa (using <area>.host) PASS
-x.xn--nxa (using <area>.hostname) PASS
-x.β (using URL) PASS
-x.β (using URL.host) PASS
-x.β (using URL.hostname) PASS
-x.β (using <a>) PASS
-x.β (using <a>.host) PASS
-x.β (using <a>.hostname) PASS
-x.β (using <area>) PASS
-x.β (using <area>.host) PASS
-x.β (using <area>.hostname) PASS
x-.xn--nxa (using URL) PASS
x-.xn--nxa (using URL.host) PASS
x-.xn--nxa (using URL.hostname) PASS
x-.xn--nxa (using <a>) PASS
x-.xn--nxa (using <a>.host) PASS
x-.xn--nxa (using <a>.hostname) PASS
x-.xn--nxa (using <area>) PASS
x-.xn--nxa (using <area>.host) PASS
x-.xn--nxa (using <area>.hostname) PASS
x-.β (using URL) PASS
x-.β (using URL.host) PASS
x-.β (using URL.hostname) PASS
x-.β (using <a>) PASS
x-.β (using <a>.host) PASS
x-.β (using <a>.hostname) PASS
x-.β (using <area>) PASS
x-.β (using <area>.host) PASS
x-.β (using <area>.hostname) PASS
x..xn--nxa (using URL) PASS
x..xn--nxa (using URL.host) PASS
x..xn--nxa (using URL.hostname) PASS
x..xn--nxa (using <a>) PASS
x..xn--nxa (using <a>.host) PASS
x..xn--nxa (using <a>.hostname) PASS
x..xn--nxa (using <area>) PASS
x..xn--nxa (using <area>.host) PASS
x..xn--nxa (using <area>.hostname) PASS
x..β (using URL) FAIL Type error
x..β (using URL.host) FAIL assert_equals: expected "x..xn--nxa" but got "x"
x..β (using URL.hostname) FAIL assert_equals: expected "x..xn--nxa" but got "x"
x..β (using <a>) FAIL Type error
x..β (using <a>.host) FAIL assert_equals: expected "x..xn--nxa" but got "x"
x..β (using <a>.hostname) FAIL assert_equals: expected "x..xn--nxa" but got "x"
x..β (using <area>) FAIL Type error
x..β (using <area>.host) FAIL assert_equals: expected "x..xn--nxa" but got "x"
x..β (using <area>.hostname) FAIL assert_equals: expected "x..xn--nxa" but got "x"
xn--a (using URL) FAIL assert_throws: function "() => makeURL("url", hostTest.input)" did not throw
xn--a (using URL.host) FAIL assert_equals: expected "x" but got "xn--a"
xn--a (using URL.hostname) FAIL assert_equals: expected "x" but got "xn--a"
xn--a (using <a>) FAIL assert_equals: expected "" but got "xn--a"

|

@ghost
Copy link

ghost commented May 18, 2017

*This report has been truncated because the total content is 182604 characters in length, which is in excess of GitHub.com's limit for comments (65536 characters).

View the complete job log.

Chrome (unstable)

Testing web-platform-tests at revision b5d96af
Using browser at version 60.0.3112.10 dev
Starting 10 test iterations
All results were stable

All results

1 test ran
/url/toascii.window.html
Subtest Results Messages
OK
Loading data… PASS
aa-- (using URL) PASS
aa-- (using URL.host) PASS
aa-- (using URL.hostname) PASS
aa-- (using <a>) PASS
aa-- (using <a>.host) PASS
aa-- (using <a>.hostname) PASS
aa-- (using <area>) PASS
aa-- (using <area>.host) PASS
aa-- (using <area>.hostname) PASS
a†-- (using URL) FAIL Failed to construct 'URL': Invalid URL
a†-- (using URL.host) FAIL assert_equals: expected "xn--a---kp0a" but got ""
a†-- (using URL.hostname) FAIL assert_equals: expected "xn--a---kp0a" but got ""
a†-- (using <a>) FAIL Failed to construct 'URL': Invalid URL
a†-- (using <a>.host) FAIL assert_equals: expected "xn--a---kp0a" but got ""
a†-- (using <a>.hostname) FAIL assert_equals: expected "xn--a---kp0a" but got ""
a†-- (using <area>) FAIL Failed to construct 'URL': Invalid URL
a†-- (using <area>.host) FAIL assert_equals: expected "xn--a---kp0a" but got ""
a†-- (using <area>.hostname) FAIL assert_equals: expected "xn--a---kp0a" but got ""
ab--c (using URL) PASS
ab--c (using URL.host) PASS
ab--c (using URL.hostname) PASS
ab--c (using <a>) PASS
ab--c (using <a>.host) PASS
ab--c (using <a>.hostname) PASS
ab--c (using <area>) PASS
ab--c (using <area>.host) PASS
ab--c (using <area>.hostname) PASS
-x (using URL) PASS
-x (using URL.host) PASS
-x (using URL.hostname) PASS
-x (using <a>) PASS
-x (using <a>.host) PASS
-x (using <a>.hostname) PASS
-x (using <area>) PASS
-x (using <area>.host) PASS
-x (using <area>.hostname) PASS
-† (using URL) FAIL Failed to construct 'URL': Invalid URL
-† (using URL.host) FAIL assert_equals: expected "xn----xhn" but got ""
-† (using URL.hostname) FAIL assert_equals: expected "xn----xhn" but got ""
-† (using <a>) FAIL Failed to construct 'URL': Invalid URL
-† (using <a>.host) FAIL assert_equals: expected "xn----xhn" but got ""
-† (using <a>.hostname) FAIL assert_equals: expected "xn----xhn" but got ""
-† (using <area>) FAIL Failed to construct 'URL': Invalid URL
-† (using <area>.host) FAIL assert_equals: expected "xn----xhn" but got ""
-† (using <area>.hostname) FAIL assert_equals: expected "xn----xhn" but got ""
-x.xn--nxa (using URL) PASS
-x.xn--nxa (using URL.host) PASS
-x.xn--nxa (using URL.hostname) PASS
-x.xn--nxa (using <a>) PASS
-x.xn--nxa (using <a>.host) PASS
-x.xn--nxa (using <a>.hostname) PASS
-x.xn--nxa (using <area>) PASS
-x.xn--nxa (using <area>.host) PASS
-x.xn--nxa (using <area>.hostname) PASS
-x.β (using URL) FAIL Failed to construct 'URL': Invalid URL
-x.β (using URL.host) FAIL assert_equals: expected "-x.xn--nxa" but got ""
-x.β (using URL.hostname) FAIL assert_equals: expected "-x.xn--nxa" but got ""
-x.β (using <a>) FAIL Failed to construct 'URL': Invalid URL
-x.β (using <a>.host) FAIL assert_equals: expected "-x.xn--nxa" but got ""
-x.β (using <a>.hostname) FAIL assert_equals: expected "-x.xn--nxa" but got ""
-x.β (using <area>) FAIL Failed to construct 'URL': Invalid URL
-x.β (using <area>.host) FAIL assert_equals: expected "-x.xn--nxa" but got ""
-x.β (using <area>.hostname) FAIL assert_equals: expected "-x.xn--nxa" but got ""
x-.xn--nxa (using URL) PASS
x-.xn--nxa (using URL.host) PASS
x-.xn--nxa (using URL.hostname) PASS
x-.xn--nxa (using <a>) PASS
x-.xn--nxa (using <a>.host) PASS
x-.xn--nxa (using <a>.hostname) PASS
x-.xn--nxa (using <area>) PASS
x-.xn--nxa (using <area>.host) PASS
x-.xn--nxa (using <area>.hostname) PASS
x-.β (using URL) FAIL Failed to construct 'URL': Invalid URL
x-.β (using URL.host) FAIL assert_equals: expected "x-.xn--nxa" but got ""
x-.β (using URL.hostname) FAIL assert_equals: expected "x-.xn--nxa" but got ""
x-.β (using <a>) FAIL Failed to construct 'URL': Invalid URL
x-.β (using <a>.host) FAIL assert_equals: expected "x-.xn--nxa" but got ""
x-.β (using <a>.hostname) FAIL assert_equals: expected "x-.xn--nxa" but got ""
x-.β (using <area>) FAIL Failed to construct 'URL': Invalid URL
x-.β (using <area>.host) FAIL assert_equals: expected "x-.xn--nxa" but got ""
x-.β (using <area>.hostname) FAIL assert_equals: expected "x-.xn--nxa" but got ""
x..xn--nxa (using URL) PASS
x..xn--nxa (using URL.host) PASS
x..xn--nxa (using URL.hostname) PASS
x..xn--nxa (using <a>) PASS
x..xn--nxa (using <a>.host) PASS
x..xn--nxa (using <a>.hostname) PASS
x..xn--nxa (using <area>) PASS
x..xn--nxa (using <area>.host) PASS
x..xn--nxa (using <area>.hostname) PASS
x..β (using URL) FAIL Failed to construct 'URL': Invalid URL
x..β (using URL.host) FAIL assert_equals: expected "x..xn--nxa" but got ""
x..β (using URL.hostname) FAIL assert_equals: expected "x..xn--nxa" but got ""
x..β (using <a>) FAIL Failed to construct 'URL': Invalid URL
x..β (using <a>.host) FAIL assert_equals: expected "x..xn--nxa" but got ""
x..β (using <a>.hostname) FAIL assert_equals: expected "x..xn--nxa" but got ""
x..β (using <area>) FAIL Failed to construct 'URL': Invalid URL
x..β (using <area>.host) FAIL assert_equals: expected "x..xn--nxa" but got ""
x..β (using <area>.hostname) FAIL assert_equals: expected "x..xn--nxa" but got ""
xn--a (using URL) FAIL assert_throws: function "() => makeURL("url", hostTest.input)" did not throw
xn--a (using URL.host) FAIL assert_equals: expected "x" but got "xn--a"
xn--a (using URL.hostname) FAIL assert_equals: expected "x" but got "xn--a"
xn--a (using <a>) FAIL assert_equals: expected "" but got "xn--a"
xn--a (using <a>.host)

@ghost
Copy link

ghost commented May 18, 2017

*This report has been truncated because the total content is 259355 characters in length, which is in excess of GitHub.com's limit for comments (65536 characters).

View the complete job log.

Sauce (MicrosoftEdge)

Testing web-platform-tests at revision b5d96af
Using browser at version 14.14393
Starting 10 test iterations
All results were stable

All results

1 test ran
/url/toascii.window.html
Subtest Results Messages
OK
Loading data… PASS
aa-- (using URL) PASS
aa-- (using URL.host) PASS
aa-- (using URL.hostname) PASS
aa-- (using <a>) PASS
aa-- (using <a>.host) PASS
aa-- (using <a>.hostname) PASS
aa-- (using <area>) PASS
aa-- (using <area>.host) PASS
aa-- (using <area>.hostname) PASS
a†-- (using URL) FAIL assert_equals: expected "xn--a---kp0a" but got "a†--"
a†-- (using URL.host) FAIL assert_equals: expected "xn--a---kp0a" but got "a†--"
a†-- (using URL.hostname) FAIL assert_equals: expected "xn--a---kp0a" but got "a†--"
a†-- (using <a>) FAIL assert_equals: expected "xn--a---kp0a" but got "a†--"
a†-- (using <a>.host) FAIL assert_equals: expected "xn--a---kp0a" but got "a†--"
a†-- (using <a>.hostname) FAIL assert_equals: expected "xn--a---kp0a" but got "a†--"
a†-- (using <area>) FAIL assert_equals: expected "xn--a---kp0a" but got "a†--"
a†-- (using <area>.host) FAIL assert_equals: expected "xn--a---kp0a" but got "a†--"
a†-- (using <area>.hostname) FAIL assert_equals: expected "xn--a---kp0a" but got "a†--"
ab--c (using URL) PASS
ab--c (using URL.host) PASS
ab--c (using URL.hostname) PASS
ab--c (using <a>) PASS
ab--c (using <a>.host) PASS
ab--c (using <a>.hostname) PASS
ab--c (using <area>) PASS
ab--c (using <area>.host) PASS
ab--c (using <area>.hostname) PASS
-x (using URL) PASS
-x (using URL.host) PASS
-x (using URL.hostname) PASS
-x (using <a>) PASS
-x (using <a>.host) PASS
-x (using <a>.hostname) PASS
-x (using <area>) PASS
-x (using <area>.host) PASS
-x (using <area>.hostname) PASS
-† (using URL) FAIL assert_equals: expected "xn----xhn" but got "-†"
-† (using URL.host) FAIL assert_equals: expected "xn----xhn" but got "-†"
-† (using URL.hostname) FAIL assert_equals: expected "xn----xhn" but got "-†"
-† (using <a>) FAIL assert_equals: expected "xn----xhn" but got "-†"
-† (using <a>.host) FAIL assert_equals: expected "xn----xhn" but got "-†"
-† (using <a>.hostname) FAIL assert_equals: expected "xn----xhn" but got "-†"
-† (using <area>) FAIL assert_equals: expected "xn----xhn" but got "-†"
-† (using <area>.host) FAIL assert_equals: expected "xn----xhn" but got "-†"
-† (using <area>.hostname) FAIL assert_equals: expected "xn----xhn" but got "-†"
-x.xn--nxa (using URL) FAIL Unspecified error.
-x.xn--nxa (using URL.host) PASS
-x.xn--nxa (using URL.hostname) PASS
-x.xn--nxa (using <a>) FAIL Unspecified error.
-x.xn--nxa (using <a>.host) FAIL Unspecified error.
-x.xn--nxa (using <a>.hostname) FAIL Unspecified error.
-x.xn--nxa (using <area>) FAIL Unspecified error.
-x.xn--nxa (using <area>.host) FAIL Unspecified error.
-x.xn--nxa (using <area>.hostname) FAIL Unspecified error.
-x.β (using URL) FAIL Unspecified error.
-x.β (using URL.host) FAIL assert_equals: expected "-x.xn--nxa" but got "-x.β"
-x.β (using URL.hostname) FAIL assert_equals: expected "-x.xn--nxa" but got "-x.β"
-x.β (using <a>) FAIL Unspecified error.
-x.β (using <a>.host) FAIL Unspecified error.
-x.β (using <a>.hostname) FAIL Unspecified error.
-x.β (using <area>) FAIL Unspecified error.
-x.β (using <area>.host) FAIL Unspecified error.
-x.β (using <area>.hostname) FAIL Unspecified error.
x-.xn--nxa (using URL) FAIL Unspecified error.
x-.xn--nxa (using URL.host) PASS
x-.xn--nxa (using URL.hostname) PASS
x-.xn--nxa (using <a>) FAIL Unspecified error.
x-.xn--nxa (using <a>.host) FAIL Unspecified error.
x-.xn--nxa (using <a>.hostname) FAIL Unspecified error.
x-.xn--nxa (using <area>) FAIL Unspecified error.
x-.xn--nxa (using <area>.host) FAIL Unspecified error.
x-.xn--nxa (using <area>.hostname) FAIL Unspecified error.

@rmisev
Copy link
Member

rmisev commented May 18, 2017

I see some uncovered cases. The following tests can be added:

  1. Leading/trailing hyphens:
    -x.xn--nxa
    -x.β
    x-.xn--nxa
    x-.β

  2. Empty labels:
    x..xn--nxa
    x..β

  3. Labels longer than 63 code points:
    x01234567890123456789012345678901234567890123456789012345678901x.xn--nxa
    x01234567890123456789012345678901234567890123456789012345678901x.β

I checked only tests (no test code) and they LGTM.

@annevk
Copy link
Member Author

annevk commented May 19, 2017

Maybe we should also test domain longer than 255 with labels shorter than 63.

@rmisev
Copy link
Member

rmisev commented May 19, 2017

Yes, makes sense.

Tests for whatwg/url#53 and friends.
@annevk
Copy link
Member Author

annevk commented May 24, 2017

@rmisev could you review once more? It seems Chrome would rather have this merged and then evaluate.

annevk added a commit to whatwg/url that referenced this pull request May 24, 2017
Tests: web-platform-tests/wpt#5976.

Fixes #53 and fixes #267 by no longer breaking on on hyphens in the
3rd and 4th position of a domain label. This is known to break
YouTube: r3---sn-2gb7ln7k.googlevideo.com. This is done by setting
the proposed CheckHyphens flag to false.

Fixes #110 by clarifying that BIDI and CONTEXTJ checks are to be done
by setting the proposed CheckBidi and CheckJoiners flags to true.

Follow-up #313 is filed to remove the proposed bits once Unicode is
updated.
@rmisev
Copy link
Member

rmisev commented May 24, 2017

I think the tests are OK, but I suggest adding two more tests to highlight the fast path problem:

  1. "\u200D.example" in Punycode (CheckJoiners test)
  {
    "input": "xn--1ug.example",
    "output": null
  },
  1. "يa" in Punycode (CheckBidi test)
  {
    "input": "xn--a-yoc",
    "output": null
  },

@annevk
Copy link
Member Author

annevk commented May 25, 2017

Good call! (And thanks for figuring out the Punycode.)

if (typeof hostTest === "string") {
continue // skip comments
}
if(hostTest.output === undefined) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer that this kind of normalization be done ahead of time, so that there is less logic in the tests. I will push a commit to fix.

@TimothyGu
Copy link
Member

We have another one in Node.js:

  {
    "comment": "Forbidden character",
    "input": "\uFFFD.com",
    "output": null
  },

@rmisev
Copy link
Member

rmisev commented Jun 1, 2017

... and the same encoded:

  {
    "comment": "U+FFFD character encoded in Punycode",
    "input": "xn--zn7c.com",
    "output": null
  },

domenic pushed a commit to whatwg/url that referenced this pull request Jun 1, 2017
Tests: web-platform-tests/wpt#5976.

Fixes #53 and fixes #267 by no longer breaking on hyphens in the 3rd and
4th position of a domain label. This is known to break YouTube:
r3---sn-2gb7ln7k.googlevideo.com. This is fixed by setting the proposed
CheckHyphens flag to false.

Fixes #110 by clarifying that BIDI and CONTEXTJ checks are to be done
by setting the proposed CheckBidi and CheckJoiners flags to true.

Follow-up #313 is filed to remove the proposed bits once Unicode is
updated. #317 also tracks a potential cleanup.
@domenic domenic merged commit ded8ffe into master Jun 1, 2017
@domenic domenic deleted the annevk/url-toascii branch June 1, 2017 21:54
TimothyGu added a commit to TimothyGu/node that referenced this pull request Jun 7, 2017
Remove custom tests for invalid IDNA domains in url-idna.js in favor of
the more comprehensive official set.

Refs: whatwg/url#309
Refs: web-platform-tests/wpt#5976
TimothyGu added a commit to TimothyGu/node that referenced this pull request Jun 7, 2017
Remove custom tests for invalid IDNA domains in url-idna.js in favor of
the more comprehensive official set.

PR-URL: nodejs#13362
Refs: whatwg/url#309
Refs: web-platform-tests/wpt#5976
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Daijiro Wachi <[email protected]>
jasnell pushed a commit to nodejs/node that referenced this pull request Jun 7, 2017
Remove custom tests for invalid IDNA domains in url-idna.js in favor of
the more comprehensive official set.

PR-URL: #13362
Refs: whatwg/url#309
Refs: web-platform-tests/wpt#5976
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Daijiro Wachi <[email protected]>
TimothyGu added a commit to TimothyGu/node that referenced this pull request Nov 28, 2017
Remove custom tests for invalid IDNA domains in url-idna.js in favor of
the more comprehensive official set.

PR-URL: nodejs#13362
Refs: whatwg/url#309
Refs: web-platform-tests/wpt#5976
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Daijiro Wachi <[email protected]>
MylesBorins pushed a commit to nodejs/node that referenced this pull request Jan 18, 2018
Remove custom tests for invalid IDNA domains in url-idna.js in favor of
the more comprehensive official set.

Backport-PR-URL: #17365
PR-URL: #13362
Refs: whatwg/url#309
Refs: web-platform-tests/wpt#5976
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Daijiro Wachi <[email protected]>
MylesBorins pushed a commit to nodejs/node that referenced this pull request Feb 11, 2018
Remove custom tests for invalid IDNA domains in url-idna.js in favor of
the more comprehensive official set.

Backport-PR-URL: #17365
PR-URL: #13362
Refs: whatwg/url#309
Refs: web-platform-tests/wpt#5976
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Daijiro Wachi <[email protected]>
MylesBorins pushed a commit to nodejs/node that referenced this pull request Feb 12, 2018
Remove custom tests for invalid IDNA domains in url-idna.js in favor of
the more comprehensive official set.

Backport-PR-URL: #17365
PR-URL: #13362
Refs: whatwg/url#309
Refs: web-platform-tests/wpt#5976
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Daijiro Wachi <[email protected]>
MylesBorins pushed a commit to nodejs/node that referenced this pull request Feb 13, 2018
Remove custom tests for invalid IDNA domains in url-idna.js in favor of
the more comprehensive official set.

Backport-PR-URL: #17365
PR-URL: #13362
Refs: whatwg/url#309
Refs: web-platform-tests/wpt#5976
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Daijiro Wachi <[email protected]>
rmisev added a commit to upa-url/upa that referenced this pull request May 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants