[Webkit-unassigned] [Bug 41645] localStorage setItem converting value argument to string before saving

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Sep 17 02:16:10 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=41645





--- Comment #5 from Jeremy Orlow <jorlow at chromium.org>  2010-09-17 02:16:10 PST ---
(In reply to comment #4)
> (In reply to comment #3)
> > Actually, I thought we had a bug on implementing the structured clone algorithm for Storage APIs.
> > 
> > I certainly think it would be good to implement, and it shouldn't even be difficult...
> 
> If this is a bug, I think it would be extremely useful and helpful if this was fixed or addressed sometime soon. The general gist I am getting is that DOM Storage API is becoming popular very fast.

I'd say that's fairly true.  At the same time, I'm not sure it's a good thing or something we want to encourage.  LocalStorage is either going to be racy or limit concurrency by design.  There's likely no way for UAs to work around this.

> If people start implementing DOM Storage logic based on key/value (string/string) pair then future API modifications could be harder to maintain for web-application developers.

This change will be nearly backwards compatible.  The only way you could get in trouble is if you assume .getItem() is going to return a string (even though what you passed to .setItem() is not).  ...which is a bit worrisome, even if we made the change now (there are already a lot of people using it)...hm...

> At the same time.. How to get attention of other browser vendors in this regard?

Not sure.  File bugs and poke on mailing lists?


Btw, implementing this would be pretty easy for any V8+WebKit since we already have a way to get a string that represents a serialized script value (which could then be stored in SQLite).  JSC's serialized script value does not, however, have this ability.  So most of the work involved would be implementing that.

(If anyone is doing this, I'd like to encourage you to look at how the JSC and V8 versions of serialized script value could be factored together.  The JSC/V8 specific method calls are very similar, so I doubt there's a reason we need two completely different tree crawlers and wire formats.)

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list