Commit Graph

1927 Commits

Author SHA1 Message Date
Ben Wiederhake
f0586d74d7 WebServer: Convert document_root_path from DeprecatedString to String 2023-05-21 07:52:41 +02:00
Ben Wiederhake
e795641d99 WebServer: Prefer LibFileSystem over DeprecatedFile 2023-05-21 07:52:41 +02:00
Ben Wiederhake
fecaf27b3a FileSystemAccessServer: Prefer LibFileSystem over DeprecatedFile 2023-05-21 07:52:41 +02:00
Liav A
f7185dfa91 SystemServer: Print useful information when failing to drop privileges
It occurred to me that when trying to running "pls pro SOME_URL" with a
subsequent failure (which will be fixed in a future patch), that a small
error message was printed to the debug log about "Failed to drop
privileges (GID=0, UID=0)".

To actually understand where it failed, I added the actual errno to
printed message which helped me with further debugging, but this could
easily help others in similar scenarios so let's print the actual error.
2023-05-20 21:44:03 +02:00
Ben Wiederhake
b4ad3f1b37 LookupServer: Prefer File::read_until_eof over DeprecatedFile 2023-05-19 23:31:20 +02:00
Ben Wiederhake
362773d4a6 LibIPC: Explicitly mark HashMap copy, offer move interface 2023-05-19 22:33:57 +02:00
Ben Wiederhake
5b318dd160 WindowServer: Prefer File::read_until_eof over DeprecatedFile::read_all 2023-05-19 21:36:37 +02:00
thankyouverycool
fef594708e FileSystemAccessServer: Return EPERM for denied prompts
Instead of showing an ambiguous "Unknown error" when FSAS approval is
denied, let's affirm the user's action wasn't permitted if they
reject the prompt.
2023-05-19 06:20:41 +02:00
Liav A
0bbd9040ef Kernel+Userland: Split bind-mounting and re-mounting from mount syscall
These 2 are an actual separate types of syscalls, so let's stop using
special flags for bind mounting or re-mounting and instead let userspace
calling directly for this kind of actions.
2023-05-17 23:39:15 -06:00
Andreas Kling
fb722e69f3 LibWeb: Resolve CSS custom properties on pseudo elements
The resolved property sets are stored with the element in a
per-pseudo-element array (same as for pseudo element layout nodes).

Longer term, we should stop storing this with elements entirely and make
it temporary state in StyleComputer somehow, so we don't waste memory
keeping all the resolved properties around.

This makes various gradients show up on https://shopify.com/ :^)
2023-05-17 20:37:29 +02:00
Timothy Flynn
c82f678fc6 LibWeb+WebContent: Add APIs to control video playback state
This allows for the browser process to control the play/pause state,
whether we paint user agent controls on the video, and whether the video
loops when it finishes playing.
2023-05-16 12:48:39 +02:00
Timothy Flynn
d8f03dda08 Browser+LibWeb+WebContent: Broadcast video element context menu requests
This just sets up the IPC to notify the browser process of context menu
requests on video elements. The IPC contains a few pieces of information
about the state of the video element.
2023-05-16 12:48:39 +02:00
thankyouverycool
44049f5ad5 WindowServer: Catch more Window stealing misbehavior
Previously it was possible for a window to register as a parentless
blocking modal then add itself to a stealable parent's modal chain,
bypassing a mode misbehavior check in create_window()

Also relaxes reciprocity for blockers with the same parent. This
scenario is usually created by simultaneous MessageBoxes. It's not
an ideal UX to cascade these, but there's no need to crash over it.
2023-05-15 12:15:39 +02:00
thankyouverycool
7323a54e59 LibGUI+FileSystemAccessServer: Avoid using dummy windows
Creates two new gatekept helpers for FilePicker and MessageBox to be
used by FSAS to replace the "dummy window" approach to centering
Dialogs. There was a slight delay in creating two windows, one a
transparent intermediary hidden behind the second, to display FSAS
Dialogs. Now we only need to make the window we actually see.
2023-05-15 12:15:39 +02:00
Ben Wiederhake
85c897dc17 LaunchServer: Prefer FileSystem over DeprecatedFile 2023-05-15 06:50:43 +02:00
Ben Wiederhake
b10106fc7d LookupServer: Migrate from DeprecatedFile to File 2023-05-14 15:41:58 -06:00
Daniel Bertalan
2626136749 SpiceAgent: Gracefully handle the host clearing the clipboard
When the host clears the clipboard (e.g. by running `pbcopy </dev/null`)
the Spice server sends an empty string to us. Previously, we would crash
as `AnonymousBuffer::create_with_size` doesn't accept a size of 0. Fix
this by passing `{}` to `async_set_clipboard_data` in this case.
2023-05-13 10:19:28 +02:00
Ben Wiederhake
bc2a517ade Userland: Merge DEFAULT_PATH into LibFileSystem/FileSystem.h 2023-05-13 07:53:13 +02:00
Ben Wiederhake
d2cc8baf41 SystemServer: Migrate from DeprecatedFile to File
Note that previously, the only check was that at least one byte was read
from /dev/devctl. This is incorrect, as potentially not the entire
struct was read. In practice, this probably never happened, but the new
code at least detects this case and aborts.
2023-05-12 19:46:54 +01:00
Ben Wiederhake
37b5bfa068 AudioServer: Migrate from DeprecatedFile to File
Advances #17129.
2023-05-12 19:46:54 +01:00
Ben Wiederhake
da394abe04 LibGfx+Fuzz: Convert ImageDecoder::initialize to ErrorOr
This prevents callers from accidentally discarding the result of
initialize(), which was the root cause of this OSS Fuzz bug:

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=55896&q=label%3AProj-serenity&sort=summary
2023-05-12 09:40:24 +01:00
Andreas Kling
43616316de LibWeb: Don't include CSS/StyleComputer.h from Element.h and Document.h
This made editing StyleComputer.h unpleasant for no reason.
2023-05-08 09:29:44 +02:00
Ben Wiederhake
449911c286 Chess: Slightly improve error propagation during startup 2023-05-07 14:04:55 +02:00
Ben Wiederhake
0fe29a48ad Chess: Avoid IODevice and DeprecatedFile 2023-05-07 14:04:55 +02:00
Ben Wiederhake
4b7639c3b5 LibGfx+WindowServer: Ensure constrain-to-rect ends up inside the rect 2023-05-06 22:04:46 +02:00
Patryk Pilipczuk
90ab011127 WindowServer: Fix window content scaling when switching from fullscreen
Resolves #18624

Switching to and from fullscreen produces a behaviour where window
content too big in relation to window size.

This patch fixes sent resize event to contain current
window size.
2023-05-06 12:24:53 +01:00
Andreas Kling
1b8788157c LibWeb: Fill PageHost root with document background color
This makes Acid3 have a background color again.

Regressed with f2f14ad9bd.
2023-05-06 08:43:22 +02:00
Lucas CHOLLET
1a97382305 LibGUI: Make Application's construction fallible
The pattern to construct `Application` was to use the `try_create`
method from the `C_OBJECT` macro. While being safe from an OOM
perspective, this method doesn't propagate errors from the constructor.
This patch make `Application` use the `C_OBJECT_ABSTRACT` and manually
define a `create` method that can bubble up errors from the
construction stage.

This commit also removes the ability to use `argc` and `argv` to
create an `Application`, only `Main`'s `Arguments` can be used.

From a user point of view, the patch renames `try_create` => `create`,
hence the huge number of modified files.
2023-05-05 16:41:21 +01:00
Lucas CHOLLET
5a4c61838f FileSystemAccessServer: Use ECANCELED instead of -1
-1 was used when the user cancel the dialog, `ECANCELED` is a bit more
explicit about what it is.
2023-05-05 15:12:24 +01:00
Joel Petersson
42e118e6a9 AudioServer: Dequeue all buffers when clearing a ClientAudioStream
Previously we would exit the dequeuing loop after just one buffer
had been dequeued due to some bogus logic. This would manifest
when stopping and starting a track in SoundPlayer, where a few
miliseconds of 'old' audio would play when restarting the playback.

This commit makes sure we clear the entire queue.
2023-05-03 10:01:14 +02:00
Tim Ledbetter
56dde3df54 LibChess+ChessEngine: Don't crash on error when reading UCI commands
ChessEngine and the chess GUI will no longer crash on error while
reading UCI commands. ChessEngine will print a message to the standard
output, while the GUI will ignore unknown commands. Both will print
the error to the debug log if the UCI_DEBUG flag is enabled.

Trailing and preceding whitespace is now stripped from commands before
they are parsed. Commands which are just whitespace no longer produce
errors.
2023-05-03 08:31:34 +01:00
thankyouverycool
f7e034d4b2 LibGfx+Userland: Merge FrameShape and FrameShadow into FrameStyle
Previously, Frames could set both these properties along with a
thickness to confusing effect: Most shapes of the same shadowing only
differentiated at a thickness >= 2, and some not at all. This led
to a lot of creative but ultimately superfluous choices in the code.

Instead let's streamline our options, automate thickness, and get
the right look without so much guesswork.

Plain shadowing has been consolidated into a single Plain style,
and 0 thickness can be had by setting style to NoFrame.
2023-04-30 05:49:46 +02:00
thankyouverycool
91bafc2653 LibGUI+Userland: Port Labels to String 2023-04-30 05:48:14 +02:00
Liav A
eb90d468ac SystemServer: Remove unused code for generating /dev/hwrng
This device was removed in b596af363c, so
we can't really create anything related to it, therefore this piece of
code should be removed too.
2023-04-28 23:26:31 +02:00
Tim Ledbetter
536f6b8b34 ChessEngine: Reset the engine state on receiving a ucinewgame command 2023-04-28 05:55:51 +02:00
Lucas CHOLLET
7fffa0176f KeyboardPreferenceLoader: Remove usage of DeprecatedFile 2023-04-27 07:29:49 +02:00
Lucas CHOLLET
f92ae03e76 DHCPClient: Remove usage of DeprecatedFile 2023-04-27 07:29:49 +02:00
Lucas CHOLLET
d7ca3a5196 LaunchServer: Remove usage of DeprecatedFile
And use the new `guess_mime_type_based_on_sniffed_bytes` helper.
2023-04-27 07:29:49 +02:00
Jelle Raaijmakers
7b10c8048c WindowServer: Draw stretched wallpapers with bilinear blending
This improves the quality of stretched photos and artwork considerably,
and I'd argue that this is what users will expect by default.
2023-04-25 22:37:57 +02:00
Andreas Kling
e5b97f4a57 WebContent: Always update layout before dumping layout tree
This fixes an issue where layout tests were sometimes flakey because
we tried dumping the layout tree before one had been built(!)
2023-04-25 18:01:35 +02:00
Andreas Kling
3de8dd921e Userland: Remove serialize-to-JSON functions only used for Inspector 2023-04-25 14:48:40 +02:00
Andreas Kling
c756e021a7 Userland: Remove "Inspector" program and related utilities
This program has never lived up to its original idea, and has been
broken for years (property editing, etc). It's also unmaintained and
off-by-default since forever.

At this point, Inspector is more of a maintenance burden than a feature,
so this commit removes it from the system, along with the mechanism in
Core::EventLoop that enables it.

If we decide we want the feature again in the future, it can be
reimplemented better. :^)
2023-04-25 14:48:40 +02:00
Andreas Kling
411d36719e LibCore: Simplify Core::Notifier by only allowing one event type
Not a single client of this API actually used the event mask feature to
listen for readability AND writability.

Let's simplify the API and have only one hook: on_activation.
2023-04-25 14:48:40 +02:00
Sigmund Lahn
f2f14ad9bd LibWeb+WebContent: Make document background and Viewport transparent
This means iframes are transparent by default (as in firefox/chrome).

Painting the outermost canvas background is moved to the PageHost.
2023-04-25 09:33:35 +02:00
Sam Atkins
29c41e953b LibChess: Convert Commands to use String and propagate errors 2023-04-24 20:58:35 +02:00
Timothy Flynn
f08499b4cf WebContent: Add the 'thread' pledge for video playback
This is required after 036eb82aca.
2023-04-24 14:49:42 +02:00
Cameron Youell
bedb370dec Services/WebContent: Use JsonArray::append
We can use the failable function here easily
2023-04-24 09:21:51 +02:00
Cameron Youell
8134dccdc7 AK: Add new failable JsonArray::{append/set} functions
Move all old usages to the more explicit `JsonArray:must_{append/set}`
2023-04-24 09:21:51 +02:00
Timothy Flynn
5089766af6 Browser+Ladybird+LibWeb: Port content filters to String 2023-04-22 12:32:40 +02:00
Timothy Flynn
76ae60da15 Browser+Ladybird+LibWeb: Prevent infinite growth of content filters
We never clear content filters on either end of the Browser-WebContent
IPC connection. So when the filters change, we re-append all filters to
the Vector holding them. This incidentally makes it impossible to remove
a filter.

Change both sides to clear their filter lists when receiving a new set
of filters.
2023-04-22 12:32:40 +02:00