LibWeb: Use CSSKeywordValue for CSS-wide keywords

We previously had 4 single-instance StyleValues for these keywords.
CSS-Typed-OM expects them keywords to be exposed as CSSKeywordValue, so
it's simpler to treat them the same. The single-instance behaviour is
kept by having StyleValue::create() use a cached instance for each of
these.
This commit is contained in:
Sam Atkins 2024-08-14 15:00:10 +01:00 committed by Sam Atkins
commit f518811f73
Notes: github-actions[bot] 2024-08-15 12:59:29 +00:00
12 changed files with 38 additions and 203 deletions

View file

@ -61,7 +61,6 @@
#include <LibWeb/CSS/StyleValues/TransformationStyleValue.h>
#include <LibWeb/CSS/StyleValues/TransitionStyleValue.h>
#include <LibWeb/CSS/StyleValues/UnresolvedStyleValue.h>
#include <LibWeb/CSS/StyleValues/UnsetStyleValue.h>
#include <LibWeb/DOM/Attr.h>
#include <LibWeb/DOM/Document.h>
#include <LibWeb/DOM/Element.h>
@ -1869,7 +1868,7 @@ NonnullRefPtr<CSSStyleValue const> StyleComputer::get_inherit_value(JS::Realm& i
void StyleComputer::compute_defaulted_property_value(StyleProperties& style, DOM::Element const* element, CSS::PropertyID property_id, Optional<CSS::Selector::PseudoElement::Type> pseudo_element) const
{
// FIXME: If we don't know the correct initial value for a property, we fall back to InitialStyleValue.
// FIXME: If we don't know the correct initial value for a property, we fall back to `initial`.
auto& value_slot = style.m_property_values[to_underlying(property_id)];
if (!value_slot) {