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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/// The DOM attribute name used to store the unique euv identifier on an element.
///
/// This attribute is set on every element that registers an event listener
/// so the framework can look up the element's identity across re-renders.
pub const DATA_EUV_ID: &str = "data-euv-id";
/// The maximum number of dispatch iterations allowed in `dispatch_updates`.
///
/// Prevents infinite loops when callbacks continuously re-queue themselves.
/// After this many passes, the dispatch loop breaks even if dirty entries remain.
pub const MAX_ITERATIONS: usize = 3;
/// Event names that do not bubble up to `window`.
///
/// These events must be attached directly on the target element
/// instead of using global event delegation on `window`.
///
/// Sources:
/// - W3C DOM Level 3 Events: `abort`, `blur`, `error`, `focus`, `load`, `resize`, `unload`
/// - Mouse: `mouseenter`, `mouseleave`
/// - Media (all non-bubbling): `loadstart`, `progress`, `loadend`, `emptied`, `stalled`,
/// `suspend`, `canplay`, `canplaythrough`, `loadedmetadata`, `waiting`, `playing`,
/// `pause`, `seeking`, `seeked`, `timeupdate`, `volumechange`, `durationchange`,
/// `ratechange`, `ended`
/// - UI: `beforeunload`, `scroll`, `resize`, `select`
/// - CSS: `transitionend`, `animationend`, `animationiteration`, `animationstart`
pub const NON_BUBBLING_EVENTS: = ;
/// Event names that fire at very high frequency (mousemove, touchmove,
/// pointermove, scroll, wheel, dragover). For these events the
/// `dispatch_delegated_event` ancestor walk is capped at
/// `MAX_ANCESTOR_DEPTH_FOR_HIGH_FREQ` levels instead of walking all the
/// way to `<html>`, because:
///
/// - mousemove/touchmove handlers almost always live on the same element
/// they fire on, or 1-2 ancestors above (e.g. a draggable card inside
/// a scrollable container);
/// - paying the cost of `get_attribute` + `parse::<usize>` + HashMap
/// lookup on every intermediate element is pure overhead when the
/// handler lives near the target.
///
/// Events NOT on this list (`click`, `input`, `keydown`, etc.) keep the
/// original full-depth behaviour because their handler lookup is less
/// locality-preserving: a `click` on a deeply nested icon needs to
/// resolve to a button defined many ancestors up.
///
/// When adding a new entry to this list, document WHY in the comment
/// above the array, and consider whether the framework's other
/// event-delegation paths (e.g. portal marker resolution) need a
/// matching special-case.
pub const HIGH_FREQUENCY_EVENTS: = ;
/// Upper bound on the ancestor walk depth for events named in
/// `HIGH_FREQUENCY_EVENTS`. The walk starts at `event.target()` (depth 0)
/// and proceeds through at most this many `parent_element` hops before
/// giving up. The cap exists to bound the per-event CPU cost of
/// `get_attribute` + `parse::<usize>` + HashMap lookup at 4 hops, which
/// is empirically enough to reach a typical scroll/drag container while
/// keeping the worst case proportional to constant time rather than the
/// full DOM depth.
///
/// See the doc on `HIGH_FREQUENCY_EVENTS` for the rationale.
pub const MAX_ANCESTOR_DEPTH_FOR_HIGH_FREQ: usize = 4;