summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-03-26 14:20:05 +0100
committerAndreas Kling <kling@serenityos.org>2022-03-26 17:31:01 +0100
commit7df62c64b7116842e43f2c8fcd1a7b0e71f456b7 (patch)
tree35076dc8261625b9aec869f2231e951c1bd04bd8 /Userland
parente96b3315ad80c8ab7e6bb937ce20e146a62c18ae (diff)
downloadserenity-7df62c64b7116842e43f2c8fcd1a7b0e71f456b7.zip
LibWeb: Treat width/height on <svg> element as HTML dimension values
This might not be entirely correct, but neither was using the completely ad-hoc parse_html_length(), and this is the last user of that API so let's move off of it.
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibWeb/SVG/SVGSVGElement.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/SVG/SVGSVGElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGSVGElement.cpp
index 96d6178ce3..d0264c5ff4 100644
--- a/Userland/Libraries/LibWeb/SVG/SVGSVGElement.cpp
+++ b/Userland/Libraries/LibWeb/SVG/SVGSVGElement.cpp
@@ -28,14 +28,14 @@ RefPtr<Layout::Node> SVGSVGElement::create_layout_node(NonnullRefPtr<CSS::StyleP
void SVGSVGElement::apply_presentational_hints(CSS::StyleProperties& style) const
{
// Width defaults to 100%
- if (auto width_value = parse_html_length(document(), attribute("width"))) {
+ if (auto width_value = parse_dimension_value(attribute(SVG::AttributeNames::width))) {
style.set_property(CSS::PropertyID::Width, width_value.release_nonnull());
} else {
style.set_property(CSS::PropertyID::Width, CSS::PercentageStyleValue::create(CSS::Percentage { 100 }));
}
// Height defaults to 100%
- if (auto height_value = parse_html_length(document(), attribute("height"))) {
+ if (auto height_value = parse_dimension_value(attribute(SVG::AttributeNames::width))) {
style.set_property(CSS::PropertyID::Height, height_value.release_nonnull());
} else {
style.set_property(CSS::PropertyID::Height, CSS::PercentageStyleValue::create(CSS::Percentage { 100 }));