W3C home > Mailing lists > Public > public-html@w3.org > December 2008

Re: DOM Storage feedback

From: Ian Hickson <ian@hixie.ch>
Date: Wed, 24 Dec 2008 11:59:32 +0000 (UTC)
To: Adam Roben <aroben@apple.com>, Maciej Stachowiak <mjs@apple.com>
Cc: public-html@w3.org
Message-ID: <Pine.LNX.4.62.0812241157540.24109@hixie.dreamhostps.com>

On Thu, 19 Jun 2008, Adam Roben wrote:
> 
> I've been worried a bit recently about the synchronous API for reading 
> from localStorage. It seems like it would be very common for pages to 
> access localStorage early in the lifetime of the page to restore state 
> from the last browsing session, and even with an ahead-of-time read it's 
> entirely possible that we won't have finished reading off the disk by 
> the first access. In this case, the whole browser will hang.
> 
> One possible solution to this problem would be to have an event that 
> fires when localStorage is ready for reading (perhaps called 
> "localstorageready"). Before that event fires, all attempts to read from 
> localStorage will fail (perhaps writes should fail as well, for 
> consistency?). After the event fires, localStorage can be used normally.

I would imagine that localStorage would load faster than DNS, usually, so 
this seems like an unnecessary worry. You already have to wait til you've 
loaded all the cookies for that domain, why would you have significantly 
more trouble waiting for the storage data?

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Wednesday, 24 December 2008 12:00:07 UTC

This archive was generated by hypermail 2.3.1 : Monday, 29 September 2014 09:39:00 UTC