| Summary: | AX: SpeechSynthesisUtterance cannot addEventListener | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | chris fleizach <cfleizach> | ||||
| Component: | Accessibility | Assignee: | chris fleizach <cfleizach> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | cdumez, commit-queue, esprehn+autocc, kondapallykalyan, mario, webkit-bug-importer | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | 528+ (Nightly build) | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Attachments: |
|
||||||
Created attachment 230358 [details]
patch
Comment on attachment 230358 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=230358&action=review It looks good to me, but please take into consideration my comments below (should they make sense to you too). Thanks! > Source/WebCore/Modules/speech/SpeechSynthesisUtterance.idl:40 > + void addEventListener(DOMString type, EventListener listener, optional boolean useCapture); > + void removeEventListener(DOMString type, EventListener listener, optional boolean useCapture); I know you probably don't need it for this specific case, but wouldn't it be a good idea to add EventTarget's dispatchEvent() here too, so the implementation of that interface is complete insite SpeechSynthesisUtterance? Also, for consistency with other IDLs (e.g. html/MediaController.idl, html/track/TextTrack.idl...), I guess I would add these methods to the end with a comment "// EventTarget interface" on top for clarity. http://trac.webkit.org/changeset/167933 Thanks Mario! |
According to the Web Speech API spec, the SpeechSynthesisUtterance is a subclass of EventTarget. Therefore it has event handler attributes like `onend` and `onresume`. However it did not implement the `addEventListener` method, so you cannot hook event handlers to an utterance instance via the more common way. Steps to Reproduce: 1. var u = new SpeechSynthesisUtterance("Test speech"); 2. u.addEventListener('end', function(e) { console.log(e); }); <rdar://problem/14887812>