1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 10:57:35 +00:00

LibWeb: Remove redundant Length::resolved() calls

Now that calc() is also resolved in to_px(), code in the form
`foo.resolved(bar).to_px(bar)` can be simplified to `foo.to_px(bar)`.
This commit is contained in:
Sam Atkins 2022-02-18 16:27:28 +00:00 committed by Andreas Kling
parent 6df3f9920d
commit b715943035
9 changed files with 60 additions and 72 deletions

View file

@ -17,10 +17,10 @@ BorderRadiusData normalized_border_radius_data(Layout::Node const& node, Gfx::Fl
// Spec just says "Refer to corresponding dimension of the border box."
// For now, all relative values are relative to the width.
auto width_length = CSS::Length::make_px(rect.width());
auto bottom_left_radius_px = bottom_left_radius.resolved(node, width_length).resolved(node).to_px(node);
auto bottom_right_radius_px = bottom_right_radius.resolved(node, width_length).resolved(node).to_px(node);
auto top_left_radius_px = top_left_radius.resolved(node, width_length).resolved(node).to_px(node);
auto top_right_radius_px = top_right_radius.resolved(node, width_length).resolved(node).to_px(node);
auto bottom_left_radius_px = bottom_left_radius.resolved(node, width_length).to_px(node);
auto bottom_right_radius_px = bottom_right_radius.resolved(node, width_length).to_px(node);
auto top_left_radius_px = top_left_radius.resolved(node, width_length).to_px(node);
auto top_right_radius_px = top_right_radius.resolved(node, width_length).to_px(node);
// Scale overlapping curves according to https://www.w3.org/TR/css-backgrounds-3/#corner-overlap
auto f = 1.0f;