From fd3411c868302335cfd54302bdbfd276bfbac4f0 Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Wed, 8 Nov 2023 15:04:58 +0100 Subject: [PATCH] LibWeb: Ignore document's box during overflow clip rect calculation Reduction of bug: ```html
``` Fixes https://github.com/SerenityOS/serenity/issues/21690 and painting on many other websites (null.com, servo.org). --- Userland/Libraries/LibWeb/Painting/PaintableBox.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp b/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp index 4087a79a0d6..462e8149bc9 100644 --- a/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp +++ b/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp @@ -406,6 +406,10 @@ BorderRadiiData PaintableBox::normalized_border_radii_data(ShrinkRadiiForBorders Optional PaintableBox::calculate_overflow_clipped_rect() const { + if (layout_node().is_viewport()) { + return {}; + } + if (!m_clip_rect.has_value()) { // NOTE: stacking context should not be crossed while aggregating rectangle to // clip `overflow: hidden` because intersecting rectangles with different