LibWeb: Store scroll and sticky frames state in single vector

This way we don't have to allocate separate vector with both scroll and
sticky frame that is used for display list player (scroll and sticky
frames share id pool), so player could access offset by frame id.

No behavior change.
This commit is contained in:
Aliaksandr Kalenik 2024-10-11 20:31:19 +02:00 committed by Alexander Kalenik
commit 6452bfb612
Notes: github-actions[bot] 2024-10-12 11:14:07 +00:00
7 changed files with 50 additions and 35 deletions

View file

@ -5582,17 +5582,7 @@ RefPtr<Painting::DisplayList> Document::record_display_list(PaintConfig config)
viewport_paintable.paint_all_phases(context);
display_list->set_device_pixels_per_css_pixel(page().client().device_pixels_per_css_pixel());
Vector<RefPtr<Painting::ScrollFrame>> scroll_state;
scroll_state.resize(viewport_paintable.scroll_state().scroll_frames().size() + viewport_paintable.scroll_state().sticky_frames().size());
for (auto const& scroll_frame : viewport_paintable.scroll_state().scroll_frames()) {
scroll_state[scroll_frame->id()] = scroll_frame;
}
for (auto const& scroll_frame : viewport_paintable.scroll_state().sticky_frames()) {
scroll_state[scroll_frame->id()] = scroll_frame;
}
display_list->set_scroll_state(move(scroll_state));
display_list->set_scroll_state(viewport_paintable.scroll_state());
m_needs_repaint = false;