Commit graph

66045 commits

Author SHA1 Message Date
Jelle Raaijmakers
bfb87b24a3 LibWeb: Use verify_cast in insertParagraph command
No functional changes.
2024-12-10 14:54:19 +01:00
Jelle Raaijmakers
1c55153d43 LibWeb: Refactor "editable" and "editing host" concepts
The DOM spec defines what it means for an element to be an "editing
host", and the Editing spec does the same for the "editable" concept.
Replace our `Node::is_editable()` implementation with these
spec-compliant algorithms.

An editing host is an element that has the properties to make its
contents effectively editable. Editable elements are descendants of an
editing host. Concepts like the inheritable contenteditable attribute
are propagated through the editable algorithm.
2024-12-10 14:54:19 +01:00
Jelle Raaijmakers
f88c13a58c LibWeb: Prevent null deref in collapsed whitespace check
The spec even warned us about the reference potentially being null.
2024-12-10 14:54:19 +01:00
Jelle Raaijmakers
d5143db081 LibWeb: Skip node trees outside of range in insertParagraph
Instead of recursively iterating all descendants of the common ancestor
of the new line range that are not contained by that range, skip the
entire node tree as soon as we determine they're not.
2024-12-10 14:54:19 +01:00
ronak69
d48831e893 LibWeb: Leave tooltip or unhover link only if page entered/hovered one
Before, on a mouse-move event, if the hovered html element did not have
a tooltip or it was not a link, `page_did_leave_tooltip_area()` and
`page_did_unhover_link()` virtual functions would get called.

Now, the page remembers if it is in a tooltip area or hovering a link
and only informs of leaving or unhovering only if it was.
2024-12-10 05:29:52 -08:00
ronak69
318fc62b53 LibWeb: Remember page's cursor and request change only when it changes
Before, on *every* mouse-move event, `page_did_request_cursor_change()`
virtual function would get called, requesting to change cursor to the
event's mouse position's cursor.

Now, the page keeps track of the last cursor change that was requested
("page's current cursor") and only requests cursor change again if and
only if the current cursor is not already the one that is required.
2024-12-10 05:29:52 -08:00
Shannon Booth
ac6fe2e211 LibWeb: Implement multiple import map support 2024-12-10 12:01:45 +00:00
Shannon Booth
0a216f9c14 LibWeb/HTML: Use DOM's post connection steps for <script> elements
This aligns our behaviour with WebKit and Chrome.

See: https://github.com/whatwg/html/commit/ddd2d0dd
2024-12-10 10:38:56 +00:00
Shannon Booth
02efb64e64 LibWeb/DOM: Implement the DOM post connection steps
See: https://github.com/whatwg/dom/commit/0616094
2024-12-10 10:38:56 +00:00
dependabot[bot]
4559af6ef5 CI: Bump JamesIves/github-pages-deploy-action from 4.6.9 to 4.7.2
Bumps [JamesIves/github-pages-deploy-action](https://github.com/jamesives/github-pages-deploy-action) from 4.6.9 to 4.7.2.
- [Release notes](https://github.com/jamesives/github-pages-deploy-action/releases)
- [Commits](https://github.com/jamesives/github-pages-deploy-action/compare/v4.6.9...v4.7.2)

---
updated-dependencies:
- dependency-name: JamesIves/github-pages-deploy-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-10 09:53:23 +01:00
Andrew Kaster
85b87508bf ClangPlugins: Remove confusing hasType check for lambda capture types
This check asserts that templated types will never escape. Which doesn't
hold up at all in practice.
2024-12-10 07:13:00 +01:00
Andrew Kaster
2f38c83caf LibGC: Mark GC::Function and create_function as ESCAPING
Whenever we create a GC function, it should always be so that we can
pass it to a platform event loop spin, HTML event loop spin, or some
queued task on the HTML event loop. For every use case, any local
variables will be out of scope by the time the function executes.
2024-12-10 07:13:00 +01:00
Andrew Kaster
66519af43f LibWeb: Remove some uses of [&] lambda captures for queued tasks
Using a default reference capture for these kinds of tasks is dangerous
and prone to error. Some of the variables should for sure be captured
by value so that we can keep a GC object alive rather than trying to
refer to stack objects.
2024-12-10 07:13:00 +01:00
Andrew Kaster
6ed2bf2bb1 LibWeb: Mark local variables captured in GC functions as ignored
These variables are all captured in queued events or other event loop
tasks, but are all guarded by event loop spins later in the function.

The IGNORE_USE_IN_ESCAPING_LAMBDA will soon be required for all locals
that are captured by ref in GC::Function as well as AK::Function.
2024-12-10 07:13:00 +01:00
Andrew Kaster
31d21570bf LibWeb: Don't store local functions in GC Function
If a function isn't going to be escaped from the current context,
there's no need to wrap the lambda in a GC allocation.
2024-12-10 07:13:00 +01:00
Jelle Raaijmakers
1514197e36 LibWeb: Remove dom_ from dom_exception_to_throw_completion
We're not converting `WebIDL::DOMException`, but `WebIDL::Exception`
instead.
2024-12-09 20:02:51 -07:00
Jelle Raaijmakers
17d5dfe597 LibWeb: Implement Web::Fetch::Body::fully_read() closer to spec
By actually using streams, they get marked as disturbed and the
`.bodyUsed` API starts to work. Fixes at least 94 subtests in the WPT
`fetch/api/request` test suite.

Co-authored-by: Timothy Flynn <trflynn89@pm.me>
2024-12-09 20:02:51 -07:00
Timothy Flynn
9396a643b8 LibWeb: Ensure FilteredResponse setters forward to the base class
The spec for filtered responses states:

    Unless stated otherwise a filtered response’s associated concepts
    (such as its body) refer to the associated concepts of its internal
    response.

This includes setting its associated concepts. In particular, when the
filtered response's body is set upon fetching a request with integrity
metadata, we must set the internal response's body instead.

Further restrictions that apply to filtered response subclasses (such as
opaque filtered responses having a status code of 0) are already
implemented.
2024-12-09 20:02:51 -07:00
Timothy Flynn
4b4b12165e LibWeb: Release acquired readers after piping through a stream
This very partially implements the spec's "finalize" steps for piping
streams.
2024-12-09 20:02:51 -07:00
Timothy Flynn
383d303b79 LibWeb: Enable callbacks in execution contexts when teeing streams
This will be needed once fetched response bodies are read using streams.
2024-12-09 20:02:51 -07:00
Timothy Flynn
5cd6d403ca LibWeb: Remove outdated comment about synchronous body initialization
We now do this step asynchronously.
2024-12-09 20:02:51 -07:00
Timothy Flynn
953fe75271 LibWeb: Remove exception handling from safely extracting response bodies
The entire purpose of this AO is to avoid handling exceptions, which we
can do now that the underlying AOs do not throw exceptions on OOM.
2024-12-09 20:02:51 -07:00
Timothy Flynn
49ff5eb4d8 LibWeb: Do not move heap functions into other heap functions in Fetch
In particular, the processBody callback here *can't* move the
processBodyError callback. It is needed a few lines after. Passing by
value is safe and intended here.
2024-12-09 20:02:51 -07:00
Andrew Kaster
f0bfb7f697 LibWeb: Don't capture local variables in HTMLImageElement::decode 2024-12-10 00:50:45 +01:00
Pavel Shliak
10311fba87 LibWeb: Align mfrac Padding with Updated MathML Core Spec
This aligns with the transition from the MathML Core Working Draft
(27 November 2023) to the Editor's Draft (26 November 2024).
2024-12-09 20:06:48 +00:00
Pavel Shliak
617ad9c3a5 LibWeb: Move expensive-to-copy arguments 2024-12-09 13:55:03 +01:00
Pavel Shliak
399af2416a LibWeb: Do not pass cheap-to-copy enums by reference 2024-12-09 13:55:03 +01:00
Pavel Shliak
6f81b80114 Everywhere: Include HashMap only where it's actually used 2024-12-09 12:31:16 +01:00
Pavel Shliak
97d99aa8d6 AK: Verify that HashMap is not empty in take_first
This makes the behavior uniform with:
- HashTable
- SinglyLinkedList
- Vector
2024-12-09 12:31:16 +01:00
Pavel Shliak
e08f6a69b2 LibWasm: Respect instance.types() bounds 2024-12-09 12:30:41 +01:00
Lucien Fiorini
3c2bbd45cf Tests: Mark test as passing in XMLSerializer-serializeToString.txt 2024-12-09 09:13:24 +00:00
Lucien Fiorini
ae8033b80f LibWeb: Rename abbreviated variable name 2024-12-09 09:13:24 +00:00
Lucien Fiorini
7feb8eb5bf Tests: Import WPT test for firstElementChild namespace in xhtml 2024-12-09 09:13:24 +00:00
Lucien Fiorini
0c24c9150a LibWeb: Parse the qualified name of XML dom elements correctly 2024-12-09 09:13:24 +00:00
sideshowbarker
0a2aa87107 LibWeb: Assign ARIA role “switch” to <input type=checkbox switch> 2024-12-09 09:47:36 +01:00
R-Goc
18132a0be1 LibJS: Remove compile flag for Windows 2024-12-08 17:37:26 -07:00
R-Goc
f380b4b95b AK: Port BumpAllocator.h to Windows
Done by forward declaring the required functions and defining the needed
constants. The defines shouldn't collide as they are from memoryapi.h.
This is done to avoid including windows.h.
2024-12-08 17:36:37 -07:00
R-Goc
c66eb5db11 LibCore: Add includes for S_ISDIR on Windows 2024-12-08 17:29:22 -07:00
stasoid
777dcdf6d0 LibCore: Port SharedCircularQueue to Windows 2024-12-08 17:25:40 -07:00
stasoid
85da489f39 LibThreading: Build on Windows 2024-12-08 17:19:42 -07:00
R-Goc
e2b6ab4a69 LibCrypto: DER.cpp use uz literals 2024-12-08 17:18:12 -07:00
R-Goc
3e69794c7d LibCrypto: Use size_t integer literal 2024-12-08 17:18:12 -07:00
Konstantin Konstantin
b03138cbff LibWeb: Support creation of shared memory in WebAssembly API
Add support for shared memory creation in WebAssembly memory API.
This API is needed for WPT tests that use shared array buffers.

Import related WPT tests.
2024-12-08 22:10:45 +01:00
Pavel Shliak
6ec06a01a2 LibCore: Do not include math.h in ArgsParser 2024-12-08 16:38:13 +00:00
sideshowbarker
aa2c296489 Docs: Add “Is [some particular site] usable in Ladybird” to FAQ 2024-12-08 15:30:03 +01:00
Pavel Shliak
116e7baead LibGfx: Remove aligned_within from Rect
The CenterRight and TopCenter alignment cases were
mistakenly identical due to a copy-paste error,
causing the function to behave unexpectedly.
Rather than attempting to fix it, remove aligned_within entirely.
2024-12-08 13:32:10 +00:00
Jelle Raaijmakers
4c6cb13f7f CI: Make stalebot actually close PRs after 30 days
Now stalebot has run to completion on notifying stale PRs, we can
enable its PR closing behavior.
2024-12-07 22:09:45 +01:00
Jelle Raaijmakers
681531d0e5 CI: Increase stalebot operations per run to 500
No need to limit ourselves to 30 API calls per run :^)
2024-12-07 22:07:15 +01:00
Jelle Raaijmakers
ea58dbd507 CI: Set actions permission for stalebot
The stale action has a weird interaction with the cache which requires
the `actions: write` permission. Without this, it is unable to overwrite
any existing cache key.
2024-12-07 21:58:53 +01:00
Jelle Raaijmakers
3da855e0cc CI: Fix Stalebot not progressing on PRs between runs 2024-12-07 21:43:06 +01:00