Commit Graph

14 Commits

Author SHA1 Message Date
Timothy Flynn
05f41382bb Userland: Properly define IPC::encode and IPC::decode specializations
In order to avoid the base encode/decode methods from being used (and
failing a static assertion), we must be sure to declare/define the
custom type implementations as template specializations.

After this, LibIPC is no longer sensitive to include order.
2022-11-15 13:25:51 -05:00
Timothy Flynn
8e624c8f6d LibWeb+WebContent+WebDriver: Implement Find Elements From Shadow Root 2022-11-15 11:55:36 +00:00
Timothy Flynn
6d9bd04233 LibWeb+WebContent+WebDriver: Implement Find Element From Shadow Root 2022-11-15 11:55:36 +00:00
Timothy Flynn
4d9fd5d190 LibWeb+WebContent+WebDriver: Implement Get Element Shadow Root 2022-11-15 11:55:36 +00:00
Timothy Flynn
cb91e6067c LibWeb+WebContent+WebDriver: Implement Get Active Element
Unfortunately, nothing ever calls DOM::Document::set_active_element at
the moment, so this will always return ErrorCode::NoSuchElement.
2022-11-15 11:55:36 +00:00
Timothy Flynn
9fbc4138bb LibWeb: Define the route for the Fullscreen Window command
This was missed in 4eefa292df.
2022-11-14 00:05:15 +00:00
Timothy Flynn
5385cb1287 LibWeb+WebContentr+WebDriver: Move driver response wrapping to LibWeb
Success responses are meant to be wrapped in a JSON object with a single
"value" key. Instead of doing this in both WebContent and WebDriver, do
it once in LibWeb.
2022-11-13 16:41:07 +00:00
Timothy Flynn
4eefa292df LibWeb: Re-implement WebDriver endpoint handling within Web::WebDriver
This moves communication and route matching for WebDriver endpoints into
LibWeb. This is to reduce the amount of duplication required to create a
WebDriver implementation for Ladybird.

In doing so, this introduces some cleanup of WebDriver handling. Routes
are now a compile-time array, and matching a route is nearly free of
allocations (we still allocate a Vector for parsed parameters). This
implementation also makes heavier use of TRY semantics to propagate
errors into one handler.
2022-11-13 16:41:07 +00:00
Timothy Flynn
cb4b9108d1 LibWeb+WebDriver: Move the timeouts configuration object to LibWeb 2022-11-11 22:03:23 +00:00
Timothy Flynn
40b9d248be LibWeb: Implement screenshot painting inside Web::WebDriver
This will allow for implementing the screenshot action closer to the
spec, as we can now use HTMLCanvasElement to encode the bitmap, and
capture the screenshot on the animation frame loop.
2022-11-11 11:36:07 +00:00
Timothy Flynn
15916e5c14 LibWeb: Implement the element location strategies in Web::WebDriver 2022-11-10 13:10:16 +00:00
Timothy Flynn
8ae10ba0fd LibWeb+WebDriver: Add an IPC-transferable Web::WebDriver::Response class
This is essentially an ErrorOr<JsonValue, Web::WebDriver::Error> class.
Unfortunately, that ErrorOr would not be default-constructible, which is
required for the generated IPC classes. So this is a thin wrapper around
a Variant<JsonValue, Web::WebDriver::Error> to emulate ErrorOr.
2022-11-08 19:58:34 -05:00
Timothy Flynn
0246abec80 LibWeb+WebDriver: Move WebDriverError to Web::WebDriver::Error
This is to prepare for WebContent becoming the WebDriver client.
2022-11-08 19:58:34 -05:00
Linus Groh
b572a91a6f LibWeb+WebContent: Add WebDriver infrastructure for executing scripts
This cannot be done on the Browser or WebDriver ends, or via the
existing run_javascript() IPC endpoint, as we cannot transfer JS objects
through the IPC boundary (yet), only serialized JSON, so the individual
WebDriver steps around script execution need to run in the WebContent
process.
2022-11-02 23:46:30 +00:00