Commit graph

12 commits

Author SHA1 Message Date
Callum Law
06313acac0 LibWeb: Store updated attributes directly within FontFace
The spec states that updates to descriptors in a `@font-face` rule
should be reflected in the connected `FontFace`'s attributes.

Previously this was achieved by directly accessing those descriptors
when calling the attribute getters, but this has a couple of issues:
 a) The changes are only reflected if we use the accessors (i.e.
    `FontFace::family()` rather than `FontFace::m_family`) which isn't
     the case everywhere
 b) The changes aren't persisted after the `FontFace` is disconnected
    from it's `CSSFontFaceRule`

To fix these issues we now reparse and store the `FontFace`'s attributes
whenever the `CSSFontFaceRule`'s descriptors change.
2026-01-13 10:40:00 +00:00
Callum Law
d8f9caf853 LibWeb: Only run handle_src_descriptor_change once
Previously we would run it once within `set_src()` and then again within
`set_property()` which would lead to us creating two new `FontFace`s
instead of just one
2026-01-10 03:33:03 +00:00
Tim Ledbetter
7b8099bb89 LibWeb: Disconnect and replace FontFace on @font-face src change 2026-01-05 16:15:58 +00:00
Sam Atkins
a8312bf571 LibWeb/CSS: Use FlyString const& for property name IDL parameters 2025-10-02 13:46:04 +01:00
Sam Atkins
498e143687 LibWeb/DOM: Stop including Element.h from AbstractElement.h
We only need the forward declaration here, and this will let us include
AbstractElement from Element.
2025-06-19 12:35:31 +01:00
Sam Atkins
0925a32558 LibWeb/CSS: Extract a CSSDescriptors base class
This holds the boilerplate that's needed by any CSSStyleDeclaration
subclass that holds Descriptors. CSSFontFaceDescriptors now only has to
worry about initialization and its own exposed properties.
2025-05-08 16:21:32 +01:00
Sam Atkins
fa8bbfa6a5 LibWeb/CSS: Align declaration block parsing with the spec
We have two different code paths that implement the "parse a CSS
declaration block" algorithm, for properties and descriptors. COmbining
them isn't straightforward, and doesn't seem especially useful.
2025-04-23 10:55:45 +01:00
Andreas Kling
a6dfc74e93 LibWeb: Only set prototype once for object with IDL interface
Before this change, we were going through the chain of base classes for
each IDL interface object and having them set the prototype to their
prototype.

Instead of doing that, reorder things so that we set the right prototype
immediately in Foo::initialize(), and then don't bother in all the base
class overrides.

This knocks off a ~1% profile item on Speedometer 3.
2025-04-20 18:43:11 +02:00
Andrew Kaster
6d11414957 LibWeb: Make storage of CSS::StyleValues const-correct
Now we consistently use `RefPtr<StyleValue const>` for all StyleValues.
2025-04-16 10:41:44 -06:00
Sam Atkins
ce56ac9159 LibWeb/CSS: Correct include style in CSSFontFaceDescriptors.cpp 2025-04-07 10:00:21 +01:00
Sam Atkins
775efd01e2 LibWeb/CSS: Use initial values for @font-face descriptors 2025-04-07 10:00:21 +01:00
Sam Atkins
cb8511772d LibWeb/CSS: Add CSSFontFaceDescriptors type
This is a CSSOM type that holds the descriptors for a CSSFontFaceRule,
but this commit only adds it without using it.
2025-04-04 10:40:32 +01:00