1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//! Scroll offsets as painted (`P7-SCROLL-REPAINT-1`).
//!
//! A scroll offset change repaints on the web whoever made it (CSSOM
//! View §4.1 "perform a scroll" updates the rendering; HTML §8.1.7.3
//! "update the rendering" paints it). Scroll offsets are not DOM
//! mutations, so the dirty tracker never sees them: the
//! [`App`](crate::runtime::App) compares each element's offsets with
//! the ones its last frame painted instead. That covers every writer
//! alike — the programmatic scroll API from a listener, a timer or an
//! `AppHandle::inject` closure, a smooth-scroll step, and a consumer
//! writing `TuiExt::scroll_x` / `scroll_y` directly — and leaves an
//! offset written back to its painted value with nothing to draw.
//!
//! Only elements in the tree count: a detached subtree is not painted,
//! and re-inserting it is a tree mutation that repaints anyway.
//!
//! Both are whole-tree walks, so the App runs them only when needed
//! (`P7G-IDLE-WALKS-1`): [`moved_since_paint`] after code ran since the
//! last frame (an event, a timer, an injected closure, `dom_mut()` —
//! nothing else writes offsets between frames), [`note_painted`] after a
//! frame that laid out (only layout's clamp and the caret reveal move
//! offsets inside a frame).
use NodeId;
use crateTuiDom;
use crateTuiNodeExt;
/// Whether some connected element's scroll offset differs from the one
/// the last painted frame recorded ([`note_painted`]).
pub
/// Record every connected element's scroll offsets as painted. The App
/// calls this once a frame is drawn — after layout's own clamp and the
/// caret reveal, so the recorded offsets are the ones on screen.
pub