Commit graph

63788 commits

Author SHA1 Message Date
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
sin-ack
3e29a1975a LibWeb: Obtain basename before passing base_url to ClassicScript::create
This would previously crash because it depended on a specific order for
evaluating function arguments, which is undefined.

(cherry picked from commit 27b1d94e04386fd46c2c9148b9555c841595e2d3)
2024-11-12 22:26:21 -05:00
Jelle Raaijmakers
8c714769f3 LibWeb: Implement navigator.deviceMemory
Fixes at least 2 subtests in wpt/device-memory.

(cherry picked from commit 69f11fc1c657603b189015fd620f96e32adfb9fd)
2024-11-12 22:26:21 -05:00
Jelle Raaijmakers
3a79099303 LibWeb: Add WebIDL::Double type
(cherry picked from commit 6189d1ac9d73347638c3cbec4d7e21a390edd238)
2024-11-12 22:26:21 -05:00
Jelle Raaijmakers
2ce1b1af9b LibCore: Add System::physical_memory_bytes()
(cherry picked from commit 9515290fde3c973226c9737cbd055ebd85df7101)
2024-11-12 22:26:21 -05:00
Jamie Mansfield
5ef8538d38 LibWeb/UIEvents: Implement TextEvent
(cherry picked from commit f610a12671cccc5bf96c7ce8f7773c02412b8d81)
2024-11-12 22:26:21 -05:00
Jamie Mansfield
ad93d00ed2 LibWeb/UIEvents: Implement CompositionEvent
(cherry picked from commit 86e20ea2469c0defb6fca40de3cbb339c168b543)
2024-11-12 22:26:21 -05:00
Jamie Mansfield
77cdbb5318 LibWeb/UIEvents: Implement InputEvent
(cherry picked from commit 9fce70069dc29f2232feb8247e69d21fe720fa94)
2024-11-12 22:26:21 -05:00
Jamie Mansfield
88a24d015d LibWeb: Correct forward for UIEvents::UIEvent
(cherry picked from commit 60d9c3929ccb8334420dc36abddc5665b5955f44)
2024-11-12 22:26:21 -05:00
Tim Ledbetter
05e8835555 LibWeb: Follow spec steps to set the selectionDirection attribute value
(cherry picked from commit d0b97873d421d092eb41e3b7a7d8959347b3b436)
2024-11-12 22:26:21 -05:00
Timothy Flynn
48ce92598d LibWeb: Dispatch click events using the correct button/buttons
We were generating click events always using the primary mouse button
instead of the provided button, and with the buttons field set to that
provided button.

(cherry picked from commit dd5a0361f2307b280a910d219fbc2dfd0072409f)
2024-11-12 22:26:21 -05:00
Timothy Flynn
2fa5bb85e3 LibWeb: Use a named enum value to generate mousemove button events
Rather than having to know what 1 means, let's use the enum value.

(cherry picked from commit ae01904369fac96343bf491df1e4860018f20159)
2024-11-12 22:26:21 -05:00
BenJilks
f3426e3ca0 LibWeb: Test for hits around fragments in InlinePaintable
This allows you to select text at the end of fragments, just like in
non-inline elements.

(cherry picked from commit 813612096c6135357c9a0e079db67e52900ebd5f)
2024-11-12 22:26:21 -05:00
BenJilks
a93d4d4975 LibWeb: Pick the closest hit test result, instead of the first
When performing a hit test of type TextCursor, it would check if the
position is around each fragment and not just inside it. This resulted
in always selecting the first fragment checked.

This commit computes the distance of each hit test result, and picks the
closest one.

(cherry picked from commit 8c465c95aa7acde2355b0ce0762987724f5f6811)
2024-11-12 22:26:21 -05:00
Bram Otte
795925bff9 LibWeb: Handle multiple result values for WebAssembly functions
(cherry picked from commit 003fc4f8eeb57eedba9a6a055002c7fa9d0aab7d)
2024-11-12 22:26:21 -05:00
mrdcbrush
588d79e36e LibWebView: Add Kagi search engine to menu
LibWebView: Add Kagi search engine to selection menu
(cherry picked from commit b757ee0bc8863b7785fe6f5f15ae6d4d3c82896f)
2024-11-12 22:26:21 -05:00
Andreas Kling
b0d8d9ef4a LibWasm: Make BytecodeInterpreter overrides final
This gives us free devirtualization of some hot calls inside the
bytecode interpreter. Most notably the did_trap() checks.

Modest performance improvement on the https://figma.com/ landing page.

(cherry picked from commit 2f3128333dcd5a781f35272800631d6cf03803ad)
2024-11-12 22:26:21 -05:00
Ali Mohammad Pur
28af9da66f LibWasm: Allow all Value::to<Integral>() calls
This brings back the old behaviour of Value::to<short>() (and other
similar calls), which WASI depends on.
To make sure all similar issues are caught in the future, this commit
also introduces an static assertion in Value::to().

(cherry picked from commit 0d05ab2ad0cc56cc6fe9ee647dfcfda44a92b4f2)
2024-11-12 22:26:21 -05:00
Sebastian-Webster
584e555f33 LibWebView: Add Ecosia search engine
(cherry picked from commit b0e3b289299728583847590209f9ed4b9083bbe3)
2024-11-12 22:26:21 -05:00
Ali Mohammad Pur
7d1b4c9ee0 LibWasm: Use braces to initialize Reference::Foo classes
These have no declared constructor, so apple clang and clang clang seem
to disagree on some versions.

(cherry picked from commit d2ff92077b2a4ead0a1ef65e7131702e1152cbeb)
2024-11-12 22:26:21 -05:00
Diego Frias
a97996351f LibWasm: Remove type information from Value
Gets fib(30) from 380ms to 340ms.

(cherry picked from commit a58704296cd36d3080dbf8f1be49300de2c25ea9;
amended to comment out two dbgln_if()s that no longer compile after
this change if WASM_TRACE_DEBUG is defined to 1 -- see comments on
LadybirdBrowser/ladybird#960. Likewise, one dbgln_if() in Wasi.cpp
got commented out as well)
2024-11-12 19:58:14 -05:00
Diego Frias
dea772ab0f LibWasm: Directly remove from the stack when clearing a label
Theoretically, the previous "pop, then push" method should be faster,
but it's actually faster to just remove from the stack directly.

(cherry picked from commit a2448308fd90ba0aafd42587a091c0da3c037ba9)
2024-11-12 19:58:14 -05:00
Diego Frias
764529cdc1 LibWasm: Inline bytecode interpreter instruction interpretation
Gets fib(30) from 480ms to 380ms.

(cherry picked from commit b73b17aab457bdeb33ada917ae7217aab81a664b)
2024-11-12 19:58:14 -05:00
Diego Frias
6a1d2f990c LibWasm: Split main interpreter stack into three
Instead of one stack to hold frames, labels, and values, there is now
three separate stacks. This speeds up fib(30) from 580ms to 480ms.

(cherry picked from commit a3b077c6415e0f4038b8c8da1e1e9c9cc2df5f0a)
2024-11-12 19:58:14 -05:00
Diego Frias
f7a322b1fb LibWasm: Simplify downcasting in bytecode interpreter
(cherry picked from commit 15510fb42e03b71e39b42d08dfbc7f7a822a0a1e)
2024-11-12 19:58:14 -05:00
Hermes Junior
34ae4521ff LibJS: Correctly return cached value for global var bindings
When the cached value was not an accessor, it was simply ignored.
This is the value we really want, so we can just return it.
Shows up to 5x improvements on some benchmarks,
and 1.4x in general js-benchmarks.

(cherry picked from commit 77a46ab1b8d13f35b11a7bd08459752912dca1bf)
2024-11-12 19:57:55 -05:00
Andreas Kling
7b2568bc9a LibJS: Stop having AsyncFunctionDriverWrapper leak itself
Async functions whose promise is never resolved were leaking, since they
had a strong root JS::Handle on themselves.

This doesn't appear to actually be necessary, since the wrapper will be
kept alive as long as it's reachable (and if it's not reachable, nobody
is going to resolve/reject the promise either).

This fixes the vast majority of leaks on Speedometer, bringing memory
usage at the end of a full run from ~12 GiB to ~3 GiB.

(cherry picked from commit b6a5b7e18626ce0dee11a25bb0d51d2e84d3c057)
2024-11-12 19:57:55 -05:00
Andreas Kling
8486d6e8aa LibJS: Use ConservativeVector when instantiating static class fields
This fixes an issue where a badly-timed garbage collection could swallow
a static field initializer.

Caught by running test262 in GC-on-every-allocation mode.

(cherry picked from commit 10724a7cb346e57b0b97e4bd54c13c5c604dbf9c)
2024-11-12 19:57:55 -05:00
Andreas Kling
1c7e69a5b5 LibJS: Make ConservativeVector<T> visit all possible values
We were miscalculating the length of the buffer in pointer-sized chunks,
which is what the conservative root scan cares about.

This could cause some values to be prematurely garbage-collected.

(cherry picked from commit 2fb3b6c542db3a86cbd1aa7e34d470e34c485372)
2024-11-12 19:57:55 -05:00
justus2510
da16c169ae LibWeb: Handle unpaired surrogates in USVStrings
This should fix (at least) the last two remaining WPT test failures in
FileAPI/unicode.html.

(cherry picked from commit 55f0dc823ff266aeb29fd6f7d47d5e7f89a50ee6)
2024-11-12 19:57:55 -05:00
Gingeh
1a1ccd3a92 LibWeb: Set both start and end in Selection::extend
(cherry picked from commit f41cbfa2a9c1ff21890581d0ae87334ff1e780e6)
2024-11-12 19:57:55 -05:00
Gingeh
1c7ca6d33e LibWeb: Set direction to forwards in addRange
(cherry picked from commit 93927d8243ae61b96fc70e6e7d44f8e0255b0408)
2024-11-12 19:57:55 -05:00
Gingeh
7f930dcdb0 LibWeb: Implement Selection::direction
(cherry picked from commit a7953f5e092429be3d51e3de2f26f666315ec912)
2024-11-12 19:57:55 -05:00
sin-ack
b7dea19a3f LibWeb: Compare navigable active_url with fragments included
This was previously negated due to a misread of
https://url.spec.whatwg.org/#concept-url-equals. This change fixes a
bunch of WPT crashes such as
"/html/browsers/history/the-history-interface/001".

(cherry picked from commit f1cab5de7a071fe76eae10d36603f6cf34fa989e)
2024-11-12 19:57:55 -05:00
Glenn Skrzypczak
34247c4251 LibWeb: Don't crash when encountering a resolution in a calculation
calc() seems to support resolutions by now.

The change allows us to pass this WPT test:
http://wpt.live/css/css-values/round-mod-rem-invalid.html

(cherry picked from commit 3804c4dea1a8e4296327ca570e012264ee2580b3)
2024-11-12 19:57:55 -05:00