Commit graph

61982 commits

Author SHA1 Message Date
Andreas Kling c8206fa070 LibWeb: Rename Element::shadow_root_internal() to shadow_root()
And let the old shadow_root(), which was only supposed to be used by
bindings, be called shadow_root_for_bindings() instead.

This makes it much easier to read DOM code, and we don't have to worry
about when to use shadow_root_internal() or why.

(cherry picked from commit f4bdf562127c12a7af18029777a88d4260af82d3)
2024-06-26 08:48:11 +02:00
Andreas Kling 1c5f0e8daf LibWeb: Update DOM cloning algorithm for declarative shadow DOM
(cherry picked from commit c7d9c1c0b21ad54894984dd73c775e225f82af09)
2024-06-26 08:48:11 +02:00
Andreas Kling 6217ebe33c LibWeb: Add HTMLTemplateElement IDL attrs for declarative shadow DOM
(cherry picked from commit a0e111220913ec1bf8d51dde37174120781b0a5f)
2024-06-26 08:48:11 +02:00
Andreas Kling 020764b204 LibWeb: Add ShadowRoot.clonable and ShadowRoot.serializable
(cherry picked from commit 8e68215d333963eeb63cccde171dba6ea77651d7)
2024-06-26 08:48:11 +02:00
Andreas Kling 88d9dc148c LibWeb: Update HTML fragment serialization for declarative shadow DOM
(cherry picked from commit e62db9c1181f5af49242656d3e065ceb0db800b9)
2024-06-26 08:48:11 +02:00
Andreas Kling a5189537e9 LibWeb: Parse declarative shadow DOM template elements
We now honor the shadowrootmode attribute on template elements while
parsing, and instantiate a shadow tree as required by the spec.

(cherry picked from commit 9eb4b91168145def5677cd41057d34ecf369372b)
2024-06-26 08:48:11 +02:00
Andreas Kling 34a4b28b89 LibWeb: Refactor Element.attachShadow() after spec changes
The bulk of this function is moved to a new "attach a shadow root"
helper, designed to be used both from here and the HTML parser.

(cherry picked from commit 043ad0eb7644a529c1ffbd4de9a4b89771808c84,
and amended to make `is_valid_shadow_host_name()` static.
2024-06-26 08:48:11 +02:00
Andreas Kling 3a2260b28b LibWeb: Add "allow declarative shadow roots" flag to Document
(cherry picked from commit f3070118b1fabda4a35f283a3bcf8086e32a25a9)
2024-06-26 08:48:11 +02:00
Sönke Holz facca92780 Kernel/Storage: Dump storage devices to the framebuffer console as well
This is helps bringing up bare metal devices without having to use the
serial console.
2024-06-26 08:47:00 +02:00
FujiBookPro 728f42f8f5 LibAudio: Replace DeprecatedFlyString with FlyString 2024-06-25 18:32:45 -06:00
Ali Mohammad Pur 3b05c81070 LibIPC: Allow sync messages to completely block the event loop
The expectation with these messages is that no other code is allowed to
run while we're waiting for the response to arrive.
Not meeting this requirement did not degrade any (observable)
functionality, however.
2024-06-25 18:30:03 -06:00
Idan Horowitz 3aa1bd520b Kernel: Support re-mapping MMIOVMObject-backed regions
This is required for example when write combine is enabled on a region
after the initial mapping.
2024-06-25 17:46:37 +02:00
Daniel Bertalan 8d2a8dbb8b Everywhere: Write dtors for types with incomplete members out-of-line
These are rejected by Clang (19) trunk as a result of
https://github.com/llvm/llvm-project/pull/77753.

(cherry picked from commit bf1f631f257e90e91b0b45a6454d731b4b98914c)
2024-06-25 17:42:49 +02:00
Daniel Bertalan d1f1a6eef0 Everywhere: Remove usages of template keyword with no parameter list
These were made invalid with P1787, and Clang (19) trunk started warning
on them with https://github.com/llvm/llvm-project/pull/80801.

(cherry picked from commit 397774d42272fff8dbc6d8d53616d79667d6608a)
2024-06-25 17:42:49 +02:00
Timothy Flynn 46ce6decfe LibProtocol: Exit fatally if the connection to RequestServer disappears
The default implementation of die() causes the client process to simply
exit cleanly. This prevents any tests from recognizing that something
went wrong, as the process exits with a code of 0. With this patch, we
still just exit when the connection dies, but with a fatal signal. In
the future, we will want to launch a new RequestServer process and
re-establish client connections.

(cherry picked from commit d1ec32e28feee10c2c36f4cd0d496b8a95d375f8)
2024-06-25 17:42:49 +02:00
Nico Weber 7e2c8693b1 LibJS: Initialize fields of on-stack buf structure
We pass all fields of `buf` to `add_possible_value()`, and at least
on Linux `setjmp()` does not initialize all fields.

Fixes #24560.
2024-06-25 17:40:17 +02:00
Liav A. 393c886c24 Utilities: Introduce the sizefmt utility
This utility takes a human-readable size and converts it into a raw
integer that can be used on commandline utilities.
2024-06-25 09:24:55 +02:00
Liav A. b91c625f8f AK: Introduce declerations for base10 size suffixes
Also, re-organize the base2 size suffixes to not use KiB repeatedly.
2024-06-25 09:24:55 +02:00
Nico Weber 22d737f370 Meta: Add a warning suppression used in the cmake build to the gn build
8263e0a619 added `-Wno-coroutine-missing-unhandled-exception` to the
cmake build, and the coroutine code does not build without it.

Unbreaks building e.g. `js` with GN.
2024-06-24 20:44:26 +02:00
Andreas Kling 93253e3701 LibJS/Bytecode: Give TypeofBinding instructions a lookup cache
These can use an EnvironmentCoordinate for caching, just like normal
binding lookups. Saves a bunch of time for repeated typeof checks.

(cherry picked from commit 60a05ef414f804fe0c44d20fe13c795800826368)
2024-06-24 16:38:47 +02:00
Andreas Kling 3a7da923e6 LibJS/Bytecode: Rename TypeofVariable => TypeofBinding
(cherry picked from commit 4302e073463c403f8d7ab09c42e7644089fc33a2)
2024-06-24 16:38:47 +02:00
Andreas Kling cd7a151aef LibJS: Allow let and const to create locals in global code
This is actually safe everywhere but in the topmost program scope.
For web compatibility reasons, we have to flush all top-level bindings
to the environment, in case a subsequent separate <script> program
comes looking for them.

(cherry picked from commit 9d21d88374cf440ddf381e02a597a59ad329ed62)
2024-06-24 16:38:47 +02:00
Andreas Kling 776e5d38cd LibJS/Bytecode: Display local variable names in bytecode dumps
Instead of displaying locals as "locN", we now show them as "name~N".
This makes it a lot easier to follow bytecode dumps, especially in
longer functions.

Note that we keep displaying the local index, to avoid confusion in case
there are multiple separate locals with the same name in one executable.

(cherry picked from commit 0aa8cb7dac60c88eac3bb7674e3fe575cf1da60b)
2024-06-24 16:38:47 +02:00
Andreas Kling 63d8a1821e LibJS: Don't overwrite cached this value on async/generator reentry
When resuming execution of a suspended function, we must not overwrite
any cached `this` value with something from the ExecutionContext.

This was causing an empty JS::Value to leak into the VM when resuming
an async arrow function, since the "this mode" for such functions is
lexical and thus ExecutionContext will have an empty `this`.

It became a problem due to the bytecode optimization where we allow
ourselves to assume that `this` remains cached after we've executed a
ResolveThisBinding in this (or the first) basic block of the executable.

Fixes https://github.com/LadybirdBrowser/ladybird/issues/138

(cherry picked from commit a91bb72dabe54849657720e36e19a3d3b737055f)
2024-06-24 16:38:47 +02:00
Tim Ledbetter 0b1adf784f SystemMonitor: Add an action to manually refresh process statistics 2024-06-23 21:20:37 +01:00
Tim Ledbetter 4091d7fc05 SystemMonitor: Add an action to pause updates 2024-06-23 21:20:37 +01:00
Liav A. 5cb1d2a63e Utilities/pkg: Move ports database handling from AvailablePort{.h,.cpp}
Instead, let's create a new class called AvailablePortDatabase that will
handle updating (from the Internet, by using our repository) of the list
and instantiating an object that could be used for querying.
2024-06-23 00:59:54 +02:00
Liav A. 1e13d758a2 Utilities/pkg: Move ports database handling from InstalledPort{.h,.cpp}
Instead, let's create a new class called InstalledPortDatabase that will
handle reading, and adding new entries as needed to such database.
2024-06-23 00:59:54 +02:00
Liav A. b201a91e72 Utilities/pkg: Rename ports_database => default_ports_database_path 2024-06-23 00:59:54 +02:00
Daniel Bertalan 8b189b7eb0 Fuzzers: Use libc++ on OSS-Fuzz for Lagom code generators
By unsetting `CXXFLAGS` in order to build Lagom code generators without
instrumentation, we were also removing `-stdlib=libc++`, so Clang ended
up using the runner image's libstdc++ 9 headers. These are too old, and
don't contain `<coroutine>`, leading to a build failure.

Fixes #24578
2024-06-22 20:44:13 +02:00
Ali Mohammad Pur a711bb63b7 LibHTTP+LibCore+RequestServer: Use async streams for HTTP
We no longer use blocking reads and writes, yielding a nice performance
boost and a significantly cleaner (and more readable) implementation :^)
2024-06-19 15:45:02 +02:00
Ali Mohammad Pur be2bf055dd LibCore: Fix some thread-related memory/object leaks 2024-06-19 15:45:02 +02:00
Ali Mohammad Pur 1c31dbd110 LibJS: Make emsdk's clang happy 2024-06-19 15:45:02 +02:00
Ali Mohammad Pur fe3cdda2eb Contrib/VideoPlayerSDL: Disable on emscripten 2024-06-19 15:45:02 +02:00
Ali Mohammad Pur 8c0b13a60a Meta: Update CI emsdk to latest 2024-06-19 15:45:02 +02:00
Ali Mohammad Pur 9f4f319277 RequestServer+LibCore+LibTLS: Use coroutines for socket connection
This allows RS to start connections in parallel without actively waiting
for any possible handshakes.
Doing so gives us a nearly-3x speedup on the average connection latency.
2024-06-19 15:45:02 +02:00
Ali Mohammad Pur 30c41835e6 LibIPC: Actually yield to the event loop when EMSGSIZE or EAGAIN
Previously this just yielded the time slice, which blocked the event
loop until the other side read some data from the socket.
This "fixed" impl is still equally bad, but at least it doesn't block
the event loop.
2024-06-19 15:45:02 +02:00
Ali Mohammad Pur ba54c9adb2 LibCore: Add a couple coroutine-related helper functions 2024-06-19 15:45:02 +02:00
Ali Mohammad Pur 6edf5653a5 AK: Add a formatter for OwnPtr<T>
This formatter just prints the object out as a pointer.
2024-06-19 15:45:02 +02:00
Ali Mohammad Pur 8691d1b885 LibCrypto: Milk some more performance out of galois_multiply()
This simple change makes AES-GCM 5% faster :^)
2024-06-19 15:45:02 +02:00
Ali Mohammad Pur ea15ccdae3 LibCrypto: Remove select individual Vector/Span::at() calls
These were showing up on profiles as quite hot (>5%), we can avoid all
the unnecessary assertions by doing them once in advance and using
pointers for the rest of the function.
This makes AES-GCM about 6% faster.
2024-06-19 15:45:02 +02:00
Nico Weber 1cc4d29d20 LibGfx/WebPWriter: Use align_up_to()
No behavior change.
2024-06-16 14:50:32 -04:00
Nico Weber 8c7a0e6334 LibGfx/WebPWriter: Use count_required_bits()
This is slightly longer than doing it manually, but arguably easier
to read. (And we don't need to convert to float and back.)

No behavior to change.
2024-06-16 14:50:32 -04:00
Ozzelot 96007da65b Ports: Add Schism Tracker 2024-06-15 22:59:36 +02:00
Ozzelot 8d5e63d6d3 Ports: Add SpaceCadetPinball
Co-authored-by: Tim Schumacher <timschumi@gmx.de>
2024-06-15 10:59:36 +02:00
Beckett Normington d26e708bcf Ports: Update perl5 to 5.40.0
Released on 2024-06-09. This commit also removes two patches that have
been upstreamed and are no longer needed.
2024-06-15 10:43:08 +02:00
Liav A. 5133c9d4cb Utilities/du: Add options to filter files with min and max sizes
These options supplements the original threshold option, because it's
now possible to specify a threshold and add either minimum/maximum size
for additional filtering.

It's also possible to not use the old threshold option (that Tim
Schumacher told me it was inherited from coreutils) and only specify the
2 new options to create a filtering.
2024-06-15 09:36:39 +02:00
circl 462abc242e Tests/LibWeb: Add test to verify correctness of getImageData
(cherry picked from commit dbc94ce92e09e987f8a07a5b1e978250286b015a)
2024-06-14 18:18:40 -04:00
circl ec7d44d635 Revert "LibWeb: Use memcpy() in CanvasRenderingContext2D.getImageData()"
This reverts commit 59cb7994c6.

This change caused a bug where getImageData returned the image in
BGRA8888 format instead of RGBA8888.

(cherry picked from commit d2f9ba7db1d8dd1dd611e6a3f40b9125b5aa054d)
2024-06-14 18:18:40 -04:00
Erick Howard 407dfdac37 Build: Update mold version to fix build problems
Mold issue 1178 is now fixed, so Serenity is able to build fine
using Mold
2024-06-14 06:45:36 -04:00