[whatwg/url] Close more gaps between URL writing and parser sections (PR #924)

Three fixes align the writing grammar with the parser, addressing divergences reported in #704:

* Introduce path-absolute-non-authority-URL string. Where scheme-relative and path-absolute were both offered as top-level alternatives, inputs starting with `//` could fall back to path-absolute when the scheme-relative form failed. This made `foo://:80`, `foo://h@x`, `foo://h:8x`, and `//:80` (against `https://`, `foo://`, and `file://` bases) incorrectly valid.

* Remove path-absolute-non-Windows-file-URL string. The parser accepts `file://host/C:/demo` and `/C:/path` against `file://server/tmp/` without validation errors, so the grammar should too.

* Require U+0023 (#) in the opaque-path branch of relative-URL-with-fragment string. The empty string against `foo:opaque` was valid by the grammar but fails to parse.

Helps with #704.


<!--
    This comment and the below content is programmatically generated.
    You may add a comma-separated list of anchors you'd like a
    direct link to below (e.g. #idl-serializers, #idl-sequence):

    Don't remove this comment or modify anything below this line.
    If you don't want a preview generated for this pull request,
    just replace the whole of this comment's content by "no preview"
    and remove what's below.
-->
***
<a href="https://whatpr.org/url/924.html" title="Last updated on Jul 1, 2026, 12:39 PM UTC (c458273)">Preview</a> | <a href="https://whatpr.org/url/924/b2965a0...c458273.html" title="Last updated on Jul 1, 2026, 12:39 PM UTC (c458273)">Diff</a>
You can view, comment on, or merge this pull request online at:

  https://github.com/whatwg/url/pull/924

-- Commit Summary --

  * Close more gaps between URL writing and parser sections

-- File Changes --

    M url.bs (35)

-- Patch Links --

https://github.com/whatwg/url/pull/924.patch
https://github.com/whatwg/url/pull/924.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/url/pull/924
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/url/pull/924@github.com>

Received on Wednesday, 1 July 2026 12:40:13 UTC