forked from WebKit/WebKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
https://bugs.webkit.org/show_bug.cgi?id=271636 Reviewed by Alex Christensen. This was standardized in whatwg/url#825 and test coverage was added here: web-platform-tests/wpt#45248 As a drive-by fix we remove m_baseURL from DOMURL as it does not need it. * LayoutTests/imported/w3c/web-platform-tests/url/url-statics-parse.any-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/url/url-statics-parse.any.html: Added. * LayoutTests/imported/w3c/web-platform-tests/url/url-statics-parse.any.js: Added. (forEach): (test): * LayoutTests/imported/w3c/web-platform-tests/url/url-statics-parse.any.worker-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/url/url-statics-parse.any.worker.html: Added. * LayoutTests/imported/w3c/web-platform-tests/url/w3c-import.log: * Source/WebCore/html/DOMURL.cpp: (WebCore::DOMURL::DOMURL): (WebCore::DOMURL::create): (WebCore::parseInternal): (WebCore::DOMURL::parse): (WebCore::DOMURL::canParse): * Source/WebCore/html/DOMURL.h: * Source/WebCore/html/DOMURL.idl: Canonical link: https://commits.webkit.org/276656@main
- Loading branch information
Showing
9 changed files
with
96 additions
and
10 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
LayoutTests/imported/w3c/web-platform-tests/url/url-statics-parse.any-expected.txt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
PASS URL.parse(undefined, undefined) | ||
PASS URL.parse(aaa:b, undefined) | ||
PASS URL.parse(undefined, aaa:b) | ||
PASS URL.parse(aaa:/b, undefined) | ||
PASS URL.parse(undefined, aaa:/b) | ||
PASS URL.parse(https://test:test, undefined) | ||
PASS URL.parse(a, https://b/) | ||
PASS URL.parse() should return a unique object | ||
|
1 change: 1 addition & 0 deletions
1
LayoutTests/imported/w3c/web-platform-tests/url/url-statics-parse.any.html
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<!-- This file is required for WebKit test infrastructure to run the templated test --> |
50 changes: 50 additions & 0 deletions
50
LayoutTests/imported/w3c/web-platform-tests/url/url-statics-parse.any.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// This intentionally does not use resources/urltestdata.json to preserve resources. | ||
[ | ||
{ | ||
"url": undefined, | ||
"base": undefined, | ||
"expected": false | ||
}, | ||
{ | ||
"url": "aaa:b", | ||
"base": undefined, | ||
"expected": true | ||
}, | ||
{ | ||
"url": undefined, | ||
"base": "aaa:b", | ||
"expected": false | ||
}, | ||
{ | ||
"url": "aaa:/b", | ||
"base": undefined, | ||
"expected": true | ||
}, | ||
{ | ||
"url": undefined, | ||
"base": "aaa:/b", | ||
"expected": true | ||
}, | ||
{ | ||
"url": "https://test:test", | ||
"base": undefined, | ||
"expected": false | ||
}, | ||
{ | ||
"url": "a", | ||
"base": "https://b/", | ||
"expected": true | ||
} | ||
].forEach(({ url, base, expected }) => { | ||
test(() => { | ||
if (expected == false) { | ||
assert_equals(URL.parse(url, base), null); | ||
} else { | ||
assert_equals(URL.parse(url, base).href, new URL(url, base).href); | ||
} | ||
}, `URL.parse(${url}, ${base})`); | ||
}); | ||
|
||
test(() => { | ||
assert_not_equals(URL.parse("https://example/"), URL.parse("https://example/")); | ||
}, `URL.parse() should return a unique object`); |
10 changes: 10 additions & 0 deletions
10
LayoutTests/imported/w3c/web-platform-tests/url/url-statics-parse.any.worker-expected.txt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
PASS URL.parse(undefined, undefined) | ||
PASS URL.parse(aaa:b, undefined) | ||
PASS URL.parse(undefined, aaa:b) | ||
PASS URL.parse(aaa:/b, undefined) | ||
PASS URL.parse(undefined, aaa:/b) | ||
PASS URL.parse(https://test:test, undefined) | ||
PASS URL.parse(a, https://b/) | ||
PASS URL.parse() should return a unique object | ||
|
1 change: 1 addition & 0 deletions
1
LayoutTests/imported/w3c/web-platform-tests/url/url-statics-parse.any.worker.html
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<!-- This file is required for WebKit test infrastructure to run the templated test --> |
This file contains 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
This file contains 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
This file contains 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
This file contains 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