1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:17:44 +00:00

LibWeb: Apply border-radius clip only if overflow hidden for both axis

Before this change `apply_clip_overflow_rect` might crash trying to
access `clip_rect` that does not have value because we currently
support calculation of visible rectangle when `overflow: hidden`
is applied for both axis.
This commit is contained in:
Aliaksandr Kalenik 2023-03-19 18:43:32 +03:00 committed by Andreas Kling
parent 633983d354
commit 7ddacef3b5
3 changed files with 17 additions and 1 deletions

View file

@ -363,7 +363,7 @@ void PaintableBox::apply_clip_overflow_rect(PaintContext& context, PaintPhase ph
clip_overflow();
}
if (overflow_y == CSS::Overflow::Hidden || overflow_x == CSS::Overflow::Hidden) {
if (overflow_y == CSS::Overflow::Hidden && overflow_x == CSS::Overflow::Hidden) {
auto border_radii_data = normalized_border_radii_data(ShrinkRadiiForBorders::Yes);
if (border_radii_data.has_any_radius()) {
auto corner_clipper = BorderRadiusCornerClipper::create(context, context.rounded_device_rect(*clip_rect), border_radii_data, CornerClip::Outside, BorderRadiusCornerClipper::UseCachedBitmap::No);