1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-10 18:10:56 +09:00

LibWeb: Add NumberPercentage CSS type

This type is used quite a bit in CSS filters.
This commit is contained in:
MacDue 2022-09-15 08:31:09 +01:00 committed by Sam Atkins
parent 0829aa5df0
commit 84d9a226e6
Notes: sideshowbarker 2024-07-17 07:08:04 +09:00

View file

@ -11,6 +11,7 @@
#include <LibWeb/CSS/Angle.h>
#include <LibWeb/CSS/Frequency.h>
#include <LibWeb/CSS/Length.h>
#include <LibWeb/CSS/Number.h>
#include <LibWeb/CSS/Time.h>
namespace Web::CSS {
@ -209,6 +210,14 @@ public:
virtual Time resolve_calculated(NonnullRefPtr<CalculatedStyleValue> const&, Layout::Node const&, Time const& reference_value) const override;
};
struct NumberPercentage : public PercentageOr<Number> {
public:
using PercentageOr<Number>::PercentageOr;
bool is_number() const { return is_t(); }
Number const& number() const { return get_t(); }
};
}
template<>