Title: [269796] branches/safari-610-branch/Source
Revision
269796
Author
[email protected]
Date
2020-11-13 14:17:02 -0800 (Fri, 13 Nov 2020)

Log Message

Cherry-pick r269208. rdar://problem/71378171

    AX: Incorrect list of voices being displayed on iOS
    https://bugs.webkit.org/show_bug.cgi?id=218293

    Reviewed by Per Arne Vollan.

    Source/WebCore:

    Limit the voices that we display in WebSpeech to only built-in system voices. This was the intention of the "compact"
    decision, but some mobile assets have compact voices, which are not available WebContent.

    * platform/ios/PlatformSpeechSynthesizerIOS.mm:
    (WebCore::PlatformSpeechSynthesizer::initializeVoiceList):

    Source/WebCore/PAL:

    * PAL.xcodeproj/project.pbxproj:
    * pal/PlatformMac.cmake:
    * pal/spi/cocoa/AXSpeechManagerSPI.h: Added.

    Source/WTF:

    * wtf/PlatformHave.h:

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269208 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Added Paths

Diff

Modified: branches/safari-610-branch/Source/WTF/ChangeLog (269795 => 269796)


--- branches/safari-610-branch/Source/WTF/ChangeLog	2020-11-13 22:16:45 UTC (rev 269795)
+++ branches/safari-610-branch/Source/WTF/ChangeLog	2020-11-13 22:17:02 UTC (rev 269796)
@@ -1,3 +1,41 @@
+2020-11-13  Russell Epstein  <[email protected]>
+
+        Cherry-pick r269208. rdar://problem/71378171
+
+    AX: Incorrect list of voices being displayed on iOS
+    https://bugs.webkit.org/show_bug.cgi?id=218293
+    
+    Reviewed by Per Arne Vollan.
+    
+    Source/WebCore:
+    
+    Limit the voices that we display in WebSpeech to only built-in system voices. This was the intention of the "compact"
+    decision, but some mobile assets have compact voices, which are not available WebContent.
+    
+    * platform/ios/PlatformSpeechSynthesizerIOS.mm:
+    (WebCore::PlatformSpeechSynthesizer::initializeVoiceList):
+    
+    Source/WebCore/PAL:
+    
+    * PAL.xcodeproj/project.pbxproj:
+    * pal/PlatformMac.cmake:
+    * pal/spi/cocoa/AXSpeechManagerSPI.h: Added.
+    
+    Source/WTF:
+    
+    * wtf/PlatformHave.h:
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269208 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-10-30  Chris Fleizach  <[email protected]>
+
+            AX: Incorrect list of voices being displayed on iOS
+            https://bugs.webkit.org/show_bug.cgi?id=218293
+
+            Reviewed by Per Arne Vollan.
+
+            * wtf/PlatformHave.h:
+
 2020-10-27  Russell Epstein  <[email protected]>
 
         Apply patch. rdar://problem/70733375

Modified: branches/safari-610-branch/Source/WTF/wtf/PlatformHave.h (269795 => 269796)


--- branches/safari-610-branch/Source/WTF/wtf/PlatformHave.h	2020-11-13 22:16:45 UTC (rev 269795)
+++ branches/safari-610-branch/Source/WTF/wtf/PlatformHave.h	2020-11-13 22:17:02 UTC (rev 269796)
@@ -705,3 +705,9 @@
 #if PLATFORM(MACCATALYST) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000
 #define HAVE_CATALYST_USER_INTERFACE_IDIOM_AND_SCALE_FACTOR 1
 #endif
+
+#if (PLATFORM(IOS) || PLATFORM(MACCATALYST)) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140300
+#if !defined(HAVE_AVSPEECHSYNTHESIS_SYSTEMVOICE)
+#define HAVE_AVSPEECHSYNTHESIS_SYSTEMVOICE 1
+#endif
+#endif

Modified: branches/safari-610-branch/Source/WebCore/ChangeLog (269795 => 269796)


--- branches/safari-610-branch/Source/WebCore/ChangeLog	2020-11-13 22:16:45 UTC (rev 269795)
+++ branches/safari-610-branch/Source/WebCore/ChangeLog	2020-11-13 22:17:02 UTC (rev 269796)
@@ -1,5 +1,47 @@
 2020-11-13  Russell Epstein  <[email protected]>
 
+        Cherry-pick r269208. rdar://problem/71378171
+
+    AX: Incorrect list of voices being displayed on iOS
+    https://bugs.webkit.org/show_bug.cgi?id=218293
+    
+    Reviewed by Per Arne Vollan.
+    
+    Source/WebCore:
+    
+    Limit the voices that we display in WebSpeech to only built-in system voices. This was the intention of the "compact"
+    decision, but some mobile assets have compact voices, which are not available WebContent.
+    
+    * platform/ios/PlatformSpeechSynthesizerIOS.mm:
+    (WebCore::PlatformSpeechSynthesizer::initializeVoiceList):
+    
+    Source/WebCore/PAL:
+    
+    * PAL.xcodeproj/project.pbxproj:
+    * pal/PlatformMac.cmake:
+    * pal/spi/cocoa/AXSpeechManagerSPI.h: Added.
+    
+    Source/WTF:
+    
+    * wtf/PlatformHave.h:
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269208 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-10-30  Chris Fleizach  <[email protected]>
+
+            AX: Incorrect list of voices being displayed on iOS
+            https://bugs.webkit.org/show_bug.cgi?id=218293
+
+            Reviewed by Per Arne Vollan.
+
+            Limit the voices that we display in WebSpeech to only built-in system voices. This was the intention of the "compact"
+            decision, but some mobile assets have compact voices, which are not available WebContent.
+
+            * platform/ios/PlatformSpeechSynthesizerIOS.mm:
+            (WebCore::PlatformSpeechSynthesizer::initializeVoiceList):
+
+2020-11-13  Russell Epstein  <[email protected]>
+
         Cherry-pick r269121. rdar://problem/71381839
 
     [MSE] Handle trackId changing across Initialization Segments

Modified: branches/safari-610-branch/Source/WebCore/PAL/ChangeLog (269795 => 269796)


--- branches/safari-610-branch/Source/WebCore/PAL/ChangeLog	2020-11-13 22:16:45 UTC (rev 269795)
+++ branches/safari-610-branch/Source/WebCore/PAL/ChangeLog	2020-11-13 22:17:02 UTC (rev 269796)
@@ -1,3 +1,43 @@
+2020-11-13  Russell Epstein  <[email protected]>
+
+        Cherry-pick r269208. rdar://problem/71378171
+
+    AX: Incorrect list of voices being displayed on iOS
+    https://bugs.webkit.org/show_bug.cgi?id=218293
+    
+    Reviewed by Per Arne Vollan.
+    
+    Source/WebCore:
+    
+    Limit the voices that we display in WebSpeech to only built-in system voices. This was the intention of the "compact"
+    decision, but some mobile assets have compact voices, which are not available WebContent.
+    
+    * platform/ios/PlatformSpeechSynthesizerIOS.mm:
+    (WebCore::PlatformSpeechSynthesizer::initializeVoiceList):
+    
+    Source/WebCore/PAL:
+    
+    * PAL.xcodeproj/project.pbxproj:
+    * pal/PlatformMac.cmake:
+    * pal/spi/cocoa/AXSpeechManagerSPI.h: Added.
+    
+    Source/WTF:
+    
+    * wtf/PlatformHave.h:
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269208 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-10-30  Chris Fleizach  <[email protected]>
+
+            AX: Incorrect list of voices being displayed on iOS
+            https://bugs.webkit.org/show_bug.cgi?id=218293
+
+            Reviewed by Per Arne Vollan.
+
+            * PAL.xcodeproj/project.pbxproj:
+            * pal/PlatformMac.cmake:
+            * pal/spi/cocoa/AXSpeechManagerSPI.h: Added.
+
 2020-10-15  Russell Epstein  <[email protected]>
 
         Cherry-pick r268308. rdar://problem/70321629

Modified: branches/safari-610-branch/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj (269795 => 269796)


--- branches/safari-610-branch/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj	2020-11-13 22:16:45 UTC (rev 269795)
+++ branches/safari-610-branch/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj	2020-11-13 22:17:02 UTC (rev 269796)
@@ -115,6 +115,7 @@
 		1D12CC4B2411BCAE00FDA0A3 /* FeatureFlagsSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 1D12CC4A2411BCAE00FDA0A3 /* FeatureFlagsSPI.h */; };
 		293EE4A824154F8F0047493D /* AccessibilitySupportSoftLink.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 293EE4A624154F8F0047493D /* AccessibilitySupportSoftLink.cpp */; };
 		293EE4A924154F8F0047493D /* AccessibilitySupportSoftLink.h in Headers */ = {isa = PBXBuildFile; fileRef = 293EE4A724154F8F0047493D /* AccessibilitySupportSoftLink.h */; };
+		29CDEBA62548D57F007C07B7 /* AXSpeechManagerSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 29CDEB9E2548D055007C07B7 /* AXSpeechManagerSPI.h */; };
 		2D02E93C2056FAA700A13797 /* AudioToolboxSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D02E93B2056FAA700A13797 /* AudioToolboxSPI.h */; };
 		2E1342CC215AA10A007199D2 /* UIKitSoftLink.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E1342CA215AA10A007199D2 /* UIKitSoftLink.h */; };
 		2E1342CD215AA10A007199D2 /* UIKitSoftLink.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2E1342CB215AA10A007199D2 /* UIKitSoftLink.mm */; };
@@ -304,6 +305,7 @@
 		1D12CC4A2411BCAE00FDA0A3 /* FeatureFlagsSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FeatureFlagsSPI.h; sourceTree = "<group>"; };
 		293EE4A624154F8F0047493D /* AccessibilitySupportSoftLink.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilitySupportSoftLink.cpp; sourceTree = "<group>"; };
 		293EE4A724154F8F0047493D /* AccessibilitySupportSoftLink.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AccessibilitySupportSoftLink.h; sourceTree = "<group>"; };
+		29CDEB9E2548D055007C07B7 /* AXSpeechManagerSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AXSpeechManagerSPI.h; sourceTree = "<group>"; };
 		2D02E93B2056FAA700A13797 /* AudioToolboxSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioToolboxSPI.h; sourceTree = "<group>"; };
 		2E1342CA215AA10A007199D2 /* UIKitSoftLink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIKitSoftLink.h; sourceTree = "<group>"; };
 		2E1342CB215AA10A007199D2 /* UIKitSoftLink.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = UIKitSoftLink.mm; sourceTree = "<group>"; };
@@ -454,6 +456,7 @@
 				411A9AC02525D4CA00807D7E /* AVAssetWriterSPI.h */,
 				0C7785701F45130F00F4EBB6 /* AVFoundationSPI.h */,
 				0C2DA1221F3BEB4900DBC317 /* AVKitSPI.h */,
+				29CDEB9E2548D055007C07B7 /* AXSpeechManagerSPI.h */,
 				0C2DA1231F3BEB4900DBC317 /* CFNSURLConnectionSPI.h */,
 				7A36D0F8223AD9AB00B0522E /* CommonCryptoSPI.h */,
 				ABCA536724895DB900361BFF /* CoreMotionSPI.h */,
@@ -898,6 +901,7 @@
 				0C2DA1471F3BEB4900DBC317 /* URLFormattingSPI.h in Headers */,
 				07611DB6243FA5BF00D80704 /* UsageTrackingSoftLink.h in Headers */,
 				0C2DA1591F3BEB4900DBC317 /* WebFilterEvaluatorSPI.h in Headers */,
+				29CDEBA62548D57F007C07B7 /* AXSpeechManagerSPI.h in Headers */,
 				A10826F91F576292004772AC /* WebPanel.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;

Modified: branches/safari-610-branch/Source/WebCore/PAL/pal/PlatformMac.cmake (269795 => 269796)


--- branches/safari-610-branch/Source/WebCore/PAL/pal/PlatformMac.cmake	2020-11-13 22:16:45 UTC (rev 269795)
+++ branches/safari-610-branch/Source/WebCore/PAL/pal/PlatformMac.cmake	2020-11-13 22:17:02 UTC (rev 269796)
@@ -23,6 +23,7 @@
 
     spi/cocoa/AVFoundationSPI.h
     spi/cocoa/AVKitSPI.h
+    spi/cocoa/AXSpeechManagerSPI.h
     spi/cocoa/AccessibilitySupportSPI.h
     spi/cocoa/AccessibilitySupportSoftLink.h
     spi/cocoa/AppSSOSPI.h

Added: branches/safari-610-branch/Source/WebCore/PAL/pal/spi/cocoa/AXSpeechManagerSPI.h (0 => 269796)


--- branches/safari-610-branch/Source/WebCore/PAL/pal/spi/cocoa/AXSpeechManagerSPI.h	                        (rev 0)
+++ branches/safari-610-branch/Source/WebCore/PAL/pal/spi/cocoa/AXSpeechManagerSPI.h	2020-11-13 22:17:02 UTC (rev 269796)
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2020 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 PLATFORM(IOS_FAMILY)
+
+#if USE(APPLE_INTERNAL_SDK)
+
+#include <AXSpeechManager.h>
+
+#else
+
+#include <AVFoundation/AVFoundation.h>
+
+@interface AVSpeechSynthesizer (PrivateAttributes)
+@property (nonatomic, readonly) BOOL isSystemVoice SPI_AVAILABLE(macos(11.3), ios(13.3), tvos(13.3), watchos(6.3));
+@end
+
+#endif // USE(APPLE_INTERNAL_SDK)
+
+#endif // PLATFORM(IOS_FAMILY)
+

Modified: branches/safari-610-branch/Source/WebCore/platform/ios/PlatformSpeechSynthesizerIOS.mm (269795 => 269796)


--- branches/safari-610-branch/Source/WebCore/platform/ios/PlatformSpeechSynthesizerIOS.mm	2020-11-13 22:16:45 UTC (rev 269795)
+++ branches/safari-610-branch/Source/WebCore/platform/ios/PlatformSpeechSynthesizerIOS.mm	2020-11-13 22:17:02 UTC (rev 269796)
@@ -30,6 +30,7 @@
 #import "PlatformSpeechSynthesisUtterance.h"
 #import "PlatformSpeechSynthesisVoice.h"
 #import <AVFoundation/AVSpeechSynthesis.h>
+#import <pal/spi/cocoa/AXSpeechManagerSPI.h>
 #import <wtf/BlockObjCExceptions.h>
 #import <wtf/RetainPtr.h>
 
@@ -265,7 +266,11 @@
         NSString *name = [voice name];
         
         // Only show built-in voices when requesting through WebKit to reduce fingerprinting surface area.
+#if HAVE(AVSPEECHSYNTHESIS_SYSTEMVOICE)
+        if (voice.isSystemVoice)
+#else
         if (voice.quality == AVSpeechSynthesisVoiceQualityDefault)
+#endif
             m_voiceList.append(PlatformSpeechSynthesisVoice::create(voiceURI, name, language, true, isDefault));
     }
     END_BLOCK_OBJC_EXCEPTIONS
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to