Bug 103422
| Summary: | Optional second argument to TrackEvent constructor is not respected | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Antoine Quint <graouts> |
| Component: | Media | Assignee: | 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
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 | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/12758216>
Eric Carlson
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
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
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: {}});