1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 19:14:58 +00:00

LibWeb: Turn <td align> into CSS text-align

Note that align=center and align=middle both behave like the <center>
element, and not like text-align:center.
This commit is contained in:
Andreas Kling 2020-06-13 15:16:56 +02:00
parent 07ccaa1934
commit 7e8945601a
4 changed files with 15 additions and 0 deletions

View file

@ -44,6 +44,14 @@ void HTMLTableCellElement::apply_presentational_hints(StyleProperties& style) co
auto color = Color::from_string(value);
if (color.has_value())
style.set_property(CSS::PropertyID::BackgroundColor, ColorStyleValue::create(color.value()));
return;
}
if (name == HTML::AttributeNames::align) {
if (value.equals_ignoring_case("center") || value.equals_ignoring_case("middle"))
style.set_property(CSS::PropertyID::TextAlign, StringView("-libweb-center"));
else
style.set_property(CSS::PropertyID::TextAlign, value.view());
return;
}
});
}