euv-core 0.48.1

Core cross-platform runtime for euv featuring arena-based fine-grained reactivity, deterministic layout, flat scene graph, multi-mode rendering, and direct OS platform adapters.
Documentation
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
use super::*;

/// HTML tag name created when mounting a cross-platform canvas surface.
pub(crate) const WEB_CANVAS_TAG: &str = "canvas";

/// CSS custom property exposing `env(safe-area-inset-top)` without DOM mutation or layout reflow.
pub(crate) const WEB_CSS_SAFE_TOP: &str = "--euv-safe-top";

/// CSS custom property exposing `env(safe-area-inset-right)` without DOM mutation or layout reflow.
pub(crate) const WEB_CSS_SAFE_RIGHT: &str = "--euv-safe-right";

/// CSS custom property exposing `env(safe-area-inset-bottom)` without DOM mutation or layout reflow.
pub(crate) const WEB_CSS_SAFE_BOTTOM: &str = "--euv-safe-bottom";

/// CSS custom property exposing `env(safe-area-inset-left)` without DOM mutation or layout reflow.
pub(crate) const WEB_CSS_SAFE_LEFT: &str = "--euv-safe-left";

/// `window.getComputedStyle` property name.
pub(crate) const WEB_METHOD_GET_COMPUTED_STYLE: &str = "getComputedStyle";

/// `CSSStyleDeclaration.getPropertyValue` property name.
pub(crate) const WEB_METHOD_GET_PROPERTY_VALUE: &str = "getPropertyValue";

/// `navigator.gpu` WebGPU capability property name.
pub(crate) const WEB_PROP_GPU: &str = "gpu";

/// WebGPU rendering context identifier passed to `HTMLCanvasElement.getContext`.
pub(crate) const WEB_CONTEXT_WEBGPU: &str = "webgpu";

/// WebGL2 rendering context identifier passed to `HTMLCanvasElement.getContext`.
pub(crate) const WEB_CONTEXT_WEBGL2: &str = "webgl2";

/// WebGL2 context option key disabling alpha compositing overhead.
pub(crate) const WEB_GL_OPT_ALPHA: &str = "alpha";

/// WebGL2 context option key disabling MSAA overhead.
pub(crate) const WEB_GL_OPT_ANTIALIAS: &str = "antialias";

/// WebGL2 context option key disabling depth buffer allocation.
pub(crate) const WEB_GL_OPT_DEPTH: &str = "depth";

/// WebGL2 context option key requesting low-latency desynchronized presentation.
pub(crate) const WEB_GL_OPT_DESYNCHRONIZED: &str = "desynchronized";

/// WebGL2 context option key requesting discrete/high-performance GPU adapter.
pub(crate) const WEB_GL_OPT_POWER_PREF: &str = "powerPreference";

/// WebGL2 `powerPreference` value selecting the highest-throughput GPU.
pub(crate) const WEB_GL_OPT_HIGH_PERFORMANCE: &str = "high-performance";

/// WebGL2 context option key avoiding redundant drawing buffer copies.
pub(crate) const WEB_GL_OPT_PRESERVE_DRAWING: &str = "preserveDrawingBuffer";

/// Global browser `ResizeObserver` constructor name.
pub(crate) const WEB_CTOR_RESIZE_OBSERVER: &str = "ResizeObserver";

/// `ResizeObserver.observe` method name.
pub(crate) const WEB_METHOD_OBSERVE: &str = "observe";

/// `ResizeObserver.disconnect` method name.
pub(crate) const WEB_METHOD_DISCONNECT: &str = "disconnect";

/// WebGL2 `createTexture` method name.
pub(crate) const WEB_GL_CREATE_TEXTURE: &str = "createTexture";

/// WebGL2 `activeTexture` method name.
pub(crate) const WEB_GL_ACTIVE_TEXTURE: &str = "activeTexture";

/// WebGL2 `bindTexture` method name.
pub(crate) const WEB_GL_BIND_TEXTURE: &str = "bindTexture";

/// WebGL2 `texParameteri` method name.
pub(crate) const WEB_GL_TEX_PARAMETERI: &str = "texParameteri";

/// `window.visualViewport` property name.
pub(crate) const WEB_PROP_VISUAL_VIEWPORT: &str = "visualViewport";

/// `VisualViewport.width` property name.
pub(crate) const WEB_PROP_WIDTH: &str = "width";

/// `VisualViewport.height` property name.
pub(crate) const WEB_PROP_HEIGHT: &str = "height";

/// `VisualViewport.scale` property name guarding pinch-zoom from shrinking the layout canvas backing store.
pub(crate) const WEB_PROP_SCALE: &str = "scale";

/// Minimum supported Web `devicePixelRatio` multiplier.
pub(crate) const WEB_DPR_MIN: f32 = 1.0;

/// Maximum supported Web `devicePixelRatio` multiplier covering 3x Retina displays at up to 200% browser zoom.
pub(crate) const WEB_DPR_MAX: f32 = 6.0;

/// Maximum safe physical Web `<canvas>` dimension per axis preventing GPU allocation failures at extreme zoom.
pub(crate) const WEB_CANVAS_MAX_PHYS_DIM: f64 = 8192.0;

/// Threshold above `1.0` indicating browser pinch-zoom is active on `window.visualViewport`.
pub(crate) const WEB_PINCH_ZOOM_THRESHOLD: f64 = 1.01;

/// `window.open` target name opening external links in a new browser tab.
pub(crate) const WEB_OPEN_TARGET_BLANK: &str = "_blank";

/// `window.open` feature flags preventing reverse tabnabbing on external links.
pub(crate) const WEB_OPEN_FEATURES_SAFE: &str = "noopener,noreferrer";

/// Uniform name binding sampler unit 0 in `WEB_GL2_BLIT_FRAG_SHADER`.
pub(crate) const WEB_GL2_UNIFORM_TEX: &str = "u_tex";

/// Uniform name carrying the physical drawing-buffer size (`vec2`) in `WEB_GL2_BLIT_FRAG_SHADER`.
pub(crate) const WEB_GL2_UNIFORM_VIEW: &str = "u_view";

/// Argument index key for single-argument `Reflect::construct` invocation.
pub(crate) const WEB_REFLECT_ARG0_KEY: &str = "0";

/// Inline style HTML attribute name.
pub(crate) const WEB_ATTR_STYLE: &str = "style";

/// DOM `id` attribute name used to deduplicate injected `<style>` elements.
pub(crate) const WEB_ATTR_ID: &str = "id";

/// HTML `<style>` tag name injected to suppress browser tap-highlight and focus-ring overlays.
pub(crate) const WEB_STYLE_TAG: &str = "style";

/// CSS selector locating the document `<head>` element without extra `web-sys` feature flags.
pub(crate) const WEB_HEAD_SELECTOR: &str = "head";

/// DOM id assigned to the injected zero-highlight browser reset stylesheet.
pub(crate) const WEB_RESET_STYLE_ID: &str = "euv-web-reset";

/// CSS rules suppressing full-canvas tap-highlight blue overlays, touch callouts, text selection, and focus outlines across Chrome, Safari, and Firefox.
pub(crate) const WEB_RESET_STYLE_CSS: &str = "html,body,canvas{-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;user-select:none;-webkit-user-select:none;outline:none;}canvas:focus,canvas:focus-visible{outline:none;}";

/// Tabindex HTML attribute name enabling keyboard focus on canvas.
pub(crate) const WEB_ATTR_TABINDEX: &str = "tabindex";

/// Default full-viewport body inline CSS eliminating scrollbars, tap highlights, and borders.
pub(crate) const WEB_BODY_STYLE: &str = "margin:0;padding:0;width:100vw;height:100vh;height:100dvh;overflow:hidden;background:#09090b;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent;outline:none;";

/// Inline CSS prefix for the full-viewport 1:1 physical canvas surface.
pub(crate) const WEB_CANVAS_STYLE_PREFIX: &str =
    "position:fixed;inset:0;width:100%;height:100%;display:block;outline:none;cursor:";

/// Inline CSS suffix disabling browser touch panning, tap-highlight overlays, callouts, and text selection on the active foreground canvas surface.
pub(crate) const WEB_CANVAS_STYLE_SUFFIX: &str = ";margin:0;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent;z-index:1;visibility:visible;opacity:1;pointer-events:auto;";

/// Inline CSS style keeping a pre-warming standby `<canvas>` hidden underneath the active canvas until atomic frame-boundary handoff.
pub(crate) const WEB_STANDBY_CANVAS_STYLE: &str = "position:fixed;inset:0;width:100%;height:100%;display:block;outline:none;margin:0;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent;z-index:0;visibility:hidden;opacity:0;pointer-events:none;";

/// HTML `data-euv-canvas-role` attribute name marking active vs standby presentation canvases.
pub(crate) const WEB_ATTR_CANVAS_ROLE: &str = "data-euv-canvas-role";

/// Role attribute value applied to the visible foreground `<canvas>`.
pub(crate) const WEB_CANVAS_ROLE_ACTIVE: &str = "active";

/// Role attribute value applied to a hidden pre-warming standby `<canvas>`.
pub(crate) const WEB_CANVAS_ROLE_STANDBY: &str = "standby";

/// Error message when WebGL2 direct GPU presentation is requested without a live WebGL2 direct pipeline.
pub(crate) const ERR_WEB_GL2_DIRECT_MISSING: &str =
    "WebGL2 direct GPU primitive pipeline unavailable on active canvas";

/// Error message when a WebGL2 context cannot be acquired on a fresh independent canvas.
pub(crate) const ERR_WEB_GL2_CONTEXT_MISSING: &str =
    "failed to acquire independent webgl2 canvas rendering context";

/// WebGL2 direct GPU primitive vertex shader (`#version 300 es`, `precision highp float`) drawing screen-space rectangles without CPU framebuffer upload.
pub(crate) const WEB_GL2_DIRECT_VERT_SHADER: &str = "#version 300 es\n\
precision highp float;\n\
precision highp int;\n\
uniform highp vec2 u_view;\n\
uniform highp vec4 u_rect;\n\
void main() {\n\
    vec2 corner = vec2((gl_VertexID == 1 || gl_VertexID == 4 || gl_VertexID == 5) ? 1.0 : 0.0,\n\
                       (gl_VertexID == 2 || gl_VertexID == 3 || gl_VertexID == 5) ? 1.0 : 0.0);\n\
    vec2 px = u_rect.xy + corner * u_rect.zw;\n\
    vec2 ndc = vec2((px.x / max(u_view.x, 1.0)) * 2.0 - 1.0, 1.0 - (px.y / max(u_view.y, 1.0)) * 2.0);\n\
    gl_Position = vec4(ndc, 0.0, 1.0);\n\
}\n";

/// WebGL2 direct GPU primitive fragment shader (`#version 300 es`, `precision highp float`).
pub(crate) const WEB_GL2_DIRECT_FRAG_SHADER: &str = "#version 300 es\n\
precision highp float;\n\
uniform highp vec4 u_color;\n\
out highp vec4 out_color;\n\
void main() {\n\
    out_color = u_color;\n\
}\n";

/// Uniform name carrying the primitive bounds `[x, y, w, h]` in `WEB_GL2_DIRECT_VERT_SHADER`.
pub(crate) const WEB_GL2_DIRECT_UNIFORM_RECT: &str = "u_rect";

/// Uniform name carrying the normalized RGBA primitive color in `WEB_GL2_DIRECT_FRAG_SHADER`.
pub(crate) const WEB_GL2_DIRECT_UNIFORM_COLOR: &str = "u_color";

/// Default canvas tabindex value enabling keyboard focus.
pub(crate) const WEB_ATTR_TABINDEX_ZERO: &str = "0";

/// 2D rendering context identifier passed to `HTMLCanvasElement.getContext`.
pub(crate) const WEB_CONTEXT_2D: &str = "2d";

/// Media query string used to detect browser dark mode preference.
pub(crate) const WEB_DARK_MEDIA_QUERY: &str = "(prefers-color-scheme: dark)";

/// Error message when browser `window` or `document` is unavailable.
pub(crate) const ERR_WEB_WINDOW_MISSING: &str = "browser window or document unavailable";

/// Error message when `HTMLCanvasElement` creation or casting fails.
pub(crate) const ERR_WEB_CANVAS_CREATE: &str = "failed to create HTMLCanvasElement";

/// Error message when `CanvasRenderingContext2d` cannot be acquired.
pub(crate) const ERR_WEB_CTX2D_MISSING: &str = "failed to acquire 2d canvas rendering context";

/// Error message when `ImageData` creation or `putImageData` fails.
pub(crate) const ERR_WEB_PRESENT_FAILED: &str = "failed to blit ImageData to canvas";

/// CSS cursor keyword for default arrow.
pub(crate) const WEB_CURSOR_DEFAULT: &str = "default";

/// CSS cursor keyword for clickable hand pointer.
pub(crate) const WEB_CURSOR_POINTER: &str = "pointer";

/// CSS cursor keyword for text selection I-beam.
pub(crate) const WEB_CURSOR_TEXT: &str = "text";

/// CSS cursor keyword for precision crosshair.
pub(crate) const WEB_CURSOR_CROSSHAIR: &str = "crosshair";

/// CSS cursor keyword for disabled control.
pub(crate) const WEB_CURSOR_NOT_ALLOWED: &str = "not-allowed";

/// CSS cursor keyword for open grab hand.
pub(crate) const WEB_CURSOR_GRAB: &str = "grab";

/// CSS cursor keyword for active grabbing hand.
pub(crate) const WEB_CURSOR_GRABBING: &str = "grabbing";

/// CSS cursor keyword for omnidirectional move.
pub(crate) const WEB_CURSOR_MOVE: &str = "move";

/// CSS cursor keyword for horizontal resize.
pub(crate) const WEB_CURSOR_EW_RESIZE: &str = "ew-resize";

/// CSS cursor keyword for vertical resize.
pub(crate) const WEB_CURSOR_NS_RESIZE: &str = "ns-resize";

/// DOM Element method name entering browser fullscreen.
pub(crate) const WEB_METHOD_REQUEST_FULLSCREEN: &str = "requestFullscreen";

/// WebKit-prefixed DOM Element method name entering browser fullscreen on Safari.
pub(crate) const WEB_METHOD_WEBKIT_REQUEST_FULLSCREEN: &str = "webkitRequestFullscreen";

/// DOM Document method name exiting browser fullscreen.
pub(crate) const WEB_METHOD_EXIT_FULLSCREEN: &str = "exitFullscreen";

/// WebKit-prefixed DOM Document method name exiting browser fullscreen on Safari.
pub(crate) const WEB_METHOD_WEBKIT_EXIT_FULLSCREEN: &str = "webkitExitFullscreen";

/// WebKit-prefixed DOM Document property reporting the active fullscreen element on Safari.
pub(crate) const WEB_PROP_WEBKIT_FULLSCREEN_ELEMENT: &str = "webkitFullscreenElement";

/// DOM `devicemotion` window event name.
pub(crate) const WEB_EVENT_DEVICE_MOTION: &str = "devicemotion";

/// DOM `deviceorientation` window event name.
pub(crate) const WEB_EVENT_DEVICE_ORIENTATION: &str = "deviceorientation";

/// Global `DeviceMotionEvent` constructor property name on `window`.
pub(crate) const WEB_CTOR_DEVICE_MOTION_EVENT: &str = "DeviceMotionEvent";

/// Global `DeviceOrientationEvent` constructor property name on `window`.
pub(crate) const WEB_CTOR_DEVICE_ORIENTATION_EVENT: &str = "DeviceOrientationEvent";

/// iOS Safari sensor permission static method name on `DeviceMotionEvent` / `DeviceOrientationEvent`.
pub(crate) const WEB_METHOD_REQUEST_PERMISSION: &str = "requestPermission";

/// iOS Safari granted permission string value.
pub(crate) const WEB_PERMISSION_GRANTED: &str = "granted";

/// `window.screen` property name.
pub(crate) const WEB_PROP_SCREEN: &str = "screen";

/// `screen.orientation` / legacy `window.orientation` property name.
pub(crate) const WEB_PROP_ORIENTATION: &str = "orientation";

/// `screen.orientation.angle` property name.
pub(crate) const WEB_PROP_ANGLE: &str = "angle";

/// `DeviceMotionEvent.accelerationIncludingGravity` property name.
pub(crate) const WEB_PROP_ACCEL_INCLUDING_GRAVITY: &str = "accelerationIncludingGravity";

/// `DeviceMotionEvent.acceleration` property name.
pub(crate) const WEB_PROP_ACCELERATION: &str = "acceleration";

/// `DeviceMotionEvent.rotationRate` property name.
pub(crate) const WEB_PROP_ROTATION_RATE: &str = "rotationRate";

/// `DeviceOrientationEvent` / `rotationRate` alpha axis property name.
pub(crate) const WEB_PROP_ALPHA: &str = "alpha";

/// `DeviceOrientationEvent` / `rotationRate` beta axis property name.
pub(crate) const WEB_PROP_BETA: &str = "beta";

/// `DeviceOrientationEvent` / `rotationRate` gamma axis property name.
pub(crate) const WEB_PROP_GAMMA: &str = "gamma";

/// Cartesian `x` component property name.
pub(crate) const WEB_PROP_AXIS_X: &str = "x";

/// Cartesian `y` component property name.
pub(crate) const WEB_PROP_AXIS_Y: &str = "y";

/// Cartesian `z` component property name.
pub(crate) const WEB_PROP_AXIS_Z: &str = "z";

/// Degree-to-radian conversion constant (`PI / 180`).
pub(crate) const WEB_DEG_TO_RAD: f32 = PI / 180.0;

/// Exponential low-pass filter factor used to separate gravity when `DeviceMotionEvent.acceleration` is null.
pub(crate) const WEB_GRAVITY_LPF_ALPHA: f32 = 0.22;

/// Minimum dot-product magnitude between orientation gravity and accelerometer gravity to auto-detect Safari vs W3C sign convention.
pub(crate) const WEB_GRAVITY_SIGN_DOT_THRESHOLD: f32 = 12.0;

/// DOM element ID for the reusable hidden CSS `env(safe-area-inset-*)` length probe.
pub(crate) const WEB_SAFE_PROBE_ID: &str = "euv-safe-area-probe";

/// HTML `div` tag name used for the hidden safe-area CSS probe element.
pub(crate) const WEB_TAG_DIV: &str = "div";

/// HTML `img` tag name used for browser-native async image decoding.
pub(crate) const WEB_TAG_IMG: &str = "img";

/// Inline CSS rule mapping `env(safe-area-inset-*)` onto real box `padding-*` lengths so every browser resolves exact pixel values.
pub(crate) const WEB_SAFE_PROBE_STYLE: &str = "position:fixed;top:0;left:0;width:0;height:0;visibility:hidden;pointer-events:none;padding:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px);";

/// CSS computed property name for top padding on the hidden safe-area probe.
pub(crate) const WEB_CSS_PADDING_TOP: &str = "padding-top";

/// CSS computed property name for right padding on the hidden safe-area probe.
pub(crate) const WEB_CSS_PADDING_RIGHT: &str = "padding-right";

/// CSS computed property name for bottom padding on the hidden safe-area probe.
pub(crate) const WEB_CSS_PADDING_BOTTOM: &str = "padding-bottom";

/// CSS computed property name for left padding on the hidden safe-area probe.
pub(crate) const WEB_CSS_PADDING_LEFT: &str = "padding-left";

/// DOM `HTMLImageElement.crossOrigin` property name.
pub(crate) const WEB_PROP_CROSS_ORIGIN: &str = "crossOrigin";

/// CORS anonymous attribute value enabling `<canvas>` pixel readback on cross-origin images.
pub(crate) const WEB_CORS_ANONYMOUS: &str = "anonymous";

/// DOM `HTMLImageElement.src` property name.
pub(crate) const WEB_PROP_SRC: &str = "src";

/// DOM `HTMLImageElement.naturalWidth` property name.
pub(crate) const WEB_PROP_NATURAL_WIDTH: &str = "naturalWidth";

/// DOM `HTMLImageElement.naturalHeight` property name.
pub(crate) const WEB_PROP_NATURAL_HEIGHT: &str = "naturalHeight";

/// DOM `CanvasRenderingContext2D.drawImage` method name.
pub(crate) const WEB_METHOD_DRAW_IMAGE: &str = "drawImage";

/// DOM `load` event name for image elements.
pub(crate) const WEB_EVENT_LOAD: &str = "load";

/// DOM `error` event name for image elements.
pub(crate) const WEB_EVENT_ERROR: &str = "error";

/// HTTP scheme prefix used to detect cross-origin image fetches.
pub(crate) const WEB_SCHEME_HTTP: &str = "http://";

/// HTTPS scheme prefix used to detect cross-origin image fetches.
pub(crate) const WEB_SCHEME_HTTPS: &str = "https://";

/// Maximum rasterized image dimension in pixels when decoding network images onto a 2D canvas.
pub(crate) const WEB_IMAGE_MAX_DIM: u32 = 2048;

/// Default fallback width in CSS pixels for vector SVG images reporting zero intrinsic width.
pub(crate) const WEB_SVG_FALLBACK_WIDTH: u32 = 240;

/// Default fallback height in CSS pixels for vector SVG images reporting zero intrinsic height.
pub(crate) const WEB_SVG_FALLBACK_HEIGHT: u32 = 48;

/// Maximum DPR multiplier applied when rasterizing vector SVG sources onto an offscreen 2D canvas.
pub(crate) const WEB_SVG_RASTER_MAX_DPR: f32 = 4.0;

/// `CanvasRenderingContext2D.imageSmoothingQuality` property name for crisp HiDPI image decoding.
pub(crate) const WEB_PROP_IMAGE_SMOOTHING_QUALITY: &str = "imageSmoothingQuality";

/// High-quality resampling mode for browser offscreen 2D canvas image rasterization.
pub(crate) const WEB_IMG_SMOOTHING_HIGH: &str = "high";

/// File extension marker identifying vector SVG image URLs.
pub(crate) const WEB_EXT_SVG: &str = ".svg";

/// Data URI prefix identifying inline vector SVG images.
pub(crate) const WEB_DATA_SVG_PREFIX: &str = "data:image/svg+xml";

/// HTML `<textarea>` tag name used for synchronous clipboard copy fallback.
pub(crate) const WEB_TAG_TEXTAREA: &str = "textarea";

/// HTML attribute tagging the temporary offscreen clipboard copy `<textarea>` so document `copy` listeners pass it through.
pub(crate) const WEB_ATTR_COPY_PROXY: &str = "data-euv-copy-proxy";

/// Attribute value identifying the temporary offscreen clipboard copy proxy.
pub(crate) const WEB_COPY_PROXY_FLAG: &str = "1";

/// HTML `readonly` attribute preventing mobile soft keyboards from flashing during offscreen clipboard copy.
pub(crate) const WEB_ATTR_READONLY: &str = "readonly";

/// Inline style positioning the offscreen clipboard copy proxy outside the viewport without shifting scroll.
pub(crate) const WEB_COPY_PROXY_STYLE: &str =
    "position:fixed;left:-9999px;top:0;width:1px;height:1px;opacity:0;pointer-events:none;";

/// `navigator.clipboard` property name.
pub(crate) const WEB_PROP_CLIPBOARD: &str = "clipboard";

/// `Clipboard.writeText` method name.
pub(crate) const WEB_METHOD_WRITE_TEXT: &str = "writeText";

/// `HTMLTextAreaElement.value` property name.
pub(crate) const WEB_PROP_VALUE: &str = "value";

/// `HTMLTextAreaElement.select` method name.
pub(crate) const WEB_METHOD_SELECT: &str = "select";

/// `HTMLTextAreaElement.setSelectionRange` method name.
pub(crate) const WEB_METHOD_SET_SELECTION_RANGE: &str = "setSelectionRange";

/// `Document.execCommand` method name for synchronous clipboard copy fallback.
pub(crate) const WEB_METHOD_EXEC_COMMAND: &str = "execCommand";

/// `Document.execCommand` copy command name.
pub(crate) const WEB_CMD_COPY: &str = "copy";

/// `Promise.catch` method name suppressing unhandled clipboard permission rejection logs.
pub(crate) const WEB_METHOD_CATCH: &str = "catch";

/// Empty JS no-op function body used as a `Promise.catch` handler.
pub(crate) const WEB_JS_NOOP_BODY: &str = "";