Commit graph

66382 commits

Author SHA1 Message Date
Pavel Shliak
8b523a1786 Meta: Update sqlite to 3.47.2 2024-12-28 10:12:59 -08:00
sideshowbarker
0c6a6d4457 LibWeb: Normalize getter name for reflected “Element?” IDL types
This change updates the bindings generator for the case defined at
https://html.spec.whatwg.org/#reflecting-content-attributes-in-idl-attributes:element;
that is, the case “If a reflected IDL attribute has the type T?, where T
is either Element or an interface that inherits from Element”.

The change “normalizes” the generator behavior for that case — such that
the generated code expects a getter with a name of the form used in
other cases; e.g., popover_target_element().

Otherwise, without this change, the generator expects a name of the form
get_popover_target_element() for that case.
2024-12-28 08:34:40 -08:00
Timothy Flynn
19567d96ec LibWeb: Remove special handling for the ARIA "switch" role
If we use the correct string for "switch", the special handling is not
necessary after 8961d5d2ce.
2024-12-28 08:33:57 -08:00
Timothy Flynn
4d6a9f9d2d LibWeb: Remove now-unnecessary clang-format off directive 2024-12-28 05:39:32 -08:00
Timothy Flynn
27478ec7d4 Everywhere: Run clang-format
The following command was used to clang-format these files:

    clang-format-19 -i $(find . \
        -not \( -path "./\.*" -prune \) \
        -not \( -path "./Build/*" -prune \) \
        -not \( -path "./Toolchain/*" -prune \) \
        -type f -name "*.cpp" -o -name "*.mm" -o -name "*.h")
2024-12-28 05:39:32 -08:00
Timothy Flynn
66732d2203 Meta: Switch to clang-format-19 as the standard formatter 2024-12-28 05:39:32 -08:00
Timothy Flynn
2ec97b4548 Meta: Update to clang-19 in CI and build instructions 2024-12-28 05:39:32 -08:00
Shannon Booth
b165ffc868 LibWeb/CSS: Add overflow hidden to UA stylesheet for marquee element 2024-12-28 11:18:25 +00:00
Khaled Lakehal
b0e061b943 LibWeb/HTML: Fix URL fragment comparison triggering unwanted events
This update ensures consistent handling of URL fragments, treating null
fragments as empty strings in `Location::set_hash` method.

This fixes all tests in
https://wpt.live/html/browsers/browsing-the-web/history-traversal/hash-empty-string.html
2024-12-28 10:50:34 +00:00
Lucas CHOLLET
9585aeafda LibWeb/DOM: Don't assume that Animations have an associated effect
Fixes a crash on:
 - css/css-transitions/CSSTransition-effect.tentative.html
2024-12-28 10:37:44 +01:00
Gingeh
42a8effae5 LibWeb: Notify canvas context when width or height attribute is changed 2024-12-28 10:37:15 +01:00
tanner.drake
fe25f77bcf LibWeb/Geometry: Implement "other than none" keyword check 2024-12-28 07:51:11 +01:00
sideshowbarker
5ba847b1c4 LibWeb: Minor code cleanup: Replace some first_is_one_of with is_one_of 2024-12-27 17:16:34 -08:00
sideshowbarker
2983a17ea6 LibWeb: Compute roles for SVG graphics-symbol elements and foreignObject
This change adds computation of ARIA roles for a number of SVG elements
for which, if the element meets the SVG spec criteria for inclusion in
the accessibility tree, the computed ARIA role should be
“graphics-symbol”, and should otherwise be “generic”.

This change also adds similar role computation for the SVG foreignObject
element (the role for which, if the element meets the SVG spec criteria
for inclusion in the accessibility tree, should be “group”, and should
otherwise be “generic”).
2024-12-27 17:16:15 -08:00
sideshowbarker
8961d5d2ce LibWeb: Add support for ARIA Graphics roles
This change adds support for the graphics-document, graphics-object, and
graphics-symbol ARIA roles from the WAI-ARIA Graphics Module spec at
https://w3c.github.io/graphics-aria/#role_definitions
2024-12-27 17:16:15 -08:00
Vinicius Deolindo
fc956080e2 Flake/devshell: Add more useful packages
The list now includes:
    - clang-tools: For clangd and clang-format
    - pre-commit: For the pre-commit hooks
    - prettier: For web-related formatting
2024-12-27 17:13:26 -07:00
Lucas CHOLLET
589538ec8f LibWeb/DOM: Visit the animation of Document's pending animations 2024-12-27 11:50:11 -08:00
Shannon Booth
ffda698d3a LibWeb/Streams: Actually implement the piped through steps
This mistakenly implemented the 'piped to' operation on ReadableStream.
No functional difference as the caller was doing the extra work already
of 'piped through' vs 'piped to'.
2024-12-27 06:56:38 -08:00
Shannon Booth
a28961a92d LibWeb/Streams: Fully implement BYOB operations for ReadableStream
As far as I can tell there is no change in WPT from this implementation.
But these steps should be more effecient than using the non BYOB steps
as we can make direct use of the provided buffer to the byte stream.
2024-12-27 06:56:38 -08:00
Shannon Booth
3d3c1d8bf7 LibWeb/WebIDL: Implement 'write' operation for ArrayBufferView 2024-12-27 06:56:38 -08:00
Shannon Booth
5d8d5375a0 LibWeb/Streams: Fix spec link for RBS controller release steps 2024-12-27 06:56:38 -08:00
Andreas Kling
1a0f5d3180 LibWeb: Remove unused pointer from DOM::Text to its "owner" element
This is a leftover from an earlier implementation of text input.
2024-12-27 12:27:03 +01:00
Pavel Shliak
ef3a86f010 LibWeb: Update Selection::getRangeAt() spec to handle focus and anchor
Co-authored-by: Jim Broadbent <jim.r.broadbent@gmail.com>
Co-authored-by: Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
2024-12-27 11:48:19 +01:00
Andreas Kling
ceefe7d858 LibWeb: Make CustomElementDefinition relationship with GC more sane
1. Stop using GC::Root in member variables, since that usually creates
   a realm leak.

2. Stop putting OrderedHashMap<FlyString, GC::Ptr> on the stack while
   setting these up, since that won't protect the objects from GC.
2024-12-27 10:02:58 +01:00
sideshowbarker
062e33438e LibWeb: Space-separate parts of multi-label accessible names
This change ensures that when an accessible name is computed from
multiple labels, the parts computed from each label are separated by
spaces. Otherwise, without this change, the parts are run together in
the accessible name, with no space in between.
2024-12-26 20:44:14 +00:00
Andreas Kling
3bfb0534be LibGC: Rename MarkedVector => RootVector
Let's try to make it a bit more clear that this is a Vector of GC roots.
2024-12-26 19:10:44 +01:00
Timothy Flynn
ada36e5c0a LibJS: Allow async functions named "async" as function properties
For example, https://locals.com/site/discover has a script with an
object of the form:

    var f = {
        parser: {
            sync() {},
            async async() {},
        }
    };

We were previously throwing a syntax error on the async function, as we
specifically did not allow using "async" as a function name here.
2024-12-26 17:23:10 +01:00
Timothy Flynn
a5455ac121 LibJS: Ensure a function follows an async identifier in objects 2024-12-26 17:23:10 +01:00
Andreas Kling
4eda7b5646 LibCore: Make EventReceiver ref counting use atomics
This removes a race in ImageDecoder's make_decode_image_job(), where the
ref count of `this` is mutated from separate threads in the callbacks.
2024-12-26 13:45:10 +01:00
Shannon Booth
3913e9f948 LibWeb/Fetch: Return a cloned cached response body
Otherwise we will fully read from the cached response and invalidate
it's stream, invalidating it for the next time it is read from. Fixes
a crash when reloading linegoup.lol after two reloads.
2024-12-26 13:44:52 +01:00
Andreas Kling
7cd6ea6f33 RequestServer: Clean up the CURLM "multi handle" when client drops
Otherwise we may leak all kinds of things inside CURL.
2024-12-25 19:14:45 +01:00
Lucas CHOLLET
1c61ccef40 LibWeb/DOM: Fire transition[cancel,start,run,end] events 2024-12-25 17:14:08 +01:00
Lucas CHOLLET
a2ab3769f4 LibWeb/CSS: Don't assume that animations have an associated effect
... when computing properties.
2024-12-25 17:14:08 +01:00
Lucas CHOLLET
c39ef2a738 LibWeb/Animations: Don't assume that animations have an effect
I agree that the spec definition of this function isn't super clear
about that, but from "Web Animations 1 - 4.5. Animations"[1]:

An animation is a timing node that binds an animation effect child,
called its associated effect, to a timeline parent so that it runs. Both
of these associations are optional and configurable such that an
animation can have no associated effect or timeline at a given moment.

[1]: https://drafts.csswg.org/web-animations-1/#animations
2024-12-25 17:14:08 +01:00
Lucas CHOLLET
441c1a29ae LibWeb/Animations: Consider CSSTransitions in is_replaceable() 2024-12-25 17:14:08 +01:00
Lucas CHOLLET
c2165fb6b8 LibWeb/Animations: Don't try to associate animations to null timelines
The input to `set_timeline` is user controlled, it can be null.
2024-12-25 17:14:08 +01:00
Lucas CHOLLET
55b4a983a7 LibWeb/CSS: Add the TransitionEvent type 2024-12-25 17:14:08 +01:00
Andreas Kling
56e6d4f42d LibWeb: Protect HTTP cache entries from garbage collector
One day we'll have an eviction strategy, too, but for now let's not
allow these to get collected.

Co-Authored-By: Gingeh <39150378+Gingeh@users.noreply.github.com>
2024-12-25 17:11:16 +01:00
Glenn Skrzypczak
08589741f5 LibWeb: Correctly implement event listeners default passive attribute
This commit implements the default value of the passive attribute of
event listeners according to the spec.
2024-12-25 14:57:22 +00:00
Pavel Shliak
4c7cd05078 LibWeb: Update FormData constructor to reflect the spec 2024-12-25 14:52:57 +00:00
sideshowbarker
72a86f2df3 LibWeb: Fix selector matching for non-HTML mixed-case element names
This change fixes selector matching for non-HTML elements that have
mixed-case names — such as the SVG foreignObject element.

Otherwise, without this change, attempting to use a selector to match
such an element — e.g., document.querySelector("foreignObject") — fails.
2024-12-25 13:54:06 +00:00
Andreas Kling
f625ea27d0 LibWeb: Use the right StyleInvalidationReason for iframe geometry change 2024-12-25 13:26:51 +01:00
Andreas Kling
f45e24864b LibWeb: Skip unneeded style invalidation on custom element state change
If there are no :defined pseudo-class selectors anywhere in the
document, we don't have to invalidate style at all when an element's
custom element state changes.
2024-12-25 13:26:51 +01:00
Andrew Kaster
202bf901d7 LibWeb: List supported media types publicly for HTMLMediaElement 2024-12-25 12:02:39 +01:00
Saksham Goyal
8ebf2c3007 LibWeb: Add missing attributes in Event Handlers 2024-12-25 12:01:56 +01:00
Shannon Booth
5f2b75852f LibWeb: Add an 'enqueue' helper method on TransformStream 2024-12-25 12:00:54 +01:00
Shannon Booth
9ce0c5914b LibWeb: Add a 'get a reader' helper method on ReadableStream 2024-12-25 12:00:54 +01:00
Shannon Booth
da408cb09a LibWeb: Add a 'piped through' helper method on ReadableStream
This reads a bit nicer, and follows the streams spec pattern on
performing operations on a stream outside of the streams spec.
2024-12-25 12:00:54 +01:00
Timothy Flynn
79a2b96d1c Meta: Consolidate checking for the system audio backend
The goal here is to ensure we check for audio backends in a way that
makes sense. On macOS, let's just always use Audio Unit (and thus avoid
any checks for Pulse, to reduce needless/confusing build log noise). We
will also only use the Qt audio backend if no other backend was found,
rather than only checking for Pulse.
2024-12-25 12:00:43 +01:00
Timothy Flynn
33a1e38646 WebContent: Don't check for specific audio backends
Rather than conditionalizing creating an audio plugin, just let the
audio backend factory return an error on its own. If an audio plugin
is not found, we will get a similar error to what is removed here.
2024-12-25 12:00:43 +01:00