mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Auto merge of #29455 - 2shiori17:issue-29425, r=mukilan
Implement URLSearchParams's size <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #29425 <!-- Either: --> - [x] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
This commit is contained in:
commit
a516281d7d
3 changed files with 6 additions and 26 deletions
|
@ -91,6 +91,11 @@ impl URLSearchParams {
|
|||
}
|
||||
|
||||
impl URLSearchParamsMethods for URLSearchParams {
|
||||
// https://url.spec.whatwg.org/#dom-urlsearchparams-size
|
||||
fn Size(&self) -> u32 {
|
||||
self.list.borrow().len() as u32
|
||||
}
|
||||
|
||||
// https://url.spec.whatwg.org/#dom-urlsearchparams-append
|
||||
fn Append(&self, name: USVString, value: USVString) {
|
||||
// Step 1.
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
[Exposed=(Window,Worker)]
|
||||
interface URLSearchParams {
|
||||
[Throws] constructor(optional (sequence<sequence<USVString>> or record<USVString, USVString> or USVString) init = "");
|
||||
readonly attribute unsigned long size;
|
||||
undefined append(USVString name, USVString value);
|
||||
undefined delete(USVString name);
|
||||
USVString? get(USVString name);
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
[urlsearchparams-size.any.html]
|
||||
[URLSearchParams's size and deletion]
|
||||
expected: FAIL
|
||||
|
||||
[URLSearchParams's size and addition]
|
||||
expected: FAIL
|
||||
|
||||
[URLSearchParams's size when obtained from a URL]
|
||||
expected: FAIL
|
||||
|
||||
[URLSearchParams's size when obtained from a URL and using .search]
|
||||
expected: FAIL
|
||||
|
||||
|
||||
[urlsearchparams-size.any.worker.html]
|
||||
[URLSearchParams's size and deletion]
|
||||
expected: FAIL
|
||||
|
||||
[URLSearchParams's size and addition]
|
||||
expected: FAIL
|
||||
|
||||
[URLSearchParams's size when obtained from a URL]
|
||||
expected: FAIL
|
||||
|
||||
[URLSearchParams's size when obtained from a URL and using .search]
|
||||
expected: FAIL
|
Loading…
Add table
Add a link
Reference in a new issue