Commit graph

7131 commits

Author SHA1 Message Date
Jelle Raaijmakers
bd2488a468 LibWeb: Make block_extend_a_range() take a GC::Ref for the range
This makes it more consistent with the other signatures.
2025-01-10 23:33:35 +01:00
Jelle Raaijmakers
e5b107b6b6 LibWeb: Fix typo in spec comment for non-list single line containers 2025-01-10 23:33:35 +01:00
Jelle Raaijmakers
acef5a34de LibWeb: Remove useless move from remove_node_preserving_its_descendants 2025-01-10 23:33:35 +01:00
Jelle Raaijmakers
e64766d54d LibWeb: Add spec links to editing command definitions 2025-01-10 23:33:35 +01:00
Aliaksandr Kalenik
cf57efd252 LibWeb: Unload fonts when adopted style sheet is removed
Add missing unloading step that we do for regular style sheets but
mistakenly missed for adopted style sheets.
2025-01-10 19:12:48 +03:00
Aliaksandr Kalenik
d8b0b1535b LibWeb: Skip keyframe animation update if target element isn't connected
Makes some pages on Github faster as previously we had to update
animation for elements in not connected shadow trees.
2025-01-10 15:41:37 +01:00
Aliaksandr Kalenik
de062e4d2c LibWeb: Invalidate style if url changed in HTMLHyperlinkElementUtils
Previously, <a> elements were frequently invalidated because
`set_the_url()` was called by `reinitialize_url()`, which is a
preparation step in every HTMLHyperlinkElementUtils function. As a
result, styles were unnecessarily invalidated each time any of these
functions were invoked without changing the URL.
2025-01-10 14:35:33 +00:00
Tim Ledbetter
84b69c2387 LibWeb: Make TemporaryExecutionContext [[nodiscard]] 2025-01-10 13:21:36 +00:00
Tim Ledbetter
5d4aa15ada LibThreading: Make MutexLocker [[nodiscard]] 2025-01-10 13:21:36 +00:00
Shannon Booth
1f4c7ac62b LibWeb/DOM: Remove uneccessary ExceptionOr for NodeIterator::create 2025-01-10 08:08:46 +00:00
Shannon Booth
17c92d7c2b LibWeb/DOM: Create TreeWalker in document's realm 2025-01-10 08:08:46 +00:00
Shannon Booth
84f22cb6b3 LibWeb/DOM: Create NodeIterator in document's realm 2025-01-10 08:08:46 +00:00
sideshowbarker
10766ecf54 LibWeb: Ignore role=none for focusable & has-global-ARIA-attribute cases
This change causes explicit role=none and role=presentation attribute
values to be ignored in cases where the elements for which those values
are specified are either focusable, or have global ARIA attributes —
per https://w3c.github.io/aria/#conflict_resolution_presentation_none.
2025-01-09 14:08:23 +00:00
sideshowbarker
ead3af0163 LibWeb: Ignore name-required landmark roles which lack accessible names
This change implements the role-checking requirement from the ARIA spec
at https://w3c.github.io/aria/#document-handling_author-errors_roles
that the “form” and “region” roles are required to have accessible
names — and that if they don’t have accessible names as required, UAs
must treat them as if they’d not been specified at all.
2025-01-09 14:08:23 +00:00
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
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
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
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
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
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
e26b524721 LibWeb/WebGL2: Implement invalidateFramebuffer 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
Sam Atkins
ba43dfe49a LibWeb/CSS: Remove use of Dimension in calc() parsing
Rather than partly-converting number, dimension, and ident tokens at the
start of parsing a calculation, and then later finishing it off, we can
just do the whole step in convert_to_calculation_node(). This is a
little less code, but mainly means we are left with only a single use
of the Dimension type in the codebase, so that can be removed soon.
2025-01-08 14:28:54 +00:00