mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-28 02:27:19 +02:00
LibWeb: Support the hspace and vspace attributes on img elements
These map HTML dimension values to CSS margin values.
This commit is contained in:
Notes:
sideshowbarker
2024-07-17 16:44:53 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/0e806f58fe
@@ -55,6 +55,16 @@ void HTMLImageElement::apply_presentational_hints(CSS::StyleProperties& style) c
|
||||
} else if (name == HTML::AttributeNames::height) {
|
||||
if (auto parsed_value = parse_dimension_value(value))
|
||||
style.set_property(CSS::PropertyID::Height, parsed_value.release_nonnull());
|
||||
} else if (name == HTML::AttributeNames::hspace) {
|
||||
if (auto parsed_value = parse_dimension_value(value)) {
|
||||
style.set_property(CSS::PropertyID::MarginLeft, *parsed_value);
|
||||
style.set_property(CSS::PropertyID::MarginRight, *parsed_value);
|
||||
}
|
||||
} else if (name == HTML::AttributeNames::vspace) {
|
||||
if (auto parsed_value = parse_dimension_value(value)) {
|
||||
style.set_property(CSS::PropertyID::MarginTop, *parsed_value);
|
||||
style.set_property(CSS::PropertyID::MarginBottom, *parsed_value);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user