From 4617e33b27d386bbf1db8c04316961d46aaa1397 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Tue, 3 Jan 2017 15:33:47 +0100 Subject: [PATCH] Return failure in state override scheme parsing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: https://github.com/w3c/web-platform-tests/pull/4412. This is the cleanup work mentioned in https://github.com/whatwg/html/commit/f0a73659b4046cc35a28855f3544dead66345689 that is happening way late. --- url.bs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/url.bs b/url.bs index a16f29a9..f8bb9843 100644 --- a/url.bs +++ b/url.bs @@ -1262,7 +1262,11 @@ string input, optionally with a base URL base, opti state to no scheme state, and decrease pointer by one. -
  • Otherwise, syntax violation, terminate this algorithm. +

  • +

    Otherwise, syntax violation, return failure. + +

    This indication of failure is used exclusively by {{Location}} object's + {{Location/protocol}} attribute.

    scheme state @@ -1329,7 +1333,12 @@ string input, optionally with a base URL base, opti no scheme state, and start over (from the first code point in input). -
  • Otherwise, syntax violation, terminate this algorithm. +

  • +

    Otherwise, syntax violation, return failure. + +

    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.

    no scheme state