From daa88448e1385372a261c2c22595647e81d32bfd Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 28 Jun 2020 15:08:37 +0200 Subject: [PATCH] LibWeb: Add Length::is_undefined_or_auto() Quite often, we want the same behavior in both cases. This allows us to express that with a single method. --- Libraries/LibWeb/CSS/Length.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Libraries/LibWeb/CSS/Length.h b/Libraries/LibWeb/CSS/Length.h index f42e64bbf8..023c5ae702 100644 --- a/Libraries/LibWeb/CSS/Length.h +++ b/Libraries/LibWeb/CSS/Length.h @@ -78,6 +78,7 @@ public: return resolved(make_px(0), layout_node, reference_for_percent); } + bool is_undefined_or_auto() const { return m_type == Type::Undefined || m_type == Type::Auto; } bool is_undefined() const { return m_type == Type::Undefined; } bool is_percentage() const { return m_type == Type::Percentage; } bool is_auto() const { return m_type == Type::Auto; }