mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 03:55:24 +00:00
LibHTML: Add is<T> helpers for the table-related LayoutNode subclasses
This commit is contained in:
parent
5e29238a49
commit
b4c2621ed7
Notes:
sideshowbarker
2024-07-19 11:39:28 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/b4c2621ed70
4 changed files with 24 additions and 0 deletions
|
@ -50,6 +50,9 @@ public:
|
|||
virtual bool is_block() const { return false; }
|
||||
virtual bool is_replaced() 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; }
|
||||
virtual bool is_table_cell() const { return false; }
|
||||
bool has_style() const { return m_has_style; }
|
||||
|
||||
bool is_inline() const { return m_inline; }
|
||||
|
|
|
@ -10,5 +10,12 @@ public:
|
|||
virtual void layout() override;
|
||||
|
||||
private:
|
||||
virtual bool is_table() const override { return true; }
|
||||
virtual const char* class_name() const override { return "LayoutTable"; }
|
||||
};
|
||||
|
||||
template<>
|
||||
inline bool is<LayoutTable>(const LayoutNode& node)
|
||||
{
|
||||
return node.is_table();
|
||||
}
|
||||
|
|
|
@ -8,5 +8,12 @@ public:
|
|||
virtual ~LayoutTableCell() override;
|
||||
|
||||
private:
|
||||
virtual bool is_table_cell() const override { return true; }
|
||||
virtual const char* class_name() const override { return "LayoutTableCell"; }
|
||||
};
|
||||
|
||||
template<>
|
||||
inline bool is<LayoutTableCell>(const LayoutNode& node)
|
||||
{
|
||||
return node.is_table_cell();
|
||||
}
|
||||
|
|
|
@ -10,5 +10,12 @@ public:
|
|||
virtual void layout() override;
|
||||
|
||||
private:
|
||||
virtual bool is_table_row() const override { return true; }
|
||||
virtual const char* class_name() const override { return "LayoutTableRow"; }
|
||||
};
|
||||
|
||||
template<>
|
||||
inline bool is<LayoutTableRow>(const LayoutNode& node)
|
||||
{
|
||||
return node.is_table_row();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue