Title: [268762] trunk
Revision
268762
Author
[email protected]
Date
2020-10-20 14:54:36 -0700 (Tue, 20 Oct 2020)

Log Message

Add stubs for SpeechRecognition
https://bugs.webkit.org/show_bug.cgi?id=217780
<rdar://problem/70350727>

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

* web-platform-tests/speech-api/SpeechRecognition-basics.https-expected.txt:
* web-platform-tests/speech-api/idlharness.window-expected.txt:

Source/WebCore:

Add bindings code and a feature flag for SpeechRecognition.
Spec: https://wicg.github.io/speech-api/#speechreco-section.

This patch includes all interfaces of SpeechRecognition, except SpeechGrammar and SpeechGrammarList. We have not
decided what grammar format and types we are going to support, or how we are going to support it if it is not
defined in exisiting speech recognition service. So let's add those interfaces after we figure this out.

No new tests. Rebaseline existins tests.

* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Modules/speech/SpeechRecognition.cpp: Added.
(WebCore::SpeechRecognition::create):
(WebCore::SpeechRecognition::SpeechRecognition):
(WebCore::SpeechRecognition::suspend):
(WebCore::SpeechRecognition::startRecognition):
(WebCore::SpeechRecognition::stopRecognition):
(WebCore::SpeechRecognition::abortRecognition):
(WebCore::SpeechRecognition::activeDOMObjectName const):
* Modules/speech/SpeechRecognition.h: Added.
(WebCore::SpeechRecognition::lang const):
(WebCore::SpeechRecognition::setLang):
(WebCore::SpeechRecognition::continuous const):
(WebCore::SpeechRecognition::setContinuous):
(WebCore::SpeechRecognition::interimResults const):
(WebCore::SpeechRecognition::setInterimResults):
(WebCore::SpeechRecognition::maxAlternatives const):
(WebCore::SpeechRecognition::setMaxAlternatives):
* Modules/speech/SpeechRecognition.idl: Added.
* Modules/speech/SpeechRecognitionAlternative.cpp: Added.
(WebCore::SpeechRecognitionAlternative::create):
(WebCore::SpeechRecognitionAlternative::SpeechRecognitionAlternative):
* Modules/speech/SpeechRecognitionAlternative.h: Added.
* Modules/speech/SpeechRecognitionAlternative.idl: Added.
* Modules/speech/SpeechRecognitionErrorCode.h: Added.
* Modules/speech/SpeechRecognitionErrorCode.idl: Added.
* Modules/speech/SpeechRecognitionErrorEvent.cpp: Added.
(WebCore::SpeechRecognitionErrorEvent::create):
(WebCore::SpeechRecognitionErrorEvent::SpeechRecognitionErrorEvent):
(WebCore::SpeechRecognitionErrorEvent::eventInterface const):
* Modules/speech/SpeechRecognitionErrorEvent.h: Added.
* Modules/speech/SpeechRecognitionErrorEvent.idl: Added.
* Modules/speech/SpeechRecognitionEvent.cpp: Added.
(WebCore::SpeechRecognitionEvent::create):
(WebCore::SpeechRecognitionEvent::SpeechRecognitionEvent):
(WebCore::SpeechRecognitionEvent::eventInterface const):
* Modules/speech/SpeechRecognitionEvent.h: Added.
* Modules/speech/SpeechRecognitionEvent.idl: Added.
* Modules/speech/SpeechRecognitionResult.cpp: Added.
(WebCore::SpeechRecognitionResult::create):
(WebCore::SpeechRecognitionResult::SpeechRecognitionResult):
(WebCore::SpeechRecognitionResult::item const):
* Modules/speech/SpeechRecognitionResult.h: Added.
* Modules/speech/SpeechRecognitionResult.idl: Added.
* Modules/speech/SpeechRecognitionResultList.cpp: Added.
(WebCore::SpeechRecognitionResultList::create):
(WebCore::SpeechRecognitionResultList::item const):
(WebCore::SpeechRecognitionResultList::add):
(WebCore::SpeechRecognitionResultList::SpeechRecognitionResultList):
* Modules/speech/SpeechRecognitionResultList.h: Added.
* Modules/speech/SpeechRecognitionResultList.idl: Added.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* dom/EventNames.in:
* dom/EventTargetFactory.in:

Source/WebKitLegacy/mac:

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(-[WebPreferences _speechRecognitionEnabled]):
(-[WebPreferences _setSpeechRecognitionEnabled:]):
* WebView/WebPreferencesPrivate.h:

Source/WTF:

* Scripts/Preferences/WebPreferencesExperimental.yaml:
* wtf/PlatformEnable.h:

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm:
(enableExperimentalFeatures):

LayoutTests:

* platform/mac/TestExpectations:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (268761 => 268762)


--- trunk/LayoutTests/ChangeLog	2020-10-20 21:40:40 UTC (rev 268761)
+++ trunk/LayoutTests/ChangeLog	2020-10-20 21:54:36 UTC (rev 268762)
@@ -1,3 +1,13 @@
+2020-10-20  Sihui Liu  <[email protected]>
+
+        Add stubs for SpeechRecognition
+        https://bugs.webkit.org/show_bug.cgi?id=217780
+        <rdar://problem/70350727>
+
+        Reviewed by Youenn Fablet.
+
+        * platform/mac/TestExpectations:
+
 2020-10-20  Ross Kirsling  <[email protected]>
 
         [JSC] Rename item() to at() and move it behind a flag

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (268761 => 268762)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2020-10-20 21:40:40 UTC (rev 268761)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2020-10-20 21:54:36 UTC (rev 268762)
@@ -1,3 +1,14 @@
+2020-10-20  Sihui Liu  <[email protected]>
+
+        Add stubs for SpeechRecognition
+        https://bugs.webkit.org/show_bug.cgi?id=217780
+        <rdar://problem/70350727>
+
+        Reviewed by Youenn Fablet.
+
+        * web-platform-tests/speech-api/SpeechRecognition-basics.https-expected.txt:
+        * web-platform-tests/speech-api/idlharness.window-expected.txt:
+
 2020-10-20  Antti Koivisto  <[email protected]>
 
         Implement <forgiving-selector-list> for :is/:where

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechRecognition-basics.https-expected.txt (268761 => 268762)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechRecognition-basics.https-expected.txt	2020-10-20 21:40:40 UTC (rev 268761)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechRecognition-basics.https-expected.txt	2020-10-20 21:54:36 UTC (rev 268762)
@@ -1,3 +1,3 @@
 
-FAIL SpeechRecognition basics Can't find variable: SpeechRecognition
+FAIL SpeechRecognition basics undefined is not an object (evaluating 'reco.grammars.length')
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/idlharness.window-expected.txt (268761 => 268762)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/idlharness.window-expected.txt	2020-10-20 21:40:40 UTC (rev 268761)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/idlharness.window-expected.txt	2020-10-20 21:54:36 UTC (rev 268762)
@@ -11,93 +11,93 @@
 PASS Window includes AnimationFrameProvider: member names are unique
 PASS Window includes WindowSessionStorage: member names are unique
 PASS Window includes WindowLocalStorage: member names are unique
-FAIL SpeechRecognition interface: existence and properties of interface object assert_own_property: self does not have own property "SpeechRecognition" expected property "SpeechRecognition" missing
-FAIL SpeechRecognition interface object length assert_own_property: self does not have own property "SpeechRecognition" expected property "SpeechRecognition" missing
-FAIL SpeechRecognition interface object name assert_own_property: self does not have own property "SpeechRecognition" expected property "SpeechRecognition" missing
-FAIL SpeechRecognition interface: existence and properties of interface prototype object assert_own_property: self does not have own property "SpeechRecognition" expected property "SpeechRecognition" missing
-FAIL SpeechRecognition interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "SpeechRecognition" expected property "SpeechRecognition" missing
-FAIL SpeechRecognition interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "SpeechRecognition" expected property "SpeechRecognition" missing
-FAIL SpeechRecognition interface: attribute grammars assert_own_property: self does not have own property "SpeechRecognition" expected property "SpeechRecognition" missing
-FAIL SpeechRecognition interface: attribute lang assert_own_property: self does not have own property "SpeechRecognition" expected property "SpeechRecognition" missing
-FAIL SpeechRecognition interface: attribute continuous assert_own_property: self does not have own property "SpeechRecognition" expected property "SpeechRecognition" missing
-FAIL SpeechRecognition interface: attribute interimResults assert_own_property: self does not have own property "SpeechRecognition" expected property "SpeechRecognition" missing
-FAIL SpeechRecognition interface: attribute maxAlternatives assert_own_property: self does not have own property "SpeechRecognition" expected property "SpeechRecognition" missing
-FAIL SpeechRecognition interface: operation start() assert_own_property: self does not have own property "SpeechRecognition" expected property "SpeechRecognition" missing
-FAIL SpeechRecognition interface: operation stop() assert_own_property: self does not have own property "SpeechRecognition" expected property "SpeechRecognition" missing
-FAIL SpeechRecognition interface: operation abort() assert_own_property: self does not have own property "SpeechRecognition" expected property "SpeechRecognition" missing
-FAIL SpeechRecognition interface: attribute onaudiostart assert_own_property: self does not have own property "SpeechRecognition" expected property "SpeechRecognition" missing
-FAIL SpeechRecognition interface: attribute onsoundstart assert_own_property: self does not have own property "SpeechRecognition" expected property "SpeechRecognition" missing
-FAIL SpeechRecognition interface: attribute onspeechstart assert_own_property: self does not have own property "SpeechRecognition" expected property "SpeechRecognition" missing
-FAIL SpeechRecognition interface: attribute onspeechend assert_own_property: self does not have own property "SpeechRecognition" expected property "SpeechRecognition" missing
-FAIL SpeechRecognition interface: attribute onsoundend assert_own_property: self does not have own property "SpeechRecognition" expected property "SpeechRecognition" missing
-FAIL SpeechRecognition interface: attribute onaudioend assert_own_property: self does not have own property "SpeechRecognition" expected property "SpeechRecognition" missing
-FAIL SpeechRecognition interface: attribute onresult assert_own_property: self does not have own property "SpeechRecognition" expected property "SpeechRecognition" missing
-FAIL SpeechRecognition interface: attribute onnomatch assert_own_property: self does not have own property "SpeechRecognition" expected property "SpeechRecognition" missing
-FAIL SpeechRecognition interface: attribute onerror assert_own_property: self does not have own property "SpeechRecognition" expected property "SpeechRecognition" missing
-FAIL SpeechRecognition interface: attribute onstart assert_own_property: self does not have own property "SpeechRecognition" expected property "SpeechRecognition" missing
-FAIL SpeechRecognition interface: attribute onend assert_own_property: self does not have own property "SpeechRecognition" expected property "SpeechRecognition" missing
-FAIL SpeechRecognition must be primary interface of new SpeechRecognition() assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: SpeechRecognition"
-FAIL Stringification of new SpeechRecognition() assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: SpeechRecognition"
-FAIL SpeechRecognition interface: new SpeechRecognition() must inherit property "grammars" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: SpeechRecognition"
-FAIL SpeechRecognition interface: new SpeechRecognition() must inherit property "lang" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: SpeechRecognition"
-FAIL SpeechRecognition interface: new SpeechRecognition() must inherit property "continuous" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: SpeechRecognition"
-FAIL SpeechRecognition interface: new SpeechRecognition() must inherit property "interimResults" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: SpeechRecognition"
-FAIL SpeechRecognition interface: new SpeechRecognition() must inherit property "maxAlternatives" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: SpeechRecognition"
-FAIL SpeechRecognition interface: new SpeechRecognition() must inherit property "start()" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: SpeechRecognition"
-FAIL SpeechRecognition interface: new SpeechRecognition() must inherit property "stop()" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: SpeechRecognition"
-FAIL SpeechRecognition interface: new SpeechRecognition() must inherit property "abort()" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: SpeechRecognition"
-FAIL SpeechRecognition interface: new SpeechRecognition() must inherit property "onaudiostart" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: SpeechRecognition"
-FAIL SpeechRecognition interface: new SpeechRecognition() must inherit property "onsoundstart" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: SpeechRecognition"
-FAIL SpeechRecognition interface: new SpeechRecognition() must inherit property "onspeechstart" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: SpeechRecognition"
-FAIL SpeechRecognition interface: new SpeechRecognition() must inherit property "onspeechend" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: SpeechRecognition"
-FAIL SpeechRecognition interface: new SpeechRecognition() must inherit property "onsoundend" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: SpeechRecognition"
-FAIL SpeechRecognition interface: new SpeechRecognition() must inherit property "onaudioend" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: SpeechRecognition"
-FAIL SpeechRecognition interface: new SpeechRecognition() must inherit property "onresult" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: SpeechRecognition"
-FAIL SpeechRecognition interface: new SpeechRecognition() must inherit property "onnomatch" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: SpeechRecognition"
-FAIL SpeechRecognition interface: new SpeechRecognition() must inherit property "onerror" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: SpeechRecognition"
-FAIL SpeechRecognition interface: new SpeechRecognition() must inherit property "onstart" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: SpeechRecognition"
-FAIL SpeechRecognition interface: new SpeechRecognition() must inherit property "onend" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: SpeechRecognition"
-FAIL SpeechRecognitionErrorEvent interface: existence and properties of interface object assert_own_property: self does not have own property "SpeechRecognitionErrorEvent" expected property "SpeechRecognitionErrorEvent" missing
-FAIL SpeechRecognitionErrorEvent interface object length assert_own_property: self does not have own property "SpeechRecognitionErrorEvent" expected property "SpeechRecognitionErrorEvent" missing
-FAIL SpeechRecognitionErrorEvent interface object name assert_own_property: self does not have own property "SpeechRecognitionErrorEvent" expected property "SpeechRecognitionErrorEvent" missing
-FAIL SpeechRecognitionErrorEvent interface: existence and properties of interface prototype object assert_own_property: self does not have own property "SpeechRecognitionErrorEvent" expected property "SpeechRecognitionErrorEvent" missing
-FAIL SpeechRecognitionErrorEvent interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "SpeechRecognitionErrorEvent" expected property "SpeechRecognitionErrorEvent" missing
-FAIL SpeechRecognitionErrorEvent interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "SpeechRecognitionErrorEvent" expected property "SpeechRecognitionErrorEvent" missing
-FAIL SpeechRecognitionErrorEvent interface: attribute error assert_own_property: self does not have own property "SpeechRecognitionErrorEvent" expected property "SpeechRecognitionErrorEvent" missing
-FAIL SpeechRecognitionErrorEvent interface: attribute message assert_own_property: self does not have own property "SpeechRecognitionErrorEvent" expected property "SpeechRecognitionErrorEvent" missing
-FAIL SpeechRecognitionAlternative interface: existence and properties of interface object assert_own_property: self does not have own property "SpeechRecognitionAlternative" expected property "SpeechRecognitionAlternative" missing
-FAIL SpeechRecognitionAlternative interface object length assert_own_property: self does not have own property "SpeechRecognitionAlternative" expected property "SpeechRecognitionAlternative" missing
-FAIL SpeechRecognitionAlternative interface object name assert_own_property: self does not have own property "SpeechRecognitionAlternative" expected property "SpeechRecognitionAlternative" missing
-FAIL SpeechRecognitionAlternative interface: existence and properties of interface prototype object assert_own_property: self does not have own property "SpeechRecognitionAlternative" expected property "SpeechRecognitionAlternative" missing
-FAIL SpeechRecognitionAlternative interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "SpeechRecognitionAlternative" expected property "SpeechRecognitionAlternative" missing
-FAIL SpeechRecognitionAlternative interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "SpeechRecognitionAlternative" expected property "SpeechRecognitionAlternative" missing
-FAIL SpeechRecognitionAlternative interface: attribute transcript assert_own_property: self does not have own property "SpeechRecognitionAlternative" expected property "SpeechRecognitionAlternative" missing
-FAIL SpeechRecognitionAlternative interface: attribute confidence assert_own_property: self does not have own property "SpeechRecognitionAlternative" expected property "SpeechRecognitionAlternative" missing
-FAIL SpeechRecognitionResult interface: existence and properties of interface object assert_own_property: self does not have own property "SpeechRecognitionResult" expected property "SpeechRecognitionResult" missing
-FAIL SpeechRecognitionResult interface object length assert_own_property: self does not have own property "SpeechRecognitionResult" expected property "SpeechRecognitionResult" missing
-FAIL SpeechRecognitionResult interface object name assert_own_property: self does not have own property "SpeechRecognitionResult" expected property "SpeechRecognitionResult" missing
-FAIL SpeechRecognitionResult interface: existence and properties of interface prototype object assert_own_property: self does not have own property "SpeechRecognitionResult" expected property "SpeechRecognitionResult" missing
-FAIL SpeechRecognitionResult interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "SpeechRecognitionResult" expected property "SpeechRecognitionResult" missing
-FAIL SpeechRecognitionResult interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "SpeechRecognitionResult" expected property "SpeechRecognitionResult" missing
-FAIL SpeechRecognitionResult interface: attribute length assert_own_property: self does not have own property "SpeechRecognitionResult" expected property "SpeechRecognitionResult" missing
-FAIL SpeechRecognitionResult interface: operation item(unsigned long) assert_own_property: self does not have own property "SpeechRecognitionResult" expected property "SpeechRecognitionResult" missing
-FAIL SpeechRecognitionResult interface: attribute isFinal assert_own_property: self does not have own property "SpeechRecognitionResult" expected property "SpeechRecognitionResult" missing
-FAIL SpeechRecognitionResultList interface: existence and properties of interface object assert_own_property: self does not have own property "SpeechRecognitionResultList" expected property "SpeechRecognitionResultList" missing
-FAIL SpeechRecognitionResultList interface object length assert_own_property: self does not have own property "SpeechRecognitionResultList" expected property "SpeechRecognitionResultList" missing
-FAIL SpeechRecognitionResultList interface object name assert_own_property: self does not have own property "SpeechRecognitionResultList" expected property "SpeechRecognitionResultList" missing
-FAIL SpeechRecognitionResultList interface: existence and properties of interface prototype object assert_own_property: self does not have own property "SpeechRecognitionResultList" expected property "SpeechRecognitionResultList" missing
-FAIL SpeechRecognitionResultList interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "SpeechRecognitionResultList" expected property "SpeechRecognitionResultList" missing
-FAIL SpeechRecognitionResultList interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "SpeechRecognitionResultList" expected property "SpeechRecognitionResultList" missing
-FAIL SpeechRecognitionResultList interface: attribute length assert_own_property: self does not have own property "SpeechRecognitionResultList" expected property "SpeechRecognitionResultList" missing
-FAIL SpeechRecognitionResultList interface: operation item(unsigned long) assert_own_property: self does not have own property "SpeechRecognitionResultList" expected property "SpeechRecognitionResultList" missing
-FAIL SpeechRecognitionEvent interface: existence and properties of interface object assert_own_property: self does not have own property "SpeechRecognitionEvent" expected property "SpeechRecognitionEvent" missing
-FAIL SpeechRecognitionEvent interface object length assert_own_property: self does not have own property "SpeechRecognitionEvent" expected property "SpeechRecognitionEvent" missing
-FAIL SpeechRecognitionEvent interface object name assert_own_property: self does not have own property "SpeechRecognitionEvent" expected property "SpeechRecognitionEvent" missing
-FAIL SpeechRecognitionEvent interface: existence and properties of interface prototype object assert_own_property: self does not have own property "SpeechRecognitionEvent" expected property "SpeechRecognitionEvent" missing
-FAIL SpeechRecognitionEvent interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "SpeechRecognitionEvent" expected property "SpeechRecognitionEvent" missing
-FAIL SpeechRecognitionEvent interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "SpeechRecognitionEvent" expected property "SpeechRecognitionEvent" missing
-FAIL SpeechRecognitionEvent interface: attribute resultIndex assert_own_property: self does not have own property "SpeechRecognitionEvent" expected property "SpeechRecognitionEvent" missing
-FAIL SpeechRecognitionEvent interface: attribute results assert_own_property: self does not have own property "SpeechRecognitionEvent" expected property "SpeechRecognitionEvent" missing
+PASS SpeechRecognition interface: existence and properties of interface object
+PASS SpeechRecognition interface object length
+PASS SpeechRecognition interface object name
+PASS SpeechRecognition interface: existence and properties of interface prototype object
+PASS SpeechRecognition interface: existence and properties of interface prototype object's "constructor" property
+PASS SpeechRecognition interface: existence and properties of interface prototype object's @@unscopables property
+FAIL SpeechRecognition interface: attribute grammars assert_true: The prototype object must have a property "grammars" expected true got false
+PASS SpeechRecognition interface: attribute lang
+PASS SpeechRecognition interface: attribute continuous
+PASS SpeechRecognition interface: attribute interimResults
+PASS SpeechRecognition interface: attribute maxAlternatives
+PASS SpeechRecognition interface: operation start()
+PASS SpeechRecognition interface: operation stop()
+PASS SpeechRecognition interface: operation abort()
+PASS SpeechRecognition interface: attribute onaudiostart
+PASS SpeechRecognition interface: attribute onsoundstart
+PASS SpeechRecognition interface: attribute onspeechstart
+PASS SpeechRecognition interface: attribute onspeechend
+PASS SpeechRecognition interface: attribute onsoundend
+PASS SpeechRecognition interface: attribute onaudioend
+PASS SpeechRecognition interface: attribute onresult
+PASS SpeechRecognition interface: attribute onnomatch
+PASS SpeechRecognition interface: attribute onerror
+PASS SpeechRecognition interface: attribute onstart
+PASS SpeechRecognition interface: attribute onend
+PASS SpeechRecognition must be primary interface of new SpeechRecognition()
+PASS Stringification of new SpeechRecognition()
+FAIL SpeechRecognition interface: new SpeechRecognition() must inherit property "grammars" with the proper type assert_inherits: property "grammars" not found in prototype chain
+PASS SpeechRecognition interface: new SpeechRecognition() must inherit property "lang" with the proper type
+PASS SpeechRecognition interface: new SpeechRecognition() must inherit property "continuous" with the proper type
+PASS SpeechRecognition interface: new SpeechRecognition() must inherit property "interimResults" with the proper type
+PASS SpeechRecognition interface: new SpeechRecognition() must inherit property "maxAlternatives" with the proper type
+PASS SpeechRecognition interface: new SpeechRecognition() must inherit property "start()" with the proper type
+PASS SpeechRecognition interface: new SpeechRecognition() must inherit property "stop()" with the proper type
+PASS SpeechRecognition interface: new SpeechRecognition() must inherit property "abort()" with the proper type
+PASS SpeechRecognition interface: new SpeechRecognition() must inherit property "onaudiostart" with the proper type
+PASS SpeechRecognition interface: new SpeechRecognition() must inherit property "onsoundstart" with the proper type
+PASS SpeechRecognition interface: new SpeechRecognition() must inherit property "onspeechstart" with the proper type
+PASS SpeechRecognition interface: new SpeechRecognition() must inherit property "onspeechend" with the proper type
+PASS SpeechRecognition interface: new SpeechRecognition() must inherit property "onsoundend" with the proper type
+PASS SpeechRecognition interface: new SpeechRecognition() must inherit property "onaudioend" with the proper type
+PASS SpeechRecognition interface: new SpeechRecognition() must inherit property "onresult" with the proper type
+PASS SpeechRecognition interface: new SpeechRecognition() must inherit property "onnomatch" with the proper type
+PASS SpeechRecognition interface: new SpeechRecognition() must inherit property "onerror" with the proper type
+PASS SpeechRecognition interface: new SpeechRecognition() must inherit property "onstart" with the proper type
+PASS SpeechRecognition interface: new SpeechRecognition() must inherit property "onend" with the proper type
+PASS SpeechRecognitionErrorEvent interface: existence and properties of interface object
+PASS SpeechRecognitionErrorEvent interface object length
+PASS SpeechRecognitionErrorEvent interface object name
+PASS SpeechRecognitionErrorEvent interface: existence and properties of interface prototype object
+PASS SpeechRecognitionErrorEvent interface: existence and properties of interface prototype object's "constructor" property
+PASS SpeechRecognitionErrorEvent interface: existence and properties of interface prototype object's @@unscopables property
+PASS SpeechRecognitionErrorEvent interface: attribute error
+PASS SpeechRecognitionErrorEvent interface: attribute message
+PASS SpeechRecognitionAlternative interface: existence and properties of interface object
+PASS SpeechRecognitionAlternative interface object length
+PASS SpeechRecognitionAlternative interface object name
+PASS SpeechRecognitionAlternative interface: existence and properties of interface prototype object
+PASS SpeechRecognitionAlternative interface: existence and properties of interface prototype object's "constructor" property
+PASS SpeechRecognitionAlternative interface: existence and properties of interface prototype object's @@unscopables property
+PASS SpeechRecognitionAlternative interface: attribute transcript
+PASS SpeechRecognitionAlternative interface: attribute confidence
+PASS SpeechRecognitionResult interface: existence and properties of interface object
+PASS SpeechRecognitionResult interface object length
+PASS SpeechRecognitionResult interface object name
+PASS SpeechRecognitionResult interface: existence and properties of interface prototype object
+PASS SpeechRecognitionResult interface: existence and properties of interface prototype object's "constructor" property
+PASS SpeechRecognitionResult interface: existence and properties of interface prototype object's @@unscopables property
+PASS SpeechRecognitionResult interface: attribute length
+PASS SpeechRecognitionResult interface: operation item(unsigned long)
+PASS SpeechRecognitionResult interface: attribute isFinal
+PASS SpeechRecognitionResultList interface: existence and properties of interface object
+PASS SpeechRecognitionResultList interface object length
+PASS SpeechRecognitionResultList interface object name
+PASS SpeechRecognitionResultList interface: existence and properties of interface prototype object
+PASS SpeechRecognitionResultList interface: existence and properties of interface prototype object's "constructor" property
+PASS SpeechRecognitionResultList interface: existence and properties of interface prototype object's @@unscopables property
+PASS SpeechRecognitionResultList interface: attribute length
+PASS SpeechRecognitionResultList interface: operation item(unsigned long)
+PASS SpeechRecognitionEvent interface: existence and properties of interface object
+PASS SpeechRecognitionEvent interface object length
+PASS SpeechRecognitionEvent interface object name
+PASS SpeechRecognitionEvent interface: existence and properties of interface prototype object
+PASS SpeechRecognitionEvent interface: existence and properties of interface prototype object's "constructor" property
+PASS SpeechRecognitionEvent interface: existence and properties of interface prototype object's @@unscopables property
+PASS SpeechRecognitionEvent interface: attribute resultIndex
+PASS SpeechRecognitionEvent interface: attribute results
 FAIL SpeechGrammar interface: existence and properties of interface object assert_own_property: self does not have own property "SpeechGrammar" expected property "SpeechGrammar" missing
 FAIL SpeechGrammar interface object length assert_own_property: self does not have own property "SpeechGrammar" expected property "SpeechGrammar" missing
 FAIL SpeechGrammar interface object name assert_own_property: self does not have own property "SpeechGrammar" expected property "SpeechGrammar" missing

Modified: trunk/LayoutTests/platform/mac/TestExpectations (268761 => 268762)


--- trunk/LayoutTests/platform/mac/TestExpectations	2020-10-20 21:40:40 UTC (rev 268761)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2020-10-20 21:54:36 UTC (rev 268762)
@@ -44,6 +44,8 @@
 pointerevents/mouse [ Pass ]
 imported/w3c/web-platform-tests/pointerevents [ Pass ]
 
+imported/w3c/web-platform-tests/speech-api [ Pass ]
+
 #//////////////////////////////////////////////////////////////////////////////////////////
 # End platform-specific directories.
 #//////////////////////////////////////////////////////////////////////////////////////////

Modified: trunk/Source/WTF/ChangeLog (268761 => 268762)


--- trunk/Source/WTF/ChangeLog	2020-10-20 21:40:40 UTC (rev 268761)
+++ trunk/Source/WTF/ChangeLog	2020-10-20 21:54:36 UTC (rev 268762)
@@ -1,3 +1,14 @@
+2020-10-20  Sihui Liu  <[email protected]>
+
+        Add stubs for SpeechRecognition
+        https://bugs.webkit.org/show_bug.cgi?id=217780
+        <rdar://problem/70350727>
+
+        Reviewed by Youenn Fablet.
+
+        * Scripts/Preferences/WebPreferencesExperimental.yaml:
+        * wtf/PlatformEnable.h:
+
 2020-10-15  Jer Noble  <[email protected]>
 
         Add skeleton implementation of Media Session API

Modified: trunk/Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml (268761 => 268762)


--- trunk/Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml	2020-10-20 21:40:40 UTC (rev 268761)
+++ trunk/Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml	2020-10-20 21:54:36 UTC (rev 268762)
@@ -741,6 +741,18 @@
     WebCore:
       default: true
 
+SpeechRecognitionEnabled:
+  type: bool
+  humanReadableName: "SpeechRecognition API"
+  humanReadableDescription: "Enable SpeechRecognition of WebSpeech API"
+  defaultValue:
+    WebKitLegacy:
+      default: false
+    WebKit:
+      default: false
+    WebCore:
+      default: false
+
 # FIXME: This is enabled when ENABLE(EXPERIMENTAL_FEATURES) is true in WebKit2. Perhaps we should consider using that for WebKitLegacy as well.
 SpringTimingFunctionEnabled:
   type: bool

Modified: trunk/Source/WTF/wtf/PlatformEnable.h (268761 => 268762)


--- trunk/Source/WTF/wtf/PlatformEnable.h	2020-10-20 21:40:40 UTC (rev 268761)
+++ trunk/Source/WTF/wtf/PlatformEnable.h	2020-10-20 21:54:36 UTC (rev 268762)
@@ -446,6 +446,10 @@
 #endif
 
 #if !defined(ENABLE_SPEECH_SYNTHESIS)
+#define ENABLE_SPEECH_SYNTHESIS 1
+#endif
+
+#if !defined(ENABLE_SPEECH_SYNTHESIS)
 #define ENABLE_SPEECH_SYNTHESIS 0
 #endif
 

Modified: trunk/Source/WebCore/CMakeLists.txt (268761 => 268762)


--- trunk/Source/WebCore/CMakeLists.txt	2020-10-20 21:40:40 UTC (rev 268761)
+++ trunk/Source/WebCore/CMakeLists.txt	2020-10-20 21:54:36 UTC (rev 268762)
@@ -448,6 +448,14 @@
     Modules/remoteplayback/RemotePlayback.idl
     Modules/remoteplayback/RemotePlaybackAvailabilityCallback.idl
 
+    Modules/speech/SpeechRecognition.idl
+    Modules/speech/SpeechRecognitionAlternative.idl
+    Modules/speech/SpeechRecognitionErrorCode.idl
+    Modules/speech/SpeechRecognitionErrorEvent.idl
+    Modules/speech/SpeechRecognitionEvent.idl
+    Modules/speech/SpeechRecognitionResult.idl
+    Modules/speech/SpeechRecognitionResultList.idl
+
     Modules/speech/DOMWindow+SpeechSynthesis.idl
     Modules/speech/SpeechSynthesis.idl
     Modules/speech/SpeechSynthesisEvent.idl

Modified: trunk/Source/WebCore/ChangeLog (268761 => 268762)


--- trunk/Source/WebCore/ChangeLog	2020-10-20 21:40:40 UTC (rev 268761)
+++ trunk/Source/WebCore/ChangeLog	2020-10-20 21:54:36 UTC (rev 268762)
@@ -1,3 +1,80 @@
+2020-10-20  Sihui Liu  <[email protected]>
+
+        Add stubs for SpeechRecognition
+        https://bugs.webkit.org/show_bug.cgi?id=217780
+        <rdar://problem/70350727>
+
+        Reviewed by Youenn Fablet.
+
+        Add bindings code and a feature flag for SpeechRecognition.
+        Spec: https://wicg.github.io/speech-api/#speechreco-section.
+
+        This patch includes all interfaces of SpeechRecognition, except SpeechGrammar and SpeechGrammarList. We have not
+        decided what grammar format and types we are going to support, or how we are going to support it if it is not
+        defined in exisiting speech recognition service. So let's add those interfaces after we figure this out. 
+
+        No new tests. Rebaseline existins tests.
+
+        * CMakeLists.txt:
+        * DerivedSources-input.xcfilelist:
+        * DerivedSources-output.xcfilelist:
+        * DerivedSources.make:
+        * Modules/speech/SpeechRecognition.cpp: Added.
+        (WebCore::SpeechRecognition::create):
+        (WebCore::SpeechRecognition::SpeechRecognition):
+        (WebCore::SpeechRecognition::suspend):
+        (WebCore::SpeechRecognition::startRecognition):
+        (WebCore::SpeechRecognition::stopRecognition):
+        (WebCore::SpeechRecognition::abortRecognition):
+        (WebCore::SpeechRecognition::activeDOMObjectName const):
+        * Modules/speech/SpeechRecognition.h: Added.
+        (WebCore::SpeechRecognition::lang const):
+        (WebCore::SpeechRecognition::setLang):
+        (WebCore::SpeechRecognition::continuous const):
+        (WebCore::SpeechRecognition::setContinuous):
+        (WebCore::SpeechRecognition::interimResults const):
+        (WebCore::SpeechRecognition::setInterimResults):
+        (WebCore::SpeechRecognition::maxAlternatives const):
+        (WebCore::SpeechRecognition::setMaxAlternatives):
+        * Modules/speech/SpeechRecognition.idl: Added.
+        * Modules/speech/SpeechRecognitionAlternative.cpp: Added.
+        (WebCore::SpeechRecognitionAlternative::create):
+        (WebCore::SpeechRecognitionAlternative::SpeechRecognitionAlternative):
+        * Modules/speech/SpeechRecognitionAlternative.h: Added.
+        * Modules/speech/SpeechRecognitionAlternative.idl: Added.
+        * Modules/speech/SpeechRecognitionErrorCode.h: Added.
+        * Modules/speech/SpeechRecognitionErrorCode.idl: Added.
+        * Modules/speech/SpeechRecognitionErrorEvent.cpp: Added.
+        (WebCore::SpeechRecognitionErrorEvent::create):
+        (WebCore::SpeechRecognitionErrorEvent::SpeechRecognitionErrorEvent):
+        (WebCore::SpeechRecognitionErrorEvent::eventInterface const):
+        * Modules/speech/SpeechRecognitionErrorEvent.h: Added.
+        * Modules/speech/SpeechRecognitionErrorEvent.idl: Added.
+        * Modules/speech/SpeechRecognitionEvent.cpp: Added.
+        (WebCore::SpeechRecognitionEvent::create):
+        (WebCore::SpeechRecognitionEvent::SpeechRecognitionEvent):
+        (WebCore::SpeechRecognitionEvent::eventInterface const):
+        * Modules/speech/SpeechRecognitionEvent.h: Added.
+        * Modules/speech/SpeechRecognitionEvent.idl: Added.
+        * Modules/speech/SpeechRecognitionResult.cpp: Added.
+        (WebCore::SpeechRecognitionResult::create):
+        (WebCore::SpeechRecognitionResult::SpeechRecognitionResult):
+        (WebCore::SpeechRecognitionResult::item const):
+        * Modules/speech/SpeechRecognitionResult.h: Added.
+        * Modules/speech/SpeechRecognitionResult.idl: Added.
+        * Modules/speech/SpeechRecognitionResultList.cpp: Added.
+        (WebCore::SpeechRecognitionResultList::create):
+        (WebCore::SpeechRecognitionResultList::item const):
+        (WebCore::SpeechRecognitionResultList::add):
+        (WebCore::SpeechRecognitionResultList::SpeechRecognitionResultList):
+        * Modules/speech/SpeechRecognitionResultList.h: Added.
+        * Modules/speech/SpeechRecognitionResultList.idl: Added.
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/WebCoreBuiltinNames.h:
+        * dom/EventNames.in:
+        * dom/EventTargetFactory.in:
+
 2020-10-20  Don Olmstead  <[email protected]>
 
         Fix non-c-typedef-for-linkage warning in SocketStreamHandle

Modified: trunk/Source/WebCore/DerivedSources-input.xcfilelist (268761 => 268762)


--- trunk/Source/WebCore/DerivedSources-input.xcfilelist	2020-10-20 21:40:40 UTC (rev 268761)
+++ trunk/Source/WebCore/DerivedSources-input.xcfilelist	2020-10-20 21:54:36 UTC (rev 268762)
@@ -289,6 +289,13 @@
 $(PROJECT_DIR)/Modules/remoteplayback/HTMLMediaElement+RemotePlayback.idl
 $(PROJECT_DIR)/Modules/remoteplayback/RemotePlayback.idl
 $(PROJECT_DIR)/Modules/remoteplayback/RemotePlaybackAvailabilityCallback.idl
+$(PROJECT_DIR)/Modules/speech/SpeechRecognition.idl
+$(PROJECT_DIR)/Modules/speech/SpeechRecognitionAlternative.idl
+$(PROJECT_DIR)/Modules/speech/SpeechRecognitionErrorCode.idl
+$(PROJECT_DIR)/Modules/speech/SpeechRecognitionErrorEvent.idl
+$(PROJECT_DIR)/Modules/speech/SpeechRecognitionEvent.idl
+$(PROJECT_DIR)/Modules/speech/SpeechRecognitionResult.idl
+$(PROJECT_DIR)/Modules/speech/SpeechRecognitionResultList.idl
 $(PROJECT_DIR)/Modules/speech/DOMWindow+SpeechSynthesis.idl
 $(PROJECT_DIR)/Modules/speech/SpeechSynthesis.idl
 $(PROJECT_DIR)/Modules/speech/SpeechSynthesisEvent.idl

Modified: trunk/Source/WebCore/DerivedSources-output.xcfilelist (268761 => 268762)


--- trunk/Source/WebCore/DerivedSources-output.xcfilelist	2020-10-20 21:40:40 UTC (rev 268761)
+++ trunk/Source/WebCore/DerivedSources-output.xcfilelist	2020-10-20 21:54:36 UTC (rev 268762)
@@ -2132,6 +2132,20 @@
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSourceBuffer.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSourceBufferList.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSourceBufferList.h
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechRecognition.cpp
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechRecognition.h
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechRecognitionAlternative.cpp
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechRecognitionAlternative.h
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechRecognitionErrorCode.cpp
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechRecognitionErrorCode.h
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechRecognitionErrorEvent.cpp
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechRecognitionErrorEvent.h
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechRecognitionEvent.cpp
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechRecognitionEvent.h
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechRecognitionResult.cpp
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechRecognitionResult.h
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechRecognitionResultList.cpp
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechRecognitionResultList.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechSynthesis.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechSynthesis.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechSynthesisEvent.cpp

Modified: trunk/Source/WebCore/DerivedSources.make (268761 => 268762)


--- trunk/Source/WebCore/DerivedSources.make	2020-10-20 21:40:40 UTC (rev 268761)
+++ trunk/Source/WebCore/DerivedSources.make	2020-10-20 21:54:36 UTC (rev 268762)
@@ -316,6 +316,13 @@
     $(WebCore)/Modules/speech/SpeechSynthesisEvent.idl \
     $(WebCore)/Modules/speech/SpeechSynthesisUtterance.idl \
     $(WebCore)/Modules/speech/SpeechSynthesisVoice.idl \
+	$(WebCore)/Modules/speech/SpeechRecognition.idl \
+	$(WebCore)/Modules/speech/SpeechRecognitionAlternative.idl \
+	$(WebCore)/Modules/speech/SpeechRecognitionErrorCode.idl \
+	$(WebCore)/Modules/speech/SpeechRecognitionErrorEvent.idl \
+	$(WebCore)/Modules/speech/SpeechRecognitionEvent.idl \
+	$(WebCore)/Modules/speech/SpeechRecognitionResult.idl \
+	$(WebCore)/Modules/speech/SpeechRecognitionResultList.idl \
     $(WebCore)/Modules/streams/ByteLengthQueuingStrategy.idl \
     $(WebCore)/Modules/streams/CountQueuingStrategy.idl \
     $(WebCore)/Modules/streams/ReadableByteStreamController.idl \

Added: trunk/Source/WebCore/Modules/speech/SpeechRecognition.cpp (0 => 268762)


--- trunk/Source/WebCore/Modules/speech/SpeechRecognition.cpp	                        (rev 0)
+++ trunk/Source/WebCore/Modules/speech/SpeechRecognition.cpp	2020-10-20 21:54:36 UTC (rev 268762)
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2020 Apple 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:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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 "SpeechRecognition.h"
+
+#include "Document.h"
+#include <wtf/IsoMallocInlines.h>
+
+namespace WebCore {
+
+WTF_MAKE_ISO_ALLOCATED_IMPL(SpeechRecognition);
+
+Ref<SpeechRecognition> SpeechRecognition::create(Document& document)
+{
+    return adoptRef(*new SpeechRecognition(document));
+}
+
+SpeechRecognition::SpeechRecognition(Document& document)
+    : ActiveDOMObject(document)
+{
+    suspendIfNeeded();
+}
+
+void SpeechRecognition::suspend(ReasonForSuspension)
+{
+    abortRecognition();
+}
+
+ExceptionOr<void> SpeechRecognition::startRecognition()
+{
+    return { };
+}
+
+void SpeechRecognition::stopRecognition()
+{
+}
+
+void SpeechRecognition::abortRecognition()
+{
+}
+
+const char* SpeechRecognition::activeDOMObjectName() const
+{
+    return "SpeechRecognition";
+}
+
+} // namespace WebCore

Added: trunk/Source/WebCore/Modules/speech/SpeechRecognition.h (0 => 268762)


--- trunk/Source/WebCore/Modules/speech/SpeechRecognition.h	                        (rev 0)
+++ trunk/Source/WebCore/Modules/speech/SpeechRecognition.h	2020-10-20 21:54:36 UTC (rev 268762)
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2020 Apple 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:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+#pragma once
+
+#include "ActiveDOMObject.h"
+#include "EventTarget.h"
+#include "SpeechRecognitionResult.h"
+
+namespace WebCore {
+
+class Document;
+
+class SpeechRecognition : public ActiveDOMObject, public RefCounted<SpeechRecognition>, public EventTargetWithInlineData  {
+    WTF_MAKE_ISO_ALLOCATED(SpeechRecognition);
+public:
+    static Ref<SpeechRecognition> create(Document&);
+
+    const String& lang() const { return m_lang; }
+    void setLang(String&& lang) { m_lang = WTFMove(lang); }
+
+    bool continuous() const { return m_continuous; }
+    void setContinuous(bool continuous) { m_continuous = continuous; }
+
+    bool interimResults() const { return m_interimResults; }
+    void setInterimResults(bool interimResults) { m_interimResults = interimResults; }
+
+    uint64_t maxAlternatives() const { return m_maxAlternatives; }
+    void setMaxAlternatives(unsigned maxAlternatives) { m_maxAlternatives = maxAlternatives; }
+
+    ExceptionOr<void> startRecognition();
+    void stopRecognition();
+    void abortRecognition();
+
+    using RefCounted::ref;
+    using RefCounted::deref;
+
+private:
+    explicit SpeechRecognition(Document&);
+
+    // ActiveDOMObject
+    const char* activeDOMObjectName() const;
+    void suspend(ReasonForSuspension);
+
+    // EventTarget
+    ScriptExecutionContext* scriptExecutionContext() const final { return ActiveDOMObject::scriptExecutionContext(); }
+    EventTargetInterface eventTargetInterface() const final { return SpeechRecognitionEventTargetInterfaceType; }
+    void refEventTarget() final { ref(); }
+    void derefEventTarget() final { deref(); }
+
+    String m_lang;
+    bool m_continuous { false };
+    bool m_interimResults { false };
+    uint64_t m_maxAlternatives { 1 };
+};
+
+} // namespace WebCore

Added: trunk/Source/WebCore/Modules/speech/SpeechRecognition.idl (0 => 268762)


--- trunk/Source/WebCore/Modules/speech/SpeechRecognition.idl	                        (rev 0)
+++ trunk/Source/WebCore/Modules/speech/SpeechRecognition.idl	2020-10-20 21:54:36 UTC (rev 268762)
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2020 Apple 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:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+[
+    ActiveDOMObject,
+    EnabledBySetting=SpeechRecognition,
+    Exposed=Window
+] interface SpeechRecognition : EventTarget {
+    [CallWith=Document] constructor();
+
+    attribute DOMString lang;
+    attribute boolean continuous;
+    attribute boolean interimResults;
+    attribute unsigned long maxAlternatives;
+
+    [MayThrowException, ImplementedAs=startRecognition] undefined start();
+    [ImplementedAs=stopRecognition] undefined stop();
+    [ImplementedAs=abortRecognition] undefined abort();
+
+    attribute EventHandler onaudiostart;
+    attribute EventHandler onsoundstart;
+    attribute EventHandler onspeechstart;
+    attribute EventHandler onspeechend;
+    attribute EventHandler onsoundend;
+    attribute EventHandler onaudioend;
+    attribute EventHandler onresult;
+    attribute EventHandler onnomatch;
+    attribute EventHandler onerror;
+    attribute EventHandler onstart;
+    attribute EventHandler onend;
+};

Added: trunk/Source/WebCore/Modules/speech/SpeechRecognitionAlternative.cpp (0 => 268762)


--- trunk/Source/WebCore/Modules/speech/SpeechRecognitionAlternative.cpp	                        (rev 0)
+++ trunk/Source/WebCore/Modules/speech/SpeechRecognitionAlternative.cpp	2020-10-20 21:54:36 UTC (rev 268762)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2020 Apple 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:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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 "SpeechRecognitionAlternative.h"
+
+#include <wtf/IsoMallocInlines.h>
+
+namespace WebCore {
+
+WTF_MAKE_ISO_ALLOCATED_IMPL(SpeechRecognitionAlternative);
+
+Ref<SpeechRecognitionAlternative> SpeechRecognitionAlternative::create(String&& transcript, double confidence)
+{
+    return adoptRef(*new SpeechRecognitionAlternative(WTFMove(transcript), confidence));
+}
+
+SpeechRecognitionAlternative::SpeechRecognitionAlternative(String&& transcript, double confidence)
+    : m_transcript(WTFMove(transcript))
+    , m_confidence(confidence)
+{
+}
+
+} // namespace WebCore

Added: trunk/Source/WebCore/Modules/speech/SpeechRecognitionAlternative.h (0 => 268762)


--- trunk/Source/WebCore/Modules/speech/SpeechRecognitionAlternative.h	                        (rev 0)
+++ trunk/Source/WebCore/Modules/speech/SpeechRecognitionAlternative.h	2020-10-20 21:54:36 UTC (rev 268762)
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2020 Apple 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:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+#pragma once
+
+#include <wtf/IsoMalloc.h>
+#include <wtf/RefCounted.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+class SpeechRecognitionAlternative final : public RefCounted<SpeechRecognitionAlternative> {
+    WTF_MAKE_ISO_ALLOCATED(SpeechRecognitionAlternative);
+public:
+    static Ref<SpeechRecognitionAlternative> create(String&& transcript, double confidence);
+
+    const String& transcript() const { return m_transcript; }
+    double confidence() const { return m_confidence; }
+
+private:
+    SpeechRecognitionAlternative(String&& transcript, double confidence);
+
+    String m_transcript;
+    double m_confidence;
+};
+
+} // namespace WebCore

Added: trunk/Source/WebCore/Modules/speech/SpeechRecognitionAlternative.idl (0 => 268762)


--- trunk/Source/WebCore/Modules/speech/SpeechRecognitionAlternative.idl	                        (rev 0)
+++ trunk/Source/WebCore/Modules/speech/SpeechRecognitionAlternative.idl	2020-10-20 21:54:36 UTC (rev 268762)
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2020 Apple 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:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+[
+    ImplementationLacksVTable,
+    EnabledBySetting=SpeechRecognition,
+    Exposed=Window
+] interface SpeechRecognitionAlternative {
+    readonly attribute DOMString transcript;
+    readonly attribute float confidence;
+};

Added: trunk/Source/WebCore/Modules/speech/SpeechRecognitionErrorCode.h (0 => 268762)


--- trunk/Source/WebCore/Modules/speech/SpeechRecognitionErrorCode.h	                        (rev 0)
+++ trunk/Source/WebCore/Modules/speech/SpeechRecognitionErrorCode.h	2020-10-20 21:54:36 UTC (rev 268762)
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2020 Apple 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:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+#pragma once
+
+namespace WebCore {
+
+enum class SpeechRecognitionErrorCode {
+    NoSpeech,
+    Aborted,
+    AudioCapture,
+    Network,
+    NotAllowed,
+    ServiceNotAllowed,
+    BadGrammar,
+    LanguageNotSupported
+};
+
+} // namespace WebCore

Added: trunk/Source/WebCore/Modules/speech/SpeechRecognitionErrorCode.idl (0 => 268762)


--- trunk/Source/WebCore/Modules/speech/SpeechRecognitionErrorCode.idl	                        (rev 0)
+++ trunk/Source/WebCore/Modules/speech/SpeechRecognitionErrorCode.idl	2020-10-20 21:54:36 UTC (rev 268762)
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2020 Apple 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:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+enum SpeechRecognitionErrorCode {
+    "no-speech",
+    "aborted",
+    "audio-capture",
+    "network",
+    "not-allowed",
+    "service-not-allowed",
+    "bad-grammar",
+    "language-not-supported"
+};

Added: trunk/Source/WebCore/Modules/speech/SpeechRecognitionErrorEvent.cpp (0 => 268762)


--- trunk/Source/WebCore/Modules/speech/SpeechRecognitionErrorEvent.cpp	                        (rev 0)
+++ trunk/Source/WebCore/Modules/speech/SpeechRecognitionErrorEvent.cpp	2020-10-20 21:54:36 UTC (rev 268762)
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2020 Apple 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:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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 "SpeechRecognitionErrorEvent.h"
+
+#include <wtf/IsoMallocInlines.h>
+
+namespace WebCore {
+
+WTF_MAKE_ISO_ALLOCATED_IMPL(SpeechRecognitionErrorEvent);
+
+Ref<SpeechRecognitionErrorEvent> SpeechRecognitionErrorEvent::create(const AtomString& type, Init&& init, IsTrusted isTrusted)
+{
+    return adoptRef(*new SpeechRecognitionErrorEvent(type, WTFMove(init), isTrusted));
+}
+
+Ref<SpeechRecognitionErrorEvent> SpeechRecognitionErrorEvent::create(const AtomString& type, SpeechRecognitionErrorCode error, const String& message)
+{
+    return adoptRef(*new SpeechRecognitionErrorEvent(type, error, message));
+}
+
+SpeechRecognitionErrorEvent::SpeechRecognitionErrorEvent(const AtomString& type, Init&& init, IsTrusted isTrusted)
+    : Event(type, init, isTrusted)
+    , m_error(init.error)
+    , m_message(WTFMove(init.message))
+{
+}
+
+SpeechRecognitionErrorEvent::SpeechRecognitionErrorEvent(const AtomString& type, SpeechRecognitionErrorCode error, const String& message)
+    : Event(type, Event::CanBubble::No, Event::IsCancelable::No)
+    , m_error(error)
+    , m_message(message)
+{
+}
+
+EventInterface SpeechRecognitionErrorEvent::eventInterface() const
+{
+    return SpeechRecognitionErrorEventInterfaceType;
+}
+
+}; // namespace WebCore

Added: trunk/Source/WebCore/Modules/speech/SpeechRecognitionErrorEvent.h (0 => 268762)


--- trunk/Source/WebCore/Modules/speech/SpeechRecognitionErrorEvent.h	                        (rev 0)
+++ trunk/Source/WebCore/Modules/speech/SpeechRecognitionErrorEvent.h	2020-10-20 21:54:36 UTC (rev 268762)
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2020 Apple 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:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+#pragma once
+
+#include "Event.h"
+#include "SpeechRecognitionErrorCode.h"
+
+namespace WebCore {
+
+class SpeechRecognitionErrorEvent final : public Event {
+    WTF_MAKE_ISO_ALLOCATED(SpeechRecognitionErrorEvent);
+public:
+    struct Init : EventInit {
+        SpeechRecognitionErrorCode error;
+        String message;
+    };
+
+    static Ref<SpeechRecognitionErrorEvent> create(const AtomString&, Init&&, IsTrusted = IsTrusted::No);
+    static Ref<SpeechRecognitionErrorEvent> create(const AtomString&, SpeechRecognitionErrorCode, const String&);
+
+    SpeechRecognitionErrorCode error() const { return m_error; }
+    const String& message() const { return m_message; }
+
+private:
+    SpeechRecognitionErrorEvent(const AtomString&, Init&&, IsTrusted);
+    SpeechRecognitionErrorEvent(const AtomString&, SpeechRecognitionErrorCode, const String&);
+
+    EventInterface eventInterface() const final;
+
+    SpeechRecognitionErrorCode m_error;
+    String m_message;
+
+};
+
+} // namespace WebCore

Added: trunk/Source/WebCore/Modules/speech/SpeechRecognitionErrorEvent.idl (0 => 268762)


--- trunk/Source/WebCore/Modules/speech/SpeechRecognitionErrorEvent.idl	                        (rev 0)
+++ trunk/Source/WebCore/Modules/speech/SpeechRecognitionErrorEvent.idl	2020-10-20 21:54:36 UTC (rev 268762)
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2020 Apple 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:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+[
+    EnabledBySetting=SpeechRecognition,
+    Exposed=Window
+] interface SpeechRecognitionErrorEvent : Event {
+    constructor(DOMString type, SpeechRecognitionErrorEventInit eventInitDict);
+    readonly attribute SpeechRecognitionErrorCode error;
+    readonly attribute DOMString message;
+};
+
+dictionary SpeechRecognitionErrorEventInit : EventInit {
+    required SpeechRecognitionErrorCode error;
+    DOMString message = "";
+};

Added: trunk/Source/WebCore/Modules/speech/SpeechRecognitionEvent.cpp (0 => 268762)


--- trunk/Source/WebCore/Modules/speech/SpeechRecognitionEvent.cpp	                        (rev 0)
+++ trunk/Source/WebCore/Modules/speech/SpeechRecognitionEvent.cpp	2020-10-20 21:54:36 UTC (rev 268762)
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2020 Apple 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:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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 "SpeechRecognitionEvent.h"
+
+#include "SpeechRecognitionResultList.h"
+#include <wtf/IsoMallocInlines.h>
+
+namespace WebCore {
+
+WTF_MAKE_ISO_ALLOCATED_IMPL(SpeechRecognitionEvent);
+
+Ref<SpeechRecognitionEvent> SpeechRecognitionEvent::create(const AtomString& type, Init&& init, IsTrusted isTrusted)
+{
+    return adoptRef(*new SpeechRecognitionEvent(type, WTFMove(init), isTrusted));
+}
+
+Ref<SpeechRecognitionEvent> SpeechRecognitionEvent::create(const AtomString& type, uint64_t resultIndex, RefPtr<SpeechRecognitionResultList>&& results)
+{
+    return adoptRef(*new SpeechRecognitionEvent(type, resultIndex, WTFMove(results)));
+}
+
+SpeechRecognitionEvent::SpeechRecognitionEvent(const AtomString& type, Init&& init, IsTrusted isTrusted)
+    : Event(type, init, isTrusted)
+    , m_resultIndex(init.resultIndex)
+    , m_results(WTFMove(init.results))
+{
+}
+
+SpeechRecognitionEvent::SpeechRecognitionEvent(const AtomString& type, uint64_t resultIndex, RefPtr<SpeechRecognitionResultList>&& results)
+    : Event(type, Event::CanBubble::No, Event::IsCancelable::No)
+    , m_resultIndex(resultIndex)
+    , m_results(WTFMove(results))
+{
+}
+
+EventInterface SpeechRecognitionEvent::eventInterface() const
+{
+    return SpeechRecognitionEventInterfaceType;
+}
+
+} // namespace WebCore

Added: trunk/Source/WebCore/Modules/speech/SpeechRecognitionEvent.h (0 => 268762)


--- trunk/Source/WebCore/Modules/speech/SpeechRecognitionEvent.h	                        (rev 0)
+++ trunk/Source/WebCore/Modules/speech/SpeechRecognitionEvent.h	2020-10-20 21:54:36 UTC (rev 268762)
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2020 Apple 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:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+#pragma once
+
+#include "Event.h"
+
+namespace WebCore {
+
+class SpeechRecognitionResultList;
+
+class SpeechRecognitionEvent final : public Event {
+    WTF_MAKE_ISO_ALLOCATED(SpeechRecognitionEvent);
+public:
+    struct Init : EventInit {
+        uint64_t resultIndex;
+        RefPtr<SpeechRecognitionResultList> results;
+    };
+
+    static Ref<SpeechRecognitionEvent> create(const AtomString&, Init&&, IsTrusted = IsTrusted::No);
+    static Ref<SpeechRecognitionEvent> create(const AtomString&, uint64_t resultIndex, RefPtr<SpeechRecognitionResultList>&&);
+
+    uint64_t resultIndex() const { return m_resultIndex; }
+    SpeechRecognitionResultList* results() const { return m_results.get(); }
+
+private:
+    SpeechRecognitionEvent(const AtomString&, Init&&, IsTrusted);
+    SpeechRecognitionEvent(const AtomString&, uint64_t resultIndex, RefPtr<SpeechRecognitionResultList>&&);
+
+    EventInterface eventInterface() const final;
+
+    uint64_t m_resultIndex;
+    RefPtr<SpeechRecognitionResultList> m_results;
+};
+
+} // namespace WebCore

Added: trunk/Source/WebCore/Modules/speech/SpeechRecognitionEvent.idl (0 => 268762)


--- trunk/Source/WebCore/Modules/speech/SpeechRecognitionEvent.idl	                        (rev 0)
+++ trunk/Source/WebCore/Modules/speech/SpeechRecognitionEvent.idl	2020-10-20 21:54:36 UTC (rev 268762)
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2020 Apple 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:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+[
+    EnabledBySetting=SpeechRecognition,
+    Exposed=Window
+] interface SpeechRecognitionEvent : Event {
+    constructor(DOMString type, SpeechRecognitionEventInit eventInitDict);
+    readonly attribute unsigned long resultIndex;
+    readonly attribute SpeechRecognitionResultList results;
+};
+
+dictionary SpeechRecognitionEventInit : EventInit {
+    unsigned long resultIndex = 0;
+    required SpeechRecognitionResultList results;
+};

Added: trunk/Source/WebCore/Modules/speech/SpeechRecognitionResult.cpp (0 => 268762)


--- trunk/Source/WebCore/Modules/speech/SpeechRecognitionResult.cpp	                        (rev 0)
+++ trunk/Source/WebCore/Modules/speech/SpeechRecognitionResult.cpp	2020-10-20 21:54:36 UTC (rev 268762)
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2020 Apple 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:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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 "SpeechRecognitionResult.h"
+
+#include <wtf/IsoMallocInlines.h>
+
+namespace WebCore {
+
+WTF_MAKE_ISO_ALLOCATED_IMPL(SpeechRecognitionResult);
+
+Ref<SpeechRecognitionResult> SpeechRecognitionResult::create(Vector<Ref<SpeechRecognitionAlternative>>&& alternatives, bool isFinal)
+{
+    return adoptRef(*new SpeechRecognitionResult(WTFMove(alternatives), isFinal));
+}
+
+SpeechRecognitionResult::SpeechRecognitionResult(Vector<Ref<SpeechRecognitionAlternative>>&& alternatives, bool isFinal)
+    : m_alternatives(WTFMove(alternatives))
+    , m_isFinal(isFinal)
+{
+}
+
+SpeechRecognitionAlternative* SpeechRecognitionResult::item(uint64_t index) const
+{
+    return (index < m_alternatives.size()) ? m_alternatives[index].ptr() : nullptr;
+}
+
+} // namespace WebCore

Added: trunk/Source/WebCore/Modules/speech/SpeechRecognitionResult.h (0 => 268762)


--- trunk/Source/WebCore/Modules/speech/SpeechRecognitionResult.h	                        (rev 0)
+++ trunk/Source/WebCore/Modules/speech/SpeechRecognitionResult.h	2020-10-20 21:54:36 UTC (rev 268762)
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2020 Apple 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:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+#pragma once
+
+#include "SpeechRecognitionAlternative.h"
+#include <wtf/IsoMalloc.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class SpeechRecognitionResult final : public RefCounted<SpeechRecognitionResult> {
+    WTF_MAKE_ISO_ALLOCATED(SpeechRecognitionResult);
+public:
+    static Ref<SpeechRecognitionResult> create(Vector<Ref<SpeechRecognitionAlternative>>&&, bool isFinal);
+
+    uint64_t length() const { return m_alternatives.size(); }
+    bool isFinal() const { return m_isFinal; }
+    SpeechRecognitionAlternative* item(uint64_t index) const;
+
+private:
+    SpeechRecognitionResult(Vector<Ref<SpeechRecognitionAlternative>>&&, bool isFinal);
+
+    Vector<Ref<SpeechRecognitionAlternative>> m_alternatives;
+    bool m_isFinal { false };
+};
+
+}

Added: trunk/Source/WebCore/Modules/speech/SpeechRecognitionResult.idl (0 => 268762)


--- trunk/Source/WebCore/Modules/speech/SpeechRecognitionResult.idl	                        (rev 0)
+++ trunk/Source/WebCore/Modules/speech/SpeechRecognitionResult.idl	2020-10-20 21:54:36 UTC (rev 268762)
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2020 Apple 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:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+[
+    EnabledBySetting=SpeechRecognition,
+    ImplementationLacksVTable,
+    Exposed=Window
+] interface SpeechRecognitionResult {
+    readonly attribute unsigned long length;
+    getter SpeechRecognitionAlternative item(unsigned long index);
+    readonly attribute boolean isFinal;
+};

Added: trunk/Source/WebCore/Modules/speech/SpeechRecognitionResultList.cpp (0 => 268762)


--- trunk/Source/WebCore/Modules/speech/SpeechRecognitionResultList.cpp	                        (rev 0)
+++ trunk/Source/WebCore/Modules/speech/SpeechRecognitionResultList.cpp	2020-10-20 21:54:36 UTC (rev 268762)
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2020 Apple 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:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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 "SpeechRecognitionResultList.h"
+
+#include "SpeechRecognitionResult.h"
+#include <wtf/IsoMallocInlines.h>
+
+namespace WebCore {
+
+WTF_MAKE_ISO_ALLOCATED_IMPL(SpeechRecognitionResultList);
+
+Ref<SpeechRecognitionResultList> SpeechRecognitionResultList::create()
+{
+    return adoptRef(*new SpeechRecognitionResultList());
+}
+
+Ref<SpeechRecognitionResultList> SpeechRecognitionResultList::create(Vector<Ref<SpeechRecognitionResult>>&& list)
+{
+    return adoptRef(*new SpeechRecognitionResultList(WTFMove(list)));
+}
+
+SpeechRecognitionResult* SpeechRecognitionResultList::item(uint64_t index) const
+{
+    return (index < m_list.size()) ? m_list[index].ptr() : nullptr;
+}
+
+void SpeechRecognitionResultList::add(SpeechRecognitionResult& result)
+{
+    m_list.append(makeRef(result));
+}
+
+SpeechRecognitionResultList::SpeechRecognitionResultList(Vector<Ref<SpeechRecognitionResult>>&& list)
+    : m_list(WTFMove(list))
+{
+}
+
+} // namespace WebCore

Added: trunk/Source/WebCore/Modules/speech/SpeechRecognitionResultList.h (0 => 268762)


--- trunk/Source/WebCore/Modules/speech/SpeechRecognitionResultList.h	                        (rev 0)
+++ trunk/Source/WebCore/Modules/speech/SpeechRecognitionResultList.h	2020-10-20 21:54:36 UTC (rev 268762)
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2020 Apple 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:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+#pragma once
+
+#include <wtf/IsoMalloc.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class SpeechRecognitionResult;
+
+class SpeechRecognitionResultList final : public RefCounted<SpeechRecognitionResultList> {
+    WTF_MAKE_ISO_ALLOCATED(SpeechRecognitionResultList);
+public:
+    static Ref<SpeechRecognitionResultList> create();
+    static Ref<SpeechRecognitionResultList> create(Vector<Ref<SpeechRecognitionResult>>&&);
+
+    bool length() const { return m_list.size(); }
+    SpeechRecognitionResult* item(uint64_t index) const;
+
+    void add(SpeechRecognitionResult&);
+
+private:
+    SpeechRecognitionResultList() = default;
+    explicit SpeechRecognitionResultList(Vector<Ref<SpeechRecognitionResult>>&&);
+
+    Vector<Ref<SpeechRecognitionResult>> m_list;
+};
+
+} // namespace WebCore

Added: trunk/Source/WebCore/Modules/speech/SpeechRecognitionResultList.idl (0 => 268762)


--- trunk/Source/WebCore/Modules/speech/SpeechRecognitionResultList.idl	                        (rev 0)
+++ trunk/Source/WebCore/Modules/speech/SpeechRecognitionResultList.idl	2020-10-20 21:54:36 UTC (rev 268762)
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2020 Apple 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:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+[
+    EnabledBySetting=SpeechRecognition,
+    ImplementationLacksVTable,
+    Exposed=Window
+] interface SpeechRecognitionResultList {
+    readonly attribute unsigned long length;
+    getter SpeechRecognitionResult item(unsigned long index);
+};

Modified: trunk/Source/WebCore/Sources.txt (268761 => 268762)


--- trunk/Source/WebCore/Sources.txt	2020-10-20 21:40:40 UTC (rev 268761)
+++ trunk/Source/WebCore/Sources.txt	2020-10-20 21:54:36 UTC (rev 268762)
@@ -184,6 +184,12 @@
 Modules/pictureinpicture/HTMLVideoElementPictureInPicture.cpp
 Modules/pictureinpicture/PictureInPictureWindow.cpp
 Modules/remoteplayback/RemotePlayback.cpp
+Modules/speech/SpeechRecognition.cpp
+Modules/speech/SpeechRecognitionAlternative.cpp
+Modules/speech/SpeechRecognitionErrorEvent.cpp
+Modules/speech/SpeechRecognitionEvent.cpp
+Modules/speech/SpeechRecognitionResult.cpp
+Modules/speech/SpeechRecognitionResultList.cpp
 Modules/speech/DOMWindowSpeechSynthesis.cpp
 Modules/speech/SpeechSynthesis.cpp
 Modules/speech/SpeechSynthesisEvent.cpp
@@ -3500,6 +3506,13 @@
 JSSlotable.cpp
 JSSourceBuffer.cpp
 JSSourceBufferList.cpp
+JSSpeechRecognition.cpp
+JSSpeechRecognitionAlternative.cpp
+JSSpeechRecognitionErrorCode.cpp
+JSSpeechRecognitionErrorEvent.cpp
+JSSpeechRecognitionEvent.cpp
+JSSpeechRecognitionResult.cpp
+JSSpeechRecognitionResultList.cpp
 JSSpeechSynthesis.cpp
 JSSpeechSynthesisEvent.cpp
 JSSpeechSynthesisUtterance.cpp

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (268761 => 268762)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2020-10-20 21:40:40 UTC (rev 268761)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2020-10-20 21:54:36 UTC (rev 268762)
@@ -2730,6 +2730,13 @@
 		9343CB8212F25E510033C5EE /* TextCodecUTF8.h in Headers */ = {isa = PBXBuildFile; fileRef = 9343CB8012F25E510033C5EE /* TextCodecUTF8.h */; };
 		93442C9E0D2B335C00338FF9 /* HTMLTableRowsCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 93442C9D0D2B335C00338FF9 /* HTMLTableRowsCollection.h */; };
 		934907E4125BBBC8007F23A0 /* GraphicsContextCG.h in Headers */ = {isa = PBXBuildFile; fileRef = 934907E3125BBBC8007F23A0 /* GraphicsContextCG.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		934950CD253943610099F171 /* SpeechRecognition.h in Headers */ = {isa = PBXBuildFile; fileRef = 934950B1253943480099F171 /* SpeechRecognition.h */; };
+		934950CE253943650099F171 /* SpeechRecognitionAlternative.h in Headers */ = {isa = PBXBuildFile; fileRef = 934950BC2539434E0099F171 /* SpeechRecognitionAlternative.h */; };
+		934950D02539436C0099F171 /* SpeechRecognitionErrorCode.h in Headers */ = {isa = PBXBuildFile; fileRef = 934950AF253943470099F171 /* SpeechRecognitionErrorCode.h */; };
+		934950D1253943700099F171 /* SpeechRecognitionErrorEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 934950C3253943520099F171 /* SpeechRecognitionErrorEvent.h */; };
+		934950D2253943730099F171 /* SpeechRecognitionEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 934950C9253943550099F171 /* SpeechRecognitionEvent.h */; };
+		934950D42539437C0099F171 /* SpeechRecognitionResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 934950C1253943510099F171 /* SpeechRecognitionResult.h */; };
+		934950D6253943810099F171 /* SpeechRecognitionResultList.h in Headers */ = {isa = PBXBuildFile; fileRef = 934950C4253943520099F171 /* SpeechRecognitionResultList.h */; };
 		934CC10A0EDB223900A658F2 /* ScriptSourceCode.h in Headers */ = {isa = PBXBuildFile; fileRef = 934CC1090EDB223900A658F2 /* ScriptSourceCode.h */; };
 		934F713A0D5A6F1000018D69 /* AuthenticationChallengeBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 934F71390D5A6F1000018D69 /* AuthenticationChallengeBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		934F713C0D5A6F1900018D69 /* ResourceErrorBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 934F713B0D5A6F1900018D69 /* ResourceErrorBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -11247,6 +11254,26 @@
 		93442C9D0D2B335C00338FF9 /* HTMLTableRowsCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLTableRowsCollection.h; sourceTree = "<group>"; };
 		93442C9F0D2B336000338FF9 /* HTMLTableRowsCollection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLTableRowsCollection.cpp; sourceTree = "<group>"; };
 		934907E3125BBBC8007F23A0 /* GraphicsContextCG.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GraphicsContextCG.h; sourceTree = "<group>"; };
+		934950AD253943460099F171 /* SpeechRecognition.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = SpeechRecognition.idl; sourceTree = "<group>"; };
+		934950AF253943470099F171 /* SpeechRecognitionErrorCode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SpeechRecognitionErrorCode.h; sourceTree = "<group>"; };
+		934950B1253943480099F171 /* SpeechRecognition.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SpeechRecognition.h; sourceTree = "<group>"; };
+		934950B4253943490099F171 /* SpeechRecognitionEvent.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = SpeechRecognitionEvent.idl; sourceTree = "<group>"; };
+		934950B72539434B0099F171 /* SpeechRecognitionAlternative.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = SpeechRecognitionAlternative.cpp; sourceTree = "<group>"; };
+		934950B82539434C0099F171 /* SpeechRecognitionErrorCode.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = SpeechRecognitionErrorCode.idl; sourceTree = "<group>"; };
+		934950B92539434D0099F171 /* SpeechRecognitionResult.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = SpeechRecognitionResult.idl; sourceTree = "<group>"; };
+		934950BA2539434D0099F171 /* SpeechRecognitionErrorEvent.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = SpeechRecognitionErrorEvent.idl; sourceTree = "<group>"; };
+		934950BB2539434E0099F171 /* SpeechRecognitionAlternative.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = SpeechRecognitionAlternative.idl; sourceTree = "<group>"; };
+		934950BC2539434E0099F171 /* SpeechRecognitionAlternative.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SpeechRecognitionAlternative.h; sourceTree = "<group>"; };
+		934950BD2539434F0099F171 /* SpeechRecognitionResultList.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = SpeechRecognitionResultList.cpp; sourceTree = "<group>"; };
+		934950BF253943500099F171 /* SpeechRecognitionResult.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = SpeechRecognitionResult.cpp; sourceTree = "<group>"; };
+		934950C0253943500099F171 /* SpeechRecognitionEvent.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = SpeechRecognitionEvent.cpp; sourceTree = "<group>"; };
+		934950C1253943510099F171 /* SpeechRecognitionResult.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SpeechRecognitionResult.h; sourceTree = "<group>"; };
+		934950C3253943520099F171 /* SpeechRecognitionErrorEvent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SpeechRecognitionErrorEvent.h; sourceTree = "<group>"; };
+		934950C4253943520099F171 /* SpeechRecognitionResultList.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SpeechRecognitionResultList.h; sourceTree = "<group>"; };
+		934950C5253943530099F171 /* SpeechRecognitionResultList.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = SpeechRecognitionResultList.idl; sourceTree = "<group>"; };
+		934950C7253943540099F171 /* SpeechRecognition.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = SpeechRecognition.cpp; sourceTree = "<group>"; };
+		934950C8253943540099F171 /* SpeechRecognitionErrorEvent.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = SpeechRecognitionErrorEvent.cpp; sourceTree = "<group>"; };
+		934950C9253943550099F171 /* SpeechRecognitionEvent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SpeechRecognitionEvent.h; sourceTree = "<group>"; };
 		934CC1090EDB223900A658F2 /* ScriptSourceCode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptSourceCode.h; sourceTree = "<group>"; };
 		934F71370D5A6EFF00018D69 /* AuthenticationChallengeBase.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = AuthenticationChallengeBase.cpp; sourceTree = "<group>"; };
 		934F71390D5A6F1000018D69 /* AuthenticationChallengeBase.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AuthenticationChallengeBase.h; sourceTree = "<group>"; };
@@ -25386,6 +25413,26 @@
 				AA2A5ABA16A485D500975A25 /* DOMWindow+SpeechSynthesis.idl */,
 				AA2A5AB816A485D500975A25 /* DOMWindowSpeechSynthesis.cpp */,
 				AA2A5AB916A485D500975A25 /* DOMWindowSpeechSynthesis.h */,
+				934950C7253943540099F171 /* SpeechRecognition.cpp */,
+				934950B1253943480099F171 /* SpeechRecognition.h */,
+				934950AD253943460099F171 /* SpeechRecognition.idl */,
+				934950B72539434B0099F171 /* SpeechRecognitionAlternative.cpp */,
+				934950BC2539434E0099F171 /* SpeechRecognitionAlternative.h */,
+				934950BB2539434E0099F171 /* SpeechRecognitionAlternative.idl */,
+				934950AF253943470099F171 /* SpeechRecognitionErrorCode.h */,
+				934950B82539434C0099F171 /* SpeechRecognitionErrorCode.idl */,
+				934950C8253943540099F171 /* SpeechRecognitionErrorEvent.cpp */,
+				934950C3253943520099F171 /* SpeechRecognitionErrorEvent.h */,
+				934950BA2539434D0099F171 /* SpeechRecognitionErrorEvent.idl */,
+				934950C0253943500099F171 /* SpeechRecognitionEvent.cpp */,
+				934950C9253943550099F171 /* SpeechRecognitionEvent.h */,
+				934950B4253943490099F171 /* SpeechRecognitionEvent.idl */,
+				934950BF253943500099F171 /* SpeechRecognitionResult.cpp */,
+				934950C1253943510099F171 /* SpeechRecognitionResult.h */,
+				934950B92539434D0099F171 /* SpeechRecognitionResult.idl */,
+				934950BD2539434F0099F171 /* SpeechRecognitionResultList.cpp */,
+				934950C4253943520099F171 /* SpeechRecognitionResultList.h */,
+				934950C5253943530099F171 /* SpeechRecognitionResultList.idl */,
 				AA2A5ABD16A485D500975A25 /* SpeechSynthesis.cpp */,
 				AA2A5ABE16A485D500975A25 /* SpeechSynthesis.h */,
 				AA2A5ABF16A485D500975A25 /* SpeechSynthesis.idl */,
@@ -34117,6 +34164,13 @@
 				84A81F420FC7E02700955300 /* SourceGraphic.h in Headers */,
 				D01A27AE10C9BFD800026A42 /* SpaceSplitString.h in Headers */,
 				626CDE0F1140424C001E5A68 /* SpatialNavigation.h in Headers */,
+				934950CD253943610099F171 /* SpeechRecognition.h in Headers */,
+				934950CE253943650099F171 /* SpeechRecognitionAlternative.h in Headers */,
+				934950D02539436C0099F171 /* SpeechRecognitionErrorCode.h in Headers */,
+				934950D1253943700099F171 /* SpeechRecognitionErrorEvent.h in Headers */,
+				934950D2253943730099F171 /* SpeechRecognitionEvent.h in Headers */,
+				934950D42539437C0099F171 /* SpeechRecognitionResult.h in Headers */,
+				934950D6253943810099F171 /* SpeechRecognitionResultList.h in Headers */,
 				AA2A5AD416A4861100975A25 /* SpeechSynthesis.h in Headers */,
 				C14938072234551A000CD707 /* SpeechSynthesisClient.h in Headers */,
 				AA2A5AD216A4860A00975A25 /* SpeechSynthesisEvent.h in Headers */,

Modified: trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h (268761 => 268762)


--- trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h	2020-10-20 21:40:40 UTC (rev 268761)
+++ trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h	2020-10-20 21:54:36 UTC (rev 268762)
@@ -238,6 +238,12 @@
     macro(ServiceWorkerGlobalScope) \
     macro(ServiceWorkerRegistration) \
     macro(ShadowRoot) \
+    macro(SpeechRecognition) \
+    macro(SpeechRecognitionAlternative) \
+    macro(SpeechRecognitionErrorEvent) \
+    macro(SpeechRecognitionEvent) \
+    macro(SpeechRecognitionResult) \
+    macro(SpeechRecognitionResultList) \
     macro(StaticRange) \
     macro(StereoPannerNode) \
     macro(StylePropertyMapReadOnly) \

Modified: trunk/Source/WebCore/dom/EventNames.in (268761 => 268762)


--- trunk/Source/WebCore/dom/EventNames.in	2020-10-20 21:40:40 UTC (rev 268761)
+++ trunk/Source/WebCore/dom/EventNames.in	2020-10-20 21:54:36 UTC (rev 268762)
@@ -62,6 +62,8 @@
 RTCDTMFToneChangeEvent conditional=WEB_RTC
 RTCPeerConnectionIceEvent conditional=WEB_RTC
 RTCTrackEvent conditional=WEB_RTC
+SpeechRecognitionErrorEvent
+SpeechRecognitionEvent
 SpeechSynthesisEvent conditional=SPEECH_SYNTHESIS
 WebGLContextEvent conditional=WEBGL
 StorageEvent

Modified: trunk/Source/WebCore/dom/EventTargetFactory.in (268761 => 268762)


--- trunk/Source/WebCore/dom/EventTargetFactory.in	2020-10-20 21:40:40 UTC (rev 268761)
+++ trunk/Source/WebCore/dom/EventTargetFactory.in	2020-10-20 21:54:36 UTC (rev 268762)
@@ -44,6 +44,7 @@
 ServiceWorkerRegistration conditional=SERVICE_WORKER
 SourceBuffer conditional=MEDIA_SOURCE
 SourceBufferList conditional=MEDIA_SOURCE
+SpeechRecognition
 SpeechSynthesisUtterance conditional=SPEECH_SYNTHESIS
 TextTrack conditional=VIDEO
 TextTrackCue conditional=VIDEO

Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (268761 => 268762)


--- trunk/Source/WebKitLegacy/mac/ChangeLog	2020-10-20 21:40:40 UTC (rev 268761)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog	2020-10-20 21:54:36 UTC (rev 268762)
@@ -1,3 +1,17 @@
+2020-10-20  Sihui Liu  <[email protected]>
+
+        Add stubs for SpeechRecognition
+        https://bugs.webkit.org/show_bug.cgi?id=217780
+        <rdar://problem/70350727>
+
+        Reviewed by Youenn Fablet.
+
+        * WebView/WebPreferenceKeysPrivate.h:
+        * WebView/WebPreferences.mm:
+        (-[WebPreferences _speechRecognitionEnabled]):
+        (-[WebPreferences _setSpeechRecognitionEnabled:]):
+        * WebView/WebPreferencesPrivate.h:
+
 2020-10-20  Sam Weinig  <[email protected]>
 
         Tweak WebPreferences*.yaml "exposed" key to only indicate that the key should not be changeable by the frontend

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h (268761 => 268762)


--- trunk/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h	2020-10-20 21:40:40 UTC (rev 268761)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h	2020-10-20 21:54:36 UTC (rev 268762)
@@ -289,6 +289,7 @@
 #define WebKitMediaRecorderEnabledPreferenceKey @"WebKitMediaRecorderEnabled"
 #define WebKitCSSIndividualTransformPropertiesEnabledPreferenceKey @"WebKitCSSIndividualTransformPropertiesEnabled"
 #define WebKitContactPickerAPIEnabledPreferenceKey @"WebKitContactPickerAPIEnabled"
+#define WebKitSpeechRecognitionEnabledPreferenceKey @"WebKitSpeechRecognitionEnabled"
 
 // The preference keys below this point are deprecated and have no effect. They should
 // be removed when it is considered safe to do so.

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm (268761 => 268762)


--- trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm	2020-10-20 21:40:40 UTC (rev 268761)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm	2020-10-20 21:54:36 UTC (rev 268762)
@@ -3375,6 +3375,16 @@
     [self _setBoolValue:flag forKey:WebKitCSSIndividualTransformPropertiesEnabledPreferenceKey];
 }
 
+- (BOOL)_speechRecognitionEnabled
+{
+    return [self _boolValueForKey:WebKitSpeechRecognitionEnabledPreferenceKey];
+}
+
+- (void)_setSpeechRecognitionEnabled:(BOOL)flag
+{
+    [self _setBoolValue:flag forKey:WebKitSpeechRecognitionEnabledPreferenceKey];
+}
+
 @end
 
 @implementation WebPreferences (WebPrivateObsolete)

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h (268761 => 268762)


--- trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h	2020-10-20 21:40:40 UTC (rev 268761)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h	2020-10-20 21:54:36 UTC (rev 268762)
@@ -348,6 +348,7 @@
 @property (nonatomic, setter=_setMediaRecorderEnabled:) BOOL _mediaRecorderEnabled;
 @property (nonatomic) BOOL CSSIndividualTransformPropertiesEnabled;
 @property (nonatomic) BOOL contactPickerAPIEnabled;
+@property (nonatomic, setter=_setSpeechRecognitionEnabled:) BOOL _speechRecognitionEnabled;
 @end
 
 @interface WebPreferences (WebPrivateDeprecated)

Modified: trunk/Tools/ChangeLog (268761 => 268762)


--- trunk/Tools/ChangeLog	2020-10-20 21:40:40 UTC (rev 268761)
+++ trunk/Tools/ChangeLog	2020-10-20 21:54:36 UTC (rev 268762)
@@ -1,3 +1,14 @@
+2020-10-20  Sihui Liu  <[email protected]>
+
+        Add stubs for SpeechRecognition
+        https://bugs.webkit.org/show_bug.cgi?id=217780
+        <rdar://problem/70350727>
+
+        Reviewed by Youenn Fablet.
+
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (enableExperimentalFeatures):
+
 2020-10-20  Jonathan Bedard  <[email protected]>
 
         [webkitpy] Use allowlist and blocklist

Modified: trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm (268761 => 268762)


--- trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm	2020-10-20 21:40:40 UTC (rev 268761)
+++ trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm	2020-10-20 21:54:36 UTC (rev 268762)
@@ -842,6 +842,7 @@
     [preferences setAspectRatioOfImgFromWidthAndHeightEnabled:YES];
     [preferences setCSSOMViewSmoothScrollingEnabled:YES];
     [preferences setAudioWorkletEnabled:YES];
+    [preferences _setSpeechRecognitionEnabled:YES];
 
     for (WebFeature* feature in [WebPreferences _experimentalFeatures]) {
         if ([feature.key isEqual:@"MediaSessionEnabled"])
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to