summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-03-26 11:39:33 +0100
committerAndreas Kling <kling@serenityos.org>2022-03-26 17:31:01 +0100
commitc92d28b4ea0d4aea4520efc817c92c1cadc31774 (patch)
tree4345058ccf570527bd08bdfc14aef44fa33f62c3 /Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp
parent075bdfdef86d7178ba0ffe8b9974184a10d888fd (diff)
downloadserenity-c92d28b4ea0d4aea4520efc817c92c1cadc31774.zip
LibWeb: Treat img width/height attributes as HTML dimension values
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp')
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp
index 7014094cf8..2e0ecfa1cd 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp
@@ -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());
- }
}
});
}