Sam Atkins
f9c9506997
WebContent: Create a separate realm for JS console input
...
This allows us to expose extra functions and properties to the console,
such as `$0`, without them being available to website scripts.
`ConsoleEnvironmentSettingsObject` is basically a stub, since we require
an `EnvironmentSettingsObject` but it has abstract methods.
2022-11-19 16:56:31 +00:00
Timothy Flynn
7398fd107c
WebContent: Add missing user prompt handling steps
...
The text on these steps is slightly different than when this was also
done in 0e94904034
, so these were missed.
2022-11-18 12:21:57 +00:00
Timothy Flynn
37c4bf3afd
WebDriver: Implement all modes for handling the current user prompt
2022-11-18 12:21:57 +00:00
Timothy Flynn
adc7977ec7
WebContent+WebDriver: Send the parsed capabilities over to WebContent
2022-11-18 12:21:57 +00:00
Timothy Flynn
f7bb835d09
LibWeb+LibWebView+WebContent+WebDriver: Implement Send Alert Text
2022-11-16 17:23:56 +00:00
Timothy Flynn
f9b8742fff
LibWeb+WebContent+WebDriver: Implement Get Alert Text
2022-11-16 17:23:56 +00:00
Timothy Flynn
3e7d633954
LibWeb+WebContent+WebDriver: Implement Accept Alert
2022-11-16 17:23:56 +00:00
Timothy Flynn
7cf2feb047
LibWeb+WebContent+WebDriver: Implement Dismiss Alert
2022-11-16 17:23:56 +00:00
Timothy Flynn
0e94904034
LibWebView+WebContent: Begin handling open user dialogs for WebDriver
...
The way in which dialogs should be handled is configurable by the driver
capabilities object, which we don't support yet. So this implements just
the default mode to dismiss the dialog and return an error if there is
one open.
In the OOPWV, this means we need to refer to the dialog after it has
been open, so we now hold a pointer to whatever dialog is open.
2022-11-16 17:23:56 +00:00
Timothy Flynn
364f44d7d8
LibWebView+WebContent: Wait for dialog responses without blocking IPC
...
Currently, the WebContent process is completely blocked while waiting
for a response to a dialog request. This patch allows the IPC event loop
to continue executing while only blocking the HTML event loop.
This will allow other processes like WebDriver to continue to operate on
the WebContent process while a dialog is open.
2022-11-16 17:23:56 +00:00
Idan Horowitz
798d7c6fae
LibWeb: Add 'should block pop ups' user config to Page
...
This will also be used by the window.open algorithm steps.
2022-11-15 21:48:19 +00:00
Timothy Flynn
4fd9e3ab08
Userland: Remove workarounds for LibIPC include order sensitivity
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
826d5f8f9a
WebContent+WebDriver: Move Window commands to WebContent
...
This moves Get Window Handle, Close Window, and Get Window Handles over
to WebContent so they may be implemented closer to the spec and be used
by Ladybird.
2022-11-14 13:43:24 -05:00
Timothy Flynn
4d4ed96fa1
WebContent: Provide access to ConnectionFromClient's PageHost
...
This is needed to construct a WebDriverConnection from outside of
PageHost itself in Ladybird.
2022-11-14 13:43:24 -05:00
Timothy Flynn
d2b2d3ad80
WebContent: Allow creating a WebDriverConnection with an existing socket
...
The socket used by WebDriverConnection will be created separately for
Ladybird.
2022-11-14 13:43:24 -05: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
Tobias Christiansen
1aa16b4dd4
WebDriver: Implement POST /session/{id}/window/fullscreen
endpoint
2022-11-12 12:12:05 +00:00
Timothy Flynn
6a55370401
WebContent: Pass the script timeout into the WebDriver script executor
...
This was dropped in 0b9803d
and 31469ee
before the timeouts object was
avaiable in WebContent.
2022-11-11 22:03:23 +00:00
Timothy Flynn
04f41bda52
WebContent+WebDriver: Move Get/Set Timeouts to WebContent
2022-11-11 22:03:23 +00:00
Timothy Flynn
2c9549cb76
Browser+WebContent+WebDriver: Move Get Title to WebContent
2022-11-11 22:03:23 +00:00
Timothy Flynn
7f142745e2
Browser+WebContent+WebDriver: Move Back, Forward, Refresh to WebContent
2022-11-11 22:03:23 +00:00
Timothy Flynn
24fb7cd0ad
LibWebView+WebContent: Add IPCs to navigate the browser's history
2022-11-11 22:03:23 +00:00
Timothy Flynn
ff6055e0a3
Browser+WebContent+WebDriver: Move Delete All Cookies to WebContent
2022-11-11 18:02:04 +00:00
Timothy Flynn
b7f21bb92e
Browser+WebContent+WebDriver: Move Delete Cookie to WebContent
2022-11-11 18:02:04 +00:00
Timothy Flynn
d202999853
LibWebView+WebContent: Add IPC to update a document's cookie
2022-11-11 18:02:04 +00:00
Timothy Flynn
18abc6c85d
Browser+WebContent+WebDriver: Move Add Cookie to WebContent
...
The new implementation is made a bit simpler by way of TRY. It also
implements setting the SameSite attribute.
2022-11-11 18:02:04 +00:00
Timothy Flynn
a3d6c2f6af
Browser+WebContent+WebDriver: Move Get Named Cookie to WebContent
...
Instead of sending *all* cookies over IPC and filtering by name, we now
filter by name from the cookie jar and send just the first matching
cookie.
2022-11-11 18:02:04 +00:00
Timothy Flynn
c6a0888088
LibWebView+WebContent: Add IPC to get a document's named cookie
2022-11-11 18:02:04 +00:00
Timothy Flynn
c77260c480
Browser+WebContent+WebDriver: Move Get All Cookies to WebContent
...
There are a couple changes here from the existing Get All Cookies
implementation.
1. Previously, WebDriver actually returned *all* cookies in the cookie
jar. The spec dictates that we only return cookies that match the
document's URL. Specifically, it calls out that we must run just the
first step of RFC 6265 section 5.4 to perform domain matching.
This change adds a special mode to our implementation of that section
to skip the remaining steps.
2. We now fill in the SameSite cookie attribute when serializing the
cookie to JSON (this was a trival FIXME that didn't get picked up
when SameSite was implemented).
2022-11-11 18:02:04 +00:00
Timothy Flynn
d2c1957d8f
LibWebView+WebContent: Add IPC to get all cookies for a document's URL
2022-11-11 18:02:04 +00:00
Timothy Flynn
31469ee45a
Browser+WebContent+WebDriver: Move Execute Async Script to WebContent
...
With this, WebDriverEndpoints is unused and removed :^)
2022-11-11 11:36:07 +00:00
Timothy Flynn
0b9803dc93
WebContent+WebDriver: Move Execute Script to WebContent
2022-11-11 11:36:07 +00:00
Timothy Flynn
88dcdf681f
Browser+WebContent+WebDriver: Move Get Page Source to WebContent
2022-11-11 11:36:07 +00:00
Timothy Flynn
561f9f36f7
WebContent: Capture entire content rect when taking a full screenshot
...
Instead of offsetting the screenshot by the position of the document
element, just take a screenshot of the entire content rect. After
looking at Acid3 a bit more, this more accurately represents what the
user actually sees on the webpage.
2022-11-11 11:36:07 +00:00
Timothy Flynn
ea0561a0b3
Browser+WebContent+WebDriver: Move Take Element Screenshot to WebContent
2022-11-11 11:36:07 +00:00
Timothy Flynn
de1e882601
Browser+WebContent+WebDriver: Move Take Screenshot to WebContent
2022-11-11 11:36:07 +00:00
Timothy Flynn
93e14799c5
Browser+WebContent+WebDriver: Move Is Element Enabled to WebContent
2022-11-10 17:02:11 +00:00
Timothy Flynn
30d6a73d0e
Browser+WebContent+WebDriver: Move Get Element Rect to WebContent
2022-11-10 17:02:11 +00:00
Timothy Flynn
9dd62228c8
Browser+WebContent+WebDriver: Move Get Element Tag Name to WebContent
2022-11-10 17:02:11 +00:00
Timothy Flynn
5d32fd7026
Browser+WebContent+WebDriver: Move Get Element Text to WebContent
2022-11-10 17:02:11 +00:00
Timothy Flynn
06f1b8825c
Browser+WebContent+WebDriver: Move Get Element CSS Value to WebContent
2022-11-10 17:02:11 +00:00
Timothy Flynn
3c00d0e92b
Browser+WebContent+WebDriver: Move Get Element Property to WebContent
2022-11-10 17:02:11 +00:00
Timothy Flynn
1bc94e135f
Browser+WebContent+WebDriver: Move Get Element Attribute to WebContent
...
In doing so, this also implements a FIXME to handle boolean attributes.
2022-11-10 17:02:11 +00:00
Timothy Flynn
7b1f3b7253
WebContent: Return a DOM::Element when getting a known connected element
...
This is how WebContent::ConnectionFromClient also behaves. Returning the
element as a DOM::ParentNode isn't quite strict enough for upcoming
endpoints.
2022-11-10 17:02:11 +00:00
Timothy Flynn
04ea3992e9
Browser+WebContent+WebDriver: Move Is Element Selected to WebContent
2022-11-10 17:02:11 +00:00
Timothy Flynn
560da56a1d
Browser+WebContent+WebDriver: Move Find Elements From Element to WC
...
This also lets us remove the element location strategy and some
WebContent IPC from Browser/LibWebView now that they are unused.
2022-11-10 13:10:16 +00:00