WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
patch
file_237614.txt (text/plain), 81.49 KB, created by
chris fleizach
on 2022-03-09 00:27:03 PST
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
chris fleizach
Created:
2022-03-09 00:27:03 PST
Size:
81.49 KB
patch
obsolete
>diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 4fdf9cb29192..c32bbf5bfaa9 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,17 @@ >+2022-03-08 Chris Fleizach <cfleizach@apple.com> >+ >+ AX: Support updated WebSpeech API >+ https://bugs.webkit.org/show_bug.cgi?id=237614 >+ <rdar://problem/89981851> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Fixed expectations: >+ * imported/w3c/web-platform-tests/speech-api/SpeechSynthesisEvent-constructor-expected.txt: Updated. >+ * imported/w3c/web-platform-tests/speech-api/SpeechSynthesisErrorEvent-constructor-expected.txt: Updated. >+ * fast/speechsynthesis/speech-synthesis-boundary-events.html: Updated. >+ * fast/speechsynthesis/speech-synthesis-boundary-events-expected.txt: Updated. >+ > 2022-03-09 Youenn Fablet <youenn@apple.com> > > Scope capture sources by page identifiers >diff --git a/LayoutTests/fast/speechsynthesis/speech-synthesis-boundary-events-expected.txt b/LayoutTests/fast/speechsynthesis/speech-synthesis-boundary-events-expected.txt >index b885901f4a24..9bc73873d7af 100644 >--- a/LayoutTests/fast/speechsynthesis/speech-synthesis-boundary-events-expected.txt >+++ b/LayoutTests/fast/speechsynthesis/speech-synthesis-boundary-events-expected.txt >@@ -4,8 +4,8 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE > > > Speech started >-Boundary event: word, Character index: 0 >-Boundary event: sentence, Character index: 14 >+Boundary event: word, Character index: 0, length: 3 >+Boundary event: sentence, Character index: 0, length: 14 > PASS successfullyParsed is true > > TEST COMPLETE >diff --git a/LayoutTests/fast/speechsynthesis/speech-synthesis-boundary-events.html b/LayoutTests/fast/speechsynthesis/speech-synthesis-boundary-events.html >index d5705d62c92c..7265245ebf44 100644 >--- a/LayoutTests/fast/speechsynthesis/speech-synthesis-boundary-events.html >+++ b/LayoutTests/fast/speechsynthesis/speech-synthesis-boundary-events.html >@@ -25,7 +25,7 @@ > } > > u.onboundary = function(event) { >- debug("Boundary event: " + event.name + ", Character index: " + event.charIndex); >+ debug("Boundary event: " + event.name + ", Character index: " + event.charIndex + ", length: " + event.charLength); > } > > u.onend = function(event) { >diff --git a/LayoutTests/imported/w3c/ChangeLog b/LayoutTests/imported/w3c/ChangeLog >index d9bb74e1a900..3803dad15cdb 100644 >--- a/LayoutTests/imported/w3c/ChangeLog >+++ b/LayoutTests/imported/w3c/ChangeLog >@@ -1,3 +1,15 @@ >+2022-03-08 Chris Fleizach <cfleizach@apple.com> >+ >+ AX: Support updated WebSpeech API >+ https://bugs.webkit.org/show_bug.cgi?id=237614 >+ <rdar://problem/89981851> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * web-platform-tests/speech-api/SpeechSynthesisErrorEvent-constructor-expected.txt: >+ * web-platform-tests/speech-api/SpeechSynthesisEvent-constructor-expected.txt: >+ * web-platform-tests/speech-api/idlharness.window-expected.txt: >+ > 2022-03-08 Antoine Quint <graouts@webkit.org> > > [web-animations] color-interpolation should support discrete animation >diff --git a/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesisErrorEvent-constructor-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesisErrorEvent-constructor-expected.txt >index 039b42402787..34fe6f4a815f 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesisErrorEvent-constructor-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesisErrorEvent-constructor-expected.txt >@@ -1,40 +1,13 @@ > >-FAIL SpeechSynthesisErrorEvent with no arguments throws TypeError assert_throws_js: function "() => { >- new SpeechSynthesisErrorEvent(); >- }" threw object "ReferenceError: Can't find variable: SpeechSynthesisErrorEvent" ("ReferenceError") expected instance of function "function TypeError() { >- [native code] >-}" ("TypeError") >-FAIL SpeechSynthesisErrorEvent with no eventInitDict throws TypeError assert_throws_js: function "() => { >- new SpeechSynthesisErrorEvent("type"); >- }" threw object "ReferenceError: Can't find variable: SpeechSynthesisErrorEvent" ("ReferenceError") expected instance of function "function TypeError() { >- [native code] >-}" ("TypeError") >-FAIL SpeechSynthesisErrorEvent with empty eventInitDict throws TypeError (requires >- utterance and error) assert_throws_js: function "() => { >- new SpeechSynthesisErrorEvent("type", {}); >- }" threw object "ReferenceError: Can't find variable: SpeechSynthesisErrorEvent" ("ReferenceError") expected instance of function "function TypeError() { >- [native code] >-}" ("TypeError") >-FAIL SpeechSynthesisErrorEvent with eventInitDict without utterance throws >- TypeError assert_throws_js: function "() => { >- new SpeechSynthesisErrorEvent("type", {error:"not-allowed"}); >- }" threw object "ReferenceError: Can't find variable: SpeechSynthesisErrorEvent" ("ReferenceError") expected instance of function "function TypeError() { >- [native code] >-}" ("TypeError") >-FAIL SpeechSynthesisErrorEvent with eventInitDict without error throws >- TypeError assert_throws_js: function "() => { >- new SpeechSynthesisErrorEvent("type", {utterance: new SpeechSynthesisUtterance()}); >- }" threw object "ReferenceError: Can't find variable: SpeechSynthesisErrorEvent" ("ReferenceError") expected instance of function "function TypeError() { >- [native code] >-}" ("TypeError") >-FAIL SpeechSynthesisErrorEvent with eventInitDict having utterance and error Can't find variable: SpeechSynthesisErrorEvent >-FAIL SpeechSynthesisErrorEvent with custom eventInitDict Can't find variable: SpeechSynthesisErrorEvent >-FAIL SpeechSynthesisErrorEvent with wrong error enum assert_throws_js: function "() => { >- new SpeechSynthesisErrorEvent("type", { >- utterance: new SpeechSynthesisUtterance(), >- error: error >- }); >- }" threw object "ReferenceError: Can't find variable: SpeechSynthesisErrorEvent" ("ReferenceError") expected instance of function "function TypeError() { >- [native code] >-}" ("TypeError") >+PASS SpeechSynthesisErrorEvent with no arguments throws TypeError >+PASS SpeechSynthesisErrorEvent with no eventInitDict throws TypeError >+PASS SpeechSynthesisErrorEvent with empty eventInitDict throws TypeError (requires >+ utterance and error) >+PASS SpeechSynthesisErrorEvent with eventInitDict without utterance throws >+ TypeError >+PASS SpeechSynthesisErrorEvent with eventInitDict without error throws >+ TypeError >+PASS SpeechSynthesisErrorEvent with eventInitDict having utterance and error >+PASS SpeechSynthesisErrorEvent with custom eventInitDict >+PASS SpeechSynthesisErrorEvent with wrong error enum > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesisEvent-constructor-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesisEvent-constructor-expected.txt >index 711dc74ff639..e0ed251a16c8 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesisEvent-constructor-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesisEvent-constructor-expected.txt >@@ -5,6 +5,6 @@ PASS SpeechSynthesisEvent with empty eventInitDict throws TypeError (requires > utterance) > PASS SpeechSynthesisEvent with eventInitDict not having utterance throws > TypeError >-FAIL SpeechSynthesisEvent with eventInitDict having an utterance Illegal constructor >-FAIL SpeechSynthesisEvent with custom eventInitDict Illegal constructor >+PASS SpeechSynthesisEvent with eventInitDict having an utterance >+PASS SpeechSynthesisEvent with custom eventInitDict > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/speech-api/idlharness.window-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/speech-api/idlharness.window-expected.txt >index 530d91891244..e7df7aa43cfb 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/speech-api/idlharness.window-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/speech-api/idlharness.window-expected.txt >@@ -129,27 +129,27 @@ FAIL SpeechGrammarList interface: new SpeechGrammarList() must inherit property > FAIL SpeechGrammarList interface: calling addFromURI(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" > 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" > 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" >-FAIL SpeechSynthesis interface: existence and properties of interface object assert_own_property: self does not have own property "SpeechSynthesis" expected property "SpeechSynthesis" missing >-FAIL SpeechSynthesis interface object length assert_own_property: self does not have own property "SpeechSynthesis" expected property "SpeechSynthesis" missing >-FAIL SpeechSynthesis interface object name assert_own_property: self does not have own property "SpeechSynthesis" expected property "SpeechSynthesis" missing >-FAIL SpeechSynthesis interface: existence and properties of interface prototype object assert_own_property: self does not have own property "SpeechSynthesis" expected property "SpeechSynthesis" missing >-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 >-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 >-FAIL SpeechSynthesis interface: attribute pending assert_own_property: self does not have own property "SpeechSynthesis" expected property "SpeechSynthesis" missing >-FAIL SpeechSynthesis interface: attribute speaking assert_own_property: self does not have own property "SpeechSynthesis" expected property "SpeechSynthesis" missing >-FAIL SpeechSynthesis interface: attribute paused assert_own_property: self does not have own property "SpeechSynthesis" expected property "SpeechSynthesis" missing >-FAIL SpeechSynthesis interface: attribute onvoiceschanged assert_own_property: self does not have own property "SpeechSynthesis" expected property "SpeechSynthesis" missing >-FAIL SpeechSynthesis interface: operation speak(SpeechSynthesisUtterance) assert_own_property: self does not have own property "SpeechSynthesis" expected property "SpeechSynthesis" missing >-FAIL SpeechSynthesis interface: operation cancel() assert_own_property: self does not have own property "SpeechSynthesis" expected property "SpeechSynthesis" missing >-FAIL SpeechSynthesis interface: operation pause() assert_own_property: self does not have own property "SpeechSynthesis" expected property "SpeechSynthesis" missing >-FAIL SpeechSynthesis interface: operation resume() assert_own_property: self does not have own property "SpeechSynthesis" expected property "SpeechSynthesis" missing >-FAIL SpeechSynthesis interface: operation getVoices() assert_own_property: self does not have own property "SpeechSynthesis" expected property "SpeechSynthesis" missing >-FAIL SpeechSynthesis must be primary interface of speechSynthesis assert_own_property: self does not have own property "SpeechSynthesis" expected property "SpeechSynthesis" missing >+PASS SpeechSynthesis interface: existence and properties of interface object >+PASS SpeechSynthesis interface object length >+PASS SpeechSynthesis interface object name >+PASS SpeechSynthesis interface: existence and properties of interface prototype object >+PASS SpeechSynthesis interface: existence and properties of interface prototype object's "constructor" property >+PASS SpeechSynthesis interface: existence and properties of interface prototype object's @@unscopables property >+PASS SpeechSynthesis interface: attribute pending >+PASS SpeechSynthesis interface: attribute speaking >+PASS SpeechSynthesis interface: attribute paused >+PASS SpeechSynthesis interface: attribute onvoiceschanged >+PASS SpeechSynthesis interface: operation speak(SpeechSynthesisUtterance) >+PASS SpeechSynthesis interface: operation cancel() >+PASS SpeechSynthesis interface: operation pause() >+PASS SpeechSynthesis interface: operation resume() >+PASS SpeechSynthesis interface: operation getVoices() >+PASS SpeechSynthesis must be primary interface of speechSynthesis > PASS Stringification of speechSynthesis > PASS SpeechSynthesis interface: speechSynthesis must inherit property "pending" with the proper type > PASS SpeechSynthesis interface: speechSynthesis must inherit property "speaking" with the proper type > PASS SpeechSynthesis interface: speechSynthesis must inherit property "paused" with the proper type >-FAIL SpeechSynthesis interface: speechSynthesis must inherit property "onvoiceschanged" with the proper type assert_inherits: property "onvoiceschanged" not found in prototype chain >+PASS SpeechSynthesis interface: speechSynthesis must inherit property "onvoiceschanged" with the proper type > PASS SpeechSynthesis interface: speechSynthesis must inherit property "speak(SpeechSynthesisUtterance)" with the proper type > PASS SpeechSynthesis interface: calling speak(SpeechSynthesisUtterance) on speechSynthesis with too few arguments must throw TypeError > PASS SpeechSynthesis interface: speechSynthesis must inherit property "cancel()" with the proper type >@@ -191,35 +191,35 @@ PASS SpeechSynthesisUtterance interface: new SpeechSynthesisUtterance() must inh > PASS SpeechSynthesisUtterance interface: new SpeechSynthesisUtterance() must inherit property "onmark" with the proper type > PASS SpeechSynthesisUtterance interface: new SpeechSynthesisUtterance() must inherit property "onboundary" with the proper type > PASS SpeechSynthesisEvent interface: existence and properties of interface object >-FAIL SpeechSynthesisEvent interface object length assert_equals: wrong value for SpeechSynthesisEvent.length expected 2 but got 0 >+PASS SpeechSynthesisEvent interface object length > PASS SpeechSynthesisEvent interface object name > PASS SpeechSynthesisEvent interface: existence and properties of interface prototype object > PASS SpeechSynthesisEvent interface: existence and properties of interface prototype object's "constructor" property > PASS SpeechSynthesisEvent interface: existence and properties of interface prototype object's @@unscopables property >-FAIL SpeechSynthesisEvent interface: attribute utterance assert_true: The prototype object must have a property "utterance" expected true got false >+PASS SpeechSynthesisEvent interface: attribute utterance > PASS SpeechSynthesisEvent interface: attribute charIndex >-FAIL SpeechSynthesisEvent interface: attribute charLength assert_true: The prototype object must have a property "charLength" expected true got false >+PASS SpeechSynthesisEvent interface: attribute charLength > PASS SpeechSynthesisEvent interface: attribute elapsedTime > PASS SpeechSynthesisEvent interface: attribute name >-FAIL SpeechSynthesisErrorEvent interface: existence and properties of interface object assert_own_property: self does not have own property "SpeechSynthesisErrorEvent" expected property "SpeechSynthesisErrorEvent" missing >-FAIL SpeechSynthesisErrorEvent interface object length assert_own_property: self does not have own property "SpeechSynthesisErrorEvent" expected property "SpeechSynthesisErrorEvent" missing >-FAIL SpeechSynthesisErrorEvent interface object name assert_own_property: self does not have own property "SpeechSynthesisErrorEvent" expected property "SpeechSynthesisErrorEvent" missing >-FAIL SpeechSynthesisErrorEvent interface: existence and properties of interface prototype object assert_own_property: self does not have own property "SpeechSynthesisErrorEvent" expected property "SpeechSynthesisErrorEvent" missing >-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 >-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 >-FAIL SpeechSynthesisErrorEvent interface: attribute error assert_own_property: self does not have own property "SpeechSynthesisErrorEvent" expected property "SpeechSynthesisErrorEvent" missing >-FAIL SpeechSynthesisVoice interface: existence and properties of interface object assert_own_property: self does not have own property "SpeechSynthesisVoice" expected property "SpeechSynthesisVoice" missing >-FAIL SpeechSynthesisVoice interface object length assert_own_property: self does not have own property "SpeechSynthesisVoice" expected property "SpeechSynthesisVoice" missing >-FAIL SpeechSynthesisVoice interface object name assert_own_property: self does not have own property "SpeechSynthesisVoice" expected property "SpeechSynthesisVoice" missing >-FAIL SpeechSynthesisVoice interface: existence and properties of interface prototype object assert_own_property: self does not have own property "SpeechSynthesisVoice" expected property "SpeechSynthesisVoice" missing >-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 >-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 >-FAIL SpeechSynthesisVoice interface: attribute voiceURI assert_own_property: self does not have own property "SpeechSynthesisVoice" expected property "SpeechSynthesisVoice" missing >-FAIL SpeechSynthesisVoice interface: attribute name assert_own_property: self does not have own property "SpeechSynthesisVoice" expected property "SpeechSynthesisVoice" missing >-FAIL SpeechSynthesisVoice interface: attribute lang assert_own_property: self does not have own property "SpeechSynthesisVoice" expected property "SpeechSynthesisVoice" missing >-FAIL SpeechSynthesisVoice interface: attribute localService assert_own_property: self does not have own property "SpeechSynthesisVoice" expected property "SpeechSynthesisVoice" missing >-FAIL SpeechSynthesisVoice interface: attribute default assert_own_property: self does not have own property "SpeechSynthesisVoice" expected property "SpeechSynthesisVoice" missing >-FAIL SpeechSynthesisVoice must be primary interface of voice assert_own_property: self does not have own property "SpeechSynthesisVoice" expected property "SpeechSynthesisVoice" missing >+PASS SpeechSynthesisErrorEvent interface: existence and properties of interface object >+PASS SpeechSynthesisErrorEvent interface object length >+PASS SpeechSynthesisErrorEvent interface object name >+PASS SpeechSynthesisErrorEvent interface: existence and properties of interface prototype object >+PASS SpeechSynthesisErrorEvent interface: existence and properties of interface prototype object's "constructor" property >+PASS SpeechSynthesisErrorEvent interface: existence and properties of interface prototype object's @@unscopables property >+PASS SpeechSynthesisErrorEvent interface: attribute error >+PASS SpeechSynthesisVoice interface: existence and properties of interface object >+PASS SpeechSynthesisVoice interface object length >+PASS SpeechSynthesisVoice interface object name >+PASS SpeechSynthesisVoice interface: existence and properties of interface prototype object >+PASS SpeechSynthesisVoice interface: existence and properties of interface prototype object's "constructor" property >+PASS SpeechSynthesisVoice interface: existence and properties of interface prototype object's @@unscopables property >+PASS SpeechSynthesisVoice interface: attribute voiceURI >+PASS SpeechSynthesisVoice interface: attribute name >+PASS SpeechSynthesisVoice interface: attribute lang >+PASS SpeechSynthesisVoice interface: attribute localService >+PASS SpeechSynthesisVoice interface: attribute default >+PASS SpeechSynthesisVoice must be primary interface of voice > PASS Stringification of voice > PASS SpeechSynthesisVoice interface: voice must inherit property "voiceURI" with the proper type > PASS SpeechSynthesisVoice interface: voice must inherit property "name" with the proper type >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 7d0e9748f4a3..5a77dba2c298 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,75 @@ >+2022-03-08 Chris Fleizach <cfleizach@apple.com> >+ >+ AX: Support updated WebSpeech API >+ https://bugs.webkit.org/show_bug.cgi?id=237614 >+ <rdar://problem/89981851> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Adopt WebSpeech (18 August 2020) changes from >+ https://wicg.github.io/speech-api/ >+ >+ Tests Fixed: >+ imported/w3c/web-platform-tests/speech-api/ >+ >+ * DerivedSources-input.xcfilelist: >+ * DerivedSources-output.xcfilelist: >+ * DerivedSources.make: >+ * Modules/speech/DOMWindow+SpeechSynthesis.idl: >+ * Modules/speech/DOMWindowSpeechSynthesis.cpp: >+ (WebCore::DOMWindowSpeechSynthesis::speechSynthesis): >+ * Modules/speech/SpeechSynthesis.cpp: >+ (WebCore::Ref<SpeechSynthesis>SpeechSynthesis::create): >+ (WebCore::SpeechSynthesis::SpeechSynthesis): >+ (WebCore::SpeechSynthesis::voicesDidChange): >+ (WebCore::SpeechSynthesis::fireEvent const): >+ (WebCore::SpeechSynthesis::fireErrorEvent const): >+ (WebCore::SpeechSynthesis::handleSpeakingCompleted): >+ (WebCore::SpeechSynthesis::boundaryEventOccurred): >+ (WebCore::SpeechSynthesis::didStartSpeaking): >+ (WebCore::SpeechSynthesis::didPauseSpeaking): >+ (WebCore::SpeechSynthesis::didResumeSpeaking): >+ (WebCore::SpeechSynthesis::create): Deleted. >+ (WebCore::SpeechSynthesis::fireEvent): Deleted. >+ * Modules/speech/SpeechSynthesis.h: >+ * Modules/speech/SpeechSynthesis.idl: >+ * Modules/speech/SpeechSynthesisErrorCode.h: Added. >+ * Modules/speech/SpeechSynthesisErrorCode.idl: Copied from Source/WebCore/Modules/speech/DOMWindow+SpeechSynthesis.idl. >+ * Modules/speech/SpeechSynthesisErrorEvent.cpp: Copied from Source/WebCore/Modules/speech/SpeechSynthesisEvent.cpp. >+ (WebCore::SpeechSynthesisErrorEvent::create): >+ (WebCore::SpeechSynthesisErrorEvent::SpeechSynthesisErrorEvent): >+ * Modules/speech/SpeechSynthesisErrorEvent.h: Copied from Source/WebCore/Modules/speech/SpeechSynthesisEvent.h. >+ * Modules/speech/SpeechSynthesisErrorEvent.idl: Copied from Source/WebCore/Modules/speech/SpeechSynthesisEvent.idl. >+ * Modules/speech/SpeechSynthesisErrorEventInit.h: Copied from Source/WebCore/Modules/speech/DOMWindow+SpeechSynthesis.idl. >+ * Modules/speech/SpeechSynthesisErrorEventInit.idl: Copied from Source/WebCore/Modules/speech/DOMWindow+SpeechSynthesis.idl. >+ * Modules/speech/SpeechSynthesisEvent.cpp: >+ (WebCore::SpeechSynthesisEvent::create): >+ (WebCore::SpeechSynthesisEvent::SpeechSynthesisEvent): >+ * Modules/speech/SpeechSynthesisEvent.h: >+ (WebCore::SpeechSynthesisEvent::utterance const): >+ (WebCore::SpeechSynthesisEvent::charLength const): >+ (): Deleted. >+ * Modules/speech/SpeechSynthesisEvent.idl: >+ * Modules/speech/SpeechSynthesisEventInit.h: Copied from Source/WebCore/Modules/speech/SpeechSynthesisEvent.h. >+ (WebCore::SpeechSynthesisEventInit::SpeechSynthesisEventInit): >+ * Modules/speech/SpeechSynthesisEventInit.idl: Copied from Source/WebCore/Modules/speech/DOMWindow+SpeechSynthesis.idl. >+ * Modules/speech/SpeechSynthesisUtterance.cpp: >+ (WebCore::SpeechSynthesisUtterance::SpeechSynthesisUtterance): >+ * Modules/speech/SpeechSynthesisUtterance.h: >+ * Modules/speech/SpeechSynthesisVoice.idl: >+ * Sources.txt: >+ * WebCore.xcodeproj/project.pbxproj: >+ * dom/EventNames.h: >+ * dom/EventNames.in: >+ * dom/EventTargetFactory.in: >+ * page/SpeechSynthesisClient.h: >+ * platform/PlatformSpeechSynthesizer.h: >+ * platform/cocoa/PlatformSpeechSynthesizerCocoa.mm: >+ (-[WebSpeechSynthesisWrapper speechSynthesizer:willSpeakRangeOfSpeechString:utterance:]): >+ (WebCore::PlatformSpeechSynthesizer::initializeVoiceList): >+ * platform/mock/PlatformSpeechSynthesizerMock.cpp: >+ (WebCore::PlatformSpeechSynthesizerMock::speak): >+ > 2022-03-09 Youenn Fablet <youenn@apple.com> > > Scope capture sources by page identifiers >diff --git a/Source/WebCore/DerivedSources-input.xcfilelist b/Source/WebCore/DerivedSources-input.xcfilelist >index 6be7f4f08318..fbb9cc8ceaa2 100644 >--- a/Source/WebCore/DerivedSources-input.xcfilelist >+++ b/Source/WebCore/DerivedSources-input.xcfilelist >@@ -608,7 +608,11 @@ $(PROJECT_DIR)/Modules/speech/SpeechRecognitionEvent.idl > $(PROJECT_DIR)/Modules/speech/SpeechRecognitionResult.idl > $(PROJECT_DIR)/Modules/speech/SpeechRecognitionResultList.idl > $(PROJECT_DIR)/Modules/speech/SpeechSynthesis.idl >+$(PROJECT_DIR)/Modules/speech/SpeechSynthesisErrorCode.idl >+$(PROJECT_DIR)/Modules/speech/SpeechSynthesisErrorEvent.idl >+$(PROJECT_DIR)/Modules/speech/SpeechSynthesisErrorEventInit.idl > $(PROJECT_DIR)/Modules/speech/SpeechSynthesisEvent.idl >+$(PROJECT_DIR)/Modules/speech/SpeechSynthesisEventInit.idl > $(PROJECT_DIR)/Modules/speech/SpeechSynthesisUtterance.idl > $(PROJECT_DIR)/Modules/speech/SpeechSynthesisVoice.idl > $(PROJECT_DIR)/Modules/storage/StorageManager.idl >diff --git a/Source/WebCore/DerivedSources-output.xcfilelist b/Source/WebCore/DerivedSources-output.xcfilelist >index 6c205e71da4f..37750e2b0ada 100644 >--- a/Source/WebCore/DerivedSources-output.xcfilelist >+++ b/Source/WebCore/DerivedSources-output.xcfilelist >@@ -2516,8 +2516,16 @@ $(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/JSSpeechSynthesisErrorCode.cpp >+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechSynthesisErrorCode.h >+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechSynthesisErrorEvent.cpp >+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechSynthesisErrorEvent.h >+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechSynthesisErrorEventInit.cpp >+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechSynthesisErrorEventInit.h > $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechSynthesisEvent.cpp > $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechSynthesisEvent.h >+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechSynthesisEventInit.cpp >+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechSynthesisEventInit.h > $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechSynthesisUtterance.cpp > $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechSynthesisUtterance.h > $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechSynthesisVoice.cpp >diff --git a/Source/WebCore/DerivedSources.make b/Source/WebCore/DerivedSources.make >index 26803270d67a..ef93bffed1c2 100644 >--- a/Source/WebCore/DerivedSources.make >+++ b/Source/WebCore/DerivedSources.make >@@ -521,7 +521,11 @@ JS_BINDING_IDLS := \ > $(WebCore)/Modules/remoteplayback/RemotePlaybackAvailabilityCallback.idl \ > $(WebCore)/Modules/speech/DOMWindow+SpeechSynthesis.idl \ > $(WebCore)/Modules/speech/SpeechSynthesis.idl \ >+ $(WebCore)/Modules/speech/SpeechSynthesisErrorCode.idl \ >+ $(WebCore)/Modules/speech/SpeechSynthesisErrorEvent.idl \ >+ $(WebCore)/Modules/speech/SpeechSynthesisErrorEventInit.idl \ > $(WebCore)/Modules/speech/SpeechSynthesisEvent.idl \ >+ $(WebCore)/Modules/speech/SpeechSynthesisEventInit.idl \ > $(WebCore)/Modules/speech/SpeechSynthesisUtterance.idl \ > $(WebCore)/Modules/speech/SpeechSynthesisVoice.idl \ > $(WebCore)/Modules/speech/SpeechRecognition.idl \ >diff --git a/Source/WebCore/Modules/credentialmanagement/BasicCredential.h b/Source/WebCore/Modules/credentialmanagement/BasicCredential.h >index 1fd83275502e..2a85a5e8cab0 100644 >--- a/Source/WebCore/Modules/credentialmanagement/BasicCredential.h >+++ b/Source/WebCore/Modules/credentialmanagement/BasicCredential.h >@@ -27,12 +27,12 @@ > > #if ENABLE(WEB_AUTHN) > >-#include <wtf/RefCounted.h> >-#include <wtf/TypeCasts.h> >-#include <wtf/text/WTFString.h> > #include "Document.h" > #include "IDLTypes.h" > #include "JSDOMPromiseDeferred.h" >+#include <wtf/RefCounted.h> >+#include <wtf/TypeCasts.h> >+#include <wtf/text/WTFString.h> > > namespace WebCore { > >diff --git a/Source/WebCore/Modules/speech/DOMWindow+SpeechSynthesis.idl b/Source/WebCore/Modules/speech/DOMWindow+SpeechSynthesis.idl >index 0fd7b28c7862..04ba93666d17 100644 >--- a/Source/WebCore/Modules/speech/DOMWindow+SpeechSynthesis.idl >+++ b/Source/WebCore/Modules/speech/DOMWindow+SpeechSynthesis.idl >@@ -27,5 +27,5 @@ > Conditional=SPEECH_SYNTHESIS, > ImplementedBy=DOMWindowSpeechSynthesis > ] partial interface DOMWindow { >- readonly attribute SpeechSynthesis speechSynthesis; >+ [SameObject] readonly attribute SpeechSynthesis speechSynthesis; > }; >diff --git a/Source/WebCore/Modules/speech/DOMWindowSpeechSynthesis.cpp b/Source/WebCore/Modules/speech/DOMWindowSpeechSynthesis.cpp >index 644c884cc12a..e52cbd506283 100644 >--- a/Source/WebCore/Modules/speech/DOMWindowSpeechSynthesis.cpp >+++ b/Source/WebCore/Modules/speech/DOMWindowSpeechSynthesis.cpp >@@ -71,7 +71,7 @@ SpeechSynthesis* DOMWindowSpeechSynthesis::speechSynthesis(DOMWindow& window) > SpeechSynthesis* DOMWindowSpeechSynthesis::speechSynthesis() > { > if (!m_speechSynthesis && frame() && frame()->document()) >- m_speechSynthesis = SpeechSynthesis::create(frame()->page()->speechSynthesisClient(), *frame()->document()); >+ m_speechSynthesis = SpeechSynthesis::create(*frame()->document()); > return m_speechSynthesis.get(); > } > >diff --git a/Source/WebCore/Modules/speech/SpeechSynthesis.cpp b/Source/WebCore/Modules/speech/SpeechSynthesis.cpp >index 82c1a3a0c072..38d0c105669f 100644 >--- a/Source/WebCore/Modules/speech/SpeechSynthesis.cpp >+++ b/Source/WebCore/Modules/speech/SpeechSynthesis.cpp >@@ -29,11 +29,15 @@ > #if ENABLE(SPEECH_SYNTHESIS) > > #include "EventNames.h" >+#include "Frame.h" >+#include "Page.h" > #include "PlatformSpeechSynthesisVoice.h" > #include "PlatformSpeechSynthesizer.h" >+#include "SpeechSynthesisErrorEvent.h" > #include "SpeechSynthesisEvent.h" > #include "SpeechSynthesisUtterance.h" > #include "UserGestureIndicator.h" >+#include <wtf/IsoMallocInlines.h> > #include <wtf/NeverDestroyed.h> > > #if PLATFORM(IOS_FAMILY) >@@ -42,22 +46,27 @@ > > namespace WebCore { > >-Ref<SpeechSynthesis> SpeechSynthesis::create(WeakPtr<SpeechSynthesisClient> client, Document& document) >+WTF_MAKE_ISO_ALLOCATED_IMPL(SpeechSynthesis); >+ >+Ref<SpeechSynthesis>SpeechSynthesis::create(ScriptExecutionContext& context) > { >- return adoptRef(*new SpeechSynthesis(client, document)); >+ return adoptRef(*new SpeechSynthesis(context)); > } > >-SpeechSynthesis::SpeechSynthesis(WeakPtr<SpeechSynthesisClient> client, Document& document) >- : m_currentSpeechUtterance(nullptr) >+SpeechSynthesis::SpeechSynthesis(ScriptExecutionContext& context) >+ : ContextDestructionObserver(&context) >+ , m_currentSpeechUtterance(nullptr) > , m_isPaused(false) >-#if PLATFORM(IOS_FAMILY) >- , m_restrictions(document.audioPlaybackRequiresUserGesture() ? RequireUserGestureForSpeechStartRestriction : NoRestrictions) >-#endif >- , m_speechSynthesisClient(client) >+ , m_restrictions(NoRestrictions) >+ , m_speechSynthesisClient(nullptr) > { >-#if !PLATFORM(IOS_FAMILY) >- UNUSED_PARAM(document); >+ if (context.isDocument()) { >+#if PLATFORM(IOS_FAMILY) >+ if (downcast<Document>(context).audioPlaybackRequiresUserGesture()) >+ m_restrictions = RequireUserGestureForSpeechStartRestriction; > #endif >+ m_speechSynthesisClient = downcast<Document>(context).frame()->page()->speechSynthesisClient(); >+ } > > if (m_speechSynthesisClient) { > m_speechSynthesisClient->setObserver(*this); >@@ -65,6 +74,8 @@ SpeechSynthesis::SpeechSynthesis(WeakPtr<SpeechSynthesisClient> client, Document > } > } > >+SpeechSynthesis::~SpeechSynthesis() = default; >+ > void SpeechSynthesis::setPlatformSynthesizer(std::unique_ptr<PlatformSpeechSynthesizer> synthesizer) > { > m_platformSpeechSynthesizer = WTFMove(synthesizer); >@@ -78,6 +89,7 @@ void SpeechSynthesis::setPlatformSynthesizer(std::unique_ptr<PlatformSpeechSynth > void SpeechSynthesis::voicesDidChange() > { > m_voiceList.clear(); >+ dispatchEvent(Event::create(eventNames().voiceschangedEvent, Event::CanBubble::No, Event::IsCancelable::No)); > } > > PlatformSpeechSynthesizer& SpeechSynthesis::ensurePlatformSpeechSynthesizer() >@@ -187,9 +199,16 @@ void SpeechSynthesis::resume() > } > } > >-void SpeechSynthesis::fireEvent(const AtomString& type, SpeechSynthesisUtterance& utterance, unsigned long charIndex, const String& name) >+void SpeechSynthesis::fireEvent(const AtomString& type, SpeechSynthesisUtterance& utterance, unsigned long charIndex, unsigned long charLength, const String& name) const > { >- utterance.dispatchEvent(SpeechSynthesisEvent::create(type, charIndex, (MonotonicTime::now() - utterance.startTime()).seconds(), name)); >+ SpeechSynthesisEventInit eventInit = { &utterance, charIndex, charLength, static_cast<float>((MonotonicTime::now() - utterance.startTime()).seconds()), name }; >+ utterance.dispatchEvent(SpeechSynthesisEvent::create(type, eventInit)); >+} >+ >+void SpeechSynthesis::fireErrorEvent(const AtomString& type, SpeechSynthesisUtterance& utterance, SpeechSynthesisErrorCode errorCode) const >+{ >+ SpeechSynthesisErrorEventInit eventInit = { { &utterance, 0, 0, static_cast<float>((MonotonicTime::now() - utterance.startTime()).seconds()), { } }, errorCode }; >+ utterance.dispatchEvent(SpeechSynthesisErrorEvent::create(type, eventInit)); > } > > void SpeechSynthesis::handleSpeakingCompleted(SpeechSynthesisUtterance& utterance, bool errorOccurred) >@@ -199,8 +218,11 @@ void SpeechSynthesis::handleSpeakingCompleted(SpeechSynthesisUtterance& utteranc > > m_currentSpeechUtterance = nullptr; > >- fireEvent(errorOccurred ? eventNames().errorEvent : eventNames().endEvent, utterance, 0, String()); >- >+ if (errorOccurred) >+ fireErrorEvent(eventNames().errorEvent, utterance, SpeechSynthesisErrorCode::Canceled); >+ else >+ fireEvent(eventNames().endEvent, utterance, 0, 0, String()); >+ > if (m_utteranceQueue.size()) { > Ref<SpeechSynthesisUtterance> firstUtterance = m_utteranceQueue.takeFirst(); > ASSERT(&utterance == firstUtterance.ptr()); >@@ -211,7 +233,7 @@ void SpeechSynthesis::handleSpeakingCompleted(SpeechSynthesisUtterance& utteranc > } > } > >-void SpeechSynthesis::boundaryEventOccurred(PlatformSpeechSynthesisUtterance& utterance, SpeechBoundary boundary, unsigned charIndex) >+void SpeechSynthesis::boundaryEventOccurred(PlatformSpeechSynthesisUtterance& utterance, SpeechBoundary boundary, unsigned charIndex, unsigned charLength) > { > static NeverDestroyed<const String> wordBoundaryString(MAKE_STATIC_STRING_IMPL("word")); > static NeverDestroyed<const String> sentenceBoundaryString(MAKE_STATIC_STRING_IMPL("sentence")); >@@ -220,10 +242,10 @@ void SpeechSynthesis::boundaryEventOccurred(PlatformSpeechSynthesisUtterance& ut > > switch (boundary) { > case SpeechBoundary::SpeechWordBoundary: >- fireEvent(eventNames().boundaryEvent, static_cast<SpeechSynthesisUtterance&>(*utterance.client()), charIndex, wordBoundaryString); >+ fireEvent(eventNames().boundaryEvent, static_cast<SpeechSynthesisUtterance&>(*utterance.client()), charIndex, charLength, wordBoundaryString); > break; > case SpeechBoundary::SpeechSentenceBoundary: >- fireEvent(eventNames().boundaryEvent, static_cast<SpeechSynthesisUtterance&>(*utterance.client()), charIndex, sentenceBoundaryString); >+ fireEvent(eventNames().boundaryEvent, static_cast<SpeechSynthesisUtterance&>(*utterance.client()), charIndex, charLength, sentenceBoundaryString); > break; > default: > ASSERT_NOT_REACHED(); >@@ -265,11 +287,11 @@ void SpeechSynthesis::speakingErrorOccurred() > speakingErrorOccurred(*m_currentSpeechUtterance->platformUtterance()); > } > >-void SpeechSynthesis::boundaryEventOccurred(bool wordBoundary, unsigned charIndex) >+void SpeechSynthesis::boundaryEventOccurred(bool wordBoundary, unsigned charIndex, unsigned charLength) > { > if (!m_currentSpeechUtterance) > return; >- boundaryEventOccurred(*m_currentSpeechUtterance->platformUtterance(), wordBoundary ? SpeechBoundary::SpeechWordBoundary : SpeechBoundary::SpeechSentenceBoundary, charIndex); >+ boundaryEventOccurred(*m_currentSpeechUtterance->platformUtterance(), wordBoundary ? SpeechBoundary::SpeechWordBoundary : SpeechBoundary::SpeechSentenceBoundary, charIndex, charLength); > } > > void SpeechSynthesis::voicesChanged() >@@ -280,21 +302,21 @@ void SpeechSynthesis::voicesChanged() > void SpeechSynthesis::didStartSpeaking(PlatformSpeechSynthesisUtterance& utterance) > { > if (utterance.client()) >- fireEvent(eventNames().startEvent, static_cast<SpeechSynthesisUtterance&>(*utterance.client()), 0, String()); >+ fireEvent(eventNames().startEvent, static_cast<SpeechSynthesisUtterance&>(*utterance.client()), 0, 0, String()); > } > > void SpeechSynthesis::didPauseSpeaking(PlatformSpeechSynthesisUtterance& utterance) > { > m_isPaused = true; > if (utterance.client()) >- fireEvent(eventNames().pauseEvent, static_cast<SpeechSynthesisUtterance&>(*utterance.client()), 0, String()); >+ fireEvent(eventNames().pauseEvent, static_cast<SpeechSynthesisUtterance&>(*utterance.client()), 0, 0, String()); > } > > void SpeechSynthesis::didResumeSpeaking(PlatformSpeechSynthesisUtterance& utterance) > { > m_isPaused = false; > if (utterance.client()) >- fireEvent(eventNames().resumeEvent, static_cast<SpeechSynthesisUtterance&>(*utterance.client()), 0, String()); >+ fireEvent(eventNames().resumeEvent, static_cast<SpeechSynthesisUtterance&>(*utterance.client()), 0, 0, String()); > } > > void SpeechSynthesis::didFinishSpeaking(PlatformSpeechSynthesisUtterance& utterance) >diff --git a/Source/WebCore/Modules/speech/SpeechSynthesis.h b/Source/WebCore/Modules/speech/SpeechSynthesis.h >index d4926ecac410..e2f052f15fbd 100644 >--- a/Source/WebCore/Modules/speech/SpeechSynthesis.h >+++ b/Source/WebCore/Modules/speech/SpeechSynthesis.h >@@ -30,6 +30,7 @@ > #include "PlatformSpeechSynthesisUtterance.h" > #include "PlatformSpeechSynthesizer.h" > #include "SpeechSynthesisClient.h" >+#include "SpeechSynthesisErrorCode.h" > #include "SpeechSynthesisUtterance.h" > #include "SpeechSynthesisVoice.h" > #include <wtf/Deque.h> >@@ -41,9 +42,14 @@ class Document; > class PlatformSpeechSynthesizerClient; > class SpeechSynthesisVoice; > >-class SpeechSynthesis : public PlatformSpeechSynthesizerClient, public SpeechSynthesisClientObserver, public RefCounted<SpeechSynthesis> { >+class SpeechSynthesis : public PlatformSpeechSynthesizerClient, public SpeechSynthesisClientObserver, public RefCounted<SpeechSynthesis>, public ContextDestructionObserver, public EventTargetWithInlineData { >+ WTF_MAKE_ISO_ALLOCATED(SpeechSynthesis); > public: >- static Ref<SpeechSynthesis> create(WeakPtr<SpeechSynthesisClient>, Document&); >+ static Ref<SpeechSynthesis> create(ScriptExecutionContext&); >+ virtual ~SpeechSynthesis(); >+ >+ using RefCounted::ref; >+ using RefCounted::deref; > > bool pending() const; > bool speaking() const; >@@ -60,7 +66,7 @@ public: > WEBCORE_EXPORT void setPlatformSynthesizer(std::unique_ptr<PlatformSpeechSynthesizer>); > > private: >- SpeechSynthesis(WeakPtr<SpeechSynthesisClient>, Document&); >+ SpeechSynthesis(ScriptExecutionContext&); > > // PlatformSpeechSynthesizerClient override methods. > void voicesDidChange() override; >@@ -69,7 +75,7 @@ private: > void didResumeSpeaking(PlatformSpeechSynthesisUtterance&) override; > void didFinishSpeaking(PlatformSpeechSynthesisUtterance&) override; > void speakingErrorOccurred(PlatformSpeechSynthesisUtterance&) override; >- void boundaryEventOccurred(PlatformSpeechSynthesisUtterance&, SpeechBoundary, unsigned charIndex) override; >+ void boundaryEventOccurred(PlatformSpeechSynthesisUtterance&, SpeechBoundary, unsigned charIndex, unsigned charLength) override; > > // SpeechSynthesisClient override methods > void didStartSpeaking() override; >@@ -77,14 +83,14 @@ private: > void didPauseSpeaking() override; > void didResumeSpeaking() override; > void speakingErrorOccurred() override; >- void boundaryEventOccurred(bool wordBoundary, unsigned charIndex) override; >+ void boundaryEventOccurred(bool wordBoundary, unsigned charIndex, unsigned charLength) override; > void voicesChanged() override; > > void startSpeakingImmediately(SpeechSynthesisUtterance&); > void handleSpeakingCompleted(SpeechSynthesisUtterance&, bool errorOccurred); >- void fireEvent(const AtomString& type, SpeechSynthesisUtterance&, unsigned long charIndex, const String& name); >+ void fireEvent(const AtomString& type, SpeechSynthesisUtterance&, unsigned long charIndex, unsigned long charLength, const String& name) const; >+ void fireErrorEvent(const AtomString& type, SpeechSynthesisUtterance&, SpeechSynthesisErrorCode) const; > >-#if PLATFORM(IOS_FAMILY) > // Restrictions to change default behaviors. > enum BehaviorRestrictionFlags { > NoRestrictions = 0, >@@ -94,7 +100,12 @@ private: > > bool userGestureRequiredForSpeechStart() const { return m_restrictions & RequireUserGestureForSpeechStartRestriction; } > void removeBehaviorRestriction(BehaviorRestrictions restriction) { m_restrictions &= ~restriction; } >-#endif >+ >+ ScriptExecutionContext* scriptExecutionContext() const final { return ContextDestructionObserver::scriptExecutionContext(); } >+ EventTargetInterface eventTargetInterface() const final { return SpeechSynthesisEventTargetInterfaceType; } >+ void refEventTarget() final { ref(); } >+ void derefEventTarget() final { deref(); } >+ > PlatformSpeechSynthesizer& ensurePlatformSpeechSynthesizer(); > > std::unique_ptr<PlatformSpeechSynthesizer> m_platformSpeechSynthesizer; >@@ -102,9 +113,7 @@ private: > RefPtr<SpeechSynthesisUtterance> m_currentSpeechUtterance; > Deque<Ref<SpeechSynthesisUtterance>> m_utteranceQueue; > bool m_isPaused; >-#if PLATFORM(IOS_FAMILY) > BehaviorRestrictions m_restrictions; >-#endif > WeakPtr<SpeechSynthesisClient> m_speechSynthesisClient; > }; > >diff --git a/Source/WebCore/Modules/speech/SpeechSynthesis.idl b/Source/WebCore/Modules/speech/SpeechSynthesis.idl >index f041890b1019..e913a63439f7 100644 >--- a/Source/WebCore/Modules/speech/SpeechSynthesis.idl >+++ b/Source/WebCore/Modules/speech/SpeechSynthesis.idl >@@ -24,15 +24,17 @@ > */ > > // https://wicg.github.io/speech-api/#speechsynthesis >-// FIXME: This is not specified as "LegacyNoInterfaceObject". It should have an interface object and be Exposed=Window. > [ > Conditional=SPEECH_SYNTHESIS, >- LegacyNoInterfaceObject, >-] interface SpeechSynthesis { >+ Exposed=Window, >+] interface SpeechSynthesis : EventTarget { >+ > readonly attribute boolean pending; > readonly attribute boolean speaking; > readonly attribute boolean paused; > >+ attribute EventHandler onvoiceschanged; >+ > undefined speak(SpeechSynthesisUtterance utterance); > undefined cancel(); > undefined pause(); >diff --git a/Source/WebCore/Modules/speech/SpeechSynthesisErrorCode.h b/Source/WebCore/Modules/speech/SpeechSynthesisErrorCode.h >new file mode 100644 >index 000000000000..8c310f88c881 >--- /dev/null >+++ b/Source/WebCore/Modules/speech/SpeechSynthesisErrorCode.h >@@ -0,0 +1,48 @@ >+/* >+ * Copyright (C) 2022 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 >+ >+#if ENABLE(SPEECH_SYNTHESIS) >+ >+namespace WebCore { >+ >+enum class SpeechSynthesisErrorCode { >+ Canceled, >+ Interrupted, >+ AudioBusy, >+ AudioHardware, >+ Network, >+ SynthesisUnavailable, >+ SynthesisFailed, >+ LanguageUnavailable, >+ VoiceUnavailable, >+ TextTooLong, >+ InvalidArgument, >+ NotAllowed >+}; >+ >+}; // namespace WebCore >+ >+#endif >diff --git a/Source/WebCore/Modules/speech/SpeechSynthesisErrorCode.idl b/Source/WebCore/Modules/speech/SpeechSynthesisErrorCode.idl >new file mode 100644 >index 000000000000..1135cd090434 >--- /dev/null >+++ b/Source/WebCore/Modules/speech/SpeechSynthesisErrorCode.idl >@@ -0,0 +1,41 @@ >+/* >+ * Copyright (C) 2022 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. ``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 >+ * 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. >+ */ >+ >+[ >+ Conditional=SPEECH_SYNTHESIS >+] enum SpeechSynthesisErrorCode { >+ "canceled", >+ "interrupted", >+ "audio-busy", >+ "audio-hardware", >+ "network", >+ "synthesis-unavailable", >+ "synthesis-failed", >+ "language-unavailable", >+ "voice-unavailable", >+ "text-too-long", >+ "invalid-argument", >+ "not-allowed" >+}; >diff --git a/Source/WebCore/Modules/speech/SpeechSynthesisErrorEvent.cpp b/Source/WebCore/Modules/speech/SpeechSynthesisErrorEvent.cpp >new file mode 100644 >index 000000000000..f24429718b4a >--- /dev/null >+++ b/Source/WebCore/Modules/speech/SpeechSynthesisErrorEvent.cpp >@@ -0,0 +1,50 @@ >+/* >+ * Copyright (C) 2022 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. ``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 >+ * 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 "SpeechSynthesisErrorEvent.h" >+ >+#if ENABLE(SPEECH_SYNTHESIS) >+ >+#include <wtf/IsoMallocInlines.h> >+ >+namespace WebCore { >+ >+WTF_MAKE_ISO_ALLOCATED_IMPL(SpeechSynthesisErrorEvent); >+ >+Ref<SpeechSynthesisErrorEvent> SpeechSynthesisErrorEvent::create(const AtomString& type, const SpeechSynthesisErrorEventInit& initializer) >+{ >+ return adoptRef(*new SpeechSynthesisErrorEvent(type, initializer)); >+} >+ >+SpeechSynthesisErrorEvent::SpeechSynthesisErrorEvent(const AtomString& type, const SpeechSynthesisErrorEventInit& initializer) >+ : SpeechSynthesisEvent(type, initializer) >+ , m_error(initializer.error) >+{ >+} >+ >+} // namespace WebCore >+ >+#endif // ENABLE(SPEECH_SYNTHESIS) >diff --git a/Source/WebCore/Modules/speech/SpeechSynthesisErrorEvent.h b/Source/WebCore/Modules/speech/SpeechSynthesisErrorEvent.h >new file mode 100644 >index 000000000000..9cef8745f32d >--- /dev/null >+++ b/Source/WebCore/Modules/speech/SpeechSynthesisErrorEvent.h >@@ -0,0 +1,54 @@ >+/* >+ * Copyright (C) 2022 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. ``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 >+ * 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 >+ >+#if ENABLE(SPEECH_SYNTHESIS) >+ >+#include "SpeechSynthesisErrorCode.h" >+#include "SpeechSynthesisErrorEventInit.h" >+#include "SpeechSynthesisEvent.h" >+ >+namespace WebCore { >+ >+class SpeechSynthesisErrorEvent final : public SpeechSynthesisEvent { >+ WTF_MAKE_ISO_ALLOCATED(SpeechSynthesisErrorEvent); >+public: >+ >+ static Ref<SpeechSynthesisErrorEvent> create(const AtomString& type, const SpeechSynthesisErrorEventInit&); >+ >+ SpeechSynthesisErrorCode error() const { return m_error; } >+ >+ virtual EventInterface eventInterface() const { return SpeechSynthesisErrorEventInterfaceType; } >+ >+private: >+ SpeechSynthesisErrorEvent(const AtomString& type, const SpeechSynthesisErrorEventInit&); >+ >+ SpeechSynthesisErrorCode m_error; >+}; >+ >+} // namespace WebCore >+ >+#endif // ENABLE(SPEECH_SYNTHESIS) >diff --git a/Source/WebCore/Modules/speech/SpeechSynthesisErrorEvent.idl b/Source/WebCore/Modules/speech/SpeechSynthesisErrorEvent.idl >new file mode 100644 >index 000000000000..fbf57edb3ff5 >--- /dev/null >+++ b/Source/WebCore/Modules/speech/SpeechSynthesisErrorEvent.idl >@@ -0,0 +1,34 @@ >+/* >+ * Copyright (C) 2022 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. ``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 >+ * 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. >+ */ >+ >+// https://wicg.github.io/speech-api/#speechsynthesiserrorevent >+[ >+ Conditional=SPEECH_SYNTHESIS, >+ Exposed=Window >+] interface SpeechSynthesisErrorEvent : SpeechSynthesisEvent { >+ constructor(DOMString type, SpeechSynthesisErrorEventInit eventInitDict); >+ >+ readonly attribute SpeechSynthesisErrorCode error; >+}; >diff --git a/Source/WebCore/Modules/speech/SpeechSynthesisErrorEventInit.h b/Source/WebCore/Modules/speech/SpeechSynthesisErrorEventInit.h >new file mode 100644 >index 000000000000..2472c2553193 >--- /dev/null >+++ b/Source/WebCore/Modules/speech/SpeechSynthesisErrorEventInit.h >@@ -0,0 +1,40 @@ >+/* >+ * Copyright (C) 2022 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. ``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 >+ * 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 >+ >+#if ENABLE(SPEECH_SYNTHESIS) >+ >+#include "SpeechSynthesisEventInit.h" >+ >+namespace WebCore { >+ >+struct SpeechSynthesisErrorEventInit : SpeechSynthesisEventInit { >+ SpeechSynthesisErrorCode error; >+}; >+ >+} // namespace WebCore >+ >+#endif // ENABLE(SPEECH_SYNTHESIS) >diff --git a/Source/WebCore/Modules/speech/SpeechSynthesisErrorEventInit.idl b/Source/WebCore/Modules/speech/SpeechSynthesisErrorEventInit.idl >new file mode 100644 >index 000000000000..0e2bf0595b9d >--- /dev/null >+++ b/Source/WebCore/Modules/speech/SpeechSynthesisErrorEventInit.idl >@@ -0,0 +1,30 @@ >+/* >+ * Copyright (C) 2022 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. ``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 >+ * 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. >+ */ >+ >+[ >+ Conditional=SPEECH_SYNTHESIS >+] dictionary SpeechSynthesisErrorEventInit : SpeechSynthesisEventInit { >+ required SpeechSynthesisErrorCode error; >+}; >diff --git a/Source/WebCore/Modules/speech/SpeechSynthesisEvent.cpp b/Source/WebCore/Modules/speech/SpeechSynthesisEvent.cpp >index e2a3fe0a0ad5..15d4125d8a70 100644 >--- a/Source/WebCore/Modules/speech/SpeechSynthesisEvent.cpp >+++ b/Source/WebCore/Modules/speech/SpeechSynthesisEvent.cpp >@@ -34,16 +34,18 @@ namespace WebCore { > > WTF_MAKE_ISO_ALLOCATED_IMPL(SpeechSynthesisEvent); > >-Ref<SpeechSynthesisEvent> SpeechSynthesisEvent::create(const AtomString& type, unsigned charIndex, float elapsedTime, const String& name) >+Ref<SpeechSynthesisEvent> SpeechSynthesisEvent::create(const AtomString& type, const SpeechSynthesisEventInit& initializer) > { >- return adoptRef(*new SpeechSynthesisEvent(type, charIndex, elapsedTime, name)); >+ return adoptRef(*new SpeechSynthesisEvent(type, initializer)); > } > >-SpeechSynthesisEvent::SpeechSynthesisEvent(const AtomString& type, unsigned charIndex, float elapsedTime, const String& name) >+SpeechSynthesisEvent::SpeechSynthesisEvent(const AtomString& type, const SpeechSynthesisEventInit& initializer) > : Event(type, CanBubble::No, IsCancelable::No) >- , m_charIndex(charIndex) >- , m_elapsedTime(elapsedTime) >- , m_name(name) >+ , m_utterance(initializer.utterance) >+ , m_charIndex(initializer.charIndex) >+ , m_charLength(initializer.charLength) >+ , m_elapsedTime(initializer.elapsedTime) >+ , m_name(initializer.name) > { > } > >diff --git a/Source/WebCore/Modules/speech/SpeechSynthesisEvent.h b/Source/WebCore/Modules/speech/SpeechSynthesisEvent.h >index 3c16c3ef8767..f4090d3944ba 100644 >--- a/Source/WebCore/Modules/speech/SpeechSynthesisEvent.h >+++ b/Source/WebCore/Modules/speech/SpeechSynthesisEvent.h >@@ -28,24 +28,32 @@ > #if ENABLE(SPEECH_SYNTHESIS) > > #include "Event.h" >+#include "SpeechSynthesisEventInit.h" >+#include "SpeechSynthesisUtterance.h" > > namespace WebCore { > >-class SpeechSynthesisEvent final : public Event { >+class SpeechSynthesisEvent : public Event { > WTF_MAKE_ISO_ALLOCATED(SpeechSynthesisEvent); > public: >- static Ref<SpeechSynthesisEvent> create(const AtomString& type, unsigned charIndex, float elapsedTime, const String& name); >+ >+ static Ref<SpeechSynthesisEvent> create(const AtomString& type, const SpeechSynthesisEventInit&); > >+ const SpeechSynthesisUtterance* utterance() const { return m_utterance.get(); } > unsigned long charIndex() const { return m_charIndex; } >+ unsigned long charLength() const { return m_charLength; } > float elapsedTime() const { return m_elapsedTime; } > const String& name() const { return m_name; } > > virtual EventInterface eventInterface() const { return SpeechSynthesisEventInterfaceType; } > >-private: >- SpeechSynthesisEvent(const AtomString& type, unsigned charIndex, float elapsedTime, const String& name); >+protected: >+ SpeechSynthesisEvent(const AtomString& type, const SpeechSynthesisEventInit&); > >+private: >+ RefPtr<SpeechSynthesisUtterance> m_utterance; > unsigned long m_charIndex; >+ unsigned long m_charLength; > float m_elapsedTime; > String m_name; > }; >diff --git a/Source/WebCore/Modules/speech/SpeechSynthesisEvent.idl b/Source/WebCore/Modules/speech/SpeechSynthesisEvent.idl >index a1262fee8e07..8e41ffbd4c13 100644 >--- a/Source/WebCore/Modules/speech/SpeechSynthesisEvent.idl >+++ b/Source/WebCore/Modules/speech/SpeechSynthesisEvent.idl >@@ -20,7 +20,7 @@ > * 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. >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > */ > > // https://wicg.github.io/speech-api/#speechsynthesisevent >@@ -28,7 +28,11 @@ > Conditional=SPEECH_SYNTHESIS, > Exposed=Window > ] interface SpeechSynthesisEvent : Event { >+ constructor(DOMString type, SpeechSynthesisEventInit eventInitDict); >+ >+ readonly attribute SpeechSynthesisUtterance utterance; > readonly attribute unsigned long charIndex; >+ readonly attribute unsigned long charLength; > readonly attribute unrestricted float elapsedTime; > readonly attribute DOMString name; > }; >diff --git a/Source/WebCore/Modules/speech/SpeechSynthesisEventInit.h b/Source/WebCore/Modules/speech/SpeechSynthesisEventInit.h >new file mode 100644 >index 000000000000..25e5a7d05a7e >--- /dev/null >+++ b/Source/WebCore/Modules/speech/SpeechSynthesisEventInit.h >@@ -0,0 +1,61 @@ >+/* >+ * Copyright (C) 2013 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. ``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 >+ * 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 >+ >+#if ENABLE(SPEECH_SYNTHESIS) >+ >+#include "EventInit.h" >+#include "SpeechSynthesisUtterance.h" >+ >+namespace WebCore { >+ >+struct SpeechSynthesisEventInit : EventInit { >+ >+ // Generated code expects a default constructor >+ SpeechSynthesisEventInit() >+ : EventInit() >+ , utterance(nullptr) >+ { } >+ >+ SpeechSynthesisEventInit(SpeechSynthesisUtterance* utterance, unsigned long charIndex, unsigned long charLength, float elapsedTime, const String& name) >+ : EventInit() >+ , utterance(utterance) >+ , charIndex(charIndex) >+ , charLength(charLength) >+ , elapsedTime(elapsedTime) >+ , name(name) >+ { } >+ >+ RefPtr<SpeechSynthesisUtterance> utterance; >+ unsigned long charIndex; >+ unsigned long charLength; >+ float elapsedTime; >+ String name; >+}; >+ >+} // namespace WebCore >+ >+#endif // ENABLE(SPEECH_SYNTHESIS) >diff --git a/Source/WebCore/Modules/speech/SpeechSynthesisEventInit.idl b/Source/WebCore/Modules/speech/SpeechSynthesisEventInit.idl >new file mode 100644 >index 000000000000..c92f3a14673e >--- /dev/null >+++ b/Source/WebCore/Modules/speech/SpeechSynthesisEventInit.idl >@@ -0,0 +1,35 @@ >+/* >+ * Copyright (C) 2022 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. ``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 >+ * 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. >+ */ >+ >+// https://wicg.github.io/speech-api/#speechsynthesiseventinit >+[ >+ Conditional=SPEECH_SYNTHESIS >+] dictionary SpeechSynthesisEventInit : EventInit { >+ required SpeechSynthesisUtterance utterance; >+ unsigned long charIndex = 0; >+ unsigned long charLength = 0; >+ float elapsedTime = 0; >+ DOMString name = ""; >+}; >diff --git a/Source/WebCore/Modules/speech/SpeechSynthesisUtterance.cpp b/Source/WebCore/Modules/speech/SpeechSynthesisUtterance.cpp >index 07aae892e2c1..66a45fb91526 100644 >--- a/Source/WebCore/Modules/speech/SpeechSynthesisUtterance.cpp >+++ b/Source/WebCore/Modules/speech/SpeechSynthesisUtterance.cpp >@@ -40,8 +40,8 @@ Ref<SpeechSynthesisUtterance> SpeechSynthesisUtterance::create(ScriptExecutionCo > } > > SpeechSynthesisUtterance::SpeechSynthesisUtterance(ScriptExecutionContext& context, const String& text) >- : ContextDestructionObserver(&context) >- , m_platformUtterance(PlatformSpeechSynthesisUtterance::create(*this)) >+ : m_platformUtterance(PlatformSpeechSynthesisUtterance::create(*this)) >+ , m_scriptExecutionContext(context) > { > m_platformUtterance->setText(text); > } >diff --git a/Source/WebCore/Modules/speech/SpeechSynthesisUtterance.h b/Source/WebCore/Modules/speech/SpeechSynthesisUtterance.h >index 1c1f59ec2776..2573e507670c 100644 >--- a/Source/WebCore/Modules/speech/SpeechSynthesisUtterance.h >+++ b/Source/WebCore/Modules/speech/SpeechSynthesisUtterance.h >@@ -35,10 +35,13 @@ > > namespace WebCore { > >-class SpeechSynthesisUtterance final : public PlatformSpeechSynthesisUtteranceClient, public RefCounted<SpeechSynthesisUtterance>, public ContextDestructionObserver, public EventTargetWithInlineData { >+class SpeechSynthesisUtterance final : public PlatformSpeechSynthesisUtteranceClient, public RefCounted<SpeechSynthesisUtterance>, public EventTargetWithInlineData { > WTF_MAKE_ISO_ALLOCATED(SpeechSynthesisUtterance); > public: > static Ref<SpeechSynthesisUtterance> create(ScriptExecutionContext&, const String&); >+ >+ // Create an empty default constructor so SpeechSynthesisEventInit compiles. >+ SpeechSynthesisUtterance(); > > virtual ~SpeechSynthesisUtterance(); > >@@ -68,16 +71,19 @@ public: > > PlatformSpeechSynthesisUtterance* platformUtterance() const { return m_platformUtterance.get(); } > >+ SpeechSynthesisUtterance(const SpeechSynthesisUtterance&); >+ > private: > SpeechSynthesisUtterance(ScriptExecutionContext&, const String&); > >- ScriptExecutionContext* scriptExecutionContext() const final { return ContextDestructionObserver::scriptExecutionContext(); } >+ ScriptExecutionContext* scriptExecutionContext() const final { return &m_scriptExecutionContext; } > EventTargetInterface eventTargetInterface() const final { return SpeechSynthesisUtteranceEventTargetInterfaceType; } > void refEventTarget() final { ref(); } > void derefEventTarget() final { deref(); } > > RefPtr<PlatformSpeechSynthesisUtterance> m_platformUtterance; > RefPtr<SpeechSynthesisVoice> m_voice; >+ ScriptExecutionContext& m_scriptExecutionContext; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/Modules/speech/SpeechSynthesisVoice.idl b/Source/WebCore/Modules/speech/SpeechSynthesisVoice.idl >index 389cae5e6c3d..7f9197d1869e 100644 >--- a/Source/WebCore/Modules/speech/SpeechSynthesisVoice.idl >+++ b/Source/WebCore/Modules/speech/SpeechSynthesisVoice.idl >@@ -24,10 +24,9 @@ > */ > > // https://wicg.github.io/speech-api/#speechsynthesisvoice >-// FIXME: This is not specified as "LegacyNoInterfaceObject". It should have an interface object and be Exposed=Window. > [ >- LegacyNoInterfaceObject, >- Conditional=SPEECH_SYNTHESIS >+ Conditional=SPEECH_SYNTHESIS, >+ Exposed=Window > ] interface SpeechSynthesisVoice { > readonly attribute DOMString voiceURI; > readonly attribute DOMString name; >diff --git a/Source/WebCore/Sources.txt b/Source/WebCore/Sources.txt >index d1e1a03d1b3f..043a9332a32d 100644 >--- a/Source/WebCore/Sources.txt >+++ b/Source/WebCore/Sources.txt >@@ -285,6 +285,7 @@ Modules/speech/SpeechRecognitionCaptureSourceImpl.cpp > Modules/speech/SpeechRecognizer.cpp > Modules/speech/DOMWindowSpeechSynthesis.cpp > Modules/speech/SpeechSynthesis.cpp >+Modules/speech/SpeechSynthesisErrorEvent.cpp > Modules/speech/SpeechSynthesisEvent.cpp > Modules/speech/SpeechSynthesisUtterance.cpp > Modules/speech/SpeechSynthesisVoice.cpp >@@ -3897,7 +3898,11 @@ JSSpeechRecognitionEvent.cpp > JSSpeechRecognitionResult.cpp > JSSpeechRecognitionResultList.cpp > JSSpeechSynthesis.cpp >+JSSpeechSynthesisErrorCode.cpp >+JSSpeechSynthesisErrorEvent.cpp >+JSSpeechSynthesisErrorEventInit.cpp > JSSpeechSynthesisEvent.cpp >+JSSpeechSynthesisEventInit.cpp > JSSpeechSynthesisUtterance.cpp > JSSpeechSynthesisVoice.cpp > JSStereoPannerNode.cpp >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index fa699fbed61d..3b2e764c7416 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -7979,6 +7979,15 @@ > 29D7BCF91444AF7D0070619C /* AccessibilitySpinButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilitySpinButton.h; sourceTree = "<group>"; }; > 29E04A27BED2F81F98E9022B /* JSBeforeUnloadEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSBeforeUnloadEvent.h; sourceTree = "<group>"; }; > 29E4D8DF16B0940F00C84704 /* PlatformSpeechSynthesizer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PlatformSpeechSynthesizer.h; sourceTree = "<group>"; }; >+ 29F83EC327D315A200E1F0FD /* SpeechSynthesisErrorEvent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SpeechSynthesisErrorEvent.h; sourceTree = "<group>"; }; >+ 29F83EC427D315A200E1F0FD /* SpeechSynthesisErrorEvent.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = SpeechSynthesisErrorEvent.cpp; sourceTree = "<group>"; }; >+ 29F83EC527D315B800E1F0FD /* SpeechSynthesisErrorEvent.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = SpeechSynthesisErrorEvent.idl; sourceTree = "<group>"; }; >+ 29F83EC627D3192600E1F0FD /* SpeechSynthesisErrorCode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SpeechSynthesisErrorCode.h; sourceTree = "<group>"; }; >+ 29F83EC927D594E500E1F0FD /* SpeechSynthesisEventInit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SpeechSynthesisEventInit.h; sourceTree = "<group>"; }; >+ 29F83ECB27D5952600E1F0FD /* SpeechSynthesisEventInit.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = SpeechSynthesisEventInit.idl; sourceTree = "<group>"; }; >+ 29F83ECE27D5FA6300E1F0FD /* SpeechSynthesisErrorCode.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = SpeechSynthesisErrorCode.idl; sourceTree = "<group>"; }; >+ 29F83ECF27D6C72A00E1F0FD /* SpeechSynthesisErrorEventInit.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = SpeechSynthesisErrorEventInit.idl; sourceTree = "<group>"; }; >+ 29F83ED027D6C88500E1F0FD /* SpeechSynthesisErrorEventInit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SpeechSynthesisErrorEventInit.h; sourceTree = "<group>"; }; > 29FAF4B5195AB08900A522DC /* TextUndoInsertionMarkupMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextUndoInsertionMarkupMac.h; sourceTree = "<group>"; }; > 2A4107A026CB66ED003BF797 /* CSSKeywordValue.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CSSKeywordValue.cpp; sourceTree = "<group>"; }; > 2A4107A226CB66ED003BF797 /* CSSKeywordValue.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = CSSKeywordValue.idl; sourceTree = "<group>"; }; >@@ -28177,6 +28186,15 @@ > AA2A5AC016A485D500975A25 /* SpeechSynthesisEvent.cpp */, > AA2A5AC116A485D500975A25 /* SpeechSynthesisEvent.h */, > AA2A5AC216A485D500975A25 /* SpeechSynthesisEvent.idl */, >+ 29F83EC927D594E500E1F0FD /* SpeechSynthesisEventInit.h */, >+ 29F83ECB27D5952600E1F0FD /* SpeechSynthesisEventInit.idl */, >+ 29F83EC627D3192600E1F0FD /* SpeechSynthesisErrorCode.h */, >+ 29F83ECE27D5FA6300E1F0FD /* SpeechSynthesisErrorCode.idl */, >+ 29F83EC427D315A200E1F0FD /* SpeechSynthesisErrorEvent.cpp */, >+ 29F83EC327D315A200E1F0FD /* SpeechSynthesisErrorEvent.h */, >+ 29F83EC527D315B800E1F0FD /* SpeechSynthesisErrorEvent.idl */, >+ 29F83ECF27D6C72A00E1F0FD /* SpeechSynthesisErrorEventInit.idl */, >+ 29F83ED027D6C88500E1F0FD /* SpeechSynthesisErrorEventInit.h */, > AA2A5AC416A485D500975A25 /* SpeechSynthesisUtterance.cpp */, > AA2A5AC516A485D500975A25 /* SpeechSynthesisUtterance.h */, > AA2A5AC316A485D500975A25 /* SpeechSynthesisUtterance.idl */, >diff --git a/Source/WebCore/dom/EventNames.h b/Source/WebCore/dom/EventNames.h >index 3a7fb6cb8e13..0f42362e0461 100644 >--- a/Source/WebCore/dom/EventNames.h >+++ b/Source/WebCore/dom/EventNames.h >@@ -299,6 +299,7 @@ namespace WebCore { > macro(validatemerchant) \ > macro(versionchange) \ > macro(visibilitychange) \ >+ macro(voiceschanged) \ > macro(volumechange) \ > macro(waiting) \ > macro(waitingforkey) \ >diff --git a/Source/WebCore/dom/EventNames.in b/Source/WebCore/dom/EventNames.in >index c6e44c615d23..17840ba42378 100644 >--- a/Source/WebCore/dom/EventNames.in >+++ b/Source/WebCore/dom/EventNames.in >@@ -70,6 +70,7 @@ RTCTrackEvent conditional=WEB_RTC > RTCTransformEvent conditional=WEB_RTC > SpeechRecognitionErrorEvent > SpeechRecognitionEvent >+SpeechSynthesisErrorEvent conditional=SPEECH_SYNTHESIS > SpeechSynthesisEvent conditional=SPEECH_SYNTHESIS > WebGLContextEvent conditional=WEBGL > StorageEvent >diff --git a/Source/WebCore/dom/EventTargetFactory.in b/Source/WebCore/dom/EventTargetFactory.in >index cac1a68cfee3..8c3ff7486b85 100644 >--- a/Source/WebCore/dom/EventTargetFactory.in >+++ b/Source/WebCore/dom/EventTargetFactory.in >@@ -56,6 +56,7 @@ SharedWorkerGlobalScope > SourceBuffer conditional=MEDIA_SOURCE > SourceBufferList conditional=MEDIA_SOURCE > SpeechRecognition >+SpeechSynthesis conditional=SPEECH_SYNTHESIS > SpeechSynthesisUtterance conditional=SPEECH_SYNTHESIS > TextTrack conditional=VIDEO > TextTrackCue conditional=VIDEO >diff --git a/Source/WebCore/page/SpeechSynthesisClient.h b/Source/WebCore/page/SpeechSynthesisClient.h >index 40329ad04ae2..bd7922280462 100644 >--- a/Source/WebCore/page/SpeechSynthesisClient.h >+++ b/Source/WebCore/page/SpeechSynthesisClient.h >@@ -60,7 +60,7 @@ public: > virtual void didPauseSpeaking() = 0; > virtual void didResumeSpeaking() = 0; > virtual void speakingErrorOccurred() = 0; >- virtual void boundaryEventOccurred(bool wordBoundary, unsigned charIndex) = 0; >+ virtual void boundaryEventOccurred(bool wordBoundary, unsigned charIndex, unsigned charLength) = 0; > virtual void voicesChanged() = 0; > }; > >diff --git a/Source/WebCore/platform/PlatformSpeechSynthesizer.h b/Source/WebCore/platform/PlatformSpeechSynthesizer.h >index 23a0f29129f1..ac081b30b3af 100644 >--- a/Source/WebCore/platform/PlatformSpeechSynthesizer.h >+++ b/Source/WebCore/platform/PlatformSpeechSynthesizer.h >@@ -52,7 +52,7 @@ public: > virtual void didPauseSpeaking(PlatformSpeechSynthesisUtterance&) = 0; > virtual void didResumeSpeaking(PlatformSpeechSynthesisUtterance&) = 0; > virtual void speakingErrorOccurred(PlatformSpeechSynthesisUtterance&) = 0; >- virtual void boundaryEventOccurred(PlatformSpeechSynthesisUtterance&, SpeechBoundary, unsigned charIndex) = 0; >+ virtual void boundaryEventOccurred(PlatformSpeechSynthesisUtterance&, SpeechBoundary, unsigned charIndex, unsigned charLength) = 0; > virtual void voicesDidChange() = 0; > protected: > virtual ~PlatformSpeechSynthesizerClient() = default; >diff --git a/Source/WebCore/platform/cocoa/PlatformSpeechSynthesizerCocoa.mm b/Source/WebCore/platform/cocoa/PlatformSpeechSynthesizerCocoa.mm >index c2ba5329b004..1c8f5b309cd1 100644 >--- a/Source/WebCore/platform/cocoa/PlatformSpeechSynthesizerCocoa.mm >+++ b/Source/WebCore/platform/cocoa/PlatformSpeechSynthesizerCocoa.mm >@@ -257,7 +257,7 @@ static float getAVSpeechUtteranceMaximumSpeechRate() > return; > > // AVSpeechSynthesizer only supports word boundaries. >- m_synthesizerObject->client()->boundaryEventOccurred(*m_utterance, WebCore::SpeechBoundary::SpeechWordBoundary, characterRange.location); >+ m_synthesizerObject->client()->boundaryEventOccurred(*m_utterance, WebCore::SpeechBoundary::SpeechWordBoundary, characterRange.location, characterRange.length); > } > > @end >@@ -281,7 +281,6 @@ void PlatformSpeechSynthesizer::initializeVoiceList() > bool isDefault = true; > NSString *voiceURI = [voice identifier]; > NSString *name = [voice name]; >- > // Only show built-in voices when requesting through WebKit to reduce fingerprinting surface area. > #if HAVE(AVSPEECHSYNTHESIS_SYSTEMVOICE) > // FIXME: Remove respondsToSelector check when is available on all SDKs. >diff --git a/Source/WebCore/platform/mock/PlatformSpeechSynthesizerMock.cpp b/Source/WebCore/platform/mock/PlatformSpeechSynthesizerMock.cpp >index 69919cde9842..f06e738c8197 100644 >--- a/Source/WebCore/platform/mock/PlatformSpeechSynthesizerMock.cpp >+++ b/Source/WebCore/platform/mock/PlatformSpeechSynthesizerMock.cpp >@@ -62,8 +62,8 @@ void PlatformSpeechSynthesizerMock::speak(RefPtr<PlatformSpeechSynthesisUtteranc > client()->didStartSpeaking(*m_utterance); > > // Fire a fake word and then sentence boundary event. >- client()->boundaryEventOccurred(*m_utterance, SpeechBoundary::SpeechWordBoundary, 0); >- client()->boundaryEventOccurred(*m_utterance, SpeechBoundary::SpeechSentenceBoundary, m_utterance->text().length()); >+ client()->boundaryEventOccurred(*m_utterance, SpeechBoundary::SpeechWordBoundary, 0, 3); >+ client()->boundaryEventOccurred(*m_utterance, SpeechBoundary::SpeechSentenceBoundary, 0, m_utterance->text().length()); > > // Give the fake speech job some time so that pause and other functions have time to be called. > m_speakingFinishedTimer.startOneShot(100_ms);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 237614
:
454172
|
454176
|
454199
|
454200
|
454201
|
454202
|
454203
|
454204
|
454205
|
454242
|
454247
|
454250
|
454281
|
454283
|
454287
|
454293