W3C home > Mailing lists > Public > whatwg@whatwg.org > November 2009

[whatwg] Do we really need history.clearState()?

From: Brady Eidson <beidson@apple.com>
Date: Thu, 12 Nov 2009 13:16:51 -0800
Message-ID: <5E05F7C3-6B49-46A1-94B3-0C0A09219117@apple.com>
I should've responded to this more directly:

On Nov 12, 2009, at 12:00 PM, Justin Lebar wrote:

> I think the use case I proposed is much better served by something
> like history.truncate(numBefore, numAfter), which would remove all but
> the numBefore entries before the current entry and the numAfter
> entries after the current entry.  We'd subject this to the same-origin
> policy, of course, and stop removing entries in a direction as soon as
> we encountered an entry from another origin.

The History object is - quite purposefully - very limited in scope and abilities.  Today, it gives the ability to navigate back and forward a number of steps.  Period.  

The pushState() API adds a very limited way of adding new items programatically.  clearState() also adds the ability for a script to remove entries, but only ones that it added.  Period.

Same-origin policy be damned, I really don't like the idea of a script being able to remove items that it didn't add.

As I said in my previous reply, I think it might be useful to give a more fine-grained version of "clearState()", but that could always be added later if there's demand.  And I still think it should be limited to affecting the string of the Document object's entries.

~Brady

> 
> -Justin
Received on Thursday, 12 November 2009 13:16:51 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:19 UTC