Commit graph

65737 commits

Author SHA1 Message Date
Aliaksandr Kalenik
38488b9ef3 LibWeb: Implement GLES2 context creation
For now only macOS is supported.

IOSurface is used as a backing store because it will allow us to read
it from Skia and write to it from OpenGL without any extra copying:
- ANGLE_metal_texture_client_buffer extension is used to create
  EGLSurface from IOSurface.
- Then the same IOSurface is wrapped into Metal texture and passed to
  Skia allowing to share the same memory between Skia Metal backend and
  ANGLE.
2024-12-03 23:35:45 +01:00
Aliaksandr Kalenik
d133b0aded LibWeb: Delete OpenGL function wrappers in OpenGLContext
It's going to be replaced by code genration in upcoming changes.
2024-12-03 23:35:45 +01:00
Aliaksandr Kalenik
4bf9bf7972 LibWeb: Merge WebGLRenderingContextBase into WebGLRenderingContext
There is no need to have a separate class for WebGLRenderingContextBase
mixin.
2024-12-03 23:35:45 +01:00
Aliaksandr Kalenik
4f219f46ee LibWeb: Add ANGLE
ANGLE is going to be used for WebGL implementation in upcoming changes.
2024-12-03 23:35:45 +01:00
Aliaksandr Kalenik
f719b05ab9 LibWeb: Delegate painting surface allocation to canvas's active context
This change prepares for the addition of WebGL support, where painting
surface allocation process will differ from that of context2d.
2024-12-03 23:35:45 +01:00
Aliaksandr Kalenik
e683700fe6 LibWeb: Allow construction of PaintingSurface directly from IOSurface
Previously, constructing a PaintingSurface from an IOSurface required
wrapping IOSurface into a Metal texture before passing it to the
PaintingSurface constructor. This process was cumbersome, as the caller
needed access to a MetalContext to perform the wrapping.

With this change SkiaBackendContext maintains a reference to the
MetalContext which makes it possible to do:
IOSurface -> MetalTexture -> SkSurface within a PaintingSurface
constructor.
2024-12-03 23:35:45 +01:00
Aliaksandr Kalenik
bfdf52701f LibWeb: Treat min{max}-height as none if available is intrinsic [GFC]
Fixes infinite recursion in following cases:
- max-height: fit-content
- max-height: min-content
- max-height: max-content
2024-12-03 23:10:08 +01:00
Konstantin Konstantin
9dad8f55a4 LibWeb: Implement transfer for Resizable/ArrayBuffer
Implement transfer logic for ArrayBuffer and ResizableArrayBuffer.

Change TransferDataHolder data type to Vector<u32> to reuse existing
serialization infrastructure.

Fix 5 WPT tests in `window-postmessage.window.html` that relates to
transport.
Fix `LibWeb/Text/input/Worker/Worker-postMessage-transfer.html`.
The latter is currently ignored due to flakiness, no rebaseline is
needed.

During serialization with transfer, initialize memory with known index
and initialize Serializer at position that dependent on the memory.
This is mandatory to make ArrayBuffer transport to work. It also happens
to fix 4 WPT tests, that are related to curcular references during
serialization.
2024-12-03 21:32:01 +00:00
Tim Ledbetter
163b8a69e3 LibWeb: Assert that nodes share shadow-including root in BP calculation
Previously, it was assumed that nodes must share the same root, prior
to the calculation of their relative boundary point positions. This is
no longer the case, since `Selection.setBaseAndExtent()` now accepts
anchor and focus nodes that may be in different shadow trees.
2024-12-03 15:31:41 +01:00
Andreas Kling
a7b3360fb6 LibWeb: Make HTMLIFrameElement.sandbox.supports() not throw
We have to list the set of allowed values for the DOMTokenList to not
throw when asking if one is supported.

This fixes an issue where YouTube embeds would hang indefinitely trying
to report an endless series of exceptions, seen on https://null.com/
2024-12-03 15:30:18 +01:00
Andreas Kling
b1796ebd2c Tests: Import a WPT test that uses HTMLIFrameElement.sandbox.supports() 2024-12-03 15:30:18 +01:00
devgianlu
dace140b0d LibCrypto+LibWeb: Implement ECDSA.sign
Gained ~20 tests, failing only on P-521.
2024-12-03 13:20:51 +01:00
devgianlu
1d11448f00 LibCrypto+LibWeb: Refactor integer conversions in SECPxxxr1
Little effort to refactor the chaos of integers / bytes / ASN.1 that
is inside `SECPxxxr1`. More love is needed.
2024-12-03 13:20:51 +01:00
devgianlu
0c60f7c995 LibWeb: Migrate ECDSA.generateKey and ECDSA.verify away from ByteBuffer
Use instances of `ECPublicKey` and `ECPrivateKey` instead of
`ByteBuffer` for ECDSA. Fixes another ~200 tests.
2024-12-03 13:20:51 +01:00
devgianlu
f0fbd50c66 LibWeb: Implement ECDSA.importKey and ECDSA.exportKey
Very similar implementation to ECDH. Fixes ~700 tests!
2024-12-03 13:20:51 +01:00
Andreas Kling
940cdc7cf9 Tests: Rebaseline tests after changes to imported WPT harness 2024-12-03 00:26:03 +01:00
Jonne Ransijn
edb3b10d11 LibJS: Align AsyncBlockStart with the latest drafts
`AsyncBlockStart` was still doing a `DisposeResources` call as
specified in older drafts of the `explicit-resource-management`
proposal, but the latest draft no longer does this, and it is
causing crashes when combined with the `array-from-async` proposal.
2024-12-02 18:20:56 -05:00
Andreas Kling
0ed5278772 Tests: Rebaseline a recently-added editing test 2024-12-03 00:19:15 +01:00
Shannon Booth
6ac018bcb6 LibWeb: Fix crash accessing 'empty' PromiseRejectionEvent reason
The 'reason' was getting initialized to 'empty' state when not
provided through the constructor, which results in a crash when
accessed through throw_dom_exception_if_needed in the generated
IDL getter.
2024-12-03 00:18:11 +01:00
Shannon Booth
05b4676917 LibWeb: Ensure global objects are an event target
All global objects current need to be event targets so that they
can have events dispatched to them. This allows for removing of
verify_cast for these global objects.
2024-12-03 00:18:11 +01:00
Jelle Raaijmakers
6a85677f70 LibWeb: Expose HTMLElement's content editable state 2024-12-03 00:18:03 +01:00
Jelle Raaijmakers
c9a6bac57f LibWeb: Fix always-enabled copy command in queryCommandEnabled()
The "copy" command is not in the Miscellaneous commands section. The
"defaultParagraphSeparator" command is, however. Let the accompanying
comment reflect that.
2024-12-03 00:18:03 +01:00
Jelle Raaijmakers
3f1523b16c LibWeb: Disable execCommand() commands in plaintext-only editing state 2024-12-03 00:18:03 +01:00
Jelle Raaijmakers
217567981a LibWeb: Implement "plaintext-only" state for contenteditable 2024-12-03 00:18:03 +01:00
Jelle Raaijmakers
7e406ac668 LibWeb: Simplify editing algorithm for "ends in space" condition
Checking if a string ends in a space does not require converting UTF-8
to UTF-16 and reading out its code points.
2024-12-03 00:18:03 +01:00
Milo van der Tier
2ee7e555f2 LibWeb/CSS: Do not ignore self-start/self-end alignment in flex layout
This makes these values the same as `start` and `end`. While this is not
entirely correct, it is better than centering which is what we did
previously.

This fixes misaligned images on https://nos.nl
2024-12-03 00:17:53 +01:00
Sam Atkins
432bbb4a56 CI: Keep test artifacts around longer
From this action's documentation, "0 means using default retention."
There's no reason for this to have a different retention duration than
the CI results themselves.
2024-12-02 18:04:43 -05:00
Sam Atkins
4fd42313ae CI: Ensure uploaded test artifacts have a unique name
Without this, if two CI runs on Linux both fail and want to upload
screenshots, we get an error like this on the second:

> Error: Failed to CreateArtifact: Received non-retryable error: Failed
> request: (409) Conflict: an artifact with this name already exists on
> the workflow run

Using all the inputs as part of the name should make this kind of
conflict impossible.
2024-12-02 18:04:43 -05:00
Pavel Shliak
be0857e390 UI/Qt: Do not pass left shift modifier on every return 2024-12-02 17:57:38 -05:00
Tim Ledbetter
cc1ea02949 LibWeb: Disable test output for imported WPT tests
This reduces the runtime of all imported WPT tests from 8.2 seconds to
4.5 seconds on my local machine.
2024-12-02 22:41:51 +00:00
Tim Ledbetter
61ae388140 Tests: Create imported WPT test output from completion callback data
This allows us to disable test output, which performs expensive assert
tracking. This was making our imported tests run significantly slower
than tests run via `WPT.sh`.

Formatting the output ourselves also allows us to remove unnecessary
information from the test output.

This commit also rebaselines all existing imported WPT tests to follow
the new format.
2024-12-02 22:41:51 +00:00
Jonne Ransijn
e38b206957 AK: Print a more useful error message when a MUST(...) fails
```
VERIFICATION FAILED: !_temporary_result.is_error()
```

is not really a helpful error message.

When we are including `AK/Format.h`, which is most of the time,
we can easily print a much more useful error message:

```
UNEXPECTED ERROR: Cannot allocate memory (errno=12)
```
2024-12-02 20:07:38 +01:00
Gingeh
0afd7f166a LibWeb: Improve grid-template-area parsing and serialization 2024-12-02 16:19:47 +00:00
Gingeh
e1f4e8e6c2 LibWeb: Move CSS character type definitions to new header 2024-12-02 16:19:47 +00:00
Jonne Ransijn
1b3f8e1e9a LibJS: Cache source code positions more often
The source code position cache was moved from a line based approach
to a "chunk"-based approach to improve performance on large, minified
JavaScript files with few lines, but this has had an adverse effect
on _multi-line_ source files.

Reintroduce some of the old behaviour by caching lines again, with
some added sanity limits to avoid caching empty/overly small lines.

Source code positions in files with few lines will still be cached
less often, since minified JavaScript files can be assumed to be
unusually large, and since stack traces for minified JavaScript
are less useful as well.

On WPT tests with large JavaScript dependencies like
`css/css-masking/animations/clip-interpolation.html` this reduces the
amount of time spent in `SourceCode::range_from_offsets` by as much as
99.98%, for the small small price of 80KB extra memory usage.
2024-12-02 11:42:11 +01:00
Ben Wiederhake
079fdf50d4 Meta+Documentation: Update config for QtCreator
We no longer use C or raw assembly (*.S), and generated include files
have moved to Build/release/Lagom/.
2024-12-02 09:45:32 +00:00
Tim Ledbetter
44cf457fd2 LibWeb: Limit HTMLTableColElement span to allowed values
This change ensures that `span` is clamped to the maximum value of 1000
if the given value is larger than 2147483647.
2024-12-02 10:25:27 +01:00
Tim Ledbetter
9fc2a63131 LibWeb: Limit HTMLTableCellElement rowSpan to allowed values
This change ensures that `rowSpan` is clamped to the maximum value of
65534 if the given value is larger than 2147483647.
2024-12-02 10:25:27 +01:00
Tim Ledbetter
4630b1a44b LibWeb: Limit HTMLTableCellElement colSpan to allowed values
This change ensures that `colSpan` is clamped to the maximum value of
1000 if the given value is larger than 2147483647.
2024-12-02 10:25:27 +01:00
Tim Ledbetter
d02b763cd6 LibWeb: Add parse_integer_digits methods
The rules for parsing integers don't specify an upper bound on the
value that can be returned, so the `parse_integer_digits` method can be
used to check whether the given arbitrarily-large StringView is valid
according to these rules. The `parse_integer` and
`parse_non_negative_integer` methods would fail for values larger than
2147483647 when they shouldn't have.
2024-12-02 10:25:27 +01:00
Tim Ledbetter
7097152ebc LibWeb: Restrict HTMLTextAreaElement::min_length to the range of i32 2024-12-02 10:25:27 +01:00
Tim Ledbetter
ac7fad52f6 LibWeb: Restrict HTMLTextAreaElement::max_length to the range of i32 2024-12-02 10:25:27 +01:00
Tim Ledbetter
bc484258c2 LibWeb: Restrict HTMLInputElement::min_length to the range of i32 2024-12-02 10:25:27 +01:00
Tim Ledbetter
40d6b9d44e LibWeb: Restrict HTMLInputElement::max_length to the range of i32 2024-12-02 10:25:27 +01:00
stasoid
163ec18593 LibCore: Fix link error in EventLoopImplementationWindows.cpp 2024-12-02 10:12:57 +01:00
Konstantin Konstantin
1915574165 LibWeb: Fix NavigationType enum to string conversion
Convert NavigationType to lowercase strings, as described in the spec.

Import related WPT test.
2024-12-02 06:47:49 +00:00
Pavel Shliak
4d5acc7a00 LibWeb: Remove IDBRequest.idl FIXME 2024-12-01 22:04:05 +01:00
Pavel Shliak
e02fd4ca8c Tests: Reimport Event-constants WPT
I reimported and rebaselined it using the latest version
of our WPT importer. Now it passes.
2024-12-01 22:01:48 +01:00
Aliaksandr Kalenik
86f1c03c06 LibWeb: Fix CSS filters painting
restore() corresponding to ApplyFilters should be called after stacking
context content is painted, not before.

Fixes regression introduced in c94b4316e7
2024-12-01 21:27:29 +01:00
Jess
f4cc9c6426 Docs: Update Nixos build instructions 2024-12-01 13:27:59 -05:00