Skip to content

Commit

Permalink
IDNA: use proposed UTS46 flags to avoid breaking YouTube
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
annevk committed May 24, 2017
1 parent a622235 commit d31cef7
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions url.bs
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,15 @@ U+005C (\), or U+005D (]).
<a>domain</a> <var>domain</var>, runs these steps:

<ol>
<li><p>Let <var>result</var> be the result of running <a abstract-op lt=ToASCII>Unicode ToASCII</a> with
<i>domain_name</i> set to <var>domain</var>, <i>UseSTD3ASCIIRules</i> set to false,
<i>processing_option</i> set to <i>Nontransitional_Processing</i>, and <i>VerifyDnsLength</i> set
to false.
<li>
<p>Let <var>result</var> be the result of running <a abstract-op lt=ToASCII>Unicode ToASCII</a>
with <i>domain_name</i> set to <var>domain</var>, <i>UseSTD3ASCIIRules</i> set to false,
<i>CheckHyphens</i> set to false, <i>CheckBidi</i> set to true, <i>CheckJoiners</i> set to true,
<i>processing_option</i> set to <i>Nontransitional_Processing</i>, and <i>VerifyDnsLength</i> set
to false.

<p class="XXX">This and <a>domain to Unicode</a> below are based on a proposed revision. See
<a href="https://github.com/whatwg/url/issues/313">issue #313</a>.

<li><p>If <var>result</var> is a failure value, <a>validation error</a>, return failure.

Expand All @@ -297,9 +302,9 @@ U+005C (\), or U+005D (]).

<ol>
<li><p>Let <var>result</var> be the result of running
<a abstract-op lt=ToUnicode>Unicode ToUnicode</a> with
<i>domain_name</i> set to <var>domain</var>,
<i>UseSTD3ASCIIRules</i> set to false.
<a abstract-op lt=ToUnicode>Unicode ToUnicode</a> with <i>domain_name</i> set to <var>domain</var>,
<i>CheckHyphens</i> set to false, <i>CheckBidi</i> set to true, <i>CheckJoiners</i> set to true,
and <i>UseSTD3ASCIIRules</i> set to false.

<li><p>Signify <a>validation errors</a> for any returned errors, and then, return
<var>result</var>.
Expand Down Expand Up @@ -3151,7 +3156,7 @@ spec: MEDIA-SOURCE; urlPrefix: https://w3c.github.io/media-source/#idl-def-
type: interface; text: MediaSource
spec: MEDIACAPTURE-STREAMS; urlPrefix: https://w3c.github.io/mediacapture-main/#idl-def-
type: interface; text: MediaStream
spec: UTS46; urlPrefix: http://www.unicode.org/reports/tr46/
spec: UTS46; urlPrefix: http://www.unicode.org/reports/tr46/proposed.html
type: abstract-op; text: ToASCII; url: #ToASCII
type: abstract-op; text: ToUnicode; url: #ToUnicode
</pre>
Expand Down

0 comments on commit d31cef7

Please sign in to comment.