Skip to content

Preserve lazy hover state across document switches - #207

Merged
jdalton merged 1 commit into
dperini:masterfrom
jdalton:perf/lazy-hover
Sep 7, 2026
Merged

Preserve lazy hover state across document switches#207
jdalton merged 1 commit into
dperini:masterfrom
jdalton:perf/lazy-hover

Conversation

@jdalton

@jdalton jdalton commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

After an engine queries a second document, hover events from the first document can overwrite the active document's state. Keep lazy hover tracking per document, restore that state on document switches, and read native hover state that predates listener setup.

Use weak document records when WeakMap is available. Legacy hosts retain only the current document's record and reuse stable callbacks to avoid duplicate listeners. Preserve the lazy-registration and repeated-query assertions from #209, and add host-state, document-switching, background-event, and legacy-host regressions. The browser manifest retains the existing compound-negation fixture.

Validation after rebasing onto #206: 557 Node tests, 19 focused hover/descendant tests, and 56 browser tests pass. Formatting, lint, types, repository checks, and combined coverage pass. Combined coverage is 85.02% statements, 75.64% branches, 84.39% functions, and 83.83% lines. The packed-package check passed 22 tests before the rebase.

@jdalton
jdalton force-pushed the perf/lazy-hover branch 5 times, most recently from 28f0c22 to 7f8fc69 Compare September 7, 2026 15:02
@jdalton jdalton changed the title Install hover tracking on demand Preserve lazy hover state across document switches Sep 7, 2026
@jdalton
jdalton merged commit 947d9dd into dperini:master Sep 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant