Changeset 284742 in webkit
- Timestamp:
- Oct 23, 2021, 12:46:34 AM (5 years ago)
- Location:
- trunk/Source
- Files:
-
- 2 deleted
- 10 edited
- 1 moved
-
WTF/ChangeLog (modified) (1 diff)
-
WTF/wtf/PlatformHave.h (modified) (2 diffs)
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/PAL/ChangeLog (modified) (1 diff)
-
WebCore/PAL/PAL.xcodeproj/project.pbxproj (modified) (4 diffs)
-
WebCore/PAL/pal/cocoa/AVFoundationSoftLink.h (modified) (1 diff)
-
WebCore/PAL/pal/cocoa/AVFoundationSoftLink.mm (modified) (1 diff)
-
WebCore/PAL/pal/spi/cocoa/AXSpeechManagerSPI.h (modified) (2 diffs)
-
WebCore/PAL/pal/spi/mac/SpeechSynthesisSPI.h (deleted)
-
WebCore/SourcesCocoa.txt (modified) (3 diffs)
-
WebCore/WebCore.xcodeproj/project.pbxproj (modified) (7 diffs)
-
WebCore/platform/cocoa/PlatformSpeechSynthesizerCocoa.mm (moved) (moved from trunk/Source/WebCore/platform/ios/PlatformSpeechSynthesizerIOS.mm ) (7 diffs)
-
WebCore/platform/mac/PlatformSpeechSynthesizerMac.mm (deleted)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r284725 r284742 1 2021-10-23 Chris Fleizach <cfleizach@apple.com> 2 3 AX: Unify speech synthesizer platform usage for Mac/iOS 4 https://bugs.webkit.org/show_bug.cgi?id=231895 5 <rdar://problem/84372479> 6 7 Reviewed by Andres Gonzalez. 8 9 * wtf/PlatformHave.h: 10 1 11 2021-10-22 Joonghun Park <pjh0718@gmail.com> 2 12 -
trunk/Source/WTF/wtf/PlatformHave.h
r284439 r284742 761 761 #endif 762 762 763 #if ( PLATFORM(IOS) || PLATFORM(MACCATALYST)) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140300763 #if ((PLATFORM(IOS) || PLATFORM(MACCATALYST)) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 140300) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED > 120000) 764 764 #if !defined(HAVE_AVSPEECHSYNTHESIS_SYSTEMVOICE) 765 765 #define HAVE_AVSPEECHSYNTHESIS_SYSTEMVOICE 1 … … 770 770 #if !defined(HAVE_TCC_IOS_14_BIG_SUR_SPI) 771 771 #define HAVE_TCC_IOS_14_BIG_SUR_SPI 1 772 #endif773 #endif774 775 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 120000776 #if !defined(HAVE_SPEECHSYNTHESIS_MONTEREY_SPI)777 #define HAVE_SPEECHSYNTHESIS_MONTEREY_SPI 1778 772 #endif 779 773 #endif -
trunk/Source/WebCore/ChangeLog
r284741 r284742 1 2021-10-23 Chris Fleizach <cfleizach@apple.com> 2 3 AX: Unify speech synthesizer platform usage for Mac/iOS 4 https://bugs.webkit.org/show_bug.cgi?id=231895 5 <rdar://problem/84372479> 6 7 Reviewed by Andres Gonzalez. 8 9 AVSpeechSynthesizer has been fully supported on macOS for a number of years. This allows us to unify platform usage. 10 11 * SourcesCocoa.txt: 12 * WebCore.xcodeproj/project.pbxproj: 13 * platform/cocoa/PlatformSpeechSynthesizerCocoa.mm: Renamed from Source/WebCore/platform/ios/PlatformSpeechSynthesizerIOS.mm. 14 (getAVSpeechUtteranceDefaultSpeechRate): 15 (getAVSpeechUtteranceMaximumSpeechRate): 16 (-[WebSpeechSynthesisWrapper initWithSpeechSynthesizer:]): 17 (-[WebSpeechSynthesisWrapper mapSpeechRateToPlatformRate:]): 18 (-[WebSpeechSynthesisWrapper speakUtterance:]): 19 (-[WebSpeechSynthesisWrapper pause]): 20 (-[WebSpeechSynthesisWrapper resume]): 21 (-[WebSpeechSynthesisWrapper cancel]): 22 (-[WebSpeechSynthesisWrapper speechSynthesizer:didStartSpeechUtterance:]): 23 (-[WebSpeechSynthesisWrapper speechSynthesizer:didFinishSpeechUtterance:]): 24 (-[WebSpeechSynthesisWrapper speechSynthesizer:didPauseSpeechUtterance:]): 25 (-[WebSpeechSynthesisWrapper speechSynthesizer:didContinueSpeechUtterance:]): 26 (-[WebSpeechSynthesisWrapper speechSynthesizer:didCancelSpeechUtterance:]): 27 (-[WebSpeechSynthesisWrapper speechSynthesizer:willSpeakRangeOfSpeechString:utterance:]): 28 (WebCore::PlatformSpeechSynthesizer::PlatformSpeechSynthesizer): 29 (WebCore::PlatformSpeechSynthesizer::~PlatformSpeechSynthesizer): 30 (WebCore::PlatformSpeechSynthesizer::initializeVoiceList): 31 (WebCore::PlatformSpeechSynthesizer::pause): 32 (WebCore::PlatformSpeechSynthesizer::resume): 33 (WebCore::PlatformSpeechSynthesizer::speak): 34 (WebCore::PlatformSpeechSynthesizer::cancel): 35 (WebCore::PlatformSpeechSynthesizer::resetState): 36 * platform/mac/PlatformSpeechSynthesizerMac.mm: Removed. 37 1 38 2021-10-22 Jean-Yves Avenard <jya@apple.com> 2 39 -
trunk/Source/WebCore/PAL/ChangeLog
r284626 r284742 1 2021-10-23 Chris Fleizach <cfleizach@apple.com> 2 3 AX: Unify speech synthesizer platform usage for Mac/iOS 4 https://bugs.webkit.org/show_bug.cgi?id=231895 5 <rdar://problem/84372479> 6 7 Reviewed by Andres Gonzalez. 8 9 * PAL.xcodeproj/project.pbxproj: 10 * pal/cocoa/AVFoundationSoftLink.h: 11 * pal/cocoa/AVFoundationSoftLink.mm: 12 * pal/spi/cocoa/AXSpeechManagerSPI.h: 13 * pal/spi/mac/SpeechSynthesisSPI.h: Removed. 14 1 15 2021-10-21 Aditya Keerthi <akeerthi@apple.com> 2 16 -
trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj
r284494 r284742 170 170 A10826FA1F576292004772AC /* WebPanel.mm in Sources */ = {isa = PBXBuildFile; fileRef = A10826F81F576292004772AC /* WebPanel.mm */; }; 171 171 A10826FE1F58A433004772AC /* NSGraphicsSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = A10826FD1F58A433004772AC /* NSGraphicsSPI.h */; }; 172 A1175B491F6AFF8E00C4B9F0 /* SpeechSynthesisSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = A1175B481F6AFF8E00C4B9F0 /* SpeechSynthesisSPI.h */; };173 172 A1175B4B1F6B2D7E00C4B9F0 /* NSCellSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = A1175B4A1F6B2D7E00C4B9F0 /* NSCellSPI.h */; }; 174 173 A1175B4E1F6B337300C4B9F0 /* PopupMenu.h in Headers */ = {isa = PBXBuildFile; fileRef = A1175B4C1F6B337300C4B9F0 /* PopupMenu.h */; }; … … 397 396 A10826F81F576292004772AC /* WebPanel.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = WebPanel.mm; sourceTree = "<group>"; }; 398 397 A10826FD1F58A433004772AC /* NSGraphicsSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NSGraphicsSPI.h; sourceTree = "<group>"; }; 399 A1175B481F6AFF8E00C4B9F0 /* SpeechSynthesisSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SpeechSynthesisSPI.h; sourceTree = "<group>"; };400 398 A1175B4A1F6B2D7E00C4B9F0 /* NSCellSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NSCellSPI.h; sourceTree = "<group>"; }; 401 399 A1175B4C1F6B337300C4B9F0 /* PopupMenu.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PopupMenu.h; sourceTree = "<group>"; }; … … 644 642 0C7785851F45130F00F4EBB6 /* PIPSPI.h */, 645 643 0C7785871F45130F00F4EBB6 /* QuickLookMacSPI.h */, 646 A1175B481F6AFF8E00C4B9F0 /* SpeechSynthesisSPI.h */,647 644 71B1141F26823ACD004D6701 /* SystemPreviewSPI.h */, 648 645 0C7785881F45130F00F4EBB6 /* TelephonyUtilitiesSPI.h */, … … 1013 1010 93B38EBE25821CB600198E63 /* SpeechSoftLink.h in Headers */, 1014 1011 93B38EC225821D2200198E63 /* SpeechSPI.h in Headers */, 1015 A1175B491F6AFF8E00C4B9F0 /* SpeechSynthesisSPI.h in Headers */,1016 1012 0C5AF9211F43A4C7002EAC02 /* SQLite3SPI.h in Headers */, 1017 1013 71B1142026823ACD004D6701 /* SystemPreviewSPI.h in Headers */, -
trunk/Source/WebCore/PAL/pal/cocoa/AVFoundationSoftLink.h
r283592 r284742 77 77 SOFT_LINK_CLASS_FOR_HEADER(PAL, AVAudioSession) 78 78 SOFT_LINK_CLASS_FOR_HEADER(PAL, AVPersistableContentKeyRequest) 79 #endif 80 81 #if PLATFORM(COCOA) 79 82 SOFT_LINK_CLASS_FOR_HEADER(PAL, AVSpeechSynthesisVoice) 80 83 SOFT_LINK_CLASS_FOR_HEADER(PAL, AVSpeechSynthesizer) -
trunk/Source/WebCore/PAL/pal/cocoa/AVFoundationSoftLink.mm
r283592 r284742 103 103 SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVAudioSession, PAL_EXPORT) 104 104 SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVPersistableContentKeyRequest, PAL_EXPORT) 105 #endif 106 107 #if PLATFORM(COCOA) 105 108 SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVSpeechSynthesisVoice, PAL_EXPORT) 106 109 SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVSpeechSynthesizer, PAL_EXPORT) -
trunk/Source/WebCore/PAL/pal/spi/cocoa/AXSpeechManagerSPI.h
r269232 r284742 26 26 #pragma once 27 27 28 #if PLATFORM( IOS_FAMILY)28 #if PLATFORM(COCOA) 29 29 30 30 // FIXME: Undo when isSystemVoice is available in all SDKs. … … 43 43 #endif // USE(APPLE_INTERNAL_SDK) 44 44 45 #endif // PLATFORM( IOS_FAMILY)45 #endif // PLATFORM(COCOA) 46 46 -
trunk/Source/WebCore/SourcesCocoa.txt
r284383 r284742 257 257 platform/cocoa/PasteboardCustomDataCocoa.mm 258 258 platform/cocoa/PlatformPasteboardCocoa.mm 259 platform/cocoa/PlatformSpeechSynthesizerCocoa.mm @no-unify 259 260 platform/cocoa/PlaybackSessionModelMediaElement.mm 260 261 platform/cocoa/PowerSourceNotifier.mm … … 440 441 platform/ios/PlatformPasteboardIOS.mm 441 442 platform/ios/PlatformScreenIOS.mm 442 platform/ios/PlatformSpeechSynthesizerIOS.mm @no-unify443 443 platform/ios/PlaybackSessionInterfaceAVKit.mm @no-unify 444 444 platform/ios/PreviewConverterIOS.mm … … 487 487 platform/mac/PlatformPasteboardMac.mm 488 488 platform/mac/PlatformScreenMac.mm 489 platform/mac/PlatformSpeechSynthesizerMac.mm490 489 platform/mac/PlaybackSessionInterfaceMac.mm @no-unify 491 490 platform/mac/PluginBlocklist.mm -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r284718 r284742 3711 3711 A9D248070D757E7D00FDF959 /* JSDOMMimeType.h in Headers */ = {isa = PBXBuildFile; fileRef = A9D248030D757E7D00FDF959 /* JSDOMMimeType.h */; }; 3712 3712 A9D248090D757E7D00FDF959 /* JSDOMMimeTypeArray.h in Headers */ = {isa = PBXBuildFile; fileRef = A9D248050D757E7D00FDF959 /* JSDOMMimeTypeArray.h */; }; 3713 AA12DF491743DF83004DAFDF /* PlatformSpeechSynthesizer IOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = AAE3755D17429BCC006200C2 /* PlatformSpeechSynthesizerIOS.mm */; };3713 AA12DF491743DF83004DAFDF /* PlatformSpeechSynthesizerCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = AAE3755D17429BCC006200C2 /* PlatformSpeechSynthesizerCocoa.mm */; }; 3714 3714 AA21ECCD0ABF0FC6002B834C /* CSSCursorImageValue.h in Headers */ = {isa = PBXBuildFile; fileRef = AA0978EE0ABAA6E100874480 /* CSSCursorImageValue.h */; settings = {ATTRIBUTES = (Private, ); }; }; 3715 3715 AA2A5ACE16A485FD00975A25 /* SpeechSynthesisVoice.h in Headers */ = {isa = PBXBuildFile; fileRef = AA2A5AC716A485D500975A25 /* SpeechSynthesisVoice.h */; }; … … 7302 7302 29E04A27BED2F81F98E9022B /* JSBeforeUnloadEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSBeforeUnloadEvent.h; sourceTree = "<group>"; }; 7303 7303 29E4D8DF16B0940F00C84704 /* PlatformSpeechSynthesizer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PlatformSpeechSynthesizer.h; sourceTree = "<group>"; }; 7304 29E4D8E016B0959800C84704 /* PlatformSpeechSynthesizerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PlatformSpeechSynthesizerMac.mm; sourceTree = "<group>"; };7305 7304 29FAF4B5195AB08900A522DC /* TextUndoInsertionMarkupMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextUndoInsertionMarkupMac.h; sourceTree = "<group>"; }; 7306 7305 2A4107A026CB66ED003BF797 /* CSSKeywordValue.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CSSKeywordValue.cpp; sourceTree = "<group>"; }; … … 13631 13630 AAE27B7416CBFC0D00623043 /* PlatformSpeechSynthesizerMock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformSpeechSynthesizerMock.cpp; sourceTree = "<group>"; }; 13632 13631 AAE27B7516CBFC0D00623043 /* PlatformSpeechSynthesizerMock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformSpeechSynthesizerMock.h; sourceTree = "<group>"; }; 13633 AAE3755D17429BCC006200C2 /* PlatformSpeechSynthesizer IOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PlatformSpeechSynthesizerIOS.mm; sourceTree = "<group>"; };13632 AAE3755D17429BCC006200C2 /* PlatformSpeechSynthesizerCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PlatformSpeechSynthesizerCocoa.mm; sourceTree = "<group>"; }; 13634 13633 AAF5B7B11524B4BD0004CB49 /* WebSocketFrame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebSocketFrame.cpp; sourceTree = "<group>"; }; 13635 13634 AB23A32509BBA7D00067CC53 /* BeforeTextInsertedEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = BeforeTextInsertedEvent.cpp; sourceTree = "<group>"; }; … … 22392 22391 C5F765BA14E1ECF4006C899B /* PlatformPasteboardMac.mm */, 22393 22392 BC94D1070C274F88006BC617 /* PlatformScreenMac.mm */, 22394 29E4D8E016B0959800C84704 /* PlatformSpeechSynthesizerMac.mm */,22395 22393 CDA29A151CBDA56C00901CCF /* PlaybackSessionInterfaceMac.h */, 22396 22394 CDA29A141CBDA56C00901CCF /* PlaybackSessionInterfaceMac.mm */, … … 25063 25061 C5278B0B17F212EA003A2998 /* PlatformPasteboardIOS.mm */, 25064 25062 E45390320EAFD637003695C8 /* PlatformScreenIOS.mm */, 25065 AAE3755D17429BCC006200C2 /* PlatformSpeechSynthesizerIOS.mm */,25066 25063 CDA29A2E1CBF73FC00901CCF /* PlaybackSessionInterfaceAVKit.h */, 25067 25064 CDA29A2F1CBF73FC00901CCF /* PlaybackSessionInterfaceAVKit.mm */, … … 25222 25219 F4FB35002350C96200F0094A /* PasteboardCustomDataCocoa.mm */, 25223 25220 F4628A9E234D3BBF00BC884C /* PlatformPasteboardCocoa.mm */, 25221 AAE3755D17429BCC006200C2 /* PlatformSpeechSynthesizerCocoa.mm */, 25224 25222 52B0D4BD1C57FD1E0077CE53 /* PlatformView.h */, 25225 25223 CDA29A0A1CBD9A7400901CCF /* PlaybackSessionModel.h */, … … 36894 36892 E16982601134636A00894115 /* ObjCRuntimeObject.mm in Sources */, 36895 36893 CEA284662141E84900E407E8 /* PlatformEventFactoryIOS.mm in Sources */, 36896 AA12DF491743DF83004DAFDF /* PlatformSpeechSynthesizer IOS.mm in Sources */,36894 AA12DF491743DF83004DAFDF /* PlatformSpeechSynthesizerCocoa.mm in Sources */, 36897 36895 CDA29A301CBF74D400901CCF /* PlaybackSessionInterfaceAVKit.mm in Sources */, 36898 36896 CDA29A161CBDA56C00901CCF /* PlaybackSessionInterfaceMac.mm in Sources */, -
trunk/Source/WebCore/platform/cocoa/PlatformSpeechSynthesizerCocoa.mm
r284741 r284742 26 26 #import "PlatformSpeechSynthesizer.h" 27 27 28 #if ENABLE(SPEECH_SYNTHESIS) && PLATFORM( IOS_FAMILY)28 #if ENABLE(SPEECH_SYNTHESIS) && PLATFORM(COCOA) 29 29 30 30 #import "PlatformSpeechSynthesisUtterance.h" 31 31 #import "PlatformSpeechSynthesisVoice.h" 32 #import <AVFoundation/AVSpeechSynthesis.h> 32 33 #if __has_include(<AVFAudio/AVSpeechSynthesis.h>) 34 #import <AVFAudio/AVSpeechSynthesis.h> 35 #else 36 #import <AVFoundation/AVFoundation.h> 37 #endif 38 33 39 #import <pal/spi/cocoa/AXSpeechManagerSPI.h> 34 40 #import <wtf/BlockObjCExceptions.h> … … 64 70 #define AVSpeechUtteranceMaximumSpeechRate getAVSpeechUtteranceMaximumSpeechRate() 65 71 66 @interface WebSpeechSynthesisWrapper : NSObject<AVSpeechSynthesizerDelegate> 67 { 72 @interface WebSpeechSynthesisWrapper : NSObject<AVSpeechSynthesizerDelegate> { 68 73 WebCore::PlatformSpeechSynthesizer* m_synthesizerObject; 69 74 // Hold a Ref to the utterance so that it won't disappear until the synth is done with it. … … 192 197 193 198 // Clear the m_utterance variable in case finish speaking kicks off a new speaking job immediately. 194 RefPtr<WebCore::PlatformSpeechSynthesisUtterance> p latformUtterance = m_utterance;199 RefPtr<WebCore::PlatformSpeechSynthesisUtterance> protectedUtterance = m_utterance; 195 200 m_utterance = nullptr; 196 201 197 m_synthesizerObject->client()->didFinishSpeaking(*p latformUtterance);202 m_synthesizerObject->client()->didFinishSpeaking(*protectedUtterance); 198 203 } 199 204 … … 226 231 227 232 // Clear the m_utterance variable in case finish speaking kicks off a new speaking job immediately. 228 RefPtr<WebCore::PlatformSpeechSynthesisUtterance> p latformUtterance = m_utterance;233 RefPtr<WebCore::PlatformSpeechSynthesisUtterance> protectedUtterance = m_utterance; 229 234 m_utterance = nullptr; 230 235 231 m_synthesizerObject->client()->didFinishSpeaking(*p latformUtterance);236 m_synthesizerObject->client()->didFinishSpeaking(*protectedUtterance); 232 237 } 233 238 … … 240 245 return; 241 246 242 // iOSonly supports word boundaries.247 // AVSpeechSynthesizer only supports word boundaries. 243 248 m_synthesizerObject->client()->boundaryEventOccurred(*m_utterance, WebCore::SpeechBoundary::SpeechWordBoundary, characterRange.location); 244 249 } … … 276 281 if (includeVoice) 277 282 #else 278 if (voice.quality == AVSpeechSynthesisVoiceQualityDefault) 283 // AVSpeechSynthesis on macOS does not support quality property correctly. 284 if (voice.quality == AVSpeechSynthesisVoiceQualityDefault 285 || (TARGET_OS_OSX && ![voiceURI hasSuffix:@"premium"])) 279 286 #endif 280 287 m_voiceList.append(PlatformSpeechSynthesisVoice::create(voiceURI, name, language, true, isDefault)); … … 313 320 } // namespace WebCore 314 321 315 #endif // ENABLE(SPEECH_SYNTHESIS) && PLATFORM( IOS_FAMILY)322 #endif // ENABLE(SPEECH_SYNTHESIS) && PLATFORM(COCOA)
Note:
See TracChangeset
for help on using the changeset viewer.