Commit graph

63822 commits

Author SHA1 Message Date
Jelle Raaijmakers
e87b17b0e0 LibWeb: Add stubbed Media Source Extensions API
Just the boilerplate :^)

(cherry picked from commit 35043702813117d22e841e1b1d887d1726d4ed2d;
amended to fix conflict in idl_files.gni due to ladybird being worse
than serenity at having that file sorted alphabetically)
2024-11-13 19:32:14 -05:00
Jelle Raaijmakers
15581f8acc LibGfx: Remove unused include from Line
(cherry picked from commit 3e3851983dacee378f787f108a7ced68fa87a013)
2024-11-13 19:32:14 -05:00
Timothy Flynn
ba539d6b09 LibWeb: Guard MediaQueryList event listener removal against null
A recently imported WPT test has a subtest that effectively does the
following:

    const mql = window.matchMedia("");
    mql.removeListener(null);

(cherry picked from commit 3e5476c9e09055104fc64d294da39aa1bfccac09)
2024-11-13 19:32:02 -05:00
Timothy Flynn
0a9c220068 LibWeb: Use GCPtr in MediaQueryList
(cherry picked from commit 213155ad7d2cc32271bebce7fecdb35d1e286f22)
2024-11-13 19:32:02 -05:00
Luke Wilde
c1767b1964 LibWeb: Make iframe insertion steps check the shadow including root
The insertion steps for iframes were following an old version of the
spec, where it was checking if the iframe was "in a document tree",
which doesn't cross shadow root boundaries. The spec has since been
updated to check the shadow including root instead.

This is now needed for Cloudflare Turnstile iframe widgets to appear,
as they are now inserted into a shadow root.

(cherry picked from commit 4dd14d812f73377cb1efa5a8e8a114912a90b5af)
2024-11-13 19:32:02 -05:00
Luke Wilde
dd6ede831d LibWeb: Actually traverse the shadow root of the inclusive descendant
Previously, the inclusive descendant, which is the node that
for_each_shadow_including_inclusive_descendant was called on, would not
have it's shadow root traversed if it had one.

This is because the shadow root traversal was in the `for` loop, which
begins with the node's first child. The fix here is to move the shadow
root traversal outside of the loop, and check if the current node is an
element instead.

(cherry picked from commit 6df4e5f5e75d7d6d439d1365ed7bed4fd2a8a1da)
2024-11-13 19:32:02 -05:00
Shannon Booth
224483b941 LibWeb: Add temp execution context for resolving promise in AudioContext
Fixes a crash seen on twitter.com, namely from the 'resume' function.

(cherry picked from commit 5d7a7a43c40f2413f6936ddd69794f8550172e09)
2024-11-13 19:32:02 -05:00
Jelle Raaijmakers
ec6803eb44 LibWeb: Implement pending promises in BaseAudioContext
Move the pending promises list from AudioContext to BaseAudioContext and
deal with all remaining FIXMEs.

(cherry picked from commit 2df3488840ccf8e8c560bde4826897c2023dbe29)
2024-11-13 19:32:02 -05:00
Ninad Sachania
27b8bb7969 Ports: Add lolcat 2024-11-13 12:21:05 -05:00
Andreas Kling
bff196be31 LibWeb: Avoid unnecessary style recomputation during traversal
While traversing the DOM tree, looking for nodes that need a style
update, we were recomputing style for every node visited along the way,
even nodes that didn't themselves need a style update (but one of their
descendants did).

This avoids a bunch of completely unnecessary style recomputation on
basically every website.

(cherry picked from commit 5431db8c1c9d366d0a27959cfbf0f146bf4be20d)
2024-11-13 10:17:34 -05:00
Shannon Booth
7dc49c9038 LibJS: Align ShadowRealmConstructor closer with latest spec
The current shadow realm constructor implementation was based off a
merge request to the shadow realm proposal for integration into the
web platform. However, this merge request had a bug which we had
applied a workaround for by popping off the execution stack.

Since then, the spec has had an update of:

https://github.com/tc39/proposal-shadowrealm/commit/28b0cc

Which closer aligned the mainline spec to the proposed merge request.

Now, the original shadow realm proposal merge request has been closed
and a new one has been reopened with a much more minimal set of changes
that merely adds extra arguments to HostInitializeShadowRealm, which
this commit aligns with.

(cherry picked from commit 424a0cda936e018a9881f3e5898beb79d2212caa)
2024-11-13 10:17:34 -05:00
Shannon Booth
6f48342e3f LibJS: Update ShadowRealm to not hold an ExecutionContext
Noone needs to use this any more :^)

This is somewhat AD-HOC in the constructor as it is based on an open
shadow realm merge request, but applies the intent of the change without
any change in behaviour.

(cherry picked from commit b927d7f65870c94d0c7ead3f6bdd8e6f6f0ac887)
2024-11-13 10:17:34 -05:00
Shannon Booth
2fedb5a87e LibJS: Use GetShadowRealmContext for PerformShadowRealmEval
(cherry picked from commit 3cb62265ab203d652a3fffab431f842fc46d375c)
2024-11-13 10:17:34 -05:00
Shannon Booth
93732e2ca3 LibJS: Use GetShadowRealmContext for ShadowRealmImportValue
Removing one user of the ExecutionContext slot of ShadowRealm.

(cherry picked from commit 6a55865bf61ba0ad8aebd1b72ea0be82d849600d)
2024-11-13 10:17:34 -05:00
Shannon Booth
b0ac3039f2 LibJS: Implement ShadowRealm AO GetShadowRealmContext
This is a new AO introduced in the spec which allows the
[[ExecutionContext]] slot of the ShadowRealm object to be removed.

(cherry picked from commit 3f24008b31d36c41c3bb841312914019073fac33)
2024-11-13 10:17:34 -05:00
Shannon Booth
5ce612166f LibJS: Update HostEnsureCanCompileStrings arguments to latest spec
(cherry picked from commit c1998f96c29f04cdad822e14867c3a7ffb6cf4b3)
2024-11-13 10:17:34 -05:00
Shannon Booth
10f2c11f3b LibJS: Update CreateDynamicFunction to latest spec
The use of extract_parameter_arguments_and_body() here is to make things
a little less awkward. If we were to exactly follow spec there would be
an awkward handling of the case that no arguments were provided and we
needed to provide an empty string.

To do this, we would need to either:
  - Provide an Optional<Value> for bodyString to CreateDynamicFunction
  - Create a new empty PrimitiveString wrapped in a JS Value.

Either case is somewhat awkward. Instead, just refactor this logic
outside of CreateDynamicFunction and make the caller do it.

Otherwise, this commit prepares for the new definition of
HostEnsureCanCompileStrings.

(cherry picked from commit 6da0ac3aa71c991e18e96d721b1843c417cdab78)
2024-11-13 10:17:34 -05:00
Pavel Shliak
df40a0cf2c LibAudio: Initialize GainNode properly
That helps to pass WPT tests
under /webaudio/the-audio-api/the-gainnode-interface/ctor-gain.html

(cherry picked from commit 4998385c7aeae21939f4ea24bb4f8c6eb477840b)
2024-11-13 10:17:34 -05:00
Pavel Shliak
209df06ab7 LibJS: Add calendar id getter to ZonedDateTimePrototype
(cherry picked from commit ba71cb1ca43738096a1c93ea02904e7eaa4012dd)
2024-11-13 10:17:34 -05:00
Pavel Shliak
404b965b2e LibJS: Add calendar id getter to PlainMonthDayPrototype
(cherry picked from commit 2ad48b64caaed0e1b4bec6819d71a20a2a184bad)
2024-11-13 10:17:34 -05:00
Pavel Shliak
f6865454ae LibJS: Add calendar id getter to PlainYearMonthPrototype
(cherry picked from commit 0e1e8c908e59766ceafbdcbb6dd07ff0e06c5632)
2024-11-13 10:17:34 -05:00
Pavel Shliak
556ba1edd1 LibJS: Add calendar id getter to PlainDateTimePrototype
(cherry picked from commit 44fa8410c0dfac07ac1b293eab120d467ef8461a)
2024-11-13 10:17:34 -05:00
Pavel Shliak
dded35e06d LibJS: Add calendar id getter to PlainDatePrototype
(cherry picked from commit f7cf7382c9b4502b4292ed6aa592cfe4727ec9cf)
2024-11-13 10:17:34 -05:00
Pavel Shliak
879da0b7e7 LibJS: Adds calendar_id identifier
(cherry picked from commit e60c1ddd4d5259281cd71017f7d3a89eea99b507)
2024-11-13 10:17:34 -05:00
Timothy Flynn
5c3300e138 WebContent: Parse the type hint in WebDriver's New Window endpoint
Although we aren't using this hint (we always create tabs), we do need
to validate the payload.

(cherry picked from commit ebe89a32073a1b838f2d1e04d2146f2dfae6b6f7)
2024-11-13 10:17:34 -05:00
Jelle Raaijmakers
57e6b8cd85 LibWeb: Add PointerEvent.getCoalescedEvents() and .getPredictedEvents()
Fixes at least 4 WPT subtests in /pointerevents.

(cherry picked from commit 27928cd28c89b2cbf1291c25be9accfb3ec18146)
2024-11-13 10:17:34 -05:00
Jelle Raaijmakers
3ce27bfc73 LibWeb: Add PointerEvent.persistentDeviceId
Fixes at least 2 WPT subtests in /pointerevents.

(cherry picked from commit effa21a69f9323871da927177b85f3c61b98cc3a)
2024-11-13 10:17:34 -05:00
Vincent Sgherzi
8fc0cc0139 LibWeb: Fix boolean logic mistake in XMLSerializer for empty public ID
Fixes 5 subtests on http://wpt.live/domparsing/xml-serialization.xhtml

(cherry picked from commit 9ce139a3f084c33bb3d1f591831ca8b26c0918a9)
2024-11-13 10:17:34 -05:00
Jim Broadbent
982cea38a9 LibWeb/XHR: Progess event handle empty length
(cherry picked from commit 97ca6036fa5dc1e73b27115304d8d435b9fc7df6)
2024-11-13 10:17:34 -05:00
Kemal Zebari
5b244c69cd LibWeb/HTML: Add missing HTMLElement IDL autocorrect as a stub
This adds an IDL stub for the autocorrect HTMLElement attribute.

(cherry picked from commit 04d16a1ee3a4f8224417bbc5f8abe8ef4ffe5b88)
2024-11-13 10:17:34 -05:00
Andreas Kling
337b113e68 LibWeb: Use the correct document URL in DOMParser.parseFromString()
We were hard-coding "about:blank" as the document URL for parsed HTML
documents, which was definitely not correct.

This fixes a bunch of WPT tests under /domparsing/ :^)

(cherry picked from commit 55f58eea99c0429dcc39cd0430fafa60eecf5542)
2024-11-13 10:17:34 -05:00
Simon König
e4903feab8 LibWeb: Don't crash on encountering display: list-item on pseudo element
On any `display: list-item` Node a CSS pseudo element (`::marker`) needs
to be created. This commit allows the ::maker pseudo element to be
nested within other pseudo elements (e. g. ::before or ::after).

This fixes this WPT test:
http://wpt.live/css/CSS2/generated-content/after-content-display-003.xht

(cherry picked from commit 15d2857a01b5bda90ace3d02cf9e1bc8ce279d38)
2024-11-13 10:17:34 -05:00
Benjamin Bjerken
a3c986021d LibWeb: Add SVGImageElement load and error events
This resolves all WPT timeouts in html/canvas/element/manual/imagebitmap
We can now run an additional 6 tests and 126 subtests :)

This also adds regression tests for this behavior.

(cherry picked from commit 0c04bd66764dfbe8f6da515d09b076683c61e93c)
2024-11-13 10:17:34 -05:00
Sam Atkins
c1dacfccad LibWeb: Indent the CSS dumps correctly
Selectors and at-rules both made assumptions about their indentation
level, which made it difficult to read the dump output. It'll become
even worse once rules can be further nested within each other, so let's
fix it now. :^)

(cherry picked from commit aeed4921c4ec6ebcce487812d2fdfe7d415affd2)
2024-11-13 10:17:34 -05:00
Sam Atkins
fb332e2e7b LibWeb: Remove tiny-OOM handling from dump code
(cherry picked from commit 5cc75d4de4f68093611da22a18b8d66c16e83bf0)
2024-11-13 10:17:34 -05:00
Galvin
4ed48dfb9e UI/AppKit: Fix tab title icon and text layout
Make the tab title icon and text vertical center

(cherry picked from commit e8ff9b6eb4c77d8606e492e8f0608190d40b7649)
2024-11-13 10:17:34 -05:00
Sam Atkins
ca5b3dbd7b LibWeb/CSS: Stop invalidating style when setting an animation's effect
This reverts 6d25bf3aac

Invalidating the style here means that transitions can cause an element
to leave style computation with its "needs style update" flag set to
true. This then causes a VERIFY to fail in the TreeBuilder.

This invalidation does not otherwise seem to have any effect. The
original commit suggests this was to fix a bug, but it's not clear what
bug that was. If it reappears, we can try to solve the issue in a
different way.

(cherry picked from commit 81596b41457d250bac28db37c1390fa46e6532de;
amended test with leading whitespace since we don't have
LadybirdBrowser/ladybird#1603 yet)
2024-11-13 10:17:34 -05:00
Benjamin Bjerken
6268e8f559 LibWeb: Fix CloseWatcher constructor for detached iframes
This fixes the last subtest in /close-watcher/frame-removal.html :)

(cherry picked from commit 63d9ed9d8c4fafd569e042e0698bd5dc844a1b29)
2024-11-13 10:17:34 -05:00
Jelle Raaijmakers
fb8870d710 LibWeb: Add barebones BaseAudioContext.decodeAudioData()
Implement just enough steps to get https://zty.pe/ working! :^)

(cherry picked from commit 14b2e5849d4b82aec6900253f6f035a9b356bad3)
2024-11-13 10:17:34 -05:00
Jelle Raaijmakers
4e0c54fa61 LibWeb: Accept JS::HeapFunction when queuing a media element task
This opens up the possibility of easier memory management in future
changes.

(cherry picked from commit 7b76438d579959edd800de14cb30c57eadb14669)
2024-11-13 10:17:34 -05:00
Jelle Raaijmakers
b5f61be76a LibWeb: Move 'queue a media element task' to BaseAudioContext
We need these steps to be available for the yet to be implemented
`BaseAudioContext.decodeAudioData()`.

(cherry picked from commit 177e5210e09ee4b5906e5d7db34154fae4ec76c6)
2024-11-13 10:17:34 -05:00
Jelle Raaijmakers
4a6281221e LibWeb: Remove unused include from AudioBuffer
(cherry picked from commit 273a46cc769d1ad614d974ca6c60fb4911e81a07)
2024-11-13 10:17:34 -05:00
Jelle Raaijmakers
d1a5ef62ce LibWeb: Correct AudioBuffer spec link
(cherry picked from commit 3df3977ca5f16ec3955e0222bc277fcf2619a915)
2024-11-13 10:17:34 -05:00
Jelle Raaijmakers
8563e4a1cc Meta: Reuse built-in JS types list for IDL to C++ generation
This opens up the code path for the `ArrayBuffer` type, which can now be
used as a method argument.

(cherry picked from commit 0b9d55b6761b85b3b80a459d6231841e72a26c51)
2024-11-13 10:17:34 -05:00
justus2510
fc2f49a936 LibWeb: Make FileReader fire progress event
Fixes wpt/FileAPI/reading-data-section/filereader_events.any.html :)

(cherry picked from commit 7a92b47a35609d4bb48a111d4582ff4c424c4088)
2024-11-13 10:17:34 -05:00
Andrew Kaster
4a1bcb0380 LibWasm: Reject indirect calls to external function references
This fixes a test in the WebAssembly spec test suite that was
added in 924c1f816d

(cherry picked from commit a3157c8c6960541ba0a621680aadea7c9092bb03)
2024-11-13 10:17:34 -05:00
Douwe Zumker
cde2d51d27 LibWebView: Add GoogleScholar search engine to selection menu
(cherry picked from commit d6d94ba8cb07e1cd511d4ff1d7b34f01e4db06fd)
2024-11-13 10:17:34 -05:00
Ali Mohammad Pur
7c96d9a96d LibWasm+LibWeb+test-wasm: Refcount Wasm::Module for function references
Prior to funcref, a partial chunk of an invalid module was never needed,
but funcref allows a partially instantiated module to modify imported
tables with references to its own functions, which means we need to keep
the second module alive while that function reference is present within
the imported table.
This was tested by the spectests, but very rarely caught as our GC does
not behave particularly predictably, making it so the offending module
remains in memory just long enough to let the tests pass.

This commit makes it so all function references keep their respective
modules alive.

(cherry picked from commit a60ecea16abe62aae988ba877fdb98466d2919d3)
2024-11-13 10:17:34 -05:00
Nico Weber
1b0ed2d74a Meta: Add more commits and PRs to lb-cherry-picks.py 2024-11-13 09:58:46 -05:00
Oskar Skog
a47e63b589 Ports/python3: Backport gh-126688: Reinit import lock after fork
https://github.com/python/cpython/pull/126765

Closes #25263

Make sure to revert this commit before updating Python.
2024-11-12 22:27:19 -05:00