Commit graph

416 commits

Author SHA1 Message Date
Sam Atkins
218e646e72 LibWeb/HTML: Extract ErrorInformation struct into its own files
This is used from a few different places in the spec.
2025-11-30 11:47:10 +01:00
Callum Law
c8d91c127e LibWeb: Parse view() for the animation-timeline CSS property 2025-11-28 13:24:11 +00:00
Callum Law
7d70714eac LibWeb: Parse scroll() for the animation-timeline CSS property 2025-11-28 13:24:11 +00:00
Sam Atkins
85478c9215 LibWeb/HTML: Rename popover "invoker"
Lots of renames, no behaviour differences. (Apart from the rename of the
IDL type, which does of course affect JS.)

Corresponds to:
16cb7808da
2025-11-27 16:44:51 +00:00
Timothy Flynn
9375660b64 LibHTTP+LibWeb+RequestServer: Move Fetch's HTTP header infra to LibHTTP
The end goal here is for LibHTTP to be the home of our RFC 9111 (HTTP
caching) implementation. We currently have one implementation in LibWeb
for our in-memory cache and another in RequestServer for our disk cache.

The implementations both largely revolve around interacting with HTTP
headers. But in LibWeb, we are using Fetch's header infra, and in RS we
are using are home-grown header infra from LibHTTP.

So to give these a common denominator, this patch replaces the LibHTTP
implementation with Fetch's infra. Our existing LibHTTP implementation
was not particularly compliant with any spec, so this at least gives us
a standards-based common implementation.

This migration also required moving a handful of other Fetch AOs over
to LibHTTP. (It turns out these AOs were all from the Fetch/Infra/HTTP
folder, so perhaps it makes sense for LibHTTP to be the implementation
of that entire set of facilities.)
2025-11-27 14:57:29 +01:00
Timothy Flynn
3dce6766a3 LibWeb: Extract some CORS and MIME Fetch helpers to their own files
An upcoming commit will migrate the contents of Headers.h/cpp to LibHTTP
for use outside of LibWeb. These CORS and MIME helpers depend on other
LibWeb facilities, however, so they cannot be moved.
2025-11-27 14:57:29 +01:00
Timothy Flynn
556364fd76 LibWeb: Remove unused LoadRequest facilities
We could probably do with removing LoadRequest altogether. But this just
removes unused methods for now to make an upcoming HTTP header change a
bit simpler.
2025-11-26 09:15:06 -05:00
Jelle Raaijmakers
527a293047 LibWeb: Implement SVGAnimatedLengthList 2025-11-20 23:15:24 +01:00
Jelle Raaijmakers
797e6dd4eb LibWeb: Implement SVGLengthList 2025-11-20 23:15:24 +01:00
Sam Atkins
c4b9e7eadf LibWeb: Parse and propagate extended text-indent property values
CSS Text 3 gives `text-indent` a couple of optional keywords to control
which lines are affected. This commit parses them, but doesn't yet do
anything with them.
2025-11-20 16:02:40 +01:00
Luke Wilde
47b512ec56 LibWeb/WebAudio: Fire complete event with OfflineAudioCompletionEvent 2025-11-19 17:26:09 +01:00
Tim Ledbetter
36c6079dbc LibWeb+LibGfx: Implement SVGFEMorphologyElement
This filter primitive is used to erode or dilate an image.
2025-11-15 16:08:53 +01:00
Andreas Kling
66263f142b LibWeb: Add StyleScope to keep style caches per Document/ShadowRoot
Before this change, we've been maintaining various StyleComputer caches
at the document level.

This made sense for old-school documents without shadow trees, since
all the style information was document-wide anyway. However, documents
with many shadow trees ended up suffering since any time you mutated
a style sheet inside a shadow tree, *all* style caches for the entire
document would get invalidated.

This was particularly expensive on Reddit, which has tons of shadow
trees with their own style elements. Every time we'd create one of their
custom elements, we'd invalidate the document-level "rule cache" and
have to rebuild it, taking about ~60ms each time (ouch).

This commit introduces a new object called StyleScope.

Every Document and ShadowRoot has its own StyleScope. Rule caches etc
are moved from StyleComputer to StyleScope.

Rule cache invalidation now happens at StyleScope level. As an example,
rule cache rebuilds now take ~1ms on Reddit instead of ~60ms.

This is largely a mechanical change, moving things around, but there's
one key detail to be aware of: due to the :host selector, which works
across the shadow DOM boundary and reaches from inside a shadow tree out
into the light tree, there are various places where we have to check
both the shadow tree's StyleScope *and* the document-level StyleScope
in order to get all rules that may apply.
2025-11-14 22:05:33 +01:00
Jelle Raaijmakers
70e98e72a8 LibWeb: Add SVGFEFunc{A,B,G,R}Element 2025-11-09 01:22:48 +01:00
Jelle Raaijmakers
db321cb74f LibWeb: Add SVGComponentTransferFunctionElement
This will be the base for <feFuncR>, <feFuncG>, <feFuncB> and <feFuncA>.
2025-11-09 01:22:48 +01:00
Jelle Raaijmakers
03a8de566b LibWeb: Add SVGFEComponentTransferElement 2025-11-09 01:22:48 +01:00
Jelle Raaijmakers
c0630c700f LibWeb: Add SVGAnimatedNumberList 2025-11-09 01:22:48 +01:00
Jelle Raaijmakers
c5e7276c2f LibWeb: Add SVGNumberList 2025-11-09 01:22:48 +01:00
Jelle Raaijmakers
9991205403 LibWeb: Add SVGList<T> and use it for SVGTransformList
The spec defines a generic list interfaces that we can reuse. Currently
we only have SVGTransformList, but we will need this to add
SVGNumberList as well.
2025-11-09 01:22:48 +01:00
Jelle Raaijmakers
7e869c7816 LibWeb: Add SVGNumber 2025-11-09 01:22:48 +01:00
Undefine
d4ac9fc5c6 LibWeb: Implement WebGL extension OES_standard_derivatives 2025-11-06 19:02:36 +01:00
Timothy Flynn
ac246caa0c LibWeb: Remove now-unused Resource and ResourceClient
And deal with the fallout of transitive includes.
2025-11-05 18:27:36 +01:00
Undefine
6c115171da LibWeb: Split off WebGL2RenderingContextImpl to Impl and Overloads
This mostly analogous to the previous commit that does the same with
the WebGL1 Impl file.
2025-11-05 02:19:32 +01:00
Undefine
c70886ab1f LibWeb: Split off WebGLRenderingContextImpl to Impl and Overloads
This is more like what the IDL files specify with two different mixins,
but the inheritance structure here is slightly different for easier
maintenance. This will also allow the WebGL2 Impl to inherit from the
WebGL1 Impl as WebGL versions don't share the functions defined in the
Overloads interfaces.
2025-11-05 02:19:32 +01:00
Zaggy1024
9f44fcbded Everywhere: Remove AudioCodecPlugin and Qt Multimedia
These are no longer needed now that audio is played through
PlaybackManager.
2025-10-27 17:28:49 -07:00
Zaggy1024
3d0b8cc30c LibWeb: Set AudioTrack and VideoTrack fields according to spec
The two classes now inherit from a common base MediaTrackBase, to
deduplicate the attributes that are shared between the two.

The integer ID from the container is used for each track's id
attribute.

The kind attribute is set to "main" or "translation" according to:
https://dev.w3.org/html5/html-sourcing-inband-tracks/

The label attribute is set to the human-readable name of the track, if
one is present.

The language attribute is set to a BCP 47 language tag, if one can be
parsed successfully.
2025-10-27 17:28:49 -07:00
Callum Law
64f438857b LibWeb: Factor out some class template methods into implementation files
Reduces the rebuild required for changes to the .cpp parts (or their
includes)
2025-10-27 14:50:54 +00:00
Pavel Shliak
5ee1031b89 LibWeb: Implement SVGFEColorMatrixElement and feColorMatrix 2025-10-23 13:36:26 +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
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
Lorenz A
96b34ea744 LibWeb: Add MathML Element presentational hints 2025-10-22 01:46:41 +02:00
Callum Law
831e471444 LibWeb: Support top-level tree counting functions
Adds support for `sibling-index()` and `sibling-count()` when parsing
`<number>` and `<integer>`. This is achieved by a new
`TreeCountingFunctionStyleValue` class which is converted within
`absolutized` to `NumberStyleValue` and `IntegerStyleValue` respectively

There are still a few kinks to work out in order to support these
everywhere, namely:
 - There are some `StyleValue`s which aren't absolutized (i.e. those
   which are stored within another `StyleValue` without an
   `absolutize()` method.
 - We don't have a way to represent this new `StyleValue` within
   `{Number,Integer}OrCalculated`. This would be fixed if we were to
   instead just use the `StyleValue` classes until style computation at
   which time they would be absolutized into their respective
   primitives (double, i64, etc) bypassing the need for *OrCalculated
   entirely.
2025-10-20 16:12:08 +01:00
Luke Wilde
b15f4424f9 LibWeb/WebGL: Implement the EXT_texture_filter_anisotropic extension 2025-10-20 15:33:33 +02:00
Luke Wilde
d08915a0cd LibWeb/WebGL: Implement the WEBGL_compressed_texture_s3tc_srgb extension 2025-10-20 15:33:33 +02:00
Luke Wilde
ddf60ebe9e LibWeb/WebGL2: Implement the EXT_texture_norm16 extension 2025-10-20 15:33:33 +02:00
Luke Wilde
93d3ebfd59 LibWeb/WebGL2: Implement the EXT_render_snorm extension 2025-10-20 15:33:33 +02:00
Callum Law
95e26819d9 LibWeb: Separate use time easing functions from EasingStyleValue
In the future there will be different methods of creating these use-time
easing functions (e.g. from `KeywordStyleValue`s)
2025-10-20 11:27:44 +01:00
Luke Wilde
eeb5446c1b LibWeb: Avoid including Navigable.h in headers
This greatly reduces how much is recompiled when changing Navigable.h,
from >1000 to 82.
2025-10-20 10:16:55 +01:00
Callum Law
814efa9809 LibWeb: Parse corner-*-shape physical longhands 2025-10-09 10:23:20 +01:00
Luke Wilde
d87c2a55b0 LibWeb/IndexedDB: Remove spin_until from checking finished transactions 2025-10-08 17:25:29 +02:00
Luke Wilde
52b53e52fb LibWeb/IndexedDB: Remove spin_until from waiting for connection closure 2025-10-08 17:25:29 +02:00
Luke Wilde
5c69784ef9 LibWeb/IndexedDB: Remove spin_until from request processing 2025-10-08 17:25:29 +02:00
Johannes Gustafsson
0ea519c539 LibWeb: Implement XPath functionality using libxml2 2025-10-03 13:16:11 +02:00
Johannes Gustafsson
f04b866cb0 LibWeb: Implement stubs for XPathEvaluator 2025-10-03 13:16:11 +02:00
Aliaksandr Kalenik
20490d146c LibWeb/WebGL: Deduplicate read_and_pixel_convert_texture_image_source()
After we commited code produced by WebGL generator this function ended
up duplicated between WebGL 1 and 2 contexts.
2025-10-02 18:41:02 +02:00
Tim Ledbetter
a00e7cb20b LibWeb: Implement <feComposite> SVG filter 2025-09-30 22:33:12 +01:00
Sam Atkins
d5977b9f74 LibWeb/CSS: Implement CSSTransformValue
This is the final CSSStyleValue class used by the per-property test
harness, so those now actually run instead of throwing an exception on
load. 🎉

+39 WPT subtests. (Plus however many from the per-property tests finally
running.)

The two failing serialization tests are also failed by Safari in exactly
the same way, so that seems more like a spec issue. (The spec is
incomplete in quite a few places.) The failing subtest for toMatrix() is
also a spec issue: is2D is handled oddly by CSSMatrixComponent and this
subtest fails because of the `matrix` getter, which is unspecified. See
https://github.com/w3c/css-houdini-drafts/issues/1155 for details.
2025-09-24 12:27:05 +01:00
Sam Atkins
a1db5e7789 LibWeb/CSS: Implement CSSMatrixComponent
Equivalent to the matrix() and matrix3d() transform functions.

+19 WPT subtests.
2025-09-24 12:27:05 +01:00
Sam Atkins
2ffbb284f2 LibWeb/CSS: Implement CSSPerspective
Equivalent to the perspective() transform function.

+34 WPT subtests, and the transformvalue-normalization test now runs to
completion instead of throwing an error - though its cases still fail
until CSSTransformValue is implemented.
2025-09-24 12:27:05 +01:00
Sam Atkins
da883877f5 LibWeb/CSS: Implement CSSSkewY
Equivalent to the skewY() transform function.

+27 WPT subtests.
2025-09-24 12:27:05 +01:00