Commit graph

66555 commits

Author SHA1 Message Date
sideshowbarker
2cb7baa581 LibWeb: Ignore “orphaned” ARIA roles
This change causes explicitly-specified role attributes to be ignored in
the case where the specified role is “orphaned” — that is, when its
element lacks a required ancestor with an appropriate role.
2025-01-09 14:08:23 +00:00
sideshowbarker
56c7857053 LibWeb: Return true for is_focusable() elements with non-null tabindex
This change implements the requirements stated in the HTML spec at
https://html.spec.whatwg.org/multipage/interaction.html#tabindex-value
that UAs must allow HTML elements with non-null tabindex values to be
considered as focusable areas.
2025-01-09 14:08:23 +00:00
sideshowbarker
173368bd5e LibWeb: Allow accessible-name computation to skip role-attribute lookup
Per https://w3c.github.io/aria/#document-handling_author-errors_roles,
determining whether to ignore certain specified landmark roles requires
first determining whether the element for which the role is specified
has an accessible name.

But if we then try to retrieve a role for such elements, we end up
calling right back into the accessible-name computation code — which
would cause the calls to loop infinitely.

So to avoid that — and to have handling for any other future cases the
spec may introduce of such recursive calls that will loop indefinitely —
this change introduces a parameter that callers can pass to cause
role-attribute lookup to be skipped during accessible-name computation.
2025-01-09 14:08:23 +00:00
sideshowbarker
9f01eebff3 LibWeb: Add a to_element function to ARIAMixin
This change adds a virtual to_element function to ARIAMixin, and
overrides it in DOM::Element so it can then be used back inside
ARIAMixin to get an element when needed (for example, when computing a
role requires checking the roles of ancestors of an element).
2025-01-09 14:08:23 +00:00
Tim Ledbetter
81d6cd497a LibWeb: Validate AudioNode::disconnect() input and output arguments 2025-01-09 11:34:38 +00:00
Tim Ledbetter
5c57acf140 LibWeb: Validate AudioParam context in AudioNode::connect()
An exception is now thown if an `AudioNode` attempts to connect to an
`AudioParam` from a different `BaseAudioContext`.
2025-01-09 11:34:38 +00:00
Tim Ledbetter
2edd0812ca LibWeb: Validate AudioNode::connect() input and output arguments 2025-01-09 11:34:38 +00:00
Jelle Raaijmakers
e6334d217b LibWeb: Update implementation of Range::partially_contains_node()
This accurately reflects the spec it's implementing. This algorithm is
used in 5 spots in the spec but the old buggy behavior was never
triggered:

  * In both ::extract() and ::clone_the_contents(), invocations to this
    method are guarded by a check to see if the start node is the
    inclusive ancestor of the end node, or vice versa - effectively
    resulting in the inequality checks to be accidentally correct.

  * In ::surround_contents(), we forego the usage of this algorithm as
    stated in the spec, and instead use a correct and more optimized
    version that simply compares the start and end nodes.

A lot of words to say: no functional changes :^)
2025-01-09 10:15:55 +00:00
Ivan Zuzak
36190e3baf AK: Optimize performance in GenericShorthands via forwarding references
Functions in AK/GenericShorthands used pass-by-value which results in
copying values when calling those functions. This could be expensive
for complex types. To optimize performance, we switch the functions to
use forwarding references.
2025-01-09 09:03:50 +01:00
Ivan Zuzak
49fc569136 AK: Add tests for GenericShorthands 2025-01-09 09:03:50 +01:00
Tim Ledbetter
e469c884d4 LibWeb: Use correct ranges for BiquadFilterNode parameters 2025-01-08 19:05:51 +00:00
Nicolas Ramz
423d106fd8 LibJS: Support date strings of the form "Thu, 09 Jan 2025 23:00:00" 2025-01-08 18:45:43 +01:00
Tim Ledbetter
911cd4aefd LibWeb/WebAudio: Add BaseAudioContext.createDelay() factory method 2025-01-08 15:31:59 +00:00
Tim Ledbetter
6c4c925f02 LibWeb/WebAudio: Add DelayNode interface 2025-01-08 15:31:59 +00:00
Luke Wilde
876d26c32e LibWeb/WebGL: Respect subarrays in readPixels 2025-01-08 17:55:17 +03:00
Luke Wilde
71746c47c2 LibWeb/WebGL: Bind default frame/render buffer when binding is null
This fixes the depth issues on github.com, as the depth commands are
now sent to the right frame/render buffer.
2025-01-08 17:55:17 +03:00
Luke Wilde
e5d59a2d42 LibWeb/WebGL2: Implement getSyncParameter 2025-01-08 17:55:17 +03:00
Luke Wilde
6bf6cd3f19 LibWeb/WebGL: Account for subarrays in tex(Sub)Image{2D,3D}
This allows Ruffle to correctly upload textures.
2025-01-08 17:55:17 +03:00
Luke Wilde
49c966b4e7 LibWeb/WebGL2: Implement uniform{1,2,3,4}ui 2025-01-08 17:55:17 +03:00
Luke Wilde
2f26ade426 LibWeb/WebGL2: Implement copyBufferSubData 2025-01-08 17:55:17 +03:00
Luke Wilde
2b20b8aaff LibWeb/WebGL: Return correct types from get{Shader,Program}Parameter
Returning numbers instead of booleans for the statuses made Ruffle
(through the wgpu crate) think a shader/program failed to compile/link,
as it does a strict type comparison.
2025-01-08 17:55:17 +03:00
Luke Wilde
db2d8f8f17 LibWeb/WebGL2: Implement bindBufferRange 2025-01-08 17:55:17 +03:00
Luke Wilde
c30c1d65f4 LibWeb/WebGL2: Implement clearBuffer{fv,iv,uiv,fi} 2025-01-08 17:55:17 +03:00
Luke Wilde
f627c91bf3 LibWeb/WebGL2: Implement deleteSampler 2025-01-08 17:55:17 +03:00
Luke Wilde
09ad685238 LibWeb/WebGL2: Implement samplerParameter{i,f} 2025-01-08 17:55:17 +03:00
Luke Wilde
aa2eb7ac7d LibWeb/WebGL2: Implement MAX_VARYING_COMPONENTS parameter 2025-01-08 17:55:17 +03:00
Luke Wilde
c4ff1a1eb0 LibWeb/WebGL2: Implement MAX_FRAGMENT_UNIFORM_BLOCKS parameter 2025-01-08 17:55:17 +03:00
Luke Wilde
0390a2328c LibWeb/WebGL2: Implement MAX_ELEMENT_INDEX parameter 2025-01-08 17:55:17 +03:00
Luke Wilde
2d94953047 LibWeb/WebGL2: Implement COPY_WRITE_BUFFER_BINDING parameter 2025-01-08 17:55:17 +03:00
Luke Wilde
af8cb211eb LibWeb/WebGL2: Implement COPY_READ_BUFFER_BINDING parameter 2025-01-08 17:55:17 +03:00
Luke Wilde
47699360e5 LibWeb/WebGL2: Implement TEXTURE_BINDING_2D_ARRAY parameter 2025-01-08 17:55:17 +03:00
Luke Wilde
b8416570e0 LibWeb/WebGL2: Implement UNIFORM_BUFFER_BINDING parameter 2025-01-08 17:55:17 +03:00
Luke Wilde
9b4bad4255 LibWeb/WebGL: Factor in subarrays for typed arrays for generic methods 2025-01-08 17:55:17 +03:00
Luke Wilde
42cce393f4 LibWeb/WebGL2: Implement drawElementsInstanced 2025-01-08 17:55:17 +03:00
Luke Wilde
c05fa44cf8 LibWeb/WebGL2: Implement vertexAttribDivisor 2025-01-08 17:55:17 +03:00
Luke Wilde
b6bc5912d6 LibWeb/WebGL: Implement tex(Sub)Image2D with TexImageSource 2025-01-08 17:55:17 +03:00
Luke Wilde
f66f01ce53 LibWeb/WebGL: Implement getUniformBlockIndex 2025-01-08 17:55:17 +03:00
Luke Wilde
216d5b33be LibWeb/WebGL: Enforce minimum size when resizing existing context
Previously the enforcement was only done on creation. Not enforcing it
on change would cause a crash if the canvas width/height was set to
zero or less.
2025-01-08 17:55:17 +03:00
Luke Wilde
8e453d5069 LibWeb/WebGL: Preserve original bound objects to return in getParameter
Required by https://qwasm2.m-h.org.uk, which adds a custom `name`
attribute to objects it generates. It then gets some of these objects
out with getParameter, and expects the `name` attribute to be there.
2025-01-08 17:55:17 +03:00
Luke Wilde
c067271897 LibWeb/WebGL2: Implement getActiveUniformBlockParameter 2025-01-08 17:55:17 +03:00
Luke Wilde
191ceb0f61 LibWeb/WebGL2: Implement getActiveUniformBlockName 2025-01-08 17:55:17 +03:00
Luke Wilde
7957793863 LibWeb/WebGL2: Implement uniformBlockBinding 2025-01-08 17:55:17 +03:00
Luke Wilde
28a73dc392 LibWeb/WebGL: Implement deleteRenderbuffer 2025-01-08 17:55:17 +03:00
Luke Wilde
4e33d8e577 LibWeb/WebGL: Mark clear as a draw operation instead of clearColor 2025-01-08 17:55:17 +03:00
Luke Wilde
e26b524721 LibWeb/WebGL2: Implement invalidateFramebuffer 2025-01-08 17:55:17 +03:00
Luke Wilde
2983ad10bc LibWeb/WebGL2: Correctly handle offsets in uniform(Matrix) functions 2025-01-08 17:55:17 +03:00
Luke Wilde
63b792c205 LibWeb/WebGL2: Implement bufferSubData with offset and length 2025-01-08 17:55:17 +03:00
Luke Wilde
18ea91715b LibWeb/WebGL2: Implement bufferData with offset and length 2025-01-08 17:55:17 +03:00
Tim Ledbetter
a6ab9cc983 LibWeb: Initialize AudioBufferSourceNode with correct defaults 2025-01-08 14:45:51 +00:00
Psychpsyo
9370990ff2 LibWeb: Implement user-select
This implements all values of user-select.
2025-01-08 14:37:28 +00:00