Commit graph

66662 commits

Author SHA1 Message Date
Shannon Booth
8beb567088 LibJS: Remove redundant completion type check in ScriptEvaluation
See editorial change to the ECMA-262 spec of:

https://github.com/tc39/ecma262/commit/bc5b7fda5
2025-01-02 11:30:04 +01:00
Shannon Booth
d48a0aaa55 LibJS: Remove unneeded FIXMEs for suspending an execution context
From what I understand, the suspension steps are not required now,
or in the future for our implementation, or any other. The intent
is already implemented in the spec pushing on another execution
context to the stack and leaving the running execution context as-is.

The resume steps are a slightly different story as there is some subtle
behavior which the spec is trying to convey where some custom logic may
need to be done when one execution context changes from one to another.
It may be worth implementing those steps at a later point in time so
that this behavior is a bit easier to follow in those cases.

To make the situation more confusing - from what I can gather from the
spec, not all cases that the spec mentions resume actually means
anything normative. Resume is only _actually_ needed in a limited set
of locations.

For now, let's just remove the unneeded FIXMEs that indicate that there
is something to be done for the suspension steps, as there is not, and
leave the resume steps as is.
2025-01-02 11:30:04 +01:00
Shannon Booth
44bb2b7e32 LibWeb/HTML: Use paintable box for 'associated CSS layout box' check
This is consistent with other functions such as
HTMLElement::offset_width and fixes a crash for the included test.
Returning an offset of zero is not correct for this case, but this is
still an improvement to not crash.
2025-01-02 11:28:37 +01:00
Shannon Booth
372f2dd7a1 LibWeb/HTML: Remove uneeded handling for non-box paintable HTMLElements
All inline nodes are now PaintableBoxes, so we do not need to handle the
non box case any more :^)
2025-01-02 11:28:37 +01:00
Aliaksandr Kalenik
c7d6a7aafb LibWeb: Insert default font in font list before emoji font
This fixes a bug where, if a non-existent font family is specified in
CSS, whitespaces would be rendered using the emoji font, while letters
would use the default font. This issue occurred because the font was
resolved separately for each code point. Since the emoji font was listed
before the default font, it was chosen for whitespace characters due to
its inclusion of whitespace glyphs (at least in the Apple Color Emoji
font on macOS). This change resolves the issue by placing the default
font before the emoji font in the list.
2025-01-02 10:47:21 +01:00
Aliaksandr Kalenik
8b8d83a318 LibWeb: Request default font with size specified in style 2025-01-02 10:47:21 +01:00
Aliaksandr Kalenik
0b8b690f92 LibWeb+LibWebView: Allow to specify default font size in FontPlugin
Instead of always assuming 12pt size for default font, explicitly pass
it as a parameter.
2025-01-02 10:47:21 +01:00
sideshowbarker
1be55fe793 LibWeb: Support the ariaActiveDescendantElement IDL attribute 2025-01-01 11:00:53 +00:00
sideshowbarker
e1b4aa94db Meta: Fix “shadow-including-ancestors-descendant” generator check
This change fixes the IDLGenerators.cpp implementation of the “If
reflectedTarget's explicitly set attr-element is a descendant of any of
element's shadow-including ancestors” step from the “If a reflected IDL
attribute has the type T?, where T is either Element or an interface
that inherits from Element” case in the HTML spec at
http://whatwg.org/html/#reflecting-content-attributes-in-idl-attributes
2025-01-01 11:00:53 +00:00
sideshowbarker
f9d4852a22 Meta: Make IDLGenerators handle non-HTML and dash-containing attributes
This change updates the BindingsGenerator/IDLGenerators.cpp code to
handle reflected non-HTML::AttributeNames content-attribute names, and
to handle such names as-is — including names with dashes.
2025-01-01 11:00:53 +00:00
Andrew Kaster
35b636acb3 Devcontainer: Add a Fedora 41 devcontainer for use in CI 2024-12-31 13:42:50 -07:00
Andrew Kaster
6e2785ad73 Devcontainer: Split ladybird feature into install scripts per distro
We'll add more distros in a future commit.
2024-12-31 13:42:50 -07:00
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