Changeset 291124 in webkit
- Timestamp:
- Mar 10, 2022 12:15:28 PM (4 months ago)
- Location:
- trunk
- Files:
-
- 1 added
- 39 edited
- 8 copied
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/speechsynthesis/speech-synthesis-boundary-events-expected.txt (modified) (1 diff)
-
LayoutTests/fast/speechsynthesis/speech-synthesis-boundary-events.html (modified) (1 diff)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesisErrorEvent-constructor-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesisEvent-constructor-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/speech-api/idlharness.window-expected.txt (modified) (2 diffs)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/DerivedSources-input.xcfilelist (modified) (1 diff)
-
Source/WebCore/DerivedSources-output.xcfilelist (modified) (1 diff)
-
Source/WebCore/DerivedSources.make (modified) (1 diff)
-
Source/WebCore/Modules/credentialmanagement/BasicCredential.h (modified) (1 diff)
-
Source/WebCore/Modules/speech/DOMWindow+SpeechSynthesis.idl (modified) (1 diff)
-
Source/WebCore/Modules/speech/DOMWindowSpeechSynthesis.cpp (modified) (1 diff)
-
Source/WebCore/Modules/speech/SpeechSynthesis.cpp (modified) (11 diffs)
-
Source/WebCore/Modules/speech/SpeechSynthesis.h (modified) (7 diffs)
-
Source/WebCore/Modules/speech/SpeechSynthesis.idl (modified) (1 diff)
-
Source/WebCore/Modules/speech/SpeechSynthesisErrorCode.h (added)
-
Source/WebCore/Modules/speech/SpeechSynthesisErrorCode.idl (copied) (copied from trunk/Source/WebCore/Modules/speech/DOMWindow+SpeechSynthesis.idl) (2 diffs)
-
Source/WebCore/Modules/speech/SpeechSynthesisErrorEvent.cpp (copied) (copied from trunk/Source/WebCore/Modules/speech/SpeechSynthesisEvent.cpp) (3 diffs)
-
Source/WebCore/Modules/speech/SpeechSynthesisErrorEvent.h (copied) (copied from trunk/Source/WebCore/Modules/speech/SpeechSynthesisEvent.h) (2 diffs)
-
Source/WebCore/Modules/speech/SpeechSynthesisErrorEvent.idl (copied) (copied from trunk/Source/WebCore/Modules/speech/SpeechSynthesisEvent.idl) (2 diffs)
-
Source/WebCore/Modules/speech/SpeechSynthesisErrorEventInit.h (copied) (copied from trunk/Source/WebCore/Modules/speech/DOMWindow+SpeechSynthesis.idl) (2 diffs)
-
Source/WebCore/Modules/speech/SpeechSynthesisErrorEventInit.idl (copied) (copied from trunk/Source/WebCore/Modules/speech/DOMWindow+SpeechSynthesis.idl) (2 diffs)
-
Source/WebCore/Modules/speech/SpeechSynthesisEvent.cpp (modified) (1 diff)
-
Source/WebCore/Modules/speech/SpeechSynthesisEvent.h (modified) (2 diffs)
-
Source/WebCore/Modules/speech/SpeechSynthesisEvent.idl (modified) (2 diffs)
-
Source/WebCore/Modules/speech/SpeechSynthesisEventInit.h (copied) (copied from trunk/Source/WebCore/Modules/speech/SpeechSynthesisEvent.h) (1 diff)
-
Source/WebCore/Modules/speech/SpeechSynthesisEventInit.idl (copied) (copied from trunk/Source/WebCore/Modules/speech/DOMWindow+SpeechSynthesis.idl) (2 diffs)
-
Source/WebCore/Modules/speech/SpeechSynthesisUtterance.cpp (modified) (1 diff)
-
Source/WebCore/Modules/speech/SpeechSynthesisUtterance.h (modified) (3 diffs)
-
Source/WebCore/Modules/speech/SpeechSynthesisVoice.idl (modified) (1 diff)
-
Source/WebCore/Sources.txt (modified) (1 diff)
-
Source/WebCore/SourcesCocoa.txt (modified) (1 diff)
-
Source/WebCore/WebCore.xcodeproj/project.pbxproj (modified) (2 diffs)
-
Source/WebCore/dom/EventNames.h (modified) (1 diff)
-
Source/WebCore/dom/EventNames.in (modified) (1 diff)
-
Source/WebCore/dom/EventTargetFactory.in (modified) (1 diff)
-
Source/WebCore/page/SpeechSynthesisClient.h (modified) (1 diff)
-
Source/WebCore/platform/PlatformSpeechSynthesizer.h (modified) (1 diff)
-
Source/WebCore/platform/cocoa/PlatformSpeechSynthesizerCocoa.mm (modified) (2 diffs)
-
Source/WebCore/platform/mock/PlatformSpeechSynthesizerMock.cpp (modified) (1 diff)
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm (modified) (1 diff)
-
Source/WebKit/UIProcess/WebPageProxy.h (modified) (1 diff)
-
Source/WebKit/WebProcess/WebPage/WebPage.cpp (modified) (1 diff)
-
Source/WebKit/WebProcess/WebPage/WebPage.h (modified) (1 diff)
-
Source/WebKit/WebProcess/WebPage/WebPage.messages.in (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r291119 r291124 1 2022-03-10 Chris Fleizach <cfleizach@apple.com> 2 3 AX: Support updated WebSpeech API 4 https://bugs.webkit.org/show_bug.cgi?id=237614 5 <rdar://problem/89981851> 6 7 Reviewed by Andres Gonzalez. 8 9 Fixed expectations: 10 * imported/w3c/web-platform-tests/speech-api/SpeechSynthesisEvent-constructor-expected.txt: Updated. 11 * imported/w3c/web-platform-tests/speech-api/SpeechSynthesisErrorEvent-constructor-expected.txt: Updated. 12 * fast/speechsynthesis/speech-synthesis-boundary-events.html: Updated. 13 * fast/speechsynthesis/speech-synthesis-boundary-events-expected.txt: Updated. 14 1 15 2022-03-10 Antoine Quint <graouts@webkit.org> 2 16 -
trunk/LayoutTests/fast/speechsynthesis/speech-synthesis-boundary-events-expected.txt
r173000 r291124 5 5 6 6 Speech started 7 Boundary event: word, Character index: 0 8 Boundary event: sentence, Character index: 147 Boundary event: word, Character index: 0, length: 3 8 Boundary event: sentence, Character index: 0, length: 14 9 9 PASS successfullyParsed is true 10 10 -
trunk/LayoutTests/fast/speechsynthesis/speech-synthesis-boundary-events.html
r173000 r291124 26 26 27 27 u.onboundary = function(event) { 28 debug( "Boundary event: " + event.name + ", Character index: " + event.charIndex);28 debug(`Boundary event: ${event.name}, Character index: ${event.charIndex}, length: ${event.charLength}`); 29 29 } 30 30 -
trunk/LayoutTests/imported/w3c/ChangeLog
r291122 r291124 1 2022-03-10 Chris Fleizach <cfleizach@apple.com> 2 3 AX: Support updated WebSpeech API 4 https://bugs.webkit.org/show_bug.cgi?id=237614 5 <rdar://problem/89981851> 6 7 Reviewed by Andres Gonzalez. 8 9 * web-platform-tests/speech-api/SpeechSynthesisErrorEvent-constructor-expected.txt: 10 * web-platform-tests/speech-api/SpeechSynthesisEvent-constructor-expected.txt: 11 * web-platform-tests/speech-api/idlharness.window-expected.txt: 12 1 13 2022-03-10 Antoine Quint <graouts@webkit.org> 2 14 -
trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesisErrorEvent-constructor-expected.txt
r279400 r291124 1 1 2 FAIL SpeechSynthesisErrorEvent with no arguments throws TypeError assert_throws_js: function "() => { 3 new SpeechSynthesisErrorEvent(); 4 }" threw object "ReferenceError: Can't find variable: SpeechSynthesisErrorEvent" ("ReferenceError") expected instance of function "function TypeError() { 5 [native code] 6 }" ("TypeError") 7 FAIL SpeechSynthesisErrorEvent with no eventInitDict throws TypeError assert_throws_js: function "() => { 8 new SpeechSynthesisErrorEvent("type"); 9 }" threw object "ReferenceError: Can't find variable: SpeechSynthesisErrorEvent" ("ReferenceError") expected instance of function "function TypeError() { 10 [native code] 11 }" ("TypeError") 12 FAIL SpeechSynthesisErrorEvent with empty eventInitDict throws TypeError (requires 13 utterance and error) assert_throws_js: function "() => { 14 new SpeechSynthesisErrorEvent("type", {}); 15 }" threw object "ReferenceError: Can't find variable: SpeechSynthesisErrorEvent" ("ReferenceError") expected instance of function "function TypeError() { 16 [native code] 17 }" ("TypeError") 18 FAIL SpeechSynthesisErrorEvent with eventInitDict without utterance throws 19 TypeError assert_throws_js: function "() => { 20 new SpeechSynthesisErrorEvent("type", {error:"not-allowed"}); 21 }" threw object "ReferenceError: Can't find variable: SpeechSynthesisErrorEvent" ("ReferenceError") expected instance of function "function TypeError() { 22 [native code] 23 }" ("TypeError") 24 FAIL SpeechSynthesisErrorEvent with eventInitDict without error throws 25 TypeError assert_throws_js: function "() => { 26 new SpeechSynthesisErrorEvent("type", {utterance: new SpeechSynthesisUtterance()}); 27 }" threw object "ReferenceError: Can't find variable: SpeechSynthesisErrorEvent" ("ReferenceError") expected instance of function "function TypeError() { 28 [native code] 29 }" ("TypeError") 30 FAIL SpeechSynthesisErrorEvent with eventInitDict having utterance and error Can't find variable: SpeechSynthesisErrorEvent 31 FAIL SpeechSynthesisErrorEvent with custom eventInitDict Can't find variable: SpeechSynthesisErrorEvent 32 FAIL SpeechSynthesisErrorEvent with wrong error enum assert_throws_js: function "() => { 33 new SpeechSynthesisErrorEvent("type", { 34 utterance: new SpeechSynthesisUtterance(), 35 error: error 36 }); 37 }" threw object "ReferenceError: Can't find variable: SpeechSynthesisErrorEvent" ("ReferenceError") expected instance of function "function TypeError() { 38 [native code] 39 }" ("TypeError") 2 PASS SpeechSynthesisErrorEvent with no arguments throws TypeError 3 PASS SpeechSynthesisErrorEvent with no eventInitDict throws TypeError 4 PASS SpeechSynthesisErrorEvent with empty eventInitDict throws TypeError (requires 5 utterance and error) 6 PASS SpeechSynthesisErrorEvent with eventInitDict without utterance throws 7 TypeError 8 PASS SpeechSynthesisErrorEvent with eventInitDict without error throws 9 TypeError 10 PASS SpeechSynthesisErrorEvent with eventInitDict having utterance and error 11 PASS SpeechSynthesisErrorEvent with custom eventInitDict 12 PASS SpeechSynthesisErrorEvent with wrong error enum 40 13 -
trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesisEvent-constructor-expected.txt
r279400 r291124 6 6 PASS SpeechSynthesisEvent with eventInitDict not having utterance throws 7 7 TypeError 8 FAIL SpeechSynthesisEvent with eventInitDict having an utterance Illegal constructor 9 FAIL SpeechSynthesisEvent with custom eventInitDict Illegal constructor 8 PASS SpeechSynthesisEvent with eventInitDict having an utterance 9 PASS SpeechSynthesisEvent with custom eventInitDict 10 10 -
trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/idlharness.window-expected.txt
r270868 r291124 130 130 FAIL SpeechGrammarList interface: new SpeechGrammarList() must inherit property "addFromString(DOMString, optional float)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: SpeechGrammarList" 131 131 FAIL SpeechGrammarList interface: calling addFromString(DOMString, optional float) on new SpeechGrammarList() with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: SpeechGrammarList" 132 FAIL SpeechSynthesis interface: existence and properties of interface object assert_own_property: self does not have own property "SpeechSynthesis" expected property "SpeechSynthesis" missing 133 FAIL SpeechSynthesis interface object length assert_own_property: self does not have own property "SpeechSynthesis" expected property "SpeechSynthesis" missing 134 FAIL SpeechSynthesis interface object name assert_own_property: self does not have own property "SpeechSynthesis" expected property "SpeechSynthesis" missing 135 FAIL SpeechSynthesis interface: existence and properties of interface prototype object assert_own_property: self does not have own property "SpeechSynthesis" expected property "SpeechSynthesis" missing 136 FAIL SpeechSynthesis interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "SpeechSynthesis" expected property "SpeechSynthesis" missing 137 FAIL SpeechSynthesis interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "SpeechSynthesis" expected property "SpeechSynthesis" missing 138 FAIL SpeechSynthesis interface: attribute pending assert_own_property: self does not have own property "SpeechSynthesis" expected property "SpeechSynthesis" missing139 FAIL SpeechSynthesis interface: attribute speaking assert_own_property: self does not have own property "SpeechSynthesis" expected property "SpeechSynthesis" missing140 FAIL SpeechSynthesis interface: attribute paused assert_own_property: self does not have own property "SpeechSynthesis" expected property "SpeechSynthesis" missing 141 FAIL SpeechSynthesis interface: attribute onvoiceschanged assert_own_property: self does not have own property "SpeechSynthesis" expected property "SpeechSynthesis" missing 142 FAIL SpeechSynthesis interface: operation speak(SpeechSynthesisUtterance) assert_own_property: self does not have own property "SpeechSynthesis" expected property "SpeechSynthesis" missing 143 FAIL SpeechSynthesis interface: operation cancel() assert_own_property: self does not have own property "SpeechSynthesis" expected property "SpeechSynthesis" missing 144 FAIL SpeechSynthesis interface: operation pause() assert_own_property: self does not have own property "SpeechSynthesis" expected property "SpeechSynthesis" missing 145 FAIL SpeechSynthesis interface: operation resume() assert_own_property: self does not have own property "SpeechSynthesis" expected property "SpeechSynthesis" missing 146 FAIL SpeechSynthesis interface: operation getVoices() assert_own_property: self does not have own property "SpeechSynthesis" expected property "SpeechSynthesis" missing 147 FAIL SpeechSynthesis must be primary interface of speechSynthesis assert_own_property: self does not have own property "SpeechSynthesis" expected property "SpeechSynthesis" missing 132 PASS SpeechSynthesis interface: existence and properties of interface object 133 PASS SpeechSynthesis interface object length 134 PASS SpeechSynthesis interface object name 135 PASS SpeechSynthesis interface: existence and properties of interface prototype object 136 PASS SpeechSynthesis interface: existence and properties of interface prototype object's "constructor" property 137 PASS SpeechSynthesis interface: existence and properties of interface prototype object's @@unscopables property 138 PASS SpeechSynthesis interface: attribute pending 139 PASS SpeechSynthesis interface: attribute speaking 140 PASS SpeechSynthesis interface: attribute paused 141 PASS SpeechSynthesis interface: attribute onvoiceschanged 142 PASS SpeechSynthesis interface: operation speak(SpeechSynthesisUtterance) 143 PASS SpeechSynthesis interface: operation cancel() 144 PASS SpeechSynthesis interface: operation pause() 145 PASS SpeechSynthesis interface: operation resume() 146 PASS SpeechSynthesis interface: operation getVoices() 147 PASS SpeechSynthesis must be primary interface of speechSynthesis 148 148 PASS Stringification of speechSynthesis 149 149 PASS SpeechSynthesis interface: speechSynthesis must inherit property "pending" with the proper type 150 150 PASS SpeechSynthesis interface: speechSynthesis must inherit property "speaking" with the proper type 151 151 PASS SpeechSynthesis interface: speechSynthesis must inherit property "paused" with the proper type 152 FAIL SpeechSynthesis interface: speechSynthesis must inherit property "onvoiceschanged" with the proper type assert_inherits: property "onvoiceschanged" not found in prototype chain 152 PASS SpeechSynthesis interface: speechSynthesis must inherit property "onvoiceschanged" with the proper type 153 153 PASS SpeechSynthesis interface: speechSynthesis must inherit property "speak(SpeechSynthesisUtterance)" with the proper type 154 154 PASS SpeechSynthesis interface: calling speak(SpeechSynthesisUtterance) on speechSynthesis with too few arguments must throw TypeError … … 192 192 PASS SpeechSynthesisUtterance interface: new SpeechSynthesisUtterance() must inherit property "onboundary" with the proper type 193 193 PASS SpeechSynthesisEvent interface: existence and properties of interface object 194 FAIL SpeechSynthesisEvent interface object length assert_equals: wrong value for SpeechSynthesisEvent.length expected 2 but got 0 194 PASS SpeechSynthesisEvent interface object length 195 195 PASS SpeechSynthesisEvent interface object name 196 196 PASS SpeechSynthesisEvent interface: existence and properties of interface prototype object 197 197 PASS SpeechSynthesisEvent interface: existence and properties of interface prototype object's "constructor" property 198 198 PASS SpeechSynthesisEvent interface: existence and properties of interface prototype object's @@unscopables property 199 FAIL SpeechSynthesisEvent interface: attribute utterance assert_true: The prototype object must have a property "utterance" expected true got false199 PASS SpeechSynthesisEvent interface: attribute utterance 200 200 PASS SpeechSynthesisEvent interface: attribute charIndex 201 FAIL SpeechSynthesisEvent interface: attribute charLength assert_true: The prototype object must have a property "charLength" expected true got false 201 PASS SpeechSynthesisEvent interface: attribute charLength 202 202 PASS SpeechSynthesisEvent interface: attribute elapsedTime 203 203 PASS SpeechSynthesisEvent interface: attribute name 204 FAIL SpeechSynthesisErrorEvent interface: existence and properties of interface object assert_own_property: self does not have own property "SpeechSynthesisErrorEvent" expected property "SpeechSynthesisErrorEvent" missing 205 FAIL SpeechSynthesisErrorEvent interface object length assert_own_property: self does not have own property "SpeechSynthesisErrorEvent" expected property "SpeechSynthesisErrorEvent" missing 206 FAIL SpeechSynthesisErrorEvent interface object name assert_own_property: self does not have own property "SpeechSynthesisErrorEvent" expected property "SpeechSynthesisErrorEvent" missing 207 FAIL SpeechSynthesisErrorEvent interface: existence and properties of interface prototype object assert_own_property: self does not have own property "SpeechSynthesisErrorEvent" expected property "SpeechSynthesisErrorEvent" missing 208 FAIL SpeechSynthesisErrorEvent interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "SpeechSynthesisErrorEvent" expected property "SpeechSynthesisErrorEvent" missing 209 FAIL SpeechSynthesisErrorEvent interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "SpeechSynthesisErrorEvent" expected property "SpeechSynthesisErrorEvent" missing 210 FAIL SpeechSynthesisErrorEvent interface: attribute error assert_own_property: self does not have own property "SpeechSynthesisErrorEvent" expected property "SpeechSynthesisErrorEvent" missing 211 FAIL SpeechSynthesisVoice interface: existence and properties of interface object assert_own_property: self does not have own property "SpeechSynthesisVoice" expected property "SpeechSynthesisVoice" missing 212 FAIL SpeechSynthesisVoice interface object length assert_own_property: self does not have own property "SpeechSynthesisVoice" expected property "SpeechSynthesisVoice" missing 213 FAIL SpeechSynthesisVoice interface object name assert_own_property: self does not have own property "SpeechSynthesisVoice" expected property "SpeechSynthesisVoice" missing 214 FAIL SpeechSynthesisVoice interface: existence and properties of interface prototype object assert_own_property: self does not have own property "SpeechSynthesisVoice" expected property "SpeechSynthesisVoice" missing 215 FAIL SpeechSynthesisVoice interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "SpeechSynthesisVoice" expected property "SpeechSynthesisVoice" missing 216 FAIL SpeechSynthesisVoice interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "SpeechSynthesisVoice" expected property "SpeechSynthesisVoice" missing 217 FAIL SpeechSynthesisVoice interface: attribute voiceURI assert_own_property: self does not have own property "SpeechSynthesisVoice" expected property "SpeechSynthesisVoice" missing 218 FAIL SpeechSynthesisVoice interface: attribute name assert_own_property: self does not have own property "SpeechSynthesisVoice" expected property "SpeechSynthesisVoice" missing 219 FAIL SpeechSynthesisVoice interface: attribute lang assert_own_property: self does not have own property "SpeechSynthesisVoice" expected property "SpeechSynthesisVoice" missing220 FAIL SpeechSynthesisVoice interface: attribute localService assert_own_property: self does not have own property "SpeechSynthesisVoice" expected property "SpeechSynthesisVoice" missing 221 FAIL SpeechSynthesisVoice interface: attribute default assert_own_property: self does not have own property "SpeechSynthesisVoice" expected property "SpeechSynthesisVoice" missing 222 FAIL SpeechSynthesisVoice must be primary interface of voice assert_own_property: self does not have own property "SpeechSynthesisVoice" expected property "SpeechSynthesisVoice" missing 204 PASS SpeechSynthesisErrorEvent interface: existence and properties of interface object 205 PASS SpeechSynthesisErrorEvent interface object length 206 PASS SpeechSynthesisErrorEvent interface object name 207 PASS SpeechSynthesisErrorEvent interface: existence and properties of interface prototype object 208 PASS SpeechSynthesisErrorEvent interface: existence and properties of interface prototype object's "constructor" property 209 PASS SpeechSynthesisErrorEvent interface: existence and properties of interface prototype object's @@unscopables property 210 PASS SpeechSynthesisErrorEvent interface: attribute error 211 PASS SpeechSynthesisVoice interface: existence and properties of interface object 212 PASS SpeechSynthesisVoice interface object length 213 PASS SpeechSynthesisVoice interface object name 214 PASS SpeechSynthesisVoice interface: existence and properties of interface prototype object 215 PASS SpeechSynthesisVoice interface: existence and properties of interface prototype object's "constructor" property 216 PASS SpeechSynthesisVoice interface: existence and properties of interface prototype object's @@unscopables property 217 PASS SpeechSynthesisVoice interface: attribute voiceURI 218 PASS SpeechSynthesisVoice interface: attribute name 219 PASS SpeechSynthesisVoice interface: attribute lang 220 PASS SpeechSynthesisVoice interface: attribute localService 221 PASS SpeechSynthesisVoice interface: attribute default 222 PASS SpeechSynthesisVoice must be primary interface of voice 223 223 PASS Stringification of voice 224 224 PASS SpeechSynthesisVoice interface: voice must inherit property "voiceURI" with the proper type -
trunk/Source/WebCore/ChangeLog
r291123 r291124 1 2022-03-10 Chris Fleizach <cfleizach@apple.com> 2 3 AX: Support updated WebSpeech API 4 https://bugs.webkit.org/show_bug.cgi?id=237614 5 <rdar://problem/89981851> 6 7 Reviewed by Andres Gonzalez. 8 9 Adopt WebSpeech (18 August 2020) changes from 10 https://wicg.github.io/speech-api/ 11 12 Tests Fixed: 13 imported/w3c/web-platform-tests/speech-api/ 14 15 * DerivedSources-input.xcfilelist: 16 * DerivedSources-output.xcfilelist: 17 * DerivedSources.make: 18 * Modules/speech/DOMWindow+SpeechSynthesis.idl: 19 * Modules/speech/DOMWindowSpeechSynthesis.cpp: 20 (WebCore::DOMWindowSpeechSynthesis::speechSynthesis): 21 * Modules/speech/SpeechSynthesis.cpp: 22 (WebCore::Ref<SpeechSynthesis>SpeechSynthesis::create): 23 (WebCore::SpeechSynthesis::SpeechSynthesis): 24 (WebCore::SpeechSynthesis::voicesDidChange): 25 (WebCore::SpeechSynthesis::fireEvent const): 26 (WebCore::SpeechSynthesis::fireErrorEvent const): 27 (WebCore::SpeechSynthesis::handleSpeakingCompleted): 28 (WebCore::SpeechSynthesis::boundaryEventOccurred): 29 (WebCore::SpeechSynthesis::didStartSpeaking): 30 (WebCore::SpeechSynthesis::didPauseSpeaking): 31 (WebCore::SpeechSynthesis::didResumeSpeaking): 32 (WebCore::SpeechSynthesis::create): Deleted. 33 (WebCore::SpeechSynthesis::fireEvent): Deleted. 34 * Modules/speech/SpeechSynthesis.h: 35 * Modules/speech/SpeechSynthesis.idl: 36 * Modules/speech/SpeechSynthesisErrorCode.h: Added. 37 * Modules/speech/SpeechSynthesisErrorCode.idl: Copied from Source/WebCore/Modules/speech/DOMWindow+SpeechSynthesis.idl. 38 * Modules/speech/SpeechSynthesisErrorEvent.cpp: Copied from Source/WebCore/Modules/speech/SpeechSynthesisEvent.cpp. 39 (WebCore::SpeechSynthesisErrorEvent::create): 40 (WebCore::SpeechSynthesisErrorEvent::SpeechSynthesisErrorEvent): 41 * Modules/speech/SpeechSynthesisErrorEvent.h: Copied from Source/WebCore/Modules/speech/SpeechSynthesisEvent.h. 42 * Modules/speech/SpeechSynthesisErrorEvent.idl: Copied from Source/WebCore/Modules/speech/SpeechSynthesisEvent.idl. 43 * Modules/speech/SpeechSynthesisErrorEventInit.h: Copied from Source/WebCore/Modules/speech/DOMWindow+SpeechSynthesis.idl. 44 * Modules/speech/SpeechSynthesisErrorEventInit.idl: Copied from Source/WebCore/Modules/speech/DOMWindow+SpeechSynthesis.idl. 45 * Modules/speech/SpeechSynthesisEvent.cpp: 46 (WebCore::SpeechSynthesisEvent::create): 47 (WebCore::SpeechSynthesisEvent::SpeechSynthesisEvent): 48 * Modules/speech/SpeechSynthesisEvent.h: 49 (WebCore::SpeechSynthesisEvent::utterance const): 50 (WebCore::SpeechSynthesisEvent::charLength const): 51 (): Deleted. 52 * Modules/speech/SpeechSynthesisEvent.idl: 53 * Modules/speech/SpeechSynthesisEventInit.h: Copied from Source/WebCore/Modules/speech/SpeechSynthesisEvent.h. 54 (WebCore::SpeechSynthesisEventInit::SpeechSynthesisEventInit): 55 * Modules/speech/SpeechSynthesisEventInit.idl: Copied from Source/WebCore/Modules/speech/DOMWindow+SpeechSynthesis.idl. 56 * Modules/speech/SpeechSynthesisUtterance.cpp: 57 (WebCore::SpeechSynthesisUtterance::SpeechSynthesisUtterance): 58 * Modules/speech/SpeechSynthesisUtterance.h: 59 * Modules/speech/SpeechSynthesisVoice.idl: 60 * Sources.txt: 61 * WebCore.xcodeproj/project.pbxproj: 62 * dom/EventNames.h: 63 * dom/EventNames.in: 64 * dom/EventTargetFactory.in: 65 * page/SpeechSynthesisClient.h: 66 * platform/PlatformSpeechSynthesizer.h: 67 * platform/cocoa/PlatformSpeechSynthesizerCocoa.mm: 68 (-[WebSpeechSynthesisWrapper speechSynthesizer:willSpeakRangeOfSpeechString:utterance:]): 69 (WebCore::PlatformSpeechSynthesizer::initializeVoiceList): 70 * platform/mock/PlatformSpeechSynthesizerMock.cpp: 71 (WebCore::PlatformSpeechSynthesizerMock::speak): 72 1 73 2022-03-10 Chris Dumez <cdumez@apple.com> 2 74 -
trunk/Source/WebCore/DerivedSources-input.xcfilelist
r289978 r291124 609 609 $(PROJECT_DIR)/Modules/speech/SpeechRecognitionResultList.idl 610 610 $(PROJECT_DIR)/Modules/speech/SpeechSynthesis.idl 611 $(PROJECT_DIR)/Modules/speech/SpeechSynthesisErrorCode.idl 612 $(PROJECT_DIR)/Modules/speech/SpeechSynthesisErrorEvent.idl 613 $(PROJECT_DIR)/Modules/speech/SpeechSynthesisErrorEventInit.idl 611 614 $(PROJECT_DIR)/Modules/speech/SpeechSynthesisEvent.idl 615 $(PROJECT_DIR)/Modules/speech/SpeechSynthesisEventInit.idl 612 616 $(PROJECT_DIR)/Modules/speech/SpeechSynthesisUtterance.idl 613 617 $(PROJECT_DIR)/Modules/speech/SpeechSynthesisVoice.idl -
trunk/Source/WebCore/DerivedSources-output.xcfilelist
r290129 r291124 2517 2517 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechSynthesis.cpp 2518 2518 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechSynthesis.h 2519 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechSynthesisErrorCode.cpp 2520 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechSynthesisErrorCode.h 2521 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechSynthesisErrorEvent.cpp 2522 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechSynthesisErrorEvent.h 2523 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechSynthesisErrorEventInit.cpp 2524 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechSynthesisErrorEventInit.h 2519 2525 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechSynthesisEvent.cpp 2520 2526 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechSynthesisEvent.h 2527 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechSynthesisEventInit.cpp 2528 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechSynthesisEventInit.h 2521 2529 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechSynthesisUtterance.cpp 2522 2530 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechSynthesisUtterance.h -
trunk/Source/WebCore/DerivedSources.make
r290129 r291124 522 522 $(WebCore)/Modules/speech/DOMWindow+SpeechSynthesis.idl \ 523 523 $(WebCore)/Modules/speech/SpeechSynthesis.idl \ 524 $(WebCore)/Modules/speech/SpeechSynthesisErrorCode.idl \ 525 $(WebCore)/Modules/speech/SpeechSynthesisErrorEvent.idl \ 526 $(WebCore)/Modules/speech/SpeechSynthesisErrorEventInit.idl \ 524 527 $(WebCore)/Modules/speech/SpeechSynthesisEvent.idl \ 528 $(WebCore)/Modules/speech/SpeechSynthesisEventInit.idl \ 525 529 $(WebCore)/Modules/speech/SpeechSynthesisUtterance.idl \ 526 530 $(WebCore)/Modules/speech/SpeechSynthesisVoice.idl \ -
trunk/Source/WebCore/Modules/credentialmanagement/BasicCredential.h
r290184 r291124 28 28 #if ENABLE(WEB_AUTHN) 29 29 30 #include "Document.h" 31 #include "IDLTypes.h" 32 #include "JSDOMPromiseDeferred.h" 30 33 #include <wtf/RefCounted.h> 31 34 #include <wtf/TypeCasts.h> -
trunk/Source/WebCore/Modules/speech/DOMWindow+SpeechSynthesis.idl
r267449 r291124 28 28 ImplementedBy=DOMWindowSpeechSynthesis 29 29 ] partial interface DOMWindow { 30 readonly attribute SpeechSynthesis speechSynthesis;30 [SameObject] readonly attribute SpeechSynthesis speechSynthesis; 31 31 }; -
trunk/Source/WebCore/Modules/speech/DOMWindowSpeechSynthesis.cpp
r284057 r291124 72 72 { 73 73 if (!m_speechSynthesis && frame() && frame()->document()) 74 m_speechSynthesis = SpeechSynthesis::create( frame()->page()->speechSynthesisClient(),*frame()->document());74 m_speechSynthesis = SpeechSynthesis::create(*frame()->document()); 75 75 return m_speechSynthesis.get(); 76 76 } -
trunk/Source/WebCore/Modules/speech/SpeechSynthesis.cpp
r290329 r291124 29 29 #if ENABLE(SPEECH_SYNTHESIS) 30 30 31 #include "Document.h" 31 32 #include "EventNames.h" 33 #include "Frame.h" 34 #include "Page.h" 32 35 #include "PlatformSpeechSynthesisVoice.h" 33 36 #include "PlatformSpeechSynthesizer.h" 37 #include "SpeechSynthesisErrorEvent.h" 34 38 #include "SpeechSynthesisEvent.h" 35 39 #include "SpeechSynthesisUtterance.h" 36 40 #include "UserGestureIndicator.h" 41 #include <wtf/IsoMallocInlines.h> 37 42 #include <wtf/NeverDestroyed.h> 38 43 44 namespace WebCore { 45 46 WTF_MAKE_ISO_ALLOCATED_IMPL(SpeechSynthesis); 47 48 Ref<SpeechSynthesis>SpeechSynthesis::create(ScriptExecutionContext& context) 49 { 50 return adoptRef(*new SpeechSynthesis(context)); 51 } 52 53 SpeechSynthesis::SpeechSynthesis(ScriptExecutionContext& context) 54 : ContextDestructionObserver(&context) 55 , m_currentSpeechUtterance(nullptr) 56 , m_isPaused(false) 57 , m_restrictions(NoRestrictions) 58 , m_speechSynthesisClient(nullptr) 59 { 60 if (context.isDocument()) { 39 61 #if PLATFORM(IOS_FAMILY) 40 #include "Document.h" 62 if (downcast<Document>(context).audioPlaybackRequiresUserGesture()) 63 m_restrictions = RequireUserGestureForSpeechStartRestriction; 41 64 #endif 42 43 namespace WebCore { 44 45 Ref<SpeechSynthesis> SpeechSynthesis::create(WeakPtr<SpeechSynthesisClient> client, Document& document) 46 { 47 return adoptRef(*new SpeechSynthesis(client, document)); 48 } 49 50 SpeechSynthesis::SpeechSynthesis(WeakPtr<SpeechSynthesisClient> client, Document& document) 51 : m_currentSpeechUtterance(nullptr) 52 , m_isPaused(false) 53 #if PLATFORM(IOS_FAMILY) 54 , m_restrictions(document.audioPlaybackRequiresUserGesture() ? RequireUserGestureForSpeechStartRestriction : NoRestrictions) 55 #endif 56 , m_speechSynthesisClient(client) 57 { 58 #if !PLATFORM(IOS_FAMILY) 59 UNUSED_PARAM(document); 60 #endif 65 m_speechSynthesisClient = downcast<Document>(context).frame()->page()->speechSynthesisClient(); 66 } 61 67 62 68 if (m_speechSynthesisClient) { … … 65 71 } 66 72 } 73 74 SpeechSynthesis::~SpeechSynthesis() = default; 67 75 68 76 void SpeechSynthesis::setPlatformSynthesizer(std::unique_ptr<PlatformSpeechSynthesizer> synthesizer) … … 79 87 { 80 88 m_voiceList.clear(); 89 dispatchEvent(Event::create(eventNames().voiceschangedEvent, Event::CanBubble::No, Event::IsCancelable::No)); 81 90 } 82 91 … … 188 197 } 189 198 190 void SpeechSynthesis::fireEvent(const AtomString& type, SpeechSynthesisUtterance& utterance, unsigned long charIndex, const String& name) 191 { 192 utterance.dispatchEvent(SpeechSynthesisEvent::create(type, charIndex, (MonotonicTime::now() - utterance.startTime()).seconds(), name)); 199 void SpeechSynthesis::fireEvent(const AtomString& type, SpeechSynthesisUtterance& utterance, unsigned long charIndex, unsigned long charLength, const String& name) const 200 { 201 utterance.dispatchEvent(SpeechSynthesisEvent::create(type, { &utterance, charIndex, charLength, static_cast<float>((MonotonicTime::now() - utterance.startTime()).seconds()), name })); 202 } 203 204 void SpeechSynthesis::fireErrorEvent(const AtomString& type, SpeechSynthesisUtterance& utterance, SpeechSynthesisErrorCode errorCode) const 205 { 206 utterance.dispatchEvent(SpeechSynthesisErrorEvent::create(type, { { &utterance, 0, 0, static_cast<float>((MonotonicTime::now() - utterance.startTime()).seconds()), { } }, errorCode })); 193 207 } 194 208 … … 200 214 m_currentSpeechUtterance = nullptr; 201 215 202 fireEvent(errorOccurred ? eventNames().errorEvent : eventNames().endEvent, utterance, 0, String()); 203 216 if (errorOccurred) 217 fireErrorEvent(eventNames().errorEvent, utterance, SpeechSynthesisErrorCode::Canceled); 218 else 219 fireEvent(eventNames().endEvent, utterance, 0, 0, String()); 220 204 221 if (m_utteranceQueue.size()) { 205 222 Ref<SpeechSynthesisUtterance> firstUtterance = m_utteranceQueue.takeFirst(); … … 212 229 } 213 230 214 void SpeechSynthesis::boundaryEventOccurred(PlatformSpeechSynthesisUtterance& utterance, SpeechBoundary boundary, unsigned charIndex )231 void SpeechSynthesis::boundaryEventOccurred(PlatformSpeechSynthesisUtterance& utterance, SpeechBoundary boundary, unsigned charIndex, unsigned charLength) 215 232 { 216 233 static NeverDestroyed<const String> wordBoundaryString(MAKE_STATIC_STRING_IMPL("word")); … … 221 238 switch (boundary) { 222 239 case SpeechBoundary::SpeechWordBoundary: 223 fireEvent(eventNames().boundaryEvent, static_cast<SpeechSynthesisUtterance&>(*utterance.client()), charIndex, wordBoundaryString);240 fireEvent(eventNames().boundaryEvent, static_cast<SpeechSynthesisUtterance&>(*utterance.client()), charIndex, charLength, wordBoundaryString); 224 241 break; 225 242 case SpeechBoundary::SpeechSentenceBoundary: 226 fireEvent(eventNames().boundaryEvent, static_cast<SpeechSynthesisUtterance&>(*utterance.client()), charIndex, sentenceBoundaryString);243 fireEvent(eventNames().boundaryEvent, static_cast<SpeechSynthesisUtterance&>(*utterance.client()), charIndex, charLength, sentenceBoundaryString); 227 244 break; 228 245 default: … … 266 283 } 267 284 268 void SpeechSynthesis::boundaryEventOccurred(bool wordBoundary, unsigned charIndex )269 { 270 if (!m_currentSpeechUtterance) 271 return; 272 boundaryEventOccurred(*m_currentSpeechUtterance->platformUtterance(), wordBoundary ? SpeechBoundary::SpeechWordBoundary : SpeechBoundary::SpeechSentenceBoundary, charIndex );285 void SpeechSynthesis::boundaryEventOccurred(bool wordBoundary, unsigned charIndex, unsigned charLength) 286 { 287 if (!m_currentSpeechUtterance) 288 return; 289 boundaryEventOccurred(*m_currentSpeechUtterance->platformUtterance(), wordBoundary ? SpeechBoundary::SpeechWordBoundary : SpeechBoundary::SpeechSentenceBoundary, charIndex, charLength); 273 290 } 274 291 … … 281 298 { 282 299 if (utterance.client()) 283 fireEvent(eventNames().startEvent, static_cast<SpeechSynthesisUtterance&>(*utterance.client()), 0, String());300 fireEvent(eventNames().startEvent, static_cast<SpeechSynthesisUtterance&>(*utterance.client()), 0, 0, String()); 284 301 } 285 302 … … 288 305 m_isPaused = true; 289 306 if (utterance.client()) 290 fireEvent(eventNames().pauseEvent, static_cast<SpeechSynthesisUtterance&>(*utterance.client()), 0, String());307 fireEvent(eventNames().pauseEvent, static_cast<SpeechSynthesisUtterance&>(*utterance.client()), 0, 0, String()); 291 308 } 292 309 … … 295 312 m_isPaused = false; 296 313 if (utterance.client()) 297 fireEvent(eventNames().resumeEvent, static_cast<SpeechSynthesisUtterance&>(*utterance.client()), 0, String());314 fireEvent(eventNames().resumeEvent, static_cast<SpeechSynthesisUtterance&>(*utterance.client()), 0, 0, String()); 298 315 } 299 316 -
trunk/Source/WebCore/Modules/speech/SpeechSynthesis.h
r274678 r291124 31 31 #include "PlatformSpeechSynthesizer.h" 32 32 #include "SpeechSynthesisClient.h" 33 #include "SpeechSynthesisErrorCode.h" 33 34 #include "SpeechSynthesisUtterance.h" 34 35 #include "SpeechSynthesisVoice.h" … … 42 43 class SpeechSynthesisVoice; 43 44 44 class SpeechSynthesis : public PlatformSpeechSynthesizerClient, public SpeechSynthesisClientObserver, public RefCounted<SpeechSynthesis> { 45 class SpeechSynthesis : public PlatformSpeechSynthesizerClient, public SpeechSynthesisClientObserver, public RefCounted<SpeechSynthesis>, public ContextDestructionObserver, public EventTargetWithInlineData { 46 WTF_MAKE_ISO_ALLOCATED(SpeechSynthesis); 45 47 public: 46 static Ref<SpeechSynthesis> create(WeakPtr<SpeechSynthesisClient>, Document&); 48 static Ref<SpeechSynthesis> create(ScriptExecutionContext&); 49 virtual ~SpeechSynthesis(); 50 51 using RefCounted::ref; 52 using RefCounted::deref; 47 53 48 54 bool pending() const; … … 61 67 62 68 private: 63 SpeechSynthesis( WeakPtr<SpeechSynthesisClient>, Document&);69 SpeechSynthesis(ScriptExecutionContext&); 64 70 65 71 // PlatformSpeechSynthesizerClient override methods. … … 70 76 void didFinishSpeaking(PlatformSpeechSynthesisUtterance&) override; 71 77 void speakingErrorOccurred(PlatformSpeechSynthesisUtterance&) override; 72 void boundaryEventOccurred(PlatformSpeechSynthesisUtterance&, SpeechBoundary, unsigned charIndex ) override;78 void boundaryEventOccurred(PlatformSpeechSynthesisUtterance&, SpeechBoundary, unsigned charIndex, unsigned charLength) override; 73 79 74 80 // SpeechSynthesisClient override methods … … 78 84 void didResumeSpeaking() override; 79 85 void speakingErrorOccurred() override; 80 void boundaryEventOccurred(bool wordBoundary, unsigned charIndex ) override;86 void boundaryEventOccurred(bool wordBoundary, unsigned charIndex, unsigned charLength) override; 81 87 void voicesChanged() override; 82 88 83 89 void startSpeakingImmediately(SpeechSynthesisUtterance&); 84 90 void handleSpeakingCompleted(SpeechSynthesisUtterance&, bool errorOccurred); 85 void fireEvent(const AtomString& type, SpeechSynthesisUtterance&, unsigned long charIndex, const String& name); 91 void fireEvent(const AtomString& type, SpeechSynthesisUtterance&, unsigned long charIndex, unsigned long charLength, const String& name) const; 92 void fireErrorEvent(const AtomString& type, SpeechSynthesisUtterance&, SpeechSynthesisErrorCode) const; 86 93 87 #if PLATFORM(IOS_FAMILY)88 94 // Restrictions to change default behaviors. 89 95 enum BehaviorRestrictionFlags { … … 95 101 bool userGestureRequiredForSpeechStart() const { return m_restrictions & RequireUserGestureForSpeechStartRestriction; } 96 102 void removeBehaviorRestriction(BehaviorRestrictions restriction) { m_restrictions &= ~restriction; } 97 #endif 103 104 ScriptExecutionContext* scriptExecutionContext() const final { return ContextDestructionObserver::scriptExecutionContext(); } 105 EventTargetInterface eventTargetInterface() const final { return SpeechSynthesisEventTargetInterfaceType; } 106 void refEventTarget() final { ref(); } 107 void derefEventTarget() final { deref(); } 108 98 109 PlatformSpeechSynthesizer& ensurePlatformSpeechSynthesizer(); 99 110 … … 103 114 Deque<Ref<SpeechSynthesisUtterance>> m_utteranceQueue; 104 115 bool m_isPaused; 105 #if PLATFORM(IOS_FAMILY)106 116 BehaviorRestrictions m_restrictions; 107 #endif108 117 WeakPtr<SpeechSynthesisClient> m_speechSynthesisClient; 109 118 }; -
trunk/Source/WebCore/Modules/speech/SpeechSynthesis.idl
r267813 r291124 25 25 26 26 // https://wicg.github.io/speech-api/#speechsynthesis 27 // FIXME: This is not specified as "LegacyNoInterfaceObject". It should have an interface object and be Exposed=Window.28 27 [ 29 28 Conditional=SPEECH_SYNTHESIS, 30 LegacyNoInterfaceObject, 31 ] interface SpeechSynthesis { 29 Exposed=Window, 30 ] interface SpeechSynthesis : EventTarget { 31 32 32 readonly attribute boolean pending; 33 33 readonly attribute boolean speaking; 34 34 readonly attribute boolean paused; 35 35 36 attribute EventHandler onvoiceschanged; 37 36 38 undefined speak(SpeechSynthesisUtterance utterance); 37 39 undefined cancel(); -
trunk/Source/WebCore/Modules/speech/SpeechSynthesisErrorCode.idl
r291123 r291124 1 1 /* 2 * Copyright (C) 20 13Apple Inc. All rights reserved.2 * Copyright (C) 2022 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 25 25 26 26 [ 27 Conditional=SPEECH_SYNTHESIS, 28 ImplementedBy=DOMWindowSpeechSynthesis 29 ] partial interface DOMWindow { 30 readonly attribute SpeechSynthesis speechSynthesis; 27 Conditional=SPEECH_SYNTHESIS 28 ] enum SpeechSynthesisErrorCode { 29 "canceled", 30 "interrupted", 31 "audio-busy", 32 "audio-hardware", 33 "network", 34 "synthesis-unavailable", 35 "synthesis-failed", 36 "language-unavailable", 37 "voice-unavailable", 38 "text-too-long", 39 "invalid-argument", 40 "not-allowed" 31 41 }; -
trunk/Source/WebCore/Modules/speech/SpeechSynthesisErrorEvent.cpp
r291123 r291124 1 1 /* 2 * Copyright (C) 20 13Apple Inc. All rights reserved.2 * Copyright (C) 2022 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 25 25 26 26 #include "config.h" 27 #include "SpeechSynthesisE vent.h"27 #include "SpeechSynthesisErrorEvent.h" 28 28 29 29 #if ENABLE(SPEECH_SYNTHESIS) … … 33 33 namespace WebCore { 34 34 35 WTF_MAKE_ISO_ALLOCATED_IMPL(SpeechSynthesisE vent);35 WTF_MAKE_ISO_ALLOCATED_IMPL(SpeechSynthesisErrorEvent); 36 36 37 Ref<SpeechSynthesisE vent> SpeechSynthesisEvent::create(const AtomString& type, unsigned charIndex, float elapsedTime, const String& name)37 Ref<SpeechSynthesisErrorEvent> SpeechSynthesisErrorEvent::create(const AtomString& type, const SpeechSynthesisErrorEventInit& initializer) 38 38 { 39 return adoptRef(*new SpeechSynthesisE vent(type, charIndex, elapsedTime, name));39 return adoptRef(*new SpeechSynthesisErrorEvent(type, initializer)); 40 40 } 41 41 42 SpeechSynthesisEvent::SpeechSynthesisEvent(const AtomString& type, unsigned charIndex, float elapsedTime, const String& name) 43 : Event(type, CanBubble::No, IsCancelable::No) 44 , m_charIndex(charIndex) 45 , m_elapsedTime(elapsedTime) 46 , m_name(name) 42 SpeechSynthesisErrorEvent::SpeechSynthesisErrorEvent(const AtomString& type, const SpeechSynthesisErrorEventInit& initializer) 43 : SpeechSynthesisEvent(type, initializer) 44 , m_error(initializer.error) 47 45 { 48 46 } -
trunk/Source/WebCore/Modules/speech/SpeechSynthesisErrorEvent.h
r291123 r291124 1 1 /* 2 * Copyright (C) 20 13Apple Inc. All rights reserved.2 * Copyright (C) 2022 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 28 28 #if ENABLE(SPEECH_SYNTHESIS) 29 29 30 #include "Event.h" 30 #include "SpeechSynthesisErrorCode.h" 31 #include "SpeechSynthesisErrorEventInit.h" 32 #include "SpeechSynthesisEvent.h" 31 33 32 34 namespace WebCore { 33 35 34 class SpeechSynthesisE vent final : publicEvent {35 WTF_MAKE_ISO_ALLOCATED(SpeechSynthesisE vent);36 class SpeechSynthesisErrorEvent final : public SpeechSynthesisEvent { 37 WTF_MAKE_ISO_ALLOCATED(SpeechSynthesisErrorEvent); 36 38 public: 37 static Ref<SpeechSynthesisEvent> create(const AtomString& type, unsigned charIndex, float elapsedTime, const String& name); 39 40 static Ref<SpeechSynthesisErrorEvent> create(const AtomString& type, const SpeechSynthesisErrorEventInit&); 38 41 39 unsigned long charIndex() const { return m_charIndex; } 40 float elapsedTime() const { return m_elapsedTime; } 41 const String& name() const { return m_name; } 42 SpeechSynthesisErrorCode error() const { return m_error; } 42 43 43 virtual EventInterface eventInterface() const { return SpeechSynthesisE ventInterfaceType; }44 virtual EventInterface eventInterface() const { return SpeechSynthesisErrorEventInterfaceType; } 44 45 45 46 private: 46 SpeechSynthesisE vent(const AtomString& type, unsigned charIndex, float elapsedTime, const String& name);47 SpeechSynthesisErrorEvent(const AtomString& type, const SpeechSynthesisErrorEventInit&); 47 48 48 unsigned long m_charIndex; 49 float m_elapsedTime; 50 String m_name; 49 SpeechSynthesisErrorCode m_error; 51 50 }; 52 51 -
trunk/Source/WebCore/Modules/speech/SpeechSynthesisErrorEvent.idl
r291123 r291124 1 1 /* 2 * Copyright (C) 20 13Apple Inc. All rights reserved.2 * Copyright (C) 2022 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 21 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 24 */ 25 25 26 // https://wicg.github.io/speech-api/#speechsynthesise vent26 // https://wicg.github.io/speech-api/#speechsynthesiserrorevent 27 27 [ 28 28 Conditional=SPEECH_SYNTHESIS, 29 29 Exposed=Window 30 ] interface SpeechSynthesisE vent :Event {31 readonly attribute unsigned long charIndex;32 readonly attribute unrestricted float elapsedTime; 33 readonly attribute DOMString name;30 ] interface SpeechSynthesisErrorEvent : SpeechSynthesisEvent { 31 constructor(DOMString type, SpeechSynthesisErrorEventInit eventInitDict); 32 33 readonly attribute SpeechSynthesisErrorCode error; 34 34 }; -
trunk/Source/WebCore/Modules/speech/SpeechSynthesisErrorEventInit.h
r291123 r291124 1 1 /* 2 * Copyright (C) 20 13Apple Inc. All rights reserved.2 * Copyright (C) 2022 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 [ 27 Conditional=SPEECH_SYNTHESIS, 28 ImplementedBy=DOMWindowSpeechSynthesis 29 ] partial interface DOMWindow { 30 readonly attribute SpeechSynthesis speechSynthesis; 26 #pragma once 27 28 #if ENABLE(SPEECH_SYNTHESIS) 29 30 #include "SpeechSynthesisEventInit.h" 31 32 namespace WebCore { 33 34 struct SpeechSynthesisErrorEventInit : SpeechSynthesisEventInit { 35 SpeechSynthesisErrorCode error; 31 36 }; 37 38 } // namespace WebCore 39 40 #endif // ENABLE(SPEECH_SYNTHESIS) -
trunk/Source/WebCore/Modules/speech/SpeechSynthesisErrorEventInit.idl
r291123 r291124 1 1 /* 2 * Copyright (C) 20 13Apple Inc. All rights reserved.2 * Copyright (C) 2022 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 25 25 26 26 [ 27 Conditional=SPEECH_SYNTHESIS, 28 ImplementedBy=DOMWindowSpeechSynthesis 29 ] partial interface DOMWindow { 30 readonly attribute SpeechSynthesis speechSynthesis; 27 Conditional=SPEECH_SYNTHESIS 28 ] dictionary SpeechSynthesisErrorEventInit : SpeechSynthesisEventInit { 29 required SpeechSynthesisErrorCode error; 31 30 }; -
trunk/Source/WebCore/Modules/speech/SpeechSynthesisEvent.cpp
r250060 r291124 35 35 WTF_MAKE_ISO_ALLOCATED_IMPL(SpeechSynthesisEvent); 36 36 37 Ref<SpeechSynthesisEvent> SpeechSynthesisEvent::create(const AtomString& type, unsigned charIndex, float elapsedTime, const String& name)37 Ref<SpeechSynthesisEvent> SpeechSynthesisEvent::create(const AtomString& type, const SpeechSynthesisEventInit& initializer) 38 38 { 39 return adoptRef(*new SpeechSynthesisEvent(type, charIndex, elapsedTime, name));39 return adoptRef(*new SpeechSynthesisEvent(type, initializer)); 40 40 } 41 41 42 SpeechSynthesisEvent::SpeechSynthesisEvent(const AtomString& type, unsigned charIndex, float elapsedTime, const String& name)42 SpeechSynthesisEvent::SpeechSynthesisEvent(const AtomString& type, const SpeechSynthesisEventInit& initializer) 43 43 : Event(type, CanBubble::No, IsCancelable::No) 44 , m_charIndex(charIndex) 45 , m_elapsedTime(elapsedTime) 46 , m_name(name) 44 , m_utterance(initializer.utterance) 45 , m_charIndex(initializer.charIndex) 46 , m_charLength(initializer.charLength) 47 , m_elapsedTime(initializer.elapsedTime) 48 , m_name(initializer.name) 47 49 { 48 50 } -
trunk/Source/WebCore/Modules/speech/SpeechSynthesisEvent.h
r250060 r291124 29 29 30 30 #include "Event.h" 31 #include "SpeechSynthesisEventInit.h" 32 #include "SpeechSynthesisUtterance.h" 31 33 32 34 namespace WebCore { 33 35 34 class SpeechSynthesisEvent final: public Event {36 class SpeechSynthesisEvent : public Event { 35 37 WTF_MAKE_ISO_ALLOCATED(SpeechSynthesisEvent); 36 38 public: 37 static Ref<SpeechSynthesisEvent> create(const AtomString& type, unsigned charIndex, float elapsedTime, const String& name); 39 40 static Ref<SpeechSynthesisEvent> create(const AtomString& type, const SpeechSynthesisEventInit&); 38 41 42 const SpeechSynthesisUtterance* utterance() const { return m_utterance.get(); } 39 43 unsigned long charIndex() const { return m_charIndex; } 44 unsigned long charLength() const { return m_charLength; } 40 45 float elapsedTime() const { return m_elapsedTime; } 41 46 const String& name() const { return m_name; } … … 43 48 virtual EventInterface eventInterface() const { return SpeechSynthesisEventInterfaceType; } 44 49 50 protected: 51 SpeechSynthesisEvent(const AtomString& type, const SpeechSynthesisEventInit&); 52 45 53 private: 46 SpeechSynthesisEvent(const AtomString& type, unsigned charIndex, float elapsedTime, const String& name); 47 54 RefPtr<SpeechSynthesisUtterance> m_utterance; 48 55 unsigned long m_charIndex; 56 unsigned long m_charLength; 49 57 float m_elapsedTime; 50 58 String m_name; -
trunk/Source/WebCore/Modules/speech/SpeechSynthesisEvent.idl
r267813 r291124 21 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 24 */ 25 25 … … 29 29 Exposed=Window 30 30 ] interface SpeechSynthesisEvent : Event { 31 constructor(DOMString type, SpeechSynthesisEventInit eventInitDict); 32 33 readonly attribute SpeechSynthesisUtterance utterance; 31 34 readonly attribute unsigned long charIndex; 35 readonly attribute unsigned long charLength; 32 36 readonly attribute unrestricted float elapsedTime; 33 37 readonly attribute DOMString name; -
trunk/Source/WebCore/Modules/speech/SpeechSynthesisEventInit.h
r291123 r291124 28 28 #if ENABLE(SPEECH_SYNTHESIS) 29 29 30 #include "Event.h" 30 #include "EventInit.h" 31 #include "SpeechSynthesisUtterance.h" 31 32 32 33 namespace WebCore { 33 34 34 class SpeechSynthesisEvent final : public Event { 35 WTF_MAKE_ISO_ALLOCATED(SpeechSynthesisEvent); 36 public: 37 static Ref<SpeechSynthesisEvent> create(const AtomString& type, unsigned charIndex, float elapsedTime, const String& name); 35 struct SpeechSynthesisEventInit : EventInit { 38 36 39 unsigned long charIndex() const { return m_charIndex; } 40 float elapsedTime() const { return m_elapsedTime; } 41 const String& name() const { return m_name; } 37 // Generated code expects a default constructor 38 SpeechSynthesisEventInit() 39 : EventInit() 40 , utterance(nullptr) 41 { } 42 43 SpeechSynthesisEventInit(SpeechSynthesisUtterance* utterance, unsigned long charIndex, unsigned long charLength, float elapsedTime, const String& name) 44 : EventInit() 45 , utterance(utterance) 46 , charIndex(charIndex) 47 , charLength(charLength) 48 , elapsedTime(elapsedTime) 49 , name(name) 50 { } 42 51 43 virtual EventInterface eventInterface() const { return SpeechSynthesisEventInterfaceType; } 44 45 private: 46 SpeechSynthesisEvent(const AtomString& type, unsigned charIndex, float elapsedTime, const String& name); 47 48 unsigned long m_charIndex; 49 float m_elapsedTime; 50 String m_name; 52 RefPtr<SpeechSynthesisUtterance> utterance; 53 unsigned long charIndex; 54 unsigned long charLength; 55 float elapsedTime; 56 String name; 51 57 }; 52 58 -
trunk/Source/WebCore/Modules/speech/SpeechSynthesisEventInit.idl
r291123 r291124 1 1 /* 2 * Copyright (C) 20 13Apple Inc. All rights reserved.2 * Copyright (C) 2022 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 // https://wicg.github.io/speech-api/#speechsynthesiseventinit 26 27 [ 27 Conditional=SPEECH_SYNTHESIS, 28 ImplementedBy=DOMWindowSpeechSynthesis 29 ] partial interface DOMWindow { 30 readonly attribute SpeechSynthesis speechSynthesis; 28 Conditional=SPEECH_SYNTHESIS 29 ] dictionary SpeechSynthesisEventInit : EventInit { 30 required SpeechSynthesisUtterance utterance; 31 unsigned long charIndex = 0; 32 unsigned long charLength = 0; 33 float elapsedTime = 0; 34 DOMString name = ""; 31 35 }; -
trunk/Source/WebCore/Modules/speech/SpeechSynthesisUtterance.cpp
r243887 r291124 41 41 42 42 SpeechSynthesisUtterance::SpeechSynthesisUtterance(ScriptExecutionContext& context, const String& text) 43 : ContextDestructionObserver(&context)44 , m_ platformUtterance(PlatformSpeechSynthesisUtterance::create(*this))43 : m_platformUtterance(PlatformSpeechSynthesisUtterance::create(*this)) 44 , m_scriptExecutionContext(context) 45 45 { 46 46 m_platformUtterance->setText(text); -
trunk/Source/WebCore/Modules/speech/SpeechSynthesisUtterance.h
r243887 r291124 36 36 namespace WebCore { 37 37 38 class SpeechSynthesisUtterance final : public PlatformSpeechSynthesisUtteranceClient, public RefCounted<SpeechSynthesisUtterance>, public ContextDestructionObserver, publicEventTargetWithInlineData {38 class SpeechSynthesisUtterance final : public PlatformSpeechSynthesisUtteranceClient, public RefCounted<SpeechSynthesisUtterance>, public EventTargetWithInlineData { 39 39 WTF_MAKE_ISO_ALLOCATED(SpeechSynthesisUtterance); 40 40 public: 41 41 static Ref<SpeechSynthesisUtterance> create(ScriptExecutionContext&, const String&); 42 43 // Create an empty default constructor so SpeechSynthesisEventInit compiles. 44 SpeechSynthesisUtterance(); 42 45 43 46 virtual ~SpeechSynthesisUtterance(); … … 69 72 PlatformSpeechSynthesisUtterance* platformUtterance() const { return m_platformUtterance.get(); } 70 73 74 SpeechSynthesisUtterance(const SpeechSynthesisUtterance&); 75 71 76 private: 72 77 SpeechSynthesisUtterance(ScriptExecutionContext&, const String&); 73 78 74 ScriptExecutionContext* scriptExecutionContext() const final { return ContextDestructionObserver::scriptExecutionContext(); }79 ScriptExecutionContext* scriptExecutionContext() const final { return &m_scriptExecutionContext; } 75 80 EventTargetInterface eventTargetInterface() const final { return SpeechSynthesisUtteranceEventTargetInterfaceType; } 76 81 void refEventTarget() final { ref(); } … … 79 84 RefPtr<PlatformSpeechSynthesisUtterance> m_platformUtterance; 80 85 RefPtr<SpeechSynthesisVoice> m_voice; 86 ScriptExecutionContext& m_scriptExecutionContext; 81 87 }; 82 88 -
trunk/Source/WebCore/Modules/speech/SpeechSynthesisVoice.idl
r267813 r291124 25 25 26 26 // https://wicg.github.io/speech-api/#speechsynthesisvoice 27 // FIXME: This is not specified as "LegacyNoInterfaceObject". It should have an interface object and be Exposed=Window.28 27 [ 29 LegacyNoInterfaceObject,30 Conditional=SPEECH_SYNTHESIS28 Conditional=SPEECH_SYNTHESIS, 29 Exposed=Window 31 30 ] interface SpeechSynthesisVoice { 32 31 readonly attribute DOMString voiceURI; -
trunk/Source/WebCore/Sources.txt
r291095 r291124 286 286 Modules/speech/DOMWindowSpeechSynthesis.cpp 287 287 Modules/speech/SpeechSynthesis.cpp 288 Modules/speech/SpeechSynthesisErrorEvent.cpp 288 289 Modules/speech/SpeechSynthesisEvent.cpp 289 290 Modules/speech/SpeechSynthesisUtterance.cpp -
trunk/Source/WebCore/SourcesCocoa.txt
r291025 r291124 71 71 JSApplePayShippingMethodUpdate.cpp 72 72 JSApplePayValidateMerchantEvent.cpp 73 JSSpeechSynthesisErrorCode.cpp 74 JSSpeechSynthesisErrorEvent.cpp 75 JSSpeechSynthesisErrorEventInit.cpp 76 JSSpeechSynthesisEventInit.cpp 73 77 Modules/airplay/WebMediaSessionManager.cpp 74 78 Modules/applepay/ApplePayButtonSystemImage.mm -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r291095 r291124 7978 7978 29E04A27BED2F81F98E9022B /* JSBeforeUnloadEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSBeforeUnloadEvent.h; sourceTree = "<group>"; }; 7979 7979 29E4D8DF16B0940F00C84704 /* PlatformSpeechSynthesizer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PlatformSpeechSynthesizer.h; sourceTree = "<group>"; }; 7980 29F83EC327D315A200E1F0FD /* SpeechSynthesisErrorEvent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SpeechSynthesisErrorEvent.h; sourceTree = "<group>"; }; 7981 29F83EC427D315A200E1F0FD /* SpeechSynthesisErrorEvent.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = SpeechSynthesisErrorEvent.cpp; sourceTree = "<group>"; }; 7982 29F83EC527D315B800E1F0FD /* SpeechSynthesisErrorEvent.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = SpeechSynthesisErrorEvent.idl; sourceTree = "<group>"; }; 7983 29F83EC627D3192600E1F0FD /* SpeechSynthesisErrorCode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SpeechSynthesisErrorCode.h; sourceTree = "<group>"; }; 7984 29F83EC927D594E500E1F0FD /* SpeechSynthesisEventInit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SpeechSynthesisEventInit.h; sourceTree = "<group>"; }; 7985 29F83ECB27D5952600E1F0FD /* SpeechSynthesisEventInit.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = SpeechSynthesisEventInit.idl; sourceTree = "<group>"; }; 7986 29F83ECE27D5FA6300E1F0FD /* SpeechSynthesisErrorCode.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = SpeechSynthesisErrorCode.idl; sourceTree = "<group>"; }; 7987 29F83ECF27D6C72A00E1F0FD /* SpeechSynthesisErrorEventInit.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = SpeechSynthesisErrorEventInit.idl; sourceTree = "<group>"; }; 7988 29F83ED027D6C88500E1F0FD /* SpeechSynthesisErrorEventInit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SpeechSynthesisErrorEventInit.h; sourceTree = "<group>"; }; 7980 7989 29FAF4B5195AB08900A522DC /* TextUndoInsertionMarkupMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextUndoInsertionMarkupMac.h; sourceTree = "<group>"; }; 7981 7990 2A4107A026CB66ED003BF797 /* CSSKeywordValue.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CSSKeywordValue.cpp; sourceTree = "<group>"; }; … … 28181 28190 AA2A5AC116A485D500975A25 /* SpeechSynthesisEvent.h */, 28182 28191 AA2A5AC216A485D500975A25 /* SpeechSynthesisEvent.idl */, 28192 29F83EC927D594E500E1F0FD /* SpeechSynthesisEventInit.h */, 28193 29F83ECB27D5952600E1F0FD /* SpeechSynthesisEventInit.idl */, 28194 29F83EC627D3192600E1F0FD /* SpeechSynthesisErrorCode.h */, 28195 29F83ECE27D5FA6300E1F0FD /* SpeechSynthesisErrorCode.idl */, 28196 29F83EC427D315A200E1F0FD /* SpeechSynthesisErrorEvent.cpp */, 28197 29F83EC327D315A200E1F0FD /* SpeechSynthesisErrorEvent.h */, 28198 29F83EC527D315B800E1F0FD /* SpeechSynthesisErrorEvent.idl */, 28199 29F83ECF27D6C72A00E1F0FD /* SpeechSynthesisErrorEventInit.idl */, 28200 29F83ED027D6C88500E1F0FD /* SpeechSynthesisErrorEventInit.h */, 28183 28201 AA2A5AC416A485D500975A25 /* SpeechSynthesisUtterance.cpp */, 28184 28202 AA2A5AC516A485D500975A25 /* SpeechSynthesisUtterance.h */, -
trunk/Source/WebCore/dom/EventNames.h
r287787 r291124 300 300 macro(versionchange) \ 301 301 macro(visibilitychange) \ 302 macro(voiceschanged) \ 302 303 macro(volumechange) \ 303 304 macro(waiting) \ -
trunk/Source/WebCore/dom/EventNames.in
r289894 r291124 71 71 SpeechRecognitionErrorEvent 72 72 SpeechRecognitionEvent 73 SpeechSynthesisErrorEvent conditional=SPEECH_SYNTHESIS 73 74 SpeechSynthesisEvent conditional=SPEECH_SYNTHESIS 74 75 WebGLContextEvent conditional=WEBGL -
trunk/Source/WebCore/dom/EventTargetFactory.in
r289894 r291124 57 57 SourceBufferList conditional=MEDIA_SOURCE 58 58 SpeechRecognition 59 SpeechSynthesis conditional=SPEECH_SYNTHESIS 59 60 SpeechSynthesisUtterance conditional=SPEECH_SYNTHESIS 60 61 TextTrack conditional=VIDEO -
trunk/Source/WebCore/page/SpeechSynthesisClient.h
r286259 r291124 61 61 virtual void didResumeSpeaking() = 0; 62 62 virtual void speakingErrorOccurred() = 0; 63 virtual void boundaryEventOccurred(bool wordBoundary, unsigned charIndex ) = 0;63 virtual void boundaryEventOccurred(bool wordBoundary, unsigned charIndex, unsigned charLength) = 0; 64 64 virtual void voicesChanged() = 0; 65 65 }; -
trunk/Source/WebCore/platform/PlatformSpeechSynthesizer.h
r286259 r291124 53 53 virtual void didResumeSpeaking(PlatformSpeechSynthesisUtterance&) = 0; 54 54 virtual void speakingErrorOccurred(PlatformSpeechSynthesisUtterance&) = 0; 55 virtual void boundaryEventOccurred(PlatformSpeechSynthesisUtterance&, SpeechBoundary, unsigned charIndex ) = 0;55 virtual void boundaryEventOccurred(PlatformSpeechSynthesisUtterance&, SpeechBoundary, unsigned charIndex, unsigned charLength) = 0; 56 56 virtual void voicesDidChange() = 0; 57 57 protected: -
trunk/Source/WebCore/platform/cocoa/PlatformSpeechSynthesizerCocoa.mm
r286259 r291124 258 258 259 259 // AVSpeechSynthesizer only supports word boundaries. 260 m_synthesizerObject->client()->boundaryEventOccurred(*m_utterance, WebCore::SpeechBoundary::SpeechWordBoundary, characterRange.location );260 m_synthesizerObject->client()->boundaryEventOccurred(*m_utterance, WebCore::SpeechBoundary::SpeechWordBoundary, characterRange.location, characterRange.length); 261 261 } 262 262 … … 282 282 NSString *voiceURI = [voice identifier]; 283 283 NSString *name = [voice name]; 284 285 284 // Only show built-in voices when requesting through WebKit to reduce fingerprinting surface area. 286 285 #if HAVE(AVSPEECHSYNTHESIS_SYSTEMVOICE) -
trunk/Source/WebCore/platform/mock/PlatformSpeechSynthesizerMock.cpp
r243002 r291124 62 62 client()->didStartSpeaking(*m_utterance); 63 63 64 // Fire a fake word and then sentence boundary event. 65 client()->boundaryEventOccurred(*m_utterance, SpeechBoundary::SpeechWordBoundary, 0 );66 client()->boundaryEventOccurred(*m_utterance, SpeechBoundary::SpeechSentenceBoundary, m_utterance->text().length());64 // Fire a fake word and then sentence boundary event. Since the entire sentence is the full length, pick arbitrary (3) length for the word. 65 client()->boundaryEventOccurred(*m_utterance, SpeechBoundary::SpeechWordBoundary, 0, 3); 66 client()->boundaryEventOccurred(*m_utterance, SpeechBoundary::SpeechSentenceBoundary, 0, m_utterance->text().length()); 67 67 68 68 // Give the fake speech job some time so that pause and other functions have time to be called. -
trunk/Source/WebKit/ChangeLog
r291123 r291124 1 2022-03-10 Chris Fleizach <cfleizach@apple.com> 2 3 AX: Support updated WebSpeech API 4 https://bugs.webkit.org/show_bug.cgi?id=237614 5 <rdar://problem/89981851> 6 7 Reviewed by Andres Gonzalez. 8 9 * UIProcess/Cocoa/WebPageProxyCocoa.mm: 10 (WebKit::WebPageProxy::boundaryEventOccurred): 11 * UIProcess/WebPageProxy.h: 12 * WebProcess/WebPage/WebPage.cpp: 13 (WebKit::WebPage::boundaryEventOccurred): 14 * WebProcess/WebPage/WebPage.h: 15 * WebProcess/WebPage/WebPage.messages.in: 16 1 17 2022-03-10 Chris Dumez <cdumez@apple.com> 2 18 -
trunk/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm
r291023 r291124 452 452 } 453 453 454 void WebPageProxy::boundaryEventOccurred(WebCore::PlatformSpeechSynthesisUtterance&, WebCore::SpeechBoundary speechBoundary, unsigned charIndex )455 { 456 send(Messages::WebPage::BoundaryEventOccurred(speechBoundary == WebCore::SpeechBoundary::SpeechWordBoundary, charIndex ));454 void WebPageProxy::boundaryEventOccurred(WebCore::PlatformSpeechSynthesisUtterance&, WebCore::SpeechBoundary speechBoundary, unsigned charIndex, unsigned charLength) 455 { 456 send(Messages::WebPage::BoundaryEventOccurred(speechBoundary == WebCore::SpeechBoundary::SpeechWordBoundary, charIndex, charLength)); 457 457 } 458 458 -
trunk/Source/WebKit/UIProcess/WebPageProxy.h
r291023 r291124 2586 2586 void didResumeSpeaking(WebCore::PlatformSpeechSynthesisUtterance&) final; 2587 2587 void speakingErrorOccurred(WebCore::PlatformSpeechSynthesisUtterance&) final; 2588 void boundaryEventOccurred(WebCore::PlatformSpeechSynthesisUtterance&, WebCore::SpeechBoundary, unsigned charIndex ) final;2588 void boundaryEventOccurred(WebCore::PlatformSpeechSynthesisUtterance&, WebCore::SpeechBoundary, unsigned charIndex, unsigned charLength) final; 2589 2589 void voicesDidChange() final; 2590 2590 -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp
r291094 r291124 7350 7350 } 7351 7351 7352 void WebPage::boundaryEventOccurred(bool wordBoundary, unsigned charIndex )7352 void WebPage::boundaryEventOccurred(bool wordBoundary, unsigned charIndex, unsigned charLength) 7353 7353 { 7354 7354 if (auto observer = corePage()->speechSynthesisClient()->observer()) 7355 observer->boundaryEventOccurred(wordBoundary, charIndex );7355 observer->boundaryEventOccurred(wordBoundary, charIndex, charLength); 7356 7356 } 7357 7357 -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.h
r290985 r291124 1929 1929 #if ENABLE(SPEECH_SYNTHESIS) 1930 1930 void speakingErrorOccurred(); 1931 void boundaryEventOccurred(bool wordBoundary, unsigned charIndex );1931 void boundaryEventOccurred(bool wordBoundary, unsigned charIndex, unsigned charLength); 1932 1932 void voicesDidChange(); 1933 1933 #endif -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in
r290985 r291124 616 616 #if ENABLE(SPEECH_SYNTHESIS) 617 617 SpeakingErrorOccurred() 618 BoundaryEventOccurred(bool wordBoundary, unsigned charIndex )618 BoundaryEventOccurred(bool wordBoundary, unsigned charIndex, unsigned charLength) 619 619 VoicesDidChange() 620 620 #endif
Note: See TracChangeset
for help on using the changeset viewer.