diff --git a/Libraries/LibWeb/DOM/Element.h b/Libraries/LibWeb/DOM/Element.h index 76a29fc30d7..ddefb2ab93f 100644 --- a/Libraries/LibWeb/DOM/Element.h +++ b/Libraries/LibWeb/DOM/Element.h @@ -116,3 +116,12 @@ private: }; } + +namespace AK { +template<> +inline bool is(const Web::DOM::Node& input) +{ + return input.is_element(); +} + +} diff --git a/Libraries/LibWeb/Layout/Box.h b/Libraries/LibWeb/Layout/Box.h index b43f969fad3..7b05b381e34 100644 --- a/Libraries/LibWeb/Layout/Box.h +++ b/Libraries/LibWeb/Layout/Box.h @@ -123,6 +123,8 @@ protected: Vector m_line_boxes; private: + virtual bool is_box() const final { return true; } + Gfx::FloatPoint m_offset; Gfx::FloatSize m_size; @@ -133,3 +135,12 @@ private: }; } + +namespace AK { +template<> +inline bool is(const Web::Layout::Node& input) +{ + return input.is_box(); +} + +} diff --git a/Libraries/LibWeb/Layout/Node.h b/Libraries/LibWeb/Layout/Node.h index de7ed3e7bf1..c1699924e39 100644 --- a/Libraries/LibWeb/Layout/Node.h +++ b/Libraries/LibWeb/Layout/Node.h @@ -115,6 +115,8 @@ public: virtual void paint_fragment(PaintContext&, const LineBoxFragment&, PaintPhase) const { } virtual void after_children_paint(PaintContext&, PaintPhase) {}; + virtual bool is_box() const { return false; } + bool is_floating() const; bool is_positioned() const; bool is_absolutely_positioned() const;