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=252749 rdar://105781287 Reviewed by Darin Adler. Add support for URLSearchParams.size: - whatwg/url#734 - web-platform-tests/wpt#38655 * LayoutTests/imported/w3c/web-platform-tests/url/urlsearchparams-size.any-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/url/urlsearchparams-size.any.html: Added. * LayoutTests/imported/w3c/web-platform-tests/url/urlsearchparams-size.any.js: Added. (test): * LayoutTests/imported/w3c/web-platform-tests/url/urlsearchparams-size.any.worker-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/url/urlsearchparams-size.any.worker.html: Added. * Source/WebCore/html/URLSearchParams.h: (WebCore::URLSearchParams::size const): * Source/WebCore/html/URLSearchParams.idl: Canonical link: https://commits.webkit.org/260836@main
- Loading branch information
Showing
7 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
LayoutTests/imported/w3c/web-platform-tests/url/urlsearchparams-size.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,6 @@ | ||
|
||
PASS URLSearchParams's size and deletion | ||
PASS URLSearchParams's size and addition | ||
PASS URLSearchParams's size when obtained from a URL | ||
PASS URLSearchParams's size when obtained from a URL and using .search | ||
|
1 change: 1 addition & 0 deletions
1
LayoutTests/imported/w3c/web-platform-tests/url/urlsearchparams-size.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 --> |
34 changes: 34 additions & 0 deletions
34
LayoutTests/imported/w3c/web-platform-tests/url/urlsearchparams-size.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,34 @@ | ||
test(() => { | ||
const params = new URLSearchParams("a=1&b=2&a=3"); | ||
assert_equals(params.size, 3); | ||
|
||
params.delete("a"); | ||
assert_equals(params.size, 1); | ||
}, "URLSearchParams's size and deletion"); | ||
|
||
test(() => { | ||
const params = new URLSearchParams("a=1&b=2&a=3"); | ||
assert_equals(params.size, 3); | ||
|
||
params.append("b", "4"); | ||
assert_equals(params.size, 4); | ||
}, "URLSearchParams's size and addition"); | ||
|
||
test(() => { | ||
const url = new URL("http://localhost/query?a=1&b=2&a=3"); | ||
assert_equals(url.searchParams.size, 3); | ||
|
||
url.searchParams.delete("a"); | ||
assert_equals(url.searchParams.size, 1); | ||
|
||
url.searchParams.append("b", 4); | ||
assert_equals(url.searchParams.size, 2); | ||
}, "URLSearchParams's size when obtained from a URL"); | ||
|
||
test(() => { | ||
const url = new URL("http://localhost/query?a=1&b=2&a=3"); | ||
assert_equals(url.searchParams.size, 3); | ||
|
||
url.search = "?"; | ||
assert_equals(url.searchParams.size, 0); | ||
}, "URLSearchParams's size when obtained from a URL and using .search"); |
6 changes: 6 additions & 0 deletions
6
LayoutTests/imported/w3c/web-platform-tests/url/urlsearchparams-size.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,6 @@ | ||
|
||
PASS URLSearchParams's size and deletion | ||
PASS URLSearchParams's size and addition | ||
PASS URLSearchParams's size when obtained from a URL | ||
PASS URLSearchParams's size when obtained from a URL and using .search | ||
|
1 change: 1 addition & 0 deletions
1
LayoutTests/imported/w3c/web-platform-tests/url/urlsearchparams-size.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