Changeset 267896 in webkit
- Timestamp:
- Oct 2, 2020 1:59:11 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r267893 r267896 1 2020-10-02 Alex Christensen <achristensen@webkit.org> 2 3 Copy host from base file URL 4 https://bugs.webkit.org/show_bug.cgi?id=217170 5 6 Reviewed by Brady Eidson. 7 8 * web-platform-tests/url/a-element-expected.txt: 9 * web-platform-tests/url/a-element-xhtml-expected.txt: 10 * web-platform-tests/url/resources/urltestdata.json: 11 * web-platform-tests/url/url-constructor-expected.txt: 12 1 13 2020-10-02 Sam Weinig <weinig@apple.com> 2 14 -
trunk/LayoutTests/imported/w3c/web-platform-tests/url/a-element-expected.txt
r267837 r267896 418 418 PASS Parsing: <..> against <file:///> 419 419 PASS Parsing: </> against <file:///C:/a/b> 420 PASS Parsing: </> against <file://h/C:/a/b> 421 PASS Parsing: </> against <file://h/a/b> 420 422 PASS Parsing: <//d:> against <file:///C:/a/b> 421 423 PASS Parsing: <//d:/..> against <file:///C:/a/b> … … 428 430 PASS Parsing: <#x> against <file:///test?test#test> 429 431 PASS Parsing: <file:#x> against <file:///test?test#test> 430 FAIL Parsing: <file:\\//> against <about:blank> assert_equals: href expected "file:///" but got "file:////" 431 FAIL Parsing: <file:\\\\> against <about:blank> assert_equals: href expected "file:///" but got "file:////" 432 FAIL Parsing: <file:\\\\?fox> against <about:blank> assert_equals: href expected "file:///?fox" but got "file:////?fox" 433 FAIL Parsing: <file:\\\\#guppy> against <about:blank> assert_equals: href expected "file:///#guppy" but got "file:////#guppy" 434 FAIL Parsing: <file://spider///> against <about:blank> assert_equals: href expected "file://spider/" but got "file://spider///" 435 FAIL Parsing: <file:\\localhost//> against <about:blank> assert_equals: href expected "file:///" but got "file:////" 432 PASS Parsing: <file:\\//> against <about:blank> 433 PASS Parsing: <file:\\\\> against <about:blank> 434 PASS Parsing: <file:\\\\?fox> against <about:blank> 435 PASS Parsing: <file:\\\\#guppy> against <about:blank> 436 PASS Parsing: <file://spider///> against <about:blank> 437 PASS Parsing: <file:\\localhost//> against <about:blank> 436 438 PASS Parsing: <file:///localhost//cat> against <about:blank> 437 FAIL Parsing: <file://\/localhost//cat> against <about:blank> assert_equals: href expected "file:///localhost//cat" but got "file:////localhost//cat" 438 FAIL Parsing: <file://localhost//a//../..//> against <about:blank> assert_equals: href expected "file:///" but got "file://///" 439 FAIL Parsing: </////mouse> against <file:///elephant> assert_equals: href expected "file:///mouse" but got "file://///mouse" 439 PASS Parsing: <file://\/localhost//cat> against <about:blank> 440 PASS Parsing: <file://localhost//a//../..//> against <about:blank> 441 PASS Parsing: </////mouse> against <file:///elephant> 440 442 PASS Parsing: <\//pig> against <file://lion/> 441 FAIL Parsing: <\/localhost//pig> against <file://lion/> assert_equals: href expected "file:///pig" but got "file:////pig" 442 FAIL Parsing: <//localhost//pig> against <file://lion/> assert_equals: href expected "file:///pig" but got "file:////pig" 443 FAIL Parsing: </..//localhost//pig> against <file://lion/> assert_equals: href expected "file://lion/localhost//pig" but got "file:////localhost//pig" 443 PASS Parsing: <\/localhost//pig> against <file://lion/> 444 PASS Parsing: <//localhost//pig> against <file://lion/> 445 PASS Parsing: </..//localhost//pig> against <file://lion/> 444 446 PASS Parsing: <file://> against <file://ape/> 445 FAIL Parsing: </rooibos> against <file://tea/> assert_equals: href expected "file://tea/rooibos" but got "file:///rooibos" 446 FAIL Parsing: </?chai> against <file://tea/> assert_equals: href expected "file://tea/?chai" but got "file:///?chai" 447 FAIL Parsing: <C|> against <file://host/dir/file> assert_equals: href expected "file:// /C:" but got "file://host/dir/C|"447 PASS Parsing: </rooibos> against <file://tea/> 448 PASS Parsing: </?chai> against <file://tea/> 449 FAIL Parsing: <C|> against <file://host/dir/file> assert_equals: href expected "file://host/C:" but got "file://host/dir/C|" 448 450 PASS Parsing: <C|#> against <file://host/dir/file> 449 451 PASS Parsing: <C|?> against <file://host/dir/file> … … 458 460 PASS Parsing: <file:\c:\foo\bar> against <file:///c:/baz/qux> 459 461 PASS Parsing: </c:/foo/bar> against <file://host/path> 460 FAIL Parsing: <file://example.net/C:/> against <about:blank> assert_equals: href expected "file:///C:/" but got "file://example.net/C:/" 461 FAIL Parsing: <file://1.2.3.4/C:/> against <about:blank> assert_equals: href expected "file:///C:/" but got "file://1.2.3.4/C:/" 462 FAIL Parsing: <file://[1::8]/C:/> against <about:blank> assert_equals: href expected "file:///C:/" but got "file://[1::8]/C:/" 462 PASS Parsing: <file://example.net/C:/> against <about:blank> 463 PASS Parsing: <file://1.2.3.4/C:/> against <about:blank> 464 PASS Parsing: <file://[1::8]/C:/> against <about:blank> 463 465 PASS Parsing: <file:/C|/> against <about:blank> 464 466 PASS Parsing: <file://C|/> against <about:blank> … … 476 478 PASS Parsing: <file:///./y:> against <about:blank> 477 479 PASS Parsing: <\\\.\y:> against <about:blank> 480 PASS Parsing: <file://localhost//a//../..//foo> against <about:blank> 481 PASS Parsing: <file://localhost////foo> against <about:blank> 482 PASS Parsing: <file:////foo> against <about:blank> 483 PASS Parsing: <file:///one/two> against <file:///> 484 PASS Parsing: <file:////one/two> against <file:///> 485 PASS Parsing: <//one/two> against <file:///> 486 PASS Parsing: <///one/two> against <file:///> 487 PASS Parsing: <////one/two> against <file:///> 488 PASS Parsing: <file:///.//> against <file:////> 478 489 PASS Parsing: <http://[1:0::]> against <http://example.net/> 479 490 PASS Parsing: <http://[0:1:2:3:4:5:6:7:8]> against <http://example.net/> -
trunk/LayoutTests/imported/w3c/web-platform-tests/url/a-element-xhtml-expected.txt
r267837 r267896 418 418 PASS Parsing: <..> against <file:///> 419 419 PASS Parsing: </> against <file:///C:/a/b> 420 PASS Parsing: </> against <file://h/C:/a/b> 421 PASS Parsing: </> against <file://h/a/b> 420 422 PASS Parsing: <//d:> against <file:///C:/a/b> 421 423 PASS Parsing: <//d:/..> against <file:///C:/a/b> … … 428 430 PASS Parsing: <#x> against <file:///test?test#test> 429 431 PASS Parsing: <file:#x> against <file:///test?test#test> 430 FAIL Parsing: <file:\\//> against <about:blank> assert_equals: href expected "file:///" but got "file:////" 431 FAIL Parsing: <file:\\\\> against <about:blank> assert_equals: href expected "file:///" but got "file:////" 432 FAIL Parsing: <file:\\\\?fox> against <about:blank> assert_equals: href expected "file:///?fox" but got "file:////?fox" 433 FAIL Parsing: <file:\\\\#guppy> against <about:blank> assert_equals: href expected "file:///#guppy" but got "file:////#guppy" 434 FAIL Parsing: <file://spider///> against <about:blank> assert_equals: href expected "file://spider/" but got "file://spider///" 435 FAIL Parsing: <file:\\localhost//> against <about:blank> assert_equals: href expected "file:///" but got "file:////" 432 PASS Parsing: <file:\\//> against <about:blank> 433 PASS Parsing: <file:\\\\> against <about:blank> 434 PASS Parsing: <file:\\\\?fox> against <about:blank> 435 PASS Parsing: <file:\\\\#guppy> against <about:blank> 436 PASS Parsing: <file://spider///> against <about:blank> 437 PASS Parsing: <file:\\localhost//> against <about:blank> 436 438 PASS Parsing: <file:///localhost//cat> against <about:blank> 437 FAIL Parsing: <file://\/localhost//cat> against <about:blank> assert_equals: href expected "file:///localhost//cat" but got "file:////localhost//cat" 438 FAIL Parsing: <file://localhost//a//../..//> against <about:blank> assert_equals: href expected "file:///" but got "file://///" 439 FAIL Parsing: </////mouse> against <file:///elephant> assert_equals: href expected "file:///mouse" but got "file://///mouse" 439 PASS Parsing: <file://\/localhost//cat> against <about:blank> 440 PASS Parsing: <file://localhost//a//../..//> against <about:blank> 441 PASS Parsing: </////mouse> against <file:///elephant> 440 442 PASS Parsing: <\//pig> against <file://lion/> 441 FAIL Parsing: <\/localhost//pig> against <file://lion/> assert_equals: href expected "file:///pig" but got "file:////pig" 442 FAIL Parsing: <//localhost//pig> against <file://lion/> assert_equals: href expected "file:///pig" but got "file:////pig" 443 FAIL Parsing: </..//localhost//pig> against <file://lion/> assert_equals: href expected "file://lion/localhost//pig" but got "file:////localhost//pig" 443 PASS Parsing: <\/localhost//pig> against <file://lion/> 444 PASS Parsing: <//localhost//pig> against <file://lion/> 445 PASS Parsing: </..//localhost//pig> against <file://lion/> 444 446 PASS Parsing: <file://> against <file://ape/> 445 FAIL Parsing: </rooibos> against <file://tea/> assert_equals: href expected "file://tea/rooibos" but got "file:///rooibos" 446 FAIL Parsing: </?chai> against <file://tea/> assert_equals: href expected "file://tea/?chai" but got "file:///?chai" 447 FAIL Parsing: <C|> against <file://host/dir/file> assert_equals: href expected "file:// /C:" but got "file://host/dir/C|"447 PASS Parsing: </rooibos> against <file://tea/> 448 PASS Parsing: </?chai> against <file://tea/> 449 FAIL Parsing: <C|> against <file://host/dir/file> assert_equals: href expected "file://host/C:" but got "file://host/dir/C|" 448 450 PASS Parsing: <C|#> against <file://host/dir/file> 449 451 PASS Parsing: <C|?> against <file://host/dir/file> … … 458 460 PASS Parsing: <file:\c:\foo\bar> against <file:///c:/baz/qux> 459 461 PASS Parsing: </c:/foo/bar> against <file://host/path> 460 FAIL Parsing: <file://example.net/C:/> against <about:blank> assert_equals: href expected "file:///C:/" but got "file://example.net/C:/" 461 FAIL Parsing: <file://1.2.3.4/C:/> against <about:blank> assert_equals: href expected "file:///C:/" but got "file://1.2.3.4/C:/" 462 FAIL Parsing: <file://[1::8]/C:/> against <about:blank> assert_equals: href expected "file:///C:/" but got "file://[1::8]/C:/" 462 PASS Parsing: <file://example.net/C:/> against <about:blank> 463 PASS Parsing: <file://1.2.3.4/C:/> against <about:blank> 464 PASS Parsing: <file://[1::8]/C:/> against <about:blank> 463 465 PASS Parsing: <file:/C|/> against <about:blank> 464 466 PASS Parsing: <file://C|/> against <about:blank> … … 476 478 PASS Parsing: <file:///./y:> against <about:blank> 477 479 PASS Parsing: <\\\.\y:> against <about:blank> 480 PASS Parsing: <file://localhost//a//../..//foo> against <about:blank> 481 PASS Parsing: <file://localhost////foo> against <about:blank> 482 PASS Parsing: <file:////foo> against <about:blank> 483 PASS Parsing: <file:///one/two> against <file:///> 484 PASS Parsing: <file:////one/two> against <file:///> 485 PASS Parsing: <//one/two> against <file:///> 486 PASS Parsing: <///one/two> against <file:///> 487 PASS Parsing: <////one/two> against <file:///> 488 PASS Parsing: <file:///.//> against <file:////> 478 489 PASS Parsing: <http://[1:0::]> against <http://example.net/> 479 490 PASS Parsing: <http://[0:1:2:3:4:5:6:7:8]> against <http://example.net/> -
trunk/LayoutTests/imported/w3c/web-platform-tests/url/resources/urltestdata.json
r266399 r267896 5247 5247 }, 5248 5248 { 5249 "input": "/", 5250 "base": "file://h/C:/a/b", 5251 "href": "file://h/C:/", 5252 "protocol": "file:", 5253 "username": "", 5254 "password": "", 5255 "host": "h", 5256 "hostname": "h", 5257 "port": "", 5258 "pathname": "/C:/", 5259 "search": "", 5260 "hash": "" 5261 }, 5262 { 5263 "input": "/", 5264 "base": "file://h/a/b", 5265 "href": "file://h/", 5266 "protocol": "file:", 5267 "username": "", 5268 "password": "", 5269 "host": "h", 5270 "hostname": "h", 5271 "port": "", 5272 "pathname": "/", 5273 "search": "", 5274 "hash": "" 5275 }, 5276 { 5249 5277 "input": "//d:", 5250 5278 "base": "file:///C:/a/b", … … 5390 5418 "input": "file:\\\\//", 5391 5419 "base": "about:blank", 5392 "href": "file:/// ",5393 "protocol": "file:", 5394 "username": "", 5395 "password": "", 5396 "host": "", 5397 "hostname": "", 5398 "port": "", 5399 "pathname": "/ ",5420 "href": "file:////", 5421 "protocol": "file:", 5422 "username": "", 5423 "password": "", 5424 "host": "", 5425 "hostname": "", 5426 "port": "", 5427 "pathname": "//", 5400 5428 "search": "", 5401 5429 "hash": "" … … 5404 5432 "input": "file:\\\\\\\\", 5405 5433 "base": "about:blank", 5406 "href": "file:/// ",5407 "protocol": "file:", 5408 "username": "", 5409 "password": "", 5410 "host": "", 5411 "hostname": "", 5412 "port": "", 5413 "pathname": "/ ",5434 "href": "file:////", 5435 "protocol": "file:", 5436 "username": "", 5437 "password": "", 5438 "host": "", 5439 "hostname": "", 5440 "port": "", 5441 "pathname": "//", 5414 5442 "search": "", 5415 5443 "hash": "" … … 5418 5446 "input": "file:\\\\\\\\?fox", 5419 5447 "base": "about:blank", 5420 "href": "file:/// ?fox",5421 "protocol": "file:", 5422 "username": "", 5423 "password": "", 5424 "host": "", 5425 "hostname": "", 5426 "port": "", 5427 "pathname": "/ ",5448 "href": "file:////?fox", 5449 "protocol": "file:", 5450 "username": "", 5451 "password": "", 5452 "host": "", 5453 "hostname": "", 5454 "port": "", 5455 "pathname": "//", 5428 5456 "search": "?fox", 5429 5457 "hash": "" … … 5432 5460 "input": "file:\\\\\\\\#guppy", 5433 5461 "base": "about:blank", 5434 "href": "file:/// #guppy",5435 "protocol": "file:", 5436 "username": "", 5437 "password": "", 5438 "host": "", 5439 "hostname": "", 5440 "port": "", 5441 "pathname": "/ ",5462 "href": "file:////#guppy", 5463 "protocol": "file:", 5464 "username": "", 5465 "password": "", 5466 "host": "", 5467 "hostname": "", 5468 "port": "", 5469 "pathname": "//", 5442 5470 "search": "", 5443 5471 "hash": "#guppy" … … 5446 5474 "input": "file://spider///", 5447 5475 "base": "about:blank", 5448 "href": "file://spider/ ",5476 "href": "file://spider///", 5449 5477 "protocol": "file:", 5450 5478 "username": "", … … 5453 5481 "hostname": "spider", 5454 5482 "port": "", 5455 "pathname": "/ ",5483 "pathname": "///", 5456 5484 "search": "", 5457 5485 "hash": "" … … 5460 5488 "input": "file:\\\\localhost//", 5461 5489 "base": "about:blank", 5462 "href": "file:/// ",5463 "protocol": "file:", 5464 "username": "", 5465 "password": "", 5466 "host": "", 5467 "hostname": "", 5468 "port": "", 5469 "pathname": "/ ",5490 "href": "file:////", 5491 "protocol": "file:", 5492 "username": "", 5493 "password": "", 5494 "host": "", 5495 "hostname": "", 5496 "port": "", 5497 "pathname": "//", 5470 5498 "search": "", 5471 5499 "hash": "" … … 5488 5516 "input": "file://\\/localhost//cat", 5489 5517 "base": "about:blank", 5490 "href": "file:/// localhost//cat",5491 "protocol": "file:", 5492 "username": "", 5493 "password": "", 5494 "host": "", 5495 "hostname": "", 5496 "port": "", 5497 "pathname": "/ localhost//cat",5518 "href": "file:////localhost//cat", 5519 "protocol": "file:", 5520 "username": "", 5521 "password": "", 5522 "host": "", 5523 "hostname": "", 5524 "port": "", 5525 "pathname": "//localhost//cat", 5498 5526 "search": "", 5499 5527 "hash": "" … … 5502 5530 "input": "file://localhost//a//../..//", 5503 5531 "base": "about:blank", 5504 "href": "file:/// ",5505 "protocol": "file:", 5506 "username": "", 5507 "password": "", 5508 "host": "", 5509 "hostname": "", 5510 "port": "", 5511 "pathname": "/ ",5532 "href": "file://///", 5533 "protocol": "file:", 5534 "username": "", 5535 "password": "", 5536 "host": "", 5537 "hostname": "", 5538 "port": "", 5539 "pathname": "///", 5512 5540 "search": "", 5513 5541 "hash": "" … … 5516 5544 "input": "/////mouse", 5517 5545 "base": "file:///elephant", 5518 "href": "file:/// mouse",5519 "protocol": "file:", 5520 "username": "", 5521 "password": "", 5522 "host": "", 5523 "hostname": "", 5524 "port": "", 5525 "pathname": "/ mouse",5546 "href": "file://///mouse", 5547 "protocol": "file:", 5548 "username": "", 5549 "password": "", 5550 "host": "", 5551 "hostname": "", 5552 "port": "", 5553 "pathname": "///mouse", 5526 5554 "search": "", 5527 5555 "hash": "" … … 5544 5572 "input": "\\/localhost//pig", 5545 5573 "base": "file://lion/", 5546 "href": "file:/// pig",5547 "protocol": "file:", 5548 "username": "", 5549 "password": "", 5550 "host": "", 5551 "hostname": "", 5552 "port": "", 5553 "pathname": "/ pig",5574 "href": "file:////pig", 5575 "protocol": "file:", 5576 "username": "", 5577 "password": "", 5578 "host": "", 5579 "hostname": "", 5580 "port": "", 5581 "pathname": "//pig", 5554 5582 "search": "", 5555 5583 "hash": "" … … 5558 5586 "input": "//localhost//pig", 5559 5587 "base": "file://lion/", 5560 "href": "file:/// pig",5561 "protocol": "file:", 5562 "username": "", 5563 "password": "", 5564 "host": "", 5565 "hostname": "", 5566 "port": "", 5567 "pathname": "/ pig",5588 "href": "file:////pig", 5589 "protocol": "file:", 5590 "username": "", 5591 "password": "", 5592 "host": "", 5593 "hostname": "", 5594 "port": "", 5595 "pathname": "//pig", 5568 5596 "search": "", 5569 5597 "hash": "" … … 5572 5600 "input": "/..//localhost//pig", 5573 5601 "base": "file://lion/", 5574 "href": "file://lion/ localhost//pig",5602 "href": "file://lion//localhost//pig", 5575 5603 "protocol": "file:", 5576 5604 "username": "", … … 5579 5607 "hostname": "lion", 5580 5608 "port": "", 5581 "pathname": "/ localhost//pig",5609 "pathname": "//localhost//pig", 5582 5610 "search": "", 5583 5611 "hash": "" … … 5630 5658 "input": "C|", 5631 5659 "base": "file://host/dir/file", 5632 "href": "file:// /C:",5633 "protocol": "file:", 5634 "username": "", 5635 "password": "", 5636 "host": " ",5637 "hostname": " ",5660 "href": "file://host/C:", 5661 "protocol": "file:", 5662 "username": "", 5663 "password": "", 5664 "host": "host", 5665 "hostname": "host", 5638 5666 "port": "", 5639 5667 "pathname": "/C:", … … 5644 5672 "input": "C|#", 5645 5673 "base": "file://host/dir/file", 5646 "href": "file:// /C:#",5647 "protocol": "file:", 5648 "username": "", 5649 "password": "", 5650 "host": " ",5651 "hostname": " ",5674 "href": "file://host/C:#", 5675 "protocol": "file:", 5676 "username": "", 5677 "password": "", 5678 "host": "host", 5679 "hostname": "host", 5652 5680 "port": "", 5653 5681 "pathname": "/C:", … … 5658 5686 "input": "C|?", 5659 5687 "base": "file://host/dir/file", 5660 "href": "file:// /C:?",5661 "protocol": "file:", 5662 "username": "", 5663 "password": "", 5664 "host": " ",5665 "hostname": " ",5688 "href": "file://host/C:?", 5689 "protocol": "file:", 5690 "username": "", 5691 "password": "", 5692 "host": "host", 5693 "hostname": "host", 5666 5694 "port": "", 5667 5695 "pathname": "/C:", … … 5672 5700 "input": "C|/", 5673 5701 "base": "file://host/dir/file", 5674 "href": "file:// /C:/",5675 "protocol": "file:", 5676 "username": "", 5677 "password": "", 5678 "host": " ",5679 "hostname": " ",5702 "href": "file://host/C:/", 5703 "protocol": "file:", 5704 "username": "", 5705 "password": "", 5706 "host": "host", 5707 "hostname": "host", 5680 5708 "port": "", 5681 5709 "pathname": "/C:/", … … 5686 5714 "input": "C|\n/", 5687 5715 "base": "file://host/dir/file", 5688 "href": "file:// /C:/",5689 "protocol": "file:", 5690 "username": "", 5691 "password": "", 5692 "host": " ",5693 "hostname": " ",5716 "href": "file://host/C:/", 5717 "protocol": "file:", 5718 "username": "", 5719 "password": "", 5720 "host": "host", 5721 "hostname": "host", 5694 5722 "port": "", 5695 5723 "pathname": "/C:/", … … 5700 5728 "input": "C|\\", 5701 5729 "base": "file://host/dir/file", 5702 "href": "file:// /C:/",5703 "protocol": "file:", 5704 "username": "", 5705 "password": "", 5706 "host": " ",5707 "hostname": " ",5730 "href": "file://host/C:/", 5731 "protocol": "file:", 5732 "username": "", 5733 "password": "", 5734 "host": "host", 5735 "hostname": "host", 5708 5736 "port": "", 5709 5737 "pathname": "/C:/", … … 5785 5813 "input": "/c:/foo/bar", 5786 5814 "base": "file://host/path", 5787 "href": "file:// /c:/foo/bar",5788 "protocol": "file:", 5789 "username": "", 5790 "password": "", 5791 "host": " ",5792 "hostname": " ",5815 "href": "file://host/c:/foo/bar", 5816 "protocol": "file:", 5817 "username": "", 5818 "password": "", 5819 "host": "host", 5820 "hostname": "host", 5793 5821 "port": "", 5794 5822 "pathname": "/c:/foo/bar", … … 5796 5824 "hash": "" 5797 5825 }, 5798 "# Windows drive letter quirk with not empty host",5826 "# Do not drop the host in the presence of a drive letter", 5799 5827 { 5800 5828 "input": "file://example.net/C:/", 5801 5829 "base": "about:blank", 5830 "href": "file://example.net/C:/", 5831 "protocol": "file:", 5832 "username": "", 5833 "password": "", 5834 "host": "example.net", 5835 "hostname": "example.net", 5836 "port": "", 5837 "pathname": "/C:/", 5838 "search": "", 5839 "hash": "" 5840 }, 5841 { 5842 "input": "file://1.2.3.4/C:/", 5843 "base": "about:blank", 5844 "href": "file://1.2.3.4/C:/", 5845 "protocol": "file:", 5846 "username": "", 5847 "password": "", 5848 "host": "1.2.3.4", 5849 "hostname": "1.2.3.4", 5850 "port": "", 5851 "pathname": "/C:/", 5852 "search": "", 5853 "hash": "" 5854 }, 5855 { 5856 "input": "file://[1::8]/C:/", 5857 "base": "about:blank", 5858 "href": "file://[1::8]/C:/", 5859 "protocol": "file:", 5860 "username": "", 5861 "password": "", 5862 "host": "[1::8]", 5863 "hostname": "[1::8]", 5864 "port": "", 5865 "pathname": "/C:/", 5866 "search": "", 5867 "hash": "" 5868 }, 5869 "# Windows drive letter quirk (no host)", 5870 { 5871 "input": "file:/C|/", 5872 "base": "about:blank", 5802 5873 "href": "file:///C:/", 5803 5874 "protocol": "file:", … … 5812 5883 }, 5813 5884 { 5814 "input": "file:// 1.2.3.4/C:/",5885 "input": "file://C|/", 5815 5886 "base": "about:blank", 5816 5887 "href": "file:///C:/", … … 5825 5896 "hash": "" 5826 5897 }, 5827 {5828 "input": "file://[1::8]/C:/",5829 "base": "about:blank",5830 "href": "file:///C:/",5831 "protocol": "file:",5832 "username": "",5833 "password": "",5834 "host": "",5835 "hostname": "",5836 "port": "",5837 "pathname": "/C:/",5838 "search": "",5839 "hash": ""5840 },5841 "# Windows drive letter quirk (no host)",5842 {5843 "input": "file:/C|/",5844 "base": "about:blank",5845 "href": "file:///C:/",5846 "protocol": "file:",5847 "username": "",5848 "password": "",5849 "host": "",5850 "hostname": "",5851 "port": "",5852 "pathname": "/C:/",5853 "search": "",5854 "hash": ""5855 },5856 {5857 "input": "file://C|/",5858 "base": "about:blank",5859 "href": "file:///C:/",5860 "protocol": "file:",5861 "username": "",5862 "password": "",5863 "host": "",5864 "hostname": "",5865 "port": "",5866 "pathname": "/C:/",5867 "search": "",5868 "hash": ""5869 },5870 5898 "# file URLs without base URL by Rimas Misevičius", 5871 5899 { … … 6034 6062 "base": "about:blank", 6035 6063 "failure": true 6064 }, 6065 "# Additional file URL tetsts for (https://github.com/whatwg/url/issues/405)", 6066 { 6067 "input": "file://localhost//a//../..//foo", 6068 "base": "about:blank", 6069 "href": "file://///foo", 6070 "protocol": "file:", 6071 "username": "", 6072 "password": "", 6073 "host": "", 6074 "hostname": "", 6075 "port": "", 6076 "pathname": "///foo", 6077 "search": "", 6078 "hash": "" 6079 }, 6080 { 6081 "input": "file://localhost////foo", 6082 "base": "about:blank", 6083 "href": "file://////foo", 6084 "protocol": "file:", 6085 "username": "", 6086 "password": "", 6087 "host": "", 6088 "hostname": "", 6089 "port": "", 6090 "pathname": "////foo", 6091 "search": "", 6092 "hash": "" 6093 }, 6094 { 6095 "input": "file:////foo", 6096 "base": "about:blank", 6097 "href": "file:////foo", 6098 "protocol": "file:", 6099 "username": "", 6100 "password": "", 6101 "host": "", 6102 "hostname": "", 6103 "port": "", 6104 "pathname": "//foo", 6105 "search": "", 6106 "hash": "" 6107 }, 6108 { 6109 "input": "file:///one/two", 6110 "base": "file:///", 6111 "href": "file:///one/two", 6112 "protocol": "file:", 6113 "username": "", 6114 "password": "", 6115 "host": "", 6116 "hostname": "", 6117 "port": "", 6118 "pathname": "/one/two", 6119 "search": "", 6120 "hash": "" 6121 }, 6122 { 6123 "input": "file:////one/two", 6124 "base": "file:///", 6125 "href": "file:////one/two", 6126 "protocol": "file:", 6127 "username": "", 6128 "password": "", 6129 "host": "", 6130 "hostname": "", 6131 "port": "", 6132 "pathname": "//one/two", 6133 "search": "", 6134 "hash": "" 6135 }, 6136 { 6137 "input": "//one/two", 6138 "base": "file:///", 6139 "href": "file://one/two", 6140 "protocol": "file:", 6141 "username": "", 6142 "password": "", 6143 "host": "one", 6144 "hostname": "one", 6145 "port": "", 6146 "pathname": "/two", 6147 "search": "", 6148 "hash": "" 6149 }, 6150 { 6151 "input": "///one/two", 6152 "base": "file:///", 6153 "href": "file:///one/two", 6154 "protocol": "file:", 6155 "username": "", 6156 "password": "", 6157 "host": "", 6158 "hostname": "", 6159 "port": "", 6160 "pathname": "/one/two", 6161 "search": "", 6162 "hash": "" 6163 }, 6164 { 6165 "input": "////one/two", 6166 "base": "file:///", 6167 "href": "file:////one/two", 6168 "protocol": "file:", 6169 "username": "", 6170 "password": "", 6171 "host": "", 6172 "hostname": "", 6173 "port": "", 6174 "pathname": "//one/two", 6175 "search": "", 6176 "hash": "" 6177 }, 6178 { 6179 "input": "file:///.//", 6180 "base": "file:////", 6181 "href": "file:////", 6182 "protocol": "file:", 6183 "username": "", 6184 "password": "", 6185 "host": "", 6186 "hostname": "", 6187 "port": "", 6188 "pathname": "//", 6189 "search": "", 6190 "hash": "" 6036 6191 }, 6037 6192 "# IPv6 tests", -
trunk/LayoutTests/imported/w3c/web-platform-tests/url/url-constructor-expected.txt
r267837 r267896 421 421 PASS Parsing: <..> against <file:///> 422 422 PASS Parsing: </> against <file:///C:/a/b> 423 PASS Parsing: </> against <file://h/C:/a/b> 424 PASS Parsing: </> against <file://h/a/b> 423 425 PASS Parsing: <//d:> against <file:///C:/a/b> 424 426 PASS Parsing: <//d:/..> against <file:///C:/a/b> … … 431 433 PASS Parsing: <#x> against <file:///test?test#test> 432 434 PASS Parsing: <file:#x> against <file:///test?test#test> 433 FAIL Parsing: <file:\\//> against <about:blank> assert_equals: href expected "file:///" but got "file:////" 434 FAIL Parsing: <file:\\\\> against <about:blank> assert_equals: href expected "file:///" but got "file:////" 435 FAIL Parsing: <file:\\\\?fox> against <about:blank> assert_equals: href expected "file:///?fox" but got "file:////?fox" 436 FAIL Parsing: <file:\\\\#guppy> against <about:blank> assert_equals: href expected "file:///#guppy" but got "file:////#guppy" 437 FAIL Parsing: <file://spider///> against <about:blank> assert_equals: href expected "file://spider/" but got "file://spider///" 438 FAIL Parsing: <file:\\localhost//> against <about:blank> assert_equals: href expected "file:///" but got "file:////" 435 PASS Parsing: <file:\\//> against <about:blank> 436 PASS Parsing: <file:\\\\> against <about:blank> 437 PASS Parsing: <file:\\\\?fox> against <about:blank> 438 PASS Parsing: <file:\\\\#guppy> against <about:blank> 439 PASS Parsing: <file://spider///> against <about:blank> 440 PASS Parsing: <file:\\localhost//> against <about:blank> 439 441 PASS Parsing: <file:///localhost//cat> against <about:blank> 440 FAIL Parsing: <file://\/localhost//cat> against <about:blank> assert_equals: href expected "file:///localhost//cat" but got "file:////localhost//cat" 441 FAIL Parsing: <file://localhost//a//../..//> against <about:blank> assert_equals: href expected "file:///" but got "file://///" 442 FAIL Parsing: </////mouse> against <file:///elephant> assert_equals: href expected "file:///mouse" but got "file://///mouse" 442 PASS Parsing: <file://\/localhost//cat> against <about:blank> 443 PASS Parsing: <file://localhost//a//../..//> against <about:blank> 444 PASS Parsing: </////mouse> against <file:///elephant> 443 445 PASS Parsing: <\//pig> against <file://lion/> 444 FAIL Parsing: <\/localhost//pig> against <file://lion/> assert_equals: href expected "file:///pig" but got "file:////pig" 445 FAIL Parsing: <//localhost//pig> against <file://lion/> assert_equals: href expected "file:///pig" but got "file:////pig" 446 FAIL Parsing: </..//localhost//pig> against <file://lion/> assert_equals: href expected "file://lion/localhost//pig" but got "file:////localhost//pig" 446 PASS Parsing: <\/localhost//pig> against <file://lion/> 447 PASS Parsing: <//localhost//pig> against <file://lion/> 448 PASS Parsing: </..//localhost//pig> against <file://lion/> 447 449 PASS Parsing: <file://> against <file://ape/> 448 FAIL Parsing: </rooibos> against <file://tea/> assert_equals: href expected "file://tea/rooibos" but got "file:///rooibos" 449 FAIL Parsing: </?chai> against <file://tea/> assert_equals: href expected "file://tea/?chai" but got "file:///?chai" 450 FAIL Parsing: <C|> against <file://host/dir/file> assert_equals: href expected "file:// /C:" but got "file://host/dir/C|"450 PASS Parsing: </rooibos> against <file://tea/> 451 PASS Parsing: </?chai> against <file://tea/> 452 FAIL Parsing: <C|> against <file://host/dir/file> assert_equals: href expected "file://host/C:" but got "file://host/dir/C|" 451 453 PASS Parsing: <C|#> against <file://host/dir/file> 452 454 PASS Parsing: <C|?> against <file://host/dir/file> … … 461 463 PASS Parsing: <file:\c:\foo\bar> against <file:///c:/baz/qux> 462 464 PASS Parsing: </c:/foo/bar> against <file://host/path> 463 FAIL Parsing: <file://example.net/C:/> against <about:blank> assert_equals: href expected "file:///C:/" but got "file://example.net/C:/" 464 FAIL Parsing: <file://1.2.3.4/C:/> against <about:blank> assert_equals: href expected "file:///C:/" but got "file://1.2.3.4/C:/" 465 FAIL Parsing: <file://[1::8]/C:/> against <about:blank> assert_equals: href expected "file:///C:/" but got "file://[1::8]/C:/" 465 PASS Parsing: <file://example.net/C:/> against <about:blank> 466 PASS Parsing: <file://1.2.3.4/C:/> against <about:blank> 467 PASS Parsing: <file://[1::8]/C:/> against <about:blank> 466 468 PASS Parsing: <file:/C|/> against <about:blank> 467 469 PASS Parsing: <file://C|/> against <about:blank> … … 479 481 PASS Parsing: <file:///./y:> against <about:blank> 480 482 PASS Parsing: <\\\.\y:> against <about:blank> 483 PASS Parsing: <file://localhost//a//../..//foo> against <about:blank> 484 PASS Parsing: <file://localhost////foo> against <about:blank> 485 PASS Parsing: <file:////foo> against <about:blank> 486 PASS Parsing: <file:///one/two> against <file:///> 487 PASS Parsing: <file:////one/two> against <file:///> 488 PASS Parsing: <//one/two> against <file:///> 489 PASS Parsing: <///one/two> against <file:///> 490 PASS Parsing: <////one/two> against <file:///> 491 PASS Parsing: <file:///.//> against <file:////> 481 492 PASS Parsing: <http://[1:0::]> against <http://example.net/> 482 493 PASS Parsing: <http://[0:1:2:3:4:5:6:7:8]> against <http://example.net/> -
trunk/Source/WTF/ChangeLog
r267870 r267896 1 2020-10-02 Alex Christensen <achristensen@webkit.org> 2 3 Copy host from base file URL 4 https://bugs.webkit.org/show_bug.cgi?id=217170 5 6 Reviewed by Brady Eidson. 7 8 This matches Chrome and the URL specification. 9 Covered by newly passing web platform tests. 10 11 I also updated the web platform tests from https://github.com/web-platform-tests/wpt/pull/25716 12 which aligns with Safari in cases except copying of the host from base file URLs. 13 14 The implementation pushes copying from the base URL downstream in the parsing process to where it is in the URL specification 15 so that we can properly decide how much of the base URL to copy and so we can copy it into the right place in the result URL. 16 17 I also updated an assertion that makes sure that we re-use the input String if possible because there are cases where we copy 18 part of the parent URL, which is a "syntax violation" (meaning we copy the string parts and assemble a new one), then re-assemble 19 a new String that is equal to the input string. This is not a problem, it just needed to be reflected in the assertion. 20 21 * wtf/URLParser.cpp: 22 (WTF::URLParser::URLParser): 23 (WTF::URLParser::parse): 24 1 25 2020-10-02 Youenn Fablet <youenn@apple.com> 2 26 -
trunk/Source/WTF/wtf/URLParser.cpp
r267837 r267896 1075 1075 ASSERT(!m_url.m_isValid 1076 1076 || m_didSeeSyntaxViolation == (m_url.string() != input) 1077 || (input.isAllSpecialCharacters<isC0ControlOrSpace>() 1078 && m_url.m_string == base.m_string.left(base.m_queryEnd)));1077 || (input.isAllSpecialCharacters<isC0ControlOrSpace>() && m_url.m_string == base.m_string.left(base.m_queryEnd)) 1078 || (base.isValid() && base.protocolIs("file"))); 1079 1079 ASSERT(internalValuesConsistent(m_url)); 1080 1080 #if ASSERT_ENABLED … … 1266 1266 break; 1267 1267 } 1268 copyURLPartsUntil(base, URLPart::SchemeEnd, c, nonUTF8QueryEncoding);1269 appendToASCIIBuffer(':');1270 1268 state = State::File; 1271 1269 break; … … 1530 1528 copyURLPartsUntil(base, URLPart::PathAfterLastSlash, c, nonUTF8QueryEncoding); 1531 1529 else { 1532 appendToASCIIBuffer("///", 3); 1533 m_url.m_userStart = currentPosition(c) - 1; 1534 m_url.m_userEnd = m_url.m_userStart; 1535 m_url.m_passwordEnd = m_url.m_userStart; 1536 m_url.m_hostEnd = m_url.m_userStart; 1537 m_url.m_portLength = 0; 1538 m_url.m_pathAfterLastSlash = m_url.m_userStart + 1; 1530 bool copiedHost = false; 1531 if (base.isValid() && base.protocolIs("file")) { 1532 if (base.host().isEmpty()) { 1533 copyURLPartsUntil(base, URLPart::SchemeEnd, c, nonUTF8QueryEncoding); 1534 appendToASCIIBuffer(":///", 4); 1535 } else { 1536 copyURLPartsUntil(base, URLPart::PortEnd, c, nonUTF8QueryEncoding); 1537 appendToASCIIBuffer('/'); 1538 copiedHost = true; 1539 } 1540 } else 1541 appendToASCIIBuffer("///", 3); 1542 if (!copiedHost) { 1543 m_url.m_userStart = currentPosition(c) - 1; 1544 m_url.m_userEnd = m_url.m_userStart; 1545 m_url.m_passwordEnd = m_url.m_userStart; 1546 m_url.m_hostEnd = m_url.m_userStart; 1547 m_url.m_portLength = 0; 1548 } 1549 m_url.m_pathAfterLastSlash = m_url.m_hostEnd + 1; 1539 1550 if (isWindowsDriveLetter(c)) 1540 1551 appendWindowsDriveLetter(c); … … 1549 1560 if (UNLIKELY(*c == '\\')) 1550 1561 syntaxViolation(c); 1562 if (base.isValid() && base.protocolIs("file")) { 1563 copyURLPartsUntil(base, URLPart::SchemeEnd, c, nonUTF8QueryEncoding); 1564 appendToASCIIBuffer(":/", 2); 1565 } 1551 1566 appendToASCIIBuffer('/'); 1552 1567 advance(c); … … 1560 1575 break; 1561 1576 } 1562 syntaxViolation(c); 1563 appendToASCIIBuffer("//", 2); 1564 m_url.m_userStart = currentPosition(c) - 1; 1565 m_url.m_userEnd = m_url.m_userStart; 1566 m_url.m_passwordEnd = m_url.m_userStart; 1567 m_url.m_hostEnd = m_url.m_userStart; 1568 m_url.m_portLength = 0; 1577 { 1578 bool copiedHost = false; 1579 if (base.isValid() && base.protocolIs("file")) { 1580 if (base.host().isEmpty()) { 1581 copyURLPartsUntil(base, URLPart::SchemeEnd, c, nonUTF8QueryEncoding); 1582 appendToASCIIBuffer(":///", 4); 1583 } else { 1584 copyURLPartsUntil(base, URLPart::PortEnd, c, nonUTF8QueryEncoding); 1585 appendToASCIIBuffer('/'); 1586 copiedHost = true; 1587 } 1588 } else { 1589 syntaxViolation(c); 1590 appendToASCIIBuffer("//", 2); 1591 } 1592 if (!copiedHost) { 1593 m_url.m_userStart = currentPosition(c) - 1; 1594 m_url.m_userEnd = m_url.m_userStart; 1595 m_url.m_passwordEnd = m_url.m_userStart; 1596 m_url.m_hostEnd = m_url.m_userStart; 1597 m_url.m_portLength = 0; 1598 } 1599 } 1569 1600 if (isWindowsDriveLetter(c)) { 1570 1601 appendWindowsDriveLetter(c); 1571 m_url.m_pathAfterLastSlash = m_url.m_ userStart+ 1;1602 m_url.m_pathAfterLastSlash = m_url.m_hostEnd + 1; 1572 1603 } else if (copyBaseWindowsDriveLetter(base)) { 1573 1604 appendToASCIIBuffer('/'); 1574 m_url.m_pathAfterLastSlash = m_url.m_ userStart+ 4;1605 m_url.m_pathAfterLastSlash = m_url.m_hostEnd + 4; 1575 1606 } else 1576 m_url.m_pathAfterLastSlash = m_url.m_ userStart+ 1;1607 m_url.m_pathAfterLastSlash = m_url.m_hostEnd + 1; 1577 1608 state = State::Path; 1578 1609 break; … … 1865 1896 LOG_FINAL_STATE("FileSlash"); 1866 1897 syntaxViolation(c); 1867 m_url.m_userStart = currentPosition(c) + 1; 1868 appendToASCIIBuffer("//", 2); 1869 m_url.m_userEnd = m_url.m_userStart; 1870 m_url.m_passwordEnd = m_url.m_userStart; 1871 m_url.m_hostEnd = m_url.m_userStart; 1872 m_url.m_portLength = 0; 1898 { 1899 bool copiedHost = false; 1900 if (base.isValid() && base.protocolIs("file")) { 1901 if (base.host().isEmpty()) { 1902 copyURLPartsUntil(base, URLPart::SchemeEnd, c, nonUTF8QueryEncoding); 1903 appendToASCIIBuffer(":/", 2); 1904 } else { 1905 copyURLPartsUntil(base, URLPart::PortEnd, c, nonUTF8QueryEncoding); 1906 appendToASCIIBuffer('/'); 1907 copiedHost = true; 1908 } 1909 } 1910 if (!copiedHost) { 1911 m_url.m_userStart = currentPosition(c) + 1; 1912 appendToASCIIBuffer("//", 2); 1913 m_url.m_userEnd = m_url.m_userStart; 1914 m_url.m_passwordEnd = m_url.m_userStart; 1915 m_url.m_hostEnd = m_url.m_userStart; 1916 m_url.m_portLength = 0; 1917 } 1918 } 1873 1919 if (copyBaseWindowsDriveLetter(base)) { 1874 1920 appendToASCIIBuffer('/'); 1875 m_url.m_pathAfterLastSlash = m_url.m_ userStart+ 4;1921 m_url.m_pathAfterLastSlash = m_url.m_hostEnd + 4; 1876 1922 } else 1877 m_url.m_pathAfterLastSlash = m_url.m_ userStart+ 1;1923 m_url.m_pathAfterLastSlash = m_url.m_hostEnd + 1; 1878 1924 m_url.m_pathEnd = m_url.m_pathAfterLastSlash; 1879 1925 m_url.m_queryEnd = m_url.m_pathAfterLastSlash; … … 1957 2003 m_url.m_string = String::adopt(WTFMove(m_asciiBuffer)); 1958 2004 m_url.m_isValid = true; 1959 URL_PARSER_LOG("Parsed URL <%s> ", m_url.m_string.utf8().data());2005 URL_PARSER_LOG("Parsed URL <%s>\n\n", m_url.m_string.utf8().data()); 1960 2006 } 1961 2007
Note: See TracChangeset
for help on using the changeset viewer.