mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-03 01:38:52 +00:00
LibWeb: Support align
attribute on table
elements
This commit is contained in:
parent
7a766bdb83
commit
a54e62bea0
Notes:
sideshowbarker
2024-07-17 18:13:59 +09:00
Author: https://github.com/implicitfield
Commit: a54e62bea0
Pull-request: https://github.com/SerenityOS/serenity/pull/22000
Reviewed-by: https://github.com/kalenikaliaksandr ✅
5 changed files with 70 additions and 0 deletions
|
@ -61,6 +61,15 @@ void HTMLTableElement::apply_presentational_hints(CSS::StyleProperties& style) c
|
|||
style.set_property(CSS::PropertyID::Height, parsed_value.release_nonnull());
|
||||
return;
|
||||
}
|
||||
if (name == HTML::AttributeNames::align) {
|
||||
if (value.equals_ignoring_ascii_case("center"sv)) {
|
||||
style.set_property(CSS::PropertyID::MarginLeft, CSS::IdentifierStyleValue::create(CSS::ValueID::Auto));
|
||||
style.set_property(CSS::PropertyID::MarginRight, CSS::IdentifierStyleValue::create(CSS::ValueID::Auto));
|
||||
} else if (auto parsed_value = parse_css_value(CSS::Parser::ParsingContext { document() }, value.view(), CSS::PropertyID::Float)) {
|
||||
style.set_property(CSS::PropertyID::Float, parsed_value.release_nonnull());
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (name == HTML::AttributeNames::bgcolor) {
|
||||
// https://html.spec.whatwg.org/multipage/rendering.html#tables-2:rules-for-parsing-a-legacy-colour-value
|
||||
auto color = parse_legacy_color_value(value);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue