LibWeb: Convert BorderData::width to CSSPixels

The `clip_shrink` optimization in `paint_background()` now also
correctly uses DevicePixels, instead of reducing a DevicePixel rect by
a CSSPixels amount.
This commit is contained in:
Sam Atkins 2023-07-30 15:54:57 +01:00 committed by Sam Atkins
commit 5ee1b7db7c
Notes: sideshowbarker 2024-07-16 23:38:54 +09:00
7 changed files with 20 additions and 20 deletions

View file

@ -224,14 +224,14 @@ void LayoutState::UsedValues::set_node(NodeWithStyleAndBoxModelMetrics& node, Us
CSSPixels border_and_padding;
if (width) {
border_and_padding = CSSPixels(computed_values.border_left().width)
border_and_padding = computed_values.border_left().width
+ computed_values.padding().left().to_px(*m_node, containing_block_used_values->content_width())
+ CSSPixels(computed_values.border_right().width)
+ computed_values.border_right().width
+ computed_values.padding().right().to_px(*m_node, containing_block_used_values->content_width());
} else {
border_and_padding = CSSPixels(computed_values.border_top().width)
border_and_padding = computed_values.border_top().width
+ computed_values.padding().top().to_px(*m_node, containing_block_used_values->content_width())
+ CSSPixels(computed_values.border_bottom().width)
+ computed_values.border_bottom().width
+ computed_values.padding().bottom().to_px(*m_node, containing_block_used_values->content_width());
}