Commit graph

66750 commits

Author SHA1 Message Date
Andrew Kaster
2a16c58114 CMake: Also set VCPKG_HOST_TRIPLET to the dynamic triplet
This avoids Fedora 41 x86_64 machines using the x64-linux triplet
when building pkg-config. Doing so without our custom linker flags
causes the build to fail.
2024-12-31 13:42:50 -07:00
Andrew Kaster
37f7f02d69 LibWebView: Accept Noto Sans Mono as a monospace font 2024-12-31 13:42:50 -07:00
Andreas Kling
4324439006 LibWeb: Reorder some checks in PaintableWithLines::hit_test for speed
In particular:

- Don't compute DOM node editability if we don't need it. This was 22%
  of CPU time when scrolling on Wikipedia.

- Defer inversion of transformed coordinates until we actually need
  them, after we've performed early returns.
2024-12-30 21:25:20 +01:00
Gingeh
0a6793c89b LibWeb: Check if types have a present and nonzero percentage value
Co-authored-by: Chase Knowlden <haroldknowlden@gmail.com>
Co-authored-by: "tanner.drake" <tanner.drake@protonmail.com>
2024-12-30 11:09:15 +01:00
Gingeh
436417aabe LibWeb: Parse background positions as shorthands 2024-12-30 11:07:53 +01:00
Lucas CHOLLET
abc0418710 LibWeb/DOM: Convert elapsedTime to seconds when firing AnimationEvents
This makes all three subtests from this test to pass:
 - css/css-animations/animationevent-types.html
2024-12-30 11:05:37 +01:00
Lucas CHOLLET
61b444d538 LibWeb/DOM: Allow the animationiteration event to be fired
This event is fired while both the previous and the current phase are
active.

This prevents this test from timing out:
- css/css-animations/animationevent-types.txt
2024-12-30 11:05:37 +01:00
Lucas CHOLLET
d268df747f Tests/LibWeb: Import a test from wpt/css-animation 2024-12-30 11:04:55 +01:00
Lucas CHOLLET
43c30e4f7b LibWeb/Animations: Keep a safe copy of associated animations
The associated animations list might be modified on the time change
event. This means that we can't safely iterate over the hashmap during
this period.

This fixes a crash in:
 - css/css-animations/CSSAnimation-effect.tentative.html
2024-12-30 11:04:55 +01:00
Lucas CHOLLET
906b7bf4e3 LibWeb/DOM: Conserve references to pending animations
This fixes a crash in:
 - css/css-animations/CSSAnimation-effect.tentative.html
2024-12-30 11:04:55 +01:00
Tim Ledbetter
db24440403 LibWeb: Allow keyboard input to alter email inputs
Previously, the`HTMLInputElement.selectinStart` and
`HTMLInputElement.selectionEnd` IDL setters, and the
`setRangeText()` IDL method were used when updating an input's value
on keyboard input. These methods can't be used for this purpose,
since selection doesn't apply to email type inputs. Therefore, this
change introduces internal-use only methods that don't check whether
selection applies to the given input.
2024-12-30 11:04:16 +01:00
Tim Ledbetter
79da6d48c1 Meta: Strip query string from WPT test variants before importing them
The output of `WPT.sh list-tests` includes test variants, which vary
only by their query string. Since we don't care about this when
importing tests, ignore any query strings and ensure duplicates are
removed from the given test paths.
2024-12-29 01:35:13 +00:00
Tim Ledbetter
971aacc603 Meta: Don't suppress the output of the WPT importer script
Previously, messages printed to stdout by `import-wpt-test.py` were
being swallowed.
2024-12-29 01:35:13 +00:00
Tim Ledbetter
e049085f47 Tests: Remove support files from TestConfig.ini 2024-12-29 01:20:48 +00:00
Tim Ledbetter
c55d40e84b UI/Headless: Ignore more WPT support files
We now ignore files imported from WPT, if they are in the root `common`
directory, or any directory named `resources`. This matches the
behavior of the WPT test harness.
2024-12-29 01:20:48 +00:00
Tim Ledbetter
f8dacdaf50 Meta: Strip extraneous slashes from file paths in the WPT importer
Previously attempting to import files with a `src` that had a leading
`/` would fail.
2024-12-29 00:50:55 +00:00
Tim Ledbetter
b4751826c6 Meta: Construct test list after parsing other arguments in WPT.sh
Previously, running `WPT.sh compare foo.log` would fail because the log
file name was included in the list of test paths.
2024-12-29 00:50:02 +00:00
Pavel Shliak
48a4cc9ba3 Meta: Update libjpeg-turbo to 3.1.0 2024-12-28 10:13:13 -08:00
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