1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:17:35 +00:00

LibWeb: Add size to URLSearchParams

Added new size parameter to URLSearchParams.

Spec: https://url.spec.whatwg.org/#dom-urlsearchparams-size
Co-Authored-By: Linus Groh <mail@linusgroh.de>
This commit is contained in:
CanadaHonk 2023-02-23 13:32:08 +00:00 committed by Linus Groh
parent e231f72f61
commit 3e2ceef8c3
3 changed files with 10 additions and 0 deletions

View file

@ -149,6 +149,13 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<URLSearchParams>> URLSearchParams::construc
return URLSearchParams::create(realm, url_decode(stripped_init));
}
// https://url.spec.whatwg.org/#dom-urlsearchparams-size
size_t URLSearchParams::size() const
{
// The size getter steps are to return thiss lists size.
return m_list.size();
}
void URLSearchParams::append(DeprecatedString const& name, DeprecatedString const& value)
{
// 1. Append a new name-value pair whose name is name and value is value, to list.