LibWeb: Add the URL::searchParams attribute

This commit is contained in:
Idan Horowitz 2021-09-14 00:15:41 +03:00 committed by Andreas Kling
parent 1841fbd3e4
commit fe32c9c3bd
Notes: sideshowbarker 2024-07-18 03:59:13 +09:00
5 changed files with 15 additions and 1 deletions

View file

@ -1481,6 +1481,7 @@ void generate_prototype_implementation(IDL::Interface const& interface)
#include <LibWeb/Bindings/RangeWrapper.h>
#include <LibWeb/Bindings/StyleSheetListWrapper.h>
#include <LibWeb/Bindings/TextWrapper.h>
#include <LibWeb/Bindings/URLSearchParamsWrapper.h>
#include <LibWeb/Bindings/WindowObject.h>
#include <LibWeb/DOM/Element.h>
#include <LibWeb/DOM/EventListener.h>

View file

@ -75,4 +75,9 @@ DOM::ExceptionOr<void> URL::set_href(String const& href)
return {};
}
URLSearchParams const* URL::search_params() const
{
return m_query;
}
}

View file

@ -31,6 +31,8 @@ public:
String href() const;
DOM::ExceptionOr<void> set_href(String const&);
URLSearchParams const* search_params() const;
String to_json() const;
void set_query(Badge<URLSearchParams>, String query) { m_url.set_query(move(query)); }

View file

@ -11,7 +11,7 @@ interface URL {
// TODO: attribute USVString port;
// TODO: attribute USVString pathname;
// TODO: attribute USVString search;
// TODO: [SameObject] readonly attribute URLSearchParams searchParams;
[SameObject] readonly attribute URLSearchParams searchParams;
// TODO: attribute USVString hash;
USVString toJSON();

View file

@ -55,3 +55,9 @@ private:
};
}
namespace Web::Bindings {
URLSearchParamsWrapper* wrap(JS::GlobalObject&, URL::URLSearchParams&);
}