Commit Graph

2236 Commits

Author SHA1 Message Date
Tim Ledbetter
2331d2bafa Userland: Propagate errors with TRY() where possible 2024-02-14 17:46:06 -05:00
Andrew Kaster
9077fe15ac WebContent: Tolerate invalid page_ids in ConnectionFromClient
When a tab or nested traversable navigable is closed, there might be
messages still in the pipe from the UI process that we need to
gracefully drop, rather than crash trying to access an invalid pointer.
2024-02-13 19:46:10 +01:00
Andrew Kaster
3d6c515bae WebContent: Jump through less hoops to access top level traversable 2024-02-13 19:46:10 +01:00
Andrew Kaster
bc87a48e0b WebDriver: Mark current window handle as invalid after close_window() 2024-02-13 19:46:10 +01:00
Andrew Kaster
080aa567a5 RequestServer+LibTLS: Allow applications to specify multiple root certs 2024-02-08 08:49:32 -07:00
Andrew Kaster
53273e2037 LibWeb: Don't navigate() to about:blank when making a fresh Traversable
This matches the behavior of the window open steps, and should probably
be a spec issue :yakplus:
2024-02-08 15:53:46 +01:00
ronak69
113c6dc48b WindowServer: Show fixed aspect ratio in the resize overlay 2024-02-08 14:22:28 +00:00
ronak69
83028518a0 WindowServer: Don't show tile overlay for fixed aspect ratio windows
Windows with fixed aspect ratio cannot be tiled so the tile overlay
shouldn't be shown.
2024-02-08 14:22:28 +00:00
ronak69
8d16c7c9b9 WindowServer: Handle latching fix-aspect-ratio window to the screen edge
Double-clicking the edges of a window results in the edge being extended
until it latches to the screen edge. This used to violate the fixed
aspect ratio property of certain windows because of only extending the
window in one dimension.

This commit adds a special case to the latching logic that makes sure to
also extend the other dimension of the window such that the fixed aspect
ratio is maintained.
2024-02-08 14:22:28 +00:00
mobounya
7326d00baa RequestServer: Avoid using gethostbyname
Replace gethostbyname with Core::Socket::resolve_host in
RequestServer::ConnectionFromClient::ensure_connection.

Resolved #22199.
2024-02-06 21:43:23 +01:00
Timothy Flynn
747fd86f26 LibWeb: Make WebDriver check if the BC's navigable has been destroyed
The spec steps to check if a browsing context is open have been updated
for navigables.
2024-02-06 08:40:27 +01:00
Andrew Kaster
3aee787539 LibWeb+WebContent: Convert WebDriver to choose a navigable AO
Also use the TraversableNavigable's window_handle instead of the
BrowsingContext's.
2024-02-05 08:05:48 -07:00
Andrew Kaster
36cd2fb7c5 Ladybird+WebContent: Update IPC calls to handle multiple traversables
The IPC layer between chromes and LibWeb now understands that multiple
top level traversables can live in each WebContent process.

This largely mechanical change adds a billion page_id/page_index
arguments to make sure that pages that end up opening new WebViews
through mechanisms like window.open() still work properly with those
extra windows.
2024-02-03 20:51:37 -05:00
Andrew Kaster
adb5c27331 LibWeb: Create a new WebView for window.open()'d top level traversables 2024-02-03 20:51:37 -05:00
Andrew Kaster
677bdc2a4f Ladybird: Add IPC call for creating a new child tab
This will be used for choosing a navigable that requires opening a new
tab or new window. Such as calls to window.open(), or specific WebDriver
calls.
2024-02-03 20:51:37 -05:00
Aliaksandr Kalenik
5a29440bdf LibWeb: Create AccelGfx context only once in PageClient
Fixes silly bug when AccelGfx always was created twice.
2024-02-03 07:03:42 +01:00
Sam Atkins
8a974ca91a SystemServer: Correct logic for services exiting successfully
WIFEXITED() returns a bool, so previously we were setting
exited_successfully to true when the service was terminated by a signal,
and false if it exited, regardless of the exit status. To test the exit
status, we have to use WEXITSTATUS() instead.

This causes us to correctly use the "3 tries then give up" logic for
services that crash, instead of infinitely attempting to respawn them.
2024-02-02 16:08:23 +00:00
nyyakko
e981197ee3 Userland/TaskbarWindow: Show context menu on right click 2024-01-30 18:45:19 -07:00
Bastiaan van der Plaat
706a741053 Taskbar: Fix bug where dropping item in quick launch widget would crash 2024-01-30 22:39:52 +00:00
Bastiaan van der Plaat
350affe406 LibGUI+WindowServer: Add menu minimum width support 2024-01-29 05:29:41 -07:00
Timothy Flynn
c4820838bf LibWeb+WebContent: Port the did_request_named_cookie IPC to String 2024-01-26 20:22:39 +01:00
Timothy Flynn
9b957ead13 LibWebView+WebContent: Do not manually serialize cookie sources over IPC
LibIPC can serialize enumeration automatically (this was not the case
when these IPCs were added).
2024-01-26 20:22:39 +01:00
Timothy Flynn
85b8971a80 Ladybird+LibWeb+WebContent: Port the did_request_cookie IPC to String 2024-01-26 20:22:39 +01:00
Sam Atkins
388856dc7e AK+Userland: Return String from human_readable_size() functions 2024-01-25 09:07:32 +01:00
Aliaksandr Kalenik
980b61470c LibAccelGfx+LibWeb+WebContent: Handle OpenGL Context init errors
Now, if OpenGL context fails, an error will be returned and a message
printed, instead of crashing.
2024-01-24 19:43:51 +01:00
Dan Klishch
b5f1a48a7c AK+Everywhere: Remove JsonValue APIs with implicit default values 2024-01-21 15:47:53 -07:00
Dan Klishch
5230d2af91 AK+WebContent: Remove JsonValue::as_{i,u}{32,64}() 2024-01-21 15:47:53 -07:00
Sam Atkins
9703510682 NotificationServer: Manually calculate the text label height
The layout system can't currently answer the question "what height does
this Label want to be, if it has a certain width available?" Instead it
relies on counting newlines, which doesn't work in a lot of cases. This
made the notification windows look and behave in a funky way when their
text wraps onto multiple lines.

This patch uses TextLayout to measure how many lines we need, and then
manually sets the Label and Window heights to match. It's a bit hacky,
hence the FIXME, but it does make things behave the way they are
supposed to.
2024-01-21 09:32:10 -05:00
Sam Atkins
84e8bf3421 NotificationServer: Convert the notification window contents to GML 2024-01-21 09:32:10 -05:00
Bastiaan van der Plaat
a681429dff LibWeb: Remove DOM element deprecated_get_attribute() 2024-01-19 13:12:54 -07:00
kleines Filmröllchen
3afbf66295 LoginServer: Use new GML compiler 2024-01-19 10:50:15 +00:00
Sam Atkins
8d80841e9c LibFileSystem+Everywhere: Return ByteString from read_link() 2024-01-16 08:42:34 +00:00
Sam Atkins
56c5ffe398 LibFileSystem+Userland: Return ByteString from real_path() 2024-01-16 08:42:34 +00:00
Aliaksandr Kalenik
cc447c9c80 LibWeb+WebContent: Move paint recording init into Navigable
This refactoring makes WebContent less aware of LibWeb internals.
The code that initializes paint recording commands now resides in
`Navigable::paint()`. Additionally, we no longer need to reuse
PaintContext across iframes, allowing us to avoid saving and restoring
its state before recursing into an iframe.
2024-01-15 14:33:56 +01:00
Hugh Davenport
8e76265b0c Taskbar: Add hotkeys for theme selector menu 2024-01-14 15:16:45 -07:00
Hugh Davenport
420da686b8 Taskbar: Add support for hotkeys in menu apps 2024-01-14 15:16:45 -07:00
Hugh Davenport
6ab315ae69 LibDesktop: Add menu_name() to AppFile
This really just takes the [App].Name config value and removes the
ampersands `&` from the name. These ampersands are hotkeys for the
system menu. Instead of typing them twice - error prone  - use the
fact that name is just menu_name without the ampersand. Remove the
ampersand to use as the name and use it as is as the menu_name.
2024-01-14 15:16:45 -07:00
Dan Klishch
ccd701809f Everywhere: Add deprecated_ prefix to JsonValue::to_byte_string
`JsonValue::to_byte_string` has peculiar type-erasure semantics which is
not usually intended. Unfortunately, it also has a very stereotypical
name which does not warn about unexpected behavior. So let's prefix it
with `deprecated_` to make new code use `as_string` if it just wants to
get string value or `serialized<StringBuilder>` if it needs to do proper
serialization.
2024-01-12 17:41:34 -07:00
Liav A
ca2be5c51b WindowServer: Read from /dev/input/mice for mouse packets
Instead of trying to acquire from an individual mouse device, let's read
from /dev/input/mice, where all mouse packets are blended together from
all mouse devices that are attached to the machine.
2024-01-12 16:08:08 -07:00
Liav A
97166a5570 SystemServer: Add the all-mice device in /dev/input/mice path 2024-01-12 16:08:08 -07:00
Andrew Kaster
02edd240ae LibWeb+WebContent: Spawn Worker processes from the chrome
Instead of spawning these processes from the WebContent process, we now
create them in the Browser chrome.

Part 1/N of "all processes are owned by the chrome".
2024-01-12 15:53:11 -07:00
Timothy Flynn
a4f862a869 WebContent: Change the cookie setting IPC to be synchronous
Considering an operation like the following:

    document.cookie = "cookie=value";
    const value = document.cookie;

If the IPC for the cookie setter is asynchronous, the getter can execute
while the browser/SQLServer processes are still handling the setter.
This is often seen when hammering the document with cookie requests.
2024-01-10 23:26:40 +01:00
Timothy Flynn
1205d39fc3 LibSQL+SQLServer: Inform SQLServer when the client has processed results
The architecture of SQLServer is currently such that it sends results
over IPC one row at a time. After the rows are exhausted, it sends a
completion IPC. However, it does not wait for the client to finish
processing a row before sending another row or the completion signal.

This can result in clients hanging if the completion comes in while a
row is being processed. At least in the case of WebView::Database, the
result is that the completion signal is dropped, and the browser then
hangs forever waiting for that signal (after it finishes processing the
row).

This patch makes SQLServer asynchronously wait for the client to tell it
that the row has been processed and the next row (or completion) may be
sent. We repurpose the `m_ongoing_executions` in SQLStatement for this
purpose (this member was oddly being written to, but otherwise unused).
2024-01-10 23:26:40 +01:00
Ali Mohammad Pur
cd4ebc45a0 RequestServer: Avoid multiple connections to incompatible servers
This really only implements a heuristic, assuming that HTTP/1.0 servers
cannot handle having multiple active connections; this assumption has
lots of false positives, but ultimately HTTP/1.0 is an out-of-date HTTP
version and people using it should just switch to a newer standard
anyway.

Specifically, python's "SimpleHTTPRequestHandler" utilises a
single-threaded HTTP/1.0 server, which means no keepalive and more
importantly, hangs and races with more than a single connection present.
This commit makes it so we serialise all requests to servers that are
known to serve only a single request per connection (aka HTTP/1.0 with
our setup, as we unconditionally request keepalive)
2024-01-10 09:39:51 +01:00
Bastiaan van der Plaat
a47edb4ed1 LibWeb: Refactor unsigned to u32 in WebContentServer.ipc
The type u32 is already used almost everywhere in
WebContentServer.ipc except for the mouse and key
events so let's fix that.
2024-01-10 09:38:41 +01:00
Timothy Flynn
8b32f4ae7a LibWebView+WebContent: Let the WebView client broadcast when it painted
When the WebContent process has painted to its shared bitmaps, it sends
a synchronous IPC to the browser process to let the chrome paint. It is
synchronous to ensure the WC process doesn't paint onto the backing
bitmap again while it is being displayed.

However, this can cause a crash at exit if the browser process quits
while the WC process is waiting for a response to this IPC.

This patch makes the painting logic asynchronous by letting the browser
process broadcast when it has finished handling the paint IPC. The WC
process will not paint anything again until it receives that message. If
it had tried to repaint while waiting for that message, that paint will
be deferred until it arrives.
2024-01-08 00:51:59 +01:00
Lucas CHOLLET
e56eb11dee ImageDecoder: Add plumbing to allow a client to request an ideal size
This is only used for vector graphics format where requesting the true
displayed size leads to visual enhancement.
2024-01-07 20:10:22 +01:00
Bastiaan van der Plaat
0dd5aa40a8 LibWeb: Allow input color to give continuous updates 2024-01-06 10:02:15 -07:00
MacDue
a1d669fe63 RequestServer: Make pre-connection job refcounted
Fixes #22582

Previously, the job and the (cache of them) would lead to a UAF, as
after `.start()` was called on the job it'd be immediately destroyed.

Example of previous bug:

```
// Note due to the cache &jobA == &jobB
auto& jobA = Job::ensure("https://r.bing.com/");
auto& jobB = Job::ensure("https://r.bing.com/");
// Previously, the first .start() free'd the job
jobA.start();
// So the second .start() was a UAF
jobB.start();
```
2024-01-05 04:03:32 +03:30
Shannon Booth
fa1ef30985 LibWeb: Port Element::set_attribute_value from ByteString
Also making set_attribute_ns take a String instead of a FlyString as
this is only used as an Attr value and no FlyString properties are used.
2024-01-03 10:13:47 +01:00