Bug 19111
| Summary: | Storage interface data should be removed when using delete | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Nicholas C. Zakas <webkit> |
| Component: | WebCore Misc. | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | beidson |
| Priority: | P2 | ||
| Version: | 528+ (Nightly build) | ||
| Hardware: | PC | ||
| OS: | OS X 10.5 | ||
Nicholas C. Zakas
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.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Brady Eidson
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?
Brady Eidson
If we decide to fix this, there's no reason it will be SessionStorage-only - it will be all Storage interfaces
Brady Eidson
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...
Brady Eidson
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
Brady Eidson
Landed r33565