Commit graph

70335 commits

Author SHA1 Message Date
Callum Law
fc395f9824 Tests: Always load WPT interfaces from root interfaces directory
Previously we would load from "../interfaces" which wouldn't work for
nested tests.
2025-07-11 10:57:19 +02:00
ayeteadoe
ccb87b4cb4 Tests/LibGfx: Enable file based tests on Windows
These actually were always working since we first enabling LibGfx
on Windows. I was just running them outside of the ctest context
and therefore had the wrong working directory so the test-inputs folder
could not be found
2025-07-11 10:54:37 +02:00
Tim Ledbetter
88efb362c4 LibWeb: Remove UA styles for h1 in article, aside, nav and section 2025-07-11 08:24:32 +02:00
Jelle Raaijmakers
2998049fe9 LibWeb: Implement the unreachable scrollable overflow
Whenever we end up with a scrollable overflow rect that goes beyond
either of its axes (i.e. the rect has a negative X or Y position
relative to its parent's absolute padding box position), we need to clip
that rect to prevent going into the "unreachable scrollable overflow".

This fixes the horizontal scrolling on https://ladybird.org (gets more
pronounced if you make the window very narrow).
2025-07-11 08:23:46 +02:00
Shannon Booth
05ddf5c718 LibWeb/DOM: Add StorageEvent and DragEvent to Document.createEvent
We have since implemented these interfaces.
2025-07-11 08:22:36 +02:00
Shannon Booth
1d5ca2ae80 Tests/LibWeb: Import WPT Document-createEvent WPT tests 2025-07-11 08:22:36 +02:00
Andrew Kaster
c2a37e693c Utilites: Remove extra dashes from raw strings argument to js
Some checks are pending
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Build Dev Container Image / build (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / 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-07-10 16:28:40 -06:00
Olekoop
d6ea941208 Meta: Fix linker issue when compiling for Android 2025-07-10 15:44:53 -06:00
Olekoop
f26a898ffc Android: Workaround the system certificate issue
Due to removal of local ca-certificates we need to use system's
certificate. However, on Android it is stored in multiple files.
Ladybird doesn't support multiple certificates yet, so we just
concatenate all of them into one big file.
2025-07-10 15:44:53 -06:00
Olekoop
0738852466 Documentation: Update the version of Android Studio 2025-07-10 15:44:53 -06:00
Olekoop
e65a38bb0e Meta: Enable Vulkan and ANGLE when compiling for Android
Vulkan seems to have been disabled due to not being able to compile.
However, it compiles on my machine and it works on my phone.

As for ANGLE, someone just forgot about Android.
2025-07-10 15:44:53 -06:00
Olekoop
af2d46bd3d LibMedia+Meta: Enable FFmpeg under Android and remove the stubs
The licensing issue seems to be resolved (#2214).
The stubs are not longer necessary. Even if they were, they do not
compile properly.
2025-07-10 15:44:53 -06:00
Olekoop
a70fade461 Documentation: Remove metions about Android port not working 2025-07-10 15:44:53 -06:00
Olekoop
f6c90d00a9 Meta: Don't compile libproxy for Android
libproxy isn't availiable for Android.
2025-07-10 15:44:53 -06:00
Olekoop
4b384a3593 Meta: Add a workaround when compiling for Android
We shouldn't do any of this but it's necessary in order to link it
properly.
2025-07-10 15:44:53 -06:00
Olekoop
834eb04d33 ImageDecoder: Make it compile for Android 2025-07-10 15:44:53 -06:00
Olekoop
6f350c51fd Android: Keep up with the times
While some of the changes are due to syntax and have no effect on
the functionality, others are more important.

The major changes are
- Use Painter instead of now removed DeprecatedPainter
- Remove the need of LibArchive by using Java's native zip support
- Have a proper C++23 compiler by updating NDK to r29 beta 2
- Store user data and config in an user accessible way
- Update AGP to 8.11 and update compile target to SDK level 35
2025-07-10 15:44:53 -06:00
Jelle Raaijmakers
c99a467cdb LibWeb: Do not crash when navigating to mailto: links
We forgot to implement a couple of "otherwise," statements from the
"populating a session history entry" spec. While we're here, let's
update the spec copy where relevant.
2025-07-10 22:43:30 +02:00
Jelle Raaijmakers
d822b96786 LibWeb: Remove setting the Skia backend context in Navigable
Some checks are pending
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / 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 unused. The backend context is also referenced in the Skia
player, which we move to the rendering thread.
2025-07-10 15:27:58 +02:00
Shannon Booth
bd6581fe22 LibRegex: Correctly use ClassSetReservedPunctuator in ClassSetCharacter
Some checks are pending
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / 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
We had typo'd using ClassSetReservedDoublePunctuator which was
resulting in a parse error for the regex:

([^\\:]+?)

With the 'v' flag set.

Co-Authored-By: Ali Mohammad Pur <mpfard@serenityos.org>
2025-07-10 11:41:02 +02:00
Jelle Raaijmakers
3a232880ed Meta: Remove Polar from FUNDING.yml and FAQ.md
The issue bounty system was discontinued, so remove it from our GitHub
repo's sponsoring links and documentation.
2025-07-10 10:04:33 +02:00
Lucien Fiorini
8b1f1ae87a js: Rename the --disable-string-quotes flag to --raw-strings
Some checks are pending
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Build Dev Container Image / build (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / 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
Since it does more than removing the quotes by escaping the string too
It makes sense to change the name of the flag to something more close
to what it's really doing.
2025-07-09 18:30:02 -06:00
Lucien Fiorini
8caa7c89cf js: Safely acquire print target AK::Stream
Flush the buffered output stream before acquiring an unbuffered
AK::Stream and add support for newline within the print function.
2025-07-09 18:30:02 -06:00
ayeteadoe
8b778de36b Meta: Update vcpkg for patched libjxl port and remove our overlay port 2025-07-09 17:52:32 -06:00
Ben Eidson
3aff12bbab LibWeb/WebAudio: Implement AudioNode::disconnect()
Destubs AudioNode::disconnect() and its related overloads.

Ensures that inverse connections are properly removed
when disconnecting AudioNodeConnections. Adds associated
WPT but skips them for now because they rely on
OfflineRenderContext::start_rendering to be fully implemented.
2025-07-09 17:52:06 -06:00
ayeteadoe
75d26b1610 CMake: Improve preset display names and descriptions
Now all configure and build presets have consistently formatted
display names with useful content
2025-07-09 16:26:59 -06:00
Andrew Kaster
fa003fb2b0 LibTest: Move declaration of JS main target around to avoid CMake bug
For some reason, with CMake 4.0.3 and the Swift language enabled, this
target was getting random tokens in the compile commands. Moving it up
to the top of the file seems to fix this.
2025-07-09 16:26:49 -06:00
Andrew Kaster
a0b902cca1 CMake: Set visibility flags with add_cxx_compile_options() helper
This makes the flags not break Swift builds
2025-07-09 16:26:49 -06:00
Andrew Kaster
3040ca4311 LibWeb: Remove noisy debug messages from HTMLParser 2025-07-09 16:26:49 -06:00
Andrew Kaster
ce01236000 Meta: Update swift version to 2025-06-22 2025-07-09 16:26:49 -06:00
Tim Ledbetter
438bb56160 LibWeb/SVG: Don't crash when a filter has no valid effects 2025-07-10 00:18:25 +02:00
Luke Wilde
0cff47828d LibWeb/CSP: Implement the script-src directive 2025-07-09 15:52:54 -06:00
Luke Wilde
3d43462ccd LibJS: Implement the Dynamic Code Brand Checks stage 3 proposal
This is an active proposal at stage 3 of the TC39 proposal process.
See: https://tc39.es/proposal-dynamic-code-brand-checks/
See: https://github.com/tc39/proposal-dynamic-code-brand-checks

This proposal essentially adds support for the TrustedScript type from
the Trusted Types specification to eval and Function. This in turn
pipes support for the type into the CSP hook to check if the CSP allows
dynamic code compilation.

However, it currently doesn't support ShadowRealms, so the
implementation here is a close approximation, using PerformEval as the
basis.
See: https://github.com/tc39/proposal-dynamic-code-brand-checks/issues/19

This is required to support the new function signature for the CSP
hook, and will allow us to slot in Trusted Types support in the future.
2025-07-09 15:52:54 -06:00
Luke Wilde
2368641de5 LibWeb: Track if element was created from token with dupe attributes
This is required for CSP to ignore the nonce attribute to prevent
duplicate attributes hijacking the attribute.

See https://w3c.github.io/webappsec-csp/#security-nonce-hijacking
2025-07-09 15:52:54 -06:00
Andrew Kaster
b6b030aa43 CI: Update preset name for test262 job 2025-07-09 23:41:58 +02:00
Jelle Raaijmakers
37b8ab54df CI+CMake: Remove most of the *_CI CMake presets
These existed because of their `vcpkg_ci` base preset, whose goal was to
enable vcpkg-supported caching on GitHub. We now handle vcpkg caching in
the CI steps, removing the necessity for all these *_CI preset variants.

This allows us to reuse `inputs.build_preset` in the test step, and we
can do away with the Windows-specific test step since it is now almost
identical to the Linux/macOS test step.

I've left in the Windows_CI presets, because that one actually results
in a different set of compiled files compared to the
Windows_Experimental presets.
2025-07-09 15:32:57 -06:00
Jelle Raaijmakers
4a57fe4392 CI+CMake: Enable vcpkg source assets cache
I've set up a shared vcpkg source assets cache using Azurite. By
default, it runs in read-only mode allowing anyone who builds Ladybird
to use the cache to speed up downloads of source tarballs. This should
alleviate some of the more slower vcpkgs downloads I've been seeing
lately.

CI runs on master put vcpkg in readwrite mode, updating the cache for
everyone.
2025-07-09 15:32:57 -06:00
Jelle Raaijmakers
de36d9fb85 CI: Unify the Linux/macOS/Windows build steps
For macOS, we now default to ENABLE_QT=OFF and use the same build step
as for the other platforms. We keep a single separate macOS + Qt build
step to prevent bitrotting that part of the code.

The Windows step ran in a different directory and skipped the install
step; we can just use the Linux behavior here.
2025-07-09 15:32:57 -06:00
Luke Wilde
08a03534af Meta+RequestServer: Enable HTTP/3 for curl
This adds an overlay port for curl that adds the features required for
HTTP/3.

This is not quite compatible with the upstream vcpkg.json, because
enabling HTTP/2 makes it use the default SSL backend, which is
sectransp for macOS and schannel on Windows. These backends are not
compatible with ngtcp2. Additionally, we can not build curl with
multiple SSL backends when using ngtcp2.

I couldn't find a way to selectively disable/enable dependencies based
on what features are enabled, so I made HTTP/2 pick OpenSSL in our
overlay port. Upstream vcpkg will likely want to support wolfSSL and
GnuTLS backends for ngtcp2, so they'll be additional work to get this
into upstream.
2025-07-09 14:44:56 -06:00
Luke Wilde
993d8df29b Meta: Add overlay port for curl
This will be used to add HTTP/3 support.
2025-07-09 14:44:56 -06:00
Tim Ledbetter
c4cf1ccede LibWeb: Don't crash when parsing ASF with non comma-separated arguments 2025-07-09 19:47:12 +01:00
Aliaksandr Kalenik
193900d661 LibWeb: Cache compiled shaders for masks in DisplayListPlayerSkia
Some checks are pending
CI / Linux, x86_64, Fuzzers_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, Clang (push) Waiting to run
CI / macOS, arm64, Sanitizer_CI, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / 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
By avoiding recompilation every time `apply_mask_bitmap()` is called, we
save ~5 ms (20ms -> 15ms) in rendering of browser channel on Discord on
my machine.
2025-07-09 19:21:31 +02:00
Lucien Fiorini
4711c38aa1 Tests: Add screenshot test for the background SVG in the LB website 2025-07-09 18:07:12 +01:00
Lucien Fiorini
635adc8aa7 LibWeb/SVG: Implement resolution for a subset of SVG filters 2025-07-09 18:07:12 +01:00
Lucien Fiorini
5d85959f5f LibWeb/SVG: Add FEGaussianBlurElement 2025-07-09 18:07:12 +01:00
Lucien Fiorini
f8b12614df LibWeb/SVG: Add FEBlendElement 2025-07-09 18:07:12 +01:00
Lucien Fiorini
d3684a36b0 LibWeb/SVG: Add FEFloodElement 2025-07-09 18:07:12 +01:00
Lucien Fiorini
de271b16fc LibWeb/SVG: Add FilterPrimitiveStandardAttributes 2025-07-09 18:07:12 +01:00
Lucien Fiorini
6fb75b5ba9 LibWeb/SVG: Add filter primitive attributes 2025-07-09 18:07:12 +01:00
Callum Law
a8fc15c6b3 LibWeb: Don't fail on non-fill keyword parsing <border-image-slice>
Previously if we encountered a keyword other than `fill` when parsing
`<border-image-slice` we would return a nullptr.

This could cause issues when we parse `<border-image-slice>` as part of
parsing `border-image`, for example `border-image: 100% none` would fail
as we would try parse `none` as part of the `<border-image-slice>`
instead of `<border-image-source>`.

This change makes it so that we don't consume the token and leave it to
be parsed as part of the next section of the grammar.
2025-07-09 16:59:22 +01:00