1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-15 09:34:59 +00:00

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
parent 3d1fbcb26b
commit 00c1da8cbc
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) {