Rocky_Mountain_Vending/.pnpm-store/v10/files/6d/6ef1a8bda7388cdf3b38547569e0c3e7ded591fd299cf1067d92af69aed72c63312339dc67317ca3e3a8614e82235330c4f8f630863c4b9c4c307416fc371b
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

72 lines
No EOL
2.9 KiB
Text

// Copyright 2024 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import * as Types from '../types/types.js';
let lastUpdateLayoutTreeEvent = null;
let lastInvalidatedNode = null;
const selectorDataForUpdateLayoutTree = new Map();
const invalidatedNodeList = new Array();
export function reset() {
lastUpdateLayoutTreeEvent = null;
lastInvalidatedNode = null;
selectorDataForUpdateLayoutTree.clear();
invalidatedNodeList.length = 0;
}
export function handleEvent(event) {
if (Types.Events.isStyleRecalcInvalidationTracking(event)) {
/**
* CSS Style substree invalidation
* A subtree invalidation comes with two records, 1) a StyleInvalidatorInvalidationTracking
* event 2) following with a StyleRecalcInvalidationTracking event. List of selectors and style
* sheet ID information is stored in the 1st event. Subtree flag is stored in the 2nd
* event.
*/
if (event.args.data.subtree &&
event.args.data.reason === Types.Events.StyleRecalcInvalidationReason.RELATED_STYLE_RULE &&
lastInvalidatedNode && event.args.data.nodeId === lastInvalidatedNode.backendNodeId) {
lastInvalidatedNode.subtree = true;
return;
}
}
if (Types.Events.isSelectorStats(event) && lastUpdateLayoutTreeEvent && event.args.selector_stats) {
selectorDataForUpdateLayoutTree.set(lastUpdateLayoutTreeEvent, {
timings: event.args.selector_stats.selector_timings,
});
return;
}
if (Types.Events.isStyleInvalidatorInvalidationTracking(event)) {
const selectorList = new Array();
event.args.data.selectors?.forEach(selector => {
selectorList.push({
selector: selector.selector,
styleSheetId: selector.style_sheet_id,
});
});
if (selectorList.length > 0) {
lastInvalidatedNode = {
frame: event.args.data.frame,
backendNodeId: event.args.data.nodeId,
type: Types.Events.InvalidationEventType.StyleInvalidatorInvalidationTracking,
selectorList,
ts: event.ts,
tts: event.tts,
subtree: false,
lastUpdateLayoutTreeEventTs: lastUpdateLayoutTreeEvent ? lastUpdateLayoutTreeEvent.ts : Types.Timing.Micro(0),
};
invalidatedNodeList.push(lastInvalidatedNode);
}
}
if (Types.Events.isUpdateLayoutTree(event)) {
lastUpdateLayoutTreeEvent = event;
return;
}
}
export async function finalize() {
}
export function data() {
return {
dataForUpdateLayoutEvent: selectorDataForUpdateLayoutTree,
invalidatedNodeList,
};
}
//# sourceMappingURL=SelectorStatsHandler.js.map