← Back to release summary

Standard compliant URL host punctuation characters

Category
Miscellaneous
Type
Chromium catches up
Status
Enabled by default (Chrome 119)
Intent stage
None

WPT details: The following tests are introduced in WPT https://wpt.fyi/results/url/a-element-origin.html?label=master&label=experimental&aligned: Parsing origin: <http://!"$&'()*+,-.;=_`{}~/> against <about:blank> Parsing origin: <wss://!"$&'()*+,-.;=_`{}~/> against <about:blank>

Summary

Make Chrome's handling of URL host punctuation characters standard compliant. Examples: Before: > const url = new URL("http://exa(mple.com";); > url.href 'http://exa%28mple.com/&apos; '(' is a forbidden character, however, Chrome permits it wrongly. After: > const url = new URL("http://exa(mple.com";); > => throws TypeError: Invalid URL. Before: > const url = new URL("http://exa!mple.com";); > url.href "http://exa%2Ample.com"; '!' is permitted, but escaping punctuation characters is non-compliant. After: > const url = new URL("http://exa!mple.com";); > url.href "http://exa!mple.com"; Here is a the summary of changes in M119: Notation: - 'ESC': Allowed, but Chrome escapes it, which is non-compliant. - '-': Allowed. - '0': Forbidden. URL will be invalid if the host contains a forbidden character. Warning: SPACE and ASTERISK is still non-compliant. | | Before | After | Standard | |-----+--------+-------+----------| | SPC | ESC | ESC | 0 | | ! | ESC | - | - | | " | ESC | - | - | | # | ESC | 0 | 0 | | $ | ESC | - | - | | & | ESC | - | - | | ' | ESC | - | - | | ( | ESC | - | - | | ) | ESC | - | - | | * | ESC | ESC | - | | + | - | - | - | | , | ESC | - | - | | - | - |

Standards & signals

Ecosystem

Samples: https://chromium-review.googlesource.com/c/chromium/src/+/4875754

View on chromestatus.com