WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
80513
Speech JavaScript API: SpeechRecognitionEvent
https://bugs.webkit.org/show_bug.cgi?id=80513
Summary
Speech JavaScript API: SpeechRecognitionEvent
Hans Wennborg
Reported
2012-03-07 07:43:55 PST
Speech JavaScript API: SpeechRecognitionEvent
Attachments
Patch
(13.35 KB, patch)
2012-03-07 07:48 PST
,
Hans Wennborg
no flags
Details
Formatted Diff
Diff
Patch
(13.36 KB, patch)
2012-03-08 06:33 PST
,
Hans Wennborg
no flags
Details
Formatted Diff
Diff
Patch
(27.32 KB, patch)
2012-03-09 10:24 PST
,
Hans Wennborg
abarth
: review+
abarth
: commit-queue-
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Hans Wennborg
Comment 1
2012-03-07 07:48:11 PST
Created
attachment 130625
[details]
Patch
Hans Wennborg
Comment 2
2012-03-08 06:33:33 PST
Created
attachment 130818
[details]
Patch Rebase, const-qualify readonly attribute getters, return raw pointers.
Adam Barth
Comment 3
2012-03-08 14:16:03 PST
Comment on
attachment 130818
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=130818&action=review
> Source/WebCore/Modules/speech/SpeechRecognitionEvent.idl:29 > + interface [ > + Conditional=SCRIPTED_SPEECH > + ] SpeechRecognitionEvent : Event {
Please use the ConstructorTemplate=Event and InitializedByEventConstructor:
https://trac.webkit.org/wiki/WebKitIDL#ConstructorTemplate
This will generate DOM4-style event constructors.
Adam Barth
Comment 4
2012-03-08 14:16:35 PST
+haraken because of ConstructorTemplate=Event
Adam Barth
Comment 5
2012-03-08 14:17:27 PST
Comment on
attachment 130818
[details]
Patch Once you have a DOM4-style event constructor, you can write tests that exercise this class. Note: you should also be able to exercise it with document.createEvent.
Kentaro Hara
Comment 6
2012-03-08 15:43:40 PST
Comment on
attachment 130818
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=130818&action=review
>> Source/WebCore/Modules/speech/SpeechRecognitionEvent.idl:29 >> + ] SpeechRecognitionEvent : Event { > > Please use the ConstructorTemplate=Event and InitializedByEventConstructor: > >
https://trac.webkit.org/wiki/WebKitIDL#ConstructorTemplate
> > This will generate DOM4-style event constructors.
And please add fast/events/constructors/speech-recognition-event-constructors.html for tests.
Hans Wennborg
Comment 7
2012-03-09 10:23:49 PST
(In reply to
comment #6
)
> (From update of
attachment 130818
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=130818&action=review
>
Thanks very much for the input!
> >> Source/WebCore/Modules/speech/SpeechRecognitionEvent.idl:29 > >> + ] SpeechRecognitionEvent : Event { > > > > Please use the ConstructorTemplate=Event and InitializedByEventConstructor: > > > >
https://trac.webkit.org/wiki/WebKitIDL#ConstructorTemplate
> > > > This will generate DOM4-style event constructors.
Done.
> > And please add fast/events/constructors/speech-recognition-event-constructors.html for tests.
Done. New patch coming up.
Hans Wennborg
Comment 8
2012-03-09 10:24:21 PST
Created
attachment 131057
[details]
Patch
Adam Barth
Comment 9
2012-03-09 14:45:23 PST
Comment on
attachment 131057
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=131057&action=review
> Source/WebCore/Modules/speech/SpeechRecognitionEvent.cpp:32 > +
You've got an extra blank line here.
> Source/WebCore/Modules/speech/SpeechRecognitionEvent.cpp:70 > +void SpeechRecognitionEvent::initSpeechRecognitionEvent(const AtomicString& type, bool canBubble, bool cancelable, SpeechRecognitionResult* result, SpeechRecognitionError* error, short resultIndex, SpeechRecognitionResultList* resultHistory)
Oh, you can skip these init functions. DOM4-style events don't need them because you can just construct the event directly. We've been removing them from the platform.
> Source/WebCore/Modules/speech/SpeechRecognitionEvent.idl:42 > + void initSpeechRecognitionEvent(in [Optional=DefaultIsUndefined] DOMString typeArg, > + in [Optional=DefaultIsUndefined] boolean canBubbleArg, > + in [Optional=DefaultIsUndefined] boolean cancelableArg, > + in [Optional=DefaultIsUndefined] SpeechRecognitionResult resultArg, > + in [Optional=DefaultIsUndefined] SpeechRecognitionError errorArg, > + in [Optional=DefaultIsUndefined] short resultIndexArg, > + in [Optional=DefaultIsUndefined] SpeechRecognitionResultList resultHistoryArg);
We should skip this. Sorry I didn't notice it in your previous patch.
> LayoutTests/fast/events/constructors/speech-recognition-event-constructor.html:30 > +// Test passing resultIndex in the initializer. > +shouldBe("new webkitSpeechRecognitionEvent('eventType', { resultIndex: 42 }).resultIndex", "42");
I mean, you can also test the other properties, but maybe that's not worth while.
Hans Wennborg
Comment 10
2012-03-12 04:25:56 PDT
(In reply to
comment #9
)
> (From update of
attachment 131057
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=131057&action=review
Thanks very much for the review!
> > Source/WebCore/Modules/speech/SpeechRecognitionEvent.cpp:32 > > + > > You've got an extra blank line here.
Done.
> > Source/WebCore/Modules/speech/SpeechRecognitionEvent.cpp:70 > > +void SpeechRecognitionEvent::initSpeechRecognitionEvent(const AtomicString& type, bool canBubble, bool cancelable, SpeechRecognitionResult* result, SpeechRecognitionError* error, short resultIndex, SpeechRecognitionResultList* resultHistory) > > Oh, you can skip these init functions. DOM4-style events don't need them because you can just construct the event directly. We've been removing them from the platform.
Done.
> > Source/WebCore/Modules/speech/SpeechRecognitionEvent.idl:42 > > + void initSpeechRecognitionEvent(in [Optional=DefaultIsUndefined] DOMString typeArg, > > + in [Optional=DefaultIsUndefined] boolean canBubbleArg, > > + in [Optional=DefaultIsUndefined] boolean cancelableArg, > > + in [Optional=DefaultIsUndefined] SpeechRecognitionResult resultArg, > > + in [Optional=DefaultIsUndefined] SpeechRecognitionError errorArg, > > + in [Optional=DefaultIsUndefined] short resultIndexArg, > > + in [Optional=DefaultIsUndefined] SpeechRecognitionResultList resultHistoryArg); > > We should skip this. Sorry I didn't notice it in your previous patch.
Done. It wasn't in the first patch. I copied it from StorageEvent.idl when adding ConstructorTemplate=Event, thinking maybe it was supposed to be there too. Thanks for clarifying.
> > LayoutTests/fast/events/constructors/speech-recognition-event-constructor.html:30 > > +// Test passing resultIndex in the initializer. > > +shouldBe("new webkitSpeechRecognitionEvent('eventType', { resultIndex: 42 }).resultIndex", "42"); > > I mean, you can also test the other properties, but maybe that's not worth while.
The SpeechRecognitionResult, Error and ResultList don't have constructors, so there's no straightforward way of testing those properties :/ Maybe I should just add constructors for them. Also realized I forgot to add this layout test to the Skipped files for the other ports. Doing that now.
Hans Wennborg
Comment 11
2012-03-12 04:28:24 PDT
Committed
r110420
: <
http://trac.webkit.org/changeset/110420
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug