[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

satish at chromium.org satish at chromium.org
Wed Dec 22 16:24:52 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit a739a241046bc1407977848461aed957bee65701
Author: satish at chromium.org <satish at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Nov 23 10:01:52 2010 +0000

    2010-11-18  Satish Sampath  <satish at chromium.org>
    
            Reviewed by Jeremy Orlow.
    
            For speech input event, send an event object containing all the recognition results and metadata.
            https://bugs.webkit.org/show_bug.cgi?id=49736
    
            * fast/speech/input-onspeechchange-event-expected.txt: Added.
            * fast/speech/input-onspeechchange-event.html: New test to check multiple results.
            * fast/speech/input-text-language-tag.html: Updated with new method signature.
            * fast/speech/input-text-speechbutton.html: Ditto.
            * fast/speech/speech-button-ignore-generated-events.html: Ditto.
    2010-11-18  Satish Sampath  <satish at chromium.org>
    
            Reviewed by Jeremy Orlow.
    
            For speech input event, send an event object containing all the recognition results and metadata.
            https://bugs.webkit.org/show_bug.cgi?id=49736
    
            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". Also updated mock object with appropriate methods to test multiple results.
    
            Test: fast/speech/input-onspeechchange-event.html
    
            * CMakeLists.txt:
            * GNUmakefile.am:
            * WebCore.gypi:
            * WebCore.pri:
            * WebCore.pro:
            * WebCore.xcodeproj/project.pbxproj:
            * bindings/js/JSEventCustom.cpp:
            (WebCore::toJS): Added new event
            * bindings/v8/custom/V8EventCustom.cpp:
            (WebCore::toV8): Added new event
            * dom/Event.cpp:
            (WebCore::Event::isSpeechInputEvent):
            * dom/Event.h:
            * html/HTMLInputElement.cpp:
            * html/HTMLInputElement.h:
            * page/SpeechInputEvent.h: New file implementing SpeechInputEvent.idl
            (WebCore::SpeechInputEvent::~SpeechInputEvent):
            (WebCore::SpeechInputEvent::create):
            (WebCore::SpeechInputEvent::isSpeechInputEvent):
            (WebCore::SpeechInputEvent::results):
            (WebCore::SpeechInputEvent::SpeechInputEvent):
            * page/SpeechInputEvent.idl: New file defining SpeechInputEvent object
            * page/SpeechInputListener.h:
            * page/SpeechInputResult.cpp:
            (WebCore::SpeechInputResult::create):
            * page/SpeechInputResult.h:
            * page/SpeechInputResult.idl: New file defining a single SpeechInputResult object
            * page/SpeechInputResultList.h: New file implementing SpeechInputResultList.idl
            (WebCore::SpeechInputResultList::create):
            (WebCore::SpeechInputResultList::length):
            (WebCore::SpeechInputResultList::item):
            (WebCore::SpeechInputResultList::SpeechInputResultList):
            * page/SpeechInputResultList.idl: New file defining a list of SpeechInputResult objects
            * platform/mock/SpeechInputClientMock.cpp:
            (WebCore::SpeechInputClientMock::addRecognitionResult): Renamed method and added one parameter.
            (WebCore::SpeechInputClientMock::clearResults):
            (WebCore::SpeechInputClientMock::timerFired):
            * platform/mock/SpeechInputClientMock.h:
            * rendering/TextControlInnerElements.cpp:
            (WebCore::InputFieldSpeechButtonElement::setRecognitionResult): Pass new event object to handler.
    2010-11-18  Satish Sampath  <satish at chromium.org>
    
            Reviewed by Jeremy Orlow.
    
            For speech input event, send an event object containing all the recognition results and metadata.
            https://bugs.webkit.org/show_bug.cgi?id=49736
    
            Updated mock object's method to new signature.
    
            * public/WebSpeechInputControllerMock.h:
            * src/WebSpeechInputControllerMockImpl.cpp:
            (WebKit::WebSpeechInputControllerMockImpl::addMockRecognitionResult):
            * src/WebSpeechInputControllerMockImpl.h:
    2010-11-18  Satish Sampath  <satish at chromium.org>
    
            Reviewed by Jeremy Orlow.
    
            For speech input event, send an event object containing all the recognition results and metadata.
            https://bugs.webkit.org/show_bug.cgi?id=49736
    
            Updated DRT by renaming the mock result method on all platforms to the new signature.
    
            * DumpRenderTree/LayoutTestController.cpp:
            (addMockSpeechInputResultCallback):
            (LayoutTestController::staticFunctions):
            * DumpRenderTree/LayoutTestController.h:
            * DumpRenderTree/chromium/LayoutTestController.cpp:
            (LayoutTestController::LayoutTestController):
            (LayoutTestController::addMockSpeechInputResult):
            * DumpRenderTree/chromium/LayoutTestController.h:
            * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
            (LayoutTestController::addMockSpeechInputResult):
            * DumpRenderTree/mac/LayoutTestControllerMac.mm:
            (LayoutTestController::addMockSpeechInputResult):
            * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
            (LayoutTestController::addMockSpeechInputResult):
            * DumpRenderTree/qt/LayoutTestControllerQt.h:
            * DumpRenderTree/win/LayoutTestControllerWin.cpp:
            (LayoutTestController::addMockSpeechInputResult):
            * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
            (LayoutTestController::addMockSpeechInputResult):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72591 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 18bfa41..90e1419 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,16 @@
+2010-11-18  Satish Sampath  <satish at chromium.org>
+
+        Reviewed by Jeremy Orlow.
+
+        For speech input event, send an event object containing all the recognition results and metadata.
+        https://bugs.webkit.org/show_bug.cgi?id=49736
+
+        * fast/speech/input-onspeechchange-event-expected.txt: Added.
+        * fast/speech/input-onspeechchange-event.html: New test to check multiple results.
+        * fast/speech/input-text-language-tag.html: Updated with new method signature.
+        * fast/speech/input-text-speechbutton.html: Ditto.
+        * fast/speech/speech-button-ignore-generated-events.html: Ditto.
+
 2010-11-22  Alexey Proskuryakov  <ap at apple.com>
 
         Reviewed by Darin Adler.
diff --git a/LayoutTests/fast/speech/input-onspeechchange-event-expected.txt b/LayoutTests/fast/speech/input-onspeechchange-event-expected.txt
new file mode 100644
index 0000000..b3328d4
--- /dev/null
+++ b/LayoutTests/fast/speech/input-onspeechchange-event-expected.txt
@@ -0,0 +1,16 @@
+Tests for the onspeechchange event with <input type="text" speech>.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS document.getElementById("speechInput").value is "Green eggs and ham"
+PASS window.event.results.length is 3
+PASS window.event.results[0].utterance is "Green eggs and ham"
+PASS window.event.results[0].confidence is 0.8
+PASS window.event.results[1].utterance is "Green x and ham"
+PASS window.event.results[1].confidence is 0.5
+PASS window.event.results[2].utterance is "3 x and am"
+PASS window.event.results[2].confidence is 0.2
+PASS successfullyParsed is true
+
+TEST COMPLETE
diff --git a/LayoutTests/fast/speech/input-onspeechchange-event.html b/LayoutTests/fast/speech/input-onspeechchange-event.html
new file mode 100644
index 0000000..15aa147
--- /dev/null
+++ b/LayoutTests/fast/speech/input-onspeechchange-event.html
@@ -0,0 +1,48 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../js/resources/js-test-style.css">
+<script src="../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script type="text/javascript">
+description('Tests for the onspeechchange event with &lt;input type="text" speech>.');
+
+function onSpeechChange() {
+    shouldBeEqualToString('document.getElementById("speechInput").value', 'Green eggs and ham');
+    shouldEvaluateTo('window.event.results.length', 3);
+    shouldBeEqualToString('window.event.results[0].utterance', 'Green eggs and ham');
+    shouldEvaluateTo('window.event.results[0].confidence', 0.8);
+    shouldBeEqualToString('window.event.results[1].utterance', 'Green x and ham');
+    shouldEvaluateTo('window.event.results[1].confidence', 0.5);
+    shouldBeEqualToString('window.event.results[2].utterance', '3 x and am');
+    shouldEvaluateTo('window.event.results[2].confidence', 0.2);
+    finishJSTest();
+}
+
+function run() {
+    if (window.layoutTestController && window.eventSender) {
+        layoutTestController.addMockSpeechInputResult('Green eggs and ham', 0.8, '');
+        layoutTestController.addMockSpeechInputResult('Green x and ham', 0.5, '');
+        layoutTestController.addMockSpeechInputResult('3 x and am', 0.2, '');
+
+        // Clicking the speech button should fill in mock speech-recognized text.
+        var input = document.getElementById('speechInput');
+        var x = input.offsetLeft + input.offsetWidth - 4;
+        var y = input.offsetTop + input.offsetHeight / 2;
+        eventSender.mouseMoveTo(x, y);
+        eventSender.mouseDown();
+        eventSender.mouseUp();
+    }
+}
+
+window.onload = run;
+window.jsTestIsAsync = true;
+window.successfullyParsed = true;
+</script>
+<script src="../js/resources/js-test-post.js"></script>
+<input id='speechInput' x-webkit-speech onwebkitspeechchange="onSpeechChange()">
+</body>
+</html>
diff --git a/LayoutTests/fast/speech/input-text-language-tag.html b/LayoutTests/fast/speech/input-text-language-tag.html
index b452661..fdf5868 100644
--- a/LayoutTests/fast/speech/input-text-language-tag.html
+++ b/LayoutTests/fast/speech/input-text-language-tag.html
@@ -38,8 +38,8 @@ function speechButtonClick(elementId) {
 
 function run() {
     if (window.layoutTestController && window.eventSender) {
-        layoutTestController.setMockSpeechInputResult('Pictures of the moon', 'en-GB');
-        layoutTestController.setMockSpeechInputResult('月の写真', 'ja');
+        layoutTestController.addMockSpeechInputResult('Pictures of the moon', 1.0, 'en-GB');
+        layoutTestController.addMockSpeechInputResult('月の写真', 1.0, 'ja');
         speechButtonClick('speechInputNone');
     }
 }
diff --git a/LayoutTests/fast/speech/input-text-speechbutton.html b/LayoutTests/fast/speech/input-text-speechbutton.html
index cef7705..351a953 100644
--- a/LayoutTests/fast/speech/input-text-speechbutton.html
+++ b/LayoutTests/fast/speech/input-text-speechbutton.html
@@ -32,7 +32,7 @@ function onWebkitSpeechChange() {
 
 function run() {
     if (window.layoutTestController && window.eventSender) {
-        layoutTestController.setMockSpeechInputResult('Pictures of the moon', '');
+        layoutTestController.addMockSpeechInputResult('Pictures of the moon', 1.0, '');
 
         // Clicking the speech button should fill in mock speech-recognized text.
         var input = document.getElementById('speechInput');
diff --git a/LayoutTests/fast/speech/speech-button-ignore-generated-events.html b/LayoutTests/fast/speech/speech-button-ignore-generated-events.html
index c684863..12bea5e 100644
--- a/LayoutTests/fast/speech/speech-button-ignore-generated-events.html
+++ b/LayoutTests/fast/speech/speech-button-ignore-generated-events.html
@@ -49,7 +49,7 @@ function setupDispatchEventTest() {
 function run() {
     if (window.layoutTestController && window.eventSender) {
         // Running in DRT, test the eventSender case.
-        layoutTestController.setMockSpeechInputResult('Pictures of the moon', '');
+        layoutTestController.addMockSpeechInputResult('Pictures of the moon', 1.0, '');
         document.getElementById('speechInput').onwebkitspeechchange = function() {
             shouldBeEqualToString('document.getElementById("speechInput").value', 'Pictures of the moon');
 
diff --git a/LayoutTests/platform/chromium/test_expectations.txt b/LayoutTests/platform/chromium/test_expectations.txt
index dc89781..9f96353 100644
--- a/LayoutTests/platform/chromium/test_expectations.txt
+++ b/LayoutTests/platform/chromium/test_expectations.txt
@@ -3208,3 +3208,8 @@ BUGCR64129 MAC DEBUG : fast/files/revoke-blob-url.html = CRASH PASS
 // Test added with http://trac.webkit.org/changeset/72504 needs better expectations for Chromium.
 BUGWK4989 WIN LINUX : fast/css/font-face-data-uri.html = TEXT
 
+// Remove these once the Chromium side has caught on with multiple speech input results.
+BUG49736 : fast/speech/input-onspeechchange-event.html = TEXT
+BUG49736 : fast/speech/input-text-language-tag.html = TEXT
+BUG49736 : fast/speech/input-text-speechbutton.html = TEXT
+BUG49736 : fast/speech/speech-button-ignore-generated-events.html = TEXT
diff --git a/WebCore/CMakeLists.txt b/WebCore/CMakeLists.txt
index 09226cb..58d8066 100644
--- a/WebCore/CMakeLists.txt
+++ b/WebCore/CMakeLists.txt
@@ -330,6 +330,9 @@ SET(WebCore_IDL_FILES
     page/PerformanceTiming.idl
     page/PositionError.idl
     page/Screen.idl
+    page/SpeechInputEvent.idl
+    page/SpeechInputResult.idl
+    page/SpeechInputResultList.idl
     page/WebKitPoint.idl
     page/WorkerNavigator.idl
 
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 61216ac..5400977 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,59 @@
+2010-11-18  Satish Sampath  <satish at chromium.org>
+
+        Reviewed by Jeremy Orlow.
+
+        For speech input event, send an event object containing all the recognition results and metadata.
+        https://bugs.webkit.org/show_bug.cgi?id=49736
+
+        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". Also updated mock object with appropriate methods to test multiple results.
+
+        Test: fast/speech/input-onspeechchange-event.html
+
+        * CMakeLists.txt:
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pri:
+        * WebCore.pro:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSEventCustom.cpp:
+        (WebCore::toJS): Added new event
+        * bindings/v8/custom/V8EventCustom.cpp:
+        (WebCore::toV8): Added new event
+        * dom/Event.cpp:
+        (WebCore::Event::isSpeechInputEvent):
+        * dom/Event.h:
+        * html/HTMLInputElement.cpp:
+        * html/HTMLInputElement.h:
+        * page/SpeechInputEvent.h: New file implementing SpeechInputEvent.idl
+        (WebCore::SpeechInputEvent::~SpeechInputEvent):
+        (WebCore::SpeechInputEvent::create):
+        (WebCore::SpeechInputEvent::isSpeechInputEvent):
+        (WebCore::SpeechInputEvent::results):
+        (WebCore::SpeechInputEvent::SpeechInputEvent):
+        * page/SpeechInputEvent.idl: New file defining SpeechInputEvent object
+        * page/SpeechInputListener.h:
+        * page/SpeechInputResult.cpp:
+        (WebCore::SpeechInputResult::create):
+        * page/SpeechInputResult.h:
+        * page/SpeechInputResult.idl: New file defining a single SpeechInputResult object
+        * page/SpeechInputResultList.h: New file implementing SpeechInputResultList.idl
+        (WebCore::SpeechInputResultList::create):
+        (WebCore::SpeechInputResultList::length):
+        (WebCore::SpeechInputResultList::item):
+        (WebCore::SpeechInputResultList::SpeechInputResultList):
+        * page/SpeechInputResultList.idl: New file defining a list of SpeechInputResult objects
+        * platform/mock/SpeechInputClientMock.cpp:
+        (WebCore::SpeechInputClientMock::addRecognitionResult): Renamed method and added one parameter.
+        (WebCore::SpeechInputClientMock::clearResults):
+        (WebCore::SpeechInputClientMock::timerFired):
+        * platform/mock/SpeechInputClientMock.h:
+        * rendering/TextControlInnerElements.cpp:
+        (WebCore::InputFieldSpeechButtonElement::setRecognitionResult): Pass new event object to handler.
+
 2010-11-22  Alexey Proskuryakov  <ap at apple.com>
 
         Reviewed by Darin Adler.
diff --git a/WebCore/DerivedSources.make b/WebCore/DerivedSources.make
index 5b0fb09..c2a15f7 100644
--- a/WebCore/DerivedSources.make
+++ b/WebCore/DerivedSources.make
@@ -304,6 +304,9 @@ DOM_CLASSES = \
     SharedWorkerContext \
     ScriptProfile \
     ScriptProfileNode \
+    SpeechInputEvent \
+    SpeechInputResult \
+    SpeechInputResultList \
     SQLError \
     SQLException \
     SQLResultSet \
diff --git a/WebCore/GNUmakefile.am b/WebCore/GNUmakefile.am
index 5870d94..9f28a30 100644
--- a/WebCore/GNUmakefile.am
+++ b/WebCore/GNUmakefile.am
@@ -497,6 +497,12 @@ webcore_built_sources += \
 	DerivedSources/WebCore/JSSharedWorkerContext.h \
 	DerivedSources/WebCore/JSSharedWorker.cpp \
 	DerivedSources/WebCore/JSSharedWorker.h \
+	DerivedSources/WebCore/JSSpeechInputEvent.cpp \
+	DerivedSources/WebCore/JSSpeechInputEvent.h \
+	DerivedSources/WebCore/JSSpeechInputResult.cpp \
+	DerivedSources/WebCore/JSSpeechInputResult.h \
+	DerivedSources/WebCore/JSSpeechInputResultList.cpp \
+	DerivedSources/WebCore/JSSpeechInputResultList.h \
 	DerivedSources/WebCore/JSStyleMedia.cpp \
 	DerivedSources/WebCore/JSStyleMedia.h \
 	DerivedSources/WebCore/JSStyleSheet.cpp \
@@ -2171,11 +2177,15 @@ webcore_sources += \
 	WebCore/page/SpatialNavigation.cpp \
 	WebCore/page/SpatialNavigation.h \
 	WebCore/page/SpeechInputClient.h \
+	WebCore/page/SpeechInputEvent.cpp \
+	WebCore/page/SpeechInputEvent.h \
 	WebCore/page/SpeechInput.cpp \
 	WebCore/page/SpeechInput.h \
 	WebCore/page/SpeechInputListener.h \
 	WebCore/page/SpeechInputResult.cpp \
 	WebCore/page/SpeechInputResult.h \
+	WebCore/page/SpeechInputResultList.cpp \
+	WebCore/page/SpeechInputResultList.h \
 	WebCore/page/SuspendableTimer.cpp \
 	WebCore/page/SuspendableTimer.h \
 	WebCore/page/UserContentTypes.h \
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index 705103b..cbf7814 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -251,6 +251,9 @@
             'page/PerformanceTiming.idl',
             'page/PositionError.idl',
             'page/Screen.idl',
+            'page/SpeechInputEvent.idl',
+            'page/SpeechInputResult.idl',
+            'page/SpeechInputResultList.idl',
             'page/WebKitPoint.idl',
             'page/WorkerNavigator.idl',
             'plugins/DOMMimeType.idl',
@@ -2303,9 +2306,13 @@
             'page/SpeechInput.cpp',
             'page/SpeechInput.h',
             'page/SpeechInputClient.h',
+            'page/SpeechInputEvent.cpp',
+            'page/SpeechInputEvent.h',
             'page/SpeechInputListener.h',
             'page/SpeechInputResult.cpp',
             'page/SpeechInputResult.h',
+            'page/SpeechInputResultList.cpp',
+            'page/SpeechInputResultList.h',
             'page/SuspendableTimer.cpp',
             'page/SuspendableTimer.h',
             'page/UserContentURLPattern.cpp',
diff --git a/WebCore/WebCore.pri b/WebCore/WebCore.pri
index fa73ca4..f8cea41 100644
--- a/WebCore/WebCore.pri
+++ b/WebCore/WebCore.pri
@@ -312,6 +312,9 @@ IDL_BINDINGS += \
     page/PerformanceTiming.idl \
     page/PositionError.idl \
     page/Screen.idl \
+    page/SpeechInputEvent.idl \
+    page/SpeechInputResult.idl \
+    page/SpeechInputResultList.idl \
     page/WebKitPoint.idl \
     page/WorkerNavigator.idl \
     plugins/DOMPlugin.idl \
diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro
index a980293..1067ce2 100644
--- a/WebCore/WebCore.pro
+++ b/WebCore/WebCore.pro
@@ -2025,8 +2025,10 @@ HEADERS += \
     page/SpatialNavigation.h \
     page/SpeechInput.h \
     page/SpeechInputClient.h \
+    page/SpeechInputEvent.h \
     page/SpeechInputListener.h \
     page/SpeechInputResult.h \
+    page/SpeechInputResultList.h \
     page/WindowFeatures.h \
     page/WorkerNavigator.h \
     page/XSSAuditor.h \
@@ -3149,7 +3151,9 @@ contains(DEFINES, ENABLE_SHARED_WORKERS=1) {
 contains(DEFINES, ENABLE_INPUT_SPEECH=1) {
     SOURCES += \
         page/SpeechInput.cpp \
+        page/SpeechInputEvent.cpp \
         page/SpeechInputResult.cpp \
+        page/SpeechInputResultList.cpp \
         rendering/RenderInputSpeech.cpp
 }
 
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index 52b8a1e..2316cef 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -1512,6 +1512,16 @@
 		7535BC9512020CFF0037EC45 /* SpeechInputClientMock.h in Headers */ = {isa = PBXBuildFile; fileRef = 7535BC9312020CFF0037EC45 /* SpeechInputClientMock.h */; };
 		754133A8102E00E800075D00 /* InspectorTimelineAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 754133A7102E00E800075D00 /* InspectorTimelineAgent.h */; };
 		754133AA102E00F400075D00 /* InspectorTimelineAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 754133A9102E00F400075D00 /* InspectorTimelineAgent.cpp */; };
+		75415AFD12958D5E003AD669 /* SpeechInputEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 75415AF812958D5E003AD669 /* SpeechInputEvent.h */; };
+		75415B0012958D5E003AD669 /* SpeechInputResultList.h in Headers */ = {isa = PBXBuildFile; fileRef = 75415AFB12958D5E003AD669 /* SpeechInputResultList.h */; };
+		75415C28129A9920003AD669 /* SpeechInputEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 75415C26129A9920003AD669 /* SpeechInputEvent.cpp */; };
+		75415C29129A9920003AD669 /* SpeechInputResultList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 75415C27129A9920003AD669 /* SpeechInputResultList.cpp */; };
+		75415D55129AB2D2003AD669 /* JSSpeechInputEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 75415D4F129AB2D2003AD669 /* JSSpeechInputEvent.cpp */; };
+		75415D56129AB2D2003AD669 /* JSSpeechInputEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 75415D50129AB2D2003AD669 /* JSSpeechInputEvent.h */; };
+		75415D57129AB2D2003AD669 /* JSSpeechInputResult.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 75415D51129AB2D2003AD669 /* JSSpeechInputResult.cpp */; };
+		75415D58129AB2D2003AD669 /* JSSpeechInputResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 75415D52129AB2D2003AD669 /* JSSpeechInputResult.h */; };
+		75415D59129AB2D2003AD669 /* JSSpeechInputResultList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 75415D53129AB2D2003AD669 /* JSSpeechInputResultList.cpp */; };
+		75415D5A129AB2D2003AD669 /* JSSpeechInputResultList.h in Headers */ = {isa = PBXBuildFile; fileRef = 75415D54129AB2D2003AD669 /* JSSpeechInputResultList.h */; };
 		7553CFE8108F473F00EA281E /* TimelineRecordFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 7553CFE6108F473F00EA281E /* TimelineRecordFactory.h */; };
 		7553CFE9108F473F00EA281E /* TimelineRecordFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7553CFE7108F473F00EA281E /* TimelineRecordFactory.cpp */; };
 		7578F90B11DDF26900D933C5 /* SpeechInput.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7578F90811DDF26900D933C5 /* SpeechInput.cpp */; };
@@ -7670,6 +7680,19 @@
 		7535BC9312020CFF0037EC45 /* SpeechInputClientMock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SpeechInputClientMock.h; path = mock/SpeechInputClientMock.h; sourceTree = "<group>"; };
 		754133A7102E00E800075D00 /* InspectorTimelineAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorTimelineAgent.h; sourceTree = "<group>"; };
 		754133A9102E00F400075D00 /* InspectorTimelineAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorTimelineAgent.cpp; sourceTree = "<group>"; };
+		75415AF812958D5E003AD669 /* SpeechInputEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpeechInputEvent.h; sourceTree = "<group>"; };
+		75415AF912958D5E003AD669 /* SpeechInputEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SpeechInputEvent.idl; sourceTree = "<group>"; };
+		75415AFA12958D5E003AD669 /* SpeechInputResult.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SpeechInputResult.idl; sourceTree = "<group>"; };
+		75415AFB12958D5E003AD669 /* SpeechInputResultList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpeechInputResultList.h; sourceTree = "<group>"; };
+		75415AFC12958D5E003AD669 /* SpeechInputResultList.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SpeechInputResultList.idl; sourceTree = "<group>"; };
+		75415C26129A9920003AD669 /* SpeechInputEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpeechInputEvent.cpp; sourceTree = "<group>"; };
+		75415C27129A9920003AD669 /* SpeechInputResultList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpeechInputResultList.cpp; sourceTree = "<group>"; };
+		75415D4F129AB2D2003AD669 /* JSSpeechInputEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSpeechInputEvent.cpp; sourceTree = "<group>"; };
+		75415D50129AB2D2003AD669 /* JSSpeechInputEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSpeechInputEvent.h; sourceTree = "<group>"; };
+		75415D51129AB2D2003AD669 /* JSSpeechInputResult.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSpeechInputResult.cpp; sourceTree = "<group>"; };
+		75415D52129AB2D2003AD669 /* JSSpeechInputResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSpeechInputResult.h; sourceTree = "<group>"; };
+		75415D53129AB2D2003AD669 /* JSSpeechInputResultList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSpeechInputResultList.cpp; sourceTree = "<group>"; };
+		75415D54129AB2D2003AD669 /* JSSpeechInputResultList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSpeechInputResultList.h; sourceTree = "<group>"; };
 		7553CFE6108F473F00EA281E /* TimelineRecordFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TimelineRecordFactory.h; sourceTree = "<group>"; };
 		7553CFE7108F473F00EA281E /* TimelineRecordFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TimelineRecordFactory.cpp; sourceTree = "<group>"; };
 		7578F90811DDF26900D933C5 /* SpeechInput.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpeechInput.cpp; sourceTree = "<group>"; };
@@ -13340,9 +13363,16 @@
 				7578F90811DDF26900D933C5 /* SpeechInput.cpp */,
 				7578F90911DDF26900D933C5 /* SpeechInput.h */,
 				7578F90A11DDF26900D933C5 /* SpeechInputClient.h */,
+				75415C26129A9920003AD669 /* SpeechInputEvent.cpp */,
+				75415AF812958D5E003AD669 /* SpeechInputEvent.h */,
+				75415AF912958D5E003AD669 /* SpeechInputEvent.idl */,
 				7578F91E11E4E32800D933C5 /* SpeechInputListener.h */,
 				758978EA127090D60076D5A9 /* SpeechInputResult.cpp */,
 				758978EB127090D60076D5A9 /* SpeechInputResult.h */,
+				75415AFA12958D5E003AD669 /* SpeechInputResult.idl */,
+				75415C27129A9920003AD669 /* SpeechInputResultList.cpp */,
+				75415AFB12958D5E003AD669 /* SpeechInputResultList.h */,
+				75415AFC12958D5E003AD669 /* SpeechInputResultList.idl */,
 				62C1217A11AB9E76003C462C /* SuspendableTimer.cpp */,
 				62C1217B11AB9E77003C462C /* SuspendableTimer.h */,
 				003F1FE911E6AB43008258D9 /* UserContentTypes.h */,
@@ -15894,6 +15924,12 @@
 				65DF31EC09D1CC60000BE325 /* JSProcessingInstruction.h */,
 				E4B423850CBFB73C00AF2ECE /* JSProgressEvent.cpp */,
 				E4B423860CBFB73C00AF2ECE /* JSProgressEvent.h */,
+				75415D4F129AB2D2003AD669 /* JSSpeechInputEvent.cpp */,
+				75415D50129AB2D2003AD669 /* JSSpeechInputEvent.h */,
+				75415D51129AB2D2003AD669 /* JSSpeechInputResult.cpp */,
+				75415D52129AB2D2003AD669 /* JSSpeechInputResult.h */,
+				75415D53129AB2D2003AD669 /* JSSpeechInputResultList.cpp */,
+				75415D54129AB2D2003AD669 /* JSSpeechInputResultList.h */,
 				65DF31EF09D1CC60000BE325 /* JSText.cpp */,
 				65DF31F009D1CC60000BE325 /* JSText.h */,
 			);
@@ -21351,6 +21387,11 @@
 				D3A94A3B122DABAC00A37BBC /* MediaQueryListListener.h in Headers */,
 				D3A94A47122DC40F00A37BBC /* JSMediaQueryList.h in Headers */,
 				D3AA10F4123A98AA0092152B /* MediaQueryMatcher.h in Headers */,
+				75415AFD12958D5E003AD669 /* SpeechInputEvent.h in Headers */,
+				75415B0012958D5E003AD669 /* SpeechInputResultList.h in Headers */,
+				75415D56129AB2D2003AD669 /* JSSpeechInputEvent.h in Headers */,
+				75415D58129AB2D2003AD669 /* JSSpeechInputResult.h in Headers */,
+				75415D5A129AB2D2003AD669 /* JSSpeechInputResultList.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -23920,6 +23961,11 @@
 				D3A94A46122DC40F00A37BBC /* JSMediaQueryList.cpp in Sources */,
 				D3AA10F3123A98AA0092152B /* MediaQueryMatcher.cpp in Sources */,
 				D340629B1253BC8C009E4259 /* MediaQueryListListener.cpp in Sources */,
+				75415C28129A9920003AD669 /* SpeechInputEvent.cpp in Sources */,
+				75415C29129A9920003AD669 /* SpeechInputResultList.cpp in Sources */,
+				75415D55129AB2D2003AD669 /* JSSpeechInputEvent.cpp in Sources */,
+				75415D57129AB2D2003AD669 /* JSSpeechInputResult.cpp in Sources */,
+				75415D59129AB2D2003AD669 /* JSSpeechInputResultList.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
diff --git a/WebCore/bindings/js/JSEventCustom.cpp b/WebCore/bindings/js/JSEventCustom.cpp
index d671dee..fd80360 100644
--- a/WebCore/bindings/js/JSEventCustom.cpp
+++ b/WebCore/bindings/js/JSEventCustom.cpp
@@ -51,6 +51,7 @@
 #include "JSPageTransitionEvent.h"
 #include "JSPopStateEvent.h"
 #include "JSProgressEvent.h"
+#include "JSSpeechInputEvent.h"
 #include "JSTextEvent.h"
 #include "JSUIEvent.h"
 #include "JSWebKitAnimationEvent.h"
@@ -68,6 +69,7 @@
 #include "PageTransitionEvent.h"
 #include "PopStateEvent.h"
 #include "ProgressEvent.h"
+#include "SpeechInputEvent.h"
 #include "TextEvent.h"
 #include "UIEvent.h"
 #include "WebKitAnimationEvent.h"
@@ -193,6 +195,10 @@ JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, Event* event)
     else if (event->isAudioProcessingEvent())
         wrapper = CREATE_DOM_OBJECT_WRAPPER(exec, globalObject, AudioProcessingEvent, event);
 #endif
+#if ENABLE(INPUT_SPEECH)
+    else if (event->isSpeechInputEvent())
+        wrapper = CREATE_DOM_OBJECT_WRAPPER(exec, globalObject, SpeechInputEvent, event);
+#endif
     else
         wrapper = CREATE_DOM_OBJECT_WRAPPER(exec, globalObject, Event, event);
 
diff --git a/WebCore/bindings/v8/custom/V8EventCustom.cpp b/WebCore/bindings/v8/custom/V8EventCustom.cpp
index bb885b9..ff9b98b 100644
--- a/WebCore/bindings/v8/custom/V8EventCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8EventCustom.cpp
@@ -55,6 +55,7 @@
 #include "V8PopStateEvent.h"
 #include "V8ProgressEvent.h"
 #include "V8Proxy.h"
+#include "V8SpeechInputEvent.h"
 #include "V8StorageEvent.h"
 #include "V8TextEvent.h"
 #include "V8TouchEvent.h"
@@ -172,6 +173,10 @@ v8::Handle<v8::Value> toV8(Event* impl)
     if (impl->isAudioProcessingEvent())
         return toV8(static_cast<AudioProcessingEvent*>(impl));
 #endif
+#if ENABLE(INPUT_SPEECH)
+    if (impl->isSpeechInputEvent())
+        return toV8(static_cast<SpeechInputEvent*>(impl));
+#endif
     if (impl->isCustomEvent())
         return toV8(static_cast<CustomEvent*>(impl));
     return V8Event::wrap(impl);
diff --git a/WebCore/dom/Event.cpp b/WebCore/dom/Event.cpp
index c8da461..a949fd5 100644
--- a/WebCore/dom/Event.cpp
+++ b/WebCore/dom/Event.cpp
@@ -236,6 +236,13 @@ bool Event::isAudioProcessingEvent() const
 }
 #endif
 
+#if ENABLE(INPUT_SPEECH)
+bool Event::isSpeechInputEvent() const
+{
+    return false;
+}
+#endif
+
 bool Event::fromUserGesture()
 {
     if (!UserGestureIndicator::processingUserGesture())
diff --git a/WebCore/dom/Event.h b/WebCore/dom/Event.h
index 0d2f2b9..f05d36c 100644
--- a/WebCore/dom/Event.h
+++ b/WebCore/dom/Event.h
@@ -142,6 +142,9 @@ namespace WebCore {
         virtual bool isDeviceMotionEvent() const;
         virtual bool isDeviceOrientationEvent() const;
 #endif
+#if ENABLE(INPUT_SPEECH)
+        virtual bool isSpeechInputEvent() const;
+#endif
         bool fromUserGesture();
         
         bool propagationStopped() const { return m_propagationStopped || m_immediatePropagationStopped; }
diff --git a/WebCore/html/HTMLInputElement.cpp b/WebCore/html/HTMLInputElement.cpp
index 954aab2..fcb2be8 100644
--- a/WebCore/html/HTMLInputElement.cpp
+++ b/WebCore/html/HTMLInputElement.cpp
@@ -1937,11 +1937,6 @@ bool HTMLInputElement::isSpeechEnabled() const
     return false;
 }
 
-void HTMLInputElement::dispatchWebkitSpeechChangeEvent()
-{
-    ASSERT(isSpeechEnabled());
-    dispatchEvent(Event::create(eventNames().webkitspeechchangeEvent, true, false));
-}
 #endif
 
 } // namespace
diff --git a/WebCore/html/HTMLInputElement.h b/WebCore/html/HTMLInputElement.h
index 8f6a471..52460c7 100644
--- a/WebCore/html/HTMLInputElement.h
+++ b/WebCore/html/HTMLInputElement.h
@@ -108,7 +108,6 @@ public:
 
 #if ENABLE(INPUT_SPEECH)
     virtual bool isSpeechEnabled() const;
-    void dispatchWebkitSpeechChangeEvent();
 #endif
 
     bool checked() const { return m_checked; }
diff --git a/WebCore/page/SpeechInputEvent.cpp b/WebCore/page/SpeechInputEvent.cpp
new file mode 100644
index 0000000..181322f
--- /dev/null
+++ b/WebCore/page/SpeechInputEvent.cpp
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "SpeechInputEvent.h"
+
+#if ENABLE(INPUT_SPEECH)
+
+namespace WebCore {
+
+PassRefPtr<SpeechInputEvent> SpeechInputEvent::create(const AtomicString& eventType, const SpeechInputResultArray& results)
+{
+    return adoptRef(new SpeechInputEvent(eventType, results));
+}
+
+SpeechInputEvent::~SpeechInputEvent() {
+}
+
+SpeechInputEvent::SpeechInputEvent(const AtomicString& eventType, const SpeechInputResultArray& results)
+    : Event(eventType, true, false) // Can bubble, not cancelable
+    , m_results(SpeechInputResultList::create(results))
+{
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INPUT_SPEECH)
diff --git a/WebCore/page/SpeechInputEvent.h b/WebCore/page/SpeechInputEvent.h
new file mode 100644
index 0000000..6a39f3c
--- /dev/null
+++ b/WebCore/page/SpeechInputEvent.h
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *  * Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  * Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SpeechInputEvent_h
+#define SpeechInputEvent_h
+
+#if ENABLE(INPUT_SPEECH)
+
+#include "Event.h"
+#include "SpeechInputResultList.h"
+
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+class SpeechInputEvent : public Event {
+public:
+    static PassRefPtr<SpeechInputEvent> create(const AtomicString& eventType, const SpeechInputResultArray& results);
+    ~SpeechInputEvent();
+
+    virtual bool isSpeechInputEvent() const { return true; }
+
+    SpeechInputResultList* results() const { return m_results.get(); }
+
+private:
+    SpeechInputEvent(const AtomicString& eventType, const SpeechInputResultArray& results);
+
+    RefPtr<SpeechInputResultList> m_results;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(INPUT_SPEECH)
+
+#endif // SpeechInputEvent_h
diff --git a/WebCore/page/SpeechInputEvent.idl b/WebCore/page/SpeechInputEvent.idl
new file mode 100644
index 0000000..c461483
--- /dev/null
+++ b/WebCore/page/SpeechInputEvent.idl
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *  * Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  * Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+module core {
+
+    interface [
+        Conditional=INPUT_SPEECH
+    ] SpeechInputEvent : Event {
+        readonly attribute SpeechInputResultList results;
+    };
+
+}
diff --git a/WebCore/page/SpeechInputListener.h b/WebCore/page/SpeechInputListener.h
index 568b1b7..7415301 100644
--- a/WebCore/page/SpeechInputListener.h
+++ b/WebCore/page/SpeechInputListener.h
@@ -38,8 +38,6 @@
 
 namespace WebCore {
 
-typedef Vector<RefPtr<SpeechInputResult> > SpeechInputResultArray;
-
 // Interface to be implemented by the element which invokes SpeechInput.
 class SpeechInputListener {
 public:
diff --git a/WebCore/page/SpeechInputResult.cpp b/WebCore/page/SpeechInputResult.cpp
index f5b6972..1c042a0 100644
--- a/WebCore/page/SpeechInputResult.cpp
+++ b/WebCore/page/SpeechInputResult.cpp
@@ -35,6 +35,11 @@ PassRefPtr<SpeechInputResult> SpeechInputResult::create(const String& utterance,
     return adoptRef(new SpeechInputResult(utterance, confidence));
 }
 
+PassRefPtr<SpeechInputResult> SpeechInputResult::create(const SpeechInputResult& source)
+{
+    return adoptRef(new SpeechInputResult(source.m_utterance, source.m_confidence));
+}
+
 SpeechInputResult::SpeechInputResult(const String& utterance, double confidence)
     : m_utterance(utterance)
     , m_confidence(confidence)
diff --git a/WebCore/page/SpeechInputResult.h b/WebCore/page/SpeechInputResult.h
index ef9fd10..457f078 100644
--- a/WebCore/page/SpeechInputResult.h
+++ b/WebCore/page/SpeechInputResult.h
@@ -38,6 +38,7 @@ namespace WebCore {
 // fields, as received from the embedder.
 class SpeechInputResult : public RefCounted<SpeechInputResult> {
 public:
+    static PassRefPtr<SpeechInputResult> create(const SpeechInputResult& source);
     static PassRefPtr<SpeechInputResult> create(const String& utterance, double confidence);
 
     double confidence() const;
@@ -50,6 +51,8 @@ private:
     double m_confidence;
 };
 
+typedef Vector<RefPtr<SpeechInputResult> > SpeechInputResultArray;
+
 } // namespace WebCore
 
 #endif // ENABLE(INPUT_SPEECH)
diff --git a/WebCore/page/SpeechInputResult.idl b/WebCore/page/SpeechInputResult.idl
new file mode 100644
index 0000000..f688de4
--- /dev/null
+++ b/WebCore/page/SpeechInputResult.idl
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *  * Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  * Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+module core {
+
+    interface [
+        Conditional=INPUT_SPEECH
+    ] SpeechInputResult {
+        readonly attribute DOMString utterance;
+        readonly attribute float confidence;
+    };
+
+}
diff --git a/WebCore/page/SpeechInputResultList.cpp b/WebCore/page/SpeechInputResultList.cpp
new file mode 100644
index 0000000..41fd108
--- /dev/null
+++ b/WebCore/page/SpeechInputResultList.cpp
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "SpeechInputResultList.h"
+
+#if ENABLE(INPUT_SPEECH)
+
+namespace WebCore {
+
+PassRefPtr<SpeechInputResultList> SpeechInputResultList::create(const SpeechInputResultArray& results)
+{
+    return adoptRef(new SpeechInputResultList(results));
+}
+
+SpeechInputResult* SpeechInputResultList::item(unsigned index)
+{
+    return index >= m_results.size() ? 0 : m_results[index].get();
+}
+
+SpeechInputResultList::SpeechInputResultList(const SpeechInputResultArray& results)
+    : m_results(results) // Takes a copy of the array of RefPtrs.
+{
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INPUT_SPEECH)
diff --git a/WebCore/page/SpeechInputResultList.h b/WebCore/page/SpeechInputResultList.h
new file mode 100644
index 0000000..b050630
--- /dev/null
+++ b/WebCore/page/SpeechInputResultList.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *  * Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  * Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SpeechInputResultList_h
+#define SpeechInputResultList_h
+
+#if ENABLE(INPUT_SPEECH)
+
+#include "SpeechInputResult.h"
+
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+class SpeechInputResultList : public RefCounted<SpeechInputResultList> {
+public:
+    static PassRefPtr<SpeechInputResultList> create(const SpeechInputResultArray& results);
+
+    // Methods from the IDL.
+    size_t length() { return m_results.size(); }
+    SpeechInputResult* item(unsigned index);
+
+private:
+    SpeechInputResultList(const SpeechInputResultArray& results);
+
+    SpeechInputResultArray m_results;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(INPUT_SPEECH)
+
+#endif // SpeechInputResultList_h
diff --git a/WebCore/page/SpeechInputResultList.idl b/WebCore/page/SpeechInputResultList.idl
new file mode 100644
index 0000000..5a23d4f
--- /dev/null
+++ b/WebCore/page/SpeechInputResultList.idl
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *  * Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  * Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+module core {
+
+    interface [
+        HasIndexGetter,
+        Conditional=INPUT_SPEECH
+    ] SpeechInputResultList {
+        readonly attribute unsigned long length;
+        SpeechInputResult item(in [IsIndex] unsigned long index);
+    };
+
+}
diff --git a/WebCore/platform/mock/SpeechInputClientMock.cpp b/WebCore/platform/mock/SpeechInputClientMock.cpp
index 820152c..16f2825 100644
--- a/WebCore/platform/mock/SpeechInputClientMock.cpp
+++ b/WebCore/platform/mock/SpeechInputClientMock.cpp
@@ -81,18 +81,21 @@ void SpeechInputClientMock::cancelRecognition(int requestId)
     }
 }
 
-void SpeechInputClientMock::setRecognitionResult(const String& result, const AtomicString& language)
+void SpeechInputClientMock::addRecognitionResult(const String& result, double confidence, const AtomicString& language)
 {
     if (language.isEmpty())
-        m_resultForEmptyLanguage = result;
-    else
-        m_recognitionResult.set(language, result);
+        m_resultsForEmptyLanguage.append(SpeechInputResult::create(result, confidence));
+    else {
+        if (!m_recognitionResults.contains(language))
+            m_recognitionResults.set(language, SpeechInputResultArray());
+        m_recognitionResults.find(language)->second.append(SpeechInputResult::create(result, confidence));
+    }
 }
 
 void SpeechInputClientMock::clearResults()
 {
-    m_resultForEmptyLanguage = String();
-    m_recognitionResult.clear();
+    m_resultsForEmptyLanguage.clear();
+    m_recognitionResults.clear();
 }
 
 void SpeechInputClientMock::timerFired(WebCore::Timer<SpeechInputClientMock>*)
@@ -102,18 +105,17 @@ void SpeechInputClientMock::timerFired(WebCore::Timer<SpeechInputClientMock>*)
         m_listener->didCompleteRecording(m_requestId);
         m_timer.startOneShot(0);
     } else {
-        SpeechInputResultArray results;
         bool noResultsFound = false;
 
         // Empty language case must be handled separately to avoid problems with HashMap and empty keys.
         if (m_language.isEmpty()) {
-            if (!m_resultForEmptyLanguage.isNull())
-                results.append(SpeechInputResult::create(m_resultForEmptyLanguage, 1.0));
+            if (!m_resultsForEmptyLanguage.isEmpty())
+                m_listener->setRecognitionResult(m_requestId, m_resultsForEmptyLanguage);
             else
                 noResultsFound = true;
         } else {
-            if (m_recognitionResult.contains(m_language))
-                results.append(SpeechInputResult::create(m_recognitionResult.get(m_language), 1.0));
+            if (m_recognitionResults.contains(m_language))
+                m_listener->setRecognitionResult(m_requestId, m_recognitionResults.get(m_language));
             else
                 noResultsFound = true;
         }
@@ -124,10 +126,11 @@ void SpeechInputClientMock::timerFired(WebCore::Timer<SpeechInputClientMock>*)
             String error("error: no result found for language '");
             error.append(m_language);
             error.append("'");
+            SpeechInputResultArray results;
             results.append(SpeechInputResult::create(error, 1.0));
+            m_listener->setRecognitionResult(m_requestId, results);
         }
 
-        m_listener->setRecognitionResult(m_requestId, results);
         m_listener->didCompleteRecognition(m_requestId);
         m_requestId = 0;
     }
diff --git a/WebCore/platform/mock/SpeechInputClientMock.h b/WebCore/platform/mock/SpeechInputClientMock.h
index c2219b4..6f72191 100644
--- a/WebCore/platform/mock/SpeechInputClientMock.h
+++ b/WebCore/platform/mock/SpeechInputClientMock.h
@@ -33,6 +33,7 @@
 
 #include "PlatformString.h"
 #include "SpeechInputClient.h"
+#include "SpeechInputResult.h"
 #include "Timer.h"
 #include <wtf/HashMap.h>
 #include <wtf/text/StringHash.h>
@@ -48,7 +49,7 @@ class SpeechInputClientMock : public SpeechInputClient {
 public:
     SpeechInputClientMock();
 
-    void setRecognitionResult(const String& result, const AtomicString& language);
+    void addRecognitionResult(const String& result, double confidence, const AtomicString& language);
     void clearResults();
 
     // SpeechInputClient methods.
@@ -65,9 +66,9 @@ private:
     SpeechInputListener* m_listener;
     int m_requestId;
 
-    HashMap<String, String> m_recognitionResult;
+    HashMap<String, SpeechInputResultArray> m_recognitionResults;
     AtomicString m_language;
-    String m_resultForEmptyLanguage;
+    SpeechInputResultArray m_resultsForEmptyLanguage;
 };
 
 } // namespace WebCore
diff --git a/WebCore/rendering/TextControlInnerElements.cpp b/WebCore/rendering/TextControlInnerElements.cpp
index fba523e..ba4c7bb 100644
--- a/WebCore/rendering/TextControlInnerElements.cpp
+++ b/WebCore/rendering/TextControlInnerElements.cpp
@@ -41,6 +41,7 @@
 #include "RenderTextControlSingleLine.h"
 #include "ScrollbarTheme.h"
 #include "SpeechInput.h"
+#include "SpeechInputEvent.h"
 
 namespace WebCore {
 
@@ -478,7 +479,7 @@ void InputFieldSpeechButtonElement::setRecognitionResult(int, const SpeechInputR
     // here, we take a temporary reference.
     RefPtr<HTMLInputElement> holdRef(input);
     input->setValue(results.isEmpty() ? "" : results[0]->utterance());
-    input->dispatchWebkitSpeechChangeEvent();
+    input->dispatchEvent(SpeechInputEvent::create(eventNames().webkitspeechchangeEvent, results));
     renderer()->repaint();
 }
 
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 7bc9a7d..d8ba4b1 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,17 @@
+2010-11-18  Satish Sampath  <satish at chromium.org>
+
+        Reviewed by Jeremy Orlow.
+
+        For speech input event, send an event object containing all the recognition results and metadata.
+        https://bugs.webkit.org/show_bug.cgi?id=49736
+
+        Updated mock object's method to new signature.
+
+        * public/WebSpeechInputControllerMock.h:
+        * src/WebSpeechInputControllerMockImpl.cpp:
+        (WebKit::WebSpeechInputControllerMockImpl::addMockRecognitionResult):
+        * src/WebSpeechInputControllerMockImpl.h:
+
 2010-11-22  Alexey Marinichev  <amarinichev at chromium.org>
 
         Reviewed by Kenneth Russell.
diff --git a/WebKit/chromium/public/WebSpeechInputControllerMock.h b/WebKit/chromium/public/WebSpeechInputControllerMock.h
index 31672ba..e440b89 100644
--- a/WebKit/chromium/public/WebSpeechInputControllerMock.h
+++ b/WebKit/chromium/public/WebSpeechInputControllerMock.h
@@ -44,7 +44,7 @@ public:
         WebSpeechInputListener* listener);
     virtual ~WebSpeechInputControllerMock() { }
 
-    virtual void setMockRecognitionResult(const WebString& result, const WebString& language) = 0;
+    virtual void addMockRecognitionResult(const WebString& result, double confidence, const WebString& language) = 0;
 
     virtual void clearResults() = 0;
 };
diff --git a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp
index 8cf7848..48f8b50 100644
--- a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp
+++ b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp
@@ -55,9 +55,9 @@ WebSpeechInputControllerMockImpl::~WebSpeechInputControllerMockImpl()
     m_webcoreMock->setListener(0);
 }
 
-void WebSpeechInputControllerMockImpl::setMockRecognitionResult(const WebString& result, const WebString &language)
+void WebSpeechInputControllerMockImpl::addMockRecognitionResult(const WebString& result, double confidence, const WebString &language)
 {
-    m_webcoreMock->setRecognitionResult(result, language);
+    m_webcoreMock->addRecognitionResult(result, confidence, language);
 }
 
 void WebSpeechInputControllerMockImpl::clearResults()
diff --git a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h
index 7680873..bf00ed0 100644
--- a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h
+++ b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h
@@ -62,7 +62,7 @@ public:
     void stopRecording(int requestId);
 
     // WebSpeechInputControllerMock methods.
-    void setMockRecognitionResult(const WebString& result, const WebString& language);
+    void addMockRecognitionResult(const WebString& result, double confidence, const WebString& language);
     void clearResults();
 
 private:
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index bc17e81..824b717 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,32 @@
+2010-11-18  Satish Sampath  <satish at chromium.org>
+
+        Reviewed by Jeremy Orlow.
+
+        For speech input event, send an event object containing all the recognition results and metadata.
+        https://bugs.webkit.org/show_bug.cgi?id=49736
+
+        Updated DRT by renaming the mock result method on all platforms to the new signature.
+
+        * DumpRenderTree/LayoutTestController.cpp:
+        (addMockSpeechInputResultCallback):
+        (LayoutTestController::staticFunctions):
+        * DumpRenderTree/LayoutTestController.h:
+        * DumpRenderTree/chromium/LayoutTestController.cpp:
+        (LayoutTestController::LayoutTestController):
+        (LayoutTestController::addMockSpeechInputResult):
+        * DumpRenderTree/chromium/LayoutTestController.h:
+        * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+        (LayoutTestController::addMockSpeechInputResult):
+        * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+        (LayoutTestController::addMockSpeechInputResult):
+        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+        (LayoutTestController::addMockSpeechInputResult):
+        * DumpRenderTree/qt/LayoutTestControllerQt.h:
+        * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+        (LayoutTestController::addMockSpeechInputResult):
+        * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+        (LayoutTestController::addMockSpeechInputResult):
+
 2010-11-22  Dirk Pranke  <dpranke at chromium.org>
 
         Reviewed by Tony Chang.
diff --git a/WebKitTools/DumpRenderTree/LayoutTestController.cpp b/WebKitTools/DumpRenderTree/LayoutTestController.cpp
index 28efecb..5623c5e 100644
--- a/WebKitTools/DumpRenderTree/LayoutTestController.cpp
+++ b/WebKitTools/DumpRenderTree/LayoutTestController.cpp
@@ -1076,19 +1076,21 @@ static JSValueRef setMockGeolocationErrorCallback(JSContextRef context, JSObject
     return JSValueMakeUndefined(context);
 }
 
-static JSValueRef setMockSpeechInputResultCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+static JSValueRef addMockSpeechInputResultCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
 {
-    if (argumentCount < 2)
+    if (argumentCount < 3)
         return JSValueMakeUndefined(context);
 
     JSRetainPtr<JSStringRef> result(Adopt, JSValueToStringCopy(context, arguments[0], exception));
     ASSERT(!*exception);
 
-    JSRetainPtr<JSStringRef> language(Adopt, JSValueToStringCopy(context, arguments[1], exception));
+    double confidence = JSValueToNumber(context, arguments[1], exception);
+
+    JSRetainPtr<JSStringRef> language(Adopt, JSValueToStringCopy(context, arguments[2], exception));
     ASSERT(!*exception);
 
     LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
-    controller->setMockSpeechInputResult(result.get(), language.get());
+    controller->addMockSpeechInputResult(result.get(), confidence, language.get());
 
     return JSValueMakeUndefined(context);
 }
@@ -1973,7 +1975,7 @@ JSStaticFunction* LayoutTestController::staticFunctions()
         { "setMockDeviceOrientation", setMockDeviceOrientationCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setMockGeolocationError", setMockGeolocationErrorCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setMockGeolocationPosition", setMockGeolocationPositionCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
-        { "setMockSpeechInputResult", setMockSpeechInputResultCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "addMockSpeechInputResult", addMockSpeechInputResultCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setNewWindowsCopyBackForwardList", setNewWindowsCopyBackForwardListCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setPOSIXLocale", setPOSIXLocaleCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setPersistentUserStyleSheetLocation", setPersistentUserStyleSheetLocationCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
diff --git a/WebKitTools/DumpRenderTree/LayoutTestController.h b/WebKitTools/DumpRenderTree/LayoutTestController.h
index b61860b..391f7f5 100644
--- a/WebKitTools/DumpRenderTree/LayoutTestController.h
+++ b/WebKitTools/DumpRenderTree/LayoutTestController.h
@@ -94,7 +94,7 @@ public:
     void setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma);
     void setMockGeolocationError(int code, JSStringRef message);
     void setMockGeolocationPosition(double latitude, double longitude, double accuracy);
-    void setMockSpeechInputResult(JSStringRef result, JSStringRef language);
+    void addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language);
     void setPersistentUserStyleSheetLocation(JSStringRef path);
     void setPluginsEnabled(bool flag);
     void setPopupBlockingEnabled(bool flag);
diff --git a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp
index ad04170..e51ebb3 100644
--- a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp
@@ -150,7 +150,7 @@ LayoutTestController::LayoutTestController(TestShell* shell)
     bindMethod("setMockDeviceOrientation", &LayoutTestController::setMockDeviceOrientation);
     bindMethod("setMockGeolocationError", &LayoutTestController::setMockGeolocationError);
     bindMethod("setMockGeolocationPosition", &LayoutTestController::setMockGeolocationPosition);
-    bindMethod("setMockSpeechInputResult", &LayoutTestController::setMockSpeechInputResult);
+    bindMethod("addMockSpeechInputResult", &LayoutTestController::addMockSpeechInputResult);
     bindMethod("setPopupBlockingEnabled", &LayoutTestController::setPopupBlockingEnabled);
     bindMethod("setPOSIXLocale", &LayoutTestController::setPOSIXLocale);
     bindMethod("setScrollbarPolicy", &LayoutTestController::setScrollbarPolicy);
@@ -1537,13 +1537,13 @@ void LayoutTestController::abortModal(const CppArgumentList& arguments, CppVaria
     result->setNull();
 }
 
-void LayoutTestController::setMockSpeechInputResult(const CppArgumentList& arguments, CppVariant* result)
+void LayoutTestController::addMockSpeechInputResult(const CppArgumentList& arguments, CppVariant* result)
 {
     result->setNull();
-    if (arguments.size() < 2 || !arguments[0].isString() || !arguments[1].isString())
+    if (arguments.size() < 3 || !arguments[0].isString() || !arguments[1].isNumber() || !arguments[2].isString())
         return;
 
-    m_shell->webViewHost()->speechInputControllerMock()->setMockRecognitionResult(cppVariantToWebString(arguments[0]), cppVariantToWebString(arguments[1]));
+    m_shell->webViewHost()->speechInputControllerMock()->addMockRecognitionResult(cppVariantToWebString(arguments[0]), arguments[1].toDouble(), cppVariantToWebString(arguments[2]));
 }
 
 void LayoutTestController::layerTreeAsText(const CppArgumentList& args, CppVariant* result)
diff --git a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h
index 62f473c..7581781 100644
--- a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h
+++ b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h
@@ -326,7 +326,7 @@ public:
     void abortModal(const CppArgumentList&, CppVariant*);
 
     // Speech input related functions.
-    void setMockSpeechInputResult(const CppArgumentList&, CppVariant*);
+    void addMockSpeechInputResult(const CppArgumentList&, CppVariant*);
 
     void layerTreeAsText(const CppArgumentList& args, CppVariant* result);
 
diff --git a/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp b/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
index 39fb116..9c3ede0 100644
--- a/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
+++ b/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
@@ -500,7 +500,7 @@ void LayoutTestController::setGeolocationPermission(bool allow)
     setGeolocationPermissionCommon(allow);
 }
 
-void LayoutTestController::setMockSpeechInputResult(JSStringRef result, JSStringRef language)
+void LayoutTestController::addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language)
 {
     // FIXME: Implement for speech input layout tests.
     // See https://bugs.webkit.org/show_bug.cgi?id=39485.
diff --git a/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm b/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
index b19d6b5..e3f2141 100644
--- a/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
+++ b/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
@@ -373,7 +373,7 @@ void LayoutTestController::setGeolocationPermission(bool allow)
     [[[mainFrame webView] UIDelegate] didSetMockGeolocationPermission];
 }
 
-void LayoutTestController::setMockSpeechInputResult(JSStringRef result, JSStringRef language)
+void LayoutTestController::addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language)
 {
     // FIXME: Implement for speech input layout tests.
     // See https://bugs.webkit.org/show_bug.cgi?id=39485.
diff --git a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
index 7135a1a..624cf97 100644
--- a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
+++ b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
@@ -768,7 +768,7 @@ void LayoutTestController::setMockGeolocationPosition(double latitude, double lo
     DumpRenderTreeSupportQt::setMockGeolocationPosition(latitude, longitude, accuracy);
 }
 
-void LayoutTestController::setMockSpeechInputResult(const QString& result, const QString& language)
+void LayoutTestController::addMockSpeechInputResult(const QString& result, double confidence, const QString& language)
 {
     // FIXME: Implement for speech input layout tests.
     // See https://bugs.webkit.org/show_bug.cgi?id=39485.
diff --git a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h
index 5c17624..590225b 100644
--- a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h
+++ b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h
@@ -218,7 +218,7 @@ public slots:
     bool isGeolocationPermissionSet() const { return m_isGeolocationPermissionSet; }
     bool geolocationPermission() const { return m_geolocationPermission; }
 
-    void setMockSpeechInputResult(const QString& result, const QString& language);
+    void addMockSpeechInputResult(const QString& result, double confidence, const QString& language);
 
     // Empty stub method to keep parity with object model exposed by global LayoutTestController.
     void abortModal() {}
diff --git a/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp b/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
index 0043ce6..bc76139 100644
--- a/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
+++ b/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
@@ -411,7 +411,7 @@ void LayoutTestController::setGeolocationPermission(bool allow)
     setGeolocationPermissionCommon(allow);
 }
 
-void LayoutTestController::setMockSpeechInputResult(JSStringRef result, JSStringRef language)
+void LayoutTestController::addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language)
 {
     // FIXME: Implement for speech input layout tests.
     // See https://bugs.webkit.org/show_bug.cgi?id=39485.
diff --git a/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp b/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp
index 32614c1..8587fea 100644
--- a/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp
+++ b/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp
@@ -320,7 +320,7 @@ void LayoutTestController::setGeolocationPermission(bool allow)
     setGeolocationPermissionCommon(allow);
 }
 
-void LayoutTestController::setMockSpeechInputResult(JSStringRef result, JSStringRef language)
+void LayoutTestController::addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language)
 {
     // FIXME: Implement for speech input layout tests.
     // See https://bugs.webkit.org/show_bug.cgi?id=39485.

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list