mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Implement URLSearchParams::getAll
This commit is contained in:
parent
4cb2c87982
commit
29b14d4b3d
4 changed files with 13 additions and 16 deletions
|
@ -87,6 +87,18 @@ impl URLSearchParamsMethods for URLSearchParams {
|
|||
}).next()
|
||||
}
|
||||
|
||||
// https://url.spec.whatwg.org/#dom-urlsearchparams-getall
|
||||
fn GetAll(&self, name: USVString) -> Vec<USVString> {
|
||||
let list = self.list.borrow();
|
||||
list.iter().filter_map(|&(ref k, ref v)| {
|
||||
if k == &name.0 {
|
||||
Some(USVString(v.clone()))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}).collect()
|
||||
}
|
||||
|
||||
// https://url.spec.whatwg.org/#dom-urlsearchparams-has
|
||||
fn Has(&self, name: USVString) -> bool {
|
||||
let list = self.list.borrow();
|
||||
|
|
|
@ -12,7 +12,7 @@ interface URLSearchParams {
|
|||
void append(USVString name, USVString value);
|
||||
void delete(USVString name);
|
||||
USVString? get(USVString name);
|
||||
// sequence<USVString> getAll(USVString name);
|
||||
sequence<USVString> getAll(USVString name);
|
||||
boolean has(USVString name);
|
||||
void set(USVString name, USVString value);
|
||||
// iterable<USVString, USVString>;
|
||||
|
|
|
@ -15,12 +15,5 @@
|
|||
[URL interface: new URL("http://foo") must inherit property "searchParams" with the proper type (12)]
|
||||
expected: FAIL
|
||||
|
||||
[URLSearchParams interface: operation getAll(ScalarValueString)]
|
||||
expected: FAIL
|
||||
|
||||
[URL interface: operation domainToUnicode(USVString)]
|
||||
expected: FAIL
|
||||
|
||||
[URLSearchParams interface: operation getAll(USVString)]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
[urlsearchparams-getall.html]
|
||||
type: testharness
|
||||
[getAll() basics]
|
||||
expected: FAIL
|
||||
|
||||
[getAll() multiples]
|
||||
expected: FAIL
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue