1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 22:25:07 +00:00

LibWeb: Allow anonymous table, table-row and table-cell layout nodes

This commit is contained in:
Andreas Kling 2021-01-07 16:37:51 +01:00
parent 75829c1b81
commit d3046a2649
7 changed files with 32 additions and 13 deletions

View file

@ -30,8 +30,13 @@
namespace Web::Layout {
TableCellBox::TableCellBox(DOM::Document& document, DOM::Element& element, NonnullRefPtr<CSS::StyleProperties> style)
: Layout::BlockBox(document, &element, move(style))
TableCellBox::TableCellBox(DOM::Document& document, DOM::Element* element, NonnullRefPtr<CSS::StyleProperties> style)
: Layout::BlockBox(document, element, move(style))
{
}
TableCellBox::TableCellBox(DOM::Document& document, DOM::Element* element, CSS::ComputedValues computed_values)
: Layout::BlockBox(document, element, move(computed_values))
{
}
@ -41,7 +46,8 @@ TableCellBox::~TableCellBox()
size_t TableCellBox::colspan() const
{
ASSERT(dom_node());
if (!dom_node())
return 0;
return downcast<DOM::Element>(*dom_node()).attribute(HTML::AttributeNames::colspan).to_uint().value_or(1);
}