MCPcopy Create free account
hub / github.com/adobe/react-spectrum / start

Function start

perf/app/measure.ts:304–338  ·  view source on GitHub ↗
(event: Event)

Source from the content-addressed store, hash-verified

302}
303
304function start(event: Event) {
305 if (!armed || event.type !== armed.event || !event.isTrusted) {
306 return;
307 }
308 let target = event.composedPath()[0];
309 if (!(target instanceof Element) || !target.closest(armed.target)) {
310 return;
311 }
312 if (armed.key && (event as KeyboardEvent).key !== armed.key) {
313 return;
314 }
315 if (sample) {
316 sample.inputEvents++;
317 return;
318 }
319 sample = {
320 start: event.timeStamp,
321 semanticReady: 0,
322 renderingOpportunity: 0,
323 frameIntervals: [],
324 events: [],
325 eventTimingSupported,
326 longFrames: [],
327 longFramesSupported,
328 visibility: document.visibilityState,
329 inputEvents: 1,
330 mutations: 0,
331 nodesAdded: 0,
332 nodesRemoved: 0
333 };
334 frame = requestAnimationFrame(tick);
335 if (calibrationMode === 'input') {
336 busy(calibrationDelay);
337 }
338}
339
340for (let event of ['pointerdown', 'pointerover', 'keydown', 'wheel']) {
341 document.addEventListener(event, start, {capture: true, passive: true});

Callers

nothing calls this directly

Calls 1

busyFunction · 0.85

Tested by

no test coverage detected