-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initialization of NavigateEvent info property #9634
Comments
This is specced in https://dom.spec.whatwg.org/#constructing-events, although note whatwg/dom#600 is still open and everyone is kind of just handwaving how that works. I agree the "initialized to" language is confusing and unorthodox. It would be nice if we had a more-rigorous way of doing that. But it's what every event interface does right now. Let me know if I missed something and there's something very specific to |
Aha, I see. It looks like I have the exact same question that was asked in #5303 , which was also linked to dom#600. i.e. "why are these EventInit any values undefined, when other any values are simply "not provided"". |
For non-synthetic NavigateEvents, the spec explicitly checks if there is an
any
related to any info/state and grabs it out of the incomingNavigationOptions
Let info be options["info"], if it exists; otherwise, undefined.
However, for synthetic events, there's no actual initialization defined?
The NavigateEventInitData dictionary leaves the initial value not set:
The spec text for NavigateEvent just says that it has "the value it was initialized to"
https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigateevent-info
If it's supposed to be implied that
any info;
creates an ECMAScript undefined value, then why do all of the places that look at NavigationOptions check for the existence ofinfo
in the dictionary first?After chatting with @Lubrsi I think in order for the WPT test to be correct: https://github.com/web-platform-tests/wpt/blob/master/navigation-api/navigate-event/event-constructor.html#L95 there needs to be some spec language to initialize the
info
property toundefined
if it's not provided in theNavigateEventInitData
struct.cc @domenic
The text was updated successfully, but these errors were encountered: