Commit graph

12 commits

Author SHA1 Message Date
Sam Atkins
5e3f4d71cc LibWeb/CSS: Remove number_of_css_font_faces_with_loading_in_progress()
This is now unused as of the previous commit.
2026-02-24 15:44:32 +00:00
Sam Atkins
2660db3f52 LibWeb/CSS: Make FontFaceKey weights a range of values
For now, both the `min` and `max` are the single value we had before.
2026-02-24 10:05:09 +00:00
Callum Law
11d524bda4 LibWeb: Support CSS font-optical-sizing property 2026-02-03 11:44:25 +00:00
Callum Law
b55023fad3 LibGfx+LibWeb: Resolve font features per font rather than per element
Previously we would resolve font features
(https://drafts.csswg.org/css-fonts-4/#feature-variation-precedence)
per element, while this works for the current subset of the font feature
resolution algorithm that we support, some as yet unimplemented parts
require us to know whether we are resolving against a CSS @font-face
rule, and if so which one (e.g. applying descriptors from the @font-face
rule, deciding which @font-feature-values rules to apply, etc).

To achieve this we store the data required to resolve font features in a
struct and pass that to `FontComputer` which resolves the font features
and stores them with the computed `Font`.

We no longer need to invalidate the font shaping cache when features
change since the features are defined per font (and therefore won't ever
change).
2026-02-02 14:11:43 +00:00
Callum Law
2f7848913b LibWeb: Always respect font-variation-settings
Previously we wouldn't respect font-variation-settings for fonts matched
through `font_matching_algorithm` (i.e. any fonts which didn't have an
exact loaded match).
2026-01-21 23:49:25 +01:00
Callum Law
3f97f1579f LibGfx: Remove default parameters for some font related functions
We always pass these values so there is no need for default parameters
2026-01-21 23:49:25 +01:00
Callum Law
44415fcbe7 LibWeb: Rename FontLoader::m_vector_font to m_typeface
The `VectorFont` type was renamed to `Typeface` in d5926a3 but this
member variable was never updated.

The getter for this was also unused so has been removed
2026-01-21 23:49:25 +01:00
Callum Law
7c544175e5 LibWeb: Cache compute_font_for_style_values
We already cached the result of `font_matching_algorithm` but we can
instead cache the entire function.
2026-01-11 14:10:37 +01:00
Shannon Booth
d901e937b6 LibWeb/CSS: Do not give internal stylesheets a location URL
This fixes Acid3 numbered test 72.
2026-01-09 10:54:11 +00:00
Andreas Kling
e2d5802942 LibJS: Don't capture CSS::FontFace in GC::Root while loading fonts
This prevents a reference cycle that was leaking entire realms on
test-web.
2025-12-26 11:57:00 +01:00
Callum Law
dca80ad5eb LibWeb: Account for animated values when computing font
Computing the font for an element in `compute_font` is premature since
we are yet to apply animated properties - instead we should compute the
value on the fly (with a cache to avoid unnecessary work) to ensure we
are respecting the latest values
2025-12-05 10:03:15 +00:00
Callum Law
6c236d04d8 LibWeb: Separate font computation logic from StyleComputer
Font computation and loading is distinct enough from style computation
that it makes more sense to have this in it's own class.

This will be useful later when we move the font loading process to
`ComputedProperties` in order to respect animated values.
2025-12-05 10:03:15 +00:00