mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-27 19:59:17 +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:
@@ -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;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user