LibWeb/CSS: Introduce OpenTypeTaggedStyleValue

Two font properties, font-feature-settings and font-variation-settings,
contain a list of values that are an `<opentype-tag>` followed by a
single value. This class is intended to fill both roles.
This commit is contained in:
Sam Atkins 2024-09-30 17:05:52 +01:00 committed by Sam Atkins
commit c22a2d8f2b
Notes: github-actions[bot] 2024-10-02 15:38:16 +00:00
6 changed files with 85 additions and 0 deletions

View file

@ -117,6 +117,7 @@ public:
Math,
MathDepth,
Number,
OpenTypeTagged,
Percentage,
Position,
RadialGradient,
@ -260,6 +261,10 @@ public:
NumberStyleValue const& as_number() const;
NumberStyleValue& as_number() { return const_cast<NumberStyleValue&>(const_cast<CSSStyleValue const&>(*this).as_number()); }
bool is_open_type_tagged() const { return type() == Type::OpenTypeTagged; }
OpenTypeTaggedStyleValue const& as_open_type_tagged() const;
OpenTypeTaggedStyleValue& as_open_type_tagged() { return const_cast<OpenTypeTaggedStyleValue&>(const_cast<CSSStyleValue const&>(*this).as_open_type_tagged()); }
bool is_percentage() const { return type() == Type::Percentage; }
PercentageStyleValue const& as_percentage() const;
PercentageStyleValue& as_percentage() { return const_cast<PercentageStyleValue&>(const_cast<CSSStyleValue const&>(*this).as_percentage()); }