mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
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:
parent
d07643b122
commit
6452bfb612
Notes:
github-actions[bot]
2024-10-12 11:14:07 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 6452bfb612
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1731
7 changed files with 50 additions and 35 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue