summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorMacDue <macdue@dueutil.tech>2022-09-15 08:31:09 +0100
committerSam Atkins <atkinssj@gmail.com>2022-09-16 10:50:48 +0100
commit84d9a226e6f71ed9798922fb5f4b79e5d6b1049d (patch)
treeb8953b618d01b0950abc4527e400baab6d3d41bc /Userland
parent0829aa5df033c137c3d029dc4c29cf81a08ab9c8 (diff)
downloadserenity-84d9a226e6f71ed9798922fb5f4b79e5d6b1049d.zip
LibWeb: Add NumberPercentage CSS type
This type is used quite a bit in CSS filters.
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibWeb/CSS/Percentage.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/Percentage.h b/Userland/Libraries/LibWeb/CSS/Percentage.h
index e0716407ee..3ee0a60ef9 100644
--- a/Userland/Libraries/LibWeb/CSS/Percentage.h
+++ b/Userland/Libraries/LibWeb/CSS/Percentage.h
@@ -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<>