Fix corner clipping typos in layout-2020

inner_radii() had a minus sign that shouldn't be there.

And padding_edge_clip() and content_edge_clip() clearly need to to use
the padding_rect() and content_rect() instead of border_rect.

Tests:
  - css/css-backgrounds/background-clip-padding-box-with-border-radius.html
  - css/css-backgrounds/background-rounded-image-clip.html
This commit is contained in:
Oriol Brufau 2023-04-29 07:24:13 +02:00
parent 7eca93bb7a
commit 88b9ecea3c
3 changed files with 3 additions and 7 deletions

View file

@ -374,7 +374,7 @@ impl<'a> BuilderForBoxFragment<'a> {
.to_physical(self.fragment.style.writing_mode)
.to_webrender(),
),
self.border_rect,
*self.padding_rect(),
builder,
)
})
@ -389,7 +389,7 @@ impl<'a> BuilderForBoxFragment<'a> {
.to_physical(self.fragment.style.writing_mode)
.to_webrender(),
),
self.border_rect,
*self.content_rect(),
builder,
)
})
@ -662,7 +662,7 @@ fn image_rendering(ir: style::computed_values::image_rendering::T) -> wr::ImageR
/// Radii for the padding edge or content edge
fn inner_radii(mut radii: wr::BorderRadius, offsets: units::LayoutSideOffsets) -> wr::BorderRadius {
radii.top_left.width -= -offsets.left;
radii.top_left.width -= offsets.left;
radii.bottom_left.width -= offsets.left;
radii.top_right.width -= offsets.right;

View file

@ -1,2 +0,0 @@
[background-clip-padding-box-with-border-radius.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[background-rounded-image-clip.html]
expected: FAIL