01:44
<sideshowbarker>

wanderview: so while reviewing https://github.com/mdn/content/pull/13137 and testing URLPattern.test(), I notice this:

const pattern = new URLPattern({ hostname: '{*.}?example.com' });
console.log(pattern.test('custom-protocol://example.com/other/path?q=1'));
// false

…which makes sense because per the URL spec, non-special schemes have no hostname (right?)

(new URL('custom-protocol://example.com/other/path?q=1')).hostname
// ''

But then in testing the URLPattern() constructor, I notice this:

(new URLPattern('custom-protocol://example.com/other/path?q=1')).hostname
// 'example.com'

…which seems like either a bug in Chrome or a spec bug?

09:02
<annevk>
sideshowbarker: custom schemes can have a host
09:02
<annevk>
sideshowbarker: Chrome doesn't have a compliant URL parser so URLPattern is also somewhat broken in it
10:04
<sideshowbarker>
sideshowbarker: custom schemes can have a host
OK — what’s a case where one can?
10:04
<sideshowbarker>
the custom-protocol://example.com/other/path?q=11 case seems not to be
10:06
<sideshowbarker>
hmm, though in Safari at least, (new URL('custom-protocol://example.com/other/path?q=1')).hostname gives "example.com"
10:06
<sideshowbarker>
…but not in Firefox or Chrome
10:09
<sideshowbarker>
…and I see that jsdom whatwg-url also returns "example.com" for hostname https://jsdom.github.io/whatwg-url/#url=Y3VzdG9tLXByb3RvY29sOi8vZXhhbXBsZS5jb20vb3RoZXIvcGF0aD9xPTE=&base=YWJvdXQ6Ymxhbms=
10:10
<sideshowbarker>
so I guess that means both Chrome and Firefox aren’t conforming on this
14:18
<annevk>
Indeed