Commit graph

50605 commits

Author SHA1 Message Date
MacDue
91d8665ab4 LibWeb: Tidy up apply_clip_overflow_rect() a little
Avoid possible null optional dereference when creating border radius
clipper, and avoid creating clipper if the clip rect is empty (which
prevents some debug spam). Also remove an unnecessary lambda.
2023-05-22 06:05:47 +02:00
Aliaksandr Kalenik
193290b19a LibWeb: Support grid-auto-columns and grid-auto-rows properties in GFC
Implements assignment of sizes specified in grid-auto-columns/rows for
implicitly created tracks.
2023-05-22 06:05:19 +02:00
Aliaksandr Kalenik
6e0601a63e LibWeb/CSS: Implement parsing of grid-auto-columns and grid-auto-rows 2023-05-22 06:05:19 +02:00
Aliaksandr Kalenik
b49e9d2eab LibWeb: Check if line name is present in GridTrackSizeList::to_string()
Fixes crash in GridTrackSizeList::to_string() when line names are
missing.
2023-05-22 06:05:19 +02:00
Pankaj Raghav
0c5d6c6c47 Kernel: Move NVMeInterruptQueue initialization out of its constructor
Add a helper initialize_interrupt_queue() helper to enable_irq instead
of doing it as part of its object construction as it can fail. This is
similar to how AHCI initializes its interrupt as well.
2023-05-21 18:01:29 -06:00
Pankaj Raghav
ac161f6a8d Kernel/NVMe: Add try_create() to NVMe{Poll|Interrupt}Queue
NVMe{Poll|Interrupt}Queue don't have a try_create() method. Add one to
keep it consistent with how we create objects. Also this commit is in
preparation to moving any initialization related code out of the
constructor.
2023-05-21 18:01:29 -06:00
Pankaj Raghav
b8c03d44a7 Kernel: Convert rw_dma_page to NonnullRefPtr in NVMeQueue
Propagate error if the rw_dma_page is NULL in try_create and use
relase_nonnull to convert RefPtr to NonnullRefPtr before passing it to
the NVMeQueue.
2023-05-21 18:01:29 -06:00
Pankaj Raghav
4014b06b08 Kernel: Remove the unused {cq|sq}_dma_page from NVMeQueue
{cq|sq}_dma_page are not used by the NVMeQueue class. Remove them.
2023-05-21 18:01:29 -06:00
Pankaj Raghav
d14c2a3583 Kernel: Move handle_interrupt out-of-line in PCIIRQHandler
Upgrade to GCC 13.1.0 triggered an UBSAN in PCIIRQHandler. Moving the
handle_interrupt() function out-of-line fixes this issue.
2023-05-21 18:01:29 -06:00
Sam Atkins
ff70418ffc Revert "LibGfx: Add NearestFractional scaling type to painter"
This reverts commit df30440117.

This scaling type is now unused, and has issues with painting outside of
the Painter's clip-rect.
2023-05-22 01:38:41 +02:00
Sam Atkins
7cc118e84e Magnifier: Correct captured bitmap's clipping
Previously, we would get a line of junk pixels to the right or bottom of
the captured bitmap.

Two aspects to this:
- Use Painter's clip-rect functionality instead of trying to implement
  it ourselves.
- Switch from ScalingMode::NearestFractional to ::NearestNeighbor.
  Somehow, `draw_scaled_bitmap(NearestFractional)` draws outside of the
  Painter's clip-rect. I can't discern any difference in behavior
  between these two otherwise.

We also now use the same bitmap for drawing the grid as we used for the
bitmap, since this had issues where it wasn't drawn to the edge of the
bitmap.
2023-05-22 01:38:41 +02:00
Caoimhe
0f3f190a5a SpiceAgent: Handle file transfer requests properly :^)
Now, we write the data recieved to a file when the user drags a file
onto the Spice Viewer window. Once complete, the FileExplorer will open
with the copied file highlighted.
2023-05-21 18:45:53 +02:00
Caoimhe
d87f823a68 SpiceAgent: Implement FileTransferData messages 2023-05-21 18:45:53 +02:00
Caoimhe
af91c75080 SpiceAgent: Implement FileTransferStatus messages 2023-05-21 18:45:53 +02:00
Caoimhe
476774d681 SpiceAgent: Implement FileTransferStart messages 2023-05-21 18:45:53 +02:00
Caoimhe
0d98920930 SpiceAgent: Implement sending clipboard data to the spice server 2023-05-21 18:45:53 +02:00
Caoimhe
9f92e52464 SpiceAgent: Add support for copying images to the clipboard 2023-05-21 18:45:53 +02:00
Caoimhe
50a8db3922 SpiceAgent: Add support for reading chunks larger than 2048 bytes 2023-05-21 18:45:53 +02:00
Caoimhe
3b6d63f723 SpiceAgent: Implement setting the user's clipboard contents for text
We also now use GUI::Clipboard for setting the clipboard contents,
instead of using a custom connection to the Clipboard server.
2023-05-21 18:45:53 +02:00
Caoimhe
9c4538a9a8 SpiceAgent: Implement ClipboardRequest messages 2023-05-21 18:45:53 +02:00
Caoimhe
8202f13169 SpiceAgent: Implement ClipboardGrab messages 2023-05-21 18:45:53 +02:00
Caoimhe
79c73dd260 SpiceAgent: Let's start rewriting the messaging system :^)
The old message system was very dependent on syscalls, and the overall
structure made it hard to implement new features.

The new message system is pretty expandible, where each message has its
own dedicated class. As well as this, we now use Core::File and
AK::Stream for reading and writing messages.

Using AK::Stream also allows us to change the actual data source
(in this case, Core::File) without having to update a whole lot of code
in the future.
2023-05-21 18:45:53 +02:00
Caoimhe
fd4f00ee91 AK: Add SPICE_AGENT_DEBUG flag 2023-05-21 18:45:53 +02:00
Caoimhe
3c0b6919f7 SpiceAgent: Minor formatting changes 2023-05-21 18:45:53 +02:00
Caoimhe
7e3fd73410 SpiceAgent: Use ErrorOr<T> for on_message_received 2023-05-21 18:45:53 +02:00
Andreas Kling
0d82cc8a67 LibWeb: Don't assume response object isn't null in fetch abort algorithm
The callee that we're passing it to expects a GCPtr anyway, so there's
no need to explicitly dereference this.

Fixes a crash when loading https://spotify.com/
2023-05-21 16:19:31 +02:00
Aliaksandr Kalenik
f9803a7319 LibWeb: Represent OccupationGrid using HashTable in GFC
Using HashTable of grid positions to represent OccupationGrid allows to
simplify positioning code. For example maybe_add_row() and
maybe_add_column() calls are not needed anymore because there is no
Vector<Vector<bool>> that need to be resized.

No observable changes in grid layout are expected :)
2023-05-21 16:18:46 +02:00
Andreas Kling
0f4b82bdea LibWeb: Move SVGElement's dataset construction to initialize()
It's not safe to allocate new cells while in a cell constructor.
2023-05-21 16:01:19 +02:00
Andreas Kling
055dabc123 LibWeb: Fix unsafe capture of stack variables in main_fetch() 2023-05-21 16:01:19 +02:00
Andreas Kling
e69a06b358 LibJS: Don't dereference well-known symbols when gathering roots
This fixes an issue where very early GC would crash trying to
dereference not-yet-initialized entries in the well-known symbol set.
2023-05-21 16:01:19 +02:00
Undefine
0374351595 Shell: Properly detect the kill executable 2023-05-21 14:59:26 +01:00
Andreas Kling
cfe663435e LibWeb+LibJS: Don't lazily construct web prototypes in cell constructors
It's not safe to allocate from the GC heap while in the constructor of a
GC heap cell. (Because if this ends up triggering a collection, we may
end up trying to call through an uninitialized vtable).

This was already done safely in the initialize() virtual in much of
LibJS and LibWeb. This patch moves the logic for prototypes, mixins,
and CSSStyleDeclaration as well.

Fixes a long-standing GC crash that was pretty easy to reproduce by
refreshing https://vercel.com/
2023-05-21 14:23:58 +02:00
Andi Gallo
e6221117a5 LibWeb: Implement table rowspan
Adjust computing the table height and positioning of cells to account
for the rowspan property.

Fixes #18952.
2023-05-21 14:23:41 +02:00
Andreas Kling
6cb9d755d9 LibWeb: Don't crash on percentage values for CSS stroke-width
Fixes a crash when loading https://vercel.com/
2023-05-21 12:40:27 +02:00
Daniel Bertalan
beb55f726f Kernel/aarch64: Detect if access faults come from SafeMem
This commit lets us differentiate whether access faults are caused by
accessing junk memory addresses given to us by userspace or if we hit a
kernel bug.

The stub implementations of the `safe_*` functions currently don't let
us jump back into them and return a value indicating failure, so we
panic if such a fault happens. Practically, this means that we still
crash, but if the access violation was caused by something else, we take
the usual kernel crash code path and print a register and memory dump,
rather than hitting the `TODO_AARCH64` in `handle_safe_access_fault`.
2023-05-21 12:00:22 +02:00
Daniel Bertalan
0da2d2102a Kernel/aarch64: Flatten safe_{memset,strnlen,memcpy}()
We want to detect if an access fault comes from within these operations,
so they cannot be calling out to the non-safe variants.
2023-05-21 12:00:22 +02:00
Daniel Bertalan
ab279c850b Kernel/aarch64: Stub out atomic SafeMem functions
These are used in futexes, which are needed if we want to get further in
`run-tests`.

For now, we have no way to return a non-fatal error if an access fault
is raised while executing these, so the kernel will panic. Some would
consider this a DoS vulnerability where a malicious userspace app can
crash the kernel by passing bogus pointers to it, but I prefer to call
it progress :^)
2023-05-21 12:00:22 +02:00
Aliaksandr Kalenik
09ef2c14e9 LibWeb: Use code to size spanning tracks for non-spanning tracks in GFC
Since the specifications indicate that the algorithm for sizing tracks
without any spanning items is a simplified version of the more general
algorithm used for sizing tracks with spanning items, we can reuse the
code to size both cases.
2023-05-21 11:59:19 +02:00
Aliaksandr Kalenik
409333d80a LibWeb: Implement more of spanning tracks sizing in GFC
Implements more parts of sizing algorithm for tracks with spanning
items to archive parity with implementation for sizing of tracks
with non-spanning items.
2023-05-21 11:59:19 +02:00
Ben Wiederhake
943ecaede6 LibIPC: Remove redundant IPC::Dictionary type
We already have and use HashMap<DeprecatedString, DeprecatedString>
nearly everywhere, which is essentially equivalent.
2023-05-21 07:53:45 +02:00
Ben Wiederhake
d030f0fe9b WebSocket: Avoid unnecessary IPC::Dictionary wrapper
We already have and use HashMap<DeprecatedString, DeprecatedString>
nearly everywhere, which is equivalent.
2023-05-21 07:53:45 +02:00
Ben Wiederhake
9b9a38ec81 RequestServer: Avoid unnecessary IPC::Dictionary wrapper
We already have and use HashMap<DeprecatedString, DeprecatedString>
nearly everywhere, which is equivalent.
2023-05-21 07:53:45 +02:00
Ben Wiederhake
0ee5a4e308 Clipboard: Avoid unnecessary IPC::Dictionary wrapper
We already have and use HashMap<DeprecatedString, DeprecatedString>
nearly everywhere, which is equivalent.
2023-05-21 07:53:45 +02:00
Ben Wiederhake
67d9172885 LibIPC: Fix HashMap detection in case of non-trivial traits 2023-05-21 07:53:45 +02:00
Ben Wiederhake
4e101d1fa2 Ladybird: Remove unused IODevice.h include 2023-05-21 07:52:52 +02:00
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
Ben Wiederhake
81700d1b92 LibCodeComprehension: Remove unused #include <DeprecatedFile.h> 2023-05-21 07:52:41 +02:00
Ben Wiederhake
6055eed5a5 xml: Prefer LibFileSystem over DeprecatedFile 2023-05-21 07:50:52 +02:00