Bug 19111 - Storage interface data should be removed when using delete
Summary: Storage interface data should be removed when using delete
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-18 12:22 PDT by Nicholas C. Zakas
Modified: 2008-05-18 16:52 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicholas C. Zakas 2008-05-18 12:22:01 PDT
In sessionStorage, you should be able to remove data like this:

delete sessionStorage.name;

This doesn't work in WebKit, you using removeItem() works fine. The delete operator usage is supported in both Firefox 2+ and Internet Explorer 8.
Comment 1 Brady Eidson 2008-05-18 14:30:42 PDT
In hitting up the spec to see if it mentions the delete storage.property; syntax as an alias for removeItem(property), I see that the specific mentioning of enumeration and property matching in general has been stricken.

I wonder when this happened?
Comment 2 Brady Eidson 2008-05-18 14:40:34 PDT
If we decide to fix this, there's no reason it will be SessionStorage-only - it will be all Storage interfaces
Comment 3 Brady Eidson 2008-05-18 15:20:57 PDT
I did a little exploring into some recent revisions of the spec and tracked down why the enumeration stuff was removed.

I've emailed WHATWG about that omission and also to raise the point about the delete syntax -
http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2008-May/014848.html

In the meantime, I can't see the harm in supporting this...
Comment 4 Brady Eidson 2008-05-18 15:36:16 PDT
Hixie confirmed on IRC that the [XXX] placeholder in the storage interface is meant to imply delete support on removeItem().

I'm adding this now while I have a few free cycles
Comment 5 Brady Eidson 2008-05-18 16:52:45 PDT
Landed r33565