mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 05:39:11 +00:00
LibWeb: Treat img width/height attributes as HTML dimension values
This commit is contained in:
parent
075bdfdef8
commit
c92d28b4ea
Notes:
sideshowbarker
2024-07-17 16:44:56 +09:00
Author: https://github.com/awesomekling
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