2020-12-16 Alan Coon Cherry-pick r269930. rdar://problem/72298580 Build fails on internal simulator builds due to missing enum kCVPixelFormatType_AGX_420YpCbCr8BiPlanarVideoRange https://bugs.webkit.org/show_bug.cgi?id=219030 Unreviewed build fix for macCatalyst. * wtf/PlatformHave.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269930 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-11-17 Ryan Haddad Build fails on internal simulator builds due to missing enum kCVPixelFormatType_AGX_420YpCbCr8BiPlanarVideoRange https://bugs.webkit.org/show_bug.cgi?id=219030 Unreviewed build fix for macCatalyst. * wtf/PlatformHave.h: 2020-12-16 Alan Coon Cherry-pick r269900. rdar://problem/72298580 Build fails on internal simulator builds due to missing enum kCVPixelFormatType_AGX_420YpCbCr8BiPlanarVideoRange https://bugs.webkit.org/show_bug.cgi?id=219030 Patch by Kimmo Kinnunen on 2020-11-17 Reviewed by Antti Koivisto. Fix compile for simulator builds. Rename HAVE_CV_AGX_420_PIXEL_FORMAT_TYPES to HAVE_COREVIDEO_COMPRESSED_PIXEL_FORMAT_TYPES to better reflect what the ifdef does. Source/WebCore: * platform/graphics/cv/GraphicsContextGLCVANGLE.cpp: (WebCore::pixelRangeFromPixelFormat): (WebCore::GraphicsContextGLCVANGLE::copyPixelBufferToTexture): Source/WebCore/PAL: * pal/spi/cf/CoreVideoSPI.h: Source/WTF: * wtf/PlatformHave.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269900 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-11-17 Kimmo Kinnunen Build fails on internal simulator builds due to missing enum kCVPixelFormatType_AGX_420YpCbCr8BiPlanarVideoRange https://bugs.webkit.org/show_bug.cgi?id=219030 Reviewed by Antti Koivisto. Fix compile for simulator builds. Rename HAVE_CV_AGX_420_PIXEL_FORMAT_TYPES to HAVE_COREVIDEO_COMPRESSED_PIXEL_FORMAT_TYPES to better reflect what the ifdef does. * wtf/PlatformHave.h: 2020-12-15 Alan Coon Cherry-pick r270321. rdar://problem/72298523 Update list of block ports according fetch spec https://bugs.webkit.org/show_bug.cgi?id=219154 Reviewed by Sam Weinig. LayoutTests/imported/w3c: * web-platform-tests/fetch/api/request/request-bad-port.any-expected.txt: * web-platform-tests/fetch/api/request/request-bad-port.any.js: * web-platform-tests/fetch/api/request/request-bad-port.any.worker-expected.txt: * web-platform-tests/websockets/Create-blocked-port.any-expected.txt: * web-platform-tests/websockets/Create-blocked-port.any.js: * web-platform-tests/websockets/Create-blocked-port.any.worker-expected.txt: Source/WTF: * wtf/URL.cpp: (WTF::portAllowed): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270321 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-12-01 Youenn Fablet Update list of block ports according fetch spec https://bugs.webkit.org/show_bug.cgi?id=219154 Reviewed by Sam Weinig. * wtf/URL.cpp: (WTF::portAllowed): 2020-12-15 Alan Coon Cherry-pick r269436. rdar://problem/72298523 Consider blocking ports 5060 and 5061 https://bugs.webkit.org/show_bug.cgi?id=218557 Reviewed by Alex Christensen. LayoutTests/imported/w3c: * web-platform-tests/fetch/api/request/request-bad-port.any-expected.txt: Added. * web-platform-tests/fetch/api/request/request-bad-port.any.html: Added. * web-platform-tests/fetch/api/request/request-bad-port.any.js: Added. (BLOCKED_PORTS_LIST.map): * web-platform-tests/fetch/api/request/request-bad-port.any.worker-expected.txt: Added. * web-platform-tests/fetch/api/request/request-bad-port.any.worker.html: Added. * web-platform-tests/fetch/api/request/request-bad-port.html: Removed. * web-platform-tests/tools/wptserve/wptserve/utils.py: (is_bad_port): * web-platform-tests/websockets/Create-blocked-port.any-expected.txt: * web-platform-tests/websockets/Create-blocked-port.any.js: * web-platform-tests/websockets/Create-blocked-port.any.worker-expected.txt: Source/WTF: * wtf/URL.cpp: (WTF::portAllowed): LayoutTests: * TestExpectations: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269436 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-11-05 Youenn Fablet Consider blocking ports 5060 and 5061 https://bugs.webkit.org/show_bug.cgi?id=218557 Reviewed by Alex Christensen. * wtf/URL.cpp: (WTF::portAllowed): 2020-12-14 Alan Coon Cherry-pick r270449. rdar://problem/72298505 Add safety checks to xsltParamArrayFromParameterMap() Reviewed by Darin Adler. Source/WebCore: * xml/XSLTProcessorLibxslt.cpp: (WebCore::xsltParamArrayFromParameterMap): Source/WTF: * wtf/PlatformHave.h: (HAVE_LIBXSLT_FIX_FOR_RADAR_71864140): Add. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270449 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-12-04 David Kilzer Add safety checks to xsltParamArrayFromParameterMap() Reviewed by Darin Adler. * wtf/PlatformHave.h: (HAVE_LIBXSLT_FIX_FOR_RADAR_71864140): Add. 2020-12-08 Russell Epstein Cherry-pick r270052. rdar://problem/72099688 Use os_thread_self_restrict_rwx_is_supported instead of pthread_jit_write_protect_supported_np on Apple Internal SDK builds https://bugs.webkit.org/show_bug.cgi?id=219099 Reviewed by Mark Lam. Source/JavaScriptCore: * assembler/FastJITPermissions.h: (useFastJITPermissions): (threadSelfRestrictRWXToRW): (threadSelfRestrictRWXToRX): Source/WTF: * wtf/PlatformHave.h: * wtf/PlatformUse.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270052 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-11-19 Saam Barati Use os_thread_self_restrict_rwx_is_supported instead of pthread_jit_write_protect_supported_np on Apple Internal SDK builds https://bugs.webkit.org/show_bug.cgi?id=219099 Reviewed by Mark Lam. * wtf/PlatformHave.h: * wtf/PlatformUse.h: 2020-11-16 Russell Epstein Cherry-pick r268979. rdar://problem/71446613 Use a WeakHashSet for Document::m_captionPreferencesChangedElements https://bugs.webkit.org/show_bug.cgi?id=218170 Reviewed by Eric Carlson. Source/WebCore: Refactoring to move from raw pointer to weak pointer. For that purpose, we use WeakHashSet and WeakHashSet::forEach for extra safety. No observable change of behavior. * dom/Document.cpp: (WebCore::Document::registerForCaptionPreferencesChangedCallbacks): (WebCore::Document::unregisterForCaptionPreferencesChangedCallbacks): (WebCore::Document::captionPreferencesChanged): * dom/Document.h: Source/WTF: * wtf/WeakHashSet.h: Add a static cast for classes inheriting CanMakeWeakPtr like done for the set iterator. Update code to compile in WinCairo. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@268979 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-10-26 Youenn Fablet Use a WeakHashSet for Document::m_captionPreferencesChangedElements https://bugs.webkit.org/show_bug.cgi?id=218170 Reviewed by Eric Carlson. * wtf/WeakHashSet.h: Add a static cast for classes inheriting CanMakeWeakPtr like done for the set iterator. Update code to compile in WinCairo. 2020-11-13 Russell Epstein 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 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 Apply patch. rdar://problem/70733375 2020-10-27 Tadeu Zagallo Sign MacroAssembler::jumpsToLink https://bugs.webkit.org/show_bug.cgi?id=217774 Reviewed by Saam Barati. * wtf/PtrTag.h: (WTF::untagInt): (WTF::tagInt): 2020-10-27 Russell Epstein Cherry-pick r269019. rdar://problem/70733412 Add extra validation to MetaAllocator::findAndRemoveFreeSpace https://bugs.webkit.org/show_bug.cgi?id=217792 Reviewed Saam Barati. * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::findAndRemoveFreeSpace): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269019 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-10-15 Tadeu Zagallo Add extra validation to MetaAllocator::findAndRemoveFreeSpace https://bugs.webkit.org/show_bug.cgi?id=217792 Reviewed Saam Barati. * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::findAndRemoveFreeSpace): 2020-10-27 Russell Epstein Cherry-pick r269017. rdar://problem/70733371 Assert that WTF::HashTable does not visit the same bucket twice https://bugs.webkit.org/show_bug.cgi?id=217691 Reviewed by Saam Barati. * wtf/HashTable.h: (WTF::KeyTraits>::inlineLookup): (WTF::KeyTraits>::lookupForWriting): (WTF::KeyTraits>::fullLookupForWriting): (WTF::KeyTraits>::addUniqueForInitialization): (WTF::KeyTraits>::add): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269017 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-10-13 Tadeu Zagallo Assert that WTF::HashTable does not visit the same bucket twice https://bugs.webkit.org/show_bug.cgi?id=217691 Reviewed by Saam Barati. * wtf/HashTable.h: (WTF::KeyTraits>::inlineLookup): (WTF::KeyTraits>::lookupForWriting): (WTF::KeyTraits>::fullLookupForWriting): (WTF::KeyTraits>::addUniqueForInitialization): (WTF::KeyTraits>::add): 2020-10-27 Russell Epstein Cherry-pick r268135. rdar://problem/70733407 Add maximum depth check to RedBlackTree https://bugs.webkit.org/show_bug.cgi?id=217249 Reviewed by Saam Barati. We limit all tree traversals to 128 levels deep. That's a very conservative upper bound that would work for a tree that used all of the available address space. * wtf/RedBlackTree.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@268135 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-10-07 Tadeu Zagallo Add maximum depth check to RedBlackTree https://bugs.webkit.org/show_bug.cgi?id=217249 Reviewed by Saam Barati. We limit all tree traversals to 128 levels deep. That's a very conservative upper bound that would work for a tree that used all of the available address space. * wtf/RedBlackTree.h: 2020-10-15 Russell Epstein Cherry-pick r268367. rdar://problem/70321875 [macCatalyst] Enable WKPDFView https://bugs.webkit.org/show_bug.cgi?id=217403 Reviewed by Tim Horton. Source/WebKit: * Configurations/WebKit.xcconfig: Linked PDFKit.framework when building for the Catalyst variant on Big Sur or later. Source/WTF: * wtf/PlatformEnableCocoa.h: Enabled WKPDFView when building for the Catalyst variant on Big Sur or later. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@268367 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-10-12 Andy Estes [macCatalyst] Enable WKPDFView https://bugs.webkit.org/show_bug.cgi?id=217403 Reviewed by Tim Horton. * wtf/PlatformEnableCocoa.h: Enabled WKPDFView when building for the Catalyst variant on Big Sur or later. 2020-10-14 Russell Epstein Cherry-pick r267116. rdar://problem/70267318 [macOS Big Sur] CGFontRenderingGetFontSmoothingDisabled() is no longer useful https://bugs.webkit.org/show_bug.cgi?id=216588 Reviewed by Simon Fraser. Source/WebCore: No new tests because there is no behavior change. * platform/graphics/coretext/FontCascadeCoreText.cpp: (WebCore::FontCascade::isSubpixelAntialiasingAvailable): Source/WTF: We can eliminate WebKit's use of it to eventually phase it out entirely. * wtf/PlatformHave.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267116 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-09-15 Myles C. Maxfield [macOS Big Sur] CGFontRenderingGetFontSmoothingDisabled() is no longer useful https://bugs.webkit.org/show_bug.cgi?id=216588 Reviewed by Simon Fraser. We can eliminate WebKit's use of it to eventually phase it out entirely. * wtf/PlatformHave.h: 2020-10-14 Alan Coon Cherry-pick r268371. rdar://problem/70267767 [macOS] Workaround for MAC_OS_X_VERSION_MAJOR incorrectly including minor version when building with Xcode 12 on macOS Big Sur SUs https://bugs.webkit.org/show_bug.cgi?id=217602 rdar://70194453 Patch by Luming Yin on 2020-10-12 Reviewed by Darin Adler. The previous workaround turns out to be ineffective because we can't set the value of TARGET_MAC_OS_X_VERSION_MAJOR based on a previous value of itself. Introduce a new variable TARGET_MAC_OS_X_VERSION_MAJOR to determine whether we need to explicitly adjust MAC_OS_X_VERSION_MAJOR to 110000. PerformanceTests: * DecoderTest/Configurations/DebugRelease.xcconfig: * MediaTime/Configurations/DebugRelease.xcconfig: Source/bmalloc: * Configurations/DebugRelease.xcconfig: Source/JavaScriptCore: * Configurations/DebugRelease.xcconfig: Source/ThirdParty: * gtest/xcode/Config/General.xcconfig: Source/ThirdParty/ANGLE: * Configurations/DebugRelease.xcconfig: Source/ThirdParty/libwebrtc: * Configurations/DebugRelease.xcconfig: Source/WebCore: * Configurations/DebugRelease.xcconfig: Source/WebCore/PAL: * Configurations/DebugRelease.xcconfig: Source/WebInspectorUI: * Configurations/DebugRelease.xcconfig: Source/WebKit: * Configurations/DebugRelease.xcconfig: Source/WebKitLegacy/mac: * Configurations/DebugRelease.xcconfig: Source/WTF: * Configurations/DebugRelease.xcconfig: Tools: * ContentExtensionTester/Configurations/DebugRelease.xcconfig: * DumpRenderTree/mac/Configurations/DebugRelease.xcconfig: * ImageDiff/cg/Configurations/DebugRelease.xcconfig: * MiniBrowser/Configurations/DebugRelease.xcconfig: * TestWebKitAPI/Configurations/DebugRelease.xcconfig: * WebEditingTester/Configurations/DebugRelease.xcconfig: * WebKitTestRunner/Configurations/DebugRelease.xcconfig: * lldb/lldbWebKitTester/Configurations/DebugRelease.xcconfig: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@268371 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-10-12 Luming Yin [macOS] Workaround for MAC_OS_X_VERSION_MAJOR incorrectly including minor version when building with Xcode 12 on macOS Big Sur SUs https://bugs.webkit.org/show_bug.cgi?id=217602 rdar://70194453 Reviewed by Darin Adler. The previous workaround turns out to be ineffective because we can't set the value of TARGET_MAC_OS_X_VERSION_MAJOR based on a previous value of itself. Introduce a new variable TARGET_MAC_OS_X_VERSION_MAJOR to determine whether we need to explicitly adjust MAC_OS_X_VERSION_MAJOR to 110000. * Configurations/DebugRelease.xcconfig: 2020-10-14 Alan Coon Cherry-pick r268353. rdar://problem/70267767 [macOS] Workaround for MAC_OS_X_VERSION_MAJOR incorrectly including minor version when building with Xcode 12 on macOS Big Sur SUs https://bugs.webkit.org/show_bug.cgi?id=217602 rdar://70194453 Patch by Luming Yin on 2020-10-12 Reviewed by Darin Adler. Due to a bug in Xcode (rdar://70185899), Xcode 12.0 and Xcode 12.1 Beta incorrectly includes the minor release number in MAC_OS_X_VERSION_MAJOR, which causes Debug and Release builds of WebKit to be misconfigured when building on macOS Big Sur SUs, leading to webpages failing to load. To work around the Xcode bug, when the MAC_OS_X_VERSION_MAJOR includes the minor version number, drop the minor version number by explicitly setting TARGET_MAC_OS_X_VERSION_MAJOR to 110000. Note: This change should be reverted after is resolved. PerformanceTests: * DecoderTest/Configurations/DebugRelease.xcconfig: * MediaTime/Configurations/DebugRelease.xcconfig: Source/bmalloc: * Configurations/DebugRelease.xcconfig: Source/JavaScriptCore: * Configurations/DebugRelease.xcconfig: Source/ThirdParty: * gtest/xcode/Config/General.xcconfig: Source/ThirdParty/ANGLE: * Configurations/DebugRelease.xcconfig: Source/ThirdParty/libwebrtc: * Configurations/DebugRelease.xcconfig: Source/WebCore: * Configurations/DebugRelease.xcconfig: Source/WebCore/PAL: * Configurations/DebugRelease.xcconfig: Source/WebInspectorUI: * Configurations/DebugRelease.xcconfig: Source/WebKit: * Configurations/DebugRelease.xcconfig: Source/WebKitLegacy/mac: * Configurations/DebugRelease.xcconfig: Source/WTF: * Configurations/DebugRelease.xcconfig: Tools: * ContentExtensionTester/Configurations/DebugRelease.xcconfig: * DumpRenderTree/mac/Configurations/DebugRelease.xcconfig: * ImageDiff/cg/Configurations/DebugRelease.xcconfig: * MiniBrowser/Configurations/DebugRelease.xcconfig: * TestWebKitAPI/Configurations/DebugRelease.xcconfig: * WebEditingTester/Configurations/DebugRelease.xcconfig: * WebKitTestRunner/Configurations/DebugRelease.xcconfig: * lldb/lldbWebKitTester/Configurations/DebugRelease.xcconfig: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@268353 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-10-12 Luming Yin [macOS] Workaround for MAC_OS_X_VERSION_MAJOR incorrectly including minor version when building with Xcode 12 on macOS Big Sur SUs https://bugs.webkit.org/show_bug.cgi?id=217602 rdar://70194453 Reviewed by Darin Adler. Due to a bug in Xcode (rdar://70185899), Xcode 12.0 and Xcode 12.1 Beta incorrectly includes the minor release number in MAC_OS_X_VERSION_MAJOR, which causes Debug and Release builds of WebKit to be misconfigured when building on macOS Big Sur SUs, leading to webpages failing to load. To work around the Xcode bug, when the MAC_OS_X_VERSION_MAJOR includes the minor version number, drop the minor version number by explicitly setting TARGET_MAC_OS_X_VERSION_MAJOR to 110000. Note: This change should be reverted after is resolved. * Configurations/DebugRelease.xcconfig: 2020-10-11 Kocsen Chung Cherry-pick r268330. rdar://problem/70189394 Strip patch version from TARGET_MAC_OS_X_VERSION_MAJOR when building for macOS Big Sur or later https://bugs.webkit.org/show_bug.cgi?id=217594 rdar://70188497 Patch by Luming Yin on 2020-10-11 Reviewed by Darin Adler. To ensure successful Mac Catalyst WebKit builds, strip the patch version from TARGET_MAC_OS_X_VERSION_MAJOR by using two `base:`s on MACOSX_DEPLOYMENT_TARGET. * Configurations/Base.xcconfig: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@268330 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-10-11 Luming Yin Strip patch version from TARGET_MAC_OS_X_VERSION_MAJOR when building for macOS Big Sur or later https://bugs.webkit.org/show_bug.cgi?id=217594 rdar://70188497 Reviewed by Darin Adler. To ensure successful Mac Catalyst WebKit builds, strip the patch version from TARGET_MAC_OS_X_VERSION_MAJOR by using two `base:`s on MACOSX_DEPLOYMENT_TARGET. * Configurations/Base.xcconfig: 2020-10-11 Kocsen Chung Cherry-pick r268327. rdar://problem/70189401 Ignore deployment suffix and identifier when computing major OS version for macOS Big Sur and newer https://bugs.webkit.org/show_bug.cgi?id=217584 rdar://70168426 Patch by Luming Yin on 2020-10-11 Reviewed by Darin Adler. Stop using MACOSX_DEPLOYMENT_TARGET:suffix:identifier to compute major OS versions. Only use the deployment target base for macOS Big Sur and newer. Keep the manual definitions for legacy versions of macOS. * Configurations/Base.xcconfig: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@268327 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-10-11 Luming Yin Ignore deployment suffix and identifier when computing major OS version for macOS Big Sur and newer https://bugs.webkit.org/show_bug.cgi?id=217584 rdar://70168426 Reviewed by Darin Adler. Stop using MACOSX_DEPLOYMENT_TARGET:suffix:identifier to compute major OS versions. Only use the deployment target base for macOS Big Sur and newer. Keep the manual definitions for legacy versions of macOS. * Configurations/Base.xcconfig: 2020-10-08 Alan Coon Cherry-pick r268052. rdar://problem/70097377 Enable video capture in WebProcess by default on MacOS https://bugs.webkit.org/show_bug.cgi?id=217385 Reviewed by Sam Weinig. Source/WebKit: Manually tested in MiniBrowser. * Shared/WebPreferencesDefaultValues.cpp: * Shared/WebPreferencesDefaultValues.h: Source/WTF: * Scripts/Preferences/WebPreferencesInternal.yaml: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@268052 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-10-06 Youenn Fablet Enable video capture in WebProcess by default on MacOS https://bugs.webkit.org/show_bug.cgi?id=217385 Reviewed by Sam Weinig. * Scripts/Preferences/WebPreferencesInternal.yaml: 2020-10-06 Alan Coon Cherry-pick r267870. rdar://problem/70025703 Add AVAssetWriter SPI header https://bugs.webkit.org/show_bug.cgi?id=217169 Reviewed by Eric Carlson. Source/WebCore: No change of behavior, include SPI header instead of private SDK header. * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: Source/WebCore/PAL: * PAL.xcodeproj/project.pbxproj: * pal/spi/cocoa/AVAssetWriterSPI.h: Added. Source/WTF: * wtf/PlatformHave.h: Remove dependency on AVAssetWriter_private.h. Introduce HAVE_AVASSETWRITERDELEGATE_API for older OSes that only have delegate as SPI. LayoutTests: Enable tests by default on Catalina+, disable them on Mojave and WK1. Disable tests for iOS13. * TestExpectations: * platform/ios-13/TestExpectations: * platform/mac/TestExpectations: * platform/mac-wk1/TestExpectations: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267870 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-10-02 Youenn Fablet Add AVAssetWriter SPI header https://bugs.webkit.org/show_bug.cgi?id=217169 Reviewed by Eric Carlson. * wtf/PlatformHave.h: Remove dependency on AVAssetWriter_private.h. Introduce HAVE_AVASSETWRITERDELEGATE_API for older OSes that only have delegate as SPI. 2020-09-17 Alan Coon Cherry-pick r266802. rdar://problem/69101097 Text copied and pasted from Mac Catalyst apps appears larger than expected https://bugs.webkit.org/show_bug.cgi?id=215971 Reviewed by Tim Horton. Source/WebKit: Various pieces of platform logic in Mac Catalyst depend on the user interface idiom (i.e. Mac or iPad) of the app, as well as the application-wide "scale factor". In the context of this bug, NSAttributedString to RTF data conversion methods in `UIFoundation` consult the scale factor of `UIiOSMacIdiomManager` to determine whether to emit 0 (standard) or 1 (iOS) for the `\cocoatextscaling` attribute. The fact that the web process' scale factor may be out of sync with the UI process' scale factor leads to copied RTF data in the web process appearing either larger or smaller than expected, due to an incorrect `NSTextScalingType` value. To mitigate this (as well as any other issues), we add a mechanism for the UI process to forward the global scale factor and user interface idiom to the web process inside of the web process creation parameters, and then use new UIKit SPI to override the scale factor and idiom within the web process. * Scripts/process-entitlements.sh: Add a new entitlement needed to use `_UIApplicationCatalystRequestViewServiceIdiomAndScaleFactor`. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): Use `_UIApplicationCatalystUserInterfaceIdiom` and `_UIApplicationCatalystScaleFactor` to grab the global user interface idiom and scale factor, respectively. * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): Override the idiom and scale factor in the web process with the idiom and scale factor from the UI process, using the new SPI `_UIApplicationCatalystRequestViewServiceIdiomAndScaleFactor`. As this function hasn't landed yet, we soft link the function for now to avoid causing the web process to instantly crash on any builds without the fix for . Source/WTF: Add a new flag to guard the presence of `_UIApplicationCatalystUserInterfaceIdiom`, `_UIApplicationCatalystScaleFactor`, and `_UIApplicationCatalystRequestViewServiceIdiomAndScaleFactor`. * wtf/PlatformHave.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266802 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-09-09 Wenson Hsieh Text copied and pasted from Mac Catalyst apps appears larger than expected https://bugs.webkit.org/show_bug.cgi?id=215971 Reviewed by Tim Horton. Add a new flag to guard the presence of `_UIApplicationCatalystUserInterfaceIdiom`, `_UIApplicationCatalystScaleFactor`, and `_UIApplicationCatalystRequestViewServiceIdiomAndScaleFactor`. * wtf/PlatformHave.h: 2020-09-17 Alan Coon Cherry-pick r266827. rdar://problem/69101047 [CG] REGRESSION (Big Sur): A GIF image with a finite loopCount loops an extra cycle https://bugs.webkit.org/show_bug.cgi?id=216018 Patch by Said Abou-Hallawa on 2020-09-10 Reviewed by Tim Horton. Source/WebCore: Remove the extra 'one' we used to add to the GIF loopCount since it is now added by the underlying frameworks. But make sure we are compatible with the older versions of macOS and iOS. * platform/graphics/cg/ImageDecoderCG.cpp: (WebCore::ImageDecoderCG::repetitionCount const): Source/WTF: Add a new macro for the new accurate behavior of CGImageSource. Unrelated change: Fix the conditions for enabling the WebP images. * wtf/PlatformHave.h: LayoutTests: * platform/mac/TestExpectations: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266827 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-09-10 Said Abou-Hallawa [CG] REGRESSION (Big Sur): A GIF image with a finite loopCount loops an extra cycle https://bugs.webkit.org/show_bug.cgi?id=216018 Reviewed by Tim Horton. Add a new macro for the new accurate behavior of CGImageSource. Unrelated change: Fix the conditions for enabling the WebP images. * wtf/PlatformHave.h: 2020-09-14 Alan Coon Cherry-pick r266898. rdar://problem/68881029 Disable hardware JPEG decoding on x86 Mac https://bugs.webkit.org/show_bug.cgi?id=216377 Reviewed by Geoff Garen. Source/WebCore/PAL: Add wrappers for a new MediaToolbox SPI that allows us to disable HW JPEG decoding. * PAL.xcodeproj/project.pbxproj: * pal/PlatformMac.cmake: * pal/cocoa/MediaToolboxSoftLink.cpp: * pal/cocoa/MediaToolboxSoftLink.h: Source/WebKit: In Big Sur, ImageIO uses hardware JPEG decoding automatically for certain JPEGs. This caused a small regression in our battery life benchmark since the one-time setup cost for the decoder (~20-30 ms per process) was higher than the per-decode win we got from the HW decoder. For now, we're reverting to the Catalina behavior of not using hardware JPEG on x86 Macs by calling a MediaToolbox SPI. (The tradeoffs for Apple Silicon are different so we use ImageIO's default heuristics on that architecture.) We plan to revisit this decision once we move to a GPUProcess world. * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): Source/WTF: Add macros to disable HW JPEG decoding on x86 Macs and indicate the presence of a new MediaToolbox SPI. (The latter is to prevent unnecessary dlopen/dlsym calls since we soft-link MediaToolbox.) * wtf/PlatformEnableCocoa.h: * wtf/PlatformHave.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266898 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-09-10 Ben Nham Disable hardware JPEG decoding on x86 Mac https://bugs.webkit.org/show_bug.cgi?id=216377 Reviewed by Geoff Garen. Add macros to disable HW JPEG decoding on x86 Macs and indicate the presence of a new MediaToolbox SPI. (The latter is to prevent unnecessary dlopen/dlsym calls since we soft-link MediaToolbox.) * wtf/PlatformEnableCocoa.h: * wtf/PlatformHave.h: 2020-09-14 Alan Coon Cherry-pick r266844. rdar://problem/68880990 [Cocoa] PERF: Don't instantiate AVPlayer-based audio decoders or renderers if an element is initially muted. https://bugs.webkit.org/show_bug.cgi?id=216299 Reviewed by Eric Carlson. Source/WebCore: When an AVPlayer is created, even if muted, it will still instantiate an audio decoder and renderer if the AVAsset in the current player item has an audio track. Ostensibly, this is so that an unmute operation is instantaneous, as it's merely applying a zero gain to the decoded audio. However for web content, there's many autoplaying, muted