mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
LibWeb: Assign "own scroll frame" to a viewport
This commit is contained in:
parent
4833ba06ea
commit
a59a839df8
Notes:
github-actions[bot]
2024-08-19 16:58:32 +00:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/LadybirdBrowser/ladybird/commit/a59a839df8a Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1106
1 changed files with 3 additions and 7 deletions
|
@ -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<PaintableBox>([&](auto& paintable_box) {
|
||||
if (paintable_box.has_scrollable_overflow()) {
|
||||
int next_id = 0;
|
||||
for_each_in_inclusive_subtree_of_type<PaintableBox>([&](auto& paintable_box) {
|
||||
if (paintable_box.has_scrollable_overflow() || is<ViewportPaintable>(paintable_box)) {
|
||||
auto scroll_frame = adopt_ref(*new ScrollFrame());
|
||||
scroll_frame->id = next_id++;
|
||||
paintable_box.set_own_scroll_frame(scroll_frame);
|
||||
|
|
Loading…
Reference in a new issue