Bug 68345

Summary: pop-state-event-constructor.html crashes and fails
Product: WebKit Reporter: Kentaro Hara <haraken>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, ap, beidson, dominicc, sam, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Failing test cases
none
Patch
none
Just updated ChangeLog
none
WIP patch to see if the patch passes efl build
none
patch for review
none
patch for commit
none
patch for commit none

Kentaro Hara
Reported 2011-09-19 02:54:43 PDT
I added pop-state-event-constructor.html in this bug (https://bugs.webkit.org/show_bug.cgi?id=67977), but some tests are crashing or failing. - The following test cases are failing, as you can see in the attached file. The IDL type of PopStateEvent.state should be 'any' (http://www.whatwg.org/specs/web-apps/current-work/#popstateevent), and the IDL spec of 'any' (http://www.w3.org/TR/WebIDL/#es-any) says that the following test cases should pass. FAIL new PopStateEvent('eventType', { state: '' }).state should be undefined (of type undefined). Was (of type string). FAIL new PopStateEvent('eventType', { state: object1 }).state should be [object Object]. Was [object Object]. FAIL new PopStateEvent('eventType', { state: {valueOf: function () { return object2; } } }).state should be [object Object]. Was [object Object]. FAIL new PopStateEvent('eventType', { bubbles: true, cancelable: true, state: object3 }).state should be [object Object]. Was [object Object]. - When we pass a DOM object (i.e. an unserializable object) as follows, then DRT crashes. This crash happens only in DRT. shouldBe("new PopStateEvent('eventType', { state: document }).state", "document"); The reason for these failures and crash is that PopStateEvent.state is implemented just as SeriazliedScriptValue, and thus it cannot handle ScriptValue. I am preparing a patch for fixing this.
Attachments
Failing test cases (2.04 KB, text/plain)
2011-09-19 02:55 PDT, Kentaro Hara
no flags
Patch (22.66 KB, patch)
2011-09-26 00:19 PDT, Kentaro Hara
no flags
Just updated ChangeLog (22.79 KB, patch)
2011-09-26 00:33 PDT, Kentaro Hara
no flags
WIP patch to see if the patch passes efl build (24.14 KB, patch)
2011-09-26 01:30 PDT, Kentaro Hara
no flags
patch for review (24.14 KB, patch)
2011-09-26 04:06 PDT, Kentaro Hara
no flags
patch for commit (24.20 KB, patch)
2011-09-26 17:29 PDT, Kentaro Hara
no flags
patch for commit (24.19 KB, patch)
2011-09-26 21:10 PDT, Kentaro Hara
no flags
Kentaro Hara
Comment 1 2011-09-19 02:55:31 PDT
Created attachment 107824 [details] Failing test cases
Kentaro Hara
Comment 2 2011-09-26 00:19:13 PDT
Kentaro Hara
Comment 3 2011-09-26 00:33:07 PDT
Created attachment 108633 [details] Just updated ChangeLog
Gyuyoung Kim
Comment 4 2011-09-26 00:43:50 PDT
Comment on attachment 108633 [details] Just updated ChangeLog Attachment 108633 [details] did not pass efl-ews (efl): Output: http://queues.webkit.org/results/9843772
Kentaro Hara
Comment 5 2011-09-26 01:30:48 PDT
Created attachment 108645 [details] WIP patch to see if the patch passes efl build
Kentaro Hara
Comment 6 2011-09-26 04:06:03 PDT
Created attachment 108651 [details] patch for review
Adam Barth
Comment 7 2011-09-26 11:52:08 PDT
Comment on attachment 108651 [details] patch for review View in context: https://bugs.webkit.org/attachment.cgi?id=108651&action=review > Source/WebCore/ChangeLog:17 > + popped from HistoryItem, but we cannot deserialize the SeriazliedScriptValue into SeriazliedScriptValue => SerializedScriptValue > Source/WebCore/ChangeLog:20 > + PopStateEvent still needs to provide an API to construct it with SeriazliedScriptValue. SeriazliedScriptValue > Source/WebCore/bindings/v8/custom/V8PopStateEventCustom.cpp:46 > + SerializedScriptValue* serializedState = event->serializedState(); > + return serializedState ? serializedState->deserialize() : event->state().v8Value(); Will this return undefined when the JSC version returns null? > Source/WebCore/dom/PopStateEvent.cpp:61 > + , m_state() We usually omit this declaration when we're just calling the default constructor.
Kentaro Hara
Comment 8 2011-09-26 17:29:59 PDT
Created attachment 108763 [details] patch for commit
Kentaro Hara
Comment 9 2011-09-26 21:10:39 PDT
Created attachment 108785 [details] patch for commit
Kentaro Hara
Comment 10 2011-09-26 21:13:06 PDT
Comment on attachment 108651 [details] patch for review View in context: https://bugs.webkit.org/attachment.cgi?id=108651&action=review >> Source/WebCore/ChangeLog:17 >> + popped from HistoryItem, but we cannot deserialize the SeriazliedScriptValue into > > SeriazliedScriptValue => SerializedScriptValue Thanks! Fixed. >> Source/WebCore/ChangeLog:20 >> + PopStateEvent still needs to provide an API to construct it with SeriazliedScriptValue. > > SeriazliedScriptValue Fixed. >> Source/WebCore/bindings/v8/custom/V8PopStateEventCustom.cpp:46 >> + return serializedState ? serializedState->deserialize() : event->state().v8Value(); > > Will this return undefined when the JSC version returns null? Sorry, fixed it. >> Source/WebCore/dom/PopStateEvent.cpp:61 >> + , m_state() > > We usually omit this declaration when we're just calling the default constructor. Omitted.
WebKit Review Bot
Comment 11 2011-09-26 23:26:11 PDT
Comment on attachment 108785 [details] patch for commit Clearing flags on attachment: 108785 Committed r96073: <http://trac.webkit.org/changeset/96073>
WebKit Review Bot
Comment 12 2011-09-26 23:26:17 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.