Commit graph

68626 commits

Author SHA1 Message Date
Andrew Kaster
20352cc05b Meta: Update vcpkg to latest main revision
This should resolve CMake 4.0 issues on macOS using the fix upstream
vcpkg came up with.
2025-04-03 08:03:48 -06:00
Andrew Kaster
91c1aed57f Revert "Meta: Add workaround for CMake 4.0 policy minimum changes"
This reverts commit 04d44c9b26.
2025-04-03 08:03:48 -06:00
Andreas Kling
cba80580e2 Revert "LibJS: Avoid calling generic Instruction::length() during dispatch"
This reverts commit 8f2ee01e6f.

Speculative revert, as this appears to severely regress performance on
our JS benchmark runner.
2025-04-03 15:09:49 +02:00
Andreas Kling
ec590ef3e6 LibJS: Add builtin for Math.random() 2025-04-03 13:56:39 +02:00
Andreas Kling
714e8aec8a LibJS: Add builtin for Math.imul() 2025-04-03 13:56:39 +02:00
Andreas Kling
ab5d5d8b50 LibGC: Avoid excessive bitfield use in GC::Cell
We didn't actually save any space by making the Cell flags bitfields.
In fact, it just forced us to do bit twiddling when accessing them.
2025-04-03 13:56:39 +02:00
Andreas Kling
8f2ee01e6f LibJS: Avoid calling generic Instruction::length() during dispatch
Since we know the exact type, we can avoid calling the generic lookup
function that branches on instruction type.
2025-04-03 13:56:39 +02:00
Aliaksandr Kalenik
4b04e97feb LibWeb: Send IPC messages exceeding socket buffer through shared memory
It turned out that some web applications want to send fairly large
messages to WebWorker through IPC (for example, MapLibre GL sends
~1200KiB), which led to failures (at least on macOS) because buffer size
of TransportSocket is limited to 128KiB. This change solves the problem
by wrapping messages that exceed socket buffer size into another message
that holds wrapped message content in shared memory.

Co-Authored-By: Luke Wilde <luke@ladybird.org>
2025-04-03 13:55:41 +02:00
Aliaksandr Kalenik
bc0ec84100 LibWeb: Don't queue rendering task for empty display lists
Some checks are pending
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (arm64, macos-15, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (x86_64, ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
2025-04-02 23:22:38 +02:00
Aliaksandr Kalenik
cf143cf118 LibWeb: Don't call flush() when no surface is passed in execute_impl()
`DisplayListPlayer::execute_impl()` can receive null surface if it was
invoked to rasterize nested display lists (we use them for iframes). In
this case we should not call `flush()` by the end of execution and wait
until outer display list execution will do that.
2025-04-02 23:22:38 +02:00
Timothy Flynn
920170f60a LibWebView+UI: Remove native do-not-track setting
Some checks are pending
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Build Dev Container Image / build (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (arm64, macos-15, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (x86_64, ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
2025-04-02 14:16:18 -04:00
Timothy Flynn
1be3e7fd8a LibWebView: Add do-not-track setting to about:settings 2025-04-02 14:16:18 -04:00
Timothy Flynn
49dae536a7 Base: Replace bespoke input switch with native element
Turns out we support <input type=checkbox switch>, so let's use it!
2025-04-02 14:16:18 -04:00
Andrew Kaster
04d44c9b26 Meta: Add workaround for CMake 4.0 policy minimum changes
In CMake 4.0, having a minimum policy version set to less than 3.5 is
a hard error at configure time. Add an override until the issue can be
resolved in vcpkg itself.
2025-04-02 10:50:18 -06:00
Andrew Kaster
8e0786641f Meta: Explicitly enable zstd feature for tiff in vcpkg
Without this, the library was pulling system libzstd implicitly.
2025-04-02 10:50:18 -06:00
Andrew Kaster
6c0f97dcf2 Meta: Omit vcpkg overlay ports from style and EOF lints 2025-04-02 10:50:18 -06:00
Andrew Kaster
8455d23a4b Revert "Meta: Add fontconfig and freetype vcpkg overlays"
This reverts commit 20890d7b70.

The maintenance and downtime for the freedesktop GitLab is resolved.
2025-04-02 10:50:18 -06:00
Andrew Kaster
1fec9d6917 Meta: Update vcpkg to latest master
This includes some fixes for cmake 4.0, but not all.
2025-04-02 10:50:18 -06:00
Sam Atkins
3af25b9d2f LibWeb/SVG: Mark SVG factory functions as [NewObject]
Corresponds to 9991813a66
2025-04-02 17:28:45 +01:00
Sam Atkins
b74ec1ab7e LibWeb/SVG: Remove fixme about SVGSVGElement::getElementById()
Resolved in e02e2c6465
2025-04-02 17:28:45 +01:00
Sam Atkins
07adbddbcd LibWeb/SVG: Remove SVGAElement.text attribute
Corresponds to 7210af6604
2025-04-02 17:28:45 +01:00
Sam Atkins
02e8c0e1d1 LibWeb/HTML: Allow throwing SecurityError for push/replaceState() abuse
Corresponds to 73e51b414b
2025-04-02 17:28:06 +01:00
Sam Atkins
7367150536 LibWeb/HTML: Update FIXME to not reset form-associated custom elements
Corresponds to e6bdd0557a
2025-04-02 17:28:06 +01:00
R-Goc
5226a566e9 AK: Modify IntrusiveRedBlackTree for Windows
IntrusiveRedBlackTree relies on a member pointer for accessing the value
of a node. On windows member pointers can be of variable length,
depending on the inheritance structure of the class. This commit casts
the 4 byte member pointer, or rather offset to a full pointer type, so
that the bit_cast to u8* works, as previously the source was smaller
than the destination, which fails inside __builtin_bit_cast().
2025-04-02 10:22:08 -06:00
Timothy Flynn
e879fd29b3 Base: Use correct color code for Slate Blue 100 2025-04-02 11:41:01 -04:00
Sam Atkins
405785f584 Tests: Disable 3 tests that are flaky on CI 2025-04-02 16:08:53 +01:00
Sam Atkins
86b57a5205 LibWeb/CSS: Use font_format_is_supported() when parsing font sources 2025-04-02 15:53:50 +01:00
Sam Atkins
bd7a08da3b Tests: Reimport font-stretch tests as font-width
Corresponds to 7c0c4806bb
2025-04-02 14:55:27 +01:00
Tim Ledbetter
cbb169820a LibWeb/CSS: Implement the CSSImportRule.media attribute 2025-04-02 13:53:03 +01:00
Tim Ledbetter
b93d2b7be2 IDLGenerators: Don't attempt to set null [PutForwards] attribute
Previously, attempting to set a `[PutForwards]` annotated attribute,
would crash if the associated getter returned null.
2025-04-02 13:53:03 +01:00
Tim Ledbetter
ac19b0cda8 LibWeb/CSS: Support media queries in import at-rules 2025-04-02 13:53:03 +01:00
Timothy Flynn
c1fe912bf9 UI/AppKit: Implement an autocomplete view for the location bar 2025-04-02 08:52:45 -04:00
Timothy Flynn
60dd5cc4ef UI/Qt: Migrate to LibWebView's autocomplete engine
As a result, we now no longer depend on Qt::Network.
2025-04-02 08:52:45 -04:00
Timothy Flynn
a87c264088 UI/Qt: Add a couple of missing includes
These are currently being transitively included. This will no longer be
the case in a future patch.
2025-04-02 08:52:45 -04:00
Timothy Flynn
5d2e6ffe30 LibWebView: Add autocomplete settings to about:settings
This implements an autocomplete engine inside LibWebView, to replace the
engine currently used by Qt. Whereas Qt uses the Qt Network framework to
perform autocomplete requests, LibWebView uses RequestServer. This moves
downloading this untrusted data out of the browser process.

This patch only implements the persisted settings and their UI. It does
not integrate this engine into the browser UI.
2025-04-02 08:52:45 -04:00
Timothy Flynn
92e1d297be LibRequests: Protect Request callbacks against stopped requests
When the request is stopped, we clear its internal stream data. There is
a window where RequestServer may have sent an IPC message whose callback
will try to access that data in the time between the data being cleared
and RS receiving the stop signal. When this happens, just bail from IPC.
2025-04-02 08:52:45 -04:00
Timothy Flynn
0de017df9b LibRequests: Move NetworkError stringification to LibRequests
Let's also rename the file to NetworkError.h while we're here. No need
to have "Enum" in the name.
2025-04-02 08:52:45 -04:00
Shannon Booth
a5df972055 LibWeb: Do not store network errors as a StringView
Some checks are pending
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (arm64, macos-15, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (x86_64, ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
This is very clearly a very dangerous API to have, and was causing
a crash on Linux as a result of a stack use-after-free when visiting
https://www.index.hr/.

Fixes #3901
2025-04-02 11:43:53 +02:00
Kenneth Myhra
82a2ae99c8 Everywhere: Remove DeprecatedFlyString + any remaining references to it
This reverts commit 7c32d1e8a5.
2025-04-02 11:43:13 +02:00
Ali Mohammad Pur
4136d8d13e LibRegex: Use an interned string table for capture group names
This avoids messing around with unsafe string pointers and removes the
only non-FlyString-able user of DeprecatedFlyString.
2025-04-02 11:43:13 +02:00
Andreas Kling
6bb0d585e3 LibJS: Elide function wrapper for class field literal initializers
Some checks are pending
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (arm64, macos-15, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (x86_64, ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
If a class field initializer is just a simple literal, we can skip
creating (and calling) a wrapper function for it entirely.

1.44x speedup on JetStream3/raytrace-private-class-fields.js
1.53x speedup on JetStream3/raytrace-public-class-fields.js
2025-04-01 23:55:20 +02:00
Aliaksandr Kalenik
fd147e6be0 LibWeb: Protect SkiaBackendContext with a mutex
The Skia Ganesh backend we currently use doesn't support painting from
multiple threads, which could happen before this change when the main
thread used Skia to paint on the HTML canvas while the rendering thread
was working on display list rasterization.

Fixes https://github.com/LadybirdBrowser/ladybird/issues/4172
2025-04-01 23:39:05 +02:00
Aliaksandr Kalenik
24527b6ae3 LibWeb: Pass PaintingSurface into DisplayListPlayer::execute()
Deleteing set_surface() makes DisplayListPlayer API a bit more intuitive
because now caller doesn't have to think whether it's necessary to
restore previous surface after execution, instead DisplayListPlayer
takes care of it by maintaining a stack of surfaces.
2025-04-01 23:39:05 +02:00
Timothy Flynn
b23b21fa4a UI/AppKit: Restore custom cursor shown on link hover
This seems to have broken in some recent-ish AppKit update. When we add
the status label to the view hierarchy / change its visibility state,
the NSApp is resetting the cursor to the standard cursor. By overriding
the cursorUpdate method to do nothing, we prevent this from happening.
2025-04-01 23:10:14 +02:00
Timothy Flynn
b64d450f32 CI: Set correct architecture for JS artifact builds 2025-04-01 16:49:28 -04:00
Timothy Flynn
c5c3859205 CI: Temporarily install CMake 3.x
Many vcpkg dependencies do not work with CMake 4.x, which GitHub Actions
now bundles by default. Install the latest 3.x from Kitware for now.
2025-04-01 20:49:03 +02:00
Andreas Kling
fd0a0e963a LibJS: Make IteratorRecord slightly smaller
By reordering the members, we take this from 40 bytes to 32 bytes.
2025-04-01 20:16:39 +02:00
Jelle Raaijmakers
23f0fddeab LibWeb: Let LineBuilder decide on Y-coordinate for float insertion
Some checks are pending
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
Instead of reaching into the IFC of the LineBuilder from the BFC, we
should let LineBuilder determine how to deal with the running vertical
float clearance. No functional changes.
2025-04-01 16:02:53 +02:00
Jelle Raaijmakers
6d911a6baa LibWeb: Resolve block height correctly after line break with clear: ..
If a block with inline children ends with a line break clearing any
floats, we not only need to take the introduced clearance into account
for the next line box, but the containing block needs to set the correct
height as well.

Since the spec calls for using the last line box' bottom as the resolved
height (if treated as auto), we now correctly apply the clearance to the
previous line box' bottom coordinate.

Fixes #4058.
2025-04-01 16:02:53 +02:00
Andreas Kling
e5db913b0d Revert "LibRegex: Port remaining DeprecatedFlyString to ByteString"
This reverts commit aab3fbe254.

Greatly regressed JavaScript benchmark performance.
2025-04-01 15:40:38 +02:00