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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
/// The window event that re-runs the debounced mobile-viewport measurement.
pub const WINDOW_EVENT_RESIZE: &str = "resize";
/// The window event fired when entering or leaving a native (browser) fullscreen.
pub const WINDOW_EVENT_FULLSCREEN_CHANGE: &str = "fullscreenchange";
/// The WebKit-prefixed fullscreen event still emitted by older iOS Safari.
pub const WINDOW_EVENT_WEBKIT_FULLSCREEN_CHANGE: &str = "webkitfullscreenchange";
/// The CSS custom property carrying the real top safe-area inset for the immersive shell.
pub const IMMERSIVE_SAFE_TOP_PROPERTY: &str = "--euv-mobile-safe-top";
/// The CSS custom property carrying the real right safe-area inset for the app shell.
pub const SAFE_AREA_RIGHT_PROPERTY: &str = "--euv-safe-right";
/// The CSS custom property carrying the real bottom safe-area inset for the app shell.
pub const SAFE_AREA_BOTTOM_PROPERTY: &str = "--euv-safe-bottom";
/// The CSS custom property carrying the real left safe-area inset for the app shell.
pub const SAFE_AREA_LEFT_PROPERTY: &str = "--euv-safe-left";
/// The inset written for every side whose measured `env()` value is not trusted.
pub const SAFE_AREA_ZERO_VALUE: &str = "0px";
/// The unit every resolved `env(safe-area-inset-*)` pixel value ends with.
pub const SAFE_AREA_PIXEL_UNIT: &str = "px";
/// The largest `screen.height - window.innerHeight` gap still treated as edge-to-edge.
///
/// Any letterbox below a system status bar already exceeds it, so a browser
/// that crops the viewport out of the screen is never trusted.
pub const SAFE_AREA_LETTERBOX_TOLERANCE_PX: f64 = 24.0;
/// The user-agent token identifying desktop Safari, which also carries
/// "Macintosh" and therefore cannot be told apart from macOS by platform./// The user-agent token identifying desktop Safari, which also carries
/// "Macintosh" and therefore cannot be told apart from macOS by platform.
///
/// Safari is the only desktop browser that implements `env(safe-area-inset-*)`
/// for a notch, so it stays on the trusted path even though it is not iOS.
/// Compared against the lowercased user agent, hence the lowercase token.
pub const USER_AGENT_SAFARI_DESKTOP_TOKEN: &str = "safari";
/// The user-agent token that must be absent for a Safari match to count.
///
/// iOS Safari reports both "Safari" and "CriOS"-style tokens in some
/// in-app browsers; `Chrome` and `Firefox` on any desktop report "Safari"
/// only as a compatibility suffix, so excluding them keeps a desktop
/// Chrome from being treated as a notched host.
///
/// Comma-separated rather than a single regex-style string, because
/// `str::contains` matches substrings and would never find `"chrome|firefox"`
/// inside a user agent. Compared against the lowercased user agent, hence
/// the lowercase tokens.
pub const USER_AGENT_NON_SAFARI_TOKENS: &str = "chrome,chromium,firefox,edg,opr";
/// The `window` property a host sets to declare edge-to-edge (immersive) mode.
pub const IMMERSIVE_WINDOW_FLAG_PROPERTY: &str = "__EUV_IMMERSIVE__";
/// The selector matching the meta tag a host may ship to declare immersive mode.
pub const IMMERSIVE_META_SELECTOR: &str = r#"meta[name="euv-immersive"]"#;
/// The attribute of the immersive meta tag carrying the declared value.
pub const IMMERSIVE_META_CONTENT_ATTRIBUTE: &str = "content";
/// The meta tag `content` value that enables immersive mode.
pub const IMMERSIVE_META_CONTENT_ENABLED: &str = "true";
/// The `position` style property set on the measuring sentinel element.
pub const SENTINEL_STYLE_POSITION_PROPERTY: &str = "position";
/// The `position` value taking the sentinel out of the normal document flow.
pub const SENTINEL_STYLE_POSITION_ABSOLUTE: &str = "absolute";
/// The `visibility` style property hiding the sentinel from the user.
pub const SENTINEL_STYLE_VISIBILITY_PROPERTY: &str = "visibility";
/// The `visibility` value keeping the sentinel invisible.
pub const SENTINEL_STYLE_VISIBILITY_HIDDEN: &str = "hidden";
/// The `pointer-events` style property keeping the sentinel out of hit-testing.
pub const SENTINEL_STYLE_POINTER_EVENTS_PROPERTY: &str = "pointer-events";
/// The `pointer-events` value making the sentinel transparent to input.
pub const SENTINEL_STYLE_POINTER_EVENTS_NONE: &str = "none";
/// The `padding-top` style property probed for the top safe-area inset.
pub const SAFE_AREA_PADDING_TOP_PROPERTY: &str = "padding-top";
/// The `padding-right` style property probed for the right safe-area inset.
pub const SAFE_AREA_PADDING_RIGHT_PROPERTY: &str = "padding-right";
/// The `padding-bottom` style property probed for the bottom safe-area inset.
pub const SAFE_AREA_PADDING_BOTTOM_PROPERTY: &str = "padding-bottom";
/// The `padding-left` style property probed for the left safe-area inset.
pub const SAFE_AREA_PADDING_LEFT_PROPERTY: &str = "padding-left";
/// The `padding-top` value resolving the top safe-area inset with a zero fallback.
pub const SAFE_AREA_PADDING_TOP_VALUE: &str = "env(safe-area-inset-top, 0px)";
/// The `padding-right` value resolving the right safe-area inset with a zero fallback.
pub const SAFE_AREA_PADDING_RIGHT_VALUE: &str = "env(safe-area-inset-right, 0px)";
/// The `padding-bottom` value resolving the bottom safe-area inset with a zero fallback.
pub const SAFE_AREA_PADDING_BOTTOM_VALUE: &str = "env(safe-area-inset-bottom, 0px)";
/// The `padding-left` value resolving the left safe-area inset with a zero fallback.
pub const SAFE_AREA_PADDING_LEFT_VALUE: &str = "env(safe-area-inset-left, 0px)";
/// The CSS custom property overridden with the cached top safe-area pixel value.
pub const SAFE_AREA_INSET_TOP_PROPERTY: &str = "--safe-area-inset-top";
/// The CSS custom property overridden with the cached right safe-area pixel value.
pub const SAFE_AREA_INSET_RIGHT_PROPERTY: &str = "--safe-area-inset-right";
/// The CSS custom property overridden with the cached bottom safe-area pixel value.
pub const SAFE_AREA_INSET_BOTTOM_PROPERTY: &str = "--safe-area-inset-bottom";
/// The CSS custom property overridden with the cached left safe-area pixel value.
pub const SAFE_AREA_INSET_LEFT_PROPERTY: &str = "--safe-area-inset-left";
/// The selector for the mobile app root receiving the cached inset overrides.
pub const APP_ROOT_MOBILE_SELECTOR: &str = ".c_mobile_app_root";
/// The selector for the desktop app root receiving the cached inset overrides.
pub const APP_ROOT_DESKTOP_SELECTOR: &str = ".c_app_root";
/// The selector for the fullscreen canvas container patched outside the app root.
pub const FULLSCREEN_CANVAS_CONTAINER_SELECTOR: &str = ".c_canvas_container_fullscreen";
/// The selector for the fullscreen game container patched outside the app root.
pub const FULLSCREEN_GAME_CONTAINER_SELECTOR: &str = ".c_game_container_fullscreen";