diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-12-18 20:52:36 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-12-18 20:52:36 +0100 |
commit | 85ac9705bac2e1a494884874ff343ceabe88d32a (patch) | |
tree | fca7a5355e7c91408fcc8dc785def3986e26c4f4 /Libraries | |
parent | 7cc4b90b169c8134bc1f806f7102370edc36ac5f (diff) | |
download | serenity-85ac9705bac2e1a494884874ff343ceabe88d32a.zip |
LibHTML: Add LayoutNode::is_image() and is<LayoutImage> helper
Diffstat (limited to 'Libraries')
-rw-r--r-- | Libraries/LibHTML/Layout/LayoutImage.h | 7 | ||||
-rw-r--r-- | Libraries/LibHTML/Layout/LayoutNode.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/Libraries/LibHTML/Layout/LayoutImage.h b/Libraries/LibHTML/Layout/LayoutImage.h index 344797769c..5fcf62ca55 100644 --- a/Libraries/LibHTML/Layout/LayoutImage.h +++ b/Libraries/LibHTML/Layout/LayoutImage.h @@ -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(); +} diff --git a/Libraries/LibHTML/Layout/LayoutNode.h b/Libraries/LibHTML/Layout/LayoutNode.h index 7f80b73e91..35591ae77e 100644 --- a/Libraries/LibHTML/Layout/LayoutNode.h +++ b/Libraries/LibHTML/Layout/LayoutNode.h @@ -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; } |