Skip to content
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

Optionality of history.pushState/replaceState’s unused argument #8278

Open
bathos opened this issue Sep 10, 2022 · 0 comments
Open

Optionality of history.pushState/replaceState’s unused argument #8278

bathos opened this issue Sep 10, 2022 · 0 comments
Labels
needs implementer interest Moving the issue forward requires implementers to express interest normative change topic: history

Comments

@bathos
Copy link

bathos commented Sep 10, 2022

The signatures of pushState and replaceState currently require their unused arguments (previously title) even though their url arguments are optional.

interface History {
  /* [...] */
  undefined pushState(any data, DOMString unused, optional USVString? url = null);
  undefined replaceState(any data, DOMString unused, optional USVString? url = null);
};

While the unused arguments are unavoidable for web compat when changing the URL, the explicit second argument being required when updating state alone seems to serve no purpose (and is not particularly obvious). They could be made optional.

(Filed at the suggestion of @annevk. In that context, I was suggesting there might be ways the Web IDL overload resolution algorithm could be made a bit friendlier in general, but the particular example I gave really implied an issue with the specific signatures in question.)

@annevk annevk added needs implementer interest Moving the issue forward requires implementers to express interest topic: history normative change labels Sep 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs implementer interest Moving the issue forward requires implementers to express interest normative change topic: history
Development

No branches or pull requests

2 participants