Commit graph

71003 commits

Author SHA1 Message Date
dependabot[bot]
60ca15c0de CI: Bump actions/checkout from 4 to 5
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-12 07:05:19 -04:00
Jelle Raaijmakers
a64cee528c CI: Update to Xcode 16.4
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
Our current macOS runners have Xcode 16.4 installed.
2025-08-11 18:25:34 +02:00
Callum Law
778da0175e LibWeb: Clamp and censor top-level calc results
We now clamp the values returned from calc into the allowed range (where
we know it) and censor any `NaN`s to `0` both when we resolve and when
we serialize.

Gains us 76 WPT passes.
2025-08-11 17:10:04 +01:00
Callum Law
bc2ca96f50 LibWeb: Make signature of CSS::{Percentage,Number}::to_string consistent
By making this consistent with the other numeric data type classes we
can simplify cases where we are dealing with variants containing these
types.
2025-08-11 17:10:04 +01:00
Callum Law
3fe3adadc4 LibWeb: Remove unnecessary includes in Percentage.h 2025-08-11 17:10:04 +01:00
Callum Law
f15153ea86 LibWeb: Move formatter for Percentage into Percentage.h 2025-08-11 17:10:04 +01:00
Callum Law
90948405fc LibWeb: Return an intermediate struct from CSV::resolve_value
Returning this struct will allow us to modify the underlying value of
the `CalculationResult` without requiring us to go through the process
of constructing a whole new `CalculationResult` to return.
2025-08-11 17:10:04 +01:00
Callum Law
6025805f19 LibWeb/Meta: Compute the accepted value range for CalculationContexts
This currently only applies to property-level calculation contexts, more
work to be done to generate accepted ranges for other calculation
contexts (e.g. within transformation functions, color functions, etc)
2025-08-11 17:10:04 +01:00
Callum Law
2af7016a77 LibWeb: Rename ValueType::OpenTypeTag to ValueType::OpentypeTag
This is the correct capitalization in line with what it is called in the
spec "opentype-tag".
2025-08-11 17:10:04 +01:00
Callum Law
861bcbd9ad AK: Format floats with precision in scientific notation where applicable 2025-08-11 17:10:04 +01:00
Callum Law
1474da31c7 AK: Reduce duplication between put_f32_or_f64 and put_f64_with_precision
We were handling the special cases of NaN and Infinity in basically the
same way across both functions - we can reduce code duplication by
moving this to before we branch.

This is also required as we will be moving the logic to encode in
scientific notation above the branch in a later commit and the
`convert_floating_point_to_decimal_exponential_form` method doesn't work
with non-finite values.
2025-08-11 17:10:04 +01:00
Callum Law
1a9dd70792 LibWeb: Serialize NumberStyleValue with 6 decimal places of precision 2025-08-11 17:10:04 +01:00
Callum Law
7182a537f3 LibWeb: Reduce inaccuracies when creating rotation matrices
When converting rotate transform functions `sin` and `cos` can sometimes
be inaccurate. To avoid these inaccuracies we:
 - Mod the angle to minimise inaccuracies in the first place.
 - Discard tiny (smaller than epsilon) values returned by `sin` and
   `cos` as inaccuracies.

This is in line with  other browsers (e.g. Gecko and WebKit).
2025-08-11 17:10:04 +01:00
Callum Law
719ab5735e LibWeb: Avoid addition to infinity when rounding calc'd z-index 2025-08-11 17:10:04 +01:00
Timothy Flynn
f03c432b52 AK: Use simdutf for searching strings for a single code unit
In the following synthetic benchmark, the simdutf version is 4x faster:

    BENCHMARK_CASE(find)
    {
        auto string = u"😀Foo😀Bar"sv;

        for (size_t i = 0; i < 100'000'000; ++i)
            (void)string.find_code_unit_offset('a');
    }
2025-08-11 16:55:37 +02:00
Andreas Kling
bd7599ccfc LibCore: Remove macro-generated EventReceiver::try_create(...) factories
We can just use the infallible factory everywhere instead.
2025-08-11 16:55:25 +02:00
Andreas Kling
aec1f6aa7e LibCore: Remove unused CustomEvent 2025-08-11 16:55:25 +02:00
Andreas Kling
c47e253c60 LibCore: Remove unused "visible for timer purposes" concept
This was a long-unused leftover from SerenityOS.
2025-08-11 16:55:25 +02:00
Andreas Kling
0037df88d5 LibCore: Remove unused ChildEvent 2025-08-11 16:55:25 +02:00
Andreas Kling
75091016d7 LibCore: Remove parent/child concept from EventReceiver
This ownership model is no longer used.
2025-08-11 16:55:25 +02:00
Andreas Kling
134fd8e413 LibCore: Don't have Promise inherit from EventReceiver
This was only used for parenting promises to each other, but we can do
that with a simple vector of children.
2025-08-11 16:55:25 +02:00
Andreas Kling
dfe776b722 WebDriver: Stop using the ancient Core::EventReceiver parent/child API
Before this change, clients were kept alive by making them children of
the TCPServer object. This ownership model is going away (and this was
the only remaining use of it!) so let's just put the clients in a hash
table instead.
2025-08-11 16:55:25 +02:00
Andreas Kling
045eaa1576 LibLine: Remove unnecessary use of EventReceiver parent/child API 2025-08-11 16:55:25 +02:00
Andreas Kling
b8357bc190 LibCore: Remove unused LocalServer constructor parameter 2025-08-11 16:55:25 +02:00
Andreas Kling
cfcb63239d LibCore: Remove unused ThreadedPromise constructor 2025-08-11 16:55:25 +02:00
Andreas Kling
fa8592b4a9 LibCore: Remove unused UDPServer constructor parameter 2025-08-11 16:55:25 +02:00
Andreas Kling
036aa43a41 LibCore: Remove unused TCPServer constructor parameter 2025-08-11 16:55:25 +02:00
Andreas Kling
d13884e933 LibCore: Remove unused Timer APIs for constructing with a parent 2025-08-11 16:55:25 +02:00
Andreas Kling
4d285d6dce LibCore: Remove an unused Promise constructor 2025-08-11 16:55:25 +02:00
Andreas Kling
ecf0395c27 LibCore: Stop parenting notifiers
There's no need to participate in the ancient EventReceiver parent/child
ownership scheme here. Notifiers are already owned by RefPtrs anyway.
2025-08-11 16:55:25 +02:00
Andreas Kling
34709cc796 LibCore: Remove unused "name" concept from EventReceiver 2025-08-11 16:55:25 +02:00
Tete17
cf211cf99a LibWeb: Migrate TrustedTypes to Utf16String 2025-08-11 12:21:31 +01:00
Tete17
7559084b22 LibWeb: Add wpt test for createPolicy and createXXX
This gives us at least 72 new tests :)
2025-08-11 12:21:31 +01:00
Tete17
53e0f287d1 LibWeb: Implement reporting of trusted-types-policy violations 2025-08-11 12:21:31 +01:00
Tete17
bc9e67a0dc LibWeb: Implement methods dependant on TrustedScriptURL 2025-08-11 12:21:31 +01:00
Tete17
adaad653ca LibWeb: Implement TrustedScriptURL class 2025-08-11 12:21:31 +01:00
Tete17
40691bf25d LibWeb: Implement methods dependant on TrustedScript 2025-08-11 12:21:31 +01:00
Tete17
56cab6955a LibWeb: Implement TrustedScript type
This turns out to be very similar to TrustedHTML.
2025-08-11 12:21:31 +01:00
Tete17
c84c97b339 LibWeb: Implement createHTML for TrustedTypePolicy
This is the main mechanism by which users of the api can create
safe object with a callback for any needed sanitation of the values.
2025-08-11 12:21:31 +01:00
Tete17
966e00fd69 LibWeb: Finish algorithm to block trusted type policy creation with CSP
This is the mechanism that should pages to determine what kind of
policies can be created on their domains mostly based around the HTTP
headers the server responds with.
2025-08-11 12:21:31 +01:00
Tete17
6398e771a3 LibWeb: Implement create_policy function for TrustedTypePolicyFactory
It simply consists of a wrapper around the main algorithm
2025-08-11 12:21:31 +01:00
Tete17
90bcc16a7b LibWeb: Add TrustedTypePolicy class
It is mostly a skeleton with no actual implementation.
2025-08-11 12:21:31 +01:00
Tete17
a73c082f36 LibWeb: Implement is_html method for TrustedTypePolicyFactory
This is used to check the legitimacy of a TrustedHTML object.
2025-08-11 12:21:31 +01:00
Tete17
0a147aa9a1 LibWeb: Implement TrustedHTML class
The TrustedHTML interface represents a string that a developer can
confidently insert into an injection sink that will render it as HTML.

These objects are immutable wrappers around a string, constructed via a
TrustedTypePolicy’s createHTML method.
2025-08-11 12:21:31 +01:00
Tete17
68c55b0ef1 LibWeb: Implement getPropertyType for TrustedTypePolicyFactory
This allows authors to check if a Trusted Type is required for the given
Elements property.

This adds 28 more passing WPT tests :)
2025-08-11 12:21:31 +01:00
Sam Atkins
4bcfc4bacc LibWeb/HTML: Add cross-site ancestor flag to environment
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
Corresponds to baec061a70
2025-08-11 11:08:04 +01:00
Sam Atkins
cfdc4bad7c LibWeb: Update more navigation code to spec
Partly corresponds to 80ebad5fbf

This is mostly to handle null source_documents, which is something that
needs more work elsewhere. The spec change above is about the deferred
fetch quota.
2025-08-11 11:08:04 +01:00
Sam Atkins
0e5fd11bdc LibWeb/HTML: Create navigation params for browser-UI navigations
Step 4 corresponds to 3b6a99b1d9

The rest is from some earlier spec change.
2025-08-11 11:08:04 +01:00
Sam Atkins
cf969abba7 LibWeb/HTML: Add missing "else" to create_navigation_params_by_fetching 2025-08-11 11:08:04 +01:00
Sam Atkins
0b998b8379 LibWeb: Update base URL change processing
Corresponds to 49f5cd381e
2025-08-11 11:08:04 +01:00