Commit Graph

1853 Commits

Author SHA1 Message Date
Kenneth Myhra
ad5cbdc51b LibWeb: Port {Mouse,UI,Wheel,}Event to new String
This ports MouseEvent, UIEvent, WheelEvent, and Event to new String.
They all had a dependency to T::create() in
WebDriverConnection::fire_an_event() and therefore had to be ported in
the same commit.
2023-04-07 22:41:01 +02:00
Ali Mohammad Pur
7375beced3 LookupServer: Put upstream DNS responses in cache 2023-04-02 20:42:39 +02:00
Sam Atkins
97b3f1230b WebServer: Propagate more errors
Use try_append() instead of append().
2023-03-27 20:29:51 +01:00
Sam Atkins
7dfe1f9f8f WebServer: Use relative URLs for the directory listing
This fixes an issue found on Linus's hosted WebServer. Now, if WebServer
is hosted at a non-root URL. (eg, `example.com/webserver` instead of
`example.com`) the links will correctly go to
`example.com/webserver/foo` instead of `example.com/foo`.
2023-03-27 20:29:51 +01:00
Sam Atkins
cce5e3158f WebServer: Handle incomplete HTTP requests
Mostly by copying the code in LibWeb/WebDriver/Client.cpp
2023-03-27 20:29:51 +01:00
MacDue
cf730403ea WindowServer: Allow updating the name of a menu 2023-03-26 21:55:21 +01:00
MacDue
952f6bbb2a WindowServer: Rename menu_title to name in IPC API
This is referred to as the name everywhere else, so we should be
consistent here.
2023-03-26 21:55:21 +01:00
Aliaksandr Kalenik
9220cdc285 LibHTTP+WebDriver+WebServer: Return error from HTTP request parser 2023-03-26 17:56:17 +02:00
MacDue
43529ea25e Taskbar: Use Process::spawn_or_show_error() for shutdown actions 2023-03-24 22:06:38 +00:00
MacDue
e46b9c189e Taskbar: Use Process::spawn_or_show_error() to open the "Run" dialog 2023-03-24 22:06:38 +00:00
MacDue
c9043280ec Taskbar: Use GUI::Process::spawn_or_show_error() to launch apps
And while here make a partial fix for launching terminal apps that
require root and contain spaces in their name/path.
2023-03-24 22:06:38 +00:00
MacDue
0af3e37f5d KeyboardPreferenceLoader: Use Core::Process::spawn() to set keymap 2023-03-24 22:06:38 +00:00
MacDue
ceffca9a75 WebDriver: Use Core::Process::spawn() to launch browsers 2023-03-24 22:06:38 +00:00
Aliaksandr Kalenik
34224c42ef WebDriver: Unlink server socket before binding to it
Previously, the create_server function would fail with an "Address
already in use" error if a file that used for socket address is
already exists.
2023-03-23 19:38:44 +01:00
huttongrabiel
6a5c561a41 FileSystemAccessServer: Implement FileTypeFilter to open_file()
This is the same functionality as in FilePicker. It allows the
specification of what file types are allowed.
2023-03-22 22:33:19 +00:00
Timothy Flynn
1b811191cd LibWeb+WebContent: Change the "noopener" storage type to a named enum 2023-03-22 00:12:53 +01:00
Lucas CHOLLET
496b7ffb2b LibGfx: Move all image loaders and writers to a subdirectory 2023-03-21 22:39:25 +01:00
Cameron Youell
1d24f394c6 Everywhere: Use LibFileSystem where trivial 2023-03-21 19:03:21 +00:00
Timothy Flynn
a96ba912b3 WebDriver: Activate the browser tab during the Switch To Window command 2023-03-21 09:39:49 +00:00
Timothy Flynn
f8b6369c23 WebContent+Everywhere: Add a WebContent IPC to activate a tab 2023-03-21 09:39:49 +00:00
Timothy Flynn
a77daf77bd WebDriver: Do not activate tabs created by the New Window endpoint
The spec states that creating new windows "must be done without invoking
the focusing steps for the created browsing context". It also states we
should do so by "running the window open steps", but nowhere in those
steps is there an option to invoke or skip any focusing steps. So we do
so with a custom WebContent IPC parameter.
2023-03-21 09:39:49 +00:00
Timothy Flynn
e6fc35897f WebContent+Everywhere: Add an option to not activate new tabs over IPC
WebDriver, for example, will want to create new tabs without activating
them.
2023-03-21 09:39:49 +00:00
Aliaksandr Kalenik
16a4949e33 WebDriver: Fix handling of disconnected WebContent process
If WebContent process got disconnected it is only necessary to remove
associated window instead of terminating the entire session.
2023-03-19 14:51:40 +01:00
Aliaksandr Kalenik
7146c33522 WebDriver: Close all WebContent connections while destroying a session
While closing a session, it is necessary to close all windows that may
have been opened during that session.
2023-03-19 14:51:40 +01:00
Aliaksandr Kalenik
63c16ff41a WebDriver: Inline Sesssion::stop() in session destructor
Previously it was possible to have following sequence of calls
while destroying a session:
1. `WebContentConnection::die()` calls `Client::close_session()`
2. `Client::close_session()` removes a session from active sessions
map which causes session destructor call.
3. Session destructor calls `Client::close_session()` to remove a
session from active sessions.

With `stop()` method inlined into destructor `close_session()` need
to be called just once while destroying a session.
2023-03-19 14:51:40 +01:00
Andreas Kling
72d817d4ea LibWeb+Browser+Ladybird: Add menu action to dump paint tree 2023-03-18 20:23:35 +01:00
Timothy Flynn
6e1b5b541a LibWeb: Move initialization of the MainThreadVM to WebContent's main()
It is a fallible operation, so this lets us abort early if it fails.
2023-03-17 16:39:08 +00:00
Aliaksandr Kalenik
bb98ae08b8 WebContent: Allow pop-ups when WebDriver is connected
Currently we have `m_should_block_pop_ups` set to true by default
which means `choose_a_browsing_context` will early return if new
top-level browsing context is requested and write `Pop-up blocked!`
in console. It is good but when WebDriver is connected we want it
to be able to actually open a new window if one is requested.
2023-03-16 13:17:37 -04:00
Aliaksandr Kalenik
126fa7df14 WebContent+WebDriver: Get window handle from WebContent process
This change makes window handles on WebDriver process side be
consistent with handles returned by /window/new.
2023-03-16 13:17:37 -04:00
Aliaksandr Kalenik
f287165823 LibWeb+WebContent+WebDriver: Add WebDriver endpoint to open new window 2023-03-16 13:17:37 -04:00
Aliaksandr Kalenik
a9f8d4eada LibWeb+LibWebView+WebContent+Ladybird: Add IPC call that opens new tab 2023-03-16 13:17:37 -04:00
Aliaksandr Kalenik
6d91d2fa50 WebContent: Add IPC call to set window handle from WebContent client 2023-03-16 13:17:37 -04:00
Aliaksandr Kalenik
48e0789a17 WebContent: Add IPC call to get window handle from WebContent client 2023-03-16 13:17:37 -04:00
Timothy Flynn
700ad6bf35 WebContent+LibWebView: Consolidate the way browsers connect to WebDriver
Currently, on Serenity, we connect to WebDriver from the browser-side of
the WebContent connection for both Browser and headless-browser.

On Lagom, we connect from within the WebContent process itself, signaled
by a command line flag.

This patch changes Lagom browsers to connect to WebDriver the same way
that Serenity browsers do. This will ensure we can do other initializers
in the same order across all platforms and browsers.
2023-03-16 15:02:41 +00:00
Andreas Kling
a58d84407f WebContent: Coalesce multiple sequential MouseMove events
This can avoid getting into a situation where lots of MouseMove events
are queued up and they all trigger relayout (or something else that
takes a lot of time).

To make sure that we don't get out of sync with the input events queue
on the UI process side, we still send acknowledgements for coalesced
MouseMoves. There's room for improvement here.

My Discord friends list is now pleasantly responsive. :^)
2023-03-14 16:52:44 +01:00
Andreas Kling
479e269c8b WebContent: Give paint requests a chance to happen between input events
Before this patch, we had an issue where the WebContent process could
get backed up with tons of pending input events (especially mouse moves)
and have to work through all of those before responding to a paint
request from the UI process.

This could lead to a situation where we went for a very long time
without seeing any visual updates.

The approach I've taken here is pretty simple, we basically make a queue
of all incoming input events on the WebContent process side, and then
process that queue one event at a time, using a zero timer. This is
basic, but it allows paint requests to come in between the input events
and we do now get more frequent visual updates even during heavy
pressure from input events.
2023-03-14 16:52:44 +01:00
Timothy Flynn
97536e4684 LibWeb+Ladybird+Userland: Port window.[alert,confirm,prompt] to String
LibGUI and WebDriver (read: JSON) API boundaries use DeprecatedString,
so that is as far as these changes can reach.

The one change which isn't just a DeprecatedString to String replacement
is handling the "null" prompt response. We previously checked for the
null DeprecatedString, whereas we now represent this as an empty
Optional<String>.
2023-03-13 22:05:22 +00:00
Tim Schumacher
ae51c1821c Everywhere: Remove unintentional partial stream reads and writes 2023-03-13 15:16:20 +00:00
Tim Schumacher
d5871f5717 AK: Rename Stream::{read,write} to Stream::{read_some,write_some}
Similar to POSIX read, the basic read and write functions of AK::Stream
do not have a lower limit of how much data they read or write (apart
from "none at all").

Rename the functions to "read some [data]" and "write some [data]" (with
"data" being omitted, since everything here is reading and writing data)
to make them sufficiently distinct from the functions that ensure to
use the entire buffer (which should be the go-to function for most
usages).

No functional changes, just a lot of new FIXMEs.
2023-03-13 15:16:20 +00:00
kleines Filmröllchen
8f4d0d3797 LibCore+Userland: Make Promise's on_resolve fallible
This will be primarily necessary for BackgroundAction integration, but
it already allows us to add proper error handling in LibIMAP :^)
2023-03-13 12:12:17 +00:00
kleines Filmröllchen
bfd9f681f7 LibCore+Userland: Allow canceling promises
To make EventLoop cancel its managed Promises, we need the ability to
cancel them in the first place.
2023-03-13 12:12:17 +00:00
Nico Weber
e26aebca4f SpiceAgent: Remove unused BMPWriter.h include 2023-03-12 22:09:34 +01:00
Linus Groh
324dacbc5d LibWeb/HTML: Propagate OOM errors from Window::{local,session}_storage()
This requires a bit of error type conversion glue as HashMap::try_ensure
expects the callback to return ErrorOr<T> like the function itself does.
2023-03-11 18:26:40 +00:00
implicitfield
e9e4baee77 Everywhere: Support overriding the system color scheme 2023-03-10 22:03:49 +01:00
Andreas Kling
a504ac3e2a Everywhere: Rename equals_ignoring_case => equals_ignoring_ascii_case
Let's make it clear that these functions deal with ASCII case only.
2023-03-10 13:15:44 +01:00
Linus Groh
e76394d96c AK: Remove infallible version of StringBuilder::to_byte_buffer
Also drop the try_ prefix from the fallible function, as it is no longer
needed to distinguish the two.
2023-03-09 15:51:00 +00:00
Linus Groh
ad5e8f2742 WebServer+LibGUI: Use fallible version of StringBuilder::to_byte_buffer
...and simply ignore the errors for now. This allows us to remove the
infallible function and avoid accumulating more callers of it.
2023-03-09 15:50:45 +00:00
Karol Baraniecki
7d412983a8 WebServer: Use fallible version of StringBuilder::to_byte_buffer 2023-03-09 12:59:57 +00:00
Karol Baraniecki
058cc00837 TelnetServer: Use fallible version of StringBuilder::to_byte_buffer 2023-03-09 12:59:57 +00:00
Aliaksandr Kalenik
63b8b37bd4 WebContent: Wait for navigation to complete in WebDriver
Implements https://w3c.github.io/webdriver/#dfn-waiting-for-the-navigation-to-complete.
2023-03-08 13:08:04 -05:00