refactor(core): Add transition.to property to FakeNavigation

This matches the upstream changes in https://github.com/whatwg/html/commit/f19930f98afeb7565cfc1cbc6a1d4a2086535bca
This commit is contained in:
Andrew Scott
2025-12-03 09:56:32 -08:00
committed by Alex Rickabaugh
parent 9dd08c571a
commit 5988bdedae
2 changed files with 7 additions and 1 deletions
@@ -66,6 +66,7 @@ export declare class Navigation extends EventTarget {
export declare class NavigationTransition {
readonly navigationType: NavigationTypeString;
readonly from: NavigationHistoryEntry;
readonly to: NavigationDestination;
readonly finished: Promise<void>;
readonly committed: Promise<void>;
}
@@ -1020,7 +1020,11 @@ function dispatchNavigateEvent({
);
return;
}
const transition = new InternalNavigationTransition(navigation.currentEntry, navigationType);
const transition = new InternalNavigationTransition(
navigation.currentEntry,
event.destination,
navigationType,
);
navigation.transition = transition;
// Mark transition.finished as handled (Spec Step 33.4)
transition.finished.catch(() => {});
@@ -1227,6 +1231,7 @@ class InternalNavigationTransition implements NavigationTransition {
committedReject!: (reason: Error) => void;
constructor(
readonly from: NavigationHistoryEntry,
readonly to: NavigationDestination,
readonly navigationType: NavigationTypeString,
) {
this.finished = new Promise<void>((resolve, reject) => {