⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 284822 in webkit


Ignore:
Timestamp:
Oct 25, 2021, 2:32:05 PM (5 years ago)
Author:
Ayumi Kojima
Message:

Unreviewed, reverting r284742.

Reverting because this commit may have casued a regression on
imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-
speak-events.html

Reverted changeset:

"AX: Unify speech synthesizer platform usage for Mac/iOS"
https://bugs.webkit.org/show_bug.cgi?id=231895
https://commits.webkit.org/r284742

Location:
trunk/Source
Files:
2 added
10 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r284763 r284822  
     12021-10-25  Ayumi Kojima  <ayumi_kojima@apple.com>
     2
     3        Unreviewed, reverting r284742.
     4
     5        Reverting because this commit may have casued a regression on
     6        imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-
     7        speak-events.html
     8
     9        Reverted changeset:
     10
     11        "AX: Unify speech synthesizer platform usage for Mac/iOS"
     12        https://bugs.webkit.org/show_bug.cgi?id=231895
     13        https://commits.webkit.org/r284742
     14
    1152021-10-24  Darin Adler  <darin@apple.com>
    216
  • trunk/Source/WTF/wtf/PlatformHave.h

    r284742 r284822  
    761761#endif
    762762
    763 #if ((PLATFORM(IOS) || PLATFORM(MACCATALYST)) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 140300) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED > 120000)
     763#if (PLATFORM(IOS) || PLATFORM(MACCATALYST)) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140300
    764764#if !defined(HAVE_AVSPEECHSYNTHESIS_SYSTEMVOICE)
    765765#define HAVE_AVSPEECHSYNTHESIS_SYSTEMVOICE 1
     
    770770#if !defined(HAVE_TCC_IOS_14_BIG_SUR_SPI)
    771771#define HAVE_TCC_IOS_14_BIG_SUR_SPI 1
     772#endif
     773#endif
     774
     775#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 120000
     776#if !defined(HAVE_SPEECHSYNTHESIS_MONTEREY_SPI)
     777#define HAVE_SPEECHSYNTHESIS_MONTEREY_SPI 1
    772778#endif
    773779#endif
  • trunk/Source/WebCore/ChangeLog

    r284821 r284822  
     12021-10-25  Ayumi Kojima  <ayumi_kojima@apple.com>
     2
     3        Unreviewed, reverting r284742.
     4
     5        Reverting because this commit may have casued a regression on
     6        imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-
     7        speak-events.html
     8
     9        Reverted changeset:
     10
     11        "AX: Unify speech synthesizer platform usage for Mac/iOS"
     12        https://bugs.webkit.org/show_bug.cgi?id=231895
     13        https://commits.webkit.org/r284742
     14
    1152021-10-25  Chris Dumez  <cdumez@apple.com>
    216
  • trunk/Source/WebCore/PAL/ChangeLog

    r284742 r284822  
     12021-10-25  Ayumi Kojima  <ayumi_kojima@apple.com>
     2
     3        Unreviewed, reverting r284742.
     4
     5        Reverting because this commit may have casued a regression on
     6        imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-
     7        speak-events.html
     8
     9        Reverted changeset:
     10
     11        "AX: Unify speech synthesizer platform usage for Mac/iOS"
     12        https://bugs.webkit.org/show_bug.cgi?id=231895
     13        https://commits.webkit.org/r284742
     14
    1152021-10-23  Chris Fleizach  <cfleizach@apple.com>
    216
  • trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj

    r284742 r284822  
    170170                A10826FA1F576292004772AC /* WebPanel.mm in Sources */ = {isa = PBXBuildFile; fileRef = A10826F81F576292004772AC /* WebPanel.mm */; };
    171171                A10826FE1F58A433004772AC /* NSGraphicsSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = A10826FD1F58A433004772AC /* NSGraphicsSPI.h */; };
     172                A1175B491F6AFF8E00C4B9F0 /* SpeechSynthesisSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = A1175B481F6AFF8E00C4B9F0 /* SpeechSynthesisSPI.h */; };
    172173                A1175B4B1F6B2D7E00C4B9F0 /* NSCellSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = A1175B4A1F6B2D7E00C4B9F0 /* NSCellSPI.h */; };
    173174                A1175B4E1F6B337300C4B9F0 /* PopupMenu.h in Headers */ = {isa = PBXBuildFile; fileRef = A1175B4C1F6B337300C4B9F0 /* PopupMenu.h */; };
     
    396397                A10826F81F576292004772AC /* WebPanel.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = WebPanel.mm; sourceTree = "<group>"; };
    397398                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>"; };
    398400                A1175B4A1F6B2D7E00C4B9F0 /* NSCellSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NSCellSPI.h; sourceTree = "<group>"; };
    399401                A1175B4C1F6B337300C4B9F0 /* PopupMenu.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PopupMenu.h; sourceTree = "<group>"; };
     
    642644                                0C7785851F45130F00F4EBB6 /* PIPSPI.h */,
    643645                                0C7785871F45130F00F4EBB6 /* QuickLookMacSPI.h */,
     646                                A1175B481F6AFF8E00C4B9F0 /* SpeechSynthesisSPI.h */,
    644647                                71B1141F26823ACD004D6701 /* SystemPreviewSPI.h */,
    645648                                0C7785881F45130F00F4EBB6 /* TelephonyUtilitiesSPI.h */,
     
    10101013                                93B38EBE25821CB600198E63 /* SpeechSoftLink.h in Headers */,
    10111014                                93B38EC225821D2200198E63 /* SpeechSPI.h in Headers */,
     1015                                A1175B491F6AFF8E00C4B9F0 /* SpeechSynthesisSPI.h in Headers */,
    10121016                                0C5AF9211F43A4C7002EAC02 /* SQLite3SPI.h in Headers */,
    10131017                                71B1142026823ACD004D6701 /* SystemPreviewSPI.h in Headers */,
  • trunk/Source/WebCore/PAL/pal/cocoa/AVFoundationSoftLink.h

    r284742 r284822  
    7777SOFT_LINK_CLASS_FOR_HEADER(PAL, AVAudioSession)
    7878SOFT_LINK_CLASS_FOR_HEADER(PAL, AVPersistableContentKeyRequest)
    79 #endif
    80 
    81 #if PLATFORM(COCOA)
    8279SOFT_LINK_CLASS_FOR_HEADER(PAL, AVSpeechSynthesisVoice)
    8380SOFT_LINK_CLASS_FOR_HEADER(PAL, AVSpeechSynthesizer)
  • trunk/Source/WebCore/PAL/pal/cocoa/AVFoundationSoftLink.mm

    r284742 r284822  
    103103SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVAudioSession, PAL_EXPORT)
    104104SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVPersistableContentKeyRequest, PAL_EXPORT)
    105 #endif
    106 
    107 #if PLATFORM(COCOA)
    108105SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVSpeechSynthesisVoice, PAL_EXPORT)
    109106SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVSpeechSynthesizer, PAL_EXPORT)
  • trunk/Source/WebCore/PAL/pal/spi/cocoa/AXSpeechManagerSPI.h

    r284742 r284822  
    2626#pragma once
    2727
    28 #if PLATFORM(COCOA)
     28#if PLATFORM(IOS_FAMILY)
    2929
    3030// FIXME: Undo when isSystemVoice is available in all SDKs.
     
    4343#endif // USE(APPLE_INTERNAL_SDK)
    4444
    45 #endif // PLATFORM(COCOA)
     45#endif // PLATFORM(IOS_FAMILY)
    4646
  • trunk/Source/WebCore/SourcesCocoa.txt

    r284742 r284822  
    257257platform/cocoa/PasteboardCustomDataCocoa.mm
    258258platform/cocoa/PlatformPasteboardCocoa.mm
    259 platform/cocoa/PlatformSpeechSynthesizerCocoa.mm @no-unify
    260259platform/cocoa/PlaybackSessionModelMediaElement.mm
    261260platform/cocoa/PowerSourceNotifier.mm
     
    441440platform/ios/PlatformPasteboardIOS.mm
    442441platform/ios/PlatformScreenIOS.mm
     442platform/ios/PlatformSpeechSynthesizerIOS.mm @no-unify
    443443platform/ios/PlaybackSessionInterfaceAVKit.mm @no-unify
    444444platform/ios/PreviewConverterIOS.mm
     
    487487platform/mac/PlatformPasteboardMac.mm
    488488platform/mac/PlatformScreenMac.mm
     489platform/mac/PlatformSpeechSynthesizerMac.mm
    489490platform/mac/PlaybackSessionInterfaceMac.mm @no-unify
    490491platform/mac/PluginBlocklist.mm
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r284742 r284822  
    37113711                A9D248070D757E7D00FDF959 /* JSDOMMimeType.h in Headers */ = {isa = PBXBuildFile; fileRef = A9D248030D757E7D00FDF959 /* JSDOMMimeType.h */; };
    37123712                A9D248090D757E7D00FDF959 /* JSDOMMimeTypeArray.h in Headers */ = {isa = PBXBuildFile; fileRef = A9D248050D757E7D00FDF959 /* JSDOMMimeTypeArray.h */; };
    3713                 AA12DF491743DF83004DAFDF /* PlatformSpeechSynthesizerCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = AAE3755D17429BCC006200C2 /* PlatformSpeechSynthesizerCocoa.mm */; };
     3713                AA12DF491743DF83004DAFDF /* PlatformSpeechSynthesizerIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = AAE3755D17429BCC006200C2 /* PlatformSpeechSynthesizerIOS.mm */; };
    37143714                AA21ECCD0ABF0FC6002B834C /* CSSCursorImageValue.h in Headers */ = {isa = PBXBuildFile; fileRef = AA0978EE0ABAA6E100874480 /* CSSCursorImageValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
    37153715                AA2A5ACE16A485FD00975A25 /* SpeechSynthesisVoice.h in Headers */ = {isa = PBXBuildFile; fileRef = AA2A5AC716A485D500975A25 /* SpeechSynthesisVoice.h */; };
     
    73027302                29E04A27BED2F81F98E9022B /* JSBeforeUnloadEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSBeforeUnloadEvent.h; sourceTree = "<group>"; };
    73037303                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>"; };
    73047305                29FAF4B5195AB08900A522DC /* TextUndoInsertionMarkupMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextUndoInsertionMarkupMac.h; sourceTree = "<group>"; };
    73057306                2A4107A026CB66ED003BF797 /* CSSKeywordValue.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CSSKeywordValue.cpp; sourceTree = "<group>"; };
     
    1363013631                AAE27B7416CBFC0D00623043 /* PlatformSpeechSynthesizerMock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformSpeechSynthesizerMock.cpp; sourceTree = "<group>"; };
    1363113632                AAE27B7516CBFC0D00623043 /* PlatformSpeechSynthesizerMock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformSpeechSynthesizerMock.h; sourceTree = "<group>"; };
    13632                 AAE3755D17429BCC006200C2 /* PlatformSpeechSynthesizerCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PlatformSpeechSynthesizerCocoa.mm; sourceTree = "<group>"; };
     13633                AAE3755D17429BCC006200C2 /* PlatformSpeechSynthesizerIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PlatformSpeechSynthesizerIOS.mm; sourceTree = "<group>"; };
    1363313634                AAF5B7B11524B4BD0004CB49 /* WebSocketFrame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebSocketFrame.cpp; sourceTree = "<group>"; };
    1363413635                AB23A32509BBA7D00067CC53 /* BeforeTextInsertedEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = BeforeTextInsertedEvent.cpp; sourceTree = "<group>"; };
     
    2239122392                                C5F765BA14E1ECF4006C899B /* PlatformPasteboardMac.mm */,
    2239222393                                BC94D1070C274F88006BC617 /* PlatformScreenMac.mm */,
     22394                                29E4D8E016B0959800C84704 /* PlatformSpeechSynthesizerMac.mm */,
    2239322395                                CDA29A151CBDA56C00901CCF /* PlaybackSessionInterfaceMac.h */,
    2239422396                                CDA29A141CBDA56C00901CCF /* PlaybackSessionInterfaceMac.mm */,
     
    2506125063                                C5278B0B17F212EA003A2998 /* PlatformPasteboardIOS.mm */,
    2506225064                                E45390320EAFD637003695C8 /* PlatformScreenIOS.mm */,
     25065                                AAE3755D17429BCC006200C2 /* PlatformSpeechSynthesizerIOS.mm */,
    2506325066                                CDA29A2E1CBF73FC00901CCF /* PlaybackSessionInterfaceAVKit.h */,
    2506425067                                CDA29A2F1CBF73FC00901CCF /* PlaybackSessionInterfaceAVKit.mm */,
     
    2521925222                                F4FB35002350C96200F0094A /* PasteboardCustomDataCocoa.mm */,
    2522025223                                F4628A9E234D3BBF00BC884C /* PlatformPasteboardCocoa.mm */,
    25221                                 AAE3755D17429BCC006200C2 /* PlatformSpeechSynthesizerCocoa.mm */,
    2522225224                                52B0D4BD1C57FD1E0077CE53 /* PlatformView.h */,
    2522325225                                CDA29A0A1CBD9A7400901CCF /* PlaybackSessionModel.h */,
     
    3689236894                                E16982601134636A00894115 /* ObjCRuntimeObject.mm in Sources */,
    3689336895                                CEA284662141E84900E407E8 /* PlatformEventFactoryIOS.mm in Sources */,
    36894                                 AA12DF491743DF83004DAFDF /* PlatformSpeechSynthesizerCocoa.mm in Sources */,
     36896                                AA12DF491743DF83004DAFDF /* PlatformSpeechSynthesizerIOS.mm in Sources */,
    3689536897                                CDA29A301CBF74D400901CCF /* PlaybackSessionInterfaceAVKit.mm in Sources */,
    3689636898                                CDA29A161CBDA56C00901CCF /* PlaybackSessionInterfaceMac.mm in Sources */,
  • trunk/Source/WebCore/platform/ios/PlatformSpeechSynthesizerIOS.mm

    r284821 r284822  
    2626#import "PlatformSpeechSynthesizer.h"
    2727
    28 #if ENABLE(SPEECH_SYNTHESIS) && PLATFORM(COCOA)
     28#if ENABLE(SPEECH_SYNTHESIS) && PLATFORM(IOS_FAMILY)
    2929
    3030#import "PlatformSpeechSynthesisUtterance.h"
    3131#import "PlatformSpeechSynthesisVoice.h"
    32 
    33 #if __has_include(<AVFAudio/AVSpeechSynthesis.h>)
    34 #import <AVFAudio/AVSpeechSynthesis.h>
    35 #else
    36 #import <AVFoundation/AVFoundation.h>
    37 #endif
    38 
     32#import <AVFoundation/AVSpeechSynthesis.h>
    3933#import <pal/spi/cocoa/AXSpeechManagerSPI.h>
    4034#import <wtf/BlockObjCExceptions.h>
     
    7064#define AVSpeechUtteranceMaximumSpeechRate getAVSpeechUtteranceMaximumSpeechRate()
    7165
    72 @interface WebSpeechSynthesisWrapper : NSObject<AVSpeechSynthesizerDelegate> {
     66@interface WebSpeechSynthesisWrapper : NSObject<AVSpeechSynthesizerDelegate>
     67{
    7368    WebCore::PlatformSpeechSynthesizer* m_synthesizerObject;
    7469    // Hold a Ref to the utterance so that it won't disappear until the synth is done with it.
     
    197192
    198193    // Clear the m_utterance variable in case finish speaking kicks off a new speaking job immediately.
    199     RefPtr<WebCore::PlatformSpeechSynthesisUtterance> protectedUtterance = m_utterance;
     194    RefPtr<WebCore::PlatformSpeechSynthesisUtterance> platformUtterance = m_utterance;
    200195    m_utterance = nullptr;
    201196
    202     m_synthesizerObject->client()->didFinishSpeaking(*protectedUtterance);
     197    m_synthesizerObject->client()->didFinishSpeaking(*platformUtterance);
    203198}
    204199
     
    231226
    232227    // Clear the m_utterance variable in case finish speaking kicks off a new speaking job immediately.
    233     RefPtr<WebCore::PlatformSpeechSynthesisUtterance> protectedUtterance = m_utterance;
     228    RefPtr<WebCore::PlatformSpeechSynthesisUtterance> platformUtterance = m_utterance;
    234229    m_utterance = nullptr;
    235230
    236     m_synthesizerObject->client()->didFinishSpeaking(*protectedUtterance);
     231    m_synthesizerObject->client()->didFinishSpeaking(*platformUtterance);
    237232}
    238233
     
    245240        return;
    246241
    247     // AVSpeechSynthesizer only supports word boundaries.
     242    // iOS only supports word boundaries.
    248243    m_synthesizerObject->client()->boundaryEventOccurred(*m_utterance, WebCore::SpeechBoundary::SpeechWordBoundary, characterRange.location);
    249244}
     
    281276        if (includeVoice)
    282277#else
    283         // AVSpeechSynthesis on macOS does not support quality property correctly.
    284         if (voice.quality == AVSpeechSynthesisVoiceQualityDefault
    285             || (TARGET_OS_OSX && ![voiceURI hasSuffix:@"premium"]))
     278        if (voice.quality == AVSpeechSynthesisVoiceQualityDefault)
    286279#endif
    287280            m_voiceList.append(PlatformSpeechSynthesisVoice::create(voiceURI, name, language, true, isDefault));
     
    320313} // namespace WebCore
    321314
    322 #endif // ENABLE(SPEECH_SYNTHESIS) && PLATFORM(COCOA)
     315#endif // ENABLE(SPEECH_SYNTHESIS) && PLATFORM(IOS_FAMILY)
Note: See TracChangeset for help on using the changeset viewer.