Skip to content

Navigation API: Navigation's ongoing navigate event is not null in #inner-navigate-event-firing-algorithm #11184

@farre

Description

@farre

What is the issue with the HTML Standard?

In step 25 of #inner-navigate-event-firing-algorithm we assert that #ongoing-navigate-event is null, but I don't think this is necessarily true.

The current partial implementation in Gecko asserts at that step for the following test:

<script>
  addEventListener(
    "load",
    async () => {
      navigation.onnavigate = () => {};
      history.pushState(1, null, "#1");
      history.pushState(1, null, "#2");
    },
    { once: true }
  );
</script>

Looking at Chromium source, we see that #inform-the-navigation-api-about-aborting-navigation is called in NavigationApi::DispatchNavigateEvent, and indeed if I add a call to #inform-the-navigation-api-about-aborting-navigation in Gecko's implementation of #inner-navigate-event-firing-algorithm the assert obviously stops being a problem.

Thing is that I'm not entirely sure that this is the correct solution, but as far as I've been able to glean from the spec, there is nowhere a call to #abort-the-ongoing-navigation when doing two consecutive calls to history.pushState.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions