73242 Commits

Author SHA1 Message Date
Feng Yu
d2029b1814 LibWeb: Relax HTML parser to allow more tags inside <select>
Some checks failed
Close stale PRs / stale (push) Has been cancelled
Package the js repl as a binary artifact / Linux, arm64 (push) Has been cancelled
Package the js repl as a binary artifact / macOS, arm64 (push) Has been cancelled
Package the js repl as a binary artifact / Linux, x86_64 (push) Has been cancelled
Label PRs with merge conflicts / auto-labeler (push) Has been cancelled
This implements parsing part of customizable <select> spec update.
See whatwg/html PR #10548.

Two failing subtests in `html5lib_innerHTML_tests_innerHTML_1.html`
and `customizable-select/select-parsing.html` are due to the spec
still disallowing `<input>` inside `<select>`, even though Chrome
has already implemented this behavoir (see whatwg/html#11288).
2025-12-04 17:17:01 +00:00
Sam Atkins
315ffb91af LibWeb/CSS: Dump more information about CSSImportRules
Specifically, we now dump the conditions, and the imported style sheet -
these sheets were previously skipped entirely when dumping everything
out.
2025-12-04 16:24:04 +00:00
Sam Atkins
2a716eaf48 LibWeb: Make dump_sheet() indentable
Not all style sheets are top-level, so this will help make that
hierarchy clearer.
2025-12-04 16:24:04 +00:00
Sam Atkins
5343c9bd2e LibWeb/CSS: Dump out media queries in more detail
Instead of just serializing them, dump out the query condition as a
tree, taking advantage of the existing dump code for
BooleanExpressions.
2025-12-04 16:24:04 +00:00
Sam Atkins
1db13c52be LibWeb/CSS: Make Supports responsible for dumping itself entirely
This will reduce the boilerplate for other things that want to dump a
Supports, such as `@import`.
2025-12-04 16:24:04 +00:00
Sam Atkins
180cd4b799 LibWeb: Move CSSRule dumping code into CSSRule classes
Having the dumping code in a separate Dump.cpp meant that it was often
overlooked when the rules gained new features, and also limits dumping
to publicly-accessible information.
2025-12-04 16:24:04 +00:00
Sam Atkins
285892b5dd LibWeb: Expose dump_indent() function
Preparation for moving some dump code out of Dump.cpp. Also switch to
using append_repeated() instead of a looped append().
2025-12-04 16:24:04 +00:00
Timothy Flynn
674075f79e Everywhere: Remove LibCore/System.h includes from header files
This reduces the number of compilation jobs when System.h changes from
about 750 to 60. (There are still a large number of linker jobs.)
2025-12-04 15:40:46 +00:00
Sam Atkins
58b32814e0 LibWeb/HTML: Bring HTMLDialogElement up to spec
I missed when these changes actually happened, but the big differences
here are that a few steps got extracted into their own algorithms; and
the dialog now only does things when it's attached to a fully-active
document, instead of immediately.

I've imported a WPT test that exercises this by calling show() on an
unattached dialog.
2025-12-04 14:47:16 +00:00
Sam Atkins
a1fbcfb4c6 LibWeb/HTML: Implement CloseWatcher::getEnabledState closer to spec
We previously had this implemented in an ad-hoc way, where we used a
boolean on the CloseWatcher instead of a proper function with steps.
This worked at the time, but causes problems with the current version
of the spec, so let's just implement it properly.

This commit consciously does not update the spec text, because it's
diverted quite a lot. That will happen in a subsequent commit.
2025-12-04 14:47:16 +00:00
Sam Atkins
c541d14232 LibWeb/HTML: Add spec asserts to HTMLDialogElement::set_close_watcher()
Not sure when this change happened. This does include the fixed assert
from here though:
71e70e9006
2025-12-04 14:47:16 +00:00
Aliaksandr Kalenik
e217380d0d Meta: Lock libxml2 version in vcpkg.json 2025-12-04 08:51:59 -05:00
Sam Atkins
6b46bed970 LibWeb/CSS: Update syntax comments for a couple of properties
Corresponds to:
3a2ac8d75c
fdc08f79a2

No code changes.
2025-12-04 08:37:39 -05:00
Marcos Del Sol Vives
9b4d9966da Meta: Update libavif to version 1.3.0#1
To update to ICU 78.1, a bump to the Vcpkg baseline is required.
However, for some reason 1.3.0#0 fails to compile on the newer
baseline. Updating to 1.3.0#1 fixes the issue.
2025-12-03 19:43:12 -05:00
Zaggy1024
bd1c9aedbc LibMedia: Only set data provider error state from the decoding thread
...and use that assumption to avoid locking when checking if we're in
that state.
2025-12-03 12:20:49 -06:00
Zaggy1024
2bd541c70c LibMedia: Keep data providers suspended until they are active
This allows us to avoid waiting on the condition variable for the error
handler to be set when an error occurs.
2025-12-03 12:20:49 -06:00
Zaggy1024
8bfaae473d LibMedia: Use only the ThreadData::wake() function in data providers 2025-12-03 12:20:49 -06:00
Timothy Flynn
46ce9b0775 CI: Set the PAT on the main test262 checkout step
In the deploy step, git commands are run from the main directory, so
that is where the PAT must be set.
2025-12-03 11:29:19 -05:00
Timothy Flynn
61d9d6bebb CI: Set the Ladybird token when checking out libjs-data
According to: https://github.com/orgs/community/discussions/26694
We need to set the token when checking out the repo as well.
2025-12-03 10:06:20 -05:00
Timothy Flynn
0c9d15788e CI: Give the test262 runner write permissions
Shot in the dark to fix our ability to push changes to the libjs-data
repo.
2025-12-03 08:27:11 -05:00
aplefull
e0dd182964 LibJS: Use stored input for RegExp legacy static property views
The m_last_match, m_left_context, and m_right_context views were being
created from a temporary string instead of from the owned m_input.
This caused the views to point to destroyed stack memory when accessing
RegExp.lastMatch after calling String.replace() with a regex.
2025-12-03 13:45:26 +01:00
Sam Atkins
ed7a86b8cc LibWeb/DOM: Set the pseudo_element on created Animation/TransitionEvents
Also import a couple of WPT tests that now pass.
2025-12-03 13:29:51 +01:00
Sam Atkins
d717dd64b3 LibWeb: Make Animation's owning element an AbstractElement
From the spec:
> The owning element of a transition refers to the element or
  pseudo-element to which the transition-property property was applied
  that generated the animation.

https://drafts.csswg.org/css-transitions-2/#owning-element

Previously we only stored the element.
2025-12-03 13:29:51 +01:00
Sam Atkins
b61c857c64 LibWeb/CSS: Use AbstractElement animation helpers 2025-12-03 13:29:51 +01:00
Sam Atkins
dacc64cb8b LibWeb/DOM: Add animation helpers to AbstractElement 2025-12-03 13:29:51 +01:00
Sam Atkins
ba86b81c1a LibWeb/Animations: Make KeyframeEffect work with AbstractElements 2025-12-03 13:29:51 +01:00
Andreas Kling
05e449d32a LibCore: Simplify how we calculate processed event count 2025-12-03 13:26:27 +01:00
Andreas Kling
25764fbc54 LibCore: Remove debug logging about pending promise count
This wasn't really achieving anything other than occasionally confusing
people into thinking our JS promise system was broken.
2025-12-03 13:26:27 +01:00
Andreas Kling
cebc4d00dd LibCore: Remove ability to post heap-allocated Core::Event objects
We no longer need this API since all clients have been converted to
simply posting the Core::Event::Type (or a callback function).
2025-12-03 13:26:27 +01:00
Andreas Kling
2a1c5dc108 LibCore: Don't require heap-allocated event to hold deferred invocation
Instead of creating a DeferredInvocationEvent every time we
deferred_invoke, we now let the QueuedEvent store the invokee Function
object directly.
2025-12-03 13:26:27 +01:00
Andreas Kling
69515f8c85 LibCore: Allow posting stateless events without heap-allocated Event
This patch adds an API for posting a Core::Event::Type to the thread
event queue without requiring a full Core::Event object.

We use this API to avoid heap allocations for every timer and notifier
activation event.
2025-12-03 13:26:27 +01:00
Andreas Kling
23fb9781d1 LibCore: Avoid excessive ref-count churn in event dispatch
We were strongly reffing the event receiver twice before actually
invoking the event handlers.
2025-12-03 13:26:27 +01:00
Andreas Kling
fa85f62895 LibCore: Remove unused Core::Event::Type::Quit 2025-12-03 13:26:27 +01:00
Timothy Flynn
96806a3f90 LibWeb: Update cursor and tooltip UI state regardless of event handlers
If a script on the page cancels a mousemove event, we would return early
and neglect to update the cursor. This is seen regularly on "Diablo Web"
where they set the cursor to "none" on the main canvas, and also cancel
mousemove events.
2025-12-03 12:23:56 +01:00
Timothy Flynn
612558144b LibGfx: Add a stringifier for StandardCursor 2025-12-03 12:23:56 +01:00
Timothy Flynn
dcf8463886 LibGfx: Remove unused StandardCursor::__Count 2025-12-03 12:23:56 +01:00
Timothy Flynn
c7b3a4fcf8 LibJS: Implement Iterator.concat
This proposal reached stage 4 and was merged into ECMA-262. See:
https://github.com/tc39/ecma262/commit/aefd096
2025-12-03 12:08:40 +01:00
Timothy Flynn
7ee415a7c2 LibJS: Directly indicate when the IteratorHelper generator is complete
Our existing implementation was checking if the generator step result
was `undefined` to indicate that the generator is complete. This is
not sufficient for an upcoming implementation of Iterator.concat, where
`undefined` is used as an incomplete iteration result.

Instead, let's have the Iterator prototype return an IterationResult to
explicitly indicate its completeness. As a result, the prototype also
looks more like the spec now.
2025-12-03 12:08:40 +01:00
Timothy Flynn
6976ff389e LibJS: Mark IteratorHelper::create as infallible
This is just allocating an IteratorHelper. There is no way for this to
throw an exception.
2025-12-03 12:08:40 +01:00
Timothy Flynn
e011f8d6b1 LibJS: Replace [[UnderlyingIterator]] with [[UnderlyingIterators]]
This is an editorial change in the EMCA-262 spec. See:
https://github.com/tc39/ecma262/commit/c541680
2025-12-03 12:08:40 +01:00
Timothy Flynn
557805d6ef LibJS: Compute byteIndexInBuffer sooner in Atomic's DoWait
This is a normative change in the ECMA-262 spec. See:
https://github.com/tc39/ecma262/commit/4d2116b

Note this does not yet affect us as we do not implement the remainder of
this AO.
2025-12-03 12:08:40 +01:00
Timothy Flynn
b060d5dcdf LibJS: Fix typo in ResolveExport assertion
This is an editorial change in the ECMA-262 spec. See:
https://github.com/tc39/ecma262/commit/29c5b17
2025-12-03 12:08:40 +01:00
Zaggy1024
b572ae95a9 LibCore+LibWeb: Remove the dummy EventReceiver from deferred_invoke()
The DeferredInvocationContext only existed to satisfy the requirement
in ThreadEventQueue that each event has an EventReceiver. However,
deferred_invoke() was not even using the EventReceiver to call its
callback. Therefore, we don't need to allocate one for every deferred
invocation.

This also prevents WeakPtr::strong_ref() from racing and leaking the
context object when invoking a function across threads.
2025-12-02 21:21:03 -06:00
Zaggy1024
970100e789 LibMedia: Pass SeekData by reference to avoid an inexplicable leak
Some checks failed
Close stale PRs / stale (push) Has been cancelled
Package the js repl as a binary artifact / Linux, arm64 (push) Has been cancelled
Package the js repl as a binary artifact / macOS, arm64 (push) Has been cancelled
Package the js repl as a binary artifact / Linux, x86_64 (push) Has been cancelled
Label PRs with merge conflicts / auto-labeler (push) Has been cancelled
Nightly Lagom / Linux, arm64, Distribution, Clang (push) Has been cancelled
Nightly Lagom / macOS, arm64, Distribution, Clang (push) Has been cancelled
Nightly Lagom / Linux, arm64, Sanitizer, Clang (push) Has been cancelled
Nightly Lagom / macOS, arm64, Sanitizer, Swift (push) Has been cancelled
Nightly Lagom / Linux, x86_64, Distribution, GNU (push) Has been cancelled
Nightly Lagom / Linux, x86_64, Sanitizer, Swift (push) Has been cancelled
Nightly Lagom / Windows, x86_64, Windows_Sanitizer_CI, ClangCL (push) Has been cancelled
Nightly Lagom / Flatpak aarch64 (push) Has been cancelled
Nightly Lagom / Flatpak x86_64 (push) Has been cancelled
For some reason, it seems that passing NonnullRefPtr<SeekData> const&
was causing us to triple ref() in the capture group for the audio seek
handlers, followed by only a single unref(). Changing this to plain old
SeekData& inexplicably fixes the leak.
2025-12-02 17:19:44 -06:00
Callum Law
e935dfbf5b LibWeb: Simplify compute_style_value_list 2025-12-02 12:47:10 +00:00
Callum Law
38efc39e17 LibWeb: Simplify assemble_coordinated_value_list
We know that all coordinated value list longhands are parsed as
`StyleValueList`s
2025-12-02 12:47:10 +00:00
Callum Law
74e6c5074f LibWeb: Store list-valued properties as lists in StylePropertyMap::set()
This matches the behavior of parsed values
2025-12-02 12:47:10 +00:00
Callum Law
953f9775a4 LibWeb: Mark animation-* properties as list-valued 2025-12-02 12:47:10 +00:00
Callum Law
758432c1cd LibWeb: Don't mark mask-type as list-valued
This is distinct from the other `mask-*` properties and is not a
longhand of `mask`, and is thus not a coordinating value list longhand
2025-12-02 12:14:27 +00:00
Callum Law
4034ce995a LibWeb: Account for transition-{delay,duration} always being a list
This fixes the optimization implemented in 46acdbd that was no longer
working after e937f5d
2025-12-02 11:45:46 +00:00