Skip to content

Commit

Permalink
Return failure in state override scheme parsing
Browse files Browse the repository at this point in the history
This is necessary to define the behavior of the Location object’s
protocol attribute, which throws on syntax errors rather than silently
ignoring them as other protocol setters do.

Tests: web-platform-tests/wpt#4412.

This is the cleanup work mentioned in
whatwg/html@f0a7365
that is happening way late.
  • Loading branch information
annevk committed Jan 5, 2017
1 parent 240e61d commit 4617e33
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions url.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1262,7 +1262,11 @@ string <var>input</var>, optionally with a <a>base URL</a> <var>base</var>, opti
<var>state</var> to <a>no scheme state</a>, and decrease
<var>pointer</var> by one.

<li><p>Otherwise, <a>syntax violation</a>, terminate this algorithm.
<li>
<p>Otherwise, <a>syntax violation</a>, return failure.

<p class=note>This indication of failure is used exclusively by {{Location}} object's
{{Location/protocol}} attribute.
</ol>

<dt><dfn>scheme state</dfn>
Expand Down Expand Up @@ -1329,7 +1333,12 @@ string <var>input</var>, optionally with a <a>base URL</a> <var>base</var>, opti
<a>no scheme state</a>, and start over (from the first code point
in <var>input</var>).

<li><p>Otherwise, <a>syntax violation</a>, terminate this algorithm.
<li>
<p>Otherwise, <a>syntax violation</a>, return failure.

<p class=note>This indication of failure is used exclusively by {{Location}} object's
{{Location/protocol}} attribute. Furthermore, the non-failure termination earlier in this
state is an intentional difference for defining that attribute.
</ol>

<dt><dfn>no scheme state</dfn>
Expand Down

0 comments on commit 4617e33

Please sign in to comment.