Commit Graph

72401 Commits

Author SHA1 Message Date
Callum Law
c8f345356e LibWeb: Maintain property importance into ComputedProperties
Previously we wouldn't propagate this from CascadedProperties to
ComputedProperties
2025-10-27 09:51:50 +00:00
Callum Law
823dd11b67 LibWeb: Add ComputedProperties::set_property_without_modifying_flags
There are a few places in style computation where we want to update the
value of a property without modifying the inherited or important flags.

Previously we would look up these flags and pass them to the normal
`set_property` method but this is unnecessary and was easy to forget to
do.
2025-10-27 09:51:50 +00:00
Callum Law
84762021b8 LibWeb: Support triggering multiple animations per animation property
We also now use the computed (rather than cascaded) values when
triggering animations.
2025-10-27 09:48:25 +00:00
Callum Law
18477b0d84 LibWeb: Promote animation-composition values to enum
This brings us in line with the other `animation-*` enum properties
(`animation-play-state` and `animation-fill-mode`)
2025-10-27 09:48:25 +00:00
Tim Ledbetter
8854bb62c6 LibGfx: Use CSS sRGB serialization for canvas fill styles 2025-10-26 18:55:22 +01:00
Tim Ledbetter
ebd802f6fc LibWeb+LibGfx: Move CSS sRGB color serialization function to LibGfx 2025-10-26 18:55:22 +01:00
Rocco Corsi
633fc45e0f LibWeb: Make Worker.cpp compile again with WEB_WORKER_DEBUG enabled 2025-10-26 12:47:06 -04:00
Dave-London
5f963e1c52 Documentation: Remove de-listed VSCode extension reference
The "SerenityOS DSL Syntax Highlight" extension has been de-listed
from both the VS Code Marketplace and Open VSX. Remove the broken
section from the documentation to prevent confusion.
2025-10-26 12:44:44 -04:00
Tim Ledbetter
9dceb06992 LibWeb: Don't paint canvas objects with non-visible fill styles 2025-10-26 16:45:38 +01:00
Ben Eidson
01947ded23 LibWeb/WebAudio: Implement basic startRendering
Adds passing WPT. Does not handle actually rendering audio yet.
2025-10-26 14:19:21 +01:00
ayeteadoe
5abb5d555a LibWeb: Implement createImageBitmap() with an ImageBitmap source 2025-10-26 09:01:20 +01:00
Luke Wilde
d733bf54cc LibWeb/WebGL: Avoid copying canvas surface when uploading it 2025-10-25 12:56:17 +02:00
Luke Wilde
d65f0e4490 LibWeb/WebGL: Calculate the correct pitch for compacted types
It's not correct to multiply the number of components by the number of
bytes, since compact formats such as 4_4_4_4 have 4 components but
_always_ stored in 2 bytes, not 8 if you were to do such a
multiplication.

Fixes textures on Google Maps having large blank stripes.
2025-10-25 12:56:17 +02:00
Luke Wilde
3e7061da40 LibWeb/WebGL: Respect UNPACK_FLIP_Y_WEBGL pixel storage parameter
When this is true, we have to vertically flip TexImageSource provided
images before uploading them.

Fixes several graphical glitches on Google Maps.
Fixes globe being upside down on Shopify's homepage.
Likely fixes more websites.
2025-10-25 12:56:17 +02:00
Luke Wilde
008699c129 LibWeb/WebGL: Return null from getUniformLocation if uniform isn't found 2025-10-25 12:56:17 +02:00
aplefull
5632a52531 LibRegex: Properly track code units in u-v modes
Previously, both string_position and view_index used code unit offsets
regardless of mode. Now in unicode mode, these variables track code
point positions while string_position_in_code_units is properly
updated to reflect code unit offsets.
2025-10-24 21:23:06 +02:00
Lorenz A
fb258639d1 LibWeb: CSS selector read-write honor is_allowed_to_be_readonly 2025-10-24 19:15:58 +01:00
aplefull
cd4ac4f30f LibJS: Escape line terminators in regex source 2025-10-24 13:24:55 -04:00
aplefull
7ce4abe330 LibRegex+LibUnicode: Add unicode string properties 2025-10-24 13:24:55 -04:00
Junior Rantila
8c8961171c UI/AppKit: Make project buildable on macOS < 15
When trying to build Ladybird on macOS 14.3, it fails with the error:

```

No visible @interface for 'NSToolbar' declares the selector
'setAllowsDisplayModeCustomization:' (clang arc_may_not_respond)

```

This is caused by macOS < 15 not having the @interface definition for
in NSToolbar for setAllowsUserCustomization:(BOOL).

By dynamically calling the method, we can avoid the error altogether.
2025-10-24 12:41:42 -04:00
Aliaksandr Kalenik
6c71960425 LibWebView: Add common source loop source for deferred_invoke() on macOS
Previously, `EventLoopImplementationMacOS` didn't process
`deferred_invoke()` callbacks during window resizing because they were
scheduled in the "default" run-loop mode, which isn't serviced while the
run loop is in "Event Tracking" mode.

Commit 3bbe1b0c changed socket notifiers to schedule in
`kCFRunLoopCommonModes`, which kept IPC reads responsive during resizing
(we process IPC messages in the notifier's read hook). This change does
the same for `deferred_invoke()`: it installs a `CFRunLoopSource` in
`kCFRunLoopCommonModes` and signals it whenever a deferred callback is
enqueued.
2025-10-24 16:04:42 +02:00
Luke Wilde
d4deafe5fe LibJS: Track current shape dictionary generation in PropertyLookupCache
When an object becomes too big (currently 64 properties or more), we
change its shape to a dictionary and don't do any further transitions.

However, this means the Shape of the object no longer changes, so the
cache invalidation check of `current_shape != cache.shape` is no longer
a valid check.

This fixes that by keeping track of a generation number for the Shape
both on the Shape object and in the cache, allowing that to be checked
instead of the Shape identity. The generation is incremented whenever
the dictionary is mutated.

Fixes stale cache lookups on Gmail preventing emails from being
displayed.

I was not able to produce a reproduction for this, plus the generation
count was over the 20k mark on Gmail.
2025-10-24 15:35:04 +02:00
Luke Wilde
a21d247b0e LibJS: Actually mark uncacheable dictionary shapes as uncacheable 2025-10-24 15:35:04 +02:00
Jelle Raaijmakers
ba78e3d4be CI+Meta: Synchronize commit linting rules
Our CI commit linter now evaluates commit messages line by line, similar
to `Meta/lint-commit.sh`.

The URL rule was updated to allow any freestanding URL, optionally
prefixed by whitespace.
2025-10-24 13:09:46 +02:00
Jelle Raaijmakers
e3a56ef913 CI: Move commit message line rule down in list
This synchronizes the order of rules between `Meta/lint-commit.sh` and
this workflow. No functional changes.
2025-10-24 13:09:46 +02:00
Jelle Raaijmakers
e197ab8ff6 CI: Ignore CR in commit message linting patterns
We already check if CR is present in the first rule, and although it
would be nice to see all errors at once, we expect people to run
`Meta/lint-commit.sh` before pushing as well. This simplifies our
patterns a bit.
2025-10-24 13:09:46 +02:00
Jelle Raaijmakers
86725de23d LibGfx: Use correct include path for SkImage.h
Fixes our flatpak builds.
2025-10-24 12:44:24 +02:00
Tim Ledbetter
5294559f7b LibWeb: Use logical properties in UA stylesheet 2025-10-24 10:11:49 +01:00
Andreas Kling
a056b26e56 LibWeb: Don't create identical StyleValueList if absolutization is no-op
This case is actually incredibly common, and this ends up reducing the
memory footprint on https://gymgrossisten.com/ by 2.07 MiB.
2025-10-24 08:52:53 +02:00
Andreas Kling
4f684bb4c9 LibGfx: Don't create AnonymousBuffer for each bitmap in BitmapSequence
When decoding a BitmapSequence received over IPC, we were creating an
AnonymousBuffer for each bitmap and then making a Gfx::Bitmap wrapper
around it.

This was unnecessarily using up one file descriptor per bitmap, and also
wasting a lot of memory for small bitmaps since we always allocated at
least one VM page.

This patch changes the BitmapSequence decoder to use malloc memory
instead, saving file descriptors and using less memory overall.
2025-10-24 08:52:53 +02:00
Andreas Kling
3593c3b687 LibWeb: Throw out decoded UTF-32 data in HTMLTokenizer after parser runs
This ends up saving quite a bit of memory on many pages, since UTF-32
uses 4 bytes per code points.

As an example, it reduces the footprint on https://gymgrossisten.com/
by 2 MiB.
2025-10-24 08:52:53 +02:00
Andreas Kling
b10f2993b3 LibWeb: Use Optional<ssize_t> for the HTMLTokenizer insertion points
Instead of making a custom struct, we can just use Optional here,
to make the code feel a bit more idiomatic.
2025-10-24 08:52:53 +02:00
Tim Ledbetter
9df6ccf772 LibWeb: Add MathML doctypes that enable XHTML entities 2025-10-23 22:08:40 +02:00
Tim Ledbetter
1c00279488 LibWeb: Reset Painter when resetting canvas to its initial state 2025-10-23 18:52:36 +02:00
Tim Ledbetter
017e8a5b8d LibGfx: Add a method to reset a Painter to its initial state 2025-10-23 18:52:36 +02:00
Andreas Kling
dbf041aa98 LibWeb: Ignore repaint requests inside iframes with visibility: hidden
This reduces idle CPU usage on https://gymgrossisten.com/ from 100%
(split between WebContent and Ladybird) to ~4% on my machine.
2025-10-23 17:42:37 +02:00
Tim Ledbetter
f34361950c Tests: Rebaseline failing IndexedDB tests 2025-10-23 15:55:17 +02:00
Tim Ledbetter
49a46522d0 Meta: Use binary search instead of a Trie for public suffix list lookups 2025-10-23 15:01:13 +02:00
Tim Ledbetter
15518f119c Tests: Add some basic public suffix tests 2025-10-23 15:01:13 +02:00
Luke Wilde
85e8d2ba38 LibWeb/IndexedDB: Prevent copying and moving of RequestList
RequestList cannot be copied or moved, because m_pending_request_queue
contains lambdas that store pointers to the original RequestList and
completion steps that we don't have a reference to.

Fixes a bunch of WPT regressions and imports the ones that work.
2025-10-23 14:42:45 +02:00
Luke Wilde
4ede2cdf18 LibWebView+WebContent: Allow setting the default time zone
This is used by tests to set the default time zone to UTC.

This is because certain tests create JavaScript Date objects, which are
in the current timezone.
2025-10-23 14:42:45 +02:00
stelar7
d0bfb85c22 LibWeb/IDB: Mark request as errored if upgrade transaction is aborted 2025-10-23 14:26:54 +02:00
Jelle Raaijmakers
62ae4e878f LibWeb: Implement support for drawing with CanvasPattern
We already had the API, but drawing to the canvas was not affected by
any created CanvasPattern. This moves CanvasPatternPaintStyle to LibGfx
so we don't have to reach into LibWeb, and implements the plumbing to
let Skia use images as a fill pattern.
2025-10-23 13:20:03 +01:00
Jelle Raaijmakers
9753b8e62c Tests: Import WPT canvas repeating pattern test 2025-10-23 13:20:03 +01:00
Pavel Shliak
5ee1031b89 LibWeb: Implement SVGFEColorMatrixElement and feColorMatrix 2025-10-23 13:36:26 +02:00
ste
b50b89b4a8 Meta: Do not set -march=native on riscv64 2025-10-23 12:17:21 +02:00
ste
b28a97b399 Meta: Add build support for RISC-V (riscv64)
Co-authored-by: Bas M. <bas@opvolger.net>
2025-10-23 12:17:21 +02:00
mikiubo
5b2a71a712 LibWeb: Implement XMLFragmentParser
Implement XMLFragmentParser based on the specification:
https://html.spec.whatwg.org/multipage/xhtml.html

Fixes one WPT in:
domparsing/insert_adjacent_html-xhtml.xhtml
2025-10-23 11:06:39 +01:00
mikiubo
0b715b20a2 LibWeb: Make HTML fragment parsing return ExceptionOr
Update Element::parse_fragment and Node::unsafely_set_html to
propagate exceptions.

This refactor is needed as a prerequisite for implementing the XML
fragment parser, which requires consistent error handling in fragment
parsing.
2025-10-23 11:06:39 +01:00
Callum Law
8417d74328 LibWeb: Parse transition property as a coordinating list shorthand
We don't need all this specific logic for parsing the `transition`
property - we also now maintain `none` as such until use time which
gains us a couple extra tests
2025-10-23 10:09:11 +01:00