mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-19 17:27:51 +03:00
LibWeb: Fill in some missing FooOrCalculated types
This commit is contained in:
parent
07928129dd
commit
e907ad44c3
Notes:
sideshowbarker
2024-07-17 09:49:48 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/e907ad44c3 Pull-request: https://github.com/SerenityOS/serenity/pull/22476 Reviewed-by: https://github.com/Lubrsi
@ -13,11 +13,21 @@ Angle AngleOrCalculated::resolve_calculated(NonnullRefPtr<CalculatedStyleValue>
|
||||
return calculated->resolve_angle().value();
|
||||
}
|
||||
|
||||
Flex FlexOrCalculated::resolve_calculated(NonnullRefPtr<CalculatedStyleValue> const& calculated, Layout::Node const&) const
|
||||
{
|
||||
return calculated->resolve_flex().value();
|
||||
}
|
||||
|
||||
Frequency FrequencyOrCalculated::resolve_calculated(NonnullRefPtr<CalculatedStyleValue> const& calculated, Layout::Node const&) const
|
||||
{
|
||||
return calculated->resolve_frequency().value();
|
||||
}
|
||||
|
||||
i64 IntegerOrCalculated::resolve_calculated(NonnullRefPtr<CalculatedStyleValue> const& calculated, Layout::Node const&) const
|
||||
{
|
||||
return calculated->resolve_integer().value();
|
||||
}
|
||||
|
||||
Length LengthOrCalculated::resolve_calculated(NonnullRefPtr<CalculatedStyleValue> const& calculated, Layout::Node const& layout_node) const
|
||||
{
|
||||
return calculated->resolve_length(layout_node).value();
|
||||
@ -30,6 +40,11 @@ Length LengthOrCalculated::resolved(Length::ResolutionContext const& context) co
|
||||
return value();
|
||||
}
|
||||
|
||||
double NumberOrCalculated::resolve_calculated(NonnullRefPtr<CalculatedStyleValue> const& calculated, Layout::Node const&) const
|
||||
{
|
||||
return calculated->resolve_number().value();
|
||||
}
|
||||
|
||||
Percentage PercentageOrCalculated::resolve_calculated(NonnullRefPtr<CalculatedStyleValue> const& calculated, Layout::Node const&) const
|
||||
{
|
||||
return calculated->resolve_percentage().value();
|
||||
|
@ -8,6 +8,7 @@
|
||||
|
||||
#include <AK/Variant.h>
|
||||
#include <LibWeb/CSS/Angle.h>
|
||||
#include <LibWeb/CSS/Flex.h>
|
||||
#include <LibWeb/CSS/Frequency.h>
|
||||
#include <LibWeb/CSS/Length.h>
|
||||
#include <LibWeb/CSS/Percentage.h>
|
||||
@ -84,6 +85,13 @@ public:
|
||||
Angle resolve_calculated(NonnullRefPtr<CalculatedStyleValue> const&, Layout::Node const&) const override;
|
||||
};
|
||||
|
||||
class FlexOrCalculated : public CalculatedOr<Flex> {
|
||||
public:
|
||||
using CalculatedOr<Flex>::CalculatedOr;
|
||||
|
||||
Flex resolve_calculated(NonnullRefPtr<CalculatedStyleValue> const&, Layout::Node const&) const override;
|
||||
};
|
||||
|
||||
class FrequencyOrCalculated : public CalculatedOr<Frequency> {
|
||||
public:
|
||||
using CalculatedOr<Frequency>::CalculatedOr;
|
||||
@ -91,6 +99,13 @@ public:
|
||||
Frequency resolve_calculated(NonnullRefPtr<CalculatedStyleValue> const&, Layout::Node const&) const override;
|
||||
};
|
||||
|
||||
class IntegerOrCalculated : public CalculatedOr<i64> {
|
||||
public:
|
||||
using CalculatedOr<i64>::CalculatedOr;
|
||||
|
||||
i64 resolve_calculated(NonnullRefPtr<CalculatedStyleValue> const&, Layout::Node const&) const override;
|
||||
};
|
||||
|
||||
class LengthOrCalculated : public CalculatedOr<Length> {
|
||||
public:
|
||||
using CalculatedOr<Length>::CalculatedOr;
|
||||
@ -99,6 +114,13 @@ public:
|
||||
[[nodiscard]] Length resolved(Length::ResolutionContext const&) const;
|
||||
};
|
||||
|
||||
class NumberOrCalculated : public CalculatedOr<double> {
|
||||
public:
|
||||
using CalculatedOr<double>::CalculatedOr;
|
||||
|
||||
double resolve_calculated(NonnullRefPtr<CalculatedStyleValue> const&, Layout::Node const&) const override;
|
||||
};
|
||||
|
||||
class PercentageOrCalculated : public CalculatedOr<Percentage> {
|
||||
public:
|
||||
using CalculatedOr<Percentage>::CalculatedOr;
|
||||
|
@ -119,6 +119,7 @@ class ElementInlineCSSStyleDeclaration;
|
||||
class ExplicitGridTrack;
|
||||
class FilterValueListStyleValue;
|
||||
class Flex;
|
||||
class FlexOrCalculated;
|
||||
class FlexStyleValue;
|
||||
class FontFace;
|
||||
class Frequency;
|
||||
@ -138,6 +139,7 @@ class IdentifierStyleValue;
|
||||
class ImageStyleValue;
|
||||
class InheritStyleValue;
|
||||
class InitialStyleValue;
|
||||
class IntegerOrCalculated;
|
||||
class IntegerStyleValue;
|
||||
class Length;
|
||||
class LengthBox;
|
||||
@ -152,6 +154,7 @@ class MediaQuery;
|
||||
class MediaQueryList;
|
||||
class MediaQueryListEvent;
|
||||
class Number;
|
||||
class NumberOrCalculated;
|
||||
class NumberStyleValue;
|
||||
class Percentage;
|
||||
class PercentageOrCalculated;
|
||||
|
Loading…
Reference in New Issue
Block a user