1
0
mirror of https://github.com/SerenityOS/serenity synced 2024-07-05 22:34:49 +00:00
Commit Graph

61943 Commits

Author SHA1 Message Date
Andreas Kling
97edca4e4e LibWeb: Fix overeager fallback to stretch-fit width for some flex items
If a flex item has a preferred aspect ratio and the flex basis is not
definite, we were falling back to using stretch-fit for the main size,
since that appeared to match other browsers.

However, we missed the case where we actually have a definite cross size
through which the preferred aspect ratio can be naturally resolved.

(cherry picked from commit db1faef786dbd1722bbe6a1f4a5616f3069bdb6a)
2024-06-26 14:13:40 +02:00
Andreas Kling
47d7a3648e LibWeb: Allow flex-basis: {min,max,fit}-content
(cherry picked from commit 9c02ace89785cbc185553dc2711f79c4ad1bf389)
2024-06-26 14:13:40 +02:00
Jamie Mansfield
ef7d593463 LibWeb: Implement IDBRequest.onerror
(cherry picked from commit 68d84755f4b745351d3d494759d59ba6719b8ad8)
2024-06-26 14:13:20 +02:00
Jamie Mansfield
6d268be6fc LibWeb: Implement IDBRequest.onsuccess
(cherry picked from commit 5ebc09c83b5ffd75341f8ddca9db3a49f587ed8d)
2024-06-26 14:13:20 +02:00
Jamie Mansfield
2f0b9c6dab LibWeb: Implement IDBOpenDBRequest.onupgradeneeded
(cherry picked from commit fe3962a64d1ab019b36965ecc60fe495adfd9295)
2024-06-26 14:13:20 +02:00
Jamie Mansfield
aec46809fe LibWeb: Implement IDBOpenDBRequest.onblocked
(cherry picked from commit 30db7fb323c6041367155e646270e2a58f4233ea)
2024-06-26 14:13:20 +02:00
Jamie Mansfield
214797a69a LibWeb: Implement HTMLStyleElement.disabled
(cherry picked from commit 1114bbf2f155aeaa8d6b368a4eb567469c5d4fe3)
2024-06-26 14:13:20 +02:00
Jamie Mansfield
33262421a2 LibWeb: Remove is_media_feature_name function
This was made redundant in GH-12971 (SerenityOS), and removing it drops
a FIXME :^)

See:
- https://github.com/SerenityOS/serenity/pull/12971

(cherry picked from commit be08abbf8a0a62ae46275c3133f711c27b2efa02)
2024-06-26 14:13:20 +02:00
Andreas Kling
f1dcf567e4 Tests: Add a basic test for Declarative Shadow DOM
(cherry picked from commit 7ce350b8c069c13540c50631413b2150bab967d4)
2024-06-26 08:48:11 +02:00
Andreas Kling
83d0599d1c LibWeb: Add Element.getHTML() and ShadowRoot.getHTML()
(cherry picked from commit fb9f3f10f3090cc2822d2c681bd7350dda17830e)
2024-06-26 08:48:11 +02:00
Andreas Kling
e4feb43e86 LibWeb: Update innerHTML & co IDL definition to match spec
This stuff has moved from a mixin defined by the DOM Parsing spec, over
to the HTML spec, where they are now defined as partial interfaces for
Element and ShadowRoot.

There's also some new functionality that we don't implement yet, so
patch marks them as FIXME properties.

(cherry picked from commit 0c47b3ff971437c4bd3923134d26ad086b5f6a75)
2024-06-26 08:48:11 +02:00
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