Commit a8c0290
committed
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: 1eee3598dfd3e1171f1c0c3d30f3e438bf82b16a1 parent 414f17a commit a8c0290
File tree
7 files changed
+301
-277
lines changed- .github/workflows
- lib
- live-viewer
- scripts
7 files changed
+301
-277
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
20 | | - | |
21 | | - | |
| 19 | + | |
| 20 | + | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
536 | 536 | | |
537 | 537 | | |
538 | 538 | | |
539 | | - | |
540 | | - | |
541 | | - | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
542 | 542 | | |
543 | 543 | | |
544 | 544 | | |
| |||
575 | 575 | | |
576 | 576 | | |
577 | 577 | | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
578 | 587 | | |
579 | 588 | | |
580 | 589 | | |
| |||
751 | 760 | | |
752 | 761 | | |
753 | 762 | | |
754 | | - | |
| 763 | + | |
755 | 764 | | |
756 | 765 | | |
757 | | - | |
| 766 | + | |
758 | 767 | | |
759 | 768 | | |
760 | 769 | | |
761 | 770 | | |
762 | 771 | | |
763 | 772 | | |
764 | | - | |
765 | | - | |
| 773 | + | |
| 774 | + | |
766 | 775 | | |
767 | 776 | | |
768 | 777 | | |
769 | | - | |
| 778 | + | |
770 | 779 | | |
771 | 780 | | |
772 | 781 | | |
| |||
775 | 784 | | |
776 | 785 | | |
777 | 786 | | |
778 | | - | |
| 787 | + | |
779 | 788 | | |
780 | 789 | | |
781 | 790 | | |
| |||
794 | 803 | | |
795 | 804 | | |
796 | 805 | | |
797 | | - | |
| 806 | + | |
798 | 807 | | |
799 | 808 | | |
800 | 809 | | |
801 | 810 | | |
802 | 811 | | |
803 | 812 | | |
804 | | - | |
| 813 | + | |
805 | 814 | | |
806 | 815 | | |
807 | 816 | | |
| |||
821 | 830 | | |
822 | 831 | | |
823 | 832 | | |
824 | | - | |
| 833 | + | |
825 | 834 | | |
826 | 835 | | |
827 | 836 | | |
| |||
837 | 846 | | |
838 | 847 | | |
839 | 848 | | |
840 | | - | |
| 849 | + | |
841 | 850 | | |
842 | | - | |
| 851 | + | |
843 | 852 | | |
844 | 853 | | |
845 | 854 | | |
| |||
861 | 870 | | |
862 | 871 | | |
863 | 872 | | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
864 | 876 | | |
865 | 877 | | |
866 | | - | |
| 878 | + | |
867 | 879 | | |
868 | 880 | | |
869 | 881 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
5 | 13 | | |
6 | 14 | | |
7 | 15 | | |
8 | 16 | | |
9 | | - | |
10 | | - | |
| 17 | + | |
11 | 18 | | |
12 | | - | |
13 | | - | |
14 | | - | |
| 19 | + | |
15 | 20 | | |
16 | 21 | | |
17 | | - | |
18 | | - | |
19 | | - | |
| 22 | + | |
20 | 23 | | |
21 | 24 | | |
22 | 25 | | |
| |||
0 commit comments