Bug 73125 - StorageEvent.key should not be nullable
Summary: StorageEvent.key should not be nullable
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kentaro Hara
URL:
Keywords:
Depends on:
Blocks: 71685
  Show dependency treegraph
 
Reported: 2011-11-25 05:03 PST by Kentaro Hara
Modified: 2011-11-30 00:08 PST (History)
5 users (show)

See Also:


Attachments
test cases (409 bytes, text/html)
2011-11-25 05:03 PST, Kentaro Hara
no flags Details
Patch (8.10 KB, patch)
2011-11-25 05:31 PST, Kentaro Hara
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kentaro Hara 2011-11-25 05:03:32 PST
Created attachment 116600 [details]
test cases

Currently, document.createEvent('StorageEvent').key is evaluated as null. However, the spec (http://www.whatwg.org/specs/web-apps/current-work/#storageevent) says that StorageEvent.key is not a nullable type, and thus document.createEvent('StorageEvent').key should be '' (an empty string).

I attached test cases. The results of the test cases are as follows:

According to the spec:
document.createEvent('StorageEvent').key => ""
document.createEvent('StorageEvent').oldValue => "null"
document.createEvent('StorageEvent').newValue => "null"
document.createEvent('StorageEvent').url => ""

Chromium 16.0.912.41 beta (WebKit r100218):
document.createEvent('StorageEvent').key => "null"
document.createEvent('StorageEvent').oldValue => "null"
document.createEvent('StorageEvent').newValue => "null"
document.createEvent('StorageEvent').url => ""

Opera 11.52:
document.createEvent('StorageEvent').key => "undefined"
document.createEvent('StorageEvent').oldValue => "undefined"
document.createEvent('StorageEvent').newValue => "undefined"
document.createEvent('StorageEvent').url => ""

Firefox 8.0.1:
(Not implemented)

IE 9.0.8.112:
(Not implemented)

In this way, all browsers behave differently. Therefore I think that it is reasonable for WebKit to follow the spec.
Comment 1 Kentaro Hara 2011-11-25 05:31:59 PST
Created attachment 116605 [details]
Patch
Comment 2 WebKit Review Bot 2011-11-30 00:08:02 PST
Comment on attachment 116605 [details]
Patch

Clearing flags on attachment: 116605

Committed r101453: <http://trac.webkit.org/changeset/101453>
Comment 3 WebKit Review Bot 2011-11-30 00:08:07 PST
All reviewed patches have been landed.  Closing bug.