mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 16:57:46 +00:00
LibWeb: Account for all clipped border radii in containing block chain
With this change, instead of applying only the border-radius clipping from the closest containing block with hidden overflow, we now collect all boxes within the containing block chain and apply the clipping from all of them.
This commit is contained in:
parent
1ae416fa94
commit
d4932196cc
9 changed files with 133 additions and 32 deletions
|
@ -31,6 +31,12 @@ struct BorderRadiusData {
|
|||
if (vertical_radius != 0)
|
||||
vertical_radius = max(CSSPixels(0), vertical_radius - vertical);
|
||||
}
|
||||
|
||||
inline void union_max_radii(BorderRadiusData const& other)
|
||||
{
|
||||
horizontal_radius = max(horizontal_radius, other.horizontal_radius);
|
||||
vertical_radius = max(vertical_radius, other.vertical_radius);
|
||||
}
|
||||
};
|
||||
|
||||
using CornerRadius = Gfx::AntiAliasingPainter::CornerRadius;
|
||||
|
@ -58,6 +64,14 @@ struct BorderRadiiData {
|
|||
return top_left || top_right || bottom_right || bottom_left;
|
||||
}
|
||||
|
||||
inline void union_max_radii(BorderRadiiData const& other)
|
||||
{
|
||||
top_left.union_max_radii(other.top_left);
|
||||
top_right.union_max_radii(other.top_right);
|
||||
bottom_right.union_max_radii(other.bottom_right);
|
||||
bottom_left.union_max_radii(other.bottom_left);
|
||||
}
|
||||
|
||||
inline void shrink(CSSPixels top, CSSPixels right, CSSPixels bottom, CSSPixels left)
|
||||
{
|
||||
top_left.shrink(left, top);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue