Commit graph

61223 commits

Author SHA1 Message Date
Matthew Olsson 46ee2b5f06 ClangPlugins: Add LLVM lit test suite 2024-05-13 16:50:54 -06:00
Matthew Olsson 6587c1f350 Lagom: Remove LibJSGCVerifier 2024-05-13 16:50:54 -06:00
Matthew Olsson 4ae7bbda52 Lagom: Add ClangPlugins to the build system 2024-05-13 16:50:54 -06:00
Matthew Olsson c3ed1a7995 Lagom: Add ClangPlugins
This is a more general and robust replacement of the LibJSGCVerifier.
We want to add more generic static analysis, and this new plugin will
be built in a way that integrates into the rest of the system.
2024-05-13 16:50:54 -06:00
Tim Ledbetter a8c60d65fc LibWeb: Specify the correct argument type in IDL for AbortSignal::any()
This allows some boilerplate code to be generated automatically.
2024-05-13 23:45:45 +01:00
Lucas CHOLLET ff2c6cab55 LibGfx: Correctly round values when computing the luminosity of a Color
Truncating the value is mathematically incorrect, this error made the
conversion to grayscale unstable. In other world, calling `to_grayscale`
on a gray value would return a different value. As an example,
`Color::from_string("#686868ff"sv).to_grayscale()` used to return
#676767ff.
2024-05-13 23:43:58 +02:00
Andrew Kaster bd4f516e64 LibWeb: Stub out FontFaceSet.status and .ready attributes
WPT wants to check these properties before running ref tests.
This fixes a ton of crashes in our CI WPT runs.
2024-05-13 20:20:39 +00:00
Aliaksandr Kalenik d79438a2a6 LibJS: Join locals, constants and registers into single vector
Merging registers, constants and locals into single vector means:
- Better data locality
- No need to check type in Interpreter::get() and Interpreter::set()
  which are very hot functions

Performance improvement is visible in almost all Octane and Kraken
tests.
2024-05-13 19:54:11 +02:00
Andreas Kling 59cb7994c6 LibWeb: Use memcpy() in CanvasRenderingContext2D.getImageData()
Instead of copying the image data pixel-by-pixel, we can memcpy full
scanlines at a time.

This knocks a 4% item down to <1% in profiles of Another World JS.
2024-05-13 17:29:37 +02:00
Andreas Kling 6f5201b759 LibJS: Add fast paths in TypedArrayPrototype.fill()
Filling a typed array with an integer shouldn't have to go through the
generic Set for every element.

This knocks a 7% item down to <1% in profiles of Another World JS at
https://cyxx.github.io/another_js/
2024-05-13 17:29:37 +02:00
Andreas Kling d79353a477 LibJS/Bytecode: Add fast paths for compare-and-jump with 2 numbers
When comparing two numbers, we can avoid a lot of implicit type
conversion nonsense and go straight to comparison, saving time in the
most common case.
2024-05-13 17:29:37 +02:00
Hugh Davenport 9772590e9a MouseSettings: Only allow valid cursor themes
To align the cursor theme tab to how DisplaySettings themes tab works,
this change forces the theme combo box to not allow free-text. Currently
on a click it puts the text cursor in the box to allow typing anything
rather than acting as a dropdown when clicking anywhere on the field.

Fixes #24306
2024-05-13 08:26:16 +01:00
Andreas Kling 855f6417df LibJS/Bytecode: Move environment variable caches into instructions
These were out-of-line because we had some ideas about marking
instruction streams PROT_READ only, but that seems pretty arbitrary and
there's a lot of performance to be gained by putting these inline.
2024-05-13 09:22:14 +02:00
Andreas Kling a06441c88c LibJS/Bytecode: Defer GetGlobal identifier lookup until cache misses
This way we avoid looking up the identifier when the cache hits.
2024-05-13 09:22:14 +02:00
Andreas Kling 6ec4d6f668 LibJS/Bytecode: Cache the running execution context in interpreter 2024-05-13 09:22:14 +02:00
Andreas Kling 8447f6f6da LibJS: Inline more of cached environment variable access in interpreter
And stop passing VM strictness to direct access, since it doesn't care
about strictness anyway.
2024-05-13 09:22:14 +02:00
Shannon Booth 9b6a1de777 LibWeb: Implement URL.parse
This was an addition to the URL spec, see:

https://github.com/whatwg/url/commit/58acb0
2024-05-13 09:21:12 +02:00
Shannon Booth 67ea56da59 LibWeb: Factor out an 'initialize a URL' AO
This is a small refactor in the URL spec to avoid duplication as part of
the introduction of URL.parse, see:

https://github.com/whatwg/url/commit/58acb0
2024-05-13 09:21:12 +02:00
Abuneri 4ea1e26aee LibLocale: Move includes below #pragma once in generated headers 2024-05-13 09:20:22 +02:00
Kenneth Myhra 0950d6ed97 Ports/dosbox-staging: Enable mt32emu 2024-05-13 00:15:21 +02:00
Kenneth Myhra 36511d23ef Ports: Add libmt32emu 2024-05-13 00:15:21 +02:00
Kenneth Myhra 95bd69cec5 Ports/dosbox-staging: Enable saving screenshots in .png format 2024-05-13 00:15:21 +02:00
Kenneth Myhra 02590ff5b9 Ports/dosbox-staging: Enable fluidsynth 2024-05-13 00:15:21 +02:00
Kenneth Myhra 6cc8c34e4e Ports: Add fluidsynth 2024-05-13 00:15:21 +02:00
Timothy Flynn 4bf0ddad4c Meta: Remove the generated bindings forwarding header from the GN build
This was removed in commit 22705e3065.
2024-05-12 18:10:05 -04:00
Shannon Booth 5a0f7c5f63 LibWeb/Tests: Add a basic test for a blob URL given to a Worker 2024-05-12 15:46:29 -06:00
Shannon Booth 53eb9af42f LibWeb: Use URL's 'blob URL entry' for blob fetches
Performing a lookup in the blob URL registry does not work in the case
of a web worker - as the registry is not shared between processes.
However - the URL itself passed to a worker has the blob attached to it,
which we can pull out of the URL on a fetch.
2024-05-12 15:46:29 -06:00
Shannon Booth 2457fdc7a4 LibWeb: Attach blob to URL on DOMURL::parse
On a non-basic URL parse, we are meant to perform a lookup on the blob
URL registry and attach any blob to that URL if present. Now - we do
that :^)
2024-05-12 15:46:29 -06:00
Shannon Booth 4f30d50dc9 LibIPC: Remove uneeded NumericLimit<u32>::max check for ByteString
This is no longer needed now that ByteString does not have a null state.
2024-05-12 15:46:29 -06:00
Shannon Booth 55cd53e4ed LibIPC: Also encode URL::blob_url_entry over IPC 2024-05-12 15:46:29 -06:00
Shannon Booth 27e1f4762c LibURL: Add BlobURLEntry to URL 2024-05-12 15:46:29 -06:00
Shannon Booth ec381c122e LibWeb: Implement "Resolve a Blob URL"
Which performs a lookup to find a blob (if any) corresponding to the
given blob URL.
2024-05-12 15:46:29 -06:00
Shannon Booth c071720430 LibWeb: Handle blob URLs in Document::parse_url
Implement this function to the spec, and use the full blown URL parser
that handles blob URLs, instead of the basic-url-parser.

Also clean up a FIXME that does not seem relevant any more.
2024-05-12 15:46:29 -06:00
Timothy Flynn 95c6fdf401 LibWebView: Escape HTML entities in the Task Manager process titles 2024-05-12 15:38:18 -06:00
Timothy Flynn 0bd5e94958 Meta: Add missing IDL files to the GN build
Unclear why these being missing did not cause a compilation error.
2024-05-12 15:38:18 -06:00
Timothy Flynn cc84dba7e8 Meta: Port recent changes to the GN build
cea59b6642
2bc51f08d9
e10721f1b5
3a5eabc43b
2024-05-12 15:38:18 -06:00
Alec Murphy 8b14b5ef36 Browser: Pledge thread for FilePicker
This fixes a crash when attempting to display thumbnails for image
files in the FilePicker if thread is not pledged.
2024-05-12 15:37:36 -06:00
Timothy Flynn 3ff1d7da59 Kernel: Run clang-format
The following command was used to clang-format these files:

    clang-format-18 -i $(find . \
        -not \( -path "./\.*" -prune \) \
        -not \( -path "./Base/*" -prune \) \
        -not \( -path "./Build/*" -prune \) \
        -not \( -path "./Toolchain/*" -prune \) \
        -not \( -path "./Ports/*" -prune \) \
        -type f -name "*.cpp" -o -name "*.mm" -o -name "*.h")

There was a recent release of clang-format version 18.1.5 which fixes
errant spaces around `->` in these files.
2024-05-12 15:44:27 -04:00
Shannon Booth 5e7678d1c6 LibWeb: Implement AudioBuffer.copyFromChannel 2024-05-12 19:11:37 +02:00
Aliaksandr Kalenik 8bcaf68023 LibJS: Remove VM::execute_ast_node() 2024-05-12 19:10:25 +02:00
Aliaksandr Kalenik 6fb1d9e516 LibJS: Stop using execute_ast_node() for class property evaluation
Instead, generate bytecode to execute their AST nodes and save the
resulting operands inside the NewClass instruction.

Moving property expression evaluation to happen before NewClass
execution also moves along creation of new private environment and
its population with private members (private members should be visible
during property evaluation).

Before:
- NewClass

After:
- CreatePrivateEnvironment
- AddPrivateName
- ...
- AddPrivateName
- NewClass
- LeavePrivateEnvironment
2024-05-12 19:10:25 +02:00
Aliaksandr Kalenik b46fc47bf7 LibJS: Remove execute_ast_node() usage for ClassMethod function creation
Call ECMAScriptFunctionObject constructor directly instead of using
execute_ast_node() to emit NewFunction instruction.
2024-05-12 19:10:25 +02:00
Shannon Booth 793cab7357 LibWeb: Add a test for construction of WheelEvent 2024-05-12 14:24:18 +00:00
Shannon Booth 2e1316507f LibWeb: Fix missing initialization of delta_z in WheelEvent 2024-05-12 14:24:18 +00:00
Shannon Booth 42e3ba409e LibWeb: Add constructor for WheelEvent
This makes https://profiler.firefox.com/ progress much further in
loading :^)
2024-05-12 14:24:18 +00:00
Shannon Booth 0c799b23cb LibWeb: Use WebIDL::UnsignedLong for deltaMode in WheelEvent
This matches the IDL definition. Without this we experience a compile
time error when adding the WheelEvent constructor due to a mimatched
type between the enum class and UnsignedLong that the prototype is
passing through to the event init struct for the constructor.
2024-05-12 14:24:18 +00:00
Shannon Booth e5206f5529 LibWeb: Only use lowercase attributes on toggle for HTML documents 2024-05-12 07:28:09 +01:00
Shannon Booth 89a536b57a LibWeb: Remove resolved FIXME about putting HTMLALlCollection in HTML NS
This was an unfortunate artifact from development. I originally added
this class in the DOM namespace alongside HTMLCollection until I
realized it was defined by the HTML spec instead. To remind myself to
move it over to the HTML namespace, I left this comment. It was moved
to the correct namespace before upstreaming to the main repo, but I
forgot to remove this comment!
2024-05-12 07:28:09 +01:00
Shannon Booth 97c1722ebd LibWeb: Remove resolved FIXME about implementing more methods in Range
We are not missing a whole bunch of IDL methods any more :^)
2024-05-12 07:28:09 +01:00
Shannon Booth dadc610e4a LibWeb: Pass a FlyString to getElementsByTagNameNS 2024-05-12 07:28:09 +01:00