LibWeb: Support cellpadding attribute on table elements

This commit is contained in:
implicitfield 2023-11-19 22:19:32 +04:00 committed by Andreas Kling
commit 00c1da8cbc
Notes: sideshowbarker 2024-07-16 21:51:02 +09:00
5 changed files with 75 additions and 0 deletions

View file

@ -85,7 +85,16 @@ void HTMLTableCellElement::apply_presentational_hints(CSS::StyleProperties& styl
}
});
auto const& table_element = table_containing_cell(*this);
if (auto padding = table_element.padding()) {
style.set_property(CSS::PropertyID::PaddingTop, CSS::LengthStyleValue::create(CSS::Length::make_px(padding)));
style.set_property(CSS::PropertyID::PaddingBottom, CSS::LengthStyleValue::create(CSS::Length::make_px(padding)));
style.set_property(CSS::PropertyID::PaddingLeft, CSS::LengthStyleValue::create(CSS::Length::make_px(padding)));
style.set_property(CSS::PropertyID::PaddingRight, CSS::LengthStyleValue::create(CSS::Length::make_px(padding)));
}
auto border = table_element.border();
if (!border)
return;
auto apply_border_style = [&](CSS::PropertyID style_property, CSS::PropertyID width_property, CSS::PropertyID color_property) {