Re: [whatwg] Proposal: Allow disabling of default scroll restoration behavior

>
>
> > I think the original approach of adding a fourth argument is much better.
> >
> > It's also a better API in general, since the URL should always be given.
> > If we had a one-argument form with a dictionary, people would consider
> not
> > giving the URL but just disabling scrolling, which is suboptimal.
>
> You can require arguments with dictionaries.
>

Actually URL is optional in current spec and it defaults to current URL.
Why is this suboptimal? In anycase If making URL required is a goal then it
is best done by introducing a new method to avoid breaking compatibility.

I personally find a dictionary with only optional members which have
appropriate defaults to be very convenient. Here are some reasonable
defaults:
 - url: current URL
 - title: current title
 - state: null
 - restoreScroll: true (or willRestoreScrollPosition: false)

Received on Wednesday, 15 April 2015 16:32:25 UTC