Explorar o código

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.
Andreas Kling %!s(int64=5) %!d(string=hai) anos
pai
achega
daa88448e1
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      Libraries/LibWeb/CSS/Length.h

+ 1 - 0
Libraries/LibWeb/CSS/Length.h

@@ -78,6 +78,7 @@ public:
         return resolved(make_px(0), layout_node, reference_for_percent);
         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_undefined() const { return m_type == Type::Undefined; }
     bool is_percentage() const { return m_type == Type::Percentage; }
     bool is_percentage() const { return m_type == Type::Percentage; }
     bool is_auto() const { return m_type == Type::Auto; }
     bool is_auto() const { return m_type == Type::Auto; }