summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/Painting
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibWeb/Painting')
-rw-r--r--Userland/Libraries/LibWeb/Painting/BackgroundPainting.cpp12
-rw-r--r--Userland/Libraries/LibWeb/Painting/BorderPainting.cpp8
2 files changed, 10 insertions, 10 deletions
diff --git a/Userland/Libraries/LibWeb/Painting/BackgroundPainting.cpp b/Userland/Libraries/LibWeb/Painting/BackgroundPainting.cpp
index 2c928e698a..1e6c01291a 100644
--- a/Userland/Libraries/LibWeb/Painting/BackgroundPainting.cpp
+++ b/Userland/Libraries/LibWeb/Painting/BackgroundPainting.cpp
@@ -88,20 +88,20 @@ void paint_background(PaintContext& context, Layout::NodeWithStyleAndBoxModelMet
width = image.width();
height = image.height();
} else if (x_is_auto) {
- height = layer.size_y.resolved(CSS::Length::make_px(background_positioning_area.height()))
+ height = layer.size_y.resolved(layout_node, CSS::Length::make_px(background_positioning_area.height()))
.resolved_or_zero(layout_node)
.to_px(layout_node);
width = roundf(image.width() * ((float)height / (float)image.height()));
} else if (y_is_auto) {
- width = layer.size_x.resolved(CSS::Length::make_px(background_positioning_area.width()))
+ width = layer.size_x.resolved(layout_node, CSS::Length::make_px(background_positioning_area.width()))
.resolved_or_zero(layout_node)
.to_px(layout_node);
height = roundf(image.height() * ((float)width / (float)image.width()));
} else {
- width = layer.size_x.resolved(CSS::Length::make_px(background_positioning_area.width()))
+ width = layer.size_x.resolved(layout_node, CSS::Length::make_px(background_positioning_area.width()))
.resolved_or_zero(layout_node)
.to_px(layout_node);
- height = layer.size_y.resolved(CSS::Length::make_px(background_positioning_area.height()))
+ height = layer.size_y.resolved(layout_node, CSS::Length::make_px(background_positioning_area.height()))
.resolved_or_zero(layout_node)
.to_px(layout_node);
}
@@ -143,7 +143,7 @@ void paint_background(PaintContext& context, Layout::NodeWithStyleAndBoxModelMet
int space_y = background_positioning_area.height() - image_rect.height();
// Position
- int offset_x = layer.position_offset_x.resolved(CSS::Length::make_px(space_x))
+ int offset_x = layer.position_offset_x.resolved(layout_node, CSS::Length::make_px(space_x))
.resolved_or_zero(layout_node)
.to_px(layout_node);
if (layer.position_edge_x == CSS::PositionEdge::Right) {
@@ -152,7 +152,7 @@ void paint_background(PaintContext& context, Layout::NodeWithStyleAndBoxModelMet
image_rect.set_left(background_positioning_area.left() + offset_x);
}
- int offset_y = layer.position_offset_y.resolved(CSS::Length::make_px(space_y))
+ int offset_y = layer.position_offset_y.resolved(layout_node, CSS::Length::make_px(space_y))
.resolved_or_zero(layout_node)
.to_px(layout_node);
if (layer.position_edge_y == CSS::PositionEdge::Bottom) {
diff --git a/Userland/Libraries/LibWeb/Painting/BorderPainting.cpp b/Userland/Libraries/LibWeb/Painting/BorderPainting.cpp
index d69281649e..deafecc964 100644
--- a/Userland/Libraries/LibWeb/Painting/BorderPainting.cpp
+++ b/Userland/Libraries/LibWeb/Painting/BorderPainting.cpp
@@ -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(width_length).resolved_or_zero(node).to_px(node);
- auto bottom_right_radius_px = bottom_right_radius.resolved(width_length).resolved_or_zero(node).to_px(node);
- auto top_left_radius_px = top_left_radius.resolved(width_length).resolved_or_zero(node).to_px(node);
- auto top_right_radius_px = top_right_radius.resolved(width_length).resolved_or_zero(node).to_px(node);
+ auto bottom_left_radius_px = bottom_left_radius.resolved(node, width_length).resolved_or_zero(node).to_px(node);
+ auto bottom_right_radius_px = bottom_right_radius.resolved(node, width_length).resolved_or_zero(node).to_px(node);
+ auto top_left_radius_px = top_left_radius.resolved(node, width_length).resolved_or_zero(node).to_px(node);
+ auto top_right_radius_px = top_right_radius.resolved(node, width_length).resolved_or_zero(node).to_px(node);
// Scale overlapping curves according to https://www.w3.org/TR/css-backgrounds-3/#corner-overlap
auto f = 1.0f;