From 65dcfbc17248fa761904dff42e4bd1efcff3a30f Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Mon, 19 Dec 2016 13:21:52 -0500 Subject: [PATCH] Editorial: clarify the "shorten a path" algorithm Sometimes "single" is used to mean "any" which causes a different, incorrect interpretation of this algorithm (see https://github.com/jsdom/whatwg-url/pull/60). Clarify by using a more precise algorithm. --- url.bs | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/url.bs b/url.bs index 044f23f6..bbee9d77 100644 --- a/url.bs +++ b/url.bs @@ -904,11 +904,19 @@ input might be a relative-URL string.
-

To shorten a url's path, if -url's scheme is not "file" or url's -path does not contain a single string that is a -normalized Windows drive letter, remove url's path's last string, -if any. +

To shorten a url's path: + +

    +
  1. Let path be url's path. + +

  2. If path's size is 0, then return. + +

  3. If url's scheme is "file", path's + size is 1, and path[0] is a normalized Windows drive letter, then + return. + +

  4. Remove path's last item. +

URL syntax