[whatwg/url] Report all hostname state failures for URLPattern (PR #863)

URLPattern's canonicalize a hostname is the only invocation of the basic URL parser with a URL and state override set to hostname state that looks at the return failure.

And since the URL that URLPattern uses is a dummy URL that is ideally not exposed, knowing about all the failure conditions is kind of important.

(Now technically the second return failure added here cannot be observed as the dummy URL won't have credentials or a non-null port, but it seemed good to change that at the same time for consistency.)

This is covered by existing URLPattern web-platform-tests. Some more background can be found in https://github.com/whatwg/urlpattern/issues/252.

<!--
Thank you for contributing to the URL Standard! Please describe the change you are making and complete the checklist below if your change is not editorial.

When you submit this PR, and each time you edit this comment (including checking a checkbox through the UI!), PR Preview will run and update it. As such make any edits in one go and only after PR Preview has run.

If you think your PR is ready to land, please double-check that the build is passing and the checklist is complete before pinging.
-->

- [ ] At least two implementers are interested (and none opposed):
   * WebKit
   * 
- [x] [Tests](https://github.com/web-platform-tests/wpt) are written and can be reviewed and commented upon at:
   * URLPattern tests.
- [ ] [Implementation bugs](https://github.com/whatwg/meta/blob/main/MAINTAINERS.md#handling-pull-requests) are filed:
   * Chromium: …
   * Gecko: …
   * WebKit: https://bugs.webkit.org/show_bug.cgi?id=289401
   * Deno: …
   * Node.js: …
- [x] [MDN issue](https://github.com/whatwg/meta/blob/main/MAINTAINERS.md#handling-pull-requests) is filed: N/A
- [x] The top of this comment includes a [clear commit message](https://github.com/whatwg/meta/blob/main/COMMITTING.md) to use. <!-- If you created this PR from a single commit, Github copied its message. Otherwise, you need to add a commit message yourself. -->

(See [WHATWG Working Mode: Changes](https://whatwg.org/working-mode#changes) for more details.)


<!--
    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/863.html" title="Last updated on Mar 13, 2025, 11:07 AM UTC (ffaef5a)">Preview</a> | <a href="https://whatpr.org/url/863/076afff...ffaef5a.html" title="Last updated on Mar 13, 2025, 11:07 AM UTC (ffaef5a)">Diff</a>
You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * Report all hostname state failures for URLPattern

-- File Changes --

    M url.bs (8)

-- Patch Links --

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

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

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

Received on Thursday, 13 March 2025 11:13:53 UTC