LibWeb: Use LibwebLeft and LibwebRight to align table cells

This commit is contained in:
implicitfield 2023-11-19 14:17:54 +04:00 committed by Andreas Kling
parent ccea69ad40
commit 5df52a5082
Notes: sideshowbarker 2024-07-16 19:42:24 +09:00
3 changed files with 42 additions and 0 deletions

View file

@ -60,6 +60,10 @@ void HTMLTableCellElement::apply_presentational_hints(CSS::StyleProperties& styl
if (name == HTML::AttributeNames::align) {
if (value.equals_ignoring_ascii_case("center"sv) || value.equals_ignoring_ascii_case("middle"sv)) {
style.set_property(CSS::PropertyID::TextAlign, CSS::IdentifierStyleValue::create(CSS::ValueID::LibwebCenter));
} else if (value.equals_ignoring_ascii_case("left"sv)) {
style.set_property(CSS::PropertyID::TextAlign, CSS::IdentifierStyleValue::create(CSS::ValueID::LibwebLeft));
} else if (value.equals_ignoring_ascii_case("right"sv)) {
style.set_property(CSS::PropertyID::TextAlign, CSS::IdentifierStyleValue::create(CSS::ValueID::LibwebRight));
} else {
if (auto parsed_value = parse_css_value(CSS::Parser::ParsingContext { document() }, value.view(), CSS::PropertyID::TextAlign))
style.set_property(CSS::PropertyID::TextAlign, parsed_value.release_nonnull());