Bug 28942 - [V8] DOM Storage bindings: Event Handler should create StorageEvents
Summary: [V8] DOM Storage bindings: Event Handler should create StorageEvents
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Ben Murdoch
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-03 03:46 PDT by Ben Murdoch
Modified: 2009-09-04 03:28 PDT (History)
2 users (show)

See Also:


Attachments
Proposed patch (2.07 KB, patch)
2009-09-03 04:53 PDT, Ben Murdoch
eric: review-
Details | Formatted Diff | Diff
Rejigged Changelog (2.97 KB, patch)
2009-09-04 02:55 PDT, Ben Murdoch
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Murdoch 2009-09-03 03:46:07 PDT
On Android we're failing a set of DOM storage layout tests when running with V8. It seems that the event handling code in V8DOMWrapper.cpp does not generate Storage Events and the code in the custom storage binding (V8StorageCustom.cpp) ignores the length attribute in the setter but not in the getter.
Comment 1 Ben Murdoch 2009-09-03 04:53:32 PDT
Created attachment 38981 [details]
Proposed patch
Comment 2 Jeremy Orlow 2009-09-03 07:44:26 PDT
In what cases do we do the wrong thing for length?  IIRC, I tested these scenarios pretty carefully and found that it wasn't necessary, but that was a while ago.  If there are any, could you please add a layout test to verify the behavior?  If not, I think we should leave it as is.
Comment 3 Jeremy Orlow 2009-09-03 08:09:51 PDT
Nm.  Apparently we're failing one that we're excluding right now for chrome and this fixes it.  :-)
Comment 4 Ben Murdoch 2009-09-03 08:18:13 PDT
(In reply to comment #3)
> Nm.  Apparently we're failing one that we're excluding right now for chrome and
> this fixes it.  :-)

Yes -- just to follow up it's the storage/domstorage/localstorage/complex-keys.html test I was seeing fail. The problem is that in the binding for name/indexed property setters, we silently ignore cases when trying to set the length property but we do create a new property named 'length' if it is set through the setItem function. Now in that layout test after calling setItem("length", 0) on line 92, we query the length through a named and indexed access and as we do not special case length in the indexed/named getter of the bindings we end up returning the value 0 (as in the property we added through setItem), rather than actual number of items in the object as the layout test result expects.
Comment 5 Eric Seidel (no email) 2009-09-04 00:23:58 PDT
Comment on attachment 38981 [details]
Proposed patch

The ChnageLog should list the tests that this changes/causes v8 to pass.  If there are no tests, then this change needs tests. :(
Comment 6 Ben Murdoch 2009-09-04 02:55:35 PDT
Created attachment 39048 [details]
Rejigged Changelog

Added tests that now pass to the changelog.
Comment 7 Eric Seidel (no email) 2009-09-04 03:15:34 PDT
Comment on attachment 39048 [details]
Rejigged Changelog

LGTM.  I can't remember if you're a committer, assuming not, cq+.
Comment 8 Ben Murdoch 2009-09-04 03:17:54 PDT
(In reply to comment #7)
> (From update of attachment 39048 [details])
> LGTM.  I can't remember if you're a committer, assuming not, cq+.

Thanks - I am a committer, should be fine to let the cq handle this one though.
Comment 9 Eric Seidel (no email) 2009-09-04 03:28:40 PDT
Comment on attachment 39048 [details]
Rejigged Changelog

Clearing flags on attachment: 39048

Committed r48047: <http://trac.webkit.org/changeset/48047>
Comment 10 Eric Seidel (no email) 2009-09-04 03:28:44 PDT
All reviewed patches have been landed.  Closing bug.