mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 19:45:12 +00:00
LibWeb: Add the URL::searchParams attribute
This commit is contained in:
parent
1841fbd3e4
commit
fe32c9c3bd
Notes:
sideshowbarker
2024-07-18 03:59:13 +09:00
Author: https://github.com/IdanHo Commit: https://github.com/SerenityOS/serenity/commit/fe32c9c3bd4 Pull-request: https://github.com/SerenityOS/serenity/pull/10022
5 changed files with 15 additions and 1 deletions
|
@ -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>
|
||||
|
|
|
@ -75,4 +75,9 @@ DOM::ExceptionOr<void> URL::set_href(String const& href)
|
|||
return {};
|
||||
}
|
||||
|
||||
URLSearchParams const* URL::search_params() const
|
||||
{
|
||||
return m_query;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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)); }
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -55,3 +55,9 @@ private:
|
|||
};
|
||||
|
||||
}
|
||||
|
||||
namespace Web::Bindings {
|
||||
|
||||
URLSearchParamsWrapper* wrap(JS::GlobalObject&, URL::URLSearchParams&);
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue