[Webkit-unassigned] [Bug 67977] Implement a PopStateEvent constructor for JSC

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Sep 14 22:08:33 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=67977


Kentaro Hara <haraken at chromium.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |haraken at chromium.org




--- Comment #3 from Kentaro Hara <haraken at chromium.org>  2011-09-14 22:08:33 PST ---
Question: Which should IDL 'any' be implemented as ScriptValue or SerializedScriptValue?

The spec says that the type of both PopStateEvent.state and CustomEvent.detail should be 'any' (http://www.whatwg.org/specs/web-apps/current-work/#popstateevent, http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#interface-customevent). However, in the current WebCore implementation, CustomEvent.state is implemented as ScriptValue (https://bugs.webkit.org/show_bug.cgi?id=67248), and PopStateEvent.detail is implemented as SerializedScriptValue. Which is correct?

If we use SerializedScriptValue, some tests violate the spec of IDL 'any' (http://www.w3.org/TR/WebIDL/#es-any), as you can see in the WIP patch.

> 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].

In addition, if we use SerializedScriptValue, the test crashes when we pass a DOM object. (I guess we can fix this crash, but we need to throw some exception anyway.)

> //shouldBe("new PopStateEvent('eventType', { state: document }).state", "document"); // Crash!!!

On the other hand, if we use ScriptValue, we can get correct test results.

With these observations, I guess that we should implement PopStateEvent.state as ScriptValue, but are there any problem to change it from SeriazliedScriptValue to ScriptValue?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list