From 2ceb14357109a9062d0de155191003b91bd8c723 Mon Sep 17 00:00:00 2001 From: MacDue Date: Mon, 4 Jul 2022 20:47:23 +0100 Subject: [PATCH] LibWeb: Use padding box for clipping overflow The padding box should be used otherwise the content can overflow on to the boxes borders. --- Userland/Libraries/LibWeb/Painting/PaintableBox.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp b/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp index b4e0bfc4ba..36a0c8f1dc 100644 --- a/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp +++ b/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp @@ -245,9 +245,10 @@ BorderRadiiData PaintableBox::normalized_border_radii_data() const void PaintableBox::before_children_paint(PaintContext& context, PaintPhase) const { // FIXME: Support more overflow variations. + auto clip_rect = absolute_padding_box_rect().to_rounded(); if (computed_values().overflow_x() == CSS::Overflow::Hidden && computed_values().overflow_y() == CSS::Overflow::Hidden) { context.painter().save(); - context.painter().add_clip_rect(enclosing_int_rect(absolute_border_box_rect())); + context.painter().add_clip_rect(clip_rect); } }