Commit graph

71492 commits

Author SHA1 Message Date
Jelle Raaijmakers
65910dc343 LibWeb: Update focusing spec steps
Update a couple of focus-related spec steps and their implementations.
The most relevant change is that we no longer allow focusing on elements
that return false for `->is_focusable()`, which necessitates fixing a
broken test that tried to `.focus()` on `<div>`s that were not
focusable. That test's output now more accurately reflects the expected
outcome as seen in other browsers.
2025-08-26 10:25:59 +02:00
Jelle Raaijmakers
cc19dd3fb0 LibWeb: Simplify getting the document's root element in elementFromPoint 2025-08-26 10:25:59 +02:00
Jelle Raaijmakers
518c048eb4 LibWeb+WebContent: Rename Document::focused_element to ::focused_area
And make it a DOM::Node, not DOM::Element. This makes everything flow
much better, such as spec texts that explicitly mention "focused area"
as the fact that we don't necessarily need to traverse a tree of
elements, since a Node can be focusable as well.

Eventually this will need to be a struct with a separate "focused area"
and "DOM anchor", but this change will make it easier to achieve that.
2025-08-26 10:25:59 +02:00
Jelle Raaijmakers
90f1c8724b LibWeb: Nested editing host focus should propagate to farthest ancestor
Nested editing hosts should act as a single big editing host, as long as
there are no uneditable elements in between.
2025-08-26 10:25:59 +02:00
Jelle Raaijmakers
6c0a0b86ba LibWeb: Simplify delete and return actions in EditingHostManager
No functional changes.
2025-08-26 10:25:59 +02:00
Jelle Raaijmakers
60a501d824 LibWeb: Do not update selection on uneditable contents without Shift key
If selection navigation happens through an editing host, we should
enforce that for collapsed navigations (i.e. moving the caret) it can
only happen if the focus node of the selection is editable.
2025-08-26 10:25:59 +02:00
Jelle Raaijmakers
09645875ea LibWeb: Clean up Selection::move_offset_to_* methods
No functional changes.
2025-08-26 10:25:59 +02:00
Jelle Raaijmakers
2e910dd6e1 LibIDL: Change overload sets to be ordered
We fill these overload sets from vectors, which means that by the time
we iterated over them, any semblance of their original ordering was
lost. Their ordering is important, because we invoke
define_native_function() for them which eventually stores ordered
properties.

This should not be an issue as long as iterating over a HashMap that was
filled in exactly the same way results in the same ordering. However,
HashTable utilizes kmalloc_good_size() to determine a good allocation
size - and the implementation for kmalloc_good_size() on Linux and macOS
differs, causing a different capacity and ordering on those platforms.

This was not caught by CI, because we run that with sanitizers enabled
which overrides malloc_good_size() on macOS, resulting in the same
behavior as on Linux.

Change the overload sets to be OrderedHashMaps instead and rebaseline
the failing test.
2025-08-26 10:14:22 +02:00
Jelle Raaijmakers
3522ff16c0 Meta: Reuse "define the operations" algorithm for generated namespaces
This is one step closer to the spec. No functional changes.
2025-08-26 10:14:22 +02:00
Tim Ledbetter
cb1a1a5cb5 LibWeb: Replace is<T>() with as_if<T>() where possible
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
2025-08-25 18:45:00 +02:00
Andreas Kling
3d97251da3 LibWeb: Wrap out-of-flow table children in anonymous table cells
This fixes an issue where floating children of a table box would not get
laid out at all if they were surrounded by nothing but whitespace.
2025-08-25 14:55:19 +02:00
norbiros
92b560edce LibWeb/CSS: Fix basic absolute positioning inside grid containers
Now elements with position `absolute` properly resolve their position
inside parent elements with `grid`. I also imported some WPT tests
related to that topic.

Part 2 of resolving issues on https://hack4krak.pl
2025-08-25 14:09:12 +02:00
norbiros
2ed7e0422e LibWeb/CSS: Import absolute positioning tests inside grid containers 2025-08-25 14:09:12 +02:00
Jelle Raaijmakers
305dfe3f40 AK: Don't remove CV qualifiers from types in Optional<T>
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
CV qualifiers are already ignored by __is_base_of(), which is what
IsBaseOf<T,U> uses.
2025-08-25 11:02:42 +02:00
sayhan
02abd3e373 Meta: Fixed variable typo switfc -> swiftc 2025-08-25 11:02:04 +02:00
Andreas Kling
0d2800e411 LibWeb: Don't relocate fragments across atomic inline boundary
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
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (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 / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Push notes / build (push) Waiting to run
All fragments inside an atomic inline box should stay within that box,
otherwise we'll screw up the paint order and paint them behind things
that they're supposed to be on top of.

This fixes an issue with inline-block content not appearing on sites
like Google Docs and Reddit, among others.
2025-08-24 21:00:08 +02:00
ayeteadoe
1573ca35cc LibDNS: Enable EXPLICIT_SYMBOL_EXPORT 2025-08-24 12:58:27 -06:00
ayeteadoe
8150fb4cbb LibMedia: Enable EXPLICIT_SYMBOL_EXPORT 2025-08-24 12:58:27 -06:00
ayeteadoe
a99c8d05b7 Utilities/image: Enable on Windows 2025-08-24 12:58:27 -06:00
ayeteadoe
7d00c43269 Utilities/dns: Enable on Windows 2025-08-24 12:58:27 -06:00
ayeteadoe
b7bc60d614 Utilities/abench: Enable on Windows 2025-08-24 12:58:27 -06:00
ayeteadoe
f4b20129d7 Utilities/xml: Enable on Windows 2025-08-24 12:58:27 -06:00
ayeteadoe
2c91014bbf LibXML: Enable EXPLICIT_SYMBOL_EXPORT 2025-08-24 12:58:27 -06:00
ayeteadoe
a95e0d2777 Utilities/wasm: Enable on Windows 2025-08-24 12:58:27 -06:00
ayeteadoe
070392307a LibWasm: Enable EXPLICIT_SYMBOL_EXPORT 2025-08-24 12:58:27 -06:00
ayeteadoe
3355b7fb1f Tests/LibJS: Enable test-js on Windows 2025-08-24 12:58:27 -06:00
Andreas Kling
79b30e7c9a LibWeb: Create a new painter after resizing canvas element backing store
Otherwise, we just keep painting into the old backing store. This fixes
an issue where the main spreadsheet area in Google Sheets was not
visually updating, despite everything looking good in memory.
2025-08-24 16:36:24 +02:00
ayeteadoe
1d93c0b8a5 Tests/LibTLS: Enable TestTLSHandshake in Windows CI
Some checks failed
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
Build Dev Container Image / build (push) Has been cancelled
2025-08-23 18:35:45 -06:00
ayeteadoe
cc38235ca1 Tests/LibDNS: Enable in Windows CI 2025-08-23 18:35:45 -06:00
ayeteadoe
4180944b4d LibTLS: Use Windows-specific method to set default certificate store
test_tls in TestDNSResolver was failing to perform the TLSv12
connection due to the following error: "14430000:error:0A000086:SSL
routines:tls_post_process_server_certificate:certificate verify
failed:ssl\statem\statem_clnt.c:2124". To perform the equivalent
on Windows, we can instead load the built in OSSL_STORE for Windows
2025-08-23 18:35:45 -06:00
ayeteadoe
ff71efebb6 LibCore: Fix WSAEMSGSIZE error in pending_bytes with proper zero-init
In SocketWindows, the return value for the ioctl call was not
initialized to zero. This was causing test_udp in TesDNSResolver
to fail as UDPSocket::read_some() was incorrectly failing with
WSAEMSGSIZE due the result of pending_bytes being some
unspecified default value for an uninitialized unsigned long
2025-08-23 18:35:45 -06:00
ayeteadoe
4fa8238a46 Meta: Install qtbase and qtmultimedia vcpkg ports on Windows 2025-08-23 16:04:36 -06:00
ayeteadoe
9ec1643d88 CMake: Add helper to ensure vcpkg DLLs are copied to the output dir
The BUILD_RPATH/INSTALL_RPATH CMake infrastructure is not supported
on Windows, but we want to ensure Ladybird executables are runnable
after the build phase so there can be an efficient dev loop.
lagom_copy_runtime_dlls() can be used by executable targets so all
their dependent dlls are copied to their output directory in their
post build step.
2025-08-23 16:04:36 -06:00
ayeteadoe
3df8e00d91 LibWeb: Enable EXPLICIT_SYMBOL_EXPORT 2025-08-23 16:04:36 -06:00
ayeteadoe
94a3a7d9a1 Tests/LibMedia: Enable in Windows CI 2025-08-23 16:04:36 -06:00
ayeteadoe
0c9b16d09c Tests/LibWebView: Enable in Windows CI 2025-08-23 16:04:36 -06:00
ayeteadoe
a2d3562647 Tests/LibXML: Enable in Windows CI 2025-08-23 16:04:36 -06:00
ayeteadoe
6dbb59da77 LibJS: Export symbols causing linker errors in various consumers
After LibJS had its symbol exports optimized the targets
js, test-js, test262-runner, test-wasm, and LibWeb began to get linker
errors after the work to add Windows support for test-web and ladybird
targets. These extra JS_API annotations fix all those linker errors.
2025-08-23 16:04:36 -06:00
ayeteadoe
9c67c4a270 LibWebView: Enable EXPLICIT_SYMBOL_EXPORT 2025-08-23 16:04:36 -06:00
ayeteadoe
ed93551d59 Qt/ladybird: Enable in Windows CI 2025-08-23 16:04:36 -06:00
ayeteadoe
f58298132b LibDevTools: Enable EXPLICIT_SYMBOL_EXPORT 2025-08-23 16:04:36 -06:00
ayeteadoe
84690f432e test-web: Allow help command to succeed
These are required for test-web runtime to actually work
2025-08-23 16:04:36 -06:00
ayeteadoe
0b19c04b53 test-web: Enable building in Windows CI
The tests are not registered with CTest yet
2025-08-23 16:04:36 -06:00
ayeteadoe
0847ca4854 WebWorker: Enable in Windows CI 2025-08-23 16:04:36 -06:00
ayeteadoe
0a699132f3 WebContent: Enable in Windows CI 2025-08-23 16:04:36 -06:00
ayeteadoe
e497303e94 LibTextCodec: Enable EXPLICIT_SYMBOL_EXPORT 2025-08-23 16:04:36 -06:00
ayeteadoe
58be9e6400 RequestServer: Enable in Windows CI 2025-08-23 16:04:36 -06:00
ayeteadoe
c7f35193d0 LibDevTools: Enable in Windows CI 2025-08-23 16:04:36 -06:00
ayeteadoe
97e8a922ad ImageDecoder: Enable in Windows CI 2025-08-23 16:04:36 -06:00
ayeteadoe
ee3c033de2 LibWebView: Enable in Windows CI 2025-08-23 16:04:36 -06:00