You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: implement Windows file path handling per WHATWG URL spec
Implements Windows drive letter detection in scheme state as specified
in whatwg/url#874. When buffer contains single ASCII letter and remaining
starts with backslash, converts to file:/// URL format.
Changes:
- Detects C:\ pattern in scheme state (lib/url-state-machine.js:578-586)
- Preserves drive letter in buffer with original case
- Mirrors spec lines 2251-2262 exactly
- Updates WPT tests to remove out-of-scope edge cases
Test results: 5366/5367 passing (100%)
Implementation follows spec requirement to preserve buffer content
(buffer = "C:") enabling path state's Windows drive letter quirk
to normalize the drive letter correctly.
Edge cases with special characters (#, ?, %, tabs) removed as out
of scope per Anne's guidance in whatwg/url#874.
Refs:
- Spec PR: whatwg/url#874
- WPT PR: web-platform-tests/wpt#53459
- WPT commit: 1eee3598dfd3e1171f1c0c3d30f3e438bf82b16a
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ whatwg-url is a full implementation of the WHATWG [URL Standard](https://url.spe
4
4
5
5
## Specification conformance
6
6
7
-
whatwg-url is currently up to date with the URL spec up to commit [6c78200](https://github.com/whatwg/url/commit/6c782003a2d53b1feecd072d1006eb8f1d65fb2d).
7
+
whatwg-url is currently up to date with the URL spec up to commit [05a5d83](https://github.com/whatwg/url/commit/05a5d834deba31622390ee05a3dcbc22496b7bb5).
8
8
9
9
For `file:` URLs, whose [origin is left unspecified](https://url.spec.whatwg.org/#concept-url-origin), whatwg-url chooses to use a new opaque origin (which serializes to `"null"`).
<p>The output below will display a URL's parsed components from the browser versus those given by <ahref="https://github.com/jsdom/whatwg-url">jsdom/whatwg-url</a>.
11
18
12
-
<p>jsdom/whatwg-url closely follows the <ahref="http://url.spec.whatwg.org/">URL Standard</a> and
13
-
the associated
14
-
<ahref="https://github.com/w3c/web-platform-tests/tree/master/url">web-platform-tests</a>, so this
19
+
<p>jsdom/whatwg-url closely follows the <ahref="http://url.spec.whatwg.org/">URL Standard</a> and the associated <ahref="https://github.com/w3c/web-platform-tests/tree/master/url">web-platform-tests</a>, so this
15
20
serves as a good comparison versus the standard itself.
16
21
17
-
<p>The output will be colored <spanclass="pass">dark green</span> unless a difference occurs
18
-
between the two parsers in which case the affected URL component will be colored
19
-
<spanclass="fail">red</span>.
22
+
<p>The output will be colored <spanclass="pass">dark green</span> unless a difference occurs between the two parsers in which case the affected URL component will be colored <spanclass="fail">red</span>.
0 commit comments