refactor(observation): separate capture coordination from document consistency

This commit is contained in:
Ljy-0827
2026-09-09 15:58:56 +08:00
committed by drakezhang
parent 4e3365450a
commit 35a20582ad
12 changed files with 76 additions and 439 deletions
@@ -34,7 +34,6 @@ export interface FrameContext {
export interface NormalizedDocument {
nodes: NodeFacts[];
index: DocumentIndex;
documentElementBackendNodeId?: number;
}
/** Interpret one document using a supplied projection. No live reads or frame scheduling. */
@@ -95,12 +94,6 @@ export async function normalizeDocument(
(node) => !node.tag.startsWith("#") && !index.excludedBackendNodeIds.has(node.backendNodeId),
),
index,
documentElementBackendNodeId: nodes.find(
(node) =>
node.nodeType === 1 &&
node.parentBackendNodeId !== null &&
index.nodes.get(node.parentBackendNodeId)?.nodeType === 9,
)?.backendNodeId,
};
}