Timothy Flynn
141afbc63d
headless-browser: Allow specifying the path to the saved screenshot
...
This is to help make creating Screenshot tests a bit easier.
2025-05-20 10:48:03 -04:00
Andreas Kling
d7cd8f0fc7
LibWeb: Make CSS sign(A) ignore A's unit and just look at the raw value
...
This allows stuff like sign(1em) even when we don't have something to
resolve the em unit against.
+25 new WPT subtest passes.
2025-05-20 13:28:40 +02:00
Andreas Kling
4ef34ebd96
LibWeb: Make CSS sign(A) behave correctly for negative zero
...
We were incorrectly returning 0 instead of -0 for sign(-0).
+7 new WPT subtest passes.
2025-05-20 13:28:40 +02:00
Andreas Kling
c1e79d0b13
LibWeb: Handle calc() in CSS z-index
...
We also make getComputedStyle() reflect the actually used z-index value,
since otherwise this change is hard to observe.
+26 new WPT subtest passes.
2025-05-20 13:28:40 +02:00
Andreas Kling
821d54de7f
LibWeb: Invalidate layout tree on CSS position property change
...
When position changes, we may need to make larger structural updates
to the layout tree. A simple relayout is not sufficient.
This was a source of flakiness in the engine, and gives us at least
+28 new WPT subtest passes.
2025-05-20 13:28:40 +02:00
Andrew Kaster
f66c55138b
Utilities: Move install rules for js repl to Utilities
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-05-19 18:37:15 -04:00
Andrew Kaster
6548f9b6dd
CMake: Move library subdirectory inclusion to Libraries/CMakeLists.txt
2025-05-19 18:37:15 -04:00
Andrew Kaster
e4fb3a86a1
Tests: Move Tests CMake rules to Tests/CMakeLists.txt
...
Get this logic out of Meta/Lagom/CMakeLists.txt, in the hope that we
can eventually remove the Lagom CMakeLists.txt file entirely.
2025-05-19 18:37:15 -04:00
Andrew Kaster
26c76a8347
Tests: Move test-wasm build rules to Tests/LibWasm
2025-05-19 18:37:15 -04:00
Andrew Kaster
da106177b4
AK: Move install rules into AK's CMakeLists
2025-05-19 18:37:15 -04:00
Andrew Kaster
5418165690
Tests: Move LibJS test rules to Tests/LibJS
2025-05-19 18:37:15 -04:00
Andrew Kaster
72ca813b6b
CMake: Handle CMP0174 in Lagom CMake functions, and support CUSTOM_MAIN
2025-05-19 18:37:15 -04:00
Andrew Kaster
bf01470732
Tests: Remove unused test-test262 application
...
This test app was created to run test262-based tests on the SerenityOS
target, without having to port the entire test262 runner and driver
python script. We have no need for it here.
2025-05-19 18:37:15 -04:00
Andrew Kaster
432bc0f638
LibTLS+Tests: Build LibTLS tests from their test directory
...
Instead of building them from Lagom, build them here and use lagom_test.
Also remove second download of cacert.pem.
2025-05-19 18:37:15 -04:00
Andrew Kaster
1878ed10d2
CMake: Move Utilities build rules to Utilities directory
2025-05-19 18:37:15 -04:00
Andrew Kaster
94a20f6706
Tests+Utilities: Move test262-runner to Utilities
...
This is a utility more than it is a test in itself. We use it to run
test262 tests, which are external to this repo. The test-js runner is
still private test infrastructure though, so it stays where it is.
2025-05-19 18:37:15 -04:00
Andrew Kaster
52efd90445
CMake: Remove old gcc version check
...
We require newer than gcc 12 at this point, so this check is no longer
needed.
2025-05-19 18:37:15 -04:00
Sam Atkins
6e45d8ba6c
LibWeb/CSS: Set enum sizes for PropertyID and Keyword
...
The effect of this is hard to measure, but reducing them from 4 bytes
each to 2 bytes can't hurt. :^)
2025-05-20 10:14:21 +12:00
Sam Atkins
3add623f22
LibWeb/CSS: Use underlying_type_for_enum() for Enums.json generator
...
Replacing the duplicate implementation.
2025-05-20 10:14:21 +12:00
Sam Atkins
c4bcbff59a
LibWeb/CSS: Set enum sizes for media query types
...
This reduces `MediaFeature` from 112 to 104 bytes.
2025-05-20 10:14:21 +12:00
rmg-x
e2fa8cf7a8
LibWeb+Tests: Continue variable expansion if CSS-wide keyword is parsed
...
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 allows the existing fallback logic in `Parser::expand_variables` to
run when a CSS-wide keyword is encountered.
2025-05-19 16:32:07 +01:00
Andreas Kling
ab051f2e12
LibWeb: Maintain tree order inside LayoutState
...
Before this change, we were at the mercy of hashed pointer addresses
when processing fragment relocation in LayoutState::commit().
This made inline fragment order non-deterministic, causing layouts to
shift around seemingly randomly on page reload.
By simply using OrderedHashMap, we automatically get tree order
processing here. This fixes a bunch of flaky tests on WPT.
2025-05-19 15:21:53 +02:00
Tim Ledbetter
5dc507c573
Tests: Re-enable some ref tests that now pass
2025-05-19 14:12:25 +01:00
Tim Ledbetter
2f71f563c6
Tests: Re-enable HTML parsing tests that previously crashed
2025-05-19 14:12:25 +01:00
Andreas Kling
1a055fcb24
LibWeb: Mark canvas element for relayout when width or height changes
...
While width and height are presentational hints on canvas, they actually
map to the CSS aspect-ratio attribute, not to CSS width and height.
For this reason, we actually need to manually mark for relayout here.
Also import a WPT test that was flaky before this change.
2025-05-19 13:58:05 +02:00
Shannon Booth
14d5c638eb
LibWeb/HTML: Use find flattened slots in assignedElements/assignedNodes
...
This is very awkward, and should be improved, but this improves
our support for slots :^)
2025-05-19 23:26:02 +12:00
Shannon Booth
2d6b11c8cb
LibWeb/DOM: Implement 'find flattened slottables'
...
Returning a Vector of Slottable is not very nice here, but this
matches find_slottable (which this calls), and as far as I can
tell this is technically 'safe' at the moment in the way in
which it is / will be called.
It's also not great that like find_slottable it takes a non-const
ref, but changing that causes a bunch of other fallout.
2025-05-19 23:26:02 +12:00
Shannon Booth
98c45f3f03
Tests/LibWeb: Import a bunch of slots WPT tests
2025-05-19 23:26:02 +12:00
Colin Reeder
5ac88e7726
RequestServer: Leave Accept-Encoding up to curl
2025-05-19 13:18:44 +02:00
Tim Ledbetter
c4d298674b
Tests: Re-enable interpolation tests
...
These run significantly faster than they did when they did when they
were disabled.
2025-05-19 11:31:47 +01:00
Tim Ledbetter
09f4d90594
LibWeb: Clamp interpolated values to the range of their numeric type
...
This fixes a UBSAN warning that we previously hit when interpolating
color values.
2025-05-19 11:31:47 +01:00
Tim Ledbetter
58ffc56c38
LibWas: Unbreak compilation with WASM_TRACE_DEBUG
enabled
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-05-19 10:20:40 +01:00
Tim Ledbetter
7d7bab7cac
LibWeb: Ensure resolved border-width values are non-negative
2025-05-19 09:55:09 +02:00
Ashton
5f5ae6bf8b
AK: Replace wchar_t formatting with char32_t
...
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 makes TestFormat fully cross-platform as we no longer have to
work around the 16 vs 32-bit wide strings
2025-05-18 19:18:13 -06:00
Ashton
7f0f513159
AK: Remove unnecessary Aarch64 wchar_t handling
...
This is legacy from the Serenity codebase, but given there are no
consumers using wchar_t in Ladybird, this can be removed.
2025-05-18 19:18:13 -06:00
Ashton
4b3a3b0856
AK: Remove redundant TestPrint test
...
This test was only useful when AK/PrintfImplementation.h existed. But
that was removed 11 months ago, so since then this has just been
testing std library functions not implemented by us.
2025-05-18 19:18:13 -06:00
Andrew Kaster
4d039fc3d4
LibWeb+WebWorker: Create SharedWorkerGlobalScope for Shared Workers
...
Also push the onconnect event for the initial connection.
This still doesn't properly handle sending an onconnect event to a
pre-existing SharedWorkerGlobalScope with the same name for the same
origin, but it does give us a lot of WPT passes in the SharedWorker
category.
2025-05-18 17:50:05 -06:00
Andrew Kaster
978a3b7321
LibWeb: Move AgentType enum to its own header
2025-05-18 17:50:05 -06:00
Andrew Kaster
4af0daf3eb
LibWeb: Check actual WorkerGlobalScope subclass to set top level origin
...
Checking against DedicatedWorkerHost was probably a typo.
2025-05-18 17:50:05 -06:00
Andrew Kaster
62592c19fe
LibWeb: Reorganize EmbedderPolicy to shrink the size by 8 bytes
2025-05-18 17:50:05 -06:00
Andrew Kaster
b10a98b0cb
LibWeb: Move name attribute to WorkerGlobalScope from subclasses
...
Also refactor the other properties of WorkerGlobalScope to match the
spec better.
2025-05-18 17:50:05 -06:00
Andreas Kling
cef9564728
LibWeb: Only serialize CSS numbers with up to 5 decimals
...
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 fixes an issue where we'd serialize some floating point numbers
with excessive precision, resulting in unpleasant-looking numbers like
0.49999999999999999 and such.
At least 90 new subtests passing on WPT, possibly more. :^)
2025-05-18 17:23:34 +02:00
Andreas Kling
f813c495ae
Tests: Import a WPT test for sin(), cos() and tan() serialization
2025-05-18 17:23:34 +02:00
Andreas Kling
734bc2a0ea
AK: Strip trailing zero decimals in default formatting of float numbers
...
This gives us a more human-looking serialization of numbers by default,
and in case a fixed number of decimal digits is actually wanted, we
still have the 'f' specifier.
2025-05-18 17:23:34 +02:00
Jelle Raaijmakers
e004be7a08
LibWeb: Resolve editing FIXMEs related to unimplemented commands
...
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
We have implemented all commands in the editing spec that potentially
reference one another, so we can now rely on the fact that any command
that gets passed to these methods has a definition. User-provided
commands still get checked by means of `queryCommandSupported()` and
friends.
No functional changes.
2025-05-18 14:37:56 +12:00
Daniel Bertalan
33dbe385ce
AK: Replace CallableWrapper::destroy()
with a destructor
...
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
Previously, heap-allocated `CallableWrapper` objects were destroyed in a
very roundabout way: `AK::Function` would call a virtual `destroy()`
method, which then invoked delete manually. This was unnecessary, since
`CallableWrapper` already has a virtual destructor — deleting it through
a `CallableWrapperBase*` correctly calls the closure's destructor.
This fixes GCC `-Wfree-nonheap-object` false positive warnings (#4721 )
and coincidentally removes 8 KB of vtable entries (and the corresponding
relative relocations) from LibJS.
2025-05-17 15:07:42 -06:00
Aliaksandr Kalenik
b559965448
LibJS+LibWeb: Replace StringOrSymbol usage with PropertyKey
...
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
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, 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
- Avoids unnecessary conversions between StringOrSymbol and PropertyKey
on the hot path of property access.
- Simplifies the code by removing StringOrSymbol and using PropertyKey
directly. There was no reason to have a separate StringOrSymbol type
representing the same data as PropertyKey, just with the index key
stored as a string.
PropertyKey has been updated to use a tagged pointer instead of a
Variant, so it still occupies 8 bytes, same as StringOrSymbol.
12% improvement on JetStream/gcc-loops.cpp.js
12% improvement on MicroBench/object-assign.js
7% improvement on MicroBench/object-keys.js
2025-05-17 10:08:37 -04:00
Shannon Booth
5495531118
LibJS: Implement 'less than' for a String over code units
...
...Instead of code points.
2025-05-17 08:00:59 -04:00
Shannon Booth
d1a40b7951
LibWeb/Infra: Use Utf16View for code_unit_less_than
...
The Utf16View implemention is a more effecient implementation
and less code overall.
2025-05-17 08:00:59 -04:00
Shannon Booth
5cf87dcfdc
AK: Add a Utf16View::is_code_unit_less_than helper
...
This seems like the natural place to put this since it is specific
to UTF-16.
2025-05-17 08:00:59 -04:00