Bug 103422

Summary: Optional second argument to TrackEvent constructor is not respected
Product: WebKit Reporter: Antoine Quint <graouts>
Component: MediaAssignee: Nobody <webkit-unassigned>
Status: UNCONFIRMED    
Severity: Normal CC: eric.carlson, graouts, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
URL: http://w3c-test.org/html/tests/submission/Opera/media/interfaces/TrackEvent/constructor.html

Antoine Quint
Reported 2012-11-27 08:42:29 PST
We're failing the Opera-submitted test at http://w3c-test.org/html/tests/submission/Opera/media/interfaces/TrackEvent/constructor.html. The second test fails because it looks like we don't support the optional second argument to the TrackEvent constructor. It looks like this is a newer feature of the Event interface, and we may not support that in WebCore at all.
Attachments
Radar WebKit Bug Importer
Comment 1 2012-11-27 08:42:51 PST
Eric Carlson
Comment 2 2012-11-27 09:48:05 PST
WebKit does support the new Event interface generally and TrackEvent supports the 'track' property, see LayoutTests/fast/events/constructors/track-event-constructor.html.
Eric Carlson
Comment 3 2012-11-27 10:15:44 PST
The Opera test fails because we only allow a valid Track object as the 'track' property, see JSDictionary::convertValue(ExecState*, JSValue, RefPtr<TrackBase>&). track-event-constructor.html tests that non-track objects are not allowed in the initializer. If this is not the right thing to do we probably have the same problem with other event types that take an initializer.
Antoine Quint
Comment 4 2012-11-28 02:39:58 PST
The IDL (per http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#trackevent) is as follows: [Constructor(DOMString type, optional TrackEventInit eventInitDict)] interface TrackEvent : Event { readonly attribute object? track; }; dictionary TrackEventInit : EventInit { object? track; }; … so it looks like the optional TrackEventInit parameter allows any object to be the value of the "track" property. So it looks like providing just a vanilla JS object as the track by calling the following should work: var event = new TrackEvent('foo', {track: {}});
Note You need to log in before you can comment on or make changes to this bug.