1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 05:47:34 +00:00

LibWeb: Add Layout::Node::is_table() and make is<TableBox>() fast

This commit is contained in:
Andreas Kling 2023-01-23 17:24:34 +01:00
parent 3dd006f719
commit aa19c4a340
2 changed files with 7 additions and 0 deletions

View file

@ -92,6 +92,7 @@ public:
virtual bool is_replaced_box() const { return false; }
virtual bool is_list_item_marker_box() const { return false; }
virtual bool is_table_wrapper() const { return false; }
virtual bool is_table() const { return false; }
template<typename T>
bool fast_is() const = delete;

View file

@ -24,6 +24,12 @@ public:
return CSS::Display::from_short(CSS::Display::Short::InlineTable);
return CSS::Display::from_short(CSS::Display::Short::Table);
}
private:
virtual bool is_table() const override { return true; }
};
template<>
inline bool Node::fast_is<TableBox>() const { return is_table(); }
}