There is a web-platform test that is even implemented by Chrome that is not covered with the URLPattern spec.
new URLPattern({ "protocol": "http", "port": "80 " })
But other than canonicalizePort there is no place that actually validates the validity of the port, and canonicalizePort calls url parser setter which removes leading and trailing spaces which makes "80 " input valid.
What is the issue with the URL Pattern Standard?
There is a web-platform test that is even implemented by Chrome that is not covered with the URLPattern spec.
This fails on Chromium due to this function validation: https://chromium.googlesource.com/chromium/src/+/main/extensions/common/url_pattern.cc#101
But other than canonicalizePort there is no place that actually validates the validity of the port, and canonicalizePort calls url parser setter which removes leading and trailing spaces which makes
"80 "input valid.Relevant WPT: https://github.com/web-platform-tests/wpt/blob/0c1d19546fd4873bb9f4147f0bbf868e7b4f91b7/urlpattern/resources/urlpatterntestdata.json#L1146