summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/SVG
diff options
context:
space:
mode:
authorSam Atkins <atkinssj@serenityos.org>2022-01-27 14:38:59 +0000
committerAndreas Kling <kling@serenityos.org>2022-02-04 13:52:02 +0100
commitce0de4b2b4cddf199011e4edf311580a117cc5cd (patch)
treeebfc1b3b10e285332ad5a1df283259e9ad530185 /Userland/Libraries/LibWeb/SVG
parentf0fb84dfcb1ba2707766e6d82f24ac6e1c9acd2f (diff)
downloadserenity-ce0de4b2b4cddf199011e4edf311580a117cc5cd.zip
LibWeb: Allow LengthPercentage to hold a calculated value
Most of the time, we cannot resolve a `calc()` expression until we go to use it. Since any `<length-percentage>` can legally be a `calc ()`, let's store it in `LengthPercentage` rather than make every single user care about this distinction.
Diffstat (limited to 'Userland/Libraries/LibWeb/SVG')
-rw-r--r--Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.cpp
index 73db727cf7..5d0322110a 100644
--- a/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.cpp
+++ b/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.cpp
@@ -62,7 +62,7 @@ Optional<float> SVGGraphicsElement::stroke_width() const
// Resolved relative to the "Scaled viewport size": https://www.w3.org/TR/2017/WD-fill-stroke-3-20170413/#scaled-viewport-size
// FIXME: This isn't right, but it's something.
auto scaled_viewport_size = CSS::Length::make_px((client_width() + client_height()) * 0.5f);
- return width->resolved(scaled_viewport_size).to_px(*layout_node());
+ return width->resolved(*layout_node(), scaled_viewport_size).to_px(*layout_node());
}
return {};
}