Skip to content

Commit

Permalink
Report more parse errors. Fixes https://www.w3.org/Bugs/Public/show_b…
Browse files Browse the repository at this point in the history
…ug.cgi?id=27687

Also ack @sleevi for previous commit.
  • Loading branch information
annevk committed Aug 14, 2015
1 parent ca97ec8 commit 0bae5e5
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 19 deletions.
21 changes: 12 additions & 9 deletions url.bs
Expand Up @@ -252,7 +252,7 @@ eight <dfn id=concept-ipv6-piece lt='IPv6 piece'>16-bit pieces</dfn>.
<i>UseSTD3ASCIIRules</i> set to false, <i>processing_option</i> set to
<i>Transitional_Processing</i>, and <i>VerifyDnsLength</i> set to false.

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

<li><p>Return <var>result</var>.
</ol>
Expand All @@ -266,10 +266,8 @@ eight <dfn id=concept-ipv6-piece lt='IPv6 piece'>16-bit pieces</dfn>.
<i>domain_name</i> set to <var>domain</var>,
<i>UseSTD3ASCIIRules</i> set to false.

<li>
<p>Return <var>result</var>, ignoring any returned errors.

<p class=note>User agents are encouraged to report errors through a developer console.
<li><p>Signify <a>parse errors</a> any returned errors, and then, return
<var>result</var>.
</ol>


Expand Down Expand Up @@ -367,7 +365,7 @@ steps:
"<code>\</code>",<!-- 5C -->
and
"<code>]</code>",<!-- 5D -->
return failure.
<a>parse error</a>, return failure.

<li><p>Let <var>ipv4Host</var> be the result of <a lt="IPv4 parser">IPv4 parsing</a>
<var>asciiDomain</var>.
Expand Down Expand Up @@ -450,11 +448,12 @@ runs these steps:
<li><p>Append <var>n</var> to <var>numbers</var>.
</ol>

<li><p>If any but the last item in <var>numbers</var> is greater than 255, return
failure.
<li><p>If any but the last item in <var>numbers</var> is greater than 255,
<a>parse error</a> return failure.

<li><p>If the last item in <var>numbers</var> is greater than or equal to
256<sup>(5 &minus; the number of items in <var>numbers</var>)</sup>, return failure.
256<sup>(5 &minus; the number of items in <var>numbers</var>)</sup>,
<a>parse error</a>, return failure.

<li><p>Let <var>ipv4</var> be the last item in <var>numbers</var>.

Expand Down Expand Up @@ -1023,6 +1022,9 @@ optionally with an <a>encoding</a>
<ol>
<li><p>Set <var>url</var> to a new <a>URL</a>.

<li><p>If <var>input</var> contains any leading or trailing
<a>C0 controls and space</a>, <a>parse error</a>.

<li><p>Remove any leading and trailing <a>C0 controls and space</a> from
<var>input</var>.
</ol>
Expand Down Expand Up @@ -3019,6 +3021,7 @@ Michel Suignard,
Peter Occil,
Rodney Rehm,
Roy Fielding,
Ryan Sleevi,
Santiago M. Mola,
Sebastian Mayr,
Simon Pieters,
Expand Down
24 changes: 14 additions & 10 deletions url.html
Expand Up @@ -439,7 +439,7 @@ <h3 class="heading settled" data-level="3.1" id="idna"><span class="secno">3.1.

</p>
<li>
<p>If <var>result</var> is a failure value, return failure.
<p>If <var>result</var> is a failure value, <a data-link-type="dfn" href="#parse-error">parse error</a>, return failure.

</p>
<li>
Expand All @@ -461,11 +461,8 @@ <h3 class="heading settled" data-level="3.1" id="idna"><span class="secno">3.1.

</p>
<li>

<p>Return <var>result</var>, ignoring any returned errors.

</p>
<p class="note" role="note">User agents are encouraged to report errors through a developer console.
<p>Signify <a data-link-type="dfn" href="#parse-error">parse errors</a> any returned errors, and then, return
<var>result</var>.
</p></ol>


Expand Down Expand Up @@ -598,7 +595,7 @@ <h3 class="heading settled" data-level="3.3" id="host-parsing"><span class="secn
"<code>\</code>",
and
"<code>]</code>",
return failure.
<a data-link-type="dfn" href="#parse-error">parse error</a>, return failure.

</p>
<li>
Expand Down Expand Up @@ -741,13 +738,14 @@ <h3 class="heading settled" data-level="3.3" id="host-parsing"><span class="secn


<li>
<p>If any but the last item in <var>numbers</var> is greater than 255, return
failure.
<p>If any but the last item in <var>numbers</var> is greater than 255,
<a data-link-type="dfn" href="#parse-error">parse error</a> return failure.

</p>
<li>
<p>If the last item in <var>numbers</var> is greater than or equal to
256<sup>(5 − the number of items in <var>numbers</var>)</sup>, return failure.
256<sup>(5 − the number of items in <var>numbers</var>)</sup>,
<a data-link-type="dfn" href="#parse-error">parse error</a>, return failure.

</p>
<li>
Expand Down Expand Up @@ -1591,6 +1589,11 @@ <h3 class="heading settled" data-level="4.2" id="url-parsing"><span class="secno
<li>
<p>Set <var>url</var> to a new <a data-link-type="dfn" href="#concept-url">URL</a>.

</p>
<li>
<p>If <var>input</var> contains any leading or trailing
<a data-link-type="dfn" href="#c0-controls-and-space">C0 controls and space</a>, <a data-link-type="dfn" href="#parse-error">parse error</a>.

</p>
<li>
<p>Remove any leading and trailing <a data-link-type="dfn" href="#c0-controls-and-space">C0 controls and space</a> from
Expand Down Expand Up @@ -4679,6 +4682,7 @@ <h2 class="no-num heading settled" id="acknowledgments"><span class="content">Ac
Peter Occil,
Rodney Rehm,
Roy Fielding,
Ryan Sleevi,
Santiago M. Mola,
Sebastian Mayr,
Simon Pieters,
Expand Down

0 comments on commit 0bae5e5

Please sign in to comment.