mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-21 18:00:16 +00:00
LibWeb: Introduce a new class responsible for scroll state
It's good to have a wrapper for scroll and sticky state instead of directly mutating vectors with frames. No behavior change.
This commit is contained in:
parent
34261e5490
commit
d07643b122
Notes:
github-actions[bot]
2024-10-12 11:14:12 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: d07643b122
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1731
7 changed files with 86 additions and 29 deletions
|
@ -5584,12 +5584,12 @@ RefPtr<Painting::DisplayList> Document::record_display_list(PaintConfig config)
|
|||
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.size() + viewport_paintable.sticky_state.size());
|
||||
for (auto& [_, scrollable_frame] : viewport_paintable.scroll_state) {
|
||||
scroll_state[scrollable_frame->id()] = scrollable_frame;
|
||||
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& [_, scrollable_frame] : viewport_paintable.sticky_state) {
|
||||
scroll_state[scrollable_frame->id()] = scrollable_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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue