mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 03:55:24 +00:00
LibWeb: Add LayoutTableCell::colspan()
A convenient function for looking up a cell's colspan attribute.
This commit is contained in:
parent
196a3986d6
commit
0061a82be3
Notes:
sideshowbarker
2024-07-19 05:41:30 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/0061a82be38
2 changed files with 8 additions and 0 deletions
|
@ -38,4 +38,10 @@ LayoutTableCell::~LayoutTableCell()
|
|||
{
|
||||
}
|
||||
|
||||
size_t LayoutTableCell::colspan() const
|
||||
{
|
||||
ASSERT(node());
|
||||
return to<Element>(*node()).attribute(HTML::AttributeNames::colspan).to_uint().value_or(1);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -38,6 +38,8 @@ public:
|
|||
LayoutTableCell* next_cell() { return next_sibling_of_type<LayoutTableCell>(); }
|
||||
const LayoutTableCell* next_cell() const { return next_sibling_of_type<LayoutTableCell>(); }
|
||||
|
||||
size_t colspan() const;
|
||||
|
||||
private:
|
||||
virtual bool is_table_cell() const override { return true; }
|
||||
virtual const char* class_name() const override { return "LayoutTableCell"; }
|
||||
|
|
Loading…
Add table
Reference in a new issue