Title: [269208] trunk/Source
Revision
269208
Author
[email protected]
Date
2020-10-30 15:59:11 -0700 (Fri, 30 Oct 2020)

Log Message

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:

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (269207 => 269208)


--- trunk/Source/WTF/ChangeLog	2020-10-30 22:26:04 UTC (rev 269207)
+++ trunk/Source/WTF/ChangeLog	2020-10-30 22:59:11 UTC (rev 269208)
@@ -1,3 +1,12 @@
+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-29  Jiewen Tan  <[email protected]>
 
         [WebAuthn] Make WebContent process talk to the WebAuthn process for WebAuthn requests

Modified: trunk/Source/WTF/wtf/PlatformHave.h (269207 => 269208)


--- trunk/Source/WTF/wtf/PlatformHave.h	2020-10-30 22:26:04 UTC (rev 269207)
+++ trunk/Source/WTF/wtf/PlatformHave.h	2020-10-30 22:59:11 UTC (rev 269208)
@@ -735,3 +735,9 @@
 #define HAVE_APPLE_ATTESTATION 1
 #endif
 #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: trunk/Source/WebCore/ChangeLog (269207 => 269208)


--- trunk/Source/WebCore/ChangeLog	2020-10-30 22:26:04 UTC (rev 269207)
+++ trunk/Source/WebCore/ChangeLog	2020-10-30 22:59:11 UTC (rev 269208)
@@ -1,3 +1,16 @@
+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-10-30  Keith Rollin  <[email protected]>
 
         Further lessen reliance on VPATH in WebCore/DerivedSources.make

Modified: trunk/Source/WebCore/PAL/ChangeLog (269207 => 269208)


--- trunk/Source/WebCore/PAL/ChangeLog	2020-10-30 22:26:04 UTC (rev 269207)
+++ trunk/Source/WebCore/PAL/ChangeLog	2020-10-30 22:59:11 UTC (rev 269208)
@@ -1,3 +1,14 @@
+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-13  Keith Rollin  <[email protected]>
 
         Remove leftover MACOSX_DEPLOYMENT_TARGET_macosx support

Modified: trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj (269207 => 269208)


--- trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj	2020-10-30 22:26:04 UTC (rev 269207)
+++ trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj	2020-10-30 22:59:11 UTC (rev 269208)
@@ -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: trunk/Source/WebCore/PAL/pal/PlatformMac.cmake (269207 => 269208)


--- trunk/Source/WebCore/PAL/pal/PlatformMac.cmake	2020-10-30 22:26:04 UTC (rev 269207)
+++ trunk/Source/WebCore/PAL/pal/PlatformMac.cmake	2020-10-30 22:59:11 UTC (rev 269208)
@@ -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: trunk/Source/WebCore/PAL/pal/spi/cocoa/AXSpeechManagerSPI.h (0 => 269208)


--- trunk/Source/WebCore/PAL/pal/spi/cocoa/AXSpeechManagerSPI.h	                        (rev 0)
+++ trunk/Source/WebCore/PAL/pal/spi/cocoa/AXSpeechManagerSPI.h	2020-10-30 22:59:11 UTC (rev 269208)
@@ -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: trunk/Source/WebCore/platform/ios/PlatformSpeechSynthesizerIOS.mm (269207 => 269208)


--- trunk/Source/WebCore/platform/ios/PlatformSpeechSynthesizerIOS.mm	2020-10-30 22:26:04 UTC (rev 269207)
+++ trunk/Source/WebCore/platform/ios/PlatformSpeechSynthesizerIOS.mm	2020-10-30 22:59:11 UTC (rev 269208)
@@ -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