Repository navigation
Add opt-in WHATWG URL and URLSearchParams - #3094
Merged
Merged
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Aug 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of the opt-in web API series (#3079): a full WHATWG URL Standard implementation —
URLandURLSearchParamsbehindWebApiFeatures.Url(inDefault). Not aSystem.Uriwrapper: the spec's basic URL parser state machine, host parsers and serializers, implemented from https://url.spec.whatwg.org/ and validated against web-platform-tests.Conformance: the vendored WPT corpus passes with zero exclusions — all 891 parse rows of
urltestdata.jsonand all 278 setter rows ofsetters_tests.json(snapshot at wpt6745634413e4153144e23bc3e866d6b14d3e55e6, BSD-3 license included, SHA recorded beside the resources). The corpus drivers run against the parser directly (no engine per row), assert minimum row counts so an unembedded resource cannot green-wash, fail on stale exclusions, and were validated by mutation: a one-character serializer mutation fails 623 rows.Layout:
Jint/WebApi/Url/Parsing/is a pure, engine-free parser library (noEngine/Realm/JsValue) — fetch will consume it for request-URL resolution and per-redirect-hop policy checks — with the JS binding inJint/WebApi/Url/. Percent-encoding is one 128-entry flags table over the spec's nested encode sets withRune-based UTF-8 (USVString semantics fall out); IPv4/IPv6 are the spec algorithms including the hex/octal/overflow rules and longest-zero-run serialization.IDNA uses
IdnMappingwith an important precision: the URL Standard's own domain-to-ASCII step 4 returns an ASCII domain lowercased without consulting Unicode ToASCII at all (a web-compat rule, not an optimisation — pinned with the spec's ownxn--8i7caaexample), soIdnMappingis reached only for genuinely internationalized domains. Its known divergences from UTS-46-as-the-spec-wants (VerifyDnsLength not disableable, CheckHyphens, empty labels, ICU version skew, invariant-globalization mode) are documented on the class with a one-time fidelity probe (faß.de) — and on this machine's ICU, none of them cost a single WPT row. This is the same posture the engine takes toward CLDR in ECMA-402.JS surface: constructor with base,
URL.parse(null on failure),URL.canParse, all component accessors with the spec's stateOverride setter algorithms (including the fact — WPT-pinned — that a failing setter still commits the components parsed before the failure),originwith theblob:re-parse rule, live-syncedsearchParams(update steps in both directions),delete(name, value)/has(name, value), stable code-unitsort,size, full iteration with@@iterator === entries.URLPatternandcreateObjectURLare absent, not throwing, so feature detection works. Subclassing works viaOrdinaryCreateFromConstructor.One hazard found in self-review and fixed with a regression test:
using varon a mutable struct parser ranDisposeon a defensive copy, double-returning a pooled buffer; replaced with explicit try/finally and a test that forces the buffer-growth path.Verified: all-TFM build, both suites × both frameworks × both host-contract-verification configurations; the WPT corpus green as above.
🤖 Generated with Claude Code