Commit graph

70037 commits

Author SHA1 Message Date
Callum Law
536f8c395c LibWeb: Set numeric type of asin, acos, atan calculation results
Previously we were omitting the numeric type which meant these functions
weren't valid in some cases e.g. within rotate() functions.
2025-06-25 05:19:07 +01:00
devgianlu
4e747f525a LibCrypto+LibWeb: Check RSA keys validity on SubtleCrypto import_key
Some checks are pending
CI / Linux, x86_64, Fuzzers_CI, Clang (push) Waiting to run
CI / macOS, arm64, Sanitizer_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
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
Fix various TODO by checking the validity of RSA keys when they are
imported.

Also add some internal tests since WPT doesn't seem to provide them.
2025-06-25 12:21:28 +12:00
devgianlu
1bf4e712ec LibWeb/Crypto: Do not swap endianness when importing base64 keys
This is wrong and leads to invalid numbers. We've been kind of
unfortunate in not catching this earlier because we skipped the key
validation part.

Many tests would fail with the next commits if this wasn't fixed.
2025-06-25 12:21:28 +12:00
devgianlu
d55f759bbb LibCrypto: Add LCM functionality to UnsignedBigInteger 2025-06-25 12:21:28 +12:00
devgianlu
adaa8e418a LibWeb/Crypto: Replace noop errors with VERIFY_NOT_REACHED 2025-06-25 12:21:28 +12:00
devgianlu
67e833a0c7 LibCrypto: Remove unused methods on RSAPublicKey 2025-06-25 12:21:28 +12:00
devgianlu
289f2b24bf LibCrypto+LibWeb: De-templetize RSA and EC key types
There is no need to have `RSAPrivateKey`, `RSAPublicKey`, `ECPrivateKey`
and `ECPublicKey` to be templatize to utilize different implementation
of numbers.
2025-06-25 12:21:28 +12:00
devgianlu
7f44b88eea LibCrypto+LibWeb: Check EC keys validity on SubtleCrypto import_key
Fix various TODO by checking the validity of ECDSA and ECDH keys when
they are imported. There are no checks in place for raw import because
the spec doesn't contemplate them yet.

Also add some internal tests since WPT doesn't seem to provide them.
2025-06-25 12:21:28 +12:00
devgianlu
a90950cac7 LibWeb: Update AesCbc::decrypt after spec fix 2025-06-25 12:21:28 +12:00
devgianlu
23c9b94e7b LibWeb: Remove bogus FIXME in Crypto::get_random_values
This is not supposed to support SharedArrayBuffers since they don't
implement ArrayBufferView.
2025-06-25 12:21:28 +12:00
devgianlu
d8d69c1650 LibCrypto: Remove unused VerificationConsistency enum 2025-06-25 12:21:28 +12:00
Andrew Kaster
0205f05319 CI: Add a sanity check to the JS artifacts workflow
This workflow has been broken in the past, so let's add a sanity check
to ensure that the REPL works.
2025-06-24 13:28:58 -06:00
Andrew Kaster
6cfb98fa7d CI: Add arm64 Linux JS artifact to GitHub Actions workflow 2025-06-24 13:28:58 -06:00
Tim Ledbetter
48f1bf7ef3 LibWeb: Remove Document::parse_url()
Some checks are pending
CI / macOS, arm64, Sanitizer_CI, Clang (push) Waiting to run
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
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 no longer used.
2025-06-24 19:55:43 +02:00
Tim Ledbetter
ff3d3840ac LibWeb: Replace usages of Document::parse_url()
The spec has been updated to use `encoding_parse_url()` and
`encoding_parse_and_serialize_url()` instead.
2025-06-24 19:55:43 +02:00
Aliaksandr Kalenik
8d6f2390f6 LibWeb: Set grid-auto-* to initial values when parsing grid-template
...as `grid` property value.
2025-06-24 19:14:08 +02:00
Ali Mohammad Pur
b0e471228d LibRegex: Avoid use-after-return of MatchState in 'is_an_eligible_jump'
The opcode may have last been accessed by
block_satisfies_atomic_rewrite_precondition, which would set it to a
state that no longer exists.
Set the state to the correct one unconditionally to ensure we're looking
at the right value.
Fixes #5145.
2025-06-24 18:43:01 +02:00
Ali Mohammad Pur
2947ae7d6e LibRegex: Move required bytecode.flatten() outside optimization function
Not running the optimization passes should not leave the bytecode in a
broken state. Fixes #5146.
2025-06-24 18:43:01 +02:00
Sam Atkins
423cdd447d LibWeb+LibGfx: Apply editorial punctuation/whitespace/markup fixes
Corresponds to d426109ea1
and fd08f81d06
2025-06-25 03:12:19 +12:00
Sam Atkins
a35d14eab3 LibWeb/HTML: Add or update spec steps in HTML parser
Partly corresponds to this which adds numbering to some substeps:
d426109ea1

This is not a complete review of all the spec steps to check that
they're up to date - I just updated the parts affected by that above
commit, and then added some `->` marks to places I noticed it was
missing. There may be actual spec differences still.

An actual change that needs tackling later is that `handle_in_head()`'s
branch for `<template>` has some new steps related to custom element
registries.
2025-06-25 03:12:19 +12:00
Sam Atkins
2e2b456009 LibWeb/DOM: Update spec steps for scrolling into view
Corresponds to dad91f49ef

The spec text doesn't actually require any changes from us, but I
noticed we were incorrectly calling `is_shadow_including_ancestor_of()`
instead of `is_shadow_including_inclusive_ancestor_of()`, so that's
fixed.
2025-06-25 03:12:19 +12:00
Tim Ledbetter
1c2b6ae03e LibWeb: Don't attempt to set the frozen base url on a null base element 2025-06-25 01:33:45 +12:00
Andrew Kaster
72a384bc1f AK: Set the console output code page to UTF-8
This fixes the broken emoji output from test-js.
2025-06-24 15:27:38 +02:00
Sam Atkins
8b6c32e3ab Tests: Import tests for scrollParent() and offsetParent() 2025-06-24 15:26:35 +02:00
Tim Ledbetter
2ff9e1d038 LibWeb: Apply clip rect before painting images
Previously, the clip property was ignored when painting images.
2025-06-24 12:56:28 +01:00
Tim Ledbetter
212d748ded LibWeb: Apply clip rect before painting background and foreground items 2025-06-24 12:56:28 +01:00
Callum Law
6584ae0080 LibWeb: Treat CSS selectors containing undeclared namespaces as invalid
Selectors containing undeclared namespaces should be considered invalid,
not just not matching any elements.

Gains us 3 new WPT passes.
2025-06-24 12:51:12 +01:00
Callum Law
5fcf3d0b05 LibWeb: Combine shared stylesheet parsing functionality
No functionality changes
2025-06-24 12:51:12 +01:00
Luiz
da14e072b7 LibWeb: Correctly handle serialization of PseudoElements
Previusly the implementation only was serializing PseudoElements if they
were the last element in the CompoundSelector. This caused bugs on
Javascript code that referenced their selectorText, where it would be
wrong.
2025-06-24 12:44:44 +01:00
Gingeh
b85a8a23a7 LibWeb: Handle percentage font-size values 2025-06-24 12:42:26 +01:00
Tim Ledbetter
b46378085d LibWeb: Absolutize keyframe values before interpolating 2025-06-24 12:36:47 +01:00
Jelle Raaijmakers
71f03cb785 LibWeb: Implement emulated Geolocation position retrieval
Some checks are pending
CI / macOS, arm64, Sanitizer_CI, Clang (push) Waiting to run
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
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 implements enough of the Geolocation spec that it is now possible
for websites to retrieve the current geo position or try to watch for
updates (which currently never happen).

As it stands now, it only returns a single emulated position that points
to San Francisco.
2025-06-24 11:33:41 +02:00
Jelle Raaijmakers
53c35c5d3b LibWeb: Bring update_the_visibility_state() steps in sync with the spec
No functional changes.
2025-06-24 11:33:41 +02:00
Shannon Booth
1fed3d27c1 LibWeb/HTML: Don't set opaque origin on innerHTML document
This appears to no longer be necessary now that we are properly
handling the loading of image data for the <img> element.
2025-06-24 09:56:14 +02:00
Shannon Booth
0bdcaf02d3 LibWeb/HTML: Only update the image data on fully loaded document
Documents created by DOMParser and fragment documents do not
have an origin set on the document by the spec. These documents
also happen to never become fully active.

By properly implementing the steps for the <img> element to only
update the image data for documents which are fully active, this
fixes a crash for img elements in these types of documents.

Unfortunately, this is not a full fix for the microtask queue case.
This is because it seems possible for node document for an <img>
element to be changed during the microtask queue for that document.
It is not clear to me how this can be fixed in a nice way.
2025-06-24 09:56:14 +02:00
Shannon Booth
bc85a9bace LibWeb/HTML: Don't return any errors for update_the_img_data
There should not be any exceptions to propagate, so let's update
the return type accordingly.
2025-06-24 09:56:14 +02:00
Shannon Booth
3383a781f6 LibWeb/DOM: Support changing document to observe in DocumentObserver 2025-06-24 09:56:14 +02:00
stasoid
0e74736a53 LibTLS: Port to Windows
Some checks are pending
CI / macOS, arm64, Sanitizer_CI, Clang (push) Waiting to run
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
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-06-23 18:58:01 -06:00
stasoid
6be0816172 LibCore: Add Windows implementation of TCPSocket::connect 2025-06-23 18:58:01 -06:00
stasoid
c14e6473d6 LibCore: Add Windows impl of System::socket, getaddrinfo, connect 2025-06-23 18:58:01 -06:00
Andrew Kaster
fbf8ffe872 AK: Only propagate delayload of dbghelp.dll for static builds
When AK is a shared library, the flag should be applied to the link
of the dll. When it's a static library, we need to apply it to the
executable that links against it instead.

Co-Authored-By: ayeteadoe <ayeteadoe@gmail.com>
2025-06-23 23:04:45 +02:00
Gingeh
4292344729 LibWeb: Don't skip last keyframe 2025-06-23 21:01:26 +02:00
InvalidUsernameException
f8f399c9c0 CI: Fix path to test-dumps folder of LibWeb tests for artifact upload
Some checks are pending
CI / macOS, arm64, Sanitizer_CI, Clang (push) Waiting to run
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
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
The CI runs are supposed to upload test dumps for failed LibWeb tests as
artifacts. However, the path for the artifact upload was wrong, it
likely regressed in 9a5b31ccd1.
2025-06-23 11:35:37 -06:00
Andrew Kaster
d9c85288d9 LibTLS: Remove blocking option and simplify Options struct
The complex macro for options with defaults doesn't make sense
now that there's only one option.
2025-06-23 17:49:21 +02:00
Andrew Kaster
955d747431 LibTLS: Use non-blocking TLS socket in the handshake test
None of our real code use cases actually use blocking mode. So we
should be testing non-blocking.
2025-06-23 17:49:21 +02:00
Callum Law
89a08cb7cf LibWeb: Update CSSRule parent style sheet whenever parent rule changes 2025-06-23 15:21:36 +01:00
Callum Law
f336667771 LibWeb: Don't carry quirks across to logical aliases 2025-06-23 15:19:07 +01:00
Callum Law
b0cdc3f03b LibWeb: Respect writing-mode and direction when mapping logical aliases 2025-06-23 15:19:07 +01:00
Callum Law
34a52baeed LibWeb: Add generic functionality for logical alias computed values 2025-06-23 15:19:07 +01:00
Callum Law
cfc8d3031b LibWeb: Map logical aliases at cascade time
Previously we would incorrectly map these in
`CSSStyleProperties::convert_declarations_to_specified_order`, aside
from being too early (as it meant we didn't maintain them as distinct
from their physical counterparts in CSSStyleProperties), this meant
that we didn't yet have the required context to map them correctly.

We now map them as part of the cascade process. To compute the mapping
context we do a cascade without mapping, and extract the relevant
properties (writing-direction and direction).
2025-06-23 15:19:07 +01:00