mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 20:15:00 +00:00
LibWeb: Treat img width/height attributes as HTML dimension values
This commit is contained in:
parent
075bdfdef8
commit
c92d28b4ea
1 changed files with 2 additions and 4 deletions
|
@ -50,13 +50,11 @@ void HTMLImageElement::apply_presentational_hints(CSS::StyleProperties& style) c
|
|||
{
|
||||
for_each_attribute([&](auto& name, auto& value) {
|
||||
if (name == HTML::AttributeNames::width) {
|
||||
if (auto parsed_value = parse_html_length(document(), value)) {
|
||||
if (auto parsed_value = parse_dimension_value(value))
|
||||
style.set_property(CSS::PropertyID::Width, parsed_value.release_nonnull());
|
||||
}
|
||||
} else if (name == HTML::AttributeNames::height) {
|
||||
if (auto parsed_value = parse_html_length(document(), value)) {
|
||||
if (auto parsed_value = parse_dimension_value(value))
|
||||
style.set_property(CSS::PropertyID::Height, parsed_value.release_nonnull());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue