LibHTML: Add LayoutNode::is_image() and is<LayoutImage> helper

This commit is contained in:
Andreas Kling 2019-12-18 20:52:36 +01:00
parent 7cc4b90b16
commit 85ac9705ba
Notes: sideshowbarker 2024-07-19 10:49:04 +09:00
2 changed files with 8 additions and 0 deletions

View File

@ -19,4 +19,11 @@ public:
private:
virtual const char* class_name() const override { return "LayoutImage"; }
virtual bool is_image() const override { return true; }
};
template<>
inline bool is<LayoutImage>(const LayoutNode& node)
{
return node.is_image();
}

View File

@ -58,6 +58,7 @@ public:
virtual bool is_block() const { return false; }
virtual bool is_replaced() const { return false; }
virtual bool is_widget() const { return false; }
virtual bool is_image() const { return false; }
virtual bool is_box() const { return false; }
virtual bool is_table() const { return false; }
virtual bool is_table_row() const { return false; }