mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 10:27:35 +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:
parent
633983d354
commit
7ddacef3b5
3 changed files with 17 additions and 1 deletions
|
@ -0,0 +1,6 @@
|
|||
Viewport <#document> at (0,0) content-size 800x600 children: not-inline
|
||||
BlockContainer <html> at (0,0) content-size 800x118 children: not-inline
|
||||
BlockContainer <body> at (8,8) content-size 784x102 children: not-inline
|
||||
BlockContainer <div.box> at (9,9) content-size 100x100 positioned children: not-inline
|
||||
BlockContainer <(anonymous)> at (8,110) content-size 784x0 children: inline
|
||||
TextNode <#text>
|
|
@ -0,0 +1,10 @@
|
|||
<style>
|
||||
.box {
|
||||
border: 1px solid black;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
border-radius: 9999px;
|
||||
overflow-x: hidden;
|
||||
position: relative;
|
||||
}
|
||||
</style><div class="box"></div>
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue