From a59a839df8a91972c112acd317b934e4905867e8 Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Sat, 17 Aug 2024 18:57:17 +0200 Subject: [PATCH] LibWeb: Assign "own scroll frame" to a viewport --- .../Libraries/LibWeb/Painting/ViewportPaintable.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Userland/Libraries/LibWeb/Painting/ViewportPaintable.cpp b/Userland/Libraries/LibWeb/Painting/ViewportPaintable.cpp index 8931cfdfe2d..db14c8fe4fa 100644 --- a/Userland/Libraries/LibWeb/Painting/ViewportPaintable.cpp +++ b/Userland/Libraries/LibWeb/Painting/ViewportPaintable.cpp @@ -66,13 +66,9 @@ void ViewportPaintable::paint_all_phases(PaintContext& context) void ViewportPaintable::assign_scroll_frames() { - auto viewport_scroll_frame = adopt_ref(*new ScrollFrame()); - viewport_scroll_frame->id = 0; - scroll_state.set(this, move(viewport_scroll_frame)); - - int next_id = 1; - for_each_in_subtree_of_type([&](auto& paintable_box) { - if (paintable_box.has_scrollable_overflow()) { + int next_id = 0; + for_each_in_inclusive_subtree_of_type([&](auto& paintable_box) { + if (paintable_box.has_scrollable_overflow() || is(paintable_box)) { auto scroll_frame = adopt_ref(*new ScrollFrame()); scroll_frame->id = next_id++; paintable_box.set_own_scroll_frame(scroll_frame);