diff --git a/Libraries/LibWeb/Layout/LayoutTableCell.cpp b/Libraries/LibWeb/Layout/LayoutTableCell.cpp index 7ff80f38b5..d4cab6a2bb 100644 --- a/Libraries/LibWeb/Layout/LayoutTableCell.cpp +++ b/Libraries/LibWeb/Layout/LayoutTableCell.cpp @@ -38,4 +38,10 @@ LayoutTableCell::~LayoutTableCell() { } +size_t LayoutTableCell::colspan() const +{ + ASSERT(node()); + return to(*node()).attribute(HTML::AttributeNames::colspan).to_uint().value_or(1); +} + } diff --git a/Libraries/LibWeb/Layout/LayoutTableCell.h b/Libraries/LibWeb/Layout/LayoutTableCell.h index 456ec8a08d..ed9ba3fb03 100644 --- a/Libraries/LibWeb/Layout/LayoutTableCell.h +++ b/Libraries/LibWeb/Layout/LayoutTableCell.h @@ -38,6 +38,8 @@ public: LayoutTableCell* next_cell() { return next_sibling_of_type(); } const LayoutTableCell* next_cell() const { return next_sibling_of_type(); } + size_t colspan() const; + private: virtual bool is_table_cell() const override { return true; } virtual const char* class_name() const override { return "LayoutTableCell"; }