mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 01:20:25 +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:
parent
e231f72f61
commit
3e2ceef8c3
Notes:
sideshowbarker
2024-07-17 07:09:53 +09:00
Author: https://github.com/CanadaHonk 🔰 Commit: https://github.com/SerenityOS/serenity/commit/3e2ceef8c3 Pull-request: https://github.com/SerenityOS/serenity/pull/17578 Reviewed-by: https://github.com/awesomekling Reviewed-by: https://github.com/linusg
3 changed files with 10 additions and 0 deletions
|
@ -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 this’s list’s 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.
|
||||
|
|
|
@ -28,6 +28,7 @@ public:
|
|||
|
||||
virtual ~URLSearchParams() override;
|
||||
|
||||
size_t size() const;
|
||||
void append(DeprecatedString const& name, DeprecatedString const& value);
|
||||
void delete_(DeprecatedString const& name);
|
||||
DeprecatedString get(DeprecatedString const& name);
|
||||
|
|
|
@ -4,6 +4,8 @@ interface URLSearchParams {
|
|||
|
||||
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);
|
||||
|
|
Loading…
Reference in a new issue