Commit graph

66979 commits

Author SHA1 Message Date
rmg-x
f4c03d548e WebContent: Remove unused class "ImageCodecPluginSerenity" 2024-12-13 14:44:00 +00:00
Timothy Flynn
458af2d2a9 LibJS: Concatenate all included test262 harness files to a single script
For example, for the following `includes` line in a test262 file:

    includes: [sm/non262-TypedArray-shell.js, sm/non262.js]

We currently parse and execute each file in this list as its own script,
in the order they appear in the list.

Tests have recently been imported test262 from SpiderMonkey which fail
with this behavior. In the above example, if the first script references
some function from the second script, we will currently fail to execute
that harness file.

This patch changes our behavior to concatenate all harness files into a
single script, which satisfies the behavior required by these new tests.
This is how test262.fyi and other test262 runners already behave.
2024-12-13 05:26:39 -08:00
Timothy Flynn
40e7f46ac8 LibJS: Simplify reading test262 harness files
Make use of TRY semantics a bit more. And we don't need to store harness
files as a ByteString - we can store the contents as the ByteBuffer that
we receive from reading the file.
2024-12-13 05:26:39 -08:00
Timothy Flynn
1b4c45b9eb LibJS: Port test262-runner to use Error and TRY a bit more 2024-12-13 05:26:39 -08:00
Gingeh
84150f972f LibWeb: Properly serialize position/edge style values 2024-12-13 11:35:38 +00:00
sideshowbarker
583ca6af89 LibWeb: Implement <input type=checkbox switch> experimentally
In conformance with the requirements of the spec PR at
https://github.com/whatwg/html/pull/9546, this change adds support for
the “switch” attribute for type=checkbox “input” elements — which is
shipping in Safari (since Safari 17.4). This change also implements
support for exposing it to AT users with role=switch.
2024-12-13 11:31:27 +00:00
Ali Mohammad Pur
eee90f4aa2 LibRegex: Treat checks against nonexistent checkpoints as empty
Due to optimiser shenanigans in the tree alternative form, some
JumpNonEmpty ops might be moved before their Checkpoint instruction.
It is safe to assume the distance between the nonexistent checkpoint and
the current op is zero, so just do that.
2024-12-13 10:00:16 +01:00
Ali Mohammad Pur
358378c1c0 LibRegex: Pick the right target for OpCode_Repeat
Repeat's 'offset' field is a bit odd in that it is treated as a negative
offset, causing a backwards jump when positive; the optimizer didn't
correctly model this behaviour, which caused crashes and misopts when
dealing with Repeats.
This commit fixes that behaviour.
2024-12-13 10:00:16 +01:00
Ali Mohammad Pur
4a8d3e35a3 LibRegex: Add some more debugging info to bytecode block ranges
These were getting difficult to differentiate, now they each get a
comment on where they came from to aid with future debugging.
2024-12-13 10:00:16 +01:00
Ali Mohammad Pur
44798f44ef AK: Add Vector::get(index) convenience function
This is similar to HashMap::get(key), which returns an Optional, empty
if the index is out of bounds for the vector.
2024-12-13 10:00:16 +01:00
Ali Mohammad Pur
f8092455e2 LibRegex: Print OpCode_Repeat's offset as ssize_t 2024-12-13 10:00:16 +01:00
Aliaksandr Kalenik
897883f947 LibWeb/WebGL: Implement texStorage2D() 2024-12-13 09:19:10 +01:00
Aliaksandr Kalenik
cfff38a176 LibWeb/WebGL: Implement uniform{1,2,3,4}{i,f}v calls for WebGL2 2024-12-13 09:19:10 +01:00
Aliaksandr Kalenik
194edbfd89 CodeGenerators: Unify generation of uniform{1,2,3,4}{i,f}v [WebGL] 2024-12-13 09:19:10 +01:00
Aliaksandr Kalenik
544a0216cf CodeGenerators: Change variable name from "matrix" to "vector" [WebGL] 2024-12-13 09:19:10 +01:00
Aliaksandr Kalenik
73479d3f94 LibWeb/WebGL: Implement drawBuffers() 2024-12-13 09:19:10 +01:00
Aliaksandr Kalenik
145bb0f849 LibWeb/WebGL: Implement getSupportedExtensions() 2024-12-13 09:19:10 +01:00
Aliaksandr Kalenik
af4f0c5a81 LibWeb/WebGL: Implement texImage3D() 2024-12-13 09:19:10 +01:00
Aliaksandr Kalenik
ba19328b98 LibWeb/WebGL: Implement vertexAttrib{1,2,3,4}fv 2024-12-13 09:19:10 +01:00
Aliaksandr Kalenik
4e8ec1e793 LibWeb/WebGL: Implement readPixels() 2024-12-13 09:19:10 +01:00
Aliaksandr Kalenik
c199be061a LibWeb/WebGL: Implement drawingBufferWidth and drawingBufferHeight 2024-12-13 09:19:10 +01:00
Psychpsyo
4dc65c57a0 LibWeb: Make MouseEvent.offsetX/Y ignore transforms
That is what the spec calls it, at least.
In code, this manifests as making the offset very aware
of the element's transform, because the click position comes
relative to the viewport, not to the transformed element.
2024-12-13 07:18:56 +01:00
Andrew Kaster
c1596192fa CMake: Add workaround for binutils+patchelf incompatability 2024-12-12 17:22:34 -07:00
Andrew Kaster
7ee3727074 LibWeb: Fix compile error for popover element internal lambdas
These were converted to lambdas in
6b921e91d4
But I merged fcf6cc27f2 without checking
that the code had responded to the change.
2024-12-12 15:56:55 -07:00
Pavel Shliak
6dfcdaa0d2 LibGfx: Unify bitmap set_pixel() using templates 2024-12-12 15:13:44 -07:00
Pavel Shliak
24b68259b4 LibGfx: Remove unnecessary include 2024-12-12 15:13:44 -07:00
Pavel Shliak
ff7cca38bd AK: Remove clang-specific templates 2024-12-12 15:12:27 -07:00
Luke Warlow
fcf6cc27f2 LibWeb: Implement popover beforetoggle and toggle events 2024-12-12 15:10:33 -07:00
Ben Wiederhake
872a6a11a4 WebCrypto: Unspoof correctness of AES-GSM encryption/decryption 2024-12-12 21:48:57 +01:00
Jelle Raaijmakers
ccd5b5a705 CI: Select Xcode 16.1 explicitly instead of latest-stable
What `latest-stable` means exactly also depends on the image version
we're running the workflow on, and unfortunately this can vary wildly
between GitHub runners.

Fixate the version to 16.1 for now. This version will need to be updated
as soon as we want to increase the minimum supported compiler version.
2024-12-12 18:39:37 +01:00
Nathan van der Kamp
a276cf2d5e LibWeb: Add PopOverInvokerElement and use it in HTMLButtonElement
The popoverTargetElement seems to be one of the only cases of a
reflected Element? attribute in the HTML spec, the behaviour of which
is specified in section 2.6.1.

Buttons can't actually toggle popovers yet because showing/hiding
popovers is not implemented yet.
2024-12-12 17:11:27 +00:00
Nathan van der Kamp
158acabd21 BindingsGenerator: Add codegen for reflected nullable Element attributes 2024-12-12 17:11:27 +00:00
sideshowbarker
32dddc8140 Tests: Import some ARIA and HTML-AAM (regression) tests (no code)
We’re passing all the tests in this patch on trunk — so let’s go ahead
and welcome them into our regression-testing garden.
2024-12-12 13:54:47 +00:00
Tim Ledbetter
7d2a037d03 LibWeb: Align execute_async_script variable name with the latest spec 2024-12-12 05:16:18 -08:00
sideshowbarker
50e7e9f58d LibWeb: Assign “dir”, “dd”, “dt” default ARIA roles per-spec
Also, import http://wpt.live/html-aam/dir-role.tentative.html (which
provides test/regression coverage for the “dir” change).
2024-12-12 05:13:45 -08:00
sideshowbarker
ccbc436e85 LibWeb: Support the “image” synonym for the “img” ARIA role
Additionally: For “img” elements with empty “alt” attributes, change the
default role to the newer, preferred “none” synonym for the older
“presentation” role; import https://wpt.fyi/results/html-aam/roles.html
(which provides test/regression coverage for these changes).
2024-12-12 05:13:45 -08:00
sideshowbarker
6e24f23aa0 LibWeb: Add support for the “mark” ARIA role 2024-12-12 05:13:45 -08:00
sideshowbarker
96540e9f89 LibWeb: Add support for the “suggestion” ARIA role 2024-12-12 08:53:20 +00:00
Timothy Flynn
68164aa7ec LibWeb: Run the object representation task when the active state changes
Currently, the following JS snippet will hang indefinitely:

    new DOMParser().parseFromString("<object>", "text/html");

Because the document into which the object is inserted is not active. So
the task queued to run the representation steps will never run.

This patch implements the spec steps to rerun the representation steps
when the active state changes, and avoid the hang when the object is
created in an inactive document.
2024-12-11 17:38:31 -07:00
Timothy Flynn
a2419b5f4e LibWeb: Add a document observer to be notified upon becoming active 2024-12-11 17:38:31 -07:00
Timothy Flynn
9a62e33517 LibWeb: Protect document observers from GC during observer invocation
We currently (sometimes) copy the observer map to a vector for iteration
to ensure we are not iterating over the map if the callback happens to
remove the observer. But that list was not protected from GC.

This patch ensures we protect that list, and makes all document observer
notifiers protected from removal during iteration.
2024-12-11 17:38:31 -07:00
sideshowbarker
afca902ea9 Docs: Explain how to do Debug builds without optimizations on
This change updates the (advanced) build docs to explain how to do a
Debug build with the CXX `-O0` option set — which tells the compiler to
build with no optimizations at all.

Otherwise, Debug builds use the `-Og` option — which, when trying to
check frame variables in a debugger can result in an error of this form:

> error: Couldn't look up symbols: __ZN2AK6Detail10StringBaseD2Ev
> Hint: The expression tried to call a function that is not present in
> the target, perhaps because it was optimized out by
> the compiler.
2024-12-11 17:31:52 -07:00
sideshowbarker
e49fe384d1 LibWeb: Align default “th” and “td” roles with HTML-AAM spec and tests
This change aligns the default roles for “th” and “td” elements with the
requirements in the HTML-AAM spec, and with the corresponding WPT tests
at https://wpt.fyi/results/html-aam/table-roles.html, and with the
behavior in other engines.

Otherwise, without this change, the default role values for “th” and
“td” elements in some cases don’t match the behavior in other engines,
and don’t match the expected results for the corresponding WPT tests.
2024-12-11 16:55:07 -07:00
sideshowbarker
2d638485a8 LibWeb: Assign “orphaned” li elements the default ARIA role “none”
This change makes Ladybird conform to the current requirements at
https://w3c.github.io/core-aam/#roleMappingComputedRole in the “Core
Accessibility API Mappings” spec for the case of “orphaned” li elements;
that is, any li element which doesn’t have a role=list ancestor.

The core-aam spec requires that in such cases, the li element must not
be assigned the “listitem” role but instead must be treated as if it had
no role at all.
2024-12-11 16:43:55 -07:00
Feng Yu
824e91ffdb LibWeb: Ensure Headers API can handle non-ascii characters
This patch ensure Headers object's associated header list
is ISO-8859-1 encoded when set using `Infra::isomorphic_encode`,
and correctly decoded using `Infra::isomorphic_decode`.

Follow-up of https://github.com/LadybirdBrowser/ladybird/pull/1893
2024-12-11 16:40:36 -07:00
Lucas CHOLLET
5e62f548db LibWeb/CSS: Serialize CSSColor without relying on RGB
This gives us 140 subtests pass in:
css/css-color/parsing/color-valid-color-function.html
2024-12-11 16:37:22 -07:00
Feng Yu
9c243caac4 LibWeb: Add statusText validation for Response constructor
Implemented validation to ensure `statusText` matches the
`reason-phrase` token production.

This change fixes a WPT subtest which I have imported.
2024-12-11 16:34:10 -07:00
Tim Ledbetter
93a1c45eb2 Meta: Don't halt if importing a test fails in WPT.sh 2024-12-11 16:30:20 -07:00
Tim Ledbetter
cb8a1f6bb6 Meta: Add the ability to import entire test directories with WPT.sh
This uses the `WPT.sh list-tests` command to find which tests are in
each given path.
2024-12-11 16:30:20 -07:00
Tim Ledbetter
a4f1838798 Meta: Add a list-tests command to WPT.sh
This outputs a list of all the tests that would be run in the given
test directories.
2024-12-11 16:30:20 -07:00