Skip to content

Commit 1829f64

Browse files
committed
Initial import of upstream updated webspeech api
From c8a7a86 upstream commit.
1 parent 95fdba7 commit 1829f64

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+664
-65
lines changed

LayoutTests/ChangeLog

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
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+
* fast/speechsynthesis/speech-synthesis-boundary-events.html: Updated.
11+
* fast/speechsynthesis/speech-synthesis-boundary-events-expected.txt: Updated.
12+
113
2022-03-14 Enrique Ocaña González <eocanha@igalia.com>
214

315
[MSE][SourceBuffer] Fix removal of paddings from buffered range

LayoutTests/fast/speechsynthesis/speech-synthesis-boundary-events-expected.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
44

55

66
Speech started
7-
Boundary event: word, Character index: 0
8-
Boundary event: sentence, Character index: 14
7+
Boundary event: word, Character index: 0, length: 3
8+
Boundary event: sentence, Character index: 0, length: 14
99
PASS successfullyParsed is true
1010

1111
TEST COMPLETE

LayoutTests/fast/speechsynthesis/speech-synthesis-boundary-events.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
}
2626

2727
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}`);
2929
}
3030

3131
u.onend = function(event) {

Source/WebCore/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,11 @@ set(WebCore_NON_SVG_IDL_FILES
417417

418418
Modules/speech/DOMWindowSpeechSynthesis.idl
419419
Modules/speech/SpeechSynthesis.idl
420+
Modules/speech/SpeechSynthesisErrorCode.idl
421+
Modules/speech/SpeechSynthesisErrorEvent.idl
422+
Modules/speech/SpeechSynthesisErrorEventInit.idl
420423
Modules/speech/SpeechSynthesisEvent.idl
424+
Modules/speech/SpeechSynthesisEventInit.idl
421425
Modules/speech/SpeechSynthesisUtterance.idl
422426
Modules/speech/SpeechSynthesisVoice.idl
423427

Source/WebCore/ChangeLog

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,75 @@
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+
173
2022-05-06 Lauro Moura <lmoura@igalia.com>
274

375
[GLIB] Add Speech synthesis stubs

Source/WebCore/DerivedSources-input.xcfilelist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,11 @@ $(PROJECT_DIR)/Modules/remoteplayback/RemotePlayback.idl
259259
$(PROJECT_DIR)/Modules/remoteplayback/RemotePlaybackAvailabilityCallback.idl
260260
$(PROJECT_DIR)/Modules/speech/DOMWindowSpeechSynthesis.idl
261261
$(PROJECT_DIR)/Modules/speech/SpeechSynthesis.idl
262+
$(PROJECT_DIR)/Modules/speech/SpeechSynthesisErrorCode.idl
263+
$(PROJECT_DIR)/Modules/speech/SpeechSynthesisErrorEvent.idl
264+
$(PROJECT_DIR)/Modules/speech/SpeechSynthesisErrorEventInit.idl
262265
$(PROJECT_DIR)/Modules/speech/SpeechSynthesisEvent.idl
266+
$(PROJECT_DIR)/Modules/speech/SpeechSynthesisEventInit.idl
263267
$(PROJECT_DIR)/Modules/speech/SpeechSynthesisUtterance.idl
264268
$(PROJECT_DIR)/Modules/speech/SpeechSynthesisVoice.idl
265269
$(PROJECT_DIR)/Modules/streams/ByteLengthQueuingStrategy.idl

Source/WebCore/DerivedSources-output.xcfilelist

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1779,8 +1779,16 @@ $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSourceBufferList.cpp
17791779
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSourceBufferList.h
17801780
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechSynthesis.cpp
17811781
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechSynthesis.h
1782+
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechSynthesisErrorCode.cpp
1783+
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechSynthesisErrorCode.h
1784+
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechSynthesisErrorEvent.cpp
1785+
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechSynthesisErrorEvent.h
1786+
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechSynthesisErrorEventInit.cpp
1787+
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechSynthesisErrorEventInit.h
17821788
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechSynthesisEvent.cpp
17831789
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechSynthesisEvent.h
1790+
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechSynthesisEventInit.cpp
1791+
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechSynthesisEventInit.h
17841792
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechSynthesisUtterance.cpp
17851793
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechSynthesisUtterance.h
17861794
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSSpeechSynthesisVoice.cpp

Source/WebCore/DerivedSources.make

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,11 @@ JS_BINDING_IDLS = \
330330
$(WebCore)/Modules/remoteplayback/RemotePlaybackAvailabilityCallback.idl \
331331
$(WebCore)/Modules/speech/DOMWindowSpeechSynthesis.idl \
332332
$(WebCore)/Modules/speech/SpeechSynthesis.idl \
333+
$(WebCore)/Modules/speech/SpeechSynthesisErrorCode.idl \
334+
$(WebCore)/Modules/speech/SpeechSynthesisErrorEvent.idl \
335+
$(WebCore)/Modules/speech/SpeechSynthesisErrorEventInit.idl \
333336
$(WebCore)/Modules/speech/SpeechSynthesisEvent.idl \
337+
$(WebCore)/Modules/speech/SpeechSynthesisEventInit.idl \
334338
$(WebCore)/Modules/speech/SpeechSynthesisUtterance.idl \
335339
$(WebCore)/Modules/speech/SpeechSynthesisVoice.idl \
336340
$(WebCore)/Modules/streams/ByteLengthQueuingStrategy.idl \

Source/WebCore/Modules/credentialmanagement/BasicCredential.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727

2828
#if ENABLE(WEB_AUTHN)
2929

30+
#include "Document.h"
31+
#include "IDLTypes.h"
32+
#include "JSDOMPromiseDeferred.h"
3033
#include <wtf/RefCounted.h>
3134
#include <wtf/TypeCasts.h>
3235
#include <wtf/text/WTFString.h>

Source/WebCore/Modules/speech/DOMWindowSpeechSynthesis.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ SpeechSynthesis* DOMWindowSpeechSynthesis::speechSynthesis(DOMWindow& window)
7171
SpeechSynthesis* DOMWindowSpeechSynthesis::speechSynthesis()
7272
{
7373
if (!m_speechSynthesis && frame())
74-
m_speechSynthesis = SpeechSynthesis::create(makeWeakPtr(frame()->page()->speechSynthesisClient()));
74+
m_speechSynthesis = SpeechSynthesis::create(*frame()->document());
7575
return m_speechSynthesis.get();
7676
}
7777

0 commit comments

Comments
 (0)