Commit Graph

16 Commits

Author SHA1 Message Date
Andreas Kling
8b1108e485 Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01:00
Timothy Flynn
c19c306744 LibWeb: Convert all generated bindings to ThrowCompletionOr
This also required converting URLSearchParams::for_each and the callback
function it invokes to ThrowCompletionOr. With this, the ReturnType enum
used by WrapperGenerator is removed as all callers would be using
ReturnType::Completion.
2021-10-31 15:48:36 +01:00
Luke Wilde
fb321bad35 LibWeb: Implement URLSearchParams.getAll 2021-10-26 23:11:57 +02:00
Andreas Kling
ba0c907a6f LibWeb: Make the URL.port setter return after assigning the empty string
This matches the spec ("3. Otherwise, ...")
2021-10-03 21:31:46 +02:00
Idan Horowitz
01417c82c5 LibWeb: Make URLSearchParams iterable
This uses the new support for the iterable IDL property.
2021-09-28 16:51:27 +02:00
Idan Horowitz
ed5128d759 LibWeb: Add the URL::{protocol, pathname, search, hash} attributes 2021-09-14 00:14:45 +02:00
Idan Horowitz
7f9818bcbc LibWeb: Add the URL::host, URL::hostname & URL:port attributes 2021-09-14 00:14:45 +02:00
Idan Horowitz
e89320887e LibWeb: Add the URL::username, URL::password & URL::origin attributes 2021-09-14 00:14:45 +02:00
Idan Horowitz
fe32c9c3bd LibWeb: Add the URL::searchParams attribute 2021-09-14 00:14:45 +02:00
Idan Horowitz
1841fbd3e4 LibWeb: Add the URL::href attribute and URL::to_json method 2021-09-14 00:14:45 +02:00
Idan Horowitz
e6abc1b44e LibWeb: Add a bare implementation of the URL built-in
This only has the constructor implemented for now.
2021-09-14 00:14:45 +02:00
Idan Horowitz
af5b62d8cd LibWeb: Move url_{encode, decode} to URL/URLSearchParams.{h, cpp}
The new URL built-in that will reside in URL.{h, cpp} will have an
URLSearchParams member, which means it has to include its header, and
as such URLSearchParams.h can't include URL's header, which it needs as
it uses the url_{encode, decode} functions.
2021-09-14 00:14:45 +02:00
Brian Gianforcaro
7852b0fbc3 LibWeb: Identical sub-expression bug in URLSearchParams::set
Flagged by sonarcloud, we appear to want to make sure the entry.name
matches the name we are searching for duplicates of.

Link:
https://sonarcloud.io/project/issues?fileUuids=AXvdC606QRvsO1F91p5C&id=SerenityOS_serenity&open=AXvdC_NEQRvsO1F91p6j
2021-09-13 14:05:22 +00:00
Idan Horowitz
f21041861b LibWeb: Add the URLSearchParams built-in
This is a very partial implementation, as some features (like 2 of the
possible constructor types, iteration and the getAll method) are
missing, and other's are not implemented due to the currently missing
URL built-in.
2021-09-13 01:43:10 +02:00
Idan Horowitz
de19dcf81a LibWeb: Add URL::url_decode for decoding form url encoded parameters 2021-09-13 01:43:10 +02:00
Idan Horowitz
4629f2e4ad LibWeb: Add the Web::URL namespace and move URLEncoder to it
This namespace will be used for all interfaces defined in the URL
specification, like URL and URLSearchParams.

This has the unfortunate side-effect of requiring us to use the fully
qualified AK::URL name whenever we want to refer to the AK class, so
this commit also fixes all such references.
2021-09-13 01:43:10 +02:00