-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Description
What is the issue with the HTML Standard?
Disclaimer: I'm not the most familiar with these specs, at most I dabble.
I've been playing around with the new Navigation API and by chance I tried to manually create a NavigateEvent in a test suite only to find it seemingly cannot be created, despite having a constructor, as the NavigationDestination interface cannot be satisfied. E.g.,
new NavigateEvent('navigate', { destination: { ... } });Uncaught TypeError: Failed to construct 'NavigateEvent': Failed to read the 'destination' property from 'NavigateEventInit': Failed to convert value to 'NavigationDestination'.
As far as I can tell there's no way to satisfy the NavigationDestination interface, not by supplying all attributes or only a subset, nor can it be omitted as the destination field is a required member.
So a few possibilities, as I see them:
- Users aren't meant to be able to form a
NavigateEvent, in which case, should it have a constructor? NavigationDestinationshould have a constructor but does not.
I should add this wasn't an actual issue in my tests, was just trying various things out whilst reading the spec. I don't personally have an issue if NavigateEvent is not user constructable.