Bug 49736

Summary: For speech input events, send an object containing all the recognition results and metadata.
Product: WebKit Reporter: Satish Sampath <satish>
Component: FormsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: buildbot, commit-queue, eric, jorlow
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 39485    
Attachments:
Description Flags
Patch
none
Patch for landing
none
Patch for landing
none
Patch for landing none

Description Satish Sampath 2010-11-18 08:54:19 PST
Currently the speech input event 'onwebkitspeechchange' receives no parameters. WebCore already has the full list of recognition results and populates only the top result into the input field automatically. In this patch we pass a SpeechInputEvent object to the event handler, and the JS code can access the full list of results via "event.results.length", "results[i].utterance" and "results[i].confidence".

To test multiple recognition results, I have replaced the 'setMockSpeechInputResult' methods with 'addMockSpeechInputResult' which can be called multiple times to add multiple results. This method also takes in the result's confidence value. The mock object in webCore has been updated, along with existing layout tests and a new test added.

I have placed some newly added speech input IDLs and headers under WebCore/page since that seemed most appropriate and previously added files are located there. I'm happy to move them if there is a better suggestion.
Comment 1 Satish Sampath 2010-11-18 09:07:17 PST
Created attachment 74243 [details]
Patch
Comment 2 Eric Seidel (no email) 2010-11-18 09:35:05 PST
Attachment 74243 [details] did not build on mac:
Build output: http://queues.webkit.org/results/6222057
Comment 3 Build Bot 2010-11-18 09:44:43 PST
Attachment 74243 [details] did not build on win:
Build output: http://queues.webkit.org/results/6123061
Comment 4 Jeremy Orlow 2010-11-22 03:24:28 PST
Comment on attachment 74243 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=74243&action=review

r=me

> WebCore/page/SpeechInputEvent.h:42
> +    ~SpeechInputEvent() {}

Please put this and the constructor in a .cpp.  With something like a RefPtr of Vectors, this could lead to a lot of blow up in .o file size for anything that includes this file.

> WebCore/page/SpeechInputResultList.h:54
> +    SpeechInputResultList(const SpeechInputResultArray& results)

ditto (and for the ~)
Comment 5 Satish Sampath 2010-11-22 04:41:29 PST
Created attachment 74540 [details]
Patch for landing
Comment 6 WebKit Commit Bot 2010-11-22 05:16:00 PST
Comment on attachment 74540 [details]
Patch for landing

Rejecting patch 74540 from commit-queue.

Failed to run "['./WebKitTools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '--bot-id=abarth-cq-sl', 'build', '--no-clean', '--no-update', '--build-style=both']" exit_code: 2
Last 500 characters of output:
_MINOR 0320
    setenv YACC /Developer/usr/bin/yacc
    /bin/sh -c /Users/abarth/git/webkit-queue/WebKitBuild/WebCore.build/Debug/WebCore.build/Script-5DF50887116F3077005202AB.sh

** BUILD FAILED **


The following build commands failed:
WebCore:
	CompileC /Users/abarth/git/webkit-queue/WebKitBuild/WebCore.build/Debug/WebCore.build/Objects-normal/x86_64/JSEventCustom.o /Users/abarth/git/webkit-queue/WebCore/bindings/js/JSEventCustom.cpp normal x86_64 c++ com.apple.compilers.gcc.4_2
(1 failure)


Full output: http://queues.webkit.org/results/6274062
Comment 7 Satish Sampath 2010-11-22 06:40:00 PST
Created attachment 74546 [details]
Patch for landing
Comment 8 WebKit Commit Bot 2010-11-22 07:21:51 PST
Comment on attachment 74546 [details]
Patch for landing

Rejecting patch 74546 from commit-queue.

Failed to run "['./WebKitTools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '--bot-id=abarth-cq-sl', 'build', '--no-clean', '--no-update', '--build-style=both']" exit_code: 2
Last 500 characters of output:
ebug/WebCore.build/Objects-normal/x86_64/JSSpeechInputResult.o /Users/abarth/git/webkit-queue/WebKitBuild/Debug/DerivedSources/WebCore/JSSpeechInputResult.cpp normal x86_64 c++ com.apple.compilers.gcc.4_2
	CompileC /Users/abarth/git/webkit-queue/WebKitBuild/WebCore.build/Debug/WebCore.build/Objects-normal/x86_64/JSSpeechInputResultList.o /Users/abarth/git/webkit-queue/WebKitBuild/Debug/DerivedSources/WebCore/JSSpeechInputResultList.cpp normal x86_64 c++ com.apple.compilers.gcc.4_2
(4 failures)


Full output: http://queues.webkit.org/results/6272057
Comment 9 Satish Sampath 2010-11-22 07:50:29 PST
Created attachment 74553 [details]
Patch for landing
Comment 10 WebKit Commit Bot 2010-11-22 08:43:31 PST
Comment on attachment 74553 [details]
Patch for landing

Rejecting patch 74553 from commit-queue.

Failed to run "['./WebKitTools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '--bot-id=eseidel-cq-sl', 'build', '--no-clean', '--no-update', '--build-style=both']" exit_code: 2
Last 500 characters of output:
Element.cpp normal x86_64 c++ com.apple.compilers.gcc.4_2
(26 failures)


Failed to run "['WebKitTools/Scripts/build-webkit', '--release']" exit_code: 1
nsitionEvent.cpp normal x86_64 c++ com.apple.compilers.gcc.4_2
	CompileC /Projects/CommitQueue/WebKitBuild/WebCore.build/Release/WebCore.build/Objects-normal/x86_64/JSSVGFEMorphologyElement.o /Projects/CommitQueue/WebKitBuild/Release/DerivedSources/WebCore/JSSVGFEMorphologyElement.cpp normal x86_64 c++ com.apple.compilers.gcc.4_2
(26 failures)


Full output: http://queues.webkit.org/results/6281054
Comment 11 Satish Sampath 2010-11-22 09:02:05 PST
Comment on attachment 74553 [details]
Patch for landing

I can't find out why this patch doesn't pass through commit queue (no useful error messages shown in the CQ build log). This patch builds fine in my mac with 'build-webkit --release'. Any suggestions?
Comment 12 Satish Sampath 2010-11-23 02:02:33 PST
Committed r72591: <http://trac.webkit.org/changeset/72591>
Comment 13 Eric Seidel (no email) 2010-12-10 22:29:02 PST
Comment on attachment 74553 [details]
Patch for landing

Cleared review? from attachment 74553 [details] so that this bug does not appear in http://webkit.org/pending-review.  If you would like this patch reviewed, please attach it to a new bug (or re-open this bug before marking it for review again).