haikuwebkit/Source/WTF/wtf/PlatformHave.h

1121 lines
36 KiB
C
Raw Permalink Normal View History

/*
Returning sRGB from CG color space functions on failure is too error prone https://bugs.webkit.org/show_bug.cgi?id=221676 Reviewed by Darin Adler. Source/WebCore: * platform/graphics/cg/ColorCG.cpp: (WebCore::leakCGColor): Switch to checking for nullptr rather than sRGB and be explicit about where we can and cannot use conversion to ExtendedSRGB, rather than the old behavior where we would secretly use sRGB on platforms without ExtendedSRGB and expect CG to clamp for us. * platform/graphics/cg/ColorSpaceCG.cpp: (WebCore::sRGBColorSpaceRef): (WebCore::adobeRGB1998ColorSpaceRef): (WebCore::displayP3ColorSpaceRef): (WebCore::extendedSRGBColorSpaceRef): (WebCore::ITUR_2020ColorSpaceRef): (WebCore::labColorSpaceRef): (WebCore::linearSRGBColorSpaceRef): (WebCore::ROMMRGBColorSpaceRef): (WebCore::xyzColorSpaceRef): * platform/graphics/cg/ColorSpaceCG.h: (WebCore::cachedNullableCGColorSpace): (WebCore::cachedCGColorSpace): Rename cachedCGColorSpace to cachedNullableCGColorSpace to indicate that it can now return nullptr for unsupported color spaces. Add explicit guards around color space accessors to ensure they are only called on platforms where they are known to be supported. * platform/graphics/cg/GradientCG.cpp: (WebCore::Gradient::createCGGradient): Be explicit about which color space is being used for the gradien when extended colors are present. This is the same behavior as before, but previously it would happen silently beneath extendedSRGBColorSpaceRef() which is a suprising result. Source/WTF: * wtf/PlatformHave.h: Add specific macros for color spaces supported by Core Graphics. Canonical link: https://commits.webkit.org/233976@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272736 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-02-11 17:43:57 +00:00
* Copyright (C) 2006-2021 Apple Inc. All rights reserved.
* Copyright (C) 2007-2009 Torch Mobile, Inc.
* Copyright (C) 2010, 2011 Research In Motion Limited. 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
#ifndef WTF_PLATFORM_GUARD_AGAINST_INDIRECT_INCLUSION
#error "Please #include <wtf/Platform.h> instead of this file directly."
#endif
/* HAVE() - specific system features (headers, functions or similar) that are present or not */
#define HAVE(WTF_FEATURE) (defined HAVE_##WTF_FEATURE && HAVE_##WTF_FEATURE)
#if defined(HAVE_FEATURES_H) && HAVE_FEATURES_H
/* If the included features.h is glibc's one, __GLIBC__ is defined. */
#include <features.h>
#endif
#if CPU(ARM_NEON)
/* All NEON intrinsics usage can be disabled by this macro. */
#define HAVE_ARM_NEON_INTRINSICS 1
#endif
/* FIXME: This should be renamed to WTF_CPU_ARM_IDIV_INSTRUCTIONS and moved to CPU.h */
#if defined(__ARM_ARCH_EXT_IDIV__) || CPU(APPLE_ARMV7S)
#define HAVE_ARM_IDIV_INSTRUCTIONS 1
#endif
#if PLATFORM(COCOA)
#define HAVE_OUT_OF_PROCESS_LAYER_HOSTING 1
#endif
#if PLATFORM(COCOA)
#define HAVE_REMAP_JIT 1
#endif
#if PLATFORM(MAC)
#define HAVE_SEC_KEYCHAIN 1
#endif
#if PLATFORM(MAC)
#define HAVE_HISERVICES 1
#endif
#if PLATFORM(IOS_FAMILY)
#define HAVE_READLINE 1
#endif
#if PLATFORM(IOS_FAMILY) && CPU(ARM_NEON)
#undef HAVE_ARM_NEON_INTRINSICS
#define HAVE_ARM_NEON_INTRINSICS 0
#endif
#if !defined(HAVE_VISIBILITY_PROPAGATION_VIEW) && PLATFORM(IOS_FAMILY)
#define HAVE_VISIBILITY_PROPAGATION_VIEW 1
#endif
#if !defined(HAVE_AVSTREAMSESSION) && PLATFORM(MAC)
#define HAVE_AVSTREAMSESSION 1
#endif
#if !defined(USE_UIKIT_KEYBOARD_ADDITIONS) && (PLATFORM(IOS) || PLATFORM(MACCATALYST))
#define USE_UIKIT_KEYBOARD_ADDITIONS 1
#endif
#if !defined(HAVE_ACCESSIBILITY) && (PLATFORM(COCOA) || PLATFORM(WIN) || PLATFORM(GTK) || PLATFORM(WPE))
#define HAVE_ACCESSIBILITY 1
#endif
#if !defined(HAVE_TIMINGSAFE_BCMP) && (PLATFORM(COCOA) || OS(OPENBSD) || OS(FREEBSD))
#define HAVE_TIMINGSAFE_BCMP 1
#endif
[PlayStation] Implement FileSystem without std::filesystem https://bugs.webkit.org/show_bug.cgi?id=226197 Reviewed by Chris Dumez. .: Expose the result of the check for <filesystem> support as HAVE_STD_FILESYSTEM. * Source/cmake/OptionsCommon.cmake: Source/WTF: The PlayStation 4 doesn't have support in its SDK for std::filesystem so backport the functions jettisoned from FileSystemPOSIX and add them to a FileSystemPlayStation.cpp. The ordering matches the contents of FileSystem.cpp. Most of the functions ported to std::filesystem were just moved over as is from the commit prior to r276879. Minor changes to the function signatures made when required. The fileTypePotentiallyFollowingSymLinks function was created from the previous behavior of fileMetadataUsingFunction and toFileMetataType. The hardLinkCount was created from looking at the behavior hardLinkCount replaced in r277446. * wtf/FileSystem.cpp: * wtf/PlatformHave.h: * wtf/PlatformPlayStation.cmake: * wtf/StdFilesystem.h: * wtf/playstation/FileSystemPlayStation.cpp: Added. (WTF::FileSystemImpl::fileTypePotentiallyFollowingSymLinks): (WTF::FileSystemImpl::fileExists): (WTF::FileSystemImpl::deleteFile): (WTF::FileSystemImpl::deleteEmptyDirectory): (WTF::FileSystemImpl::moveFile): (WTF::FileSystemImpl::fileSize): (WTF::FileSystemImpl::makeAllDirectories): (WTF::FileSystemImpl::volumeFreeSpace): (WTF::FileSystemImpl::createSymbolicLink): (WTF::FileSystemImpl::hardLink): (WTF::FileSystemImpl::hardLinkOrCopyFile): (WTF::FileSystemImpl::hardLinkCount): (WTF::FileSystemImpl::deleteNonEmptyDirectory): (WTF::FileSystemImpl::fileModificationTime): (WTF::FileSystemImpl::updateFileModificationTime): (WTF::FileSystemImpl::isHiddenFile): (WTF::FileSystemImpl::fileType): (WTF::FileSystemImpl::fileTypeFollowingSymlinks): (WTF::FileSystemImpl::pathFileName): (WTF::FileSystemImpl::parentPath): (WTF::FileSystemImpl::realPath): (WTF::FileSystemImpl::pathByAppendingComponent): (WTF::FileSystemImpl::pathByAppendingComponents): (WTF::FileSystemImpl::listDirectory): Canonical link: https://commits.webkit.org/238124@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278027 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-25 17:34:01 +00:00
#if !defined(HAVE_STD_FILESYSTEM)
#if __has_include(<filesystem>)
#define HAVE_STD_FILESYSTEM 1
#else
#define HAVE_STD_FILESYSTEM 0
#endif
#endif
#if !defined(HAVE_STD_EXPERIMENTAL_FILESYSTEM)
#if __has_include(<experimental/filesystem>)
#define STD_EXPERIMENTAL_FILESYSTEM 1
#else
#define STD_EXPERIMENTAL_FILESYSTEM 0
#endif
#endif
/* FIXME: Remove after CMake build enabled on Darwin */
#if OS(DARWIN)
#define HAVE_ERRNO_H 1
#endif
#if OS(DARWIN)
#define HAVE_LANGINFO_H 1
#endif
#if OS(DARWIN)
#define HAVE_LOCALTIME_R 1
#endif
#if OS(DARWIN)
#define HAVE_MMAP 1
#endif
#if OS(DARWIN)
#define HAVE_REGEX_H 1
#endif
#if OS(DARWIN)
#define HAVE_SIGNAL_H 1
#endif
#if OS(DARWIN)
#define HAVE_STAT_BIRTHTIME 1
#endif
#if OS(DARWIN)
#define HAVE_STRNSTR 1
#endif
#if OS(DARWIN)
#define HAVE_SYS_PARAM_H 1
#endif
#if OS(DARWIN)
#define HAVE_SYS_TIME_H 1
#endif
#if OS(DARWIN)
#define HAVE_TM_GMTOFF 1
#endif
#if OS(DARWIN)
#define HAVE_TM_ZONE 1
#endif
#if OS(DARWIN)
#define HAVE_TIMEGM 1
#endif
#if OS(DARWIN)
#define HAVE_PTHREAD_MAIN_NP 1
#endif
#if OS(DARWIN) && (CPU(X86_64) || CPU(ARM64))
#define HAVE_INT128_T 1
#endif
#if OS(UNIX) && !OS(FUCHSIA)
#define HAVE_RESOURCE_H 1
#endif
#if OS(UNIX) && !OS(FUCHSIA)
#define HAVE_PTHREAD_SETSCHEDPARAM 1
#endif
#if OS(DARWIN)
#define HAVE_DISPATCH_H 1
#endif
#if OS(DARWIN)
#define HAVE_MADV_FREE 1
#endif
#if OS(DARWIN)
#define HAVE_MADV_FREE_REUSE 1
#endif
#if OS(DARWIN)
#define HAVE_MADV_DONTNEED 1
#endif
#if OS(DARWIN)
#define HAVE_PTHREAD_SETNAME_NP 1
#endif
#if OS(DARWIN)
#define HAVE_READLINE 1
#endif
#if OS(DARWIN)
#define HAVE_SYS_TIMEB_H 1
#endif
#if OS(DARWIN)
#define HAVE_AUDIT_TOKEN 1
#endif
#if OS(DARWIN) && __has_include(<mach/mach_exc.defs>) && !PLATFORM(GTK)
#define HAVE_MACH_EXCEPTIONS 1
#endif
[GPUProcess] Move ownership of RingBuffer backing used by RemoteAudioSourceProviderManager::RemoteAudio to WebProcess https://bugs.webkit.org/show_bug.cgi?id=221048 Reviewed by Geoffrey Garen. Move ownership of RingBuffer backing used by RemoteAudioSourceProviderManager::RemoteAudio from the GPUProcess to WebProcess, for jetsam purposes. This moves half a megabyte of memory from the GPUProcess to the WebProcess on https://foobar404.github.io/Wave.js. * Platform/SharedMemory.cpp: (WebKit::SharedMemory::Handle::takeOwnershipOfMemory const): * Platform/SharedMemory.h: Add takeOwnershipOfMemory() API to SharedMemory::Handle to take ownership of memory and assign it to a particular memory ledger, via mach_memory_entry_ownership(). * Platform/cocoa/SharedMemoryCocoa.cpp: (WebKit::toVMMemoryLedger): (WebKit::SharedMemory::Handle::takeOwnershipOfMemory const): Add implementation to take ownership of memory when given a mach port. (WebKit::SharedMemory::allocate): Add VM_FLAGS_PURGABLE flag when calling mach_vm_allocate() so that memory ownership can be transferred later on. (WebKit::makeMemoryEntry): First try to call mach_make_memory_entry_64() without the MAP_MEM_VM_SHARE flag since this flag prevents transfer of the memory ownership via mach_memory_entry_ownership(). If this fails, we try again with the MAP_MEM_VM_SHARE flag, to be safe. MAP_MEM_VM_SHARE allows the memory entry to cover any virtual range, possibly backed by multiple VM objects. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: * WebProcess/com.apple.WebProcess.sb.in: Tweak the sandbox to allow the WebProcess to call mach_memory_entry_ownership(). * WebProcess/GPU/media/RemoteAudioSourceProviderManager.cpp: (WebKit::RemoteAudioSourceProviderManager::RemoteAudio::setStorage): Take ownership of RingBuffer backing memory. Canonical link: https://commits.webkit.org/233422@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271989 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-27 23:58:02 +00:00
#if OS(DARWIN) && __has_include(<mach/memory_entry.h>)
#define HAVE_MACH_MEMORY_ENTRY 1
#endif
#if PLATFORM(MAC)
#define HAVE_HOSTED_CORE_ANIMATION 1
#endif
#if OS(DARWIN) || OS(FUCHSIA) || OS(HAIKU) || ((OS(FREEBSD) || OS(LINUX)) && (CPU(X86) || CPU(X86_64) || CPU(ARM) || CPU(ARM64) || CPU(MIPS)))
#define HAVE_MACHINE_CONTEXT 1
#endif
#if OS(DARWIN) || OS(HAIKU) || (OS(LINUX) && defined(__GLIBC__) && !defined(__UCLIBC__) && !CPU(MIPS))
#define HAVE_BACKTRACE 1
#endif
#if (OS(DARWIN) || OS(LINUX)) && (PLATFORM(GTK) || PLATFORM(WPE)) && defined(__GLIBC__) && !defined(__UCLIBC__) && !CPU(MIPS)
#define HAVE_BACKTRACE_SYMBOLS 1
#endif
#if OS(DARWIN) || OS(HAIKU) || OS(LINUX)
#define HAVE_DLADDR 1
#endif
#if __has_include(<System/pthread_machdep.h>)
#define HAVE_FAST_TLS 1
#endif
#if COMPILER(GCC_COMPATIBLE)
#define HAVE_COMPUTED_GOTO 1
#endif
#if CPU(ARM64E) && OS(DARWIN)
#define HAVE_FJCVTZS_INSTRUCTION 1
#endif
#if PLATFORM(IOS) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500)
#define HAVE_APP_LINKS 1
#endif
#if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST)
#define HAVE_CELESTIAL 1
#endif
#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000
#define HAVE_FIG_PHOTO_DECOMPRESSION_SET_HARDWARE_CUTOFF 1
#endif
#if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST)
#define HAVE_CORE_ANIMATION_RENDER_SERVER 1
#endif
#if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST) && !PLATFORM(APPLETV)
#define HAVE_PARENTAL_CONTROLS_WITH_UNBLOCK_HANDLER 1
#endif
#if PLATFORM(COCOA) && (!PLATFORM(APPLETV) && (!PLATFORM(WATCHOS) || !PLATFORM(IOS_FAMILY_SIMULATOR) || __WATCH_OS_VERSION_MIN_REQUIRED >= 70000))
#define HAVE_PARENTAL_CONTROLS 1
#endif
#if PLATFORM(COCOA) && !PLATFORM(APPLETV)
#define HAVE_AVKIT 1
#endif
#if PLATFORM(COCOA)
#define HAVE_MEDIA_ACCESSIBILITY_FRAMEWORK 1
#endif
#if PLATFORM(MAC) || PLATFORM(MACCATALYST)
#define HAVE_APPLE_GRAPHICS_CONTROL 1
#endif
#if PLATFORM(MAC) || PLATFORM(MACCATALYST)
#define HAVE_NSCURSOR 1
#endif
#if !defined(HAVE_QOS_CLASSES) && PLATFORM(COCOA)
#define HAVE_QOS_CLASSES 1
#endif
#if PLATFORM(COCOA)
#define HAVE_AVASSETREADER 1
#endif
#if PLATFORM(COCOA)
#define HAVE_IOSURFACE 1
#endif
Remove ENABLE_WEBPROCESS_WINDOWSERVER_BLOCKING which is always true for macOS https://bugs.webkit.org/show_bug.cgi?id=222459 Reviewed by Sam Weinig. ENABLE_WEBPROCESS_WINDOWSERVER_BLOCKING is always defined for PLATFORM(MAC), so remove it, replacing with PLATFORM(MAC) in a few places. In order to reduce the number PLATFORM(MAC), define HAVE(CVDISPLAYLINK) and use it in WK2 code that relates to DisplayLinks. Source/WebCore: * platform/graphics/cocoa/IOSurface.mm: (WebCore::IOSurface::ensurePlatformContext): * platform/graphics/opengl/GraphicsContextGLOpenGLManager.cpp: (WebCore::GraphicsContextGLOpenGLManager::addContext): (WebCore::GraphicsContextGLOpenGLManager::removeContext): * platform/mac/KeyEventMac.mm: (WebCore::PlatformKeyboardEvent::currentStateOfModifierKeys): * platform/mac/PlatformScreenMac.mm: (WebCore::gpuIDForDisplay): * platform/mac/ScrollAnimatorMac.mm: (-[WebScrollbarPartAnimation initWithScrollbar:featureToAnimate:animateFrom:animateTo:duration:]): (-[WebScrollbarPartAnimation startAnimation]): (-[WebScrollbarPartAnimation setCurrentProgress:]): (-[WebScrollbarPartAnimation stopAnimation]): (-[WebScrollbarPartAnimation setCurrentProgress:setCurrentProgress:]): Deleted. Source/WebKit: * Platform/cocoa/LayerHostingContext.mm: (WebKit::LayerHostingContext::createForExternalHostingProcess): * Shared/mac/HangDetectionDisablerMac.mm: (WebKit::setClientsMayIgnoreEvents): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::registerNotificationObservers): (WebKit::WebProcessPool::unregisterNotificationObservers): * UIProcess/WebPageProxy.cpp: (WebKit::ScrollingObserver::singleton): (WebKit::WebPageProxy::sendWheelEvent): (WebKit::WebPageProxy::updateCurrentModifierState): * UIProcess/WebProcessPool.cpp: (WebKit::displayReconfigurationCallBack): (WebKit::WebProcessPool::sendDisplayConfigurationChangedMessageForTesting): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::~WebProcessProxy): (WebKit::WebProcessProxy::processWillShutDown): * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * UIProcess/mac/DisplayLink.cpp: * UIProcess/mac/DisplayLink.h: * UIProcess/mac/WebProcessProxyMac.mm: (WebKit::WebProcessProxy::stopDisplayLink): * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm: (WebKit::InjectedBundle::initialize): * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h: * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::PDFPlugin): * WebProcess/WebPage/DrawingArea.cpp: * WebProcess/WebPage/EventDispatcher.cpp: * WebProcess/WebPage/EventDispatcher.h: * WebProcess/WebPage/EventDispatcher.messages.in: * WebProcess/WebPage/mac/DrawingAreaMac.cpp: (WebKit::DrawingArea::createDisplayRefreshMonitor): * WebProcess/WebProcess.cpp: * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): (WebKit::WebProcess::platformInitializeProcess): Source/WTF: * wtf/PlatformEnable.h: * wtf/PlatformEnableCocoa.h: * wtf/PlatformHave.h: Canonical link: https://commits.webkit.org/234697@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273657 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-01 19:15:01 +00:00
#if PLATFORM(MAC)
#define HAVE_CVDISPLAYLINK 1
#endif
#if PLATFORM(IOS_FAMILY) && !PLATFORM(IOS_FAMILY_SIMULATOR)
#define HAVE_IOSURFACE_COREIMAGE_SUPPORT 1
#endif
#if PLATFORM(IOS_FAMILY) && !PLATFORM(IOS_FAMILY_SIMULATOR) && !PLATFORM(MACCATALYST)
#define HAVE_IOSURFACE_ACCELERATOR 1
#endif
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) \
|| (((PLATFORM(IOS) && !PLATFORM(IOS_FAMILY_SIMULATOR)) || PLATFORM(MACCATALYST)) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000) \
|| (PLATFORM(WATCHOS) && !PLATFORM(IOS_FAMILY_SIMULATOR) && __WATCH_OS_VERSION_MIN_REQUIRED >= 60000) \
|| (PLATFORM(APPLETV) && !PLATFORM(IOS_FAMILY_SIMULATOR) && __TV_OS_VERSION_MIN_REQUIRED >= 130000)
#define HAVE_IOSURFACE_SET_OWNERSHIP 1
#endif
Set ownership of IOSurfaces from the GPUProcess instead of the WebProcess https://bugs.webkit.org/show_bug.cgi?id=222391 Source/WebCore: <rdar://problem/74748353> Reviewed by Simon Fraser. Replace use of IOSurfaceSetOwnership() SPI with IOSurfaceSetOwnershipIdentity(). Both do the same thing but IOSurfaceSetOwnershipIdentity() only requires an identity token for the new owner (instead of a control port). As a result, IOSurfaceSetOwnershipIdentity() requires a lot less priviledges and can now be used directly in the GPUProcess instead of the WebProcess. * platform/graphics/cocoa/IOSurface.h: * platform/graphics/cocoa/IOSurface.mm: (WebCore::IOSurface::setOwnershipIdentity): Source/WebCore/PAL: <rdar://74748353> Reviewed by Simon Fraser. Add declaration for new IOSurfaceSetOwnershipIdentity() SPI, for the open source SDK. * pal/spi/cocoa/IOSurfaceSPI.h: Source/WebKit: <rdar://problem/74748353> Reviewed by Simon Fraser. Replace use of IOSurfaceSetOwnership() SPI with IOSurfaceSetOwnershipIdentity(). Both do the same thing but IOSurfaceSetOwnershipIdentity() only requires an identity token for the new owner (instead of a control port). As a result, IOSurfaceSetOwnershipIdentity() requires a lot less priviledges and can now be used directly in the GPUProcess instead of the WebProcess. * GPUProcess/graphics/RemoteGraphicsContextGLCocoa.cpp: (WebKit::RemoteGraphicsContextGLCocoa::prepareForDisplay): * GPUProcess/graphics/RemoteImageBuffer.h: (WebKit::RemoteImageBuffer::setProcessOwnership): * GPUProcess/graphics/RemoteRenderingBackend.cpp: (WebKit::RemoteRenderingBackend::createImageBuffer): * WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp: (WebKit::RemoteGraphicsContextGLProxy::prepareForDisplay): * WebProcess/GPU/graphics/cocoa/ImageBufferShareableMappedIOSurfaceBackend.cpp: (WebKit::ImageBufferShareableMappedIOSurfaceBackend::create): (WebKit::ImageBufferShareableMappedIOSurfaceBackend::setProcessOwnership): * WebProcess/GPU/graphics/cocoa/ImageBufferShareableMappedIOSurfaceBackend.h: Source/WTF: <rdar://74748353> Reviewed by Simon Fraser. Add HAVE_IOSURFACE_SET_OWNERSHIP_IDENTITY feature flag to protect uses of the new IOSurfaceSetOwnershipIdentity() SPI. * wtf/PlatformHave.h: Canonical link: https://commits.webkit.org/234864@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273903 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-04 18:41:02 +00:00
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 120000) \
|| (((PLATFORM(IOS) && !PLATFORM(IOS_FAMILY_SIMULATOR)) || PLATFORM(MACCATALYST)) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 150000) \
|| (PLATFORM(WATCHOS) && !PLATFORM(IOS_FAMILY_SIMULATOR) && __WATCH_OS_VERSION_MIN_REQUIRED >= 80000) \
|| (PLATFORM(APPLETV) && !PLATFORM(IOS_FAMILY_SIMULATOR) && __TV_OS_VERSION_MIN_REQUIRED >= 150000)
#define HAVE_IOSURFACE_SET_OWNERSHIP_IDENTITY 1
#endif
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 120000) \
|| ((PLATFORM(IOS) || PLATFORM(MACCATALYST)) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 150000) \
|| (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 80000) \
|| (PLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 150000)
#define HAVE_NETWORK_CONNECTION_PRIVACY_STANCE 1
#endif
Prepare for memory ownership transfer in the GPUProcess https://bugs.webkit.org/show_bug.cgi?id=222122 Reviewed by Simon Fraser. Source/WebKit: Prepare for memory ownership transfer in the GPUProcess: 1. Have the WebProcess create a task identity token and pass it to the GPUProcess when connecting to it. The WebProcess' task identity token is then stored on the GPUConnectionToWebProcess object. 2. Add the entitlement to the GPUProcess that is needed to transfer memory ownership to another process. This is a first step towards having the GPUProcess transfer memory ownership of its IOSurfaces and Metal textures to the WebProcesses it is serving. * GPUProcess/GPUConnectionToWebProcess.cpp: (WebKit::GPUConnectionToWebProcess::create): (WebKit::GPUConnectionToWebProcess::GPUConnectionToWebProcess): * GPUProcess/GPUConnectionToWebProcess.h: (WebKit::GPUConnectionToWebProcess::webProcessIdentityToken const): * GPUProcess/GPUProcess.cpp: (WebKit::GPUProcess::createGPUConnectionToWebProcess): * GPUProcess/GPUProcess.h: * GPUProcess/GPUProcess.messages.in: * Scripts/process-entitlements.sh: * Shared/GPUProcessConnectionParameters.h: Copied from Source/WTF/wtf/MachSendRight.h. (WebKit::GPUProcessConnectionParameters::encode const): (WebKit::GPUProcessConnectionParameters::decode): * UIProcess/GPU/GPUProcessProxy.cpp: (WebKit::GPUProcessProxy::getGPUProcessConnection): * UIProcess/GPU/GPUProcessProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::getGPUProcessConnection): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::getGPUProcessConnection): * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::platformInitializeGPUProcessConnectionParameters): (WebKit::WebProcess::getGPUProcessConnection): * WebProcess/WebProcess.h: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeGPUProcessConnectionParameters): Source/WTF: * wtf/PlatformHave.h: Add feature flag for TASK_IDENTITY_TOKEN as this API was only introduced very recently. * wtf/MachSendRight.h: * wtf/cocoa/MachSendRight.cpp: (WTF::MachSendRight::MachSendRight): (WTF::MachSendRight::operator=): Add a copy constructor to MachSendRight for convenience. Canonical link: https://commits.webkit.org/234450@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273288 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-02-23 00:31:56 +00:00
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 110300) \
|| (((PLATFORM(IOS) && !PLATFORM(IOS_FAMILY_SIMULATOR)) || PLATFORM(MACCATALYST)) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 140500) \
|| (PLATFORM(WATCHOS) && !PLATFORM(IOS_FAMILY_SIMULATOR) && __WATCH_OS_VERSION_MAX_ALLOWED >= 70500) \
|| (PLATFORM(APPLETV) && !PLATFORM(IOS_FAMILY_SIMULATOR) && __TV_OS_VERSION_MAX_ALLOWED >= 140500)
#define HAVE_TASK_IDENTITY_TOKEN 1
#endif
#if PLATFORM(MAC)
#define HAVE_NS_ACTIVITY 1
#endif
#if PLATFORM(COCOA)
#define HAVE_SEC_TRUST_SERIALIZATION 1
#endif
#if PLATFORM(MAC)
#define HAVE_TOUCH_BAR 1
#endif
#if PLATFORM(COCOA) && !(PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101500) && !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
#define HAVE_HSTS_STORAGE_PATH 1
#endif
[Mac] Remove __MAC_OS_X_VERSION_MIN_REQUIRED checks for versions older than 10.14 https://bugs.webkit.org/show_bug.cgi?id=211420 Reviewed by Alex Christensen. Source/WebCore: * editing/cocoa/DataDetection.mm: (WebCore::detectItem): Remove __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * editing/cocoa/HTMLConverter.mm: (_WebMessageDocumentClass): Ditto. * platform/graphics/cg/GraphicsContextCG.cpp: Ditto. * platform/mac/WebCoreFullScreenPlaceholderView.mm: (-[WebCoreFullScreenPlaceholderView initWithFrame:]): Ditto. * platform/network/cocoa/CookieCocoa.mm: (WebCore::nsSameSitePolicy): Ditto. (WebCore::Cookie::operator NSHTTPCookie * _Nullable const): Ditto. * platform/network/cocoa/NetworkStorageSessionCocoa.mm: (WebCore::cookiesForURL): Ditto. (WebCore::NetworkStorageSession::setHTTPCookiesForURL const): Ditto. * platform/network/cocoa/ResourceRequestCocoa.mm: (WebCore::ResourceRequest::doUpdateResourceRequest): Ditto. (WebCore::siteForCookies): Ditto. (WebCore::ResourceRequest::doUpdatePlatformRequest): Ditto. * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::paintTextField): Ditto. * testing/Internals.h: Ditto. Source/WebCore/PAL: * pal/spi/cocoa/NSColorSPI.h: Remove __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * pal/spi/cocoa/QuartzCoreSPI.h: Ditto. * pal/spi/mac/DataDetectorsSPI.h: Ditto. * pal/spi/mac/NSApplicationSPI.h: Ditto. Source/WebKit: * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm: (WebKit::Download::resume): Remove __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): Ditto. * PluginProcess/mac/PluginProcessMac.mm: (WebKit::PluginProcess::platformInitializePluginProcess): Ditto. * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm: (WebKit::XPCServiceMain): Ditto. * UIProcess/mac/ServicesController.mm: (WebKit::hasCompatibleServicesForItems): Ditto. * UIProcess/mac/WebProcessProxyMac.mm: (WebKit::WebProcessProxy::shouldAllowNonValidInjectedCode const): Ditto. Source/WebKitLegacy/mac: * WebView/WebHTMLView.mm: Remove __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. (-[WebHTMLView _recursive:displayRectIgnoringOpacity:inContext:stopAtLayerBackedViews:_recursive:displayRectIgnoringOpacity:inContext:shouldChangeFontReferenceColor:stopAtLayerBackedViews:]): Ditto. (-[WebHTMLView _recursive:displayRectIgnoringOpacity:inContext:stopAtLayerBackedViews:_recursive:displayRectIgnoringOpacity:inContext:shouldChangeFontReferenceColor:stopAtLayerBackedViews:_recursive:displayRectIgnoringOpacity:inContext:shouldChangeFontReferenceColor:]): Deleted. (-[WebHTMLView _recursive:displayRectIgnoringOpacity:inGraphicsContext:shouldChangeFontReferenceColor:]): Deleted. * WebView/WebTextCompletionController.mm: (-[WebTextCompletionController _buildUI]): Remove some code only compiled with __MAC_OS_X_VERSION_MIN_REQUIRED < 101400. Source/WTF: * WTF.xcodeproj/project.pbxproj: Removed DeprecatedSymbolsUsedBySafari.mm. * wtf/PlatformEnableCocoa.h: Removed __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * wtf/PlatformHave.h: Ditto. This leaves behind some cases of "PLATFORM(MAC) || PLATFORM(IOS)" that should probably be turned on for watchOS and tvOS too, eventually. Also "PLATFORM(MAC) || PLATFORM(IOS) || PLATFORM(MACCATALYST)". * wtf/PlatformMac.cmake: Removed DeprecatedSymbolsUsedBySafari.mm. * wtf/PlatformUse.h: Removed __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * wtf/mac/DeprecatedSymbolsUsedBySafari.mm: Removed. * wtf/spi/darwin/ProcessMemoryFootprint.h: Removed __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. Tools: * TestWebKitAPI/Tests/WebCore/CtapPinTest.cpp: Remove __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm: Removed code disabling this test for __MAC_OS_X_VERSION_MIN_REQUIRED < 101400. * TestWebKitAPI/config.h: Removed __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * WebKitTestRunner/InjectedBundle/cocoa/ActivateFontsCocoa.mm: (WTR::installFakeHelvetica): Removed __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. Canonical link: https://commits.webkit.org/224326@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@261153 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-05-05 05:51:47 +00:00
#if PLATFORM(MAC) || PLATFORM(IOS) || PLATFORM(MACCATALYST)
#define HAVE_URL_FORMATTING 1
#endif
#if !OS(WINDOWS)
#define HAVE_STACK_BOUNDS_FOR_NEW_THREAD 1
#endif
#if !OS(WINDOWS) && !PLATFORM(PLAYSTATION) && !OS(HAIKU)
Implement Request/Response consuming as FormData https://bugs.webkit.org/show_bug.cgi?id=215671 Patch by Alex Christensen <achristensen@webkit.org> on 2020-08-24 Reviewed by Darin Adler. LayoutTests/imported/w3c: * web-platform-tests/fetch/api/abort/general.any-expected.txt: * web-platform-tests/fetch/api/abort/general.any.worker-expected.txt: * web-platform-tests/fetch/api/request/request-consume-empty-expected.txt: This remaining failing test now fails similarly in all browsers. * web-platform-tests/fetch/api/request/request-consume-expected.txt: * web-platform-tests/fetch/api/request/request-init-002-expected.txt: * web-platform-tests/fetch/api/response/response-consume-empty-expected.txt: This remaining failing test now fails similarly in all browsers. * web-platform-tests/fetch/api/response/response-consume-expected.txt: * web-platform-tests/fetch/api/response/response-error-from-stream-expected.txt: This change makes the formData failures in this file look like all the other failures in this file, which should be fixed together in a separate patch. * web-platform-tests/fetch/api/response/response-init-002-expected.txt: * web-platform-tests/url/urlencoded-parser.any-expected.txt: * web-platform-tests/url/urlencoded-parser.any.worker-expected.txt: * web-platform-tests/service-workers/service-worker/fetch-event-respond-with-custom-response.https-expected.txt: Source/WebCore: Covered by many newly passing WPT tests, for most of which Safari was the only failing browser. * Modules/fetch/FetchBody.cpp: (WebCore::FetchBody::formData): (WebCore::FetchBody::consume): (WebCore::FetchBody::consumeFormData): * Modules/fetch/FetchBody.h: * Modules/fetch/FetchBodyConsumer.cpp: (WebCore::formDataFromData): (WebCore::resolveWithTypeAndData): (WebCore::FetchBodyConsumer::resolve): * Modules/fetch/FetchBodyConsumer.h: Source/WebKit: * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp: (WebKit::WebServiceWorkerFetchTaskClient::didReceiveFormDataAndFinish): Add a fast path that allows non-blob FormData responses from service workers to not hang. This part is covered by this layout test: imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-respond-with-custom-response.https.html Source/WTF: In order to be compatible with other browsers, we need a verson of String::fromUTF8 that uses U8_NEXT_OR_FFFD instead of U8_NEXT, but changing that across the board will break other things. Leave everything else as it is, use templates and constexpr to not add any branches, but add String::fromUTF8ReplacingInvalidSequences to allow me to make our FormData consuming compatible with other browsers. * wtf/text/WTFString.cpp: (WTF::fromUTF8Helper): (WTF::String::fromUTF8): (WTF::String::fromUTF8ReplacingInvalidSequences): * wtf/text/WTFString.h: * wtf/unicode/UTF8Conversion.cpp: (WTF::Unicode::convertUTF8ToUTF16Impl): (WTF::Unicode::convertUTF8ToUTF16): (WTF::Unicode::convertUTF8ToUTF16ReplacingInvalidSequences): * wtf/unicode/UTF8Conversion.h: Canonical link: https://commits.webkit.org/228563@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266087 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-08-24 22:36:02 +00:00
#define HAVE_MEMMEM 1
#endif
#if PLATFORM(MAC) || PLATFORM(IOS) || PLATFORM(MACCATALYST)
#define HAVE_AVCONTENTKEYSESSION 1
#endif
[Mac] Remove __MAC_OS_X_VERSION_MIN_REQUIRED checks for versions older than 10.14 https://bugs.webkit.org/show_bug.cgi?id=211420 Reviewed by Alex Christensen. Source/WebCore: * editing/cocoa/DataDetection.mm: (WebCore::detectItem): Remove __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * editing/cocoa/HTMLConverter.mm: (_WebMessageDocumentClass): Ditto. * platform/graphics/cg/GraphicsContextCG.cpp: Ditto. * platform/mac/WebCoreFullScreenPlaceholderView.mm: (-[WebCoreFullScreenPlaceholderView initWithFrame:]): Ditto. * platform/network/cocoa/CookieCocoa.mm: (WebCore::nsSameSitePolicy): Ditto. (WebCore::Cookie::operator NSHTTPCookie * _Nullable const): Ditto. * platform/network/cocoa/NetworkStorageSessionCocoa.mm: (WebCore::cookiesForURL): Ditto. (WebCore::NetworkStorageSession::setHTTPCookiesForURL const): Ditto. * platform/network/cocoa/ResourceRequestCocoa.mm: (WebCore::ResourceRequest::doUpdateResourceRequest): Ditto. (WebCore::siteForCookies): Ditto. (WebCore::ResourceRequest::doUpdatePlatformRequest): Ditto. * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::paintTextField): Ditto. * testing/Internals.h: Ditto. Source/WebCore/PAL: * pal/spi/cocoa/NSColorSPI.h: Remove __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * pal/spi/cocoa/QuartzCoreSPI.h: Ditto. * pal/spi/mac/DataDetectorsSPI.h: Ditto. * pal/spi/mac/NSApplicationSPI.h: Ditto. Source/WebKit: * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm: (WebKit::Download::resume): Remove __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): Ditto. * PluginProcess/mac/PluginProcessMac.mm: (WebKit::PluginProcess::platformInitializePluginProcess): Ditto. * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm: (WebKit::XPCServiceMain): Ditto. * UIProcess/mac/ServicesController.mm: (WebKit::hasCompatibleServicesForItems): Ditto. * UIProcess/mac/WebProcessProxyMac.mm: (WebKit::WebProcessProxy::shouldAllowNonValidInjectedCode const): Ditto. Source/WebKitLegacy/mac: * WebView/WebHTMLView.mm: Remove __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. (-[WebHTMLView _recursive:displayRectIgnoringOpacity:inContext:stopAtLayerBackedViews:_recursive:displayRectIgnoringOpacity:inContext:shouldChangeFontReferenceColor:stopAtLayerBackedViews:]): Ditto. (-[WebHTMLView _recursive:displayRectIgnoringOpacity:inContext:stopAtLayerBackedViews:_recursive:displayRectIgnoringOpacity:inContext:shouldChangeFontReferenceColor:stopAtLayerBackedViews:_recursive:displayRectIgnoringOpacity:inContext:shouldChangeFontReferenceColor:]): Deleted. (-[WebHTMLView _recursive:displayRectIgnoringOpacity:inGraphicsContext:shouldChangeFontReferenceColor:]): Deleted. * WebView/WebTextCompletionController.mm: (-[WebTextCompletionController _buildUI]): Remove some code only compiled with __MAC_OS_X_VERSION_MIN_REQUIRED < 101400. Source/WTF: * WTF.xcodeproj/project.pbxproj: Removed DeprecatedSymbolsUsedBySafari.mm. * wtf/PlatformEnableCocoa.h: Removed __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * wtf/PlatformHave.h: Ditto. This leaves behind some cases of "PLATFORM(MAC) || PLATFORM(IOS)" that should probably be turned on for watchOS and tvOS too, eventually. Also "PLATFORM(MAC) || PLATFORM(IOS) || PLATFORM(MACCATALYST)". * wtf/PlatformMac.cmake: Removed DeprecatedSymbolsUsedBySafari.mm. * wtf/PlatformUse.h: Removed __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * wtf/mac/DeprecatedSymbolsUsedBySafari.mm: Removed. * wtf/spi/darwin/ProcessMemoryFootprint.h: Removed __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. Tools: * TestWebKitAPI/Tests/WebCore/CtapPinTest.cpp: Remove __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm: Removed code disabling this test for __MAC_OS_X_VERSION_MIN_REQUIRED < 101400. * TestWebKitAPI/config.h: Removed __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * WebKitTestRunner/InjectedBundle/cocoa/ActivateFontsCocoa.mm: (WTR::installFakeHelvetica): Removed __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. Canonical link: https://commits.webkit.org/224326@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@261153 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-05-05 05:51:47 +00:00
#if PLATFORM(MAC) || PLATFORM(IOS) || PLATFORM(MACCATALYST)
#define HAVE_SEC_KEY_PROXY 1
#endif
/* FIXME: Should this be enabled for IOS_FAMILY, not just IOS? */
[Mac] Remove __MAC_OS_X_VERSION_MIN_REQUIRED checks for versions older than 10.14 https://bugs.webkit.org/show_bug.cgi?id=211420 Reviewed by Alex Christensen. Source/WebCore: * editing/cocoa/DataDetection.mm: (WebCore::detectItem): Remove __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * editing/cocoa/HTMLConverter.mm: (_WebMessageDocumentClass): Ditto. * platform/graphics/cg/GraphicsContextCG.cpp: Ditto. * platform/mac/WebCoreFullScreenPlaceholderView.mm: (-[WebCoreFullScreenPlaceholderView initWithFrame:]): Ditto. * platform/network/cocoa/CookieCocoa.mm: (WebCore::nsSameSitePolicy): Ditto. (WebCore::Cookie::operator NSHTTPCookie * _Nullable const): Ditto. * platform/network/cocoa/NetworkStorageSessionCocoa.mm: (WebCore::cookiesForURL): Ditto. (WebCore::NetworkStorageSession::setHTTPCookiesForURL const): Ditto. * platform/network/cocoa/ResourceRequestCocoa.mm: (WebCore::ResourceRequest::doUpdateResourceRequest): Ditto. (WebCore::siteForCookies): Ditto. (WebCore::ResourceRequest::doUpdatePlatformRequest): Ditto. * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::paintTextField): Ditto. * testing/Internals.h: Ditto. Source/WebCore/PAL: * pal/spi/cocoa/NSColorSPI.h: Remove __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * pal/spi/cocoa/QuartzCoreSPI.h: Ditto. * pal/spi/mac/DataDetectorsSPI.h: Ditto. * pal/spi/mac/NSApplicationSPI.h: Ditto. Source/WebKit: * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm: (WebKit::Download::resume): Remove __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): Ditto. * PluginProcess/mac/PluginProcessMac.mm: (WebKit::PluginProcess::platformInitializePluginProcess): Ditto. * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm: (WebKit::XPCServiceMain): Ditto. * UIProcess/mac/ServicesController.mm: (WebKit::hasCompatibleServicesForItems): Ditto. * UIProcess/mac/WebProcessProxyMac.mm: (WebKit::WebProcessProxy::shouldAllowNonValidInjectedCode const): Ditto. Source/WebKitLegacy/mac: * WebView/WebHTMLView.mm: Remove __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. (-[WebHTMLView _recursive:displayRectIgnoringOpacity:inContext:stopAtLayerBackedViews:_recursive:displayRectIgnoringOpacity:inContext:shouldChangeFontReferenceColor:stopAtLayerBackedViews:]): Ditto. (-[WebHTMLView _recursive:displayRectIgnoringOpacity:inContext:stopAtLayerBackedViews:_recursive:displayRectIgnoringOpacity:inContext:shouldChangeFontReferenceColor:stopAtLayerBackedViews:_recursive:displayRectIgnoringOpacity:inContext:shouldChangeFontReferenceColor:]): Deleted. (-[WebHTMLView _recursive:displayRectIgnoringOpacity:inGraphicsContext:shouldChangeFontReferenceColor:]): Deleted. * WebView/WebTextCompletionController.mm: (-[WebTextCompletionController _buildUI]): Remove some code only compiled with __MAC_OS_X_VERSION_MIN_REQUIRED < 101400. Source/WTF: * WTF.xcodeproj/project.pbxproj: Removed DeprecatedSymbolsUsedBySafari.mm. * wtf/PlatformEnableCocoa.h: Removed __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * wtf/PlatformHave.h: Ditto. This leaves behind some cases of "PLATFORM(MAC) || PLATFORM(IOS)" that should probably be turned on for watchOS and tvOS too, eventually. Also "PLATFORM(MAC) || PLATFORM(IOS) || PLATFORM(MACCATALYST)". * wtf/PlatformMac.cmake: Removed DeprecatedSymbolsUsedBySafari.mm. * wtf/PlatformUse.h: Removed __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * wtf/mac/DeprecatedSymbolsUsedBySafari.mm: Removed. * wtf/spi/darwin/ProcessMemoryFootprint.h: Removed __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. Tools: * TestWebKitAPI/Tests/WebCore/CtapPinTest.cpp: Remove __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm: Removed code disabling this test for __MAC_OS_X_VERSION_MIN_REQUIRED < 101400. * TestWebKitAPI/config.h: Removed __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * WebKitTestRunner/InjectedBundle/cocoa/ActivateFontsCocoa.mm: (WTR::installFakeHelvetica): Removed __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. Canonical link: https://commits.webkit.org/224326@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@261153 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-05-05 05:51:47 +00:00
#if PLATFORM(MAC) || PLATFORM(IOS)
#define HAVE_FOUNDATION_WITH_SAME_SITE_COOKIE_SUPPORT 1
#endif
#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED < 101400
#define HAVE_NSHTTPCOOKIESTORAGE__INITWITHIDENTIFIER_WITH_INACCURATE_NULLABILITY 1
#endif
[GTK][WPE] Support color-schemes CSS property https://bugs.webkit.org/show_bug.cgi?id=208204 Patch by Alexander Mikhaylenko <alexm@gnome.org> on 2021-07-16 Reviewed by Adrian Perez de Castro. .: * Source/cmake/OptionsGTK.cmake: Enable HAVE_OS_DARK_MODE_SUPPORT. * Source/cmake/OptionsWPE.cmake: Enable ENABLE_DARK_MODE_CSS and HAVE_OS_DARK_MODE_SUPPORT. Source/WebCore: Last time we tried enabling dark mode, we broke many webpages since we couldn't have diferent controls, and more importantly, different system colors and defaults for pages that do and don't support dark mode. Now that we don't use GTK for this, we can try again. This time, use hardcoded system colors and return different colors depending on StyleColor::Options::UseDarkAppearance. To avoid dark-on-dark text on entries, we also need to enable HAVE_OS_DARK_MODE_SUPPORT for GTK and make sure it's passed to use agent CSS. And since Adwaita controls are also used in WPE, we need to enable it for WPE as well, and since WPE didn't have ENABLE_DARK_MODE_CSS, flip that as well, all in lockstep. No new tests, reenabled the existing css-dark-mode tests. * PlatformGTK.cmake: * PlatformWPE.cmake: Pass HAVE_OS_DARK_MODE_SUPPORT to user agent CSS. * css/CSSValueKeywords.in: Expose -webkit-control-background for anything with HAVE_OS_DARK_MODE_SUPPORT. * css/themeAdwaita.css: (input[type="search"]::-webkit-search-results-button,): (input[type="search"]::-webkit-search-cancel-button): (body[dir="rtl"] input[type="search"]::-webkit-search-cancel-button): (input[type="search"]::-webkit-search-results-button:hover,): (input[type="search"]::-webkit-search-cancel-button:hover): Deleted. Use mask images instead of content so we can recolor them. Change color on hover as opacity and inherit entry's color otherwise to make sure it's legible with dark appearance. * page/FrameView.cpp: (WebCore::FrameView::updateBackgroundRecursively): Use CSSValueWindow for background instead of CSSValueAppleSystemControlBackground when the latter is not available. * platform/adwaita/ThemeAdwaita.cpp: (WebCore::ThemeAdwaita::focusColor): (WebCore::ThemeAdwaita::paintFocus): (WebCore::ThemeAdwaita::paintArrow): (WebCore::ThemeAdwaita::paint): (WebCore::ThemeAdwaita::paintCheckbox): (WebCore::ThemeAdwaita::paintRadio): (WebCore::ThemeAdwaita::paintButton): (WebCore::ThemeAdwaita::paintSpinButton): * platform/adwaita/ThemeAdwaita.h: * rendering/RenderThemeAdwaita.cpp: (WebCore::RenderThemeAdwaita::platformFocusRingColor const): (WebCore::RenderThemeAdwaita::systemColor const): (WebCore::RenderThemeAdwaita::paintTextField): (WebCore::RenderThemeAdwaita::adjustTextFieldStyle const): (WebCore::RenderThemeAdwaita::adjustTextAreaStyle const): (WebCore::RenderThemeAdwaita::adjustSearchFieldStyle const): Add a border radius to the default style, so the background doesn't bleed through the corners. (WebCore::RenderThemeAdwaita::paintMenuList): (WebCore::RenderThemeAdwaita::paintProgressBar): (WebCore::RenderThemeAdwaita::paintSliderTrack): (WebCore::RenderThemeAdwaita::paintSliderThumb): * rendering/RenderThemeAdwaita.h: Source/WTF: * wtf/PlatformHave.h: Enable HAVE_OS_DARK_MODE_SUPPORT for GTK and WPE. LayoutTests: Reenable css-dark-mode tests for GTK as they pass now. Enable the same tests in WPE. Keep css-dark-mode/older-syntax/supported-color-schemes-css.html as [ Pass Crash ] for now, according to https://bugs.webkit.org/show_bug.cgi?id=202229#c2 * platform/gtk/TestExpectations: * platform/gtk/css-dark-mode/color-scheme-css-expected.txt: Removed. * platform/gtk/css-dark-mode/color-scheme-meta-expected.txt: Removed. * platform/gtk/css-dark-mode/color-scheme-priority-expected.txt: Removed. * platform/gtk/css-dark-mode/default-colors-expected.txt: Removed. * platform/gtk/css-dark-mode/older-syntax/supported-color-schemes-css-expected.txt: Removed. * platform/gtk/css-dark-mode/older-syntax/supported-color-schemes-meta-expected.txt: Removed. * platform/wpe/TestExpectations: Canonical link: https://commits.webkit.org/239730@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279987 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-16 16:39:15 +00:00
#if PLATFORM(MAC) || PLATFORM(IOS) || PLATFORM(MACCATALYST) || PLATFORM(GTK) || PLATFORM(WPE)
#define HAVE_OS_DARK_MODE_SUPPORT 1
#endif
#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 110000
#define HAVE_CG_FONT_RENDERING_GET_FONT_SMOOTHING_DISABLED 1
#endif
#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500
#define HAVE_READ_ONLY_SYSTEM_VOLUME 1
#endif
#ifdef __APPLE__
#define HAVE_FUNC_USLEEP 1
#endif
#if PLATFORM(COCOA)
#define HAVE_SEC_ACCESS_CONTROL 1
#endif
#if PLATFORM(IOS)
/* FIXME: SafariServices.framework exists on macOS. It is only used by WebKit on iOS, so the behavior is correct, but the name is misleading. */
#define HAVE_SAFARI_SERVICES_FRAMEWORK 1
#endif
#if PLATFORM(MAC) || PLATFORM(IOS) || PLATFORM(WATCHOS) || PLATFORM(MACCATALYST)
#define HAVE_SAFE_BROWSING 1
#endif
#if PLATFORM(IOS) || (PLATFORM(MACCATALYST) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 150000)
#define HAVE_LINK_PREVIEW 1
#endif
#if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000) \
|| (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 70000) \
|| (PLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 140000) \
|| (PLATFORM(MACCATALYST) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000)
#define HAVE_ACCESSIBILITY_BUNDLES_PATH 1
#endif
#if PLATFORM(COCOA) && !(PLATFORM(MAC) && !(__MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101404))
#define HAVE_CFNETWORK_OVERRIDE_SESSION_COOKIE_ACCEPT_POLICY 1
#endif
#if PLATFORM(COCOA) && !(PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101500) && !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
#define HAVE_CFNETWORK_NSURLSESSION_STRICTRUSTEVALUATE 1
#endif
Adopt new NSURLSessionConfiguration SPI for connection cache configuration https://bugs.webkit.org/show_bug.cgi?id=222934 Reviewed by Geoffrey Garen. Source/WebCore: This uses the NSURLSessionConfiguration connection cache limit SPI introduced in Big Sur to properly set the parameters we want for HTTP/1.1 connections. Previously we tried to do this using _CFNetworkHTTPConnectionCacheSetLimit in NetworkProcessCocoa, but this didn't work because that SPI only applies to NSURLConnection rather than NSURLSession. In particular, this meant that the number of priority levels wasn't set correctly, which we had to work around by constraining the number of priority levels when mapping WebKit resource priorities to CFNetwork priorities (https://bugs.webkit.org/show_bug.cgi?id=203423). This patch adopts the SPI and removes that workaround. * platform/network/cf/ResourceRequestCFNet.h: (WebCore::toResourceLoadPriority): (WebCore::toPlatformRequestPriority): Source/WebCore/PAL: Declare NSURLSessionConfiguration connection cache limit SPI when building using the public SDK. * pal/spi/cf/CFNetworkSPI.h: Source/WebKit: This uses the NSURLSessionConfiguration connection cache limit SPI introduced in Big Sur to properly set the parameters we want for HTTP/1.1 connections. Previously we tried to do this using _CFNetworkHTTPConnectionCacheSetLimit in NetworkProcessCocoa, but this didn't work because that SPI only applies to NSURLConnection rather than NSURLSession. In particular, this meant that the number of priority levels wasn't set correctly, which we had to work around by constraining the number of priority levels when mapping WebKit resource priorities to CFNetwork priorities (https://bugs.webkit.org/show_bug.cgi?id=203423). This patch adopts the SPI and removes that workaround. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::configurationForSessionID): Source/WTF: Add the HAVE_CFNETWORK_NSURLSESSION_CONNECTION_CACHE_LIMITS flag to control whether or not to use the connection cache limit SPI on NSURLSessionConfiguration. * wtf/PlatformHave.h: Canonical link: https://commits.webkit.org/235082@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274161 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-09 19:08:33 +00:00
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000) \
|| (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000) \
|| (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 70000) \
|| (PLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 140000)
#define HAVE_CFNETWORK_NSURLSESSION_CONNECTION_CACHE_LIMITS 1
#endif
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || PLATFORM(IOS_FAMILY)
#define HAVE_CFNETWORK_NEGOTIATED_SSL_PROTOCOL_CIPHER 1
#endif
Add the capability to change all of a website's cookies to SameSite=Strict https://bugs.webkit.org/show_bug.cgi?id=209369 <rdar://problem/60710690> Reviewed by Alex Christensen and David Kilzer. Source/WebCore: Test: http/tests/resourceLoadStatistics/set-all-cookies-to-same-site-strict.html * platform/network/NetworkStorageSession.cpp: (WebCore::NetworkStorageSession::setAllCookiesToSameSiteStrict): Stub function for non-Cocoa platforms. * platform/network/NetworkStorageSession.h: * platform/network/cocoa/NetworkStorageSessionCocoa.mm: (WebCore::NetworkStorageSession::setAllCookiesToSameSiteStrict): * testing/Internals.h: Added code to expose SameSite=None and path properties of cookies. However, they don't seem to carry over so I'll have to revisit the internal workings. Source/WebKit: These changes add test infrastructure to run function WebCore::NetworkStorageSession::setAllCookiesToSameSiteStrict() in the network process. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::setToSameSiteStrictCookiesForTesting): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreSetResourceLoadStatisticsToSameSiteStrictCookiesForTesting): * UIProcess/API/C/WKWebsiteDataStoreRef.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::setToSameSiteStrictCookiesForTesting): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::setResourceLoadStatisticsToSameSiteStrictCookiesForTesting): * UIProcess/WebsiteData/WebsiteDataStore.h: Source/WTF: * wtf/PlatformHave.h: Adds HAVE_CFNETWORK_SAMESITE_COOKIE_API for macOS Catalina and up, iOS 13 and up, Catalyst, watchOS, and Apple TV. Tools: These changes add TestRunner function statisticsSetToSameSiteStrictCookies(). * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: (WTR::InjectedBundle::didReceiveMessageToPage): * WebKitTestRunner/InjectedBundle/TestRunner.cpp: (WTR::TestRunner::statisticsSetToSameSiteStrictCookies): (WTR::TestRunner::statisticsCallDidSetToSameSiteStrictCookiesCallback): * WebKitTestRunner/InjectedBundle/TestRunner.h: * WebKitTestRunner/TestController.cpp: (WTR::TestController::setStatisticsToSameSiteStrictCookies): * WebKitTestRunner/TestController.h: * WebKitTestRunner/TestInvocation.cpp: (WTR::TestInvocation::didReceiveMessageFromInjectedBundle): (WTR::TestInvocation::didSetToSameSiteStrictCookies): * WebKitTestRunner/TestInvocation.h: LayoutTests: * http/tests/resourceLoadStatistics/resources/set-all-kinds-of-cookies.php: Added. * http/tests/resourceLoadStatistics/set-all-cookies-to-same-site-strict-expected.txt: Added. * http/tests/resourceLoadStatistics/set-all-cookies-to-same-site-strict.html: Added. * platform/ios/TestExpectations: Marked http/tests/resourceLoadStatistics/set-all-cookies-to-same-site-strict.html as Pass. * platform/mac-wk2/TestExpectations: Marked http/tests/resourceLoadStatistics/set-all-cookies-to-same-site-strict.html as Pass for Catalina+. * platform/wk2/TestExpectations: Skipped http/tests/resourceLoadStatistics/set-all-cookies-to-same-site-strict.html since it's only available on macOS Catalina and up and the functionality is not implemented on non-Cocoa platforms. Canonical link: https://commits.webkit.org/222379@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258884 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-03-23 23:00:50 +00:00
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000) || PLATFORM(MACCATALYST) || PLATFORM(WATCHOS) || PLATFORM(APPLETV)
#define HAVE_CFNETWORK_SAMESITE_COOKIE_API 1
#endif
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) \
|| (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000) \
|| (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 60000) \
|| (PLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 130000)
#define HAVE_CFNETWORK_METRICS_CONNECTION_PROPERTIES 1
#endif
#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 110300
#define HAVE_SAFARI_FOR_WEBKIT_DEVELOPMENT_REQUIRING_EXTRA_SYMBOLS 1
#endif
#if PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED < 140000
#define HAVE_BROKEN_DOWNLOAD_RESUME_UNLINK 1
#endif
Remove all references to non-existent 10.16 https://bugs.webkit.org/show_bug.cgi?id=215202 Reviewed by Wenson Hsieh. Source/bmalloc: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: Source/JavaScriptCore: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/ThirdParty: * gtest/xcode/Config/DebugProject.xcconfig: * gtest/xcode/Config/ReleaseProject.xcconfig: Source/ThirdParty/ANGLE: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/ThirdParty/libwebrtc: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: * Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.h: Source/WebCore: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebCore/PAL: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebInspectorUI: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebKit: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: * Scripts/process-entitlements.sh: * WebProcess/com.apple.WebProcess.sb.in: Source/WebKitLegacy/mac: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WTF: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * wtf/PlatformEnableCocoa.h: * wtf/PlatformHave.h: * wtf/PlatformUse.h: Tools: * ContentExtensionTester/Configurations/Base.xcconfig: * ContentExtensionTester/Configurations/DebugRelease.xcconfig: * DumpRenderTree/mac/Configurations/Base.xcconfig: * DumpRenderTree/mac/Configurations/DebugRelease.xcconfig: * ImageDiff/cg/Configurations/Base.xcconfig: * ImageDiff/cg/Configurations/DebugRelease.xcconfig: * MiniBrowser/Configurations/Base.xcconfig: * MiniBrowser/Configurations/DebugRelease.xcconfig: * TestWebKitAPI/Configurations/Base.xcconfig: * TestWebKitAPI/Configurations/DebugRelease.xcconfig: * TestWebKitAPI/Configurations/WebKitTargetConditionals.xcconfig: * TestWebKitAPI/config.h: * WebEditingTester/Configurations/Base.xcconfig: * WebEditingTester/Configurations/DebugRelease.xcconfig: * WebKitTestRunner/Configurations/Base.xcconfig: * WebKitTestRunner/Configurations/DebugRelease.xcconfig: * lldb/lldbWebKitTester/Configurations/Base.xcconfig: * lldb/lldbWebKitTester/Configurations/DebugRelease.xcconfig: Canonical link: https://commits.webkit.org/227995@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@265315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-08-06 00:58:34 +00:00
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000)
#define HAVE_CFNETWORK_METRICS_APIS_V4 1
#endif
Remove all references to non-existent 10.16 https://bugs.webkit.org/show_bug.cgi?id=215202 Reviewed by Wenson Hsieh. Source/bmalloc: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: Source/JavaScriptCore: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/ThirdParty: * gtest/xcode/Config/DebugProject.xcconfig: * gtest/xcode/Config/ReleaseProject.xcconfig: Source/ThirdParty/ANGLE: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/ThirdParty/libwebrtc: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: * Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.h: Source/WebCore: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebCore/PAL: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebInspectorUI: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebKit: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: * Scripts/process-entitlements.sh: * WebProcess/com.apple.WebProcess.sb.in: Source/WebKitLegacy/mac: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WTF: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * wtf/PlatformEnableCocoa.h: * wtf/PlatformHave.h: * wtf/PlatformUse.h: Tools: * ContentExtensionTester/Configurations/Base.xcconfig: * ContentExtensionTester/Configurations/DebugRelease.xcconfig: * DumpRenderTree/mac/Configurations/Base.xcconfig: * DumpRenderTree/mac/Configurations/DebugRelease.xcconfig: * ImageDiff/cg/Configurations/Base.xcconfig: * ImageDiff/cg/Configurations/DebugRelease.xcconfig: * MiniBrowser/Configurations/Base.xcconfig: * MiniBrowser/Configurations/DebugRelease.xcconfig: * TestWebKitAPI/Configurations/Base.xcconfig: * TestWebKitAPI/Configurations/DebugRelease.xcconfig: * TestWebKitAPI/Configurations/WebKitTargetConditionals.xcconfig: * TestWebKitAPI/config.h: * WebEditingTester/Configurations/Base.xcconfig: * WebEditingTester/Configurations/DebugRelease.xcconfig: * WebKitTestRunner/Configurations/Base.xcconfig: * WebKitTestRunner/Configurations/DebugRelease.xcconfig: * lldb/lldbWebKitTester/Configurations/Base.xcconfig: * lldb/lldbWebKitTester/Configurations/DebugRelease.xcconfig: Canonical link: https://commits.webkit.org/227995@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@265315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-08-06 00:58:34 +00:00
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000)
Adopt HTTP Alternative Services Storage https://bugs.webkit.org/show_bug.cgi?id=208387 Patch by Jiten Mehta <jmehta@apple.com> on 2020-03-03 Reviewed by Alex Christensen. Source/WebCore/PAL: * pal/spi/cf/CFNetworkSPI.h: Source/WebKit: Covered by a new API test which verifies that data is written to the correct directory. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::fetchWebsiteData): (WebKit::NetworkProcess::deleteWebsiteData): (WebKit::NetworkProcess::deleteWebsiteDataForOrigins): (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains): * NetworkProcess/NetworkProcess.h: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::getHostNamesWithAlternativeServices): (WebKit::NetworkProcess::deleteAlternativeServicesForHostNames): (WebKit::NetworkProcess::clearAlternativeServices): * Shared/WebsiteData/WebsiteData.cpp: (WebKit::WebsiteData::ownerProcess): * Shared/WebsiteData/WebsiteDataType.h: * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm: (dataTypesToString): * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h: (WebKit::toWebsiteDataType): (WebKit::toWKWebsiteDataTypes): * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (+[WKWebsiteDataStore _allWebsiteDataTypesIncludingPrivate]): * UIProcess/WebsiteData/WebsiteDataRecord.cpp: (WebKit::WebsiteDataRecord::addAlternativeServicesHostname): * UIProcess/WebsiteData/WebsiteDataRecord.h: Source/WTF: * wtf/PlatformHave.h: Tools: * TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm: (checkUntilEntryFound): (TEST): Canonical link: https://commits.webkit.org/221437@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257785 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-03-03 18:21:17 +00:00
#define HAVE_CFNETWORK_ALTERNATIVE_SERVICE 1
#endif
#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500
#define HAVE_CSCHECKFIXDISABLE 1
#endif
#if PLATFORM(COCOA) && !(PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101500) && !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
#define HAVE_MDNS_FAST_REGISTRATION 1
#endif
#if PLATFORM(COCOA) && !(PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101500) && !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
#define HAVE_CTFONTCREATEFORCHARACTERSWITHLANGUAGEANDOPTION 1
#endif
#if PLATFORM(IOS)
#define HAVE_ARKIT_QUICK_LOOK_PREVIEW_ITEM 1
#endif
#if PLATFORM(IOS) || PLATFORM(MACCATALYST)
#define HAVE_UI_WK_DOCUMENT_CONTEXT 1
#endif
Implement support for cursor interactions on iPad https://bugs.webkit.org/show_bug.cgi?id=209268 Reviewed by Darin Adler. No new tests in this patch, just upstreaming. Will attempt to enable some macOS mouse event tests on iOS in the future, though. * wtf/PlatformEnableCocoa.h: Don't disable the contextmenu event on iOS anymore. * wtf/PlatformHave.h: Rename HAVE_HOVER_GESTURE_RECOGNIZER to HAVE_UIKIT_WITH_MOUSE_SUPPORT. Add HAVE_UI_CURSOR_INTERACTION. Enable HAVE_UI_PARALLAX_TRANSITION_GESTURE_RECOGNIZER on iOS. * platform/RuntimeApplicationChecks.h: * platform/cocoa/RuntimeApplicationChecksCocoa.mm: (WebCore::IOSApplication::isNews): (WebCore::IOSApplication::isStocks): (WebCore::IOSApplication::isFeedly): Add some bundle ID checks needed in WebKit. * Platform/spi/ios/UIKitSPI.h: * UIProcess/Cocoa/VersionChecks.h: * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setupInteraction]): (-[WKContentView cleanupInteraction]): (-[WKContentView _removeDefaultGestureRecognizers]): (-[WKContentView _addDefaultGestureRecognizers]): (-[WKContentView gestureRecognizer:shouldReceiveTouch:]): (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]): (-[WKContentView _showShareSheet:inRect:completionHandler:]): (-[WKContentView setupDragAndDropInteractions]): (-[WKContentView shouldUseMouseGestureRecognizer]): (-[WKContentView setupMouseGestureRecognizer]): (-[WKContentView mouseGestureRecognizerChanged:]): (-[WKContentView setupCursorInteraction]): (-[WKContentView _cursorInteraction:regionForLocation:defaultRegion:completion:]): (-[WKContentView cursorRegionForPositionInformation:point:]): (-[WKContentView cursorInteraction:styleForRegion:modifiers:]): (-[WKContentView _mouseGestureRecognizerChanged:]): Deleted. * UIProcess/ios/WKMouseGestureRecognizer.h: * UIProcess/ios/WKMouseGestureRecognizer.mm: * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm: (WebKit::WebChromeClient::shouldUseMouseEventForSelection): Canonical link: https://commits.webkit.org/222230@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258721 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-03-19 19:16:33 +00:00
#if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130400)
#define HAVE_UI_POINTER_INTERACTION 1
#endif
Implement support for cursor interactions on iPad https://bugs.webkit.org/show_bug.cgi?id=209268 Reviewed by Darin Adler. No new tests in this patch, just upstreaming. Will attempt to enable some macOS mouse event tests on iOS in the future, though. * wtf/PlatformEnableCocoa.h: Don't disable the contextmenu event on iOS anymore. * wtf/PlatformHave.h: Rename HAVE_HOVER_GESTURE_RECOGNIZER to HAVE_UIKIT_WITH_MOUSE_SUPPORT. Add HAVE_UI_CURSOR_INTERACTION. Enable HAVE_UI_PARALLAX_TRANSITION_GESTURE_RECOGNIZER on iOS. * platform/RuntimeApplicationChecks.h: * platform/cocoa/RuntimeApplicationChecksCocoa.mm: (WebCore::IOSApplication::isNews): (WebCore::IOSApplication::isStocks): (WebCore::IOSApplication::isFeedly): Add some bundle ID checks needed in WebKit. * Platform/spi/ios/UIKitSPI.h: * UIProcess/Cocoa/VersionChecks.h: * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setupInteraction]): (-[WKContentView cleanupInteraction]): (-[WKContentView _removeDefaultGestureRecognizers]): (-[WKContentView _addDefaultGestureRecognizers]): (-[WKContentView gestureRecognizer:shouldReceiveTouch:]): (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]): (-[WKContentView _showShareSheet:inRect:completionHandler:]): (-[WKContentView setupDragAndDropInteractions]): (-[WKContentView shouldUseMouseGestureRecognizer]): (-[WKContentView setupMouseGestureRecognizer]): (-[WKContentView mouseGestureRecognizerChanged:]): (-[WKContentView setupCursorInteraction]): (-[WKContentView _cursorInteraction:regionForLocation:defaultRegion:completion:]): (-[WKContentView cursorRegionForPositionInformation:point:]): (-[WKContentView cursorInteraction:styleForRegion:modifiers:]): (-[WKContentView _mouseGestureRecognizerChanged:]): Deleted. * UIProcess/ios/WKMouseGestureRecognizer.h: * UIProcess/ios/WKMouseGestureRecognizer.mm: * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm: (WebKit::WebChromeClient::shouldUseMouseEventForSelection): Canonical link: https://commits.webkit.org/222230@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258721 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-03-19 19:16:33 +00:00
#if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130400) || PLATFORM(MACCATALYST)
#define HAVE_UIKIT_WITH_MOUSE_SUPPORT 1
#define HAVE_UI_PARALLAX_TRANSITION_GESTURE_RECOGNIZER 1
#endif
[macCatalyst] should have CSS `hover: hover` and `pointer: fine` https://bugs.webkit.org/show_bug.cgi?id=225672 Reviewed by Tim Horton. Source/WebKit: Test: iOSMouseSupport.MouseAlwaysConnected * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::isMousePrimaryPointingDevice): Added. (WebKit::hasAccessoryMousePointingDevice): Added. (WebKit::hasAccessoryStylusPointingDevice): Added. (WebKit::WebPage::hoverSupportedByPrimaryPointingDevice const): (WebKit::WebPage::hoverSupportedByAnyAvailablePointingDevice const): (WebKit::WebPage::pointerCharacteristicsOfPrimaryPointingDevice const): (WebKit::WebPage::pointerCharacteristicsOfAllAvailablePointingDevices const): (WebKit::hasMouseDevice): Deleted. macCatalyst should consider the mouse as the primary pointing device, just like macOS: - `hover` and `any-hover` should always be `hover` - `pointer` and `any-pointer` should always be `fine` (instead of only if an accessory mouse/stylus is connected) * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::notifyHasMouseDeviceChanged): Added. (WebKit::WebProcessProxy::notifyHasStylusDeviceChanged): * UIProcess/ios/WebProcessProxyIOS.mm: (WebKit::WebProcessProxy::platformInitialize): (WebKit::WebProcessProxy::platformDestroy): (WebKit::WebProcessProxy::notifyHasMouseDeviceChanged): Deleted. * UIProcess/ios/WKMouseDeviceObserver.h: * UIProcess/ios/WKMouseDeviceObserver.mm: * Shared/WebProcessCreationParameters.h: * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * WebProcess/WebProcess.messages.in: * WebProcess/WebProcess.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): Clean up macro usage to avoid unnecessary work on macCatalyst. Drive-by: Move non-platform code to non-platform files. Source/WTF: * wtf/PlatformHave.h: Add `HAVE_MOUSE_DEVICE_OBSERVATION` and `HAVE_STYLUS_DEVICE_OBSERVATION` to make callsites clearer instead of having a somewhat unrelated connection to `HAVE_UIKIT_WITH_MOUSE_SUPPORT` and `HAVE_PENCILKIT_TEXT_INPUT` (not to mention both of them are `PLATFORM(MACCATALYST)` which isn't desirable since macCatalyst should consider the mouse as the primary pointing device, just like macOS). Tools: * TestWebKitAPI/Tests/WebKitCocoa/iOSMouseSupport.mm: (TEST.iOSMouseSupport.MouseAlwaysConnected): * TestWebKitAPI/Tests/WebKitCocoa/iOSStylusSupport.mm: Canonical link: https://commits.webkit.org/237612@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277354 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-12 03:55:46 +00:00
#if PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130400
#define HAVE_MOUSE_DEVICE_OBSERVATION 1
#endif
#if (PLATFORM(IOS) || PLATFORM(MACCATALYST)) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000
#define HAVE_UI_HOVER_EVENT_RESPONDABLE 1
#endif
Implement support for cursor interactions on iPad https://bugs.webkit.org/show_bug.cgi?id=209268 Reviewed by Darin Adler. No new tests in this patch, just upstreaming. Will attempt to enable some macOS mouse event tests on iOS in the future, though. * wtf/PlatformEnableCocoa.h: Don't disable the contextmenu event on iOS anymore. * wtf/PlatformHave.h: Rename HAVE_HOVER_GESTURE_RECOGNIZER to HAVE_UIKIT_WITH_MOUSE_SUPPORT. Add HAVE_UI_CURSOR_INTERACTION. Enable HAVE_UI_PARALLAX_TRANSITION_GESTURE_RECOGNIZER on iOS. * platform/RuntimeApplicationChecks.h: * platform/cocoa/RuntimeApplicationChecksCocoa.mm: (WebCore::IOSApplication::isNews): (WebCore::IOSApplication::isStocks): (WebCore::IOSApplication::isFeedly): Add some bundle ID checks needed in WebKit. * Platform/spi/ios/UIKitSPI.h: * UIProcess/Cocoa/VersionChecks.h: * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setupInteraction]): (-[WKContentView cleanupInteraction]): (-[WKContentView _removeDefaultGestureRecognizers]): (-[WKContentView _addDefaultGestureRecognizers]): (-[WKContentView gestureRecognizer:shouldReceiveTouch:]): (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]): (-[WKContentView _showShareSheet:inRect:completionHandler:]): (-[WKContentView setupDragAndDropInteractions]): (-[WKContentView shouldUseMouseGestureRecognizer]): (-[WKContentView setupMouseGestureRecognizer]): (-[WKContentView mouseGestureRecognizerChanged:]): (-[WKContentView setupCursorInteraction]): (-[WKContentView _cursorInteraction:regionForLocation:defaultRegion:completion:]): (-[WKContentView cursorRegionForPositionInformation:point:]): (-[WKContentView cursorInteraction:styleForRegion:modifiers:]): (-[WKContentView _mouseGestureRecognizerChanged:]): Deleted. * UIProcess/ios/WKMouseGestureRecognizer.h: * UIProcess/ios/WKMouseGestureRecognizer.mm: * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm: (WebKit::WebChromeClient::shouldUseMouseEventForSelection): Canonical link: https://commits.webkit.org/222230@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258721 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-03-19 19:16:33 +00:00
#if PLATFORM(MACCATALYST)
#define HAVE_LOOKUP_GESTURE_RECOGNIZER 1
#endif
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || PLATFORM(IOS_FAMILY)
#define HAVE_ALLOWS_SENSITIVE_LOGGING 1
#endif
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || PLATFORM(IOS_FAMILY)
#define HAVE_FAIRPLAYSTREAMING_CENC_INITDATA 1
#endif
#if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST)
#define HAVE_APP_LINKS_WITH_ISENABLED 1
#endif
#if PLATFORM(IOS)
#define HAVE_ROUTE_SHARING_POLICY_LONG_FORM_VIDEO 1
#endif
#if PLATFORM(IOS) && !PLATFORM(IOS_SIMULATOR)
#define HAVE_DEVICE_MANAGEMENT 1
#endif
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 120000) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 150000)
#define HAVE_NSURLSESSION_WEBSOCKET 1
#endif
Disable relay for UDP sockets when not needed https://bugs.webkit.org/show_bug.cgi?id=227253 Source/WebCore: Reviewed by Eric Carlson. * Modules/mediastream/PeerConnectionBackend.h: (WebCore::PeerConnectionBackend::shouldFilterICECandidates const): * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::setConfiguration): * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h: (WebCore::LibWebRTCMediaEndpoint::rtcSocketFactory): * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::LibWebRTCPeerConnectionBackend::disableICECandidateFiltering): * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h: * platform/mediastream/libwebrtc/LibWebRTCProvider.h: Source/WebKit: Reviewed by Eric Carlson. * NetworkProcess/webrtc/NetworkRTCProvider.cpp: (WebKit::NetworkRTCProvider::createUDPSocket): * NetworkProcess/webrtc/NetworkRTCProvider.h: * NetworkProcess/webrtc/NetworkRTCProvider.messages.in: * NetworkProcess/webrtc/NetworkRTCUDPSocketCocoa.h: * NetworkProcess/webrtc/NetworkRTCUDPSocketCocoa.mm: (WebKit::NetworkRTCUDPSocketCocoaConnections::create): (WebKit::NetworkRTCUDPSocketCocoa::createUDPSocket): (WebKit::NetworkRTCUDPSocketCocoa::NetworkRTCUDPSocketCocoa): (WebKit::NetworkRTCUDPSocketCocoaConnections::NetworkRTCUDPSocketCocoaConnections): (WebKit::NetworkRTCUDPSocketCocoaConnections::createNWConnection): * WebKit.xcodeproj/project.pbxproj: * WebProcess/Network/webrtc/LibWebRTCProvider.cpp: (WebKit::RTCSocketFactory::RTCSocketFactory): (WebKit::RTCSocketFactory::CreateUdpSocket): (WebKit::LibWebRTCProvider::createSocketFactory): * WebProcess/Network/webrtc/LibWebRTCProvider.h: * WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp: (WebKit::LibWebRTCSocketFactory::createUdpSocket): * WebProcess/Network/webrtc/LibWebRTCSocketFactory.h: Source/WTF: <rdar://problem/79912154> Reviewed by Eric Carlson. * wtf/PlatformHave.h: Add a macro for new NW methods. Canonical link: https://commits.webkit.org/239336@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279483 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-01 20:56:00 +00:00
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 120000) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 150000)
#define HAVE_NWPARAMETERS_TRACKER_API 1
#endif
#if PLATFORM(COCOA) && !(PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101500) && !PLATFORM(MACCATALYST)
#define HAVE_AVPLAYER_RESOURCE_CONSERVATION_LEVEL 1
#endif
[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 <video> elements which may never be un-muted before being destroyed. Implement a policy where, if an AVPlayer is initially muted, we adopt AVFoundation SPI to forcibly prevent audio decoding and rendering until the first time the AVPlayer is unmuted. This means the first un-mute may not be instantaneous, as an audio decoder will have to be created and fed before any audio is rendered. There's some incorrect caching of mute state at the MediaPlayer level; so MediaPlayer and MPPAVFoundationObjC can get their respective m_muted states out of sync. Make sure that HTMLMediaElement always sets muted state after creating a MediaPlayer and that, respectively, MPPAVFoundationObjC always queries it's parent MediaPlayer's mute state when it in turn is created. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::createMediaPlayer): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC): (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): (WebCore::MediaPlayerPrivateAVFoundationObjC::setMuted): Source/WebCore/PAL: * pal/spi/cocoa/AVFoundationSPI.h: Source/WTF: * wtf/PlatformHave.h: Canonical link: https://commits.webkit.org/229202@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266844 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-09-10 18:23:51 +00:00
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000)
#define HAVE_AVPLAYER_SUPRESSES_AUDIO_RENDERING 1
#endif
Fix check-webkit-style errors related to AVFoundationSPI.h https://bugs.webkit.org/show_bug.cgi?id=207834 Reviewed by Eric Carlson. Source/WebCore: No new tests, no functional change. This patch fixes check-webkit-style errors, especially the ones related to soft-link headers. The soft-link headers should be included after other headers. * platform/audio/ios/AudioSessionIOS.mm: * platform/audio/ios/MediaSessionManagerIOS.mm: * platform/graphics/avfoundation/MediaPlaybackTargetCocoa.mm: * platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.mm: * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm: * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm: * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm: * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: Source/WebCore/PAL: Move AVFoundationSPI.h from folder "mac" to "cocoa" because it is used by both iOS and Mac. * PAL.xcodeproj/project.pbxproj: * pal/spi/cocoa/AVFoundationSPI.h: Renamed from Source/WebCore/PAL/pal/spi/mac/AVFoundationSPI.h. Source/WTF: Add HAVE_VIDEO_PERFORMANCE_METRICS and USE_AV_SAMPLE_BUFFER_DISPLAY_LAYER to fix check-webkit-style errors. * wtf/PlatformHave.h: * wtf/PlatformUse.h: Tools: We need to use case-insensitive comparison to check whether the headers are alphabetically sorted in each header section. Soft-link headers can be included as either "file.h" or <file.h>. * Scripts/webkitpy/style/checkers/cpp.py: (_classify_include): (check_include_line): Canonical link: https://commits.webkit.org/220827@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256770 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-02-17 21:55:51 +00:00
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED < 101404)
#define HAVE_VIDEO_PERFORMANCE_METRICS 1
#endif
[Mac] Remove __MAC_OS_X_VERSION_MIN_REQUIRED checks for versions older than 10.14 https://bugs.webkit.org/show_bug.cgi?id=211420 Reviewed by Alex Christensen. Source/WebCore: * editing/cocoa/DataDetection.mm: (WebCore::detectItem): Remove __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * editing/cocoa/HTMLConverter.mm: (_WebMessageDocumentClass): Ditto. * platform/graphics/cg/GraphicsContextCG.cpp: Ditto. * platform/mac/WebCoreFullScreenPlaceholderView.mm: (-[WebCoreFullScreenPlaceholderView initWithFrame:]): Ditto. * platform/network/cocoa/CookieCocoa.mm: (WebCore::nsSameSitePolicy): Ditto. (WebCore::Cookie::operator NSHTTPCookie * _Nullable const): Ditto. * platform/network/cocoa/NetworkStorageSessionCocoa.mm: (WebCore::cookiesForURL): Ditto. (WebCore::NetworkStorageSession::setHTTPCookiesForURL const): Ditto. * platform/network/cocoa/ResourceRequestCocoa.mm: (WebCore::ResourceRequest::doUpdateResourceRequest): Ditto. (WebCore::siteForCookies): Ditto. (WebCore::ResourceRequest::doUpdatePlatformRequest): Ditto. * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::paintTextField): Ditto. * testing/Internals.h: Ditto. Source/WebCore/PAL: * pal/spi/cocoa/NSColorSPI.h: Remove __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * pal/spi/cocoa/QuartzCoreSPI.h: Ditto. * pal/spi/mac/DataDetectorsSPI.h: Ditto. * pal/spi/mac/NSApplicationSPI.h: Ditto. Source/WebKit: * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm: (WebKit::Download::resume): Remove __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): Ditto. * PluginProcess/mac/PluginProcessMac.mm: (WebKit::PluginProcess::platformInitializePluginProcess): Ditto. * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm: (WebKit::XPCServiceMain): Ditto. * UIProcess/mac/ServicesController.mm: (WebKit::hasCompatibleServicesForItems): Ditto. * UIProcess/mac/WebProcessProxyMac.mm: (WebKit::WebProcessProxy::shouldAllowNonValidInjectedCode const): Ditto. Source/WebKitLegacy/mac: * WebView/WebHTMLView.mm: Remove __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. (-[WebHTMLView _recursive:displayRectIgnoringOpacity:inContext:stopAtLayerBackedViews:_recursive:displayRectIgnoringOpacity:inContext:shouldChangeFontReferenceColor:stopAtLayerBackedViews:]): Ditto. (-[WebHTMLView _recursive:displayRectIgnoringOpacity:inContext:stopAtLayerBackedViews:_recursive:displayRectIgnoringOpacity:inContext:shouldChangeFontReferenceColor:stopAtLayerBackedViews:_recursive:displayRectIgnoringOpacity:inContext:shouldChangeFontReferenceColor:]): Deleted. (-[WebHTMLView _recursive:displayRectIgnoringOpacity:inGraphicsContext:shouldChangeFontReferenceColor:]): Deleted. * WebView/WebTextCompletionController.mm: (-[WebTextCompletionController _buildUI]): Remove some code only compiled with __MAC_OS_X_VERSION_MIN_REQUIRED < 101400. Source/WTF: * WTF.xcodeproj/project.pbxproj: Removed DeprecatedSymbolsUsedBySafari.mm. * wtf/PlatformEnableCocoa.h: Removed __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * wtf/PlatformHave.h: Ditto. This leaves behind some cases of "PLATFORM(MAC) || PLATFORM(IOS)" that should probably be turned on for watchOS and tvOS too, eventually. Also "PLATFORM(MAC) || PLATFORM(IOS) || PLATFORM(MACCATALYST)". * wtf/PlatformMac.cmake: Removed DeprecatedSymbolsUsedBySafari.mm. * wtf/PlatformUse.h: Removed __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * wtf/mac/DeprecatedSymbolsUsedBySafari.mm: Removed. * wtf/spi/darwin/ProcessMemoryFootprint.h: Removed __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. Tools: * TestWebKitAPI/Tests/WebCore/CtapPinTest.cpp: Remove __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm: Removed code disabling this test for __MAC_OS_X_VERSION_MIN_REQUIRED < 101400. * TestWebKitAPI/config.h: Removed __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * WebKitTestRunner/InjectedBundle/cocoa/ActivateFontsCocoa.mm: (WTR::installFakeHelvetica): Removed __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. Canonical link: https://commits.webkit.org/224326@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@261153 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-05-05 05:51:47 +00:00
#if PLATFORM(COCOA) && !PLATFORM(MACCATALYST)
#define HAVE_CORETEXT_AUTO_OPTICAL_SIZING 1
#endif
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101500)
#define HAVE_NSFONT_WITH_OPTICAL_SIZING_BUG 1
#endif
#if (PLATFORM(IOS) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500))
#define HAVE_APP_SSO 1
#endif
#if PLATFORM(COCOA) && !(PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101500)
#define HAVE_TLS_PROTOCOL_VERSION_T 1
#endif
#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500
#define HAVE_SUBVIEWS_IVAR_SPI 1
#endif
#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED < 101500
#define HAVE_SUBVIEWS_IVAR_DECLARED_BY_SDK 1
#endif
#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101500
#define HAVE_AX_CLIENT_TYPE 1
#endif
#if PLATFORM(COCOA) && !(PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101500) && !PLATFORM(MACCATALYST)
#define HAVE_DESIGN_SYSTEM_UI_FONTS 1
#endif
Remove all references to non-existent 10.16 https://bugs.webkit.org/show_bug.cgi?id=215202 Reviewed by Wenson Hsieh. Source/bmalloc: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: Source/JavaScriptCore: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/ThirdParty: * gtest/xcode/Config/DebugProject.xcconfig: * gtest/xcode/Config/ReleaseProject.xcconfig: Source/ThirdParty/ANGLE: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/ThirdParty/libwebrtc: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: * Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.h: Source/WebCore: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebCore/PAL: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebInspectorUI: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebKit: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: * Scripts/process-entitlements.sh: * WebProcess/com.apple.WebProcess.sb.in: Source/WebKitLegacy/mac: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WTF: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * wtf/PlatformEnableCocoa.h: * wtf/PlatformHave.h: * wtf/PlatformUse.h: Tools: * ContentExtensionTester/Configurations/Base.xcconfig: * ContentExtensionTester/Configurations/DebugRelease.xcconfig: * DumpRenderTree/mac/Configurations/Base.xcconfig: * DumpRenderTree/mac/Configurations/DebugRelease.xcconfig: * ImageDiff/cg/Configurations/Base.xcconfig: * ImageDiff/cg/Configurations/DebugRelease.xcconfig: * MiniBrowser/Configurations/Base.xcconfig: * MiniBrowser/Configurations/DebugRelease.xcconfig: * TestWebKitAPI/Configurations/Base.xcconfig: * TestWebKitAPI/Configurations/DebugRelease.xcconfig: * TestWebKitAPI/Configurations/WebKitTargetConditionals.xcconfig: * TestWebKitAPI/config.h: * WebEditingTester/Configurations/Base.xcconfig: * WebEditingTester/Configurations/DebugRelease.xcconfig: * WebKitTestRunner/Configurations/Base.xcconfig: * WebKitTestRunner/Configurations/DebugRelease.xcconfig: * lldb/lldbWebKitTester/Configurations/Base.xcconfig: * lldb/lldbWebKitTester/Configurations/DebugRelease.xcconfig: Canonical link: https://commits.webkit.org/227995@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@265315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-08-06 00:58:34 +00:00
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000)
[WK2][Cocoa] Implement in-WebProcess cookie cache to avoid sync IPC for document.cookie in most cases https://bugs.webkit.org/show_bug.cgi?id=207593 <rdar://problem/56027027> Reviewed by Antti Koivisto. Source/WebCore: Implement in-WebProcess DOM cookie cache for serving `document.cookie` requests from JavaScript. The first time document.cookie is called for a given host, the WebProcess will pull in all the non-HTTPOnly cookies for that host from the NetworkProcess (still via sync IPC) and store them in an in-memory cookie store. Later document.cookie calls for this host from this WebProcess will then leverage the in-memory cookie store and avoid doing a sync IPC to the NetworkProcess entirely. To maintain the in-process cookie store up-to-date, the WebProcess subscribe for cookie-change notifications from the NetworkProcess, only for the hosts it is interested in. If the page's JavaScript sets a cookie by setting document.cookie, we will not invalidate the cache for performance reasons. Instead, we set the cookie in our in-memory cookie before sending the new cookie to the NetworkProcess. For compatibility reasons, any sync IPC to a given host will currently invalidate the cookie cache for this host. This is because this synchronous load may cause cookies to get set synchronously and the page could access document.cookie right after the sync XHR. This behavior is covered by the following existing test: - http/tests/cookies/sync-xhr-set-cookie-invalidates-cache.html Another limitation of the current implementation of the cookie cache is that it is currently only leveraged for first party content. This is suboptimal and could be improved in a later iteration. However, the default behavior in Safari is that third-party iframes do not have cookie access unless they request it using the storage access API. We also currently have a limit of 5 hosts with cached cookies per WebProcess. Tests: http/tests/cookies/document-cookie-after-showModalDialog.html http/tests/cookies/document-cookie-during-iframe-parsing.html * dom/Document.cpp: (WebCore::Document::didLoadResourceSynchronously): * dom/Document.h: * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::didLoadResourceSynchronously): * dom/ScriptExecutionContext.h: * loader/CookieJar.h: * loader/ThreadableLoader.cpp: (WebCore::ThreadableLoader::loadResourceSynchronously): * page/MemoryRelease.cpp: (WebCore::releaseCriticalMemory): * page/Settings.yaml: * platform/network/NetworkStorageSession.h: (WebCore::CookieChangeObserver::~CookieChangeObserver): * platform/network/cf/NetworkStorageSessionCFNet.cpp: (WebCore::NetworkStorageSession::NetworkStorageSession): (WebCore::NetworkStorageSession::cookieStorage const): * platform/network/cocoa/NetworkStorageSessionCocoa.mm: (WebCore::NetworkStorageSession::~NetworkStorageSession): (WebCore::NetworkStorageSession::setCookie): (WebCore::NetworkStorageSession::setCookies): (WebCore::NetworkStorageSession::deleteCookie): (WebCore::nsCookiesToCookieVector): (WebCore::NetworkStorageSession::nsCookieStorage const): (WebCore::createPrivateStorageSession): (WebCore::NetworkStorageSession::httpCookies const): (WebCore::NetworkStorageSession::deleteHTTPCookie const): (WebCore::NetworkStorageSession::setHTTPCookiesForURL const): (WebCore::NetworkStorageSession::httpCookiesForURL const): (WebCore::filterCookies): (WebCore::NetworkStorageSession::cookiesForURL const): (WebCore::NetworkStorageSession::cookiesForSession const): (WebCore::NetworkStorageSession::cookiesForDOM const): (WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const): (WebCore::NetworkStorageSession::setCookiesFromDOM const): (WebCore::NetworkStorageSession::getRawCookies const): (WebCore::NetworkStorageSession::deleteCookiesForHostnames): (WebCore::NetworkStorageSession::registerCookieChangeListenersIfNecessary): (WebCore::NetworkStorageSession::unregisterCookieChangeListenersIfNecessary): (WebCore::NetworkStorageSession::startListeningForCookieChangeNotifications): (WebCore::NetworkStorageSession::stopListeningForCookieChangeNotifications): (WebCore::NetworkStorageSession::domCookiesForHost): (WebCore::NetworkStorageSession::supportsCookieChangeListenerAPI const): Source/WebCore/PAL: Add new CFNetwork SPI to CFNetworkSPI.h for open source builds and for using respondsToSelector. * pal/spi/cf/CFNetworkSPI.h: Source/WebKit: See WebCore ChangeLog. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::~NetworkConnectionToWebProcess): (WebKit::NetworkConnectionToWebProcess::domCookiesForHost): (WebKit::NetworkConnectionToWebProcess::unsubscribeFromCookieChangeNotifications): (WebKit::NetworkConnectionToWebProcess::cookiesAdded): (WebKit::NetworkConnectionToWebProcess::cookiesDeleted): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * Scripts/webkit/messages.py: * Shared/WebPreferences.yaml: * Sources.txt: * SourcesCocoa.txt: * WebKit.xcodeproj/project.pbxproj: * WebProcess/Network/NetworkProcessConnection.cpp: (WebKit::NetworkProcessConnection::cookiesAdded): (WebKit::NetworkProcessConnection::cookiesDeleted): * WebProcess/Network/NetworkProcessConnection.h: * WebProcess/Network/NetworkProcessConnection.messages.in: * WebProcess/WebPage/Cocoa/WebCookieCacheCocoa.mm: Copied from Source/WebKit/WebProcess/WebPage/WebCookieJar.h. (WebKit::WebCookieCache::inMemoryStorageSession): * WebProcess/WebPage/WebCookieCache.cpp: Added. (WebKit::WebCookieCache::isFunctional): (WebKit::WebCookieCache::cookiesForDOM): (WebKit::WebCookieCache::setCookiesFromDOM): (WebKit::WebCookieCache::cookiesAdded): (WebKit::WebCookieCache::cookiesDeleted): (WebKit::WebCookieCache::clear): (WebKit::WebCookieCache::clearForHost): (WebKit::WebCookieCache::pruneCacheIfNecessary): * WebProcess/WebPage/WebCookieCache.h: Copied from Source/WebKit/WebProcess/WebPage/WebCookieJar.h. * WebProcess/WebPage/WebCookieJar.cpp: (WebKit::WebCookieJar::isEligibleForCache const): (WebKit::WebCookieJar::cookies const): (WebKit::WebCookieJar::setCookies): (WebKit::WebCookieJar::cookiesAdded): (WebKit::WebCookieJar::cookiesDeleted): (WebKit::WebCookieJar::clearCache): (WebKit::WebCookieJar::clearCacheForHost): * WebProcess/WebPage/WebCookieJar.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::m_overriddenMediaType): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::WebProcess): * WebProcess/WebProcess.h: (WebKit::WebProcess::cookieJar): Source/WTF: Add build time flags for new feature. * wtf/PlatformEnable.h: * wtf/PlatformHave.h: LayoutTests: Add layout test coverage. * http/tests/cookies/document-cookie-after-showModalDialog-expected.txt: Added. * http/tests/cookies/document-cookie-after-showModalDialog.html: Added. * http/tests/cookies/document-cookie-during-iframe-parsing-expected.txt: Added. * http/tests/cookies/document-cookie-during-iframe-parsing.html: Added. * http/tests/cookies/resources/close-modal-dialog.html: Added. * http/tests/cookies/resources/document-cookie-during-iframe-parsing-iframe.html: Added. * http/tests/cookies/resources/set-cookie-and-serve.php: Added. Canonical link: https://commits.webkit.org/220853@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256820 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-02-18 06:32:42 +00:00
#define HAVE_COOKIE_CHANGE_LISTENER_API 1
#endif
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || PLATFORM(IOS_FAMILY)
#define HAVE_DATA_PROTECTION_KEYCHAIN 1
#endif
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || (PLATFORM(IOS_FAMILY) && !PLATFORM(IOS_FAMILY_SIMULATOR))
#define HAVE_NEAR_FIELD 1
#endif
[Mac] Remove __MAC_OS_X_VERSION_MIN_REQUIRED checks for versions older than 10.14 https://bugs.webkit.org/show_bug.cgi?id=211420 Reviewed by Alex Christensen. Source/WebCore: * editing/cocoa/DataDetection.mm: (WebCore::detectItem): Remove __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * editing/cocoa/HTMLConverter.mm: (_WebMessageDocumentClass): Ditto. * platform/graphics/cg/GraphicsContextCG.cpp: Ditto. * platform/mac/WebCoreFullScreenPlaceholderView.mm: (-[WebCoreFullScreenPlaceholderView initWithFrame:]): Ditto. * platform/network/cocoa/CookieCocoa.mm: (WebCore::nsSameSitePolicy): Ditto. (WebCore::Cookie::operator NSHTTPCookie * _Nullable const): Ditto. * platform/network/cocoa/NetworkStorageSessionCocoa.mm: (WebCore::cookiesForURL): Ditto. (WebCore::NetworkStorageSession::setHTTPCookiesForURL const): Ditto. * platform/network/cocoa/ResourceRequestCocoa.mm: (WebCore::ResourceRequest::doUpdateResourceRequest): Ditto. (WebCore::siteForCookies): Ditto. (WebCore::ResourceRequest::doUpdatePlatformRequest): Ditto. * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::paintTextField): Ditto. * testing/Internals.h: Ditto. Source/WebCore/PAL: * pal/spi/cocoa/NSColorSPI.h: Remove __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * pal/spi/cocoa/QuartzCoreSPI.h: Ditto. * pal/spi/mac/DataDetectorsSPI.h: Ditto. * pal/spi/mac/NSApplicationSPI.h: Ditto. Source/WebKit: * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm: (WebKit::Download::resume): Remove __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): Ditto. * PluginProcess/mac/PluginProcessMac.mm: (WebKit::PluginProcess::platformInitializePluginProcess): Ditto. * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm: (WebKit::XPCServiceMain): Ditto. * UIProcess/mac/ServicesController.mm: (WebKit::hasCompatibleServicesForItems): Ditto. * UIProcess/mac/WebProcessProxyMac.mm: (WebKit::WebProcessProxy::shouldAllowNonValidInjectedCode const): Ditto. Source/WebKitLegacy/mac: * WebView/WebHTMLView.mm: Remove __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. (-[WebHTMLView _recursive:displayRectIgnoringOpacity:inContext:stopAtLayerBackedViews:_recursive:displayRectIgnoringOpacity:inContext:shouldChangeFontReferenceColor:stopAtLayerBackedViews:]): Ditto. (-[WebHTMLView _recursive:displayRectIgnoringOpacity:inContext:stopAtLayerBackedViews:_recursive:displayRectIgnoringOpacity:inContext:shouldChangeFontReferenceColor:stopAtLayerBackedViews:_recursive:displayRectIgnoringOpacity:inContext:shouldChangeFontReferenceColor:]): Deleted. (-[WebHTMLView _recursive:displayRectIgnoringOpacity:inGraphicsContext:shouldChangeFontReferenceColor:]): Deleted. * WebView/WebTextCompletionController.mm: (-[WebTextCompletionController _buildUI]): Remove some code only compiled with __MAC_OS_X_VERSION_MIN_REQUIRED < 101400. Source/WTF: * WTF.xcodeproj/project.pbxproj: Removed DeprecatedSymbolsUsedBySafari.mm. * wtf/PlatformEnableCocoa.h: Removed __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * wtf/PlatformHave.h: Ditto. This leaves behind some cases of "PLATFORM(MAC) || PLATFORM(IOS)" that should probably be turned on for watchOS and tvOS too, eventually. Also "PLATFORM(MAC) || PLATFORM(IOS) || PLATFORM(MACCATALYST)". * wtf/PlatformMac.cmake: Removed DeprecatedSymbolsUsedBySafari.mm. * wtf/PlatformUse.h: Removed __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * wtf/mac/DeprecatedSymbolsUsedBySafari.mm: Removed. * wtf/spi/darwin/ProcessMemoryFootprint.h: Removed __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. Tools: * TestWebKitAPI/Tests/WebCore/CtapPinTest.cpp: Remove __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm: Removed code disabling this test for __MAC_OS_X_VERSION_MIN_REQUIRED < 101400. * TestWebKitAPI/config.h: Removed __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * WebKitTestRunner/InjectedBundle/cocoa/ActivateFontsCocoa.mm: (WTR::installFakeHelvetica): Removed __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. Canonical link: https://commits.webkit.org/224326@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@261153 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-05-05 05:51:47 +00:00
#if PLATFORM(COCOA)
#define HAVE_OS_SIGNPOST 1
#endif
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000)
[Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder https://bugs.webkit.org/show_bug.cgi?id=206582 Source/WebCore: <rdar://problem/58985368> Reviewed by Eric Carlson. AVAssetWriterDelegate allows to grab recorded data whenever wanted. This delegate requires passing compressed samples to AVAssetWriter. Implement video encoding and audio encoding in dedicated classes and use these classes before adding buffers to AVAssetWriter. These classes are AudioSampleBufferCompressor and VideoSampleBufferCompressor. They support AAC and H264 so far and should be further improved to support more encoding options. Instantiate real writer only for platforms supporting AVAssetWriterDelegate, since it is not supported everywhere. The writer, doing the pacakging, is receiving compressed buffer from the audio/video compressors. It then sends data when being request to flush to its delegate, which will send data to the MediaRecorderPrivateWriter. The MediaRecorderPrivateWriter stores the data in a SharedBuffer until MediaRecorder asks for data. Note that, whenever we request data, we flush the writer and insert an end of video sample to make sure video data gets flushed. Therefore data should not be requested too fast to get adequate video compression. Covered by existing tests. * Modules/mediarecorder/MediaRecorderProvider.cpp: (WebCore::MediaRecorderProvider::createMediaRecorderPrivate): * WebCore.xcodeproj/project.pbxproj: * platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp: (WebCore::MediaRecorderPrivateAVFImpl::create): * platform/mediarecorder/MediaRecorderPrivateAVFImpl.h: * platform/mediarecorder/cocoa/AudioSampleBufferCompressor.h: Added. * platform/mediarecorder/cocoa/AudioSampleBufferCompressor.mm: Added. (WebCore::AudioSampleBufferCompressor::create): (WebCore::AudioSampleBufferCompressor::AudioSampleBufferCompressor): (WebCore::AudioSampleBufferCompressor::~AudioSampleBufferCompressor): (WebCore::AudioSampleBufferCompressor::initialize): (WebCore::AudioSampleBufferCompressor::finish): (WebCore::AudioSampleBufferCompressor::initAudioConverterForSourceFormatDescription): (WebCore::AudioSampleBufferCompressor::computeBufferSizeForAudioFormat): (WebCore::AudioSampleBufferCompressor::attachPrimingTrimsIfNeeded): (WebCore::AudioSampleBufferCompressor::gradualDecoderRefreshCount): (WebCore::AudioSampleBufferCompressor::sampleBufferWithNumPackets): (WebCore::AudioSampleBufferCompressor::audioConverterComplexInputDataProc): (WebCore::AudioSampleBufferCompressor::provideSourceDataNumOutputPackets): (WebCore::AudioSampleBufferCompressor::processSampleBuffersUntilLowWaterTime): (WebCore::AudioSampleBufferCompressor::processSampleBuffer): (WebCore::AudioSampleBufferCompressor::addSampleBuffer): (WebCore::AudioSampleBufferCompressor::getOutputSampleBuffer): (WebCore::AudioSampleBufferCompressor::takeOutputSampleBuffer): * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: (-[WebAVAssetWriterDelegate initWithWriter:]): (-[WebAVAssetWriterDelegate assetWriter:didProduceFragmentedHeaderData:]): (-[WebAVAssetWriterDelegate assetWriter:didProduceFragmentedMediaData:fragmentedMediaDataReport:]): (-[WebAVAssetWriterDelegate close]): (WebCore::MediaRecorderPrivateWriter::create): (WebCore::MediaRecorderPrivateWriter::compressedVideoOutputBufferCallback): (WebCore::MediaRecorderPrivateWriter::compressedAudioOutputBufferCallback): (WebCore::MediaRecorderPrivateWriter::MediaRecorderPrivateWriter): (WebCore::MediaRecorderPrivateWriter::~MediaRecorderPrivateWriter): (WebCore::MediaRecorderPrivateWriter::initialize): (WebCore::MediaRecorderPrivateWriter::processNewCompressedVideoSampleBuffers): (WebCore::MediaRecorderPrivateWriter::processNewCompressedAudioSampleBuffers): (WebCore::MediaRecorderPrivateWriter::startAssetWriter): (WebCore::MediaRecorderPrivateWriter::appendCompressedAudioSampleBuffer): (WebCore::MediaRecorderPrivateWriter::appendCompressedVideoSampleBuffer): (WebCore::MediaRecorderPrivateWriter::appendCompressedSampleBuffers): (WebCore::appendEndsPreviousSampleDurationMarker): (WebCore::MediaRecorderPrivateWriter::appendEndOfVideoSampleDurationIfNeeded): (WebCore::MediaRecorderPrivateWriter::flushCompressedSampleBuffers): (WebCore::MediaRecorderPrivateWriter::clear): (WebCore::copySampleBufferWithCurrentTimeStamp): (WebCore::MediaRecorderPrivateWriter::appendVideoSampleBuffer): (WebCore::createAudioFormatDescription): (WebCore::createAudioSampleBuffer): (WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer): (WebCore::MediaRecorderPrivateWriter::stopRecording): (WebCore::MediaRecorderPrivateWriter::appendData): * platform/mediarecorder/cocoa/VideoSampleBufferCompressor.h: Copied from Source/WebCore/platform/mediarecorder/MediaRecorderPrivateAVFImpl.h. * platform/mediarecorder/cocoa/VideoSampleBufferCompressor.mm: Added. (WebCore::VideoSampleBufferCompressor::create): (WebCore::VideoSampleBufferCompressor::VideoSampleBufferCompressor): (WebCore::VideoSampleBufferCompressor::~VideoSampleBufferCompressor): (WebCore::VideoSampleBufferCompressor::initialize): (WebCore::VideoSampleBufferCompressor::finish): (WebCore::VideoSampleBufferCompressor::videoCompressionCallback): (WebCore::VideoSampleBufferCompressor::initCompressionSession): (WebCore::VideoSampleBufferCompressor::processSampleBuffer): (WebCore::VideoSampleBufferCompressor::addSampleBuffer): (WebCore::VideoSampleBufferCompressor::getOutputSampleBuffer): (WebCore::VideoSampleBufferCompressor::takeOutputSampleBuffer): Source/WebCore/PAL: <rdar://problem/58985368> Reviewed by Eric Carlson. Add soft link macros for VideoToolbox and AudioToolbox. * PAL.xcodeproj/project.pbxproj: * pal/cf/AudioToolboxSoftLink.cpp: Added. * pal/cf/AudioToolboxSoftLink.h: Added. * pal/cf/CoreMediaSoftLink.cpp: * pal/cf/CoreMediaSoftLink.h: * pal/cf/VideoToolboxSoftLink.cpp: Added. * pal/cf/VideoToolboxSoftLink.h: Added. Source/WebKit: <rdar://problem/58985368> Reviewed by Eric Carlson. Enable RemoteMediaRecorder only for systems supporting AVAssetWriterDelegate. * GPUProcess/GPUConnectionToWebProcess.cpp: (WebKit::GPUConnectionToWebProcess::didReceiveMessage): * GPUProcess/GPUConnectionToWebProcess.h: * GPUProcess/webrtc/RemoteMediaRecorder.cpp: * GPUProcess/webrtc/RemoteMediaRecorder.h: * GPUProcess/webrtc/RemoteMediaRecorder.messages.in: * GPUProcess/webrtc/RemoteMediaRecorderManager.cpp: * GPUProcess/webrtc/RemoteMediaRecorderManager.h: * GPUProcess/webrtc/RemoteMediaRecorderManager.messages.in: * GPUProcess/webrtc/RemoteSampleBufferDisplayLayerManager.h: * WebProcess/GPU/webrtc/MediaRecorderPrivate.cpp: * WebProcess/GPU/webrtc/MediaRecorderPrivate.h: * WebProcess/GPU/webrtc/MediaRecorderProvider.cpp: (WebKit::MediaRecorderProvider::createMediaRecorderPrivate): Source/WTF: Reviewed by Eric Carlson. * wtf/PlatformHave.h: LayoutTests: Reviewed by Eric Carlson. Disable tests on all platforms except the ones supporting AVAssetWriterDelegate. * TestExpectations: * http/wpt/mediarecorder/MediaRecorder-AV-audio-video-dataavailable-gpuprocess.html: Remove web audio generation since there seems to be some unstability in web audio -> stream -> media recorder. which should be fixed as follow-up specific patches. * platform/mac/TestExpectations: Enable running tests. Canonical link: https://commits.webkit.org/225705@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262708 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-08 11:49:15 +00:00
#define HAVE_AVASSETWRITERDELEGATE 1
#endif
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000)
#define HAVE_AVASSETWRITERDELEGATE_API 1
#endif
Remove all references to non-existent 10.16 https://bugs.webkit.org/show_bug.cgi?id=215202 Reviewed by Wenson Hsieh. Source/bmalloc: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: Source/JavaScriptCore: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/ThirdParty: * gtest/xcode/Config/DebugProject.xcconfig: * gtest/xcode/Config/ReleaseProject.xcconfig: Source/ThirdParty/ANGLE: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/ThirdParty/libwebrtc: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: * Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.h: Source/WebCore: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebCore/PAL: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebInspectorUI: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebKit: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: * Scripts/process-entitlements.sh: * WebProcess/com.apple.WebProcess.sb.in: Source/WebKitLegacy/mac: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WTF: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * wtf/PlatformEnableCocoa.h: * wtf/PlatformHave.h: * wtf/PlatformUse.h: Tools: * ContentExtensionTester/Configurations/Base.xcconfig: * ContentExtensionTester/Configurations/DebugRelease.xcconfig: * DumpRenderTree/mac/Configurations/Base.xcconfig: * DumpRenderTree/mac/Configurations/DebugRelease.xcconfig: * ImageDiff/cg/Configurations/Base.xcconfig: * ImageDiff/cg/Configurations/DebugRelease.xcconfig: * MiniBrowser/Configurations/Base.xcconfig: * MiniBrowser/Configurations/DebugRelease.xcconfig: * TestWebKitAPI/Configurations/Base.xcconfig: * TestWebKitAPI/Configurations/DebugRelease.xcconfig: * TestWebKitAPI/Configurations/WebKitTargetConditionals.xcconfig: * TestWebKitAPI/config.h: * WebEditingTester/Configurations/Base.xcconfig: * WebEditingTester/Configurations/DebugRelease.xcconfig: * WebKitTestRunner/Configurations/Base.xcconfig: * WebKitTestRunner/Configurations/DebugRelease.xcconfig: * lldb/lldbWebKitTester/Configurations/Base.xcconfig: * lldb/lldbWebKitTester/Configurations/DebugRelease.xcconfig: Canonical link: https://commits.webkit.org/227995@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@265315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-08-06 00:58:34 +00:00
#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000
#define HAVE_AVPLAYER_VIDEORANGEOVERRIDE 1
#endif
[Mac] Remove __MAC_OS_X_VERSION_MIN_REQUIRED checks for versions older than 10.14 https://bugs.webkit.org/show_bug.cgi?id=211420 Reviewed by Alex Christensen. Source/WebCore: * editing/cocoa/DataDetection.mm: (WebCore::detectItem): Remove __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * editing/cocoa/HTMLConverter.mm: (_WebMessageDocumentClass): Ditto. * platform/graphics/cg/GraphicsContextCG.cpp: Ditto. * platform/mac/WebCoreFullScreenPlaceholderView.mm: (-[WebCoreFullScreenPlaceholderView initWithFrame:]): Ditto. * platform/network/cocoa/CookieCocoa.mm: (WebCore::nsSameSitePolicy): Ditto. (WebCore::Cookie::operator NSHTTPCookie * _Nullable const): Ditto. * platform/network/cocoa/NetworkStorageSessionCocoa.mm: (WebCore::cookiesForURL): Ditto. (WebCore::NetworkStorageSession::setHTTPCookiesForURL const): Ditto. * platform/network/cocoa/ResourceRequestCocoa.mm: (WebCore::ResourceRequest::doUpdateResourceRequest): Ditto. (WebCore::siteForCookies): Ditto. (WebCore::ResourceRequest::doUpdatePlatformRequest): Ditto. * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::paintTextField): Ditto. * testing/Internals.h: Ditto. Source/WebCore/PAL: * pal/spi/cocoa/NSColorSPI.h: Remove __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * pal/spi/cocoa/QuartzCoreSPI.h: Ditto. * pal/spi/mac/DataDetectorsSPI.h: Ditto. * pal/spi/mac/NSApplicationSPI.h: Ditto. Source/WebKit: * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm: (WebKit::Download::resume): Remove __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): Ditto. * PluginProcess/mac/PluginProcessMac.mm: (WebKit::PluginProcess::platformInitializePluginProcess): Ditto. * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm: (WebKit::XPCServiceMain): Ditto. * UIProcess/mac/ServicesController.mm: (WebKit::hasCompatibleServicesForItems): Ditto. * UIProcess/mac/WebProcessProxyMac.mm: (WebKit::WebProcessProxy::shouldAllowNonValidInjectedCode const): Ditto. Source/WebKitLegacy/mac: * WebView/WebHTMLView.mm: Remove __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. (-[WebHTMLView _recursive:displayRectIgnoringOpacity:inContext:stopAtLayerBackedViews:_recursive:displayRectIgnoringOpacity:inContext:shouldChangeFontReferenceColor:stopAtLayerBackedViews:]): Ditto. (-[WebHTMLView _recursive:displayRectIgnoringOpacity:inContext:stopAtLayerBackedViews:_recursive:displayRectIgnoringOpacity:inContext:shouldChangeFontReferenceColor:stopAtLayerBackedViews:_recursive:displayRectIgnoringOpacity:inContext:shouldChangeFontReferenceColor:]): Deleted. (-[WebHTMLView _recursive:displayRectIgnoringOpacity:inGraphicsContext:shouldChangeFontReferenceColor:]): Deleted. * WebView/WebTextCompletionController.mm: (-[WebTextCompletionController _buildUI]): Remove some code only compiled with __MAC_OS_X_VERSION_MIN_REQUIRED < 101400. Source/WTF: * WTF.xcodeproj/project.pbxproj: Removed DeprecatedSymbolsUsedBySafari.mm. * wtf/PlatformEnableCocoa.h: Removed __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * wtf/PlatformHave.h: Ditto. This leaves behind some cases of "PLATFORM(MAC) || PLATFORM(IOS)" that should probably be turned on for watchOS and tvOS too, eventually. Also "PLATFORM(MAC) || PLATFORM(IOS) || PLATFORM(MACCATALYST)". * wtf/PlatformMac.cmake: Removed DeprecatedSymbolsUsedBySafari.mm. * wtf/PlatformUse.h: Removed __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * wtf/mac/DeprecatedSymbolsUsedBySafari.mm: Removed. * wtf/spi/darwin/ProcessMemoryFootprint.h: Removed __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. Tools: * TestWebKitAPI/Tests/WebCore/CtapPinTest.cpp: Remove __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm: Removed code disabling this test for __MAC_OS_X_VERSION_MIN_REQUIRED < 101400. * TestWebKitAPI/config.h: Removed __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * WebKitTestRunner/InjectedBundle/cocoa/ActivateFontsCocoa.mm: (WTR::installFakeHelvetica): Removed __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. Canonical link: https://commits.webkit.org/224326@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@261153 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-05-05 05:51:47 +00:00
#if PLATFORM(COCOA) && !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
#define HAVE_CG_PATH_UNEVEN_CORNERS_ROUNDEDRECT 1
#endif
#if PLATFORM(WATCHOS) || PLATFORM(APPLETV) || (PLATFORM(IOS_FAMILY) && !(defined __has_include && __has_include(<CoreFoundation/CFPriv.h>)))
#define HAVE_NSPROGRESS_PUBLISHING_SPI 1
#endif
Standard gamepad mapping for GameControllerGamepads https://bugs.webkit.org/show_bug.cgi?id=206033 Patch by James Howard <jameshoward@mac.com> on 2020-02-10 Reviewed by Dean Jackson. Source/WebCore: Extend PlatformGamepad to add a field for the gamepad mapping. The mapping defines the order and interpretation of the axes and buttons vectors, and is passed along to users of the Gamepad API[1]. Letting PlatformGamepad subclassers define their mapping is the natural place for this functionality. The PlatformGamepad already defines the order of the axes and buttons and PlatformGamepad subclassers may know something about the physical layout of the gamepad they represent. This change modifies the GameControllerGamepad subclass of PlatformGamepad to set the mapping to "standard" when a GCExtendedGamepad is detected, and to bind the axes and buttons appropriately. Previously, the buttons and axes were bound arbitrarily, and in some cases incompletely. While that wasn't a bug per se, because with the mapping set to the empty string an implementation is free to provide any interpretation of the gamepad elements it likes, it was certainly less useful than the "standard" mapping. [1] https://www.w3.org/TR/gamepad/#remapping * Modules/gamepad/Gamepad.cpp: (WebCore::Gamepad::Gamepad): * platform/gamepad/PlatformGamepad.h: (WebCore::PlatformGamepad::mapping const): * platform/gamepad/cocoa/GameControllerGamepad.mm: (WebCore::GameControllerGamepad::setupAsExtendedGamepad): * testing/MockGamepad.cpp: (WebCore::MockGamepad::MockGamepad): (WebCore::MockGamepad::updateDetails): * testing/MockGamepad.h: * testing/MockGamepadProvider.cpp: (WebCore::MockGamepadProvider::setMockGamepadDetails): * testing/MockGamepadProvider.h: * testing/js/WebCoreTestSupport.cpp: (WebCoreTestSupport::setMockGamepadDetails): * testing/js/WebCoreTestSupport.h: Source/WebKit: Make the mapping as provided by PlatformGamepad available in UIGamepad, and pass it along to GamepadData so it can be correctly reflected in the Gamepad API. * Shared/Gamepad/GamepadData.cpp: (WebKit::GamepadData::GamepadData): (WebKit::GamepadData::encode const): (WebKit::GamepadData::decode): * Shared/Gamepad/GamepadData.h: (WebKit::GamepadData::mapping const): * UIProcess/Gamepad/UIGamepad.cpp: (WebKit::UIGamepad::UIGamepad): (WebKit::UIGamepad::fullGamepadData const): * UIProcess/Gamepad/UIGamepad.h: * WebProcess/Gamepad/WebGamepad.cpp: (WebKit::WebGamepad::WebGamepad): Tools: * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: * WebKitTestRunner/InjectedBundle/TestRunner.cpp: (WTR::TestRunner::setMockGamepadDetails): * WebKitTestRunner/InjectedBundle/TestRunner.h: * WebKitTestRunner/TestInvocation.cpp: (WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle): LayoutTests: * gamepad/gamepad-polling-access-expected.txt: * gamepad/gamepad-polling-access.html: * gamepad/gamepad-timestamp.html: * gamepad/gamepad-visibility-1.html: Canonical link: https://commits.webkit.org/220496@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256215 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-02-10 22:38:22 +00:00
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000)
#define HAVE_GCEXTENDEDGAMEPAD_BUTTONS_OPTIONS_MENU 1
#endif
[Mac] Remove __MAC_OS_X_VERSION_MIN_REQUIRED checks for versions older than 10.14 https://bugs.webkit.org/show_bug.cgi?id=211420 Reviewed by Alex Christensen. Source/WebCore: * editing/cocoa/DataDetection.mm: (WebCore::detectItem): Remove __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * editing/cocoa/HTMLConverter.mm: (_WebMessageDocumentClass): Ditto. * platform/graphics/cg/GraphicsContextCG.cpp: Ditto. * platform/mac/WebCoreFullScreenPlaceholderView.mm: (-[WebCoreFullScreenPlaceholderView initWithFrame:]): Ditto. * platform/network/cocoa/CookieCocoa.mm: (WebCore::nsSameSitePolicy): Ditto. (WebCore::Cookie::operator NSHTTPCookie * _Nullable const): Ditto. * platform/network/cocoa/NetworkStorageSessionCocoa.mm: (WebCore::cookiesForURL): Ditto. (WebCore::NetworkStorageSession::setHTTPCookiesForURL const): Ditto. * platform/network/cocoa/ResourceRequestCocoa.mm: (WebCore::ResourceRequest::doUpdateResourceRequest): Ditto. (WebCore::siteForCookies): Ditto. (WebCore::ResourceRequest::doUpdatePlatformRequest): Ditto. * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::paintTextField): Ditto. * testing/Internals.h: Ditto. Source/WebCore/PAL: * pal/spi/cocoa/NSColorSPI.h: Remove __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * pal/spi/cocoa/QuartzCoreSPI.h: Ditto. * pal/spi/mac/DataDetectorsSPI.h: Ditto. * pal/spi/mac/NSApplicationSPI.h: Ditto. Source/WebKit: * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm: (WebKit::Download::resume): Remove __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): Ditto. * PluginProcess/mac/PluginProcessMac.mm: (WebKit::PluginProcess::platformInitializePluginProcess): Ditto. * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm: (WebKit::XPCServiceMain): Ditto. * UIProcess/mac/ServicesController.mm: (WebKit::hasCompatibleServicesForItems): Ditto. * UIProcess/mac/WebProcessProxyMac.mm: (WebKit::WebProcessProxy::shouldAllowNonValidInjectedCode const): Ditto. Source/WebKitLegacy/mac: * WebView/WebHTMLView.mm: Remove __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. (-[WebHTMLView _recursive:displayRectIgnoringOpacity:inContext:stopAtLayerBackedViews:_recursive:displayRectIgnoringOpacity:inContext:shouldChangeFontReferenceColor:stopAtLayerBackedViews:]): Ditto. (-[WebHTMLView _recursive:displayRectIgnoringOpacity:inContext:stopAtLayerBackedViews:_recursive:displayRectIgnoringOpacity:inContext:shouldChangeFontReferenceColor:stopAtLayerBackedViews:_recursive:displayRectIgnoringOpacity:inContext:shouldChangeFontReferenceColor:]): Deleted. (-[WebHTMLView _recursive:displayRectIgnoringOpacity:inGraphicsContext:shouldChangeFontReferenceColor:]): Deleted. * WebView/WebTextCompletionController.mm: (-[WebTextCompletionController _buildUI]): Remove some code only compiled with __MAC_OS_X_VERSION_MIN_REQUIRED < 101400. Source/WTF: * WTF.xcodeproj/project.pbxproj: Removed DeprecatedSymbolsUsedBySafari.mm. * wtf/PlatformEnableCocoa.h: Removed __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * wtf/PlatformHave.h: Ditto. This leaves behind some cases of "PLATFORM(MAC) || PLATFORM(IOS)" that should probably be turned on for watchOS and tvOS too, eventually. Also "PLATFORM(MAC) || PLATFORM(IOS) || PLATFORM(MACCATALYST)". * wtf/PlatformMac.cmake: Removed DeprecatedSymbolsUsedBySafari.mm. * wtf/PlatformUse.h: Removed __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * wtf/mac/DeprecatedSymbolsUsedBySafari.mm: Removed. * wtf/spi/darwin/ProcessMemoryFootprint.h: Removed __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. Tools: * TestWebKitAPI/Tests/WebCore/CtapPinTest.cpp: Remove __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm: Removed code disabling this test for __MAC_OS_X_VERSION_MIN_REQUIRED < 101400. * TestWebKitAPI/config.h: Removed __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * WebKitTestRunner/InjectedBundle/cocoa/ActivateFontsCocoa.mm: (WTR::installFakeHelvetica): Removed __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. Canonical link: https://commits.webkit.org/224326@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@261153 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-05-05 05:51:47 +00:00
#if PLATFORM(COCOA)
Standard gamepad mapping for GameControllerGamepads https://bugs.webkit.org/show_bug.cgi?id=206033 Patch by James Howard <jameshoward@mac.com> on 2020-02-10 Reviewed by Dean Jackson. Source/WebCore: Extend PlatformGamepad to add a field for the gamepad mapping. The mapping defines the order and interpretation of the axes and buttons vectors, and is passed along to users of the Gamepad API[1]. Letting PlatformGamepad subclassers define their mapping is the natural place for this functionality. The PlatformGamepad already defines the order of the axes and buttons and PlatformGamepad subclassers may know something about the physical layout of the gamepad they represent. This change modifies the GameControllerGamepad subclass of PlatformGamepad to set the mapping to "standard" when a GCExtendedGamepad is detected, and to bind the axes and buttons appropriately. Previously, the buttons and axes were bound arbitrarily, and in some cases incompletely. While that wasn't a bug per se, because with the mapping set to the empty string an implementation is free to provide any interpretation of the gamepad elements it likes, it was certainly less useful than the "standard" mapping. [1] https://www.w3.org/TR/gamepad/#remapping * Modules/gamepad/Gamepad.cpp: (WebCore::Gamepad::Gamepad): * platform/gamepad/PlatformGamepad.h: (WebCore::PlatformGamepad::mapping const): * platform/gamepad/cocoa/GameControllerGamepad.mm: (WebCore::GameControllerGamepad::setupAsExtendedGamepad): * testing/MockGamepad.cpp: (WebCore::MockGamepad::MockGamepad): (WebCore::MockGamepad::updateDetails): * testing/MockGamepad.h: * testing/MockGamepadProvider.cpp: (WebCore::MockGamepadProvider::setMockGamepadDetails): * testing/MockGamepadProvider.h: * testing/js/WebCoreTestSupport.cpp: (WebCoreTestSupport::setMockGamepadDetails): * testing/js/WebCoreTestSupport.h: Source/WebKit: Make the mapping as provided by PlatformGamepad available in UIGamepad, and pass it along to GamepadData so it can be correctly reflected in the Gamepad API. * Shared/Gamepad/GamepadData.cpp: (WebKit::GamepadData::GamepadData): (WebKit::GamepadData::encode const): (WebKit::GamepadData::decode): * Shared/Gamepad/GamepadData.h: (WebKit::GamepadData::mapping const): * UIProcess/Gamepad/UIGamepad.cpp: (WebKit::UIGamepad::UIGamepad): (WebKit::UIGamepad::fullGamepadData const): * UIProcess/Gamepad/UIGamepad.h: * WebProcess/Gamepad/WebGamepad.cpp: (WebKit::WebGamepad::WebGamepad): Tools: * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: * WebKitTestRunner/InjectedBundle/TestRunner.cpp: (WTR::TestRunner::setMockGamepadDetails): * WebKitTestRunner/InjectedBundle/TestRunner.h: * WebKitTestRunner/TestInvocation.cpp: (WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle): LayoutTests: * gamepad/gamepad-polling-access-expected.txt: * gamepad/gamepad-polling-access.html: * gamepad/gamepad-timestamp.html: * gamepad/gamepad-visibility-1.html: Canonical link: https://commits.webkit.org/220496@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256215 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-02-10 22:38:22 +00:00
#define HAVE_GCEXTENDEDGAMEPAD_BUTTONS_THUMBSTICK 1
#endif
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500)
#define HAVE_MULTIGAMEPADPROVIDER_SUPPORT 1
#endif
Add Gamepad tests that exercise the native frameworks <rdar://problem/65343674> and https://bugs.webkit.org/show_bug.cgi?id=214188 Reviewed by Tim Horton. Source/WebCore: * platform/gamepad/mac/MultiGamepadProvider.h: (WebCore::MultiGamepadProvider::setUsesOnlyHIDGamepadProvider): * platform/gamepad/mac/MultiGamepadProvider.mm: (WebCore::MultiGamepadProvider::startMonitoringGamepads): (WebCore::MultiGamepadProvider::stopMonitoringGamepads): Source/WebKit: Add some testing-only SPI for TestWebKitAPI. * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _numberOfConnectedGamepadsForTesting]): (-[WKProcessPool _setUsesOnlyHIDGamepadProviderForTesting:]): * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/Gamepad/UIGamepadProvider.h: (WebKit::UIGamepadProvider::numberOfConnectedGamepads const): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::numberOfConnectedGamepadsForTesting): (WebKit::WebProcessPool::setUsesOnlyHIDGamepadProviderForTesting): * UIProcess/WebProcessPool.h: Source/WTF: * wtf/PlatformHave.h: Tools: For Internal builds, we can create HID devices that exercise the native gamepad providers. E.g. Actually exercise the IOHID gamepad provider codepath. Give the Internal TestWebKitAPI build some entitlements: * TestWebKitAPI/Configurations/TestWebKitAPI-macOS-internal.entitlements: Added. * TestWebKitAPI/Configurations/TestWebKitAPI.xcconfig: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: Add a very basic test that connects a device, presses a button, and verifies the web page sees it: * TestWebKitAPI/Tests/mac/HIDGamepads.mm: Added. (-[GamepadMessageHandler userContentController:didReceiveScriptMessage:]): (TestWebKitAPI::handleGamepadConnect): Add the beginnings of a VirtualGamepad device that reads in a HID descriptor (just like real gamepads): * TestWebKitAPI/mac/VirtualGamepad.h: Added. * TestWebKitAPI/mac/VirtualGamepad.mm: Added. (TestWebKitAPI::VirtualGamepad::makeVirtualNimbus): (TestWebKitAPI::VirtualGamepad::VirtualGamepad): (TestWebKitAPI::VirtualGamepad::~VirtualGamepad): (TestWebKitAPI::VirtualGamepad::setButtonValue): (TestWebKitAPI::VirtualGamepad::setAxisValue): (TestWebKitAPI::VirtualGamepad::publishReport): WebKitLibraries: * WebKitPrivateFrameworkStubs/Mac/101500/HID.framework/HID.tbd: Added. * WebKitPrivateFrameworkStubs/Mac/101600/HID.framework/HID.tbd: Added. * WebKitPrivateFrameworkStubs/Mac/110000/HID.framework/HID.tbd: Added. Canonical link: https://commits.webkit.org/227505@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@264769 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-07-23 16:36:15 +00:00
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500)
#define HAVE_HID_FRAMEWORK 1
#endif
Remove all references to non-existent 10.16 https://bugs.webkit.org/show_bug.cgi?id=215202 Reviewed by Wenson Hsieh. Source/bmalloc: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: Source/JavaScriptCore: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/ThirdParty: * gtest/xcode/Config/DebugProject.xcconfig: * gtest/xcode/Config/ReleaseProject.xcconfig: Source/ThirdParty/ANGLE: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/ThirdParty/libwebrtc: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: * Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.h: Source/WebCore: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebCore/PAL: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebInspectorUI: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebKit: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: * Scripts/process-entitlements.sh: * WebProcess/com.apple.WebProcess.sb.in: Source/WebKitLegacy/mac: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WTF: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * wtf/PlatformEnableCocoa.h: * wtf/PlatformHave.h: * wtf/PlatformUse.h: Tools: * ContentExtensionTester/Configurations/Base.xcconfig: * ContentExtensionTester/Configurations/DebugRelease.xcconfig: * DumpRenderTree/mac/Configurations/Base.xcconfig: * DumpRenderTree/mac/Configurations/DebugRelease.xcconfig: * ImageDiff/cg/Configurations/Base.xcconfig: * ImageDiff/cg/Configurations/DebugRelease.xcconfig: * MiniBrowser/Configurations/Base.xcconfig: * MiniBrowser/Configurations/DebugRelease.xcconfig: * TestWebKitAPI/Configurations/Base.xcconfig: * TestWebKitAPI/Configurations/DebugRelease.xcconfig: * TestWebKitAPI/Configurations/WebKitTargetConditionals.xcconfig: * TestWebKitAPI/config.h: * WebEditingTester/Configurations/Base.xcconfig: * WebEditingTester/Configurations/DebugRelease.xcconfig: * WebKitTestRunner/Configurations/Base.xcconfig: * WebKitTestRunner/Configurations/DebugRelease.xcconfig: * lldb/lldbWebKitTester/Configurations/Base.xcconfig: * lldb/lldbWebKitTester/Configurations/DebugRelease.xcconfig: Canonical link: https://commits.webkit.org/227995@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@265315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-08-06 00:58:34 +00:00
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000)
#define HAVE_GCEXTENDEDGAMEPAD_HOME_BUTTON 1
#endif
Update macOS Version macros https://bugs.webkit.org/show_bug.cgi?id=214653 Reviewed by Tim Horton. PerformanceTests: * MediaTime/Configurations/Base.xcconfig: * MediaTime/Configurations/DebugRelease.xcconfig: Source/bmalloc: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: Source/JavaScriptCore: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/ThirdParty: * gtest/xcode/Config/DebugProject.xcconfig: * gtest/xcode/Config/ReleaseProject.xcconfig: Source/ThirdParty/ANGLE: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/ThirdParty/libwebrtc: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebCore: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebCore/PAL: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebInspectorUI: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebKit: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebKitLegacy/mac: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WTF: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * wtf/PlatformHave.h: Tools: * ContentExtensionTester/Configurations/Base.xcconfig: * ContentExtensionTester/Configurations/DebugRelease.xcconfig: * DumpRenderTree/mac/Configurations/Base.xcconfig: * DumpRenderTree/mac/Configurations/DebugRelease.xcconfig: * ImageDiff/cg/Configurations/Base.xcconfig: * ImageDiff/cg/Configurations/DebugRelease.xcconfig: * MiniBrowser/Configurations/Base.xcconfig: * MiniBrowser/Configurations/DebugRelease.xcconfig: * TestWebKitAPI/Configurations/Base.xcconfig: * TestWebKitAPI/Configurations/DebugRelease.xcconfig: * TestWebKitAPI/Configurations/WebKitTargetConditionals.xcconfig: * WebEditingTester/Configurations/Base.xcconfig: * WebEditingTester/Configurations/DebugRelease.xcconfig: * WebKitTestRunner/Configurations/Base.xcconfig: * WebKitTestRunner/Configurations/DebugRelease.xcconfig: * lldb/lldbWebKitTester/Configurations/Base.xcconfig: * lldb/lldbWebKitTester/Configurations/DebugRelease.xcconfig: Canonical link: https://commits.webkit.org/227485@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@264746 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-07-23 04:49:02 +00:00
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 120000)
Resolve race between IOHIDManager and GameController framework. <rdar://problem/65554490> and https://bugs.webkit.org/show_bug.cgi?id=214245 Reviewed by Tim Horton. Source/WebCore: No automated testing available. IOHIDDevices and IOHIDServices are two separate things. An IOHIDDevice and IOHIDService often have a 1-to-1 correlation, but the IOHIDDevice might be published to the application before the IOHIDService is. WebKit's HID gamepad manager uses IOHIDDevice. GameController.framework uses IOHIDServices. When we added the ability for WebKit to switch between HID and GCF, the following happens: - Sometimes the IOHIDServiceClient will get published first. Then when the IOHIDDevice is published, and WebKit was deciding which gamepad manager to use, the device's services are available, and we get the right answer. - Sometimes, the IOHIDDevice is published first. Then when WebKit is deciding which gamepad manager to use, it can't check the IOHIDServiceClient against GameController framework. So we have the HID manager handle the device... but then GCF comes along a split second later and ALSO handles it. The "device before service" scenario results in the same gamepad showing up twice. To resolve this, we do the following: 1 - If an IOHIDDevice attaches and its services aren't available yet, we delay managing it. 2 - When we delay managing a device, we start listening for IOHIDServiceClient additions. 3 - Each time a GamePad service is published, we once again try to determine if GCF will handle the device. 4 - As long as the answer is "Maybe" - instead of "Yes" or "No" - we refuse to manage the device. 5 - After a brief delay (currently 1 second), we will give up waiting for published services and manage the device with the HID gamepad provider. In my testing, when the service publishes after the devices, it's always within 50ms, (and usually just a spin or two of the runloop) so the 1s delay seems sufficient. NOTE: The above all holds true with the "MultiGamepadProvider" on Catalina. On Big Sur, there's brand new GameController framework API that makes this much easier. 👍 * platform/gamepad/mac/HIDGamepadProvider.h: * platform/gamepad/mac/HIDGamepadProvider.mm: (WebCore::deviceAddedCallback): (WebCore::gameControllerFrameworkWillHandleHIDDevice): (WebCore::HIDGamepadProvider::waitForManagementDecisionForDevice): (WebCore::HIDGamepadProvider::removeDeviceWaitingForManagementDecision): (WebCore::HIDGamepadProvider::newGamePadServicePublished): (WebCore::HIDGamepadProvider::deviceAdded): (WebCore::HIDGamepadProvider::deviceRemoved): Source/WebCore/PAL: * pal/spi/mac/IOKitSPIMac.h: Source/WTF: * wtf/PlatformHave.h: Canonical link: https://commits.webkit.org/227142@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@264389 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-07-15 08:00:13 +00:00
#define HAVE_GCCONTROLLER_HID_DEVICE_CHECK 1
#endif
Remove all references to non-existent 10.16 https://bugs.webkit.org/show_bug.cgi?id=215202 Reviewed by Wenson Hsieh. Source/bmalloc: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: Source/JavaScriptCore: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/ThirdParty: * gtest/xcode/Config/DebugProject.xcconfig: * gtest/xcode/Config/ReleaseProject.xcconfig: Source/ThirdParty/ANGLE: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/ThirdParty/libwebrtc: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: * Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.h: Source/WebCore: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebCore/PAL: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebInspectorUI: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebKit: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: * Scripts/process-entitlements.sh: * WebProcess/com.apple.WebProcess.sb.in: Source/WebKitLegacy/mac: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WTF: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * wtf/PlatformEnableCocoa.h: * wtf/PlatformHave.h: * wtf/PlatformUse.h: Tools: * ContentExtensionTester/Configurations/Base.xcconfig: * ContentExtensionTester/Configurations/DebugRelease.xcconfig: * DumpRenderTree/mac/Configurations/Base.xcconfig: * DumpRenderTree/mac/Configurations/DebugRelease.xcconfig: * ImageDiff/cg/Configurations/Base.xcconfig: * ImageDiff/cg/Configurations/DebugRelease.xcconfig: * MiniBrowser/Configurations/Base.xcconfig: * MiniBrowser/Configurations/DebugRelease.xcconfig: * TestWebKitAPI/Configurations/Base.xcconfig: * TestWebKitAPI/Configurations/DebugRelease.xcconfig: * TestWebKitAPI/Configurations/WebKitTargetConditionals.xcconfig: * TestWebKitAPI/config.h: * WebEditingTester/Configurations/Base.xcconfig: * WebEditingTester/Configurations/DebugRelease.xcconfig: * WebKitTestRunner/Configurations/Base.xcconfig: * WebKitTestRunner/Configurations/DebugRelease.xcconfig: * lldb/lldbWebKitTester/Configurations/Base.xcconfig: * lldb/lldbWebKitTester/Configurations/DebugRelease.xcconfig: Canonical link: https://commits.webkit.org/227995@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@265315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-08-06 00:58:34 +00:00
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000)
#define HAVE_INCREMENTAL_PDF_APIS 1
#endif
Use the feature flags mechanism to give default feature preference values https://bugs.webkit.org/show_bug.cgi?id=208607 Reviewed by Youenn Fablet. Source/WebCore/PAL: * PAL.xcodeproj/project.pbxproj: * pal/spi/cocoa/FeatureFlagsSPI.h: Added. Source/WebKit: No new tests, no functional change. Add WebKit.plist to the project in order to use the feature flags mechanism. * FeatureFlags/WebKit.plist: Added. Replace the default feature preference values defined with macros (for async_frame_and_overflow_scrolling, incremental_pdf, canvas_and_media_in_gpu_process, WebGL2, WebGPU, and webrtc_in_gpu_process) with functions implemented with the feature flags mechanism. * Shared/WebPreferences.yaml: * Shared/WebPreferencesDefaultValues.cpp: (WebKit::defaultAsyncFrameAndOverflowScrollingEnabled): (WebKit::defaultAsyncFrameScrollingEnabled): (WebKit::defaultAsyncOverflowScrollingEnabled): (WebKit::defaultUseGPUProcessForMedia): (WebKit::defaultRenderCanvasInGPUProcessEnabled): (WebKit::defaultCaptureAudioInGPUProcessEnabled): (WebKit::defaultCaptureAudioInUIProcessEnabled): (WebKit::defaultCaptureVideoInGPUProcessEnabled): (WebKit::defaultWebRTCCodecsInGPUProcess): (WebKit::defaultWebGL2Enabled): (WebKit::defaultWebGPUEnabled): * Shared/WebPreferencesDefaultValues.h: * WebKit.xcodeproj/project.pbxproj: Source/WTF: ENABLE_GPU_PROCESS_FOR_WEBRTC is removed because we will use the feature flags mechanism to give the default preference regarding the WebRTC in GPU process feature. This patch also adds macro HAVE_SYSTEM_FEATURE_FLAGS. * wtf/PlatformEnable.h: * wtf/PlatformEnableCocoa.h: * wtf/PlatformHave.h: Canonical link: https://commits.webkit.org/221638@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258026 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-03-06 21:32:45 +00:00
Remove all references to non-existent 10.16 https://bugs.webkit.org/show_bug.cgi?id=215202 Reviewed by Wenson Hsieh. Source/bmalloc: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: Source/JavaScriptCore: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/ThirdParty: * gtest/xcode/Config/DebugProject.xcconfig: * gtest/xcode/Config/ReleaseProject.xcconfig: Source/ThirdParty/ANGLE: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/ThirdParty/libwebrtc: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: * Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.h: Source/WebCore: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebCore/PAL: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebInspectorUI: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebKit: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: * Scripts/process-entitlements.sh: * WebProcess/com.apple.WebProcess.sb.in: Source/WebKitLegacy/mac: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WTF: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * wtf/PlatformEnableCocoa.h: * wtf/PlatformHave.h: * wtf/PlatformUse.h: Tools: * ContentExtensionTester/Configurations/Base.xcconfig: * ContentExtensionTester/Configurations/DebugRelease.xcconfig: * DumpRenderTree/mac/Configurations/Base.xcconfig: * DumpRenderTree/mac/Configurations/DebugRelease.xcconfig: * ImageDiff/cg/Configurations/Base.xcconfig: * ImageDiff/cg/Configurations/DebugRelease.xcconfig: * MiniBrowser/Configurations/Base.xcconfig: * MiniBrowser/Configurations/DebugRelease.xcconfig: * TestWebKitAPI/Configurations/Base.xcconfig: * TestWebKitAPI/Configurations/DebugRelease.xcconfig: * TestWebKitAPI/Configurations/WebKitTargetConditionals.xcconfig: * TestWebKitAPI/config.h: * WebEditingTester/Configurations/Base.xcconfig: * WebEditingTester/Configurations/DebugRelease.xcconfig: * WebKitTestRunner/Configurations/Base.xcconfig: * WebKitTestRunner/Configurations/DebugRelease.xcconfig: * lldb/lldbWebKitTester/Configurations/Base.xcconfig: * lldb/lldbWebKitTester/Configurations/DebugRelease.xcconfig: Canonical link: https://commits.webkit.org/227995@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@265315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-08-06 00:58:34 +00:00
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000)
#define HAVE_ALTERNATE_ICONS 1
#endif
Remove all references to non-existent 10.16 https://bugs.webkit.org/show_bug.cgi?id=215202 Reviewed by Wenson Hsieh. Source/bmalloc: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: Source/JavaScriptCore: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/ThirdParty: * gtest/xcode/Config/DebugProject.xcconfig: * gtest/xcode/Config/ReleaseProject.xcconfig: Source/ThirdParty/ANGLE: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/ThirdParty/libwebrtc: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: * Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.h: Source/WebCore: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebCore/PAL: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebInspectorUI: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebKit: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: * Scripts/process-entitlements.sh: * WebProcess/com.apple.WebProcess.sb.in: Source/WebKitLegacy/mac: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WTF: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * wtf/PlatformEnableCocoa.h: * wtf/PlatformHave.h: * wtf/PlatformUse.h: Tools: * ContentExtensionTester/Configurations/Base.xcconfig: * ContentExtensionTester/Configurations/DebugRelease.xcconfig: * DumpRenderTree/mac/Configurations/Base.xcconfig: * DumpRenderTree/mac/Configurations/DebugRelease.xcconfig: * ImageDiff/cg/Configurations/Base.xcconfig: * ImageDiff/cg/Configurations/DebugRelease.xcconfig: * MiniBrowser/Configurations/Base.xcconfig: * MiniBrowser/Configurations/DebugRelease.xcconfig: * TestWebKitAPI/Configurations/Base.xcconfig: * TestWebKitAPI/Configurations/DebugRelease.xcconfig: * TestWebKitAPI/Configurations/WebKitTargetConditionals.xcconfig: * TestWebKitAPI/config.h: * WebEditingTester/Configurations/Base.xcconfig: * WebEditingTester/Configurations/DebugRelease.xcconfig: * WebKitTestRunner/Configurations/Base.xcconfig: * WebKitTestRunner/Configurations/DebugRelease.xcconfig: * lldb/lldbWebKitTester/Configurations/Base.xcconfig: * lldb/lldbWebKitTester/Configurations/DebugRelease.xcconfig: Canonical link: https://commits.webkit.org/227995@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@265315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-08-06 00:58:34 +00:00
#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000
#define HAVE_LARGE_CONTROL_SIZE 1
#endif
#if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000)
#define HAVE_UICONTEXTMENU_LOCATION 1
#endif
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000) \
|| (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 150000) \
|| (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 70000) \
|| (PLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 140000) \
|| PLATFORM(WIN)
Use the feature flags mechanism to give default feature preference values https://bugs.webkit.org/show_bug.cgi?id=208607 Reviewed by Youenn Fablet. Source/WebCore/PAL: * PAL.xcodeproj/project.pbxproj: * pal/spi/cocoa/FeatureFlagsSPI.h: Added. Source/WebKit: No new tests, no functional change. Add WebKit.plist to the project in order to use the feature flags mechanism. * FeatureFlags/WebKit.plist: Added. Replace the default feature preference values defined with macros (for async_frame_and_overflow_scrolling, incremental_pdf, canvas_and_media_in_gpu_process, WebGL2, WebGPU, and webrtc_in_gpu_process) with functions implemented with the feature flags mechanism. * Shared/WebPreferences.yaml: * Shared/WebPreferencesDefaultValues.cpp: (WebKit::defaultAsyncFrameAndOverflowScrollingEnabled): (WebKit::defaultAsyncFrameScrollingEnabled): (WebKit::defaultAsyncOverflowScrollingEnabled): (WebKit::defaultUseGPUProcessForMedia): (WebKit::defaultRenderCanvasInGPUProcessEnabled): (WebKit::defaultCaptureAudioInGPUProcessEnabled): (WebKit::defaultCaptureAudioInUIProcessEnabled): (WebKit::defaultCaptureVideoInGPUProcessEnabled): (WebKit::defaultWebRTCCodecsInGPUProcess): (WebKit::defaultWebGL2Enabled): (WebKit::defaultWebGPUEnabled): * Shared/WebPreferencesDefaultValues.h: * WebKit.xcodeproj/project.pbxproj: Source/WTF: ENABLE_GPU_PROCESS_FOR_WEBRTC is removed because we will use the feature flags mechanism to give the default preference regarding the WebRTC in GPU process feature. This patch also adds macro HAVE_SYSTEM_FEATURE_FLAGS. * wtf/PlatformEnable.h: * wtf/PlatformEnableCocoa.h: * wtf/PlatformHave.h: Canonical link: https://commits.webkit.org/221638@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258026 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-03-06 21:32:45 +00:00
#define HAVE_SYSTEM_FEATURE_FLAGS 1
#endif
#if PLATFORM(IOS)
#define HAVE_AVOBSERVATIONCONTROLLER 1
#endif
// FIXME: Should this be enabled on other iOS-family platforms?
#if PLATFORM(IOS) || PLATFORM(MACCATALYST)
#define HAVE_CANCEL_WEB_TOUCH_EVENTS_GESTURE 1
#endif
Remove all references to non-existent 10.16 https://bugs.webkit.org/show_bug.cgi?id=215202 Reviewed by Wenson Hsieh. Source/bmalloc: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: Source/JavaScriptCore: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/ThirdParty: * gtest/xcode/Config/DebugProject.xcconfig: * gtest/xcode/Config/ReleaseProject.xcconfig: Source/ThirdParty/ANGLE: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/ThirdParty/libwebrtc: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: * Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.h: Source/WebCore: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebCore/PAL: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebInspectorUI: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebKit: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: * Scripts/process-entitlements.sh: * WebProcess/com.apple.WebProcess.sb.in: Source/WebKitLegacy/mac: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WTF: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * wtf/PlatformEnableCocoa.h: * wtf/PlatformHave.h: * wtf/PlatformUse.h: Tools: * ContentExtensionTester/Configurations/Base.xcconfig: * ContentExtensionTester/Configurations/DebugRelease.xcconfig: * DumpRenderTree/mac/Configurations/Base.xcconfig: * DumpRenderTree/mac/Configurations/DebugRelease.xcconfig: * ImageDiff/cg/Configurations/Base.xcconfig: * ImageDiff/cg/Configurations/DebugRelease.xcconfig: * MiniBrowser/Configurations/Base.xcconfig: * MiniBrowser/Configurations/DebugRelease.xcconfig: * TestWebKitAPI/Configurations/Base.xcconfig: * TestWebKitAPI/Configurations/DebugRelease.xcconfig: * TestWebKitAPI/Configurations/WebKitTargetConditionals.xcconfig: * TestWebKitAPI/config.h: * WebEditingTester/Configurations/Base.xcconfig: * WebEditingTester/Configurations/DebugRelease.xcconfig: * WebKitTestRunner/Configurations/Base.xcconfig: * WebKitTestRunner/Configurations/DebugRelease.xcconfig: * lldb/lldbWebKitTester/Configurations/Base.xcconfig: * lldb/lldbWebKitTester/Configurations/DebugRelease.xcconfig: Canonical link: https://commits.webkit.org/227995@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@265315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-08-06 00:58:34 +00:00
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000)
#define HAVE_DD_HIGHLIGHT_CREATE_WITH_SCALE 1
#endif
#if PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130400
#define HAVE_UISCENE_BASED_VIEW_SERVICE_STATE_NOTIFICATIONS 1
#endif
#if PLATFORM(IOS_FAMILY) && !PLATFORM(IOS_FAMILY_SIMULATOR) && !PLATFORM(MACCATALYST)
#define HAVE_IOS_JIT_RESTRICTIONS 1
#endif
Adopt interface AVAudioRoutingArbiter for Mac https://bugs.webkit.org/show_bug.cgi?id=210167 Source/WebCore: Reviewed by Eric Carlson. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/audio/ios/AudioSessionIOS.mm: (WebCore::AudioSession::setCategory): (WebCore::categoryName): Deleted. * platform/audio/mac/AudioSessionMac.mm: Renamed from Source/WebCore/platform/audio/mac/AudioSessionMac.cpp. (WebCore::AudioSession::setCategory): (WebCore::AudioSession::categoryOverride const): (WebCore::AudioSession::setCategoryOverride): Fix unified build failures. * platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.h: Source/WebCore/PAL: Reviewed by Eric Carlson. Add softlink for AVAudioRoutingArbiter. * pal/cocoa/AVFoundationSoftLink.h: * pal/cocoa/AVFoundationSoftLink.mm: Source/WebKit: <rdar://problem/59113994> Reviewed by Eric Carlson. Add a new cross-process object pair, AudioSessionRouterAbitrator/Proxy which passes routing arbitration commands from WebContent -> UIProcess. Because the UIProcess can represent multiple WebContent processes, it must track all outstanding arbitration requests globally. * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * GPUProcess/GPUProcess.cpp: (WebKit::GPUProcess::initializeGPUProcess): * Sources.txt: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::mediaRelatedMachServices): * UIProcess/Media/AudioSessionRoutingArbitratorProxy.cpp: Added. (WebKit::AudioSessionRoutingArbitratorProxy::AudioSessionRoutingArbitratorProxy): (WebKit::AudioSessionRoutingArbitratorProxy::~AudioSessionRoutingArbitratorProxy): (WebKit::AudioSessionRoutingArbitratorProxy::beginRoutingArbitrationWithCategory): (WebKit::AudioSessionRoutingArbitratorProxy::leaveRoutingArbitration): * UIProcess/Media/AudioSessionRoutingArbitratorProxy.h: Added. (WebKit::AudioSessionRoutingArbitratorProxy::category const): (WebKit::AudioSessionRoutingArbitratorProxy::destinationId): * UIProcess/Media/AudioSessionRoutingArbitratorProxy.messages.in: Added. * UIProcess/Media/cocoa/AudioSessionRoutingArbitratorProxyCocoa.mm: Added. (WebKit::SharedArbitrator::sharedInstance): (WebKit::SharedArbitrator::beginRoutingArbitrationForArbitrator): (WebKit::SharedArbitrator::leaveRoutingArbitrationForArbitrator): (WebKit::AudioSessionRoutingArbitratorProxy::AudioSessionRoutingArbitratorProxy): (WebKit::AudioSessionRoutingArbitratorProxy::~AudioSessionRoutingArbitratorProxy): (WebKit::AudioSessionRoutingArbitratorProxy::beginRoutingArbitrationWithCategory): (WebKit::AudioSessionRoutingArbitratorProxy::leaveRoutingArbitration): * UIProcess/WebPageProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::WebProcessProxy): * UIProcess/WebProcessProxy.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebPage/WebPage.cpp: (WebKit::m_processDisplayName): * WebProcess/WebProcess.cpp: * WebProcess/cocoa/AudioSessionRoutingArbitrator.cpp: Added. (WebKit::AudioSessionRoutingArbitrator::AudioSessionRoutingArbitrator): (WebKit::AudioSessionRoutingArbitrator::supplementName): (WebKit::AudioSessionRoutingArbitrator::beginRoutingArbitrationWithCategory): (WebKit::AudioSessionRoutingArbitrator::leaveRoutingAbritration): * WebProcess/cocoa/AudioSessionRoutingArbitrator.h: Added. * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::AudioFactory::createAudioCaptureSource): * WebProcess/com.apple.WebProcess.sb.in: Source/WTF: Reviewed by Eric Carlson. Add macro HAVE_AVAUDIO_ROUTING_ARBITER. * wtf/PlatformHave.h: Tools: Reviewed by Eric Carlson. Add test for softlink of AVAudioRoutingArbiter. * TestWebKitAPI/Tests/WebCore/cocoa/AVFoundationSoftLinkTest.mm: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/223396@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@260102 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-04-14 22:35:47 +00:00
Remove all references to non-existent 10.16 https://bugs.webkit.org/show_bug.cgi?id=215202 Reviewed by Wenson Hsieh. Source/bmalloc: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: Source/JavaScriptCore: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/ThirdParty: * gtest/xcode/Config/DebugProject.xcconfig: * gtest/xcode/Config/ReleaseProject.xcconfig: Source/ThirdParty/ANGLE: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/ThirdParty/libwebrtc: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: * Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.h: Source/WebCore: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebCore/PAL: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebInspectorUI: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebKit: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: * Scripts/process-entitlements.sh: * WebProcess/com.apple.WebProcess.sb.in: Source/WebKitLegacy/mac: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WTF: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * wtf/PlatformEnableCocoa.h: * wtf/PlatformHave.h: * wtf/PlatformUse.h: Tools: * ContentExtensionTester/Configurations/Base.xcconfig: * ContentExtensionTester/Configurations/DebugRelease.xcconfig: * DumpRenderTree/mac/Configurations/Base.xcconfig: * DumpRenderTree/mac/Configurations/DebugRelease.xcconfig: * ImageDiff/cg/Configurations/Base.xcconfig: * ImageDiff/cg/Configurations/DebugRelease.xcconfig: * MiniBrowser/Configurations/Base.xcconfig: * MiniBrowser/Configurations/DebugRelease.xcconfig: * TestWebKitAPI/Configurations/Base.xcconfig: * TestWebKitAPI/Configurations/DebugRelease.xcconfig: * TestWebKitAPI/Configurations/WebKitTargetConditionals.xcconfig: * TestWebKitAPI/config.h: * WebEditingTester/Configurations/Base.xcconfig: * WebEditingTester/Configurations/DebugRelease.xcconfig: * WebKitTestRunner/Configurations/Base.xcconfig: * WebKitTestRunner/Configurations/DebugRelease.xcconfig: * lldb/lldbWebKitTester/Configurations/Base.xcconfig: * lldb/lldbWebKitTester/Configurations/DebugRelease.xcconfig: Canonical link: https://commits.webkit.org/227995@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@265315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-08-06 00:58:34 +00:00
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000)
Adopt interface AVAudioRoutingArbiter for Mac https://bugs.webkit.org/show_bug.cgi?id=210167 Source/WebCore: Reviewed by Eric Carlson. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/audio/ios/AudioSessionIOS.mm: (WebCore::AudioSession::setCategory): (WebCore::categoryName): Deleted. * platform/audio/mac/AudioSessionMac.mm: Renamed from Source/WebCore/platform/audio/mac/AudioSessionMac.cpp. (WebCore::AudioSession::setCategory): (WebCore::AudioSession::categoryOverride const): (WebCore::AudioSession::setCategoryOverride): Fix unified build failures. * platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.h: Source/WebCore/PAL: Reviewed by Eric Carlson. Add softlink for AVAudioRoutingArbiter. * pal/cocoa/AVFoundationSoftLink.h: * pal/cocoa/AVFoundationSoftLink.mm: Source/WebKit: <rdar://problem/59113994> Reviewed by Eric Carlson. Add a new cross-process object pair, AudioSessionRouterAbitrator/Proxy which passes routing arbitration commands from WebContent -> UIProcess. Because the UIProcess can represent multiple WebContent processes, it must track all outstanding arbitration requests globally. * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * GPUProcess/GPUProcess.cpp: (WebKit::GPUProcess::initializeGPUProcess): * Sources.txt: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::mediaRelatedMachServices): * UIProcess/Media/AudioSessionRoutingArbitratorProxy.cpp: Added. (WebKit::AudioSessionRoutingArbitratorProxy::AudioSessionRoutingArbitratorProxy): (WebKit::AudioSessionRoutingArbitratorProxy::~AudioSessionRoutingArbitratorProxy): (WebKit::AudioSessionRoutingArbitratorProxy::beginRoutingArbitrationWithCategory): (WebKit::AudioSessionRoutingArbitratorProxy::leaveRoutingArbitration): * UIProcess/Media/AudioSessionRoutingArbitratorProxy.h: Added. (WebKit::AudioSessionRoutingArbitratorProxy::category const): (WebKit::AudioSessionRoutingArbitratorProxy::destinationId): * UIProcess/Media/AudioSessionRoutingArbitratorProxy.messages.in: Added. * UIProcess/Media/cocoa/AudioSessionRoutingArbitratorProxyCocoa.mm: Added. (WebKit::SharedArbitrator::sharedInstance): (WebKit::SharedArbitrator::beginRoutingArbitrationForArbitrator): (WebKit::SharedArbitrator::leaveRoutingArbitrationForArbitrator): (WebKit::AudioSessionRoutingArbitratorProxy::AudioSessionRoutingArbitratorProxy): (WebKit::AudioSessionRoutingArbitratorProxy::~AudioSessionRoutingArbitratorProxy): (WebKit::AudioSessionRoutingArbitratorProxy::beginRoutingArbitrationWithCategory): (WebKit::AudioSessionRoutingArbitratorProxy::leaveRoutingArbitration): * UIProcess/WebPageProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::WebProcessProxy): * UIProcess/WebProcessProxy.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebPage/WebPage.cpp: (WebKit::m_processDisplayName): * WebProcess/WebProcess.cpp: * WebProcess/cocoa/AudioSessionRoutingArbitrator.cpp: Added. (WebKit::AudioSessionRoutingArbitrator::AudioSessionRoutingArbitrator): (WebKit::AudioSessionRoutingArbitrator::supplementName): (WebKit::AudioSessionRoutingArbitrator::beginRoutingArbitrationWithCategory): (WebKit::AudioSessionRoutingArbitrator::leaveRoutingAbritration): * WebProcess/cocoa/AudioSessionRoutingArbitrator.h: Added. * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::AudioFactory::createAudioCaptureSource): * WebProcess/com.apple.WebProcess.sb.in: Source/WTF: Reviewed by Eric Carlson. Add macro HAVE_AVAUDIO_ROUTING_ARBITER. * wtf/PlatformHave.h: Tools: Reviewed by Eric Carlson. Add test for softlink of AVAudioRoutingArbiter. * TestWebKitAPI/Tests/WebCore/cocoa/AVFoundationSoftLinkTest.mm: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/223396@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@260102 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-04-14 22:35:47 +00:00
#define HAVE_AVAUDIO_ROUTING_ARBITER 1
#endif
[macOS] Update ScreenTime as playback state changes https://bugs.webkit.org/show_bug.cgi?id=210518 <rdar://problem/61181092> Reviewed by Jer Noble. Source/WebCore: Test: media/media-usage-state.html Pass media element state to the UI process whenever it changes. * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::HTMLMediaElement): (WebCore::HTMLMediaElement::mediaSessionUniqueIdentifier const): * html/HTMLMediaElement.h: * html/MediaElementSession.cpp: (WebCore::MediaElementSession::MediaElementSession): (WebCore::MediaElementSession::~MediaElementSession): (WebCore::MediaElementSession::updateMediaUsageIfChanged): * html/MediaElementSession.h: * page/ChromeClient.h: (WebCore::ChromeClient::addMediaUsageManagerSession): (WebCore::ChromeClient::updateMediaUsageManagerSessionState): (WebCore::ChromeClient::removeMediaUsageManagerSession): * platform/audio/PlatformMediaSession.cpp: (WebCore::PlatformMediaSession::PlatformMediaSession): * platform/audio/PlatformMediaSession.h: (WebCore::PlatformMediaSession::updateMediaUsageIfChanged): (WebCore::PlatformMediaSession::mediaSessionIdentifier const): * platform/audio/PlatformMediaSessionManager.cpp: (WebCore::PlatformMediaSessionManager::updateNowPlayingInfoIfNecessary): * platform/audio/PlatformMediaSessionManager.h: (WebCore::PlatformMediaSessionManager::scheduleUpdateSessionStatus): (WebCore::PlatformMediaSessionManager::sessionDidEndRemoteScrubbing): (WebCore::PlatformMediaSessionManager::scheduleUpdateNowPlayingInfo): Deleted. * platform/audio/cocoa/MediaSessionManagerCocoa.h: * platform/audio/cocoa/MediaSessionManagerCocoa.mm: (WebCore::MediaSessionManagerCocoa::scheduleUpdateSessionStatus): (WebCore::MediaSessionManagerCocoa::sessionWillBeginPlayback): (WebCore::MediaSessionManagerCocoa::sessionDidEndRemoteScrubbing): (WebCore::MediaSessionManagerCocoa::removeSession): (WebCore::MediaSessionManagerCocoa::sessionWillEndPlayback): (WebCore::MediaSessionManagerCocoa::clientCharacteristicsChanged): (WebCore::MediaSessionManagerCocoa::sessionCanProduceAudioChanged): (WebCore::MediaSessionManagerCocoa::scheduleUpdateNowPlayingInfo): Deleted. * platform/audio/ios/MediaSessionManagerIOS.mm: (WebCore::MediaSessionManageriOS::resetRestrictions): (WebCore::MediaSessionManageriOS::sessionWillBeginPlayback): * platform/graphics/MediaUsageInfo.h: Added. (WebCore::MediaUsageInfo::operator== const): (WebCore::MediaUsageInfo::operator!= const): (WebCore::MediaUsageInfo::encode const): (WebCore::MediaUsageInfo::decode): * testing/Internals.cpp: (WebCore::Internals::setMediaElementRestrictions): (WebCore::Internals::mediaUsageState const): * testing/Internals.h: * testing/Internals.idl: Source/WebCore/PAL: Soft link the UsageTracking framework. * PAL.xcodeproj/project.pbxproj: * pal/cocoa/UsageTrackingSoftLink.h: Added. * pal/cocoa/UsageTrackingSoftLink.mm: Added. Source/WebKit: Add a manager that gets media element state changes, and a Cocoa-specific implementation that passes that state to ScreenTime. * Scripts/webkit/messages.py: * Sources.txt: * SourcesCocoa.txt: * UIProcess/Cocoa/WebPageProxyCocoa.mm: (WebKit::WebPageProxy::mediaUsageManager): (WebKit::WebPageProxy::addMediaUsageManagerSession): (WebKit::WebPageProxy::updateMediaUsageManagerSessionState): (WebKit::WebPageProxy::removeMediaUsageManagerSession): * UIProcess/Media/MediaUsageManager.cpp: Added. (WebKit::MediaUsageManager::create): (WebKit::reset): (WebKit::MediaUsageManager::addMediaSession): (WebKit::MediaUsageManager::removeMediaSession): (WebKit::MediaUsageManager::updateMediaUsage): * UIProcess/Media/MediaUsageManager.h: Added. * UIProcess/Media/cocoa/MediaUsageManagerCocoa.h: Added. (WebKit::MediaUsageManagerCocoa::SessionMediaUsage::SessionMediaUsage): * UIProcess/Media/cocoa/MediaUsageManagerCocoa.mm: Added. (WebKit::usageTrackingAvailable): (WebKit::MediaUsageManager::create): (WebKit::MediaUsageManagerCocoa::~MediaUsageManagerCocoa): (WebKit::MediaUsageManagerCocoa::reset): (WebKit::MediaUsageManagerCocoa::addMediaSession): (WebKit::MediaUsageManagerCocoa::removeMediaSession): (WebKit::MediaUsageManagerCocoa::updateMediaUsage): * UIProcess/WebAuthentication/AuthenticatorManager.cpp: * UIProcess/WebAuthentication/Mock/MockLocalConnection.mm: * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::addMediaUsageManagerSession): (WebKit::WebChromeClient::updateMediaUsageManagerSessionState): (WebKit::WebChromeClient::removeMediaUsageManagerSession): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::addMediaUsageManagerSession): (WebKit::WebPage::updateMediaUsageManagerSessionState): (WebKit::WebPage::removeMediaUsageManagerSession): * WebProcess/WebPage/WebPage.h: Source/WTF: Define HAVE_MEDIA_USAGE_FRAMEWORK and ENABLE_MEDIA_USAGE * wtf/PlatformEnableCocoa.h: * wtf/PlatformHave.h: LayoutTests: * media/media-usage-state-expected.txt: Added. * media/media-usage-state.html: Added. * platform/gtk/TestExpectations: Skip new test. * platform/win/TestExpectations: Ditto. * platform/wpe/TestExpectations: Ditto. Canonical link: https://commits.webkit.org/223468@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@260182 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-04-16 13:36:07 +00:00
Remove all references to non-existent 10.16 https://bugs.webkit.org/show_bug.cgi?id=215202 Reviewed by Wenson Hsieh. Source/bmalloc: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: Source/JavaScriptCore: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/ThirdParty: * gtest/xcode/Config/DebugProject.xcconfig: * gtest/xcode/Config/ReleaseProject.xcconfig: Source/ThirdParty/ANGLE: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/ThirdParty/libwebrtc: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: * Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.h: Source/WebCore: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebCore/PAL: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebInspectorUI: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebKit: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: * Scripts/process-entitlements.sh: * WebProcess/com.apple.WebProcess.sb.in: Source/WebKitLegacy/mac: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WTF: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * wtf/PlatformEnableCocoa.h: * wtf/PlatformHave.h: * wtf/PlatformUse.h: Tools: * ContentExtensionTester/Configurations/Base.xcconfig: * ContentExtensionTester/Configurations/DebugRelease.xcconfig: * DumpRenderTree/mac/Configurations/Base.xcconfig: * DumpRenderTree/mac/Configurations/DebugRelease.xcconfig: * ImageDiff/cg/Configurations/Base.xcconfig: * ImageDiff/cg/Configurations/DebugRelease.xcconfig: * MiniBrowser/Configurations/Base.xcconfig: * MiniBrowser/Configurations/DebugRelease.xcconfig: * TestWebKitAPI/Configurations/Base.xcconfig: * TestWebKitAPI/Configurations/DebugRelease.xcconfig: * TestWebKitAPI/Configurations/WebKitTargetConditionals.xcconfig: * TestWebKitAPI/config.h: * WebEditingTester/Configurations/Base.xcconfig: * WebEditingTester/Configurations/DebugRelease.xcconfig: * WebKitTestRunner/Configurations/Base.xcconfig: * WebKitTestRunner/Configurations/DebugRelease.xcconfig: * lldb/lldbWebKitTester/Configurations/Base.xcconfig: * lldb/lldbWebKitTester/Configurations/DebugRelease.xcconfig: Canonical link: https://commits.webkit.org/227995@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@265315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-08-06 00:58:34 +00:00
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000) || (PLATFORM(MACCATALYST) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000)
[macOS] Update ScreenTime as playback state changes https://bugs.webkit.org/show_bug.cgi?id=210518 <rdar://problem/61181092> Reviewed by Jer Noble. Source/WebCore: Test: media/media-usage-state.html Pass media element state to the UI process whenever it changes. * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::HTMLMediaElement): (WebCore::HTMLMediaElement::mediaSessionUniqueIdentifier const): * html/HTMLMediaElement.h: * html/MediaElementSession.cpp: (WebCore::MediaElementSession::MediaElementSession): (WebCore::MediaElementSession::~MediaElementSession): (WebCore::MediaElementSession::updateMediaUsageIfChanged): * html/MediaElementSession.h: * page/ChromeClient.h: (WebCore::ChromeClient::addMediaUsageManagerSession): (WebCore::ChromeClient::updateMediaUsageManagerSessionState): (WebCore::ChromeClient::removeMediaUsageManagerSession): * platform/audio/PlatformMediaSession.cpp: (WebCore::PlatformMediaSession::PlatformMediaSession): * platform/audio/PlatformMediaSession.h: (WebCore::PlatformMediaSession::updateMediaUsageIfChanged): (WebCore::PlatformMediaSession::mediaSessionIdentifier const): * platform/audio/PlatformMediaSessionManager.cpp: (WebCore::PlatformMediaSessionManager::updateNowPlayingInfoIfNecessary): * platform/audio/PlatformMediaSessionManager.h: (WebCore::PlatformMediaSessionManager::scheduleUpdateSessionStatus): (WebCore::PlatformMediaSessionManager::sessionDidEndRemoteScrubbing): (WebCore::PlatformMediaSessionManager::scheduleUpdateNowPlayingInfo): Deleted. * platform/audio/cocoa/MediaSessionManagerCocoa.h: * platform/audio/cocoa/MediaSessionManagerCocoa.mm: (WebCore::MediaSessionManagerCocoa::scheduleUpdateSessionStatus): (WebCore::MediaSessionManagerCocoa::sessionWillBeginPlayback): (WebCore::MediaSessionManagerCocoa::sessionDidEndRemoteScrubbing): (WebCore::MediaSessionManagerCocoa::removeSession): (WebCore::MediaSessionManagerCocoa::sessionWillEndPlayback): (WebCore::MediaSessionManagerCocoa::clientCharacteristicsChanged): (WebCore::MediaSessionManagerCocoa::sessionCanProduceAudioChanged): (WebCore::MediaSessionManagerCocoa::scheduleUpdateNowPlayingInfo): Deleted. * platform/audio/ios/MediaSessionManagerIOS.mm: (WebCore::MediaSessionManageriOS::resetRestrictions): (WebCore::MediaSessionManageriOS::sessionWillBeginPlayback): * platform/graphics/MediaUsageInfo.h: Added. (WebCore::MediaUsageInfo::operator== const): (WebCore::MediaUsageInfo::operator!= const): (WebCore::MediaUsageInfo::encode const): (WebCore::MediaUsageInfo::decode): * testing/Internals.cpp: (WebCore::Internals::setMediaElementRestrictions): (WebCore::Internals::mediaUsageState const): * testing/Internals.h: * testing/Internals.idl: Source/WebCore/PAL: Soft link the UsageTracking framework. * PAL.xcodeproj/project.pbxproj: * pal/cocoa/UsageTrackingSoftLink.h: Added. * pal/cocoa/UsageTrackingSoftLink.mm: Added. Source/WebKit: Add a manager that gets media element state changes, and a Cocoa-specific implementation that passes that state to ScreenTime. * Scripts/webkit/messages.py: * Sources.txt: * SourcesCocoa.txt: * UIProcess/Cocoa/WebPageProxyCocoa.mm: (WebKit::WebPageProxy::mediaUsageManager): (WebKit::WebPageProxy::addMediaUsageManagerSession): (WebKit::WebPageProxy::updateMediaUsageManagerSessionState): (WebKit::WebPageProxy::removeMediaUsageManagerSession): * UIProcess/Media/MediaUsageManager.cpp: Added. (WebKit::MediaUsageManager::create): (WebKit::reset): (WebKit::MediaUsageManager::addMediaSession): (WebKit::MediaUsageManager::removeMediaSession): (WebKit::MediaUsageManager::updateMediaUsage): * UIProcess/Media/MediaUsageManager.h: Added. * UIProcess/Media/cocoa/MediaUsageManagerCocoa.h: Added. (WebKit::MediaUsageManagerCocoa::SessionMediaUsage::SessionMediaUsage): * UIProcess/Media/cocoa/MediaUsageManagerCocoa.mm: Added. (WebKit::usageTrackingAvailable): (WebKit::MediaUsageManager::create): (WebKit::MediaUsageManagerCocoa::~MediaUsageManagerCocoa): (WebKit::MediaUsageManagerCocoa::reset): (WebKit::MediaUsageManagerCocoa::addMediaSession): (WebKit::MediaUsageManagerCocoa::removeMediaSession): (WebKit::MediaUsageManagerCocoa::updateMediaUsage): * UIProcess/WebAuthentication/AuthenticatorManager.cpp: * UIProcess/WebAuthentication/Mock/MockLocalConnection.mm: * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::addMediaUsageManagerSession): (WebKit::WebChromeClient::updateMediaUsageManagerSessionState): (WebKit::WebChromeClient::removeMediaUsageManagerSession): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::addMediaUsageManagerSession): (WebKit::WebPage::updateMediaUsageManagerSessionState): (WebKit::WebPage::removeMediaUsageManagerSession): * WebProcess/WebPage/WebPage.h: Source/WTF: Define HAVE_MEDIA_USAGE_FRAMEWORK and ENABLE_MEDIA_USAGE * wtf/PlatformEnableCocoa.h: * wtf/PlatformHave.h: LayoutTests: * media/media-usage-state-expected.txt: Added. * media/media-usage-state.html: Added. * platform/gtk/TestExpectations: Skip new test. * platform/win/TestExpectations: Ditto. * platform/wpe/TestExpectations: Ditto. Canonical link: https://commits.webkit.org/223468@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@260182 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-04-16 13:36:07 +00:00
#define HAVE_MEDIA_USAGE_FRAMEWORK 1
#endif
WK2 Quicklook for attachments https://bugs.webkit.org/show_bug.cgi?id=208891 Reviewed by Darin Adler. Source/WebCore: Added to HTMLAttachmentElement to have member image representing QuickLook thumbnail. Added code to render this image on both iOS and Mac. No new tests. Test will be added after additions to test infrastructure. * html/HTMLAttachmentElement.cpp: (WebCore::HTMLAttachmentElement::updateThumbnailRepresentation): Allow setting of thumbnail member. * html/HTMLAttachmentElement.h: * rendering/RenderThemeIOS.mm: Added rendering of image member of attachment element. (WebCore::RenderAttachmentInfo::RenderAttachmentInfo): (WebCore::paintAttachmentIcon): (WebCore::RenderThemeIOS::paintAttachment): * rendering/RenderThemeMac.mm: (WebCore::paintAttachmentIcon): Source/WebKit: Allow attachment elements to render QuickLook thumbnail generated from contents of the file as its icon, rather than the default icons associated with each mime type. * Configurations/WebKit.xcconfig: Link QuickLook thumbnailing framework. * UIProcess/API/APIAttachment.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _insertAttachmentWithFileWrapper:contentType:completion:]): * UIProcess/Cocoa/WebPageProxyCocoa.mm: Create thumbnail request and add to queue. (WebKit::convertNSImageToBitmap): (WebKit::convertUIImageToBitmap): (WebKit::WebPageProxy::getQLThumbnailForGenerationRequestion): (WebKit::WebPageProxy::getQLThumbnailForFileWrapper): (WebKit::WebPageProxy::getQLThumbnailForAttachment): * UIProcess/QLThumbnailLoad.h: Added. * UIProcess/QLThumbnailLoad.mm: Added. Add code to request thumbnail for file data. (-[WKQLThumbnailQueueManager init]): (+[WKQLThumbnailQueueManager sharedInstance]): (-[WKQLThumbnailLoadOperation initWithAttachment:identifier:]): (-[WKQLThumbnailLoadOperation initWithURL:identifier:]): (-[WKQLThumbnailLoadOperation start]): (-[WKQLThumbnailLoadOperation isAsynchronous]): (-[WKQLThumbnailLoadOperation isExecuting]): (-[WKQLThumbnailLoadOperation setExecuting:]): (-[WKQLThumbnailLoadOperation isFinished]): (-[WKQLThumbnailLoadOperation setFinished:]): * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updateAttachmentIcon): Set thumbnail of attachment element * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: Thumbnail request message. Canonical link: https://commits.webkit.org/223659@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@260407 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-04-21 00:27:46 +00:00
#if PLATFORM(IOS) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500)
#define HAVE_PASSKIT_BOUND_INTERFACE_IDENTIFIER 1
#endif
[Apple Pay] Enable layout tests on more platforms https://bugs.webkit.org/show_bug.cgi?id=212955 <rdar://problem/64174156> Reviewed by Alex Christensen. Source/WebCore: Added runtime checks to determine the Apple Pay API version when installments are enabled. Enabled tests in http/tests/ssl/applepay on iOS. * Modules/applepay/ApplePayInstallmentConfiguration.idl: * Modules/applepay/ApplePayInstallmentConfigurationWebCore.h: * Modules/applepay/ApplePayInstallmentItem.h: * Modules/applepay/ApplePayInstallmentItem.idl: * Modules/applepay/ApplePayInstallmentItemType.h: * Modules/applepay/ApplePayInstallmentItemType.idl: * Modules/applepay/ApplePayInstallmentRetailChannel.h: * Modules/applepay/ApplePayInstallmentRetailChannel.idl: Removed uses of APPLE_PAY_INSTALLMENT_IDENTIFIERS and APPLE_PAY_INSTALLMENT_ITEMS (or replaced with APPLE_PAY_INSTALLMENTS). * Modules/applepay/PaymentAPIVersion.h: * Modules/applepay/cocoa/PaymentAPIVersionCocoa.mm: (WebCore::PaymentAPIVersion::current): Moved the computation of current API version from PaymentCoordinatorClient::supportsVersion to here. Added runtime checks to determine the level of PassKit installments support since we don't have enough information to tell at compile time. * Modules/applepay/PaymentCoordinatorClient.cpp: (WebCore::PaymentCoordinatorClient::supportsVersion): Changed to call PaymentAPIVersion::current. * Modules/applepay/PaymentInstallmentConfiguration.mm: (WebCore::makeNSArrayElement): (WebCore::createPlatformConfiguration): (WebCore::PaymentInstallmentConfiguration::create): (WebCore::PaymentInstallmentConfiguration::applePayInstallmentConfiguration const): Removed uses of HAVE_PASSKIT_INSTALLMENT_ITEMS and HAVE_PASSKIT_INSTALLMENT_IDENTIFIERS. Used runtime checks to determine support for PKPaymentInstallmentConfiguration and PKPaymentInstallmentItem. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: Added source files for PaymentAPIVersion. Source/WebCore/PAL: PassKit added SPIs for Apple Pay installments over a series of iOS 13 and macOS Catalina minor updates. WebKit trunk is still built across a range of iOS 13 and macOS Catalina minor update SDKs that contain none, some, or all of the installment SPIs. It's not possible to reliably detect the SDK minor version at compile-time, so instead we now use our own SPI declarations unless we know all minor versions of the major SDK version contain all of the installments definitions. * PAL.xcodeproj/project.pbxproj: Added PassKitInstallmentsSPI.h. * pal/cocoa/PassKitSoftLink.h: * pal/cocoa/PassKitSoftLink.mm: Used SOFT_LINK_CLASS_FOR_SOURCE_OPTIONAL_WITH_EXPORT on both Mac and iOS to soft-link PKPaymentInstallmentConfiguration and PKPaymentInstallmentItem. * pal/spi/cocoa/PassKitInstallmentSPI.h: Added. When building against an SDK that is known to declare the PassKit installments SPIs, this file includes the SPI headers. Otherwise, it declares the SPIs. * pal/spi/cocoa/PassKitSPI.h: Moved PassKit installments SPI declarations to PassKitInstallmentSPI.h. Source/WTF: * wtf/PlatformEnableCocoa.h: Removed ENABLE_APPLE_PAY_INSTALLMENT_IDENTIFIERS, ENABLE_APPLE_PAY_INSTALLMENT_ITEMS, ENABLE_APPLE_PAY_SESSION_V8, ENABLE_APPLE_PAY_SESSION_V9, and ENABLE_APPLE_PAY_SESSION_V10. * wtf/PlatformHave.h: Removed HAVE_PASSKIT_INSTALLMENT_IDENTIFIERS and corrected iOS version checks for HAVE_PASSKIT_INSTALLMENTS. LayoutTests: * http/tests/ssl/applepay/ApplePayInstallmentItems.https.html: Changed to fail instead of time out when API version 9 isn't supported. * http/tests/ssl/applepay/ApplePayError.html: * http/tests/ssl/applepay/ApplePaySession.html: * http/tests/ssl/applepay/ApplePaySessionV3.html: * http/tests/ssl/applepay/ApplePaySessionV4.html: * http/tests/ssl/applepay/ApplePaySessionV5.html: Removed a custom element-clicking function and used UIHelper.activateElement instead. * platform/ios-wk2/TestExpectations: Un-skipped http/tests/ssl/applepay. Marked PaymentRequest.https.html as Slow. Marked ApplePayInstallmentItems.https.html as Failure. * platform/mac-wk2/TestExpectations: Removed a trailing '/'. Skipped ApplePayInstallmentItems.https.html on Mojave and marked it as Failure on Catalina. Canonical link: https://commits.webkit.org/226081@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263150 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-17 15:55:49 +00:00
#if PLATFORM(IOS) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500)
#define HAVE_PASSKIT_INSTALLMENTS 1
#endif
[Apple Pay] Enable layout tests on more platforms https://bugs.webkit.org/show_bug.cgi?id=212955 <rdar://problem/64174156> Reviewed by Alex Christensen. Source/WebCore: Added runtime checks to determine the Apple Pay API version when installments are enabled. Enabled tests in http/tests/ssl/applepay on iOS. * Modules/applepay/ApplePayInstallmentConfiguration.idl: * Modules/applepay/ApplePayInstallmentConfigurationWebCore.h: * Modules/applepay/ApplePayInstallmentItem.h: * Modules/applepay/ApplePayInstallmentItem.idl: * Modules/applepay/ApplePayInstallmentItemType.h: * Modules/applepay/ApplePayInstallmentItemType.idl: * Modules/applepay/ApplePayInstallmentRetailChannel.h: * Modules/applepay/ApplePayInstallmentRetailChannel.idl: Removed uses of APPLE_PAY_INSTALLMENT_IDENTIFIERS and APPLE_PAY_INSTALLMENT_ITEMS (or replaced with APPLE_PAY_INSTALLMENTS). * Modules/applepay/PaymentAPIVersion.h: * Modules/applepay/cocoa/PaymentAPIVersionCocoa.mm: (WebCore::PaymentAPIVersion::current): Moved the computation of current API version from PaymentCoordinatorClient::supportsVersion to here. Added runtime checks to determine the level of PassKit installments support since we don't have enough information to tell at compile time. * Modules/applepay/PaymentCoordinatorClient.cpp: (WebCore::PaymentCoordinatorClient::supportsVersion): Changed to call PaymentAPIVersion::current. * Modules/applepay/PaymentInstallmentConfiguration.mm: (WebCore::makeNSArrayElement): (WebCore::createPlatformConfiguration): (WebCore::PaymentInstallmentConfiguration::create): (WebCore::PaymentInstallmentConfiguration::applePayInstallmentConfiguration const): Removed uses of HAVE_PASSKIT_INSTALLMENT_ITEMS and HAVE_PASSKIT_INSTALLMENT_IDENTIFIERS. Used runtime checks to determine support for PKPaymentInstallmentConfiguration and PKPaymentInstallmentItem. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: Added source files for PaymentAPIVersion. Source/WebCore/PAL: PassKit added SPIs for Apple Pay installments over a series of iOS 13 and macOS Catalina minor updates. WebKit trunk is still built across a range of iOS 13 and macOS Catalina minor update SDKs that contain none, some, or all of the installment SPIs. It's not possible to reliably detect the SDK minor version at compile-time, so instead we now use our own SPI declarations unless we know all minor versions of the major SDK version contain all of the installments definitions. * PAL.xcodeproj/project.pbxproj: Added PassKitInstallmentsSPI.h. * pal/cocoa/PassKitSoftLink.h: * pal/cocoa/PassKitSoftLink.mm: Used SOFT_LINK_CLASS_FOR_SOURCE_OPTIONAL_WITH_EXPORT on both Mac and iOS to soft-link PKPaymentInstallmentConfiguration and PKPaymentInstallmentItem. * pal/spi/cocoa/PassKitInstallmentSPI.h: Added. When building against an SDK that is known to declare the PassKit installments SPIs, this file includes the SPI headers. Otherwise, it declares the SPIs. * pal/spi/cocoa/PassKitSPI.h: Moved PassKit installments SPI declarations to PassKitInstallmentSPI.h. Source/WTF: * wtf/PlatformEnableCocoa.h: Removed ENABLE_APPLE_PAY_INSTALLMENT_IDENTIFIERS, ENABLE_APPLE_PAY_INSTALLMENT_ITEMS, ENABLE_APPLE_PAY_SESSION_V8, ENABLE_APPLE_PAY_SESSION_V9, and ENABLE_APPLE_PAY_SESSION_V10. * wtf/PlatformHave.h: Removed HAVE_PASSKIT_INSTALLMENT_IDENTIFIERS and corrected iOS version checks for HAVE_PASSKIT_INSTALLMENTS. LayoutTests: * http/tests/ssl/applepay/ApplePayInstallmentItems.https.html: Changed to fail instead of time out when API version 9 isn't supported. * http/tests/ssl/applepay/ApplePayError.html: * http/tests/ssl/applepay/ApplePaySession.html: * http/tests/ssl/applepay/ApplePaySessionV3.html: * http/tests/ssl/applepay/ApplePaySessionV4.html: * http/tests/ssl/applepay/ApplePaySessionV5.html: Removed a custom element-clicking function and used UIHelper.activateElement instead. * platform/ios-wk2/TestExpectations: Un-skipped http/tests/ssl/applepay. Marked PaymentRequest.https.html as Slow. Marked ApplePayInstallmentItems.https.html as Failure. * platform/mac-wk2/TestExpectations: Removed a trailing '/'. Skipped ApplePayInstallmentItems.https.html on Mojave and marked it as Failure on Catalina. Canonical link: https://commits.webkit.org/226081@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263150 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-17 15:55:49 +00:00
#if PLATFORM(IOS) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500)
#define HAVE_PASSKIT_PAYMENT_METHOD_BILLING_ADDRESS 1
#endif
[Payment Request] upstream new features https://bugs.webkit.org/show_bug.cgi?id=226740 <rdar://problem/78963132> Reviewed by Andy Estes. Source/WebCore: - recurring line items (`HAVE_PASSKIT_RECURRING_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_RECURRING_LINE_ITEM`) - deferred line items (`HAVE_PASSKIT_DEFERRED_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_DEFERRED_LINE_ITEM`) - estimated shipping dates (`HAVE_PASSKIT_SHIPPING_METHOD_DATE_COMPONENTS_RANGE` and `ENABLE_APPLE_PAY_SHIPPING_METHOD_DATE_COMPONENTS_RANGE`) - coupon code entry (`HAVE_PASSKIT_COUPON_CODE` and `ENABLE_APPLE_PAY_COUPON_CODE`) - shipped vs in-store pickup (`HAVE_PASSKIT_SHIPPING_CONTACT_EDITING_MODE` and `ENABLE_APPLE_PAY_SHIPPING_CONTACT_EDITING_MODE`) Tests: http/tests/paymentrequest/ApplePayModifier-additionalLineItems.https.html http/tests/paymentrequest/ApplePayModifier-additionalShippingMethods.https.html http/tests/paymentrequest/ApplePayModifier-total.https.html http/tests/paymentrequest/paymentmethodchange-couponCode.https.html http/tests/paymentrequest/paymentrequest-couponCode.https.html http/tests/paymentrequest/paymentrequest-shippingContactEditingMode.https.html http/tests/paymentrequest/paymentrequest-supportsCouponCode.https.html * Modules/applepay/ApplePayCouponCodeUpdate.idl: Copied from Source/WebCore/Modules/applepay/ApplePayPaymentMethodModeUpdate.idl. * Modules/applepay/ApplePayCouponCodeUpdate.h: Renamed from Source/WebCore/Modules/applepay/ApplePayPaymentMethodModeUpdate.h. (WebCore::ApplePayCouponCodeUpdate::encode const): (WebCore::ApplePayCouponCodeUpdate::decode): Object used to update the payment request via `ApplePaySession.prototype.completeCouponCodeChange` when responding to the user modifying the coupon code. * Modules/applepay/ApplePayErrorCode.idl: * Modules/applepay/ApplePayErrorCode.h: Add `"couponCodeInvalid"` and `"couponCodeExpired"`. * Modules/applepay/ApplePayLineItem.idl: * Modules/applepay/ApplePayLineItem.h: (WebCore::ApplePayLineItem::encode const): (WebCore::ApplePayLineItem::decode): * Modules/applepay/ApplePayPaymentTiming.idl: Added. * Modules/applepay/ApplePayPaymentTiming.h: Added. * Modules/applepay/ApplePayRecurringPaymentDateUnit.idl: Added. * Modules/applepay/ApplePayRecurringPaymentDateUnit.h: Added. Add members that indicate whether this line item is immediate, recurring, or deferred. Depending on that timing, additional members are added for further configuration (e.g. the start and/or end date of a recurring payment, it's frequency, etc.). * Modules/applepay/ApplePayShippingMethod.idl: * Modules/applepay/ApplePayShippingMethod.h: (WebCore::ApplePayShippingMethod::encode const): (WebCore::ApplePayShippingMethod::decode): * Modules/applepay/ApplePayDateComponentsRange.idl: Added. * Modules/applepay/ApplePayDateComponentsRange.h: Added. (WebCore::ApplePayDateComponentsRange::encode const): (WebCore::ApplePayDateComponentsRange::decode): * Modules/applepay/ApplePayDateComponents.idl: Added. * Modules/applepay/ApplePayDateComponents.h: Added. (WebCore::ApplePayDateComponents::encode const): (WebCore::ApplePayDateComponents::decode): Add members that can be used to indicate the estimated shipping dates for this shipping method. * Modules/applepay/ApplePayRequestBase.idl: * Modules/applepay/ApplePayRequestBase.h: * Modules/applepay/ApplePayRequestBase.cpp: (WebCore::convertAndValidate): * Modules/applepay/ApplePaySessionPaymentRequest.h: (WebCore::ApplePaySessionPaymentRequest::supportsCouponCode const): Added. (WebCore::ApplePaySessionPaymentRequest::setSupportsCouponCode): Added. (WebCore::ApplePaySessionPaymentRequest::couponCode const): Added. (WebCore::ApplePaySessionPaymentRequest::setCouponCode): Added. (WebCore::ApplePaySessionPaymentRequest::shippingContactEditingMode const): Added. (WebCore::ApplePaySessionPaymentRequest::setShippingContactEditingMode): Added. * Modules/applepay/ApplePayShippingContactEditingMode.idl: Added. * Modules/applepay/ApplePayShippingContactEditingMode.h: Added. Add members that indicate: - whether this payment request supports a coupon code at all - the initial coupon code (assuming the above) - whether this payment request allows editing the shipping contact (i.e. in-store pickup does not) * dom/EventNames.h: * dom/EventNames.in: * Modules/applepay/ApplePayCouponCodeChangedEvent.idl: Added. * Modules/applepay/ApplePayCouponCodeChangedEvent.h: Added. * Modules/applepay/ApplePayCouponCodeChangedEvent.cpp: Added. (WebCore::ApplePayCouponCodeChangedEvent::ApplePayCouponCodeChangedEvent): (WebCore::ApplePayCouponCodeChangedEvent::eventInterface const): Add a `"couponcodechange"` event that is dispatched whenever the user modifies the coupon code for an `ApplePaySession`. * Modules/applepay/ApplePayCouponCodeDetails.idl: Copied from Source/WebCore/Modules/applepay/ApplePayPaymentMethodModeDetails.idl. * Modules/applepay/ApplePayCouponCodeDetails.h: Copied from Source/WebCore/Modules/applepay/ApplePayPaymentMethodModeUpdate.idl. Used as the `object methodData` when a `PaymentMethodChangeEvent` is dispatched for a `PaymentRequest`. * Modules/applepay/ApplePaySession.idl: * Modules/applepay/ApplePaySession.h: * Modules/applepay/ApplePaySession.cpp: (WebCore::convertAndValidate): (WebCore::ApplePaySession::completeCouponCodeChange): Added. (WebCore::ApplePaySession::didChangeCouponCode): Renamed from `WebCore::ApplePaySession::didChangePaymentMethodMode`. (WebCore::ApplePaySession::canSuspendWithoutCanceling const): (WebCore::ApplePaySession::canBegin const): (WebCore::ApplePaySession::canAbort const): (WebCore::ApplePaySession::canCancel const): (WebCore::ApplePaySession::canCompleteShippingMethodSelection const): (WebCore::ApplePaySession::canCompleteShippingContactSelection const): (WebCore::ApplePaySession::canCompletePaymentMethodSelection const): (WebCore::ApplePaySession::canCompleteCouponCodeChange const): Renamed from `WebCore::ApplePaySession::canCompletePaymentMethodModeChange const`. (WebCore::ApplePaySession::canCompletePayment const): (WebCore::ApplePaySession::isFinalState const): * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h: * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp: (WebCore::ApplePayPaymentHandler::paymentMethodUpdated): (WebCore::ApplePayPaymentHandler::didChangeCouponCode): Renamed from `WebCore::ApplePayPaymentHandler::didChangePaymentMethodMode`. Add methods for JS to call and state logic to handle coupon code changes. * Modules/applepay/PaymentCoordinator.h: * Modules/applepay/PaymentCoordinator.cpp: (WebCore::PaymentCoordinator::completeCouponCodeChange): Renamed from `WebCore::PaymentCoordinator::completePaymentMethodModeChange`. (WebCore::PaymentCoordinator::didChangeCouponCode): Renamed from `WebCore::PaymentCoordinator::didChangePaymentMethodMode`. * Modules/applepay/PaymentCoordinatorClient.h: * loader/EmptyClients.cpp: (WebCore::EmptyPaymentCoordinatorClient::completeCouponCodeChange): Renamed from `WebCore::EmptyPaymentCoordinatorClient::completePaymentMethodModeChange`. Plumbing up to WebKit. * Modules/applepay/cocoa/PaymentSummaryItemsCocoa.mm: (WebCore::toDate): Added. (WebCore::toCalendarUnit): Added. (WebCore::toPKPaymentSummaryItem): Convert WebCore objects to PassKit objects. * testing/MockPaymentCoordinator.idl: * testing/MockPaymentCoordinator.h: * testing/MockPaymentCoordinator.cpp: (WebCore::MockPaymentCoordinator::showPaymentUI): (WebCore::MockPaymentCoordinator::completeCouponCodeChange): Renamed from `WebCore::MockPaymentCoordinator::completePaymentMethodModeChange`. (WebCore::MockPaymentCoordinator::changeCouponCode): Added. * Modules/applepay/cocoa/PaymentAPIVersionCocoa.mm: (WebCore::PaymentAPIVersion::current): * Modules/applepay/PaymentHeaders.h: * Modules/applepay/PaymentSession.h: * Modules/applepay/ApplePayLineItemData.idl: Removed. * Modules/applepay/ApplePayLineItemData.h: Removed. * Modules/applepay/ApplePayShippingMethodData.idl: Removed. * Modules/applepay/ApplePayShippingMethodData.h: Removed. Remove unnecessary base types after r275169. * PlatformMac.cmake: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: Source/WebCore/PAL: - recurring line items (`HAVE_PASSKIT_RECURRING_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_RECURRING_LINE_ITEM`) - deferred line items (`HAVE_PASSKIT_DEFERRED_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_DEFERRED_LINE_ITEM`) - estimated shipping dates (`HAVE_PASSKIT_SHIPPING_METHOD_DATE_COMPONENTS_RANGE` and `ENABLE_APPLE_PAY_SHIPPING_METHOD_DATE_COMPONENTS_RANGE`) - coupon code entry (`HAVE_PASSKIT_COUPON_CODE` and `ENABLE_APPLE_PAY_COUPON_CODE`) - shipped vs in-store pickup (`HAVE_PASSKIT_SHIPPING_CONTACT_EDITING_MODE` and `ENABLE_APPLE_PAY_SHIPPING_CONTACT_EDITING_MODE`) * pal/cocoa/PassKitSoftLink.h: * pal/cocoa/PassKitSoftLink.mm: * pal/spi/cocoa/PassKitSPI.h: Source/WebKit: - recurring line items (`HAVE_PASSKIT_RECURRING_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_RECURRING_LINE_ITEM`) - deferred line items (`HAVE_PASSKIT_DEFERRED_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_DEFERRED_LINE_ITEM`) - estimated shipping dates (`HAVE_PASSKIT_SHIPPING_METHOD_DATE_COMPONENTS_RANGE` and `ENABLE_APPLE_PAY_SHIPPING_METHOD_DATE_COMPONENTS_RANGE`) - coupon code entry (`HAVE_PASSKIT_COUPON_CODE` and `ENABLE_APPLE_PAY_COUPON_CODE`) - shipped vs in-store pickup (`HAVE_PASSKIT_SHIPPING_CONTACT_EDITING_MODE` and `ENABLE_APPLE_PAY_SHIPPING_CONTACT_EDITING_MODE`) * Platform/cocoa/PaymentAuthorizationViewController.mm: (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didChangeCouponCode:handler:]): Added. * Platform/ios/PaymentAuthorizationController.mm: (-[WKPaymentAuthorizationControllerDelegate paymentAuthorizationController:didChangeCouponCode:handler:]): Added. * Platform/cocoa/PaymentAuthorizationPresenter.h: * Platform/cocoa/PaymentAuthorizationPresenter.mm: (WebKit::toPKPaymentErrorCode): (WebKit::PaymentAuthorizationPresenter::completeCouponCodeChange): Renamed from `WebKit::PaymentAuthorizationPresenter::completePaymentMethodModeChange`. * Platform/cocoa/WKPaymentAuthorizationDelegate.h: * Platform/cocoa/WKPaymentAuthorizationDelegate.mm: (-[WKPaymentAuthorizationDelegate completeCouponCodeChange:]): Added. (toDateComponents): Added. (toDateComponentsRange): Added. (toShippingMethod): (-[WKPaymentAuthorizationDelegate _didChangeCouponCode:completion:]): Added. Add plumbing from/to PassKit for coupon code changes. * Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in: * Shared/ApplePay/WebPaymentCoordinatorProxy.h: * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp: (WebKit::WebPaymentCoordinatorProxy::completeCouponCodeChange): Renamed from `WebKit::WebPaymentCoordinatorProxy::completePaymentMethodModeChange`. (WebKit::WebPaymentCoordinatorProxy::presenterDidChangeCouponCode): Renamed from `WebKit::WebPaymentCoordinatorProxy::presenterDidChangePaymentMethodMode`. (WebKit::WebPaymentCoordinatorProxy::canBegin const): (WebKit::WebPaymentCoordinatorProxy::canCancel const): (WebKit::WebPaymentCoordinatorProxy::canCompletePayment const): (WebKit::WebPaymentCoordinatorProxy::canAbort const): * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toNSDateComponents): Added. (WebKit::toPKDateComponentsRange): Added. (WebKit::toPKShippingMethod): (WebKit::toPKShippingContactEditingMode): Added. (WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest): (WebKit::WebPaymentCoordinatorProxy::platformCompleteCouponCodeChange): Renamed from `WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodModeChange`. Convert PassKit objects to/from WebCore objects. * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder<WebCore::ApplePaySessionPaymentRequest>::encode): (IPC::ArgumentCoder<WebCore::ApplePaySessionPaymentRequest>::decode): * WebProcess/ApplePay/WebPaymentCoordinator.messages.in: * WebProcess/ApplePay/WebPaymentCoordinator.h: * WebProcess/ApplePay/WebPaymentCoordinator.cpp: (WebKit::WebPaymentCoordinator::completeCouponCodeChange): Renamed from `WebKit::WebPaymentCoordinator::completePaymentMethodModeChange`. (WebKit::WebPaymentCoordinator::didChangeCouponCode): Renamed from `WebKit::WebPaymentCoordinator::didChangePaymentMethodMode`. Plumbing into/from WebCore. Source/WebKitLegacy/mac: - recurring line items (`HAVE_PASSKIT_RECURRING_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_RECURRING_LINE_ITEM`) - deferred line items (`HAVE_PASSKIT_DEFERRED_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_DEFERRED_LINE_ITEM`) - estimated shipping dates (`HAVE_PASSKIT_SHIPPING_METHOD_DATE_COMPONENTS_RANGE` and `ENABLE_APPLE_PAY_SHIPPING_METHOD_DATE_COMPONENTS_RANGE`) - coupon code entry (`HAVE_PASSKIT_COUPON_CODE` and `ENABLE_APPLE_PAY_COUPON_CODE`) - shipped vs in-store pickup (`HAVE_PASSKIT_SHIPPING_CONTACT_EDITING_MODE` and `ENABLE_APPLE_PAY_SHIPPING_CONTACT_EDITING_MODE`) * WebCoreSupport/WebPaymentCoordinatorClient.h: * WebCoreSupport/WebPaymentCoordinatorClient.mm: (WebPaymentCoordinatorClient::completeCouponCodeChange): Renamed from `WebPaymentCoordinatorClient::completePaymentMethodModeChange`. Source/WTF: - recurring line items (`HAVE_PASSKIT_RECURRING_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_RECURRING_LINE_ITEM`) - deferred line items (`HAVE_PASSKIT_DEFERRED_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_DEFERRED_LINE_ITEM`) - estimated shipping dates (`HAVE_PASSKIT_SHIPPING_METHOD_DATE_COMPONENTS_RANGE` and `ENABLE_APPLE_PAY_SHIPPING_METHOD_DATE_COMPONENTS_RANGE`) - coupon code entry (`HAVE_PASSKIT_COUPON_CODE` and `ENABLE_APPLE_PAY_COUPON_CODE`) - shipped vs in-store pickup (`HAVE_PASSKIT_SHIPPING_CONTACT_EDITING_MODE` and `ENABLE_APPLE_PAY_SHIPPING_CONTACT_EDITING_MODE`) * wtf/PlatformHave.h: * wtf/PlatformEnableCocoa.h: LayoutTests: * http/tests/paymentrequest/ApplePayModifier-additionalLineItems.https.html: Added. * http/tests/paymentrequest/ApplePayModifier-additionalLineItems.https-expected.txt: Added. * http/tests/paymentrequest/ApplePayModifier-additionalShippingMethods.https.html: Added. * http/tests/paymentrequest/ApplePayModifier-additionalShippingMethods.https-expected.txt: Added. * http/tests/paymentrequest/ApplePayModifier-total.https.html: Added. * http/tests/paymentrequest/ApplePayModifier-total.https-expected.txt: Added. * http/tests/paymentrequest/paymentmethodchange-couponCode.https.html: Added. * http/tests/paymentrequest/paymentmethodchange-couponCode.https-expected.txt: Added. * http/tests/paymentrequest/paymentrequest-couponCode.https.html: Added. * http/tests/paymentrequest/paymentrequest-couponCode.https-expected.txt: Added. * http/tests/paymentrequest/paymentrequest-shippingContactEditingMode.https.html: Added. * http/tests/paymentrequest/paymentrequest-shippingContactEditingMode.https-expected.txt: Added. * http/tests/paymentrequest/paymentrequest-supportsCouponCode.https.html: Added. * http/tests/paymentrequest/paymentrequest-supportsCouponCode.https-expected.txt: Added. * http/tests/ssl/applepay/ApplePayError-expected.txt: * platform/ios-wk2/TestExpectations: * platform/mac-wk2/TestExpectations: Canonical link: https://commits.webkit.org/238613@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278630 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-08 22:15:18 +00:00
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 120000) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 150000)
#define HAVE_PASSKIT_RECURRING_SUMMARY_ITEM 1
#define HAVE_PASSKIT_DEFERRED_SUMMARY_ITEM 1
#define HAVE_PASSKIT_SHIPPING_METHOD_DATE_COMPONENTS_RANGE 1
#define HAVE_PASSKIT_COUPON_CODE 1
#define HAVE_PASSKIT_SHIPPING_CONTACT_EDITING_MODE 1
[Payment Request] `additionalShippingMethods` are not used if a `paymentMethodType` is provided https://bugs.webkit.org/show_bug.cgi?id=228599 <rdar://problem/81190366> Reviewed by Andy Estes. Source/WebCore: r275169 made it so that `paymentMethodType` is no longer `required` so that `additionalShippingMethods` can be specified without having to limit it to a specific payment method type. While this works in theory, WebKit doesn't know about the user's selected payment method type until the user actually selects a payment method, meaning that until then the `additionalShippingMethods` are not used. Unfortunately (until now) `PKPaymentRequestPaymentMethodUpdate` did not support providing a `NSArray<PKShippingMethod *> *`, so there was no way to update the list of shipping methods when the user changed their selected payment method, meaning that WebKit would have to wait/rely on the user to change their shipping address _after_ selecting a payment method in order for `additionalShippingMethods` to take effect. This also fixes an issue with WebKit's implementation of the W3C Payment Request API by allowing any generic (i.e. things not specific to Apple Pay) `shippingOptions` provided in `PaymentDetailsUpdate` to actually be used and update the Apple Pay sheet accordingly. Test: http/tests/paymentrequest/ApplePayModifier-paymentMethodType.https.html * Modules/applepay/ApplePayModifier.idl: * Modules/applepay/ApplePayModifier.h: * Modules/applepay/ApplePayPaymentMethodUpdate.idl: * Modules/applepay/ApplePayPaymentMethodUpdate.h: (WebCore::ApplePayPaymentMethodUpdate::encode const): (WebCore::ApplePayPaymentMethodUpdate::decode): * Modules/applepay/ApplePayShippingMethodUpdate.idl: * Modules/applepay/ApplePayShippingMethodUpdate.h: (WebCore::ApplePayShippingMethodUpdate::encode const): (WebCore::ApplePayShippingMethodUpdate::decode): Add (or wrap existing) `additionalShippingMethods`/`newShippingMethods` properties. * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp: (WebCore::ApplePayPaymentHandler::computeShippingMethods): (WebCore::ApplePayPaymentHandler::detailsUpdated): (WebCore::ApplePayPaymentHandler::shippingOptionUpdated): (WebCore::ApplePayPaymentHandler::paymentMethodUpdated): Also call `computeShippingMethods()` and add the result to the update. * testing/MockPaymentCoordinator.cpp: (WebCore::MockPaymentCoordinator::completeShippingMethodSelection): (WebCore::MockPaymentCoordinator::completeShippingContactSelection): (WebCore::MockPaymentCoordinator::completePaymentMethodSelection): (WebCore::MockPaymentCoordinator::completeCouponCodeChange): Support for testing. Source/WebCore/PAL: r275169 made it so that `paymentMethodType` is no longer `required` so that `additionalShippingMethods` can be specified without having to limit it to a specific payment method type. While this works in theory, WebKit doesn't know about the user's selected payment method type until the user actually selects a payment method, meaning that until then the `additionalShippingMethods` are not used. Unfortunately (until now) `PKPaymentRequestPaymentMethodUpdate` did not support providing a `NSArray<PKShippingMethod *> *`, so there was no way to update the list of shipping methods when the user changed their selected payment method, meaning that WebKit would have to wait/rely on the user to change their shipping address _after_ selecting a payment method in order for `additionalShippingMethods` to take effect. This also fixes an issue with WebKit's implementation of the W3C Payment Request API by allowing any generic (i.e. things not specific to Apple Pay) `shippingOptions` provided in `PaymentDetailsUpdate` to actually be used and update the Apple Pay sheet accordingly. * pal/spi/cocoa/PassKitSPI.h: - add the new `shippingMethods` property on `PKPaymentRequestUpdate` - add the existing `errors` property on `PKPaymentRequestPaymentMethodUpdate` Source/WebKit: r275169 made it so that `paymentMethodType` is no longer `required` so that `additionalShippingMethods` can be specified without having to limit it to a specific payment method type. While this works in theory, WebKit doesn't know about the user's selected payment method type until the user actually selects a payment method, meaning that until then the `additionalShippingMethods` are not used. Unfortunately (until now) `PKPaymentRequestPaymentMethodUpdate` did not support providing a `NSArray<PKShippingMethod *> *`, so there was no way to update the list of shipping methods when the user changed their selected payment method, meaning that WebKit would have to wait/rely on the user to change their shipping address _after_ selecting a payment method in order for `additionalShippingMethods` to take effect. This also fixes an issue with WebKit's implementation of the W3C Payment Request API by allowing any generic (i.e. things not specific to Apple Pay) `shippingOptions` provided in `PaymentDetailsUpdate` to actually be used and update the Apple Pay sheet accordingly. * Platform/cocoa/PaymentAuthorizationPresenter.mm: (WebKit::PaymentAuthorizationPresenter::completePaymentMethodSelection): (WebKit::PaymentAuthorizationPresenter::completeShippingMethodSelection): Also convert and set the `shippingMethods` on the update. Source/WTF: r275169 made it so that `paymentMethodType` is no longer `required` so that `additionalShippingMethods` can be specified without having to limit it to a specific payment method type. While this works in theory, WebKit doesn't know about the user's selected payment method type until the user actually selects a payment method, meaning that until then the `additionalShippingMethods` are not used. Unfortunately (until now) `PKPaymentRequestPaymentMethodUpdate` did not support providing a `NSArray<PKShippingMethod *> *`, so there was no way to update the list of shipping methods when the user changed their selected payment method, meaning that WebKit would have to wait/rely on the user to change their shipping address _after_ selecting a payment method in order for `additionalShippingMethods` to take effect. This also fixes an issue with WebKit's implementation of the W3C Payment Request API by allowing any generic (i.e. things not specific to Apple Pay) `shippingOptions` provided in `PaymentDetailsUpdate` to actually be used and update the Apple Pay sheet accordingly. * wtf/PlatformHave.h: * wtf/PlatformEnableCocoa.h: Add new compile flags for PassKit supporting modifying shipping methods with any update. LayoutTests: * http/tests/paymentrequest/ApplePayModifier-paymentMethodType.https.html: Added. * http/tests/paymentrequest/ApplePayModifier-paymentMethodType.https-expected.txt: Added. * platform/ios-14-wk2/TestExpectations: * platform/mac-bigsur-wk2/TestExpectations: Added. Skip on older macOS/iOS since they don't support modifying shipping methods with any update. Canonical link: https://commits.webkit.org/240094@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280459 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-30 00:28:45 +00:00
#define HAVE_PASSKIT_UPDATE_SHIPPING_METHODS_WHEN_CHANGING_SUMMARY_ITEMS 1
[Payment Request] upstream new features https://bugs.webkit.org/show_bug.cgi?id=226740 <rdar://problem/78963132> Reviewed by Andy Estes. Source/WebCore: - recurring line items (`HAVE_PASSKIT_RECURRING_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_RECURRING_LINE_ITEM`) - deferred line items (`HAVE_PASSKIT_DEFERRED_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_DEFERRED_LINE_ITEM`) - estimated shipping dates (`HAVE_PASSKIT_SHIPPING_METHOD_DATE_COMPONENTS_RANGE` and `ENABLE_APPLE_PAY_SHIPPING_METHOD_DATE_COMPONENTS_RANGE`) - coupon code entry (`HAVE_PASSKIT_COUPON_CODE` and `ENABLE_APPLE_PAY_COUPON_CODE`) - shipped vs in-store pickup (`HAVE_PASSKIT_SHIPPING_CONTACT_EDITING_MODE` and `ENABLE_APPLE_PAY_SHIPPING_CONTACT_EDITING_MODE`) Tests: http/tests/paymentrequest/ApplePayModifier-additionalLineItems.https.html http/tests/paymentrequest/ApplePayModifier-additionalShippingMethods.https.html http/tests/paymentrequest/ApplePayModifier-total.https.html http/tests/paymentrequest/paymentmethodchange-couponCode.https.html http/tests/paymentrequest/paymentrequest-couponCode.https.html http/tests/paymentrequest/paymentrequest-shippingContactEditingMode.https.html http/tests/paymentrequest/paymentrequest-supportsCouponCode.https.html * Modules/applepay/ApplePayCouponCodeUpdate.idl: Copied from Source/WebCore/Modules/applepay/ApplePayPaymentMethodModeUpdate.idl. * Modules/applepay/ApplePayCouponCodeUpdate.h: Renamed from Source/WebCore/Modules/applepay/ApplePayPaymentMethodModeUpdate.h. (WebCore::ApplePayCouponCodeUpdate::encode const): (WebCore::ApplePayCouponCodeUpdate::decode): Object used to update the payment request via `ApplePaySession.prototype.completeCouponCodeChange` when responding to the user modifying the coupon code. * Modules/applepay/ApplePayErrorCode.idl: * Modules/applepay/ApplePayErrorCode.h: Add `"couponCodeInvalid"` and `"couponCodeExpired"`. * Modules/applepay/ApplePayLineItem.idl: * Modules/applepay/ApplePayLineItem.h: (WebCore::ApplePayLineItem::encode const): (WebCore::ApplePayLineItem::decode): * Modules/applepay/ApplePayPaymentTiming.idl: Added. * Modules/applepay/ApplePayPaymentTiming.h: Added. * Modules/applepay/ApplePayRecurringPaymentDateUnit.idl: Added. * Modules/applepay/ApplePayRecurringPaymentDateUnit.h: Added. Add members that indicate whether this line item is immediate, recurring, or deferred. Depending on that timing, additional members are added for further configuration (e.g. the start and/or end date of a recurring payment, it's frequency, etc.). * Modules/applepay/ApplePayShippingMethod.idl: * Modules/applepay/ApplePayShippingMethod.h: (WebCore::ApplePayShippingMethod::encode const): (WebCore::ApplePayShippingMethod::decode): * Modules/applepay/ApplePayDateComponentsRange.idl: Added. * Modules/applepay/ApplePayDateComponentsRange.h: Added. (WebCore::ApplePayDateComponentsRange::encode const): (WebCore::ApplePayDateComponentsRange::decode): * Modules/applepay/ApplePayDateComponents.idl: Added. * Modules/applepay/ApplePayDateComponents.h: Added. (WebCore::ApplePayDateComponents::encode const): (WebCore::ApplePayDateComponents::decode): Add members that can be used to indicate the estimated shipping dates for this shipping method. * Modules/applepay/ApplePayRequestBase.idl: * Modules/applepay/ApplePayRequestBase.h: * Modules/applepay/ApplePayRequestBase.cpp: (WebCore::convertAndValidate): * Modules/applepay/ApplePaySessionPaymentRequest.h: (WebCore::ApplePaySessionPaymentRequest::supportsCouponCode const): Added. (WebCore::ApplePaySessionPaymentRequest::setSupportsCouponCode): Added. (WebCore::ApplePaySessionPaymentRequest::couponCode const): Added. (WebCore::ApplePaySessionPaymentRequest::setCouponCode): Added. (WebCore::ApplePaySessionPaymentRequest::shippingContactEditingMode const): Added. (WebCore::ApplePaySessionPaymentRequest::setShippingContactEditingMode): Added. * Modules/applepay/ApplePayShippingContactEditingMode.idl: Added. * Modules/applepay/ApplePayShippingContactEditingMode.h: Added. Add members that indicate: - whether this payment request supports a coupon code at all - the initial coupon code (assuming the above) - whether this payment request allows editing the shipping contact (i.e. in-store pickup does not) * dom/EventNames.h: * dom/EventNames.in: * Modules/applepay/ApplePayCouponCodeChangedEvent.idl: Added. * Modules/applepay/ApplePayCouponCodeChangedEvent.h: Added. * Modules/applepay/ApplePayCouponCodeChangedEvent.cpp: Added. (WebCore::ApplePayCouponCodeChangedEvent::ApplePayCouponCodeChangedEvent): (WebCore::ApplePayCouponCodeChangedEvent::eventInterface const): Add a `"couponcodechange"` event that is dispatched whenever the user modifies the coupon code for an `ApplePaySession`. * Modules/applepay/ApplePayCouponCodeDetails.idl: Copied from Source/WebCore/Modules/applepay/ApplePayPaymentMethodModeDetails.idl. * Modules/applepay/ApplePayCouponCodeDetails.h: Copied from Source/WebCore/Modules/applepay/ApplePayPaymentMethodModeUpdate.idl. Used as the `object methodData` when a `PaymentMethodChangeEvent` is dispatched for a `PaymentRequest`. * Modules/applepay/ApplePaySession.idl: * Modules/applepay/ApplePaySession.h: * Modules/applepay/ApplePaySession.cpp: (WebCore::convertAndValidate): (WebCore::ApplePaySession::completeCouponCodeChange): Added. (WebCore::ApplePaySession::didChangeCouponCode): Renamed from `WebCore::ApplePaySession::didChangePaymentMethodMode`. (WebCore::ApplePaySession::canSuspendWithoutCanceling const): (WebCore::ApplePaySession::canBegin const): (WebCore::ApplePaySession::canAbort const): (WebCore::ApplePaySession::canCancel const): (WebCore::ApplePaySession::canCompleteShippingMethodSelection const): (WebCore::ApplePaySession::canCompleteShippingContactSelection const): (WebCore::ApplePaySession::canCompletePaymentMethodSelection const): (WebCore::ApplePaySession::canCompleteCouponCodeChange const): Renamed from `WebCore::ApplePaySession::canCompletePaymentMethodModeChange const`. (WebCore::ApplePaySession::canCompletePayment const): (WebCore::ApplePaySession::isFinalState const): * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h: * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp: (WebCore::ApplePayPaymentHandler::paymentMethodUpdated): (WebCore::ApplePayPaymentHandler::didChangeCouponCode): Renamed from `WebCore::ApplePayPaymentHandler::didChangePaymentMethodMode`. Add methods for JS to call and state logic to handle coupon code changes. * Modules/applepay/PaymentCoordinator.h: * Modules/applepay/PaymentCoordinator.cpp: (WebCore::PaymentCoordinator::completeCouponCodeChange): Renamed from `WebCore::PaymentCoordinator::completePaymentMethodModeChange`. (WebCore::PaymentCoordinator::didChangeCouponCode): Renamed from `WebCore::PaymentCoordinator::didChangePaymentMethodMode`. * Modules/applepay/PaymentCoordinatorClient.h: * loader/EmptyClients.cpp: (WebCore::EmptyPaymentCoordinatorClient::completeCouponCodeChange): Renamed from `WebCore::EmptyPaymentCoordinatorClient::completePaymentMethodModeChange`. Plumbing up to WebKit. * Modules/applepay/cocoa/PaymentSummaryItemsCocoa.mm: (WebCore::toDate): Added. (WebCore::toCalendarUnit): Added. (WebCore::toPKPaymentSummaryItem): Convert WebCore objects to PassKit objects. * testing/MockPaymentCoordinator.idl: * testing/MockPaymentCoordinator.h: * testing/MockPaymentCoordinator.cpp: (WebCore::MockPaymentCoordinator::showPaymentUI): (WebCore::MockPaymentCoordinator::completeCouponCodeChange): Renamed from `WebCore::MockPaymentCoordinator::completePaymentMethodModeChange`. (WebCore::MockPaymentCoordinator::changeCouponCode): Added. * Modules/applepay/cocoa/PaymentAPIVersionCocoa.mm: (WebCore::PaymentAPIVersion::current): * Modules/applepay/PaymentHeaders.h: * Modules/applepay/PaymentSession.h: * Modules/applepay/ApplePayLineItemData.idl: Removed. * Modules/applepay/ApplePayLineItemData.h: Removed. * Modules/applepay/ApplePayShippingMethodData.idl: Removed. * Modules/applepay/ApplePayShippingMethodData.h: Removed. Remove unnecessary base types after r275169. * PlatformMac.cmake: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: Source/WebCore/PAL: - recurring line items (`HAVE_PASSKIT_RECURRING_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_RECURRING_LINE_ITEM`) - deferred line items (`HAVE_PASSKIT_DEFERRED_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_DEFERRED_LINE_ITEM`) - estimated shipping dates (`HAVE_PASSKIT_SHIPPING_METHOD_DATE_COMPONENTS_RANGE` and `ENABLE_APPLE_PAY_SHIPPING_METHOD_DATE_COMPONENTS_RANGE`) - coupon code entry (`HAVE_PASSKIT_COUPON_CODE` and `ENABLE_APPLE_PAY_COUPON_CODE`) - shipped vs in-store pickup (`HAVE_PASSKIT_SHIPPING_CONTACT_EDITING_MODE` and `ENABLE_APPLE_PAY_SHIPPING_CONTACT_EDITING_MODE`) * pal/cocoa/PassKitSoftLink.h: * pal/cocoa/PassKitSoftLink.mm: * pal/spi/cocoa/PassKitSPI.h: Source/WebKit: - recurring line items (`HAVE_PASSKIT_RECURRING_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_RECURRING_LINE_ITEM`) - deferred line items (`HAVE_PASSKIT_DEFERRED_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_DEFERRED_LINE_ITEM`) - estimated shipping dates (`HAVE_PASSKIT_SHIPPING_METHOD_DATE_COMPONENTS_RANGE` and `ENABLE_APPLE_PAY_SHIPPING_METHOD_DATE_COMPONENTS_RANGE`) - coupon code entry (`HAVE_PASSKIT_COUPON_CODE` and `ENABLE_APPLE_PAY_COUPON_CODE`) - shipped vs in-store pickup (`HAVE_PASSKIT_SHIPPING_CONTACT_EDITING_MODE` and `ENABLE_APPLE_PAY_SHIPPING_CONTACT_EDITING_MODE`) * Platform/cocoa/PaymentAuthorizationViewController.mm: (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didChangeCouponCode:handler:]): Added. * Platform/ios/PaymentAuthorizationController.mm: (-[WKPaymentAuthorizationControllerDelegate paymentAuthorizationController:didChangeCouponCode:handler:]): Added. * Platform/cocoa/PaymentAuthorizationPresenter.h: * Platform/cocoa/PaymentAuthorizationPresenter.mm: (WebKit::toPKPaymentErrorCode): (WebKit::PaymentAuthorizationPresenter::completeCouponCodeChange): Renamed from `WebKit::PaymentAuthorizationPresenter::completePaymentMethodModeChange`. * Platform/cocoa/WKPaymentAuthorizationDelegate.h: * Platform/cocoa/WKPaymentAuthorizationDelegate.mm: (-[WKPaymentAuthorizationDelegate completeCouponCodeChange:]): Added. (toDateComponents): Added. (toDateComponentsRange): Added. (toShippingMethod): (-[WKPaymentAuthorizationDelegate _didChangeCouponCode:completion:]): Added. Add plumbing from/to PassKit for coupon code changes. * Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in: * Shared/ApplePay/WebPaymentCoordinatorProxy.h: * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp: (WebKit::WebPaymentCoordinatorProxy::completeCouponCodeChange): Renamed from `WebKit::WebPaymentCoordinatorProxy::completePaymentMethodModeChange`. (WebKit::WebPaymentCoordinatorProxy::presenterDidChangeCouponCode): Renamed from `WebKit::WebPaymentCoordinatorProxy::presenterDidChangePaymentMethodMode`. (WebKit::WebPaymentCoordinatorProxy::canBegin const): (WebKit::WebPaymentCoordinatorProxy::canCancel const): (WebKit::WebPaymentCoordinatorProxy::canCompletePayment const): (WebKit::WebPaymentCoordinatorProxy::canAbort const): * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toNSDateComponents): Added. (WebKit::toPKDateComponentsRange): Added. (WebKit::toPKShippingMethod): (WebKit::toPKShippingContactEditingMode): Added. (WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest): (WebKit::WebPaymentCoordinatorProxy::platformCompleteCouponCodeChange): Renamed from `WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodModeChange`. Convert PassKit objects to/from WebCore objects. * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder<WebCore::ApplePaySessionPaymentRequest>::encode): (IPC::ArgumentCoder<WebCore::ApplePaySessionPaymentRequest>::decode): * WebProcess/ApplePay/WebPaymentCoordinator.messages.in: * WebProcess/ApplePay/WebPaymentCoordinator.h: * WebProcess/ApplePay/WebPaymentCoordinator.cpp: (WebKit::WebPaymentCoordinator::completeCouponCodeChange): Renamed from `WebKit::WebPaymentCoordinator::completePaymentMethodModeChange`. (WebKit::WebPaymentCoordinator::didChangeCouponCode): Renamed from `WebKit::WebPaymentCoordinator::didChangePaymentMethodMode`. Plumbing into/from WebCore. Source/WebKitLegacy/mac: - recurring line items (`HAVE_PASSKIT_RECURRING_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_RECURRING_LINE_ITEM`) - deferred line items (`HAVE_PASSKIT_DEFERRED_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_DEFERRED_LINE_ITEM`) - estimated shipping dates (`HAVE_PASSKIT_SHIPPING_METHOD_DATE_COMPONENTS_RANGE` and `ENABLE_APPLE_PAY_SHIPPING_METHOD_DATE_COMPONENTS_RANGE`) - coupon code entry (`HAVE_PASSKIT_COUPON_CODE` and `ENABLE_APPLE_PAY_COUPON_CODE`) - shipped vs in-store pickup (`HAVE_PASSKIT_SHIPPING_CONTACT_EDITING_MODE` and `ENABLE_APPLE_PAY_SHIPPING_CONTACT_EDITING_MODE`) * WebCoreSupport/WebPaymentCoordinatorClient.h: * WebCoreSupport/WebPaymentCoordinatorClient.mm: (WebPaymentCoordinatorClient::completeCouponCodeChange): Renamed from `WebPaymentCoordinatorClient::completePaymentMethodModeChange`. Source/WTF: - recurring line items (`HAVE_PASSKIT_RECURRING_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_RECURRING_LINE_ITEM`) - deferred line items (`HAVE_PASSKIT_DEFERRED_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_DEFERRED_LINE_ITEM`) - estimated shipping dates (`HAVE_PASSKIT_SHIPPING_METHOD_DATE_COMPONENTS_RANGE` and `ENABLE_APPLE_PAY_SHIPPING_METHOD_DATE_COMPONENTS_RANGE`) - coupon code entry (`HAVE_PASSKIT_COUPON_CODE` and `ENABLE_APPLE_PAY_COUPON_CODE`) - shipped vs in-store pickup (`HAVE_PASSKIT_SHIPPING_CONTACT_EDITING_MODE` and `ENABLE_APPLE_PAY_SHIPPING_CONTACT_EDITING_MODE`) * wtf/PlatformHave.h: * wtf/PlatformEnableCocoa.h: LayoutTests: * http/tests/paymentrequest/ApplePayModifier-additionalLineItems.https.html: Added. * http/tests/paymentrequest/ApplePayModifier-additionalLineItems.https-expected.txt: Added. * http/tests/paymentrequest/ApplePayModifier-additionalShippingMethods.https.html: Added. * http/tests/paymentrequest/ApplePayModifier-additionalShippingMethods.https-expected.txt: Added. * http/tests/paymentrequest/ApplePayModifier-total.https.html: Added. * http/tests/paymentrequest/ApplePayModifier-total.https-expected.txt: Added. * http/tests/paymentrequest/paymentmethodchange-couponCode.https.html: Added. * http/tests/paymentrequest/paymentmethodchange-couponCode.https-expected.txt: Added. * http/tests/paymentrequest/paymentrequest-couponCode.https.html: Added. * http/tests/paymentrequest/paymentrequest-couponCode.https-expected.txt: Added. * http/tests/paymentrequest/paymentrequest-shippingContactEditingMode.https.html: Added. * http/tests/paymentrequest/paymentrequest-shippingContactEditingMode.https-expected.txt: Added. * http/tests/paymentrequest/paymentrequest-supportsCouponCode.https.html: Added. * http/tests/paymentrequest/paymentrequest-supportsCouponCode.https-expected.txt: Added. * http/tests/ssl/applepay/ApplePayError-expected.txt: * platform/ios-wk2/TestExpectations: * platform/mac-wk2/TestExpectations: Canonical link: https://commits.webkit.org/238613@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278630 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-08 22:15:18 +00:00
#endif
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || PLATFORM(IOS) || PLATFORM(MACCATALYST)
WK2 Quicklook for attachments https://bugs.webkit.org/show_bug.cgi?id=208891 Reviewed by Darin Adler. Source/WebCore: Added to HTMLAttachmentElement to have member image representing QuickLook thumbnail. Added code to render this image on both iOS and Mac. No new tests. Test will be added after additions to test infrastructure. * html/HTMLAttachmentElement.cpp: (WebCore::HTMLAttachmentElement::updateThumbnailRepresentation): Allow setting of thumbnail member. * html/HTMLAttachmentElement.h: * rendering/RenderThemeIOS.mm: Added rendering of image member of attachment element. (WebCore::RenderAttachmentInfo::RenderAttachmentInfo): (WebCore::paintAttachmentIcon): (WebCore::RenderThemeIOS::paintAttachment): * rendering/RenderThemeMac.mm: (WebCore::paintAttachmentIcon): Source/WebKit: Allow attachment elements to render QuickLook thumbnail generated from contents of the file as its icon, rather than the default icons associated with each mime type. * Configurations/WebKit.xcconfig: Link QuickLook thumbnailing framework. * UIProcess/API/APIAttachment.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _insertAttachmentWithFileWrapper:contentType:completion:]): * UIProcess/Cocoa/WebPageProxyCocoa.mm: Create thumbnail request and add to queue. (WebKit::convertNSImageToBitmap): (WebKit::convertUIImageToBitmap): (WebKit::WebPageProxy::getQLThumbnailForGenerationRequestion): (WebKit::WebPageProxy::getQLThumbnailForFileWrapper): (WebKit::WebPageProxy::getQLThumbnailForAttachment): * UIProcess/QLThumbnailLoad.h: Added. * UIProcess/QLThumbnailLoad.mm: Added. Add code to request thumbnail for file data. (-[WKQLThumbnailQueueManager init]): (+[WKQLThumbnailQueueManager sharedInstance]): (-[WKQLThumbnailLoadOperation initWithAttachment:identifier:]): (-[WKQLThumbnailLoadOperation initWithURL:identifier:]): (-[WKQLThumbnailLoadOperation start]): (-[WKQLThumbnailLoadOperation isAsynchronous]): (-[WKQLThumbnailLoadOperation isExecuting]): (-[WKQLThumbnailLoadOperation setExecuting:]): (-[WKQLThumbnailLoadOperation isFinished]): (-[WKQLThumbnailLoadOperation setFinished:]): * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updateAttachmentIcon): Set thumbnail of attachment element * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: Thumbnail request message. Canonical link: https://commits.webkit.org/223659@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@260407 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-04-21 00:27:46 +00:00
#define HAVE_QUICKLOOK_THUMBNAILING 1
#endif
Remove all references to non-existent 10.16 https://bugs.webkit.org/show_bug.cgi?id=215202 Reviewed by Wenson Hsieh. Source/bmalloc: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: Source/JavaScriptCore: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/ThirdParty: * gtest/xcode/Config/DebugProject.xcconfig: * gtest/xcode/Config/ReleaseProject.xcconfig: Source/ThirdParty/ANGLE: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/ThirdParty/libwebrtc: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: * Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.h: Source/WebCore: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebCore/PAL: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebInspectorUI: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebKit: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: * Scripts/process-entitlements.sh: * WebProcess/com.apple.WebProcess.sb.in: Source/WebKitLegacy/mac: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WTF: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * wtf/PlatformEnableCocoa.h: * wtf/PlatformHave.h: * wtf/PlatformUse.h: Tools: * ContentExtensionTester/Configurations/Base.xcconfig: * ContentExtensionTester/Configurations/DebugRelease.xcconfig: * DumpRenderTree/mac/Configurations/Base.xcconfig: * DumpRenderTree/mac/Configurations/DebugRelease.xcconfig: * ImageDiff/cg/Configurations/Base.xcconfig: * ImageDiff/cg/Configurations/DebugRelease.xcconfig: * MiniBrowser/Configurations/Base.xcconfig: * MiniBrowser/Configurations/DebugRelease.xcconfig: * TestWebKitAPI/Configurations/Base.xcconfig: * TestWebKitAPI/Configurations/DebugRelease.xcconfig: * TestWebKitAPI/Configurations/WebKitTargetConditionals.xcconfig: * TestWebKitAPI/config.h: * WebEditingTester/Configurations/Base.xcconfig: * WebEditingTester/Configurations/DebugRelease.xcconfig: * WebKitTestRunner/Configurations/Base.xcconfig: * WebKitTestRunner/Configurations/DebugRelease.xcconfig: * lldb/lldbWebKitTester/Configurations/Base.xcconfig: * lldb/lldbWebKitTester/Configurations/DebugRelease.xcconfig: Canonical link: https://commits.webkit.org/227995@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@265315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-08-06 00:58:34 +00:00
#if PLATFORM(IOS) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000)
#define HAVE_DISPLAY_LAYER_BIPLANAR_SUPPORT 1
#endif
REGRESSION (r261812): editing/async-clipboard/clipboard-item-get-type-basic.html is flaky https://bugs.webkit.org/show_bug.cgi?id=212281 <rdar://problem/63554912> Reviewed by Tim Horton. Source/WebKit: Declare `-delegateSupportsImagePaste` on UIKeyboardImpl. * Platform/spi/ios/UIKitSPI.h: Source/WTF: Add a new `HAVE()` define. * wtf/PlatformHave.h: Tools: On some shipping versions of iOS, returning `NO` from `-supportsImagePaste` still results in UIKit keyboard code pinning temporary items to the general pasteboard, which increments the change count of the pasteboard. If this happens in the middle of an attempt to read from the pasteboard, we end up falsely denying access to the contents of the pasteboard, since we believe that the contents of the pasteboard have changed. This has the potential to affect any test that attempts to read from the pasteboard on iOS, though the titular layout test seems to trigger the bug more frequently than other tests. This item pinning was added in support of being able to insert Memojis from the software keyboard, and works by pretending to copy a temporary PNG image, asking the delegate whether it `-canPerformAction:withSender:`, and then restoring the items previously on the pasteboard. To work around this in the test runner, we can simply swizzle out `-[UIKeyboardImpl delegateSupportsImagePaste]` to always return `NO`, which has the same effect as disabling the Memoji keyboard. * WebKitTestRunner/TestController.h: * WebKitTestRunner/ios/TestControllerIOS.mm: (overrideKeyboardDelegateSupportsImagePaste): (WTR::TestController::platformResetStateToConsistentValues): LayoutTests: Remove the failing test expectation. * platform/ios-simulator-wk2/TestExpectations: Canonical link: https://commits.webkit.org/225335@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262283 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-05-29 07:27:03 +00:00
#if PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000
#define HAVE_NONDESTRUCTIVE_IMAGE_PASTE_SUPPORT_QUERY 1
#endif
Remove all references to non-existent 10.16 https://bugs.webkit.org/show_bug.cgi?id=215202 Reviewed by Wenson Hsieh. Source/bmalloc: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: Source/JavaScriptCore: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/ThirdParty: * gtest/xcode/Config/DebugProject.xcconfig: * gtest/xcode/Config/ReleaseProject.xcconfig: Source/ThirdParty/ANGLE: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/ThirdParty/libwebrtc: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: * Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.h: Source/WebCore: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebCore/PAL: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebInspectorUI: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebKit: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: * Scripts/process-entitlements.sh: * WebProcess/com.apple.WebProcess.sb.in: Source/WebKitLegacy/mac: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WTF: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * wtf/PlatformEnableCocoa.h: * wtf/PlatformHave.h: * wtf/PlatformUse.h: Tools: * ContentExtensionTester/Configurations/Base.xcconfig: * ContentExtensionTester/Configurations/DebugRelease.xcconfig: * DumpRenderTree/mac/Configurations/Base.xcconfig: * DumpRenderTree/mac/Configurations/DebugRelease.xcconfig: * ImageDiff/cg/Configurations/Base.xcconfig: * ImageDiff/cg/Configurations/DebugRelease.xcconfig: * MiniBrowser/Configurations/Base.xcconfig: * MiniBrowser/Configurations/DebugRelease.xcconfig: * TestWebKitAPI/Configurations/Base.xcconfig: * TestWebKitAPI/Configurations/DebugRelease.xcconfig: * TestWebKitAPI/Configurations/WebKitTargetConditionals.xcconfig: * TestWebKitAPI/config.h: * WebEditingTester/Configurations/Base.xcconfig: * WebEditingTester/Configurations/DebugRelease.xcconfig: * WebKitTestRunner/Configurations/Base.xcconfig: * WebKitTestRunner/Configurations/DebugRelease.xcconfig: * lldb/lldbWebKitTester/Configurations/Base.xcconfig: * lldb/lldbWebKitTester/Configurations/DebugRelease.xcconfig: Canonical link: https://commits.webkit.org/227995@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@265315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-08-06 00:58:34 +00:00
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000)
#define HAVE_LOGGING_PRIVACY_LEVEL 1
#endif
#if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST)
#define HAVE_FRONTBOARD_SYSTEM_APP_SERVICES 1
#endif
Remove all references to non-existent 10.16 https://bugs.webkit.org/show_bug.cgi?id=215202 Reviewed by Wenson Hsieh. Source/bmalloc: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: Source/JavaScriptCore: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/ThirdParty: * gtest/xcode/Config/DebugProject.xcconfig: * gtest/xcode/Config/ReleaseProject.xcconfig: Source/ThirdParty/ANGLE: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/ThirdParty/libwebrtc: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: * Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.h: Source/WebCore: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebCore/PAL: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebInspectorUI: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebKit: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: * Scripts/process-entitlements.sh: * WebProcess/com.apple.WebProcess.sb.in: Source/WebKitLegacy/mac: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WTF: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * wtf/PlatformEnableCocoa.h: * wtf/PlatformHave.h: * wtf/PlatformUse.h: Tools: * ContentExtensionTester/Configurations/Base.xcconfig: * ContentExtensionTester/Configurations/DebugRelease.xcconfig: * DumpRenderTree/mac/Configurations/Base.xcconfig: * DumpRenderTree/mac/Configurations/DebugRelease.xcconfig: * ImageDiff/cg/Configurations/Base.xcconfig: * ImageDiff/cg/Configurations/DebugRelease.xcconfig: * MiniBrowser/Configurations/Base.xcconfig: * MiniBrowser/Configurations/DebugRelease.xcconfig: * TestWebKitAPI/Configurations/Base.xcconfig: * TestWebKitAPI/Configurations/DebugRelease.xcconfig: * TestWebKitAPI/Configurations/WebKitTargetConditionals.xcconfig: * TestWebKitAPI/config.h: * WebEditingTester/Configurations/Base.xcconfig: * WebEditingTester/Configurations/DebugRelease.xcconfig: * WebKitTestRunner/Configurations/Base.xcconfig: * WebKitTestRunner/Configurations/DebugRelease.xcconfig: * lldb/lldbWebKitTester/Configurations/Base.xcconfig: * lldb/lldbWebKitTester/Configurations/DebugRelease.xcconfig: Canonical link: https://commits.webkit.org/227995@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@265315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-08-06 00:58:34 +00:00
#if OS(DARWIN) && CPU(X86_64) && ((PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000) || (PLATFORM(MACCATALYST) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000))
#define HAVE_CPU_TRANSLATION_CAPABILITY 1
#endif
Allow building JavaScriptCore Mac+arm64 in public SDK build https://bugs.webkit.org/show_bug.cgi?id=213472 Reviewed by Sam Weinig. .: * Source/cmake/OptionsFTW.cmake: * Source/cmake/WebKitFeatures.cmake: Source/JavaScriptCore: We used to only builld code for fast permission switching when using the Apple internal SDK. However, with arm64 on macOS, this is no longer a viable implementation strategy. This patch makes it so we can build JSC on macOS+arm64 using the public Xcode SDK. - ENABLE_FAST_JIT_PERMISSIONS is removed. We now use runtime checks instead. - In the new suite of OS betas, pthreads has added API for fast permissions switching. We now use this API instead of using the non-public SDK found in the kernel headers. - We fall back to the separated W/X heaps when fast permissions checking is not supported. This all happens at runtime. * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/ARM64Assembler.h: (JSC::ARM64Assembler::fillNops): * assembler/ARMv7Assembler.h: (JSC::ARMv7Assembler::fillNops): * assembler/FastJITPermissions.h: Added. (useFastJITPermissions): (threadSelfRestrictRWXToRW): (threadSelfRestrictRWXToRX): (fastJITPermissionsIsSupported): * assembler/LinkBuffer.cpp: (JSC::memcpyWrapper): (JSC::LinkBuffer::copyCompactAndLinkCode): * assembler/MIPSAssembler.h: (JSC::MIPSAssembler::fillNops): * assembler/MacroAssemblerARM64.h: (JSC::MacroAssemblerARM64::link): * assembler/MacroAssemblerARMv7.h: (JSC::MacroAssemblerARMv7::link): * jit/ExecutableAllocator.cpp: (JSC::initializeJITPageReservation): * jit/ExecutableAllocator.h: (JSC::performJITMemcpy): (JSC::useFastJITPermissions): Deleted. * runtime/JSCConfig.h: * runtime/Options.cpp: (JSC::Options::recomputeDependentOptions): * runtime/OptionsList.h: Source/WTF: * wtf/PlatformEnable.h: * wtf/PlatformEnableCocoa.h: * wtf/PlatformHave.h: Canonical link: https://commits.webkit.org/226286@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263380 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-23 01:28:17 +00:00
Remove all references to non-existent 10.16 https://bugs.webkit.org/show_bug.cgi?id=215202 Reviewed by Wenson Hsieh. Source/bmalloc: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: Source/JavaScriptCore: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/ThirdParty: * gtest/xcode/Config/DebugProject.xcconfig: * gtest/xcode/Config/ReleaseProject.xcconfig: Source/ThirdParty/ANGLE: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/ThirdParty/libwebrtc: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: * Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.h: Source/WebCore: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebCore/PAL: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebInspectorUI: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebKit: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: * Scripts/process-entitlements.sh: * WebProcess/com.apple.WebProcess.sb.in: Source/WebKitLegacy/mac: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WTF: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * wtf/PlatformEnableCocoa.h: * wtf/PlatformHave.h: * wtf/PlatformUse.h: Tools: * ContentExtensionTester/Configurations/Base.xcconfig: * ContentExtensionTester/Configurations/DebugRelease.xcconfig: * DumpRenderTree/mac/Configurations/Base.xcconfig: * DumpRenderTree/mac/Configurations/DebugRelease.xcconfig: * ImageDiff/cg/Configurations/Base.xcconfig: * ImageDiff/cg/Configurations/DebugRelease.xcconfig: * MiniBrowser/Configurations/Base.xcconfig: * MiniBrowser/Configurations/DebugRelease.xcconfig: * TestWebKitAPI/Configurations/Base.xcconfig: * TestWebKitAPI/Configurations/DebugRelease.xcconfig: * TestWebKitAPI/Configurations/WebKitTargetConditionals.xcconfig: * TestWebKitAPI/config.h: * WebEditingTester/Configurations/Base.xcconfig: * WebEditingTester/Configurations/DebugRelease.xcconfig: * WebKitTestRunner/Configurations/Base.xcconfig: * WebKitTestRunner/Configurations/DebugRelease.xcconfig: * lldb/lldbWebKitTester/Configurations/Base.xcconfig: * lldb/lldbWebKitTester/Configurations/DebugRelease.xcconfig: Canonical link: https://commits.webkit.org/227995@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@265315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-08-06 00:58:34 +00:00
#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000
#define HAVE_APP_ACCENT_COLORS 1
#endif
[Cocoa] Update Launch Services database in the WebContent process from the Network process https://bugs.webkit.org/show_bug.cgi?id=213794 Reviewed by Brent Fulgham. Source/WebCore/PAL: Declare interface for observing and consuming the Launch Services database. * pal/spi/cocoa/LaunchServicesSPI.h: Source/WebKit: To be able to deny mach lookup access to the Launch Services database mapping service in the WebContent process, the database needs to be sent from the Networking process to the WebContent process, represented by an xpc object. The Networking process is chosen instead of the UI process, since WebKit is controlling the sandbox of the Networking process. There is already a direct connection between the Networking process and the WebContent process, but this is a CoreIPC connection. Since the database is represented by an xpc object, an xpc connection is requiered to transfer the database. This patch creates a direct xpc connection between the Networking process and the WebContent process, by creating an xpc endpoint in the Networking process, sending this to the UI process over the bootstrap xpc connection, and then providing each WebContent process with this endpoint by sending it over the bootstrap xpc connection between the UI process and the WebContent process. This endpoint has to be sent via the xpc connections to the UI process, since the already existing direct connection between the Networking process and the WebContent process is a lower level CoreIPC connection, which does not support transferring xpc objects like the xpc endpoint. When the WebContent process receives the endpoint, it will create an xpc connection from the endpoint, which will create a direct connection with the Networking process. A message is then sent over the connection to request the database xpc object. When the Networking process receives this message, it checks the entitlement of the remote end to make sure it is communicating with a WebContent process, and then sends the database if the entitlement check succeeds. When the WebContent process receives this message, it performs an entitlement check as well, and if successful, the database object is consumed. Consuming this database object, will make sure UTI to MIME type mapping is working correctly in the WebContent process. For the UI process to be able to pick up xpc messages on the bootstrap connection, a new virtual method, handleXPCEvent, is added to the ProcessLauncher Client class. This way, a ProcessLauncher client will be able to pick up xpc messages from the xpc bootstrap connection. Previously the event handler for the bootstrap connection in the UI process would handle only xpc error messages. It has now been expanded to handle normal messages, which are being forwarded to the ProcessLauncher client. In this case the client is the Network process proxy, which will check the message received, and if it turns out to be a message containing an xpc endpoint, the message will be forwarded to all Web processes. The ProcessLauncher client can be expanded to handle any xpc message, but right not the Network process proxy only handles the xpc endpoint message. The handleXPCEvent virtual method return a RefPtr to an XPCEventHandler, which is captured in the event handler of the bootstrap xpc connection. No new tests, since there already exist tests for this. UTI to MIME type mapping is being used in WebKit and underlying framework, and many tests would fail if this mapping was not working. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeConnection): * NetworkProcess/cocoa/LaunchServicesDatabaseObserver.h: Added. * NetworkProcess/cocoa/LaunchServicesDatabaseObserver.mm: Added. (WebKit::LaunchServicesDatabaseObserver::singleton): (WebKit::LaunchServicesDatabaseObserver::LaunchServicesDatabaseObserver): (WebKit::LaunchServicesDatabaseObserver::startObserving): (WebKit::LaunchServicesDatabaseObserver::~LaunchServicesDatabaseObserver): (WebKit::LaunchServicesDatabaseObserver::xpcEndpointMessageNameKey const): (WebKit::LaunchServicesDatabaseObserver::xpcEndpointMessageName const): (WebKit::LaunchServicesDatabaseObserver::xpcEndpointNameKey const): (WebKit::LaunchServicesDatabaseObserver::handleEvent): * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: * Scripts/process-entitlements.sh: * Shared/Cocoa/LaunchServicesDatabaseXPCConstants.h: Added. * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm: * SourcesCocoa.txt: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::xpcEndpointMessage const): (WebKit::WebProcessPool::sendNetworkProcessXPCEndpointToWebProcess): * UIProcess/Cocoa/XPCEventHandler.h: Added. (WebKit::XPCEventHandler::~XPCEventHandler): * UIProcess/Launcher/ProcessLauncher.h: (WebKit::ProcessLauncher::Client::xpcEventHandler const): * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::ProcessLauncher::launchProcess): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Network/NetworkProcessProxyCocoa.mm: Added. (WebKit::NetworkProcessProxy::xpcEventHandler const): (WebKit::NetworkProcessProxy::XPCEventHandler::handleXPCEvent const): (WebKit::NetworkProcessProxy::XPCEventHandler::XPCEventHandler): (WebKit::NetworkProcessProxy::XPCEventHandler::~XPCEventHandler): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didFinishLaunching): * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebPage/Cocoa/WebPageCocoa.mm: (WebKit::WebPage::platformDidReceiveLoadParameters): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeConnection): * WebProcess/WebProcess.h: * WebProcess/cocoa/LaunchServicesDatabaseManager.h: Added. * WebProcess/cocoa/LaunchServicesDatabaseManager.mm: Added. (WebKit::LaunchServicesDatabaseManager::singleton): (WebKit::LaunchServicesDatabaseManager::handleEvent): (WebKit::LaunchServicesDatabaseManager::didConnect): (WebKit::LaunchServicesDatabaseManager::waitForDatabaseUpdate): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::handleXPCEndpointMessages const): (WebKit::WebProcess::platformInitializeWebProcess): Source/WTF: Added HAVE define for determining if the class LSDatabaseContext is present. * wtf/PlatformHave.h: Canonical link: https://commits.webkit.org/226950@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@264178 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-07-09 17:06:14 +00:00
Remove all references to non-existent 10.16 https://bugs.webkit.org/show_bug.cgi?id=215202 Reviewed by Wenson Hsieh. Source/bmalloc: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: Source/JavaScriptCore: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/ThirdParty: * gtest/xcode/Config/DebugProject.xcconfig: * gtest/xcode/Config/ReleaseProject.xcconfig: Source/ThirdParty/ANGLE: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/ThirdParty/libwebrtc: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: * Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.h: Source/WebCore: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebCore/PAL: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebInspectorUI: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WebKit: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: * Scripts/process-entitlements.sh: * WebProcess/com.apple.WebProcess.sb.in: Source/WebKitLegacy/mac: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: Source/WTF: * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * wtf/PlatformEnableCocoa.h: * wtf/PlatformHave.h: * wtf/PlatformUse.h: Tools: * ContentExtensionTester/Configurations/Base.xcconfig: * ContentExtensionTester/Configurations/DebugRelease.xcconfig: * DumpRenderTree/mac/Configurations/Base.xcconfig: * DumpRenderTree/mac/Configurations/DebugRelease.xcconfig: * ImageDiff/cg/Configurations/Base.xcconfig: * ImageDiff/cg/Configurations/DebugRelease.xcconfig: * MiniBrowser/Configurations/Base.xcconfig: * MiniBrowser/Configurations/DebugRelease.xcconfig: * TestWebKitAPI/Configurations/Base.xcconfig: * TestWebKitAPI/Configurations/DebugRelease.xcconfig: * TestWebKitAPI/Configurations/WebKitTargetConditionals.xcconfig: * TestWebKitAPI/config.h: * WebEditingTester/Configurations/Base.xcconfig: * WebEditingTester/Configurations/DebugRelease.xcconfig: * WebKitTestRunner/Configurations/Base.xcconfig: * WebKitTestRunner/Configurations/DebugRelease.xcconfig: * lldb/lldbWebKitTester/Configurations/Base.xcconfig: * lldb/lldbWebKitTester/Configurations/DebugRelease.xcconfig: Canonical link: https://commits.webkit.org/227995@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@265315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-08-06 00:58:34 +00:00
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000)
Use AVRoutePickerView when available for choosing AirPlay devices https://bugs.webkit.org/show_bug.cgi?id=213497 <rdar://problem/58610662> Reviewed by Jer Noble. Source/WebCore: Use an AVRoutePickerView, the replacement for AVOutputDeviceMenuController, when it is available to allow a user to pick an AirPlay device. To do this, create an AVPlaybackTargetPicker abstract base and create a concrete class from the AVOutputDeviceMenuController-specific code from MediaPlaybackTargetPickerMac, and create a new concrete class using AVRoutePickerView. Tested manually because these changes require an AirPlay device. * Modules/mediasession/WebMediaSessionManager.cpp: (WebCore::WebMediaSessionManager::showPlaybackTargetPicker): Pass the view to the target picker. * Modules/mediasession/WebMediaSessionManagerClient.h: * Modules/remoteplayback/RemotePlayback.cpp: (WebCore::RemotePlayback::playbackTargetPickerWasDismissed): Drive-by fix: return early if there are no pending promises. * SourcesCocoa.txt: Add new files. * WebCore.xcodeproj/project.pbxproj: Ditto. * platform/graphics/MediaPlaybackTargetPicker.cpp: (WebCore::MediaPlaybackTargetPicker::showPlaybackTargetPicker): Add new parameter. * platform/graphics/MediaPlaybackTargetPicker.h: * platform/graphics/avfoundation/objc/AVOutputDeviceMenuControllerTargetPicker.h: Copied from Source/WebCore/platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h. * platform/graphics/avfoundation/objc/AVOutputDeviceMenuControllerTargetPicker.mm: Copied from Source/WebCore/platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm. (WebCore::AVOutputDeviceMenuControllerTargetPicker::AVOutputDeviceMenuControllerTargetPicker): (WebCore::AVOutputDeviceMenuControllerTargetPicker::~AVOutputDeviceMenuControllerTargetPicker): (WebCore::AVOutputDeviceMenuControllerTargetPicker::devicePicker): (WebCore::AVOutputDeviceMenuControllerTargetPicker::availableDevicesDidChange): (WebCore::AVOutputDeviceMenuControllerTargetPicker::currentDeviceDidChange): (WebCore::AVOutputDeviceMenuControllerTargetPicker::showPlaybackTargetPicker): (WebCore::AVOutputDeviceMenuControllerTargetPicker::startingMonitoringPlaybackTargets): (WebCore::AVOutputDeviceMenuControllerTargetPicker::stopMonitoringPlaybackTargets): (WebCore::AVOutputDeviceMenuControllerTargetPicker::invalidatePlaybackTargets): (WebCore::AVOutputDeviceMenuControllerTargetPicker::externalOutputDeviceAvailable): (WebCore::AVOutputDeviceMenuControllerTargetPicker::outputContext): (-[WebAVOutputDeviceMenuControllerHelper initWithCallback:]): (-[WebAVOutputDeviceMenuControllerHelper clearCallback]): (-[WebAVOutputDeviceMenuControllerHelper observeValueForKeyPath:ofObject:change:context:]): * platform/graphics/avfoundation/objc/AVPlaybackTargetPicker.h: Added. (WebCore::AVPlaybackTargetPicker::AVPlaybackTargetPicker): (WebCore::AVPlaybackTargetPicker::client const): * platform/graphics/avfoundation/objc/AVRoutePickerViewTargetPicker.h: Added. * platform/graphics/avfoundation/objc/AVRoutePickerViewTargetPicker.mm: Added. (WebCore::AVRoutePickerViewTargetPicker::isAvailable): (WebCore::AVRoutePickerViewTargetPicker::AVRoutePickerViewTargetPicker): (WebCore::AVRoutePickerViewTargetPicker::~AVRoutePickerViewTargetPicker): (WebCore::AVRoutePickerViewTargetPicker::outputContextInternal): (WebCore::AVRoutePickerViewTargetPicker::devicePicker): (WebCore::AVRoutePickerViewTargetPicker::routeDetector): (WebCore::AVRoutePickerViewTargetPicker::showPlaybackTargetPicker): (WebCore::AVRoutePickerViewTargetPicker::startingMonitoringPlaybackTargets): (WebCore::AVRoutePickerViewTargetPicker::stopMonitoringPlaybackTargets): (WebCore::AVRoutePickerViewTargetPicker::externalOutputDeviceAvailable): (WebCore::AVRoutePickerViewTargetPicker::outputContext): (WebCore::AVRoutePickerViewTargetPicker::invalidatePlaybackTargets): (WebCore::AVRoutePickerViewTargetPicker::availableDevicesDidChange): (WebCore::AVRoutePickerViewTargetPicker::currentDeviceDidChange): (WebCore::AVRoutePickerViewTargetPicker::devicePickerWasDismissed): (-[WebAVRoutePickerViewHelper initWithCallback:]): (-[WebAVRoutePickerViewHelper dealloc]): (-[WebAVRoutePickerViewHelper clearCallback]): (-[WebAVRoutePickerViewHelper routePickerViewDidEndPresentingRoutes:]): (-[WebAVRoutePickerViewHelper notificationHandler:]): * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h: * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm: (WebCore::MediaPlaybackTargetPickerMac::MediaPlaybackTargetPickerMac): (WebCore::MediaPlaybackTargetPickerMac::~MediaPlaybackTargetPickerMac): (WebCore::MediaPlaybackTargetPickerMac::externalOutputDeviceAvailable): (WebCore::MediaPlaybackTargetPickerMac::playbackTarget): (WebCore::MediaPlaybackTargetPickerMac::routePicker): (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker): (WebCore::MediaPlaybackTargetPickerMac::startingMonitoringPlaybackTargets): (WebCore::MediaPlaybackTargetPickerMac::stopMonitoringPlaybackTargets): (WebCore::MediaPlaybackTargetPickerMac::invalidatePlaybackTargets): (WebCore::MediaPlaybackTargetPickerMac::pickerWasDismissed): (WebCore::MediaPlaybackTargetPickerMac::availableDevicesChanged): (WebCore::MediaPlaybackTargetPickerMac::currentDeviceChanged): (WebCore::MediaPlaybackTargetPickerMac::devicePicker): Deleted. (-[WebAVOutputDeviceMenuControllerHelper initWithCallback:]): Deleted. (-[WebAVOutputDeviceMenuControllerHelper clearCallback]): Deleted. (-[WebAVOutputDeviceMenuControllerHelper observeValueForKeyPath:ofObject:change:context:]): Deleted. * platform/mock/MediaPlaybackTargetPickerMock.cpp: (WebCore::MediaPlaybackTargetPickerMock::showPlaybackTargetPicker): * platform/mock/MediaPlaybackTargetPickerMock.h: Source/WebCore/PAL: * pal/cocoa/AVFoundationSoftLink.h: * pal/cocoa/AVFoundationSoftLink.mm: Soft link AVRoutePickerView. * pal/spi/cocoa/AVKitSPI.h: Declare AVRoutePickerView. Source/WebKit: * UIProcess/WebPageProxy.h: * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::platformView const): Add new override. Source/WebKitLegacy/mac: * WebView/WebMediaPlaybackTargetPicker.h: (WebMediaPlaybackTargetPicker::~WebMediaPlaybackTargetPicker): Deleted. * WebView/WebMediaPlaybackTargetPicker.mm: (WebMediaPlaybackTargetPicker::create): (WebMediaPlaybackTargetPicker::WebMediaPlaybackTargetPicker): (WebMediaPlaybackTargetPicker::invalidate): (WebMediaPlaybackTargetPicker::platformView const): New override. * WebView/WebView.mm: (-[WebView _devicePicker]): Pass view to WebMediaPlaybackTargetPicker factory. Source/WTF: * wtf/PlatformHave.h: Define HAVE_AVROUTEPICKERVIEW. Tools: * TestWebKitAPI/Tests/WebCore/cocoa/AVFoundationSoftLinkTest.mm: (TestWebKitAPI::TEST): Test AVOutputContextOutputDevicesDidChangeNotification. Don't check AVRouteDetectorMultipleRoutesDetectedDidChangeNotification on watchOS, we don't use it there. Canonical link: https://commits.webkit.org/227408@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@264663 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-07-21 17:46:28 +00:00
#define HAVE_AVROUTEPICKERVIEW 1
#endif
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000)
#define HAVE_NSTABLEVIEWSTYLE 1
#endif
Experimental: Cap the expiry of persistent cookies set in 3rd-party CNAME cloaked HTTP responses https://bugs.webkit.org/show_bug.cgi?id=215201 <rdar://problem/57454633> Reviewed by Brent Fulgham. Also reviewed and commented on by Chris Dumez, Jiten Mehta, Sam Weinig, and Alex Christensen. Source/WebCore: Tests: http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-1p-cname.html http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-3p-cname.html http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-matching-cname.html http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-no-cname.html http/tests/resourceLoadStatistics/cname-cloaking-top-no-cname-sub-1p-cname.html http/tests/resourceLoadStatistics/cname-cloaking-top-no-cname-sub-3p-cname.html http/tests/resourceLoadStatistics/cname-cloaking-top-no-cname-sub-no-cname.html * page/Settings.yaml: Added the off-by-default flag isCNAMECloakingMitigationEnabled. * platform/network/NetworkStorageSession.cpp: (WebCore::NetworkStorageSession::resourceLoadStatisticsEnabled const): New getter for the ITP setting. * platform/network/NetworkStorageSession.h: * platform/network/cocoa/NetworkStorageSessionCocoa.mm: (WebCore::NetworkStorageSession::capExpiryOfPersistentCookie): Broke this function out so that it can be reused. (WebCore::parseDOMCookie): Here's from where the function above was broken out. The existing functionality has a test case. Source/WebCore/PAL: * pal/spi/cf/CFNetworkSPI.h: This change declares two new properties on NSURLSessionTask: - _cookieTransformCallback - _resolvedCNAMEChain Source/WebKit: This experimental feature is off by default. CNAME cloaking means a host resolves to a a different domain, potentially a third-party domain, as part of DNS resolution. This patch makes WebKit::NetworkDataTaskCocoa capture any CNAME cloaking for the first party host and stores it in a table in the WebKit::NetworkSession. It then checks first party subresource loads to see if they resolve to a different domain and if so, compare that domain to both the first party domain and its CNAME cloaking domain, if there is one. If there's a mismatch, it's deemed a case of third-party CNAME cloaking and any cookies set in the response of the cloaked subresource load will have their expiry capped to 7 days. The cases for capping expiry look like this (and are backed by test cases): First-party host | First-party subdomain | Capped expiry ------------------|----------------------------|-------------- No CNAME cloaking | No CNAME cloaking | No No CNAME cloaking | First-party CNAME cloaking | No No CNAME cloaking | Third-party CNAME cloaking | Yes CNAME cloaking | No CNAME cloaking | No CNAME cloaking | Matching CNAME cloaking | No CNAME cloaking | First-party CNAME cloaking | No CNAME cloaking | Third-party CNAME cloaking | Yes This patch makes use of two new CFNetwork SPIs on NSURLSessionTask: - _cookieTransformCallback - _resolvedCNAMEChain * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::resetParametersToDefaultValues): This reset now covers the new CNAME cloaking member variables. (WebKit::NetworkProcess::setIsRunningResourceLoadStatisticsTest): This function now also enables the CNAME cloaking code. (WebKit::NetworkProcess::setFirstPartyHostCNAMEDomainForTesting): (WebKit::NetworkProcess::setThirdPartyCNAMEDomainForTesting): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: New IPC to forward test configuration. * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::NetworkSession): Now picks up the flag for this feature. (WebKit::NetworkSession::setFirstPartyHostCNAMEDomain): This is called from NetworkDataTaskCocoa::updateFirstPartyInfoForTaskAndSession() when there is CNAME cloaking for the first party host. This is done to make it possible to not cap the expiry of cookies if subsequent subresource loads have CNAME cloaking that matches the first-party host's CNAME cloaking. This happens when whole websites are hosted on edge networks. This function is also used by the test infrastructure to mock the DNS resolution for a first-party host. (WebKit::NetworkSession::firstPartyHostCNAMEDomain): This returns any captured CNAME cloaking for a host, if there is one. (WebKit::NetworkSession::resetCNAMEDomainData): * NetworkProcess/NetworkSession.h: (WebKit::NetworkSession::setCNAMECloakingMitigationEnabled): (WebKit::NetworkSession::cnameCloakingMitigationEnabled const): (WebKit::NetworkSession::setThirdPartyCNAMEDomainForTesting): This test functions allows us to mock the DNS resolution for a subresource. (WebKit::NetworkSession::thirdPartyCNAMEDomainForTesting const): * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::hasCNAMEAndCookieTransformSPI): (WebKit::lastCNAMEDomain): (WebKit::NetworkDataTaskCocoa::updateFirstPartyInfoForSession): This is called by NetworkDataTaskCocoa::didReceiveResponse() to capture any CNAME cloaking for the first-party host. (WebKit::NetworkDataTaskCocoa::applyCookiePolicyForThirdPartyCNAMECloaking): This is called in the NetworkDataTaskCocoa constructor and in NetworkDataTaskCocoa::willPerformHTTPRedirection() and sets the new _cookieTransformCallback SPI property on the task which will check the response for any third-party CNAME cloaking and cap the expiry of incoming cookies accordingly. (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): This now calls NetworkDataTaskCocoa::applyCookiePolicyForThirdPartyCNAMECloaking(). (WebKit::NetworkDataTaskCocoa::didReceiveResponse): This now calls NetworkDataTaskCocoa::updateFirstPartyInfoForTaskAndSession(). (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection): This now calls NetworkDataTaskCocoa::applyCookiePolicyForThirdPartyCNAMECloaking(). * Shared/ResourceLoadStatisticsParameters.h: Now holds a WebCore::CNAMECloakingMitigationEnabled flag. (WebKit::ResourceLoadStatisticsParameters::encode const): (WebKit::ResourceLoadStatisticsParameters::decode): * Shared/WebPreferences.yaml: * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreSetResourceLoadStatisticsFirstPartyHostCNAMEDomainForTesting): Used to mock CNAME resolution data. (WKWebsiteDataStoreSetResourceLoadStatisticsThirdPartyCNAMEDomainForTesting): Used to mock CNAME resolution data. * UIProcess/API/C/WKWebsiteDataStoreRef.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::setFirstPartyHostCNAMEDomainForTesting): (WebKit::NetworkProcessProxy::setThirdPartyCNAMEDomainForTesting): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): Now handles the WebCore::CNAMECloakingMitigationEnabled flag. * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::platformSetNetworkParameters): Now handles the WebCore::CNAMECloakingMitigationEnabled flag. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::setResourceLoadStatisticsFirstPartyHostCNAMEDomainForTesting): (WebKit::WebsiteDataStore::setResourceLoadStatisticsThirdPartyCNAMEDomainForTesting): (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStore.h: Source/WTF: This change defines HAVE_CFNETWORK_CNAME_AND_COOKIE_TRANSFORM_SPI. * wtf/PlatformHave.h: Tools: This patch adds two TestRunner functions which allows for testing with data that would otherwise come from DNS resolution: - statisticsSetFirstPartyHostCNAMEDomain() - statisticsSetThirdPartyCNAMEDomain() * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: (WTR::InjectedBundle::didReceiveMessageToPage): * WebKitTestRunner/InjectedBundle/TestRunner.cpp: (WTR::TestRunner::statisticsSetFirstPartyHostCNAMEDomain): (WTR::TestRunner::statisticsCallDidSetFirstPartyHostCNAMEDomainCallback): (WTR::TestRunner::statisticsSetThirdPartyCNAMEDomain): (WTR::TestRunner::statisticsCallDidSetThirdPartyCNAMEDomainCallback): * WebKitTestRunner/InjectedBundle/TestRunner.h: * WebKitTestRunner/TestController.cpp: (WTR::TestController::setStatisticsFirstPartyHostCNAMEDomain): (WTR::TestController::setStatisticsThirdPartyCNAMEDomain): * WebKitTestRunner/TestController.h: * WebKitTestRunner/TestInvocation.cpp: (WTR::TestInvocation::didReceiveMessageFromInjectedBundle): (WTR::TestInvocation::didSetFirstPartyHostCNAMEDomain): (WTR::TestInvocation::didSetThirdPartyCNAMEDomain): * WebKitTestRunner/TestInvocation.h: LayoutTests: * http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-1p-cname-expected.txt: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-1p-cname.html: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-3p-cname-expected.txt: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-3p-cname.html: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-matching-cname-expected.txt: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-matching-cname.html: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-no-cname-expected.txt: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-no-cname.html: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-no-cname-sub-1p-cname-expected.txt: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-no-cname-sub-1p-cname.html: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-no-cname-sub-3p-cname-expected.txt: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-no-cname-sub-3p-cname.html: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-no-cname-sub-no-cname-expected.txt: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-no-cname-sub-no-cname.html: Added. * platform/ios-13/TestExpectations: New tests marked as [ Skip ]. * platform/ios-wk2/TestExpectations: New tests marked as [ Pass ] in general. * platform/mac-wk2/TestExpectations: New tests marked as [ Pass ] for BigSur+. * platform/wk2/TestExpectations: New tests marked as [ Skip ] in general. Canonical link: https://commits.webkit.org/228067@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@265389 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-08-07 20:40:32 +00:00
Add support for HTMLMediaElement.setSinkId https://bugs.webkit.org/show_bug.cgi?id=216696 Reviewed by Eric Carlson. LayoutTests/imported/w3c: * resources/import-expectations.json: * web-platform-tests/audio-output/META.yml: Added. * web-platform-tests/audio-output/idlharness.https.window-expected.txt: Added. * web-platform-tests/audio-output/idlharness.https.window.html: Added. * web-platform-tests/audio-output/idlharness.https.window.js: Added. * web-platform-tests/audio-output/setSinkId.https-expected.txt: Added. * web-platform-tests/audio-output/setSinkId.https.html: Added. * web-platform-tests/audio-output/w3c-import.log: Added. Source/WebCore: Implement setSinkId and sinkId as per https://w3c.github.io/mediacapture-output/#htmlmediaelement-extensions. Introduce a setting to expose these methods and to enable/disable user gesture requirement. Add interfaces to change device output for specific media players. Add support for HLS, MSE and MediaStreamTrack renderers on MacOS. In case of setting the empty string, the default output device is used Tests: http/wpt/audio-output/setSinkId.https.html imported/w3c/web-platform-tests/audio-output/idlharness.https.window.html imported/w3c/web-platform-tests/audio-output/setSinkId.https.html * CMakeLists.txt: * DerivedSources.make: * Modules/mediastream/MediaDevices.cpp: (WebCore::MediaDevices::exposeDevices): * Modules/mediastream/MediaDevices.h: * WebCore.xcodeproj/project.pbxproj: * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::audioOutputDevice const): (WebCore::HTMLMediaElement::setAudioOutputDevice): (WebCore::HTMLMediaElement::audioOutputDeviceId const): * html/HTMLMediaElement.h: (WebCore::HTMLMediaElement::audioOutputHashedDeviceId const): * html/HTMLMediaElementAudioOutput.idl: Added. * page/Settings.yaml: * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::audioOutputDeviceChanged): * platform/graphics/MediaPlayer.h: (WebCore::MediaPlayerClient::audioOutputDeviceId const): (WebCore::MediaPlayerClient::audioOutputDeviceIdOverride const): (WebCore::MediaPlayer::audioOutputDeviceId const): (WebCore::MediaPlayer::audioOutputDeviceIdOverride const): * platform/graphics/MediaPlayerPrivate.h: (WebCore::MediaPlayerPrivateInterface::audioOutputDeviceChanged): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): (WebCore::MediaPlayerPrivateAVFoundationObjC::audioOutputDeviceChanged): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::audioOutputDeviceChanged): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateTracks): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::audioOutputDeviceChanged): * platform/mediastream/AudioMediaStreamTrackRenderer.h: (WebCore::AudioMediaStreamTrackRenderer::setAudioOutputDevice): * platform/mediastream/AudioTrackPrivateMediaStream.cpp: (WebCore::AudioTrackPrivateMediaStream::setAudioOutputDevice): * platform/mediastream/AudioTrackPrivateMediaStream.h: * platform/mediastream/mac/AudioMediaStreamTrackRendererCocoa.cpp: (WebCore::AudioMediaStreamTrackRendererCocoa::setAudioOutputDevice): (WebCore::AudioMediaStreamTrackRendererCocoa::pushSamples): * platform/mediastream/mac/AudioMediaStreamTrackRendererCocoa.h: * platform/mediastream/mac/AudioMediaStreamTrackRendererUnit.cpp: (WebCore::AudioMediaStreamTrackRendererUnit::setAudioOutputDevice): (WebCore::AudioMediaStreamTrackRendererUnit::createAudioUnitIfNeeded): * platform/mediastream/mac/AudioMediaStreamTrackRendererUnit.h: Source/WebKit: Add internal flag to enable/disable user gesture requirement for setting audio output device, and for per media element setting of audio output device. * Shared/WebPreferencesExperimental.yaml: * Shared/WebPreferencesInternals.yaml: Source/WTF: Add HAVE_AUDIO_OUTPUT_DEVICE_UNIQUE_ID. * wtf/PlatformHave.h: Tools: * WebKitTestRunner/TestController.cpp: (WTR::TestController::resetPreferencesToConsistentValues): LayoutTests: Skip new tests on WK1 since mediaDevices is not implemented in WK1. * http/wpt/audio-output/setSinkId.https-expected.txt: Added. * http/wpt/audio-output/setSinkId.https.html: Added. * platform/mac-wk1/TestExpectations: * platform/win/TestExpectations: Canonical link: https://commits.webkit.org/229664@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267472 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-09-23 14:04:20 +00:00
#if PLATFORM(MAC)
#define HAVE_AUDIO_OUTPUT_DEVICE_UNIQUE_ID 1
#endif
#if ((PLATFORM(IOS) || PLATFORM(MACCATALYST)) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000) \
|| (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 70000) \
|| (PLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 140000)
#define HAVE_UIKEYBOARDIMPL_SMARTINSERTDELETE_CLASS_METHOD 1
#endif
Experimental: Cap the expiry of persistent cookies set in 3rd-party CNAME cloaked HTTP responses https://bugs.webkit.org/show_bug.cgi?id=215201 <rdar://problem/57454633> Reviewed by Brent Fulgham. Also reviewed and commented on by Chris Dumez, Jiten Mehta, Sam Weinig, and Alex Christensen. Source/WebCore: Tests: http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-1p-cname.html http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-3p-cname.html http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-matching-cname.html http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-no-cname.html http/tests/resourceLoadStatistics/cname-cloaking-top-no-cname-sub-1p-cname.html http/tests/resourceLoadStatistics/cname-cloaking-top-no-cname-sub-3p-cname.html http/tests/resourceLoadStatistics/cname-cloaking-top-no-cname-sub-no-cname.html * page/Settings.yaml: Added the off-by-default flag isCNAMECloakingMitigationEnabled. * platform/network/NetworkStorageSession.cpp: (WebCore::NetworkStorageSession::resourceLoadStatisticsEnabled const): New getter for the ITP setting. * platform/network/NetworkStorageSession.h: * platform/network/cocoa/NetworkStorageSessionCocoa.mm: (WebCore::NetworkStorageSession::capExpiryOfPersistentCookie): Broke this function out so that it can be reused. (WebCore::parseDOMCookie): Here's from where the function above was broken out. The existing functionality has a test case. Source/WebCore/PAL: * pal/spi/cf/CFNetworkSPI.h: This change declares two new properties on NSURLSessionTask: - _cookieTransformCallback - _resolvedCNAMEChain Source/WebKit: This experimental feature is off by default. CNAME cloaking means a host resolves to a a different domain, potentially a third-party domain, as part of DNS resolution. This patch makes WebKit::NetworkDataTaskCocoa capture any CNAME cloaking for the first party host and stores it in a table in the WebKit::NetworkSession. It then checks first party subresource loads to see if they resolve to a different domain and if so, compare that domain to both the first party domain and its CNAME cloaking domain, if there is one. If there's a mismatch, it's deemed a case of third-party CNAME cloaking and any cookies set in the response of the cloaked subresource load will have their expiry capped to 7 days. The cases for capping expiry look like this (and are backed by test cases): First-party host | First-party subdomain | Capped expiry ------------------|----------------------------|-------------- No CNAME cloaking | No CNAME cloaking | No No CNAME cloaking | First-party CNAME cloaking | No No CNAME cloaking | Third-party CNAME cloaking | Yes CNAME cloaking | No CNAME cloaking | No CNAME cloaking | Matching CNAME cloaking | No CNAME cloaking | First-party CNAME cloaking | No CNAME cloaking | Third-party CNAME cloaking | Yes This patch makes use of two new CFNetwork SPIs on NSURLSessionTask: - _cookieTransformCallback - _resolvedCNAMEChain * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::resetParametersToDefaultValues): This reset now covers the new CNAME cloaking member variables. (WebKit::NetworkProcess::setIsRunningResourceLoadStatisticsTest): This function now also enables the CNAME cloaking code. (WebKit::NetworkProcess::setFirstPartyHostCNAMEDomainForTesting): (WebKit::NetworkProcess::setThirdPartyCNAMEDomainForTesting): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: New IPC to forward test configuration. * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::NetworkSession): Now picks up the flag for this feature. (WebKit::NetworkSession::setFirstPartyHostCNAMEDomain): This is called from NetworkDataTaskCocoa::updateFirstPartyInfoForTaskAndSession() when there is CNAME cloaking for the first party host. This is done to make it possible to not cap the expiry of cookies if subsequent subresource loads have CNAME cloaking that matches the first-party host's CNAME cloaking. This happens when whole websites are hosted on edge networks. This function is also used by the test infrastructure to mock the DNS resolution for a first-party host. (WebKit::NetworkSession::firstPartyHostCNAMEDomain): This returns any captured CNAME cloaking for a host, if there is one. (WebKit::NetworkSession::resetCNAMEDomainData): * NetworkProcess/NetworkSession.h: (WebKit::NetworkSession::setCNAMECloakingMitigationEnabled): (WebKit::NetworkSession::cnameCloakingMitigationEnabled const): (WebKit::NetworkSession::setThirdPartyCNAMEDomainForTesting): This test functions allows us to mock the DNS resolution for a subresource. (WebKit::NetworkSession::thirdPartyCNAMEDomainForTesting const): * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::hasCNAMEAndCookieTransformSPI): (WebKit::lastCNAMEDomain): (WebKit::NetworkDataTaskCocoa::updateFirstPartyInfoForSession): This is called by NetworkDataTaskCocoa::didReceiveResponse() to capture any CNAME cloaking for the first-party host. (WebKit::NetworkDataTaskCocoa::applyCookiePolicyForThirdPartyCNAMECloaking): This is called in the NetworkDataTaskCocoa constructor and in NetworkDataTaskCocoa::willPerformHTTPRedirection() and sets the new _cookieTransformCallback SPI property on the task which will check the response for any third-party CNAME cloaking and cap the expiry of incoming cookies accordingly. (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): This now calls NetworkDataTaskCocoa::applyCookiePolicyForThirdPartyCNAMECloaking(). (WebKit::NetworkDataTaskCocoa::didReceiveResponse): This now calls NetworkDataTaskCocoa::updateFirstPartyInfoForTaskAndSession(). (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection): This now calls NetworkDataTaskCocoa::applyCookiePolicyForThirdPartyCNAMECloaking(). * Shared/ResourceLoadStatisticsParameters.h: Now holds a WebCore::CNAMECloakingMitigationEnabled flag. (WebKit::ResourceLoadStatisticsParameters::encode const): (WebKit::ResourceLoadStatisticsParameters::decode): * Shared/WebPreferences.yaml: * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreSetResourceLoadStatisticsFirstPartyHostCNAMEDomainForTesting): Used to mock CNAME resolution data. (WKWebsiteDataStoreSetResourceLoadStatisticsThirdPartyCNAMEDomainForTesting): Used to mock CNAME resolution data. * UIProcess/API/C/WKWebsiteDataStoreRef.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::setFirstPartyHostCNAMEDomainForTesting): (WebKit::NetworkProcessProxy::setThirdPartyCNAMEDomainForTesting): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): Now handles the WebCore::CNAMECloakingMitigationEnabled flag. * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::platformSetNetworkParameters): Now handles the WebCore::CNAMECloakingMitigationEnabled flag. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::setResourceLoadStatisticsFirstPartyHostCNAMEDomainForTesting): (WebKit::WebsiteDataStore::setResourceLoadStatisticsThirdPartyCNAMEDomainForTesting): (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStore.h: Source/WTF: This change defines HAVE_CFNETWORK_CNAME_AND_COOKIE_TRANSFORM_SPI. * wtf/PlatformHave.h: Tools: This patch adds two TestRunner functions which allows for testing with data that would otherwise come from DNS resolution: - statisticsSetFirstPartyHostCNAMEDomain() - statisticsSetThirdPartyCNAMEDomain() * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: (WTR::InjectedBundle::didReceiveMessageToPage): * WebKitTestRunner/InjectedBundle/TestRunner.cpp: (WTR::TestRunner::statisticsSetFirstPartyHostCNAMEDomain): (WTR::TestRunner::statisticsCallDidSetFirstPartyHostCNAMEDomainCallback): (WTR::TestRunner::statisticsSetThirdPartyCNAMEDomain): (WTR::TestRunner::statisticsCallDidSetThirdPartyCNAMEDomainCallback): * WebKitTestRunner/InjectedBundle/TestRunner.h: * WebKitTestRunner/TestController.cpp: (WTR::TestController::setStatisticsFirstPartyHostCNAMEDomain): (WTR::TestController::setStatisticsThirdPartyCNAMEDomain): * WebKitTestRunner/TestController.h: * WebKitTestRunner/TestInvocation.cpp: (WTR::TestInvocation::didReceiveMessageFromInjectedBundle): (WTR::TestInvocation::didSetFirstPartyHostCNAMEDomain): (WTR::TestInvocation::didSetThirdPartyCNAMEDomain): * WebKitTestRunner/TestInvocation.h: LayoutTests: * http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-1p-cname-expected.txt: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-1p-cname.html: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-3p-cname-expected.txt: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-3p-cname.html: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-matching-cname-expected.txt: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-matching-cname.html: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-no-cname-expected.txt: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-no-cname.html: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-no-cname-sub-1p-cname-expected.txt: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-no-cname-sub-1p-cname.html: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-no-cname-sub-3p-cname-expected.txt: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-no-cname-sub-3p-cname.html: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-no-cname-sub-no-cname-expected.txt: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-no-cname-sub-no-cname.html: Added. * platform/ios-13/TestExpectations: New tests marked as [ Skip ]. * platform/ios-wk2/TestExpectations: New tests marked as [ Pass ] in general. * platform/mac-wk2/TestExpectations: New tests marked as [ Pass ] for BigSur+. * platform/wk2/TestExpectations: New tests marked as [ Skip ] in general. Canonical link: https://commits.webkit.org/228067@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@265389 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-08-07 20:40:32 +00:00
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000) \
|| ((PLATFORM(IOS) || PLATFORM(MACCATALYST)) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000) \
|| (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 70000) \
|| (PLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 140000)
#define HAVE_CF_PREFS_SET_READ_ONLY 1
Experimental: Cap the expiry of persistent cookies set in 3rd-party CNAME cloaked HTTP responses https://bugs.webkit.org/show_bug.cgi?id=215201 <rdar://problem/57454633> Reviewed by Brent Fulgham. Also reviewed and commented on by Chris Dumez, Jiten Mehta, Sam Weinig, and Alex Christensen. Source/WebCore: Tests: http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-1p-cname.html http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-3p-cname.html http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-matching-cname.html http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-no-cname.html http/tests/resourceLoadStatistics/cname-cloaking-top-no-cname-sub-1p-cname.html http/tests/resourceLoadStatistics/cname-cloaking-top-no-cname-sub-3p-cname.html http/tests/resourceLoadStatistics/cname-cloaking-top-no-cname-sub-no-cname.html * page/Settings.yaml: Added the off-by-default flag isCNAMECloakingMitigationEnabled. * platform/network/NetworkStorageSession.cpp: (WebCore::NetworkStorageSession::resourceLoadStatisticsEnabled const): New getter for the ITP setting. * platform/network/NetworkStorageSession.h: * platform/network/cocoa/NetworkStorageSessionCocoa.mm: (WebCore::NetworkStorageSession::capExpiryOfPersistentCookie): Broke this function out so that it can be reused. (WebCore::parseDOMCookie): Here's from where the function above was broken out. The existing functionality has a test case. Source/WebCore/PAL: * pal/spi/cf/CFNetworkSPI.h: This change declares two new properties on NSURLSessionTask: - _cookieTransformCallback - _resolvedCNAMEChain Source/WebKit: This experimental feature is off by default. CNAME cloaking means a host resolves to a a different domain, potentially a third-party domain, as part of DNS resolution. This patch makes WebKit::NetworkDataTaskCocoa capture any CNAME cloaking for the first party host and stores it in a table in the WebKit::NetworkSession. It then checks first party subresource loads to see if they resolve to a different domain and if so, compare that domain to both the first party domain and its CNAME cloaking domain, if there is one. If there's a mismatch, it's deemed a case of third-party CNAME cloaking and any cookies set in the response of the cloaked subresource load will have their expiry capped to 7 days. The cases for capping expiry look like this (and are backed by test cases): First-party host | First-party subdomain | Capped expiry ------------------|----------------------------|-------------- No CNAME cloaking | No CNAME cloaking | No No CNAME cloaking | First-party CNAME cloaking | No No CNAME cloaking | Third-party CNAME cloaking | Yes CNAME cloaking | No CNAME cloaking | No CNAME cloaking | Matching CNAME cloaking | No CNAME cloaking | First-party CNAME cloaking | No CNAME cloaking | Third-party CNAME cloaking | Yes This patch makes use of two new CFNetwork SPIs on NSURLSessionTask: - _cookieTransformCallback - _resolvedCNAMEChain * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::resetParametersToDefaultValues): This reset now covers the new CNAME cloaking member variables. (WebKit::NetworkProcess::setIsRunningResourceLoadStatisticsTest): This function now also enables the CNAME cloaking code. (WebKit::NetworkProcess::setFirstPartyHostCNAMEDomainForTesting): (WebKit::NetworkProcess::setThirdPartyCNAMEDomainForTesting): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: New IPC to forward test configuration. * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::NetworkSession): Now picks up the flag for this feature. (WebKit::NetworkSession::setFirstPartyHostCNAMEDomain): This is called from NetworkDataTaskCocoa::updateFirstPartyInfoForTaskAndSession() when there is CNAME cloaking for the first party host. This is done to make it possible to not cap the expiry of cookies if subsequent subresource loads have CNAME cloaking that matches the first-party host's CNAME cloaking. This happens when whole websites are hosted on edge networks. This function is also used by the test infrastructure to mock the DNS resolution for a first-party host. (WebKit::NetworkSession::firstPartyHostCNAMEDomain): This returns any captured CNAME cloaking for a host, if there is one. (WebKit::NetworkSession::resetCNAMEDomainData): * NetworkProcess/NetworkSession.h: (WebKit::NetworkSession::setCNAMECloakingMitigationEnabled): (WebKit::NetworkSession::cnameCloakingMitigationEnabled const): (WebKit::NetworkSession::setThirdPartyCNAMEDomainForTesting): This test functions allows us to mock the DNS resolution for a subresource. (WebKit::NetworkSession::thirdPartyCNAMEDomainForTesting const): * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::hasCNAMEAndCookieTransformSPI): (WebKit::lastCNAMEDomain): (WebKit::NetworkDataTaskCocoa::updateFirstPartyInfoForSession): This is called by NetworkDataTaskCocoa::didReceiveResponse() to capture any CNAME cloaking for the first-party host. (WebKit::NetworkDataTaskCocoa::applyCookiePolicyForThirdPartyCNAMECloaking): This is called in the NetworkDataTaskCocoa constructor and in NetworkDataTaskCocoa::willPerformHTTPRedirection() and sets the new _cookieTransformCallback SPI property on the task which will check the response for any third-party CNAME cloaking and cap the expiry of incoming cookies accordingly. (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): This now calls NetworkDataTaskCocoa::applyCookiePolicyForThirdPartyCNAMECloaking(). (WebKit::NetworkDataTaskCocoa::didReceiveResponse): This now calls NetworkDataTaskCocoa::updateFirstPartyInfoForTaskAndSession(). (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection): This now calls NetworkDataTaskCocoa::applyCookiePolicyForThirdPartyCNAMECloaking(). * Shared/ResourceLoadStatisticsParameters.h: Now holds a WebCore::CNAMECloakingMitigationEnabled flag. (WebKit::ResourceLoadStatisticsParameters::encode const): (WebKit::ResourceLoadStatisticsParameters::decode): * Shared/WebPreferences.yaml: * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreSetResourceLoadStatisticsFirstPartyHostCNAMEDomainForTesting): Used to mock CNAME resolution data. (WKWebsiteDataStoreSetResourceLoadStatisticsThirdPartyCNAMEDomainForTesting): Used to mock CNAME resolution data. * UIProcess/API/C/WKWebsiteDataStoreRef.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::setFirstPartyHostCNAMEDomainForTesting): (WebKit::NetworkProcessProxy::setThirdPartyCNAMEDomainForTesting): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): Now handles the WebCore::CNAMECloakingMitigationEnabled flag. * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::platformSetNetworkParameters): Now handles the WebCore::CNAMECloakingMitigationEnabled flag. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::setResourceLoadStatisticsFirstPartyHostCNAMEDomainForTesting): (WebKit::WebsiteDataStore::setResourceLoadStatisticsThirdPartyCNAMEDomainForTesting): (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStore.h: Source/WTF: This change defines HAVE_CFNETWORK_CNAME_AND_COOKIE_TRANSFORM_SPI. * wtf/PlatformHave.h: Tools: This patch adds two TestRunner functions which allows for testing with data that would otherwise come from DNS resolution: - statisticsSetFirstPartyHostCNAMEDomain() - statisticsSetThirdPartyCNAMEDomain() * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: (WTR::InjectedBundle::didReceiveMessageToPage): * WebKitTestRunner/InjectedBundle/TestRunner.cpp: (WTR::TestRunner::statisticsSetFirstPartyHostCNAMEDomain): (WTR::TestRunner::statisticsCallDidSetFirstPartyHostCNAMEDomainCallback): (WTR::TestRunner::statisticsSetThirdPartyCNAMEDomain): (WTR::TestRunner::statisticsCallDidSetThirdPartyCNAMEDomainCallback): * WebKitTestRunner/InjectedBundle/TestRunner.h: * WebKitTestRunner/TestController.cpp: (WTR::TestController::setStatisticsFirstPartyHostCNAMEDomain): (WTR::TestController::setStatisticsThirdPartyCNAMEDomain): * WebKitTestRunner/TestController.h: * WebKitTestRunner/TestInvocation.cpp: (WTR::TestInvocation::didReceiveMessageFromInjectedBundle): (WTR::TestInvocation::didSetFirstPartyHostCNAMEDomain): (WTR::TestInvocation::didSetThirdPartyCNAMEDomain): * WebKitTestRunner/TestInvocation.h: LayoutTests: * http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-1p-cname-expected.txt: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-1p-cname.html: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-3p-cname-expected.txt: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-3p-cname.html: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-matching-cname-expected.txt: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-matching-cname.html: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-no-cname-expected.txt: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-no-cname.html: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-no-cname-sub-1p-cname-expected.txt: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-no-cname-sub-1p-cname.html: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-no-cname-sub-3p-cname-expected.txt: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-no-cname-sub-3p-cname.html: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-no-cname-sub-no-cname-expected.txt: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-no-cname-sub-no-cname.html: Added. * platform/ios-13/TestExpectations: New tests marked as [ Skip ]. * platform/ios-wk2/TestExpectations: New tests marked as [ Pass ] in general. * platform/mac-wk2/TestExpectations: New tests marked as [ Pass ] for BigSur+. * platform/wk2/TestExpectations: New tests marked as [ Skip ] in general. Canonical link: https://commits.webkit.org/228067@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@265389 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-08-07 20:40:32 +00:00
#define HAVE_CFNETWORK_CNAME_AND_COOKIE_TRANSFORM_SPI 1
#define HAVE_CGIMAGESOURCE_WITH_ACCURATE_LOOP_COUNT 1
#define HAVE_CGIMAGESOURCE_WITH_SET_ALLOWABLE_TYPES 1
#define HAVE_HSTS_STORAGE 1
#define HAVE_LSDATABASECONTEXT 1
#define HAVE_PRECONNECT_PING 1
#define HAVE_WEBP 1
#define HAVE_IMAGEIO_FIX_FOR_RADAR_59589723 1
Experimental: Cap the expiry of persistent cookies set in 3rd-party CNAME cloaked HTTP responses https://bugs.webkit.org/show_bug.cgi?id=215201 <rdar://problem/57454633> Reviewed by Brent Fulgham. Also reviewed and commented on by Chris Dumez, Jiten Mehta, Sam Weinig, and Alex Christensen. Source/WebCore: Tests: http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-1p-cname.html http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-3p-cname.html http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-matching-cname.html http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-no-cname.html http/tests/resourceLoadStatistics/cname-cloaking-top-no-cname-sub-1p-cname.html http/tests/resourceLoadStatistics/cname-cloaking-top-no-cname-sub-3p-cname.html http/tests/resourceLoadStatistics/cname-cloaking-top-no-cname-sub-no-cname.html * page/Settings.yaml: Added the off-by-default flag isCNAMECloakingMitigationEnabled. * platform/network/NetworkStorageSession.cpp: (WebCore::NetworkStorageSession::resourceLoadStatisticsEnabled const): New getter for the ITP setting. * platform/network/NetworkStorageSession.h: * platform/network/cocoa/NetworkStorageSessionCocoa.mm: (WebCore::NetworkStorageSession::capExpiryOfPersistentCookie): Broke this function out so that it can be reused. (WebCore::parseDOMCookie): Here's from where the function above was broken out. The existing functionality has a test case. Source/WebCore/PAL: * pal/spi/cf/CFNetworkSPI.h: This change declares two new properties on NSURLSessionTask: - _cookieTransformCallback - _resolvedCNAMEChain Source/WebKit: This experimental feature is off by default. CNAME cloaking means a host resolves to a a different domain, potentially a third-party domain, as part of DNS resolution. This patch makes WebKit::NetworkDataTaskCocoa capture any CNAME cloaking for the first party host and stores it in a table in the WebKit::NetworkSession. It then checks first party subresource loads to see if they resolve to a different domain and if so, compare that domain to both the first party domain and its CNAME cloaking domain, if there is one. If there's a mismatch, it's deemed a case of third-party CNAME cloaking and any cookies set in the response of the cloaked subresource load will have their expiry capped to 7 days. The cases for capping expiry look like this (and are backed by test cases): First-party host | First-party subdomain | Capped expiry ------------------|----------------------------|-------------- No CNAME cloaking | No CNAME cloaking | No No CNAME cloaking | First-party CNAME cloaking | No No CNAME cloaking | Third-party CNAME cloaking | Yes CNAME cloaking | No CNAME cloaking | No CNAME cloaking | Matching CNAME cloaking | No CNAME cloaking | First-party CNAME cloaking | No CNAME cloaking | Third-party CNAME cloaking | Yes This patch makes use of two new CFNetwork SPIs on NSURLSessionTask: - _cookieTransformCallback - _resolvedCNAMEChain * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::resetParametersToDefaultValues): This reset now covers the new CNAME cloaking member variables. (WebKit::NetworkProcess::setIsRunningResourceLoadStatisticsTest): This function now also enables the CNAME cloaking code. (WebKit::NetworkProcess::setFirstPartyHostCNAMEDomainForTesting): (WebKit::NetworkProcess::setThirdPartyCNAMEDomainForTesting): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: New IPC to forward test configuration. * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::NetworkSession): Now picks up the flag for this feature. (WebKit::NetworkSession::setFirstPartyHostCNAMEDomain): This is called from NetworkDataTaskCocoa::updateFirstPartyInfoForTaskAndSession() when there is CNAME cloaking for the first party host. This is done to make it possible to not cap the expiry of cookies if subsequent subresource loads have CNAME cloaking that matches the first-party host's CNAME cloaking. This happens when whole websites are hosted on edge networks. This function is also used by the test infrastructure to mock the DNS resolution for a first-party host. (WebKit::NetworkSession::firstPartyHostCNAMEDomain): This returns any captured CNAME cloaking for a host, if there is one. (WebKit::NetworkSession::resetCNAMEDomainData): * NetworkProcess/NetworkSession.h: (WebKit::NetworkSession::setCNAMECloakingMitigationEnabled): (WebKit::NetworkSession::cnameCloakingMitigationEnabled const): (WebKit::NetworkSession::setThirdPartyCNAMEDomainForTesting): This test functions allows us to mock the DNS resolution for a subresource. (WebKit::NetworkSession::thirdPartyCNAMEDomainForTesting const): * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::hasCNAMEAndCookieTransformSPI): (WebKit::lastCNAMEDomain): (WebKit::NetworkDataTaskCocoa::updateFirstPartyInfoForSession): This is called by NetworkDataTaskCocoa::didReceiveResponse() to capture any CNAME cloaking for the first-party host. (WebKit::NetworkDataTaskCocoa::applyCookiePolicyForThirdPartyCNAMECloaking): This is called in the NetworkDataTaskCocoa constructor and in NetworkDataTaskCocoa::willPerformHTTPRedirection() and sets the new _cookieTransformCallback SPI property on the task which will check the response for any third-party CNAME cloaking and cap the expiry of incoming cookies accordingly. (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): This now calls NetworkDataTaskCocoa::applyCookiePolicyForThirdPartyCNAMECloaking(). (WebKit::NetworkDataTaskCocoa::didReceiveResponse): This now calls NetworkDataTaskCocoa::updateFirstPartyInfoForTaskAndSession(). (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection): This now calls NetworkDataTaskCocoa::applyCookiePolicyForThirdPartyCNAMECloaking(). * Shared/ResourceLoadStatisticsParameters.h: Now holds a WebCore::CNAMECloakingMitigationEnabled flag. (WebKit::ResourceLoadStatisticsParameters::encode const): (WebKit::ResourceLoadStatisticsParameters::decode): * Shared/WebPreferences.yaml: * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreSetResourceLoadStatisticsFirstPartyHostCNAMEDomainForTesting): Used to mock CNAME resolution data. (WKWebsiteDataStoreSetResourceLoadStatisticsThirdPartyCNAMEDomainForTesting): Used to mock CNAME resolution data. * UIProcess/API/C/WKWebsiteDataStoreRef.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::setFirstPartyHostCNAMEDomainForTesting): (WebKit::NetworkProcessProxy::setThirdPartyCNAMEDomainForTesting): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): Now handles the WebCore::CNAMECloakingMitigationEnabled flag. * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::platformSetNetworkParameters): Now handles the WebCore::CNAMECloakingMitigationEnabled flag. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::setResourceLoadStatisticsFirstPartyHostCNAMEDomainForTesting): (WebKit::WebsiteDataStore::setResourceLoadStatisticsThirdPartyCNAMEDomainForTesting): (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStore.h: Source/WTF: This change defines HAVE_CFNETWORK_CNAME_AND_COOKIE_TRANSFORM_SPI. * wtf/PlatformHave.h: Tools: This patch adds two TestRunner functions which allows for testing with data that would otherwise come from DNS resolution: - statisticsSetFirstPartyHostCNAMEDomain() - statisticsSetThirdPartyCNAMEDomain() * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: (WTR::InjectedBundle::didReceiveMessageToPage): * WebKitTestRunner/InjectedBundle/TestRunner.cpp: (WTR::TestRunner::statisticsSetFirstPartyHostCNAMEDomain): (WTR::TestRunner::statisticsCallDidSetFirstPartyHostCNAMEDomainCallback): (WTR::TestRunner::statisticsSetThirdPartyCNAMEDomain): (WTR::TestRunner::statisticsCallDidSetThirdPartyCNAMEDomainCallback): * WebKitTestRunner/InjectedBundle/TestRunner.h: * WebKitTestRunner/TestController.cpp: (WTR::TestController::setStatisticsFirstPartyHostCNAMEDomain): (WTR::TestController::setStatisticsThirdPartyCNAMEDomain): * WebKitTestRunner/TestController.h: * WebKitTestRunner/TestInvocation.cpp: (WTR::TestInvocation::didReceiveMessageFromInjectedBundle): (WTR::TestInvocation::didSetFirstPartyHostCNAMEDomain): (WTR::TestInvocation::didSetThirdPartyCNAMEDomain): * WebKitTestRunner/TestInvocation.h: LayoutTests: * http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-1p-cname-expected.txt: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-1p-cname.html: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-3p-cname-expected.txt: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-3p-cname.html: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-matching-cname-expected.txt: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-matching-cname.html: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-no-cname-expected.txt: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-no-cname.html: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-no-cname-sub-1p-cname-expected.txt: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-no-cname-sub-1p-cname.html: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-no-cname-sub-3p-cname-expected.txt: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-no-cname-sub-3p-cname.html: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-no-cname-sub-no-cname-expected.txt: Added. * http/tests/resourceLoadStatistics/cname-cloaking-top-no-cname-sub-no-cname.html: Added. * platform/ios-13/TestExpectations: New tests marked as [ Skip ]. * platform/ios-wk2/TestExpectations: New tests marked as [ Pass ] in general. * platform/mac-wk2/TestExpectations: New tests marked as [ Pass ] for BigSur+. * platform/wk2/TestExpectations: New tests marked as [ Skip ] in general. Canonical link: https://commits.webkit.org/228067@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@265389 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-08-07 20:40:32 +00:00
#endif
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000) \
|| ((PLATFORM(IOS) || PLATFORM(MACCATALYST)) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000) \
|| (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 70000) \
|| (PLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 140000)
#define HAVE_CTFONTISSYSTEMUIFONT 1
#endif
#if PLATFORM(COCOA) && !(PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101500)
#define HAVE_CTFONTGETPHYSICALSYMBOLICTRAITS 1
#endif
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000) \
|| ((PLATFORM(IOS) || PLATFORM(MACCATALYST)) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000) \
|| (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 70000) \
|| (PLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 140000)
#define HAVE_CTFONTDESCRIPTOR_CREATE_WITH_TEXT_STYLE_AND_ATTRIBUTES 1
#endif
Text copied and pasted from Mac Catalyst apps appears larger than expected https://bugs.webkit.org/show_bug.cgi?id=215971 <rdar://problem/65768907> 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 <rdar://problem/68524148>. Source/WTF: Add a new flag to guard the presence of `_UIApplicationCatalystUserInterfaceIdiom`, `_UIApplicationCatalystScaleFactor`, and `_UIApplicationCatalystRequestViewServiceIdiomAndScaleFactor`. * wtf/PlatformHave.h: Canonical link: https://commits.webkit.org/229163@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266802 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-09-09 22:19:10 +00:00
[iOS] Add a feature flag to stop leaking an XPC boost message to XPC services https://bugs.webkit.org/show_bug.cgi?id=219453 <rdar://72834999> Reviewed by Geoff Garen. Source/WebKit: Add a feature flag to stop leaking an XPC boost message to XPC services on builds where RunningBoard is able to give the right priorities to our XPC services based on the type of RunningBoard assertion is being held. There is no behavior change for the Network/WebContent processes since those were blocklisted in RunningBoard (Turning on the RB_full_manage_WK_jetsam feature flag gives us the default RunningBoard behavior without blocklisting). However, this allows the new GPUProcess to move to IDLE jetsam band when homing out of MobileSafari, which makes the GPUProcess eligible for the freezer. Previously, the leaked boost message would keep the GPUProcess in a higher jetsam band. For now, the feature flag is off by default. I will turn it on later on. * FeatureFlags/WebKit.plist: Add RB_full_manage_WK_jetsam feature flag but keep it off for now. On recent enough builds of RunningBoard, this flag disables the blocklisting of the WebContent/Network processes in RunningBoard so that RunningBoard can now set the priority of those processes (instead of us boosting our priority via boost messages). * GPUProcess/EntryPoint/Cocoa/XPCService/GPUService/Info-iOS.plist: * NetworkProcess/EntryPoint/Cocoa/XPCService/NetworkService/Info-iOS.plist: * WebAuthnProcess/EntryPoint/Cocoa/XPCService/WebAuthnService/Info-iOS.plist: * WebProcess/EntryPoint/Cocoa/XPCService/WebContentService/Info-iOS.plist: Set _ProcessType=App so that RunningBoard is able to set the priority of our XPC services on iOS. Without this change, we get a permission denied when RunningBoard attempts to set the priority of our XPC services. * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::shouldLeakBoost): Stop leaking a boost message on iOS when RUNNINGBOARD_WEBKIT_PRIORITY_SUPPORT compile-time flag is enabled and when the RB_full_manage_WK_jetsam feature flag is enabled. Source/WTF: Add new RUNNINGBOARD_WEBKIT_PRIORITY_SUPPORT build time flag since we need a recent enough build of RunningBoard to do this. * wtf/PlatformHave.h: Canonical link: https://commits.webkit.org/232785@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271189 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-06 03:24:49 +00:00
#if ((PLATFORM(IOS) || PLATFORM(MACCATALYST)) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 150000) \
|| (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 80000) \
|| (PLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 150000)
#define HAVE_RUNNINGBOARD_WEBKIT_PRIORITY_SUPPORT 1
#endif
// FIXME: This should include PLATFORM(MACCATALYST) but our internal bots have not updated enough yet.
// Try again when they do. See rdar://problem/73940814
#if PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 150000
#define HAVE_UI_EVENT_ATTRIBUTION 1
#endif
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 120000) \
|| ((PLATFORM(IOS) || PLATFORM(MACCATALYST)) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 150000) \
|| (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 80000) \
|| (PLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 150000)
#define HAVE_NETWORK_LOADER 1
#define HAVE_SEC_TRUST_COPY_CERTIFICATE_CHAIN 1
#endif
Text copied and pasted from Mac Catalyst apps appears larger than expected https://bugs.webkit.org/show_bug.cgi?id=215971 <rdar://problem/65768907> 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 <rdar://problem/68524148>. Source/WTF: Add a new flag to guard the presence of `_UIApplicationCatalystUserInterfaceIdiom`, `_UIApplicationCatalystScaleFactor`, and `_UIApplicationCatalystRequestViewServiceIdiomAndScaleFactor`. * wtf/PlatformHave.h: Canonical link: https://commits.webkit.org/229163@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266802 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-09-09 22:19:10 +00:00
#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 >= 140000
#define HAVE_PENCILKIT_TEXT_INPUT 1
#endif
[macCatalyst] should have CSS `hover: hover` and `pointer: fine` https://bugs.webkit.org/show_bug.cgi?id=225672 Reviewed by Tim Horton. Source/WebKit: Test: iOSMouseSupport.MouseAlwaysConnected * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::isMousePrimaryPointingDevice): Added. (WebKit::hasAccessoryMousePointingDevice): Added. (WebKit::hasAccessoryStylusPointingDevice): Added. (WebKit::WebPage::hoverSupportedByPrimaryPointingDevice const): (WebKit::WebPage::hoverSupportedByAnyAvailablePointingDevice const): (WebKit::WebPage::pointerCharacteristicsOfPrimaryPointingDevice const): (WebKit::WebPage::pointerCharacteristicsOfAllAvailablePointingDevices const): (WebKit::hasMouseDevice): Deleted. macCatalyst should consider the mouse as the primary pointing device, just like macOS: - `hover` and `any-hover` should always be `hover` - `pointer` and `any-pointer` should always be `fine` (instead of only if an accessory mouse/stylus is connected) * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::notifyHasMouseDeviceChanged): Added. (WebKit::WebProcessProxy::notifyHasStylusDeviceChanged): * UIProcess/ios/WebProcessProxyIOS.mm: (WebKit::WebProcessProxy::platformInitialize): (WebKit::WebProcessProxy::platformDestroy): (WebKit::WebProcessProxy::notifyHasMouseDeviceChanged): Deleted. * UIProcess/ios/WKMouseDeviceObserver.h: * UIProcess/ios/WKMouseDeviceObserver.mm: * Shared/WebProcessCreationParameters.h: * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * WebProcess/WebProcess.messages.in: * WebProcess/WebProcess.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): Clean up macro usage to avoid unnecessary work on macCatalyst. Drive-by: Move non-platform code to non-platform files. Source/WTF: * wtf/PlatformHave.h: Add `HAVE_MOUSE_DEVICE_OBSERVATION` and `HAVE_STYLUS_DEVICE_OBSERVATION` to make callsites clearer instead of having a somewhat unrelated connection to `HAVE_UIKIT_WITH_MOUSE_SUPPORT` and `HAVE_PENCILKIT_TEXT_INPUT` (not to mention both of them are `PLATFORM(MACCATALYST)` which isn't desirable since macCatalyst should consider the mouse as the primary pointing device, just like macOS). Tools: * TestWebKitAPI/Tests/WebKitCocoa/iOSMouseSupport.mm: (TEST.iOSMouseSupport.MouseAlwaysConnected): * TestWebKitAPI/Tests/WebKitCocoa/iOSStylusSupport.mm: Canonical link: https://commits.webkit.org/237612@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277354 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-12 03:55:46 +00:00
#if PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000
#define HAVE_STYLUS_DEVICE_OBSERVATION 1
#endif
#if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000 || PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000)
#if !defined(HAVE_APPLE_ATTESTATION)
#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
#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 120000
#if !defined(HAVE_SPEECHSYNTHESIS_MONTEREY_SPI)
#define HAVE_SPEECHSYNTHESIS_MONTEREY_SPI 1
#endif
#endif
#if PLATFORM(COCOA)
#if !defined(HAVE_CG_CONTEXT_DRAW_PATH_DIRECT)
#define HAVE_CG_CONTEXT_DRAW_PATH_DIRECT 1
#endif
#endif
[Contact Picker API] Add support for picker UI on iOS https://bugs.webkit.org/show_bug.cgi?id=218189 <rdar://problem/69862277> Reviewed by Devin Rousso. Source/WebKit: ContactsManager.select() should present a contact picker on platforms which support one. This patch enables the end-to-end functionality on iOS, presenting a contact picker upon a call to the API and returning the selected contacts upon dismissal. Tests: contact-picker/contacts-select-after-dismissing-picker.html contact-picker/contacts-select-while-presenting-picker.html contact-picker/contacts-select.html * Platform/spi/Cocoa/ContactsUISPI.h: Added. * SourcesCocoa.txt: * UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h: * UIProcess/API/Cocoa/WKWebViewTesting.mm: (-[WKWebView _didPresentContactPicker]): (-[WKWebView _didDismissContactPicker]): (-[WKWebView _dismissContactPickerWithContacts:]): * UIProcess/Cocoa/WKContactPicker.h: Added. * UIProcess/Cocoa/WKContactPicker.mm: Added. WKContactPicker is a WebKit wrapper around CNContactPickerViewController. (-[WKCNContactPickerDelegate initWithContactPickerDelegate:]): WKCNContactPickerDelegate is wrapper around CNContactPickerDelegate. This is necessary as single/multiple selection in a CNContactPickerViewController is determined by which delegate methods are implemented. The two specializations of this class include the methods necessary to present a single-select and multi-select picker respectively. (-[WKCNContactPickerDelegate contactPickerDidCancel:]): (-[WKCNContactPickerSingleSelectDelegate contactPicker:didSelectContact:]): (-[WKCNContactPickerMultiSelectDelegate contactPicker:didSelectContacts:]): (-[WKContactPicker delegate]): (-[WKContactPicker setDelegate:]): (-[WKContactPicker initWithView:]): (-[WKContactPicker presentWithRequestData:completionHandler:]): (-[WKContactPicker contactPickerDidCancel:]): This delegate method is called when the picker is dismissed by tapping the done button or when the picker is dismissed by swiping down. (-[WKContactPicker contactPicker:didSelectContact:]): (-[WKContactPicker contactPicker:didSelectContacts:]): (-[WKContactPicker _contactPickerDidDismissWithContactInfo:]): (-[WKContactPicker _contactInfoFromCNContact:]): (-[WKContactPicker dismissWithContacts:]): (-[WKContactPicker _contactsFromJSContacts:]): * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::showContactPicker): * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _showContactPicker:completionHandler:]): (-[WKContentView contactPickerDidPresent:]): (-[WKContentView contactPickerDidDismiss:]): (-[WKContentView _dismissContactPickerWithContacts:]): * WebKit.xcodeproj/project.pbxproj: Source/WTF: * wtf/PlatformHave.h: Added HAVE(CONTACTSUI) and HAVE(CNCONTACTPICKERVIEWCONTROLLER) macros. Tools: Added UIScriptController hooks to observe the presentation and dismissal of a contact picker. Furthermore, the dismissContactPickerWithContacts method was added to allow tests to dismiss the presented contact picker with a set of selected contacts. * TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl: * TestRunnerShared/UIScriptContext/UIScriptContext.h: * TestRunnerShared/UIScriptContext/UIScriptController.h: (WTR::UIScriptController::isShowingContactPicker const): (WTR::UIScriptController::dismissContactPickerWithContacts): * TestRunnerShared/UIScriptContext/UIScriptControllerShared.cpp: (WTR::UIScriptController::setDidShowContactPickerCallback): (WTR::UIScriptController::didShowContactPickerCallback const): (WTR::UIScriptController::setDidHideContactPickerCallback): (WTR::UIScriptController::didHideContactPickerCallback const): * WebKitTestRunner/cocoa/TestRunnerWKWebView.h: * WebKitTestRunner/cocoa/TestRunnerWKWebView.mm: (-[TestRunnerWKWebView resetInteractionCallbacks]): (-[TestRunnerWKWebView _didPresentContactPicker]): (-[TestRunnerWKWebView _didDismissContactPicker]): * WebKitTestRunner/cocoa/UIScriptControllerCocoa.h: * WebKitTestRunner/cocoa/UIScriptControllerCocoa.mm: (WTR::UIScriptControllerCocoa::setDidShowContactPickerCallback): (WTR::UIScriptControllerCocoa::setDidHideContactPickerCallback): (WTR::UIScriptControllerCocoa::isShowingContactPicker const): (WTR::UIScriptControllerCocoa::dismissContactPickerWithContacts): LayoutTests: Added tests to verify the presentation and dismissal of a contact picker on iOS. The new tests are only run on iOS WK2, since that is the only platform which currently supports the presentation of a contact picker. Note that these tests will be enabled on macOS WK2 once support is added in a forthcoming patch. * TestExpectations: * contact-picker/contacts-select-after-dismissing-picker-expected.txt: Added. * contact-picker/contacts-select-after-dismissing-picker.html: Added. * contact-picker/contacts-select-expected.txt: Added. * contact-picker/contacts-select-while-presenting-picker-expected.txt: Added. * contact-picker/contacts-select-while-presenting-picker.html: Added. * contact-picker/contacts-select.html: Added. * platform/ios-wk2/TestExpectations: * resources/ui-helper.js: (window.UIHelper.waitForContactPickerToShow): (window.UIHelper.waitForContactPickerToHide): (window.UIHelper.dismissContactPickerWithContacts): Canonical link: https://commits.webkit.org/231232@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269394 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-11-04 22:36:46 +00:00
#if PLATFORM(COCOA) && !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
#define HAVE_CONTACTSUI 1
#endif
#if PLATFORM(IOS_FAMILY) && !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
#define HAVE_CNCONTACTPICKERVIEWCONTROLLER 1
#endif
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000) \
|| ((PLATFORM(IOS) || PLATFORM(MACCATALYST)) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000) \
|| (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 70000) \
|| (PLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 140000)
#define HAVE_AVOUTPUTDEVICE_SPATIALAUDIO 1
#endif
Implement basic permission check for SpeechRecognition https://bugs.webkit.org/show_bug.cgi?id=218476 <rdar://problem/71222638> Reviewed by Youenn Fablet. Source/WebCore: Tests: fast/speechrecognition/permission-error.html fast/speechrecognition/start-recognition-in-removed-iframe.html * Modules/speech/SpeechRecognition.cpp: (WebCore::SpeechRecognition::startRecognition): * Modules/speech/SpeechRecognitionConnection.h: * Modules/speech/SpeechRecognitionRequest.cpp: (WebCore::SpeechRecognitionRequest::create): Deleted. * Modules/speech/SpeechRecognitionRequest.h: (WebCore::SpeechRecognitionRequest::clientOrigin const): * Modules/speech/SpeechRecognitionRequestInfo.h: (WebCore::SpeechRecognitionRequestInfo::encode const): (WebCore::SpeechRecognitionRequestInfo::decode): * Modules/speech/SpeechRecognitionUpdate.cpp: (WebCore::SpeechRecognitionUpdate::create): (WebCore::SpeechRecognitionUpdate::error const): (WebCore::SpeechRecognitionUpdate::result const): * Modules/speech/SpeechRecognitionUpdate.h: * page/DummySpeechRecognitionProvider.h: Source/WebKit: Introduce SpeechRecognitionPermissionManager, which checks and requests speech recognition permissions before we actually start capturing audio and perform recognition. SpeechRecognitionPermissionManager is per-page, like SpeechRecognitionServer. The checks include: 1. Sandbox requirement for microphone 2. TCC check for microphone 3. TCC check for SFSpeechRecognizer 4. User permission on speech recognition for origin Add a delegate function for requesting user permission. By default, user permission is not granted. API test: WebKit2.SpeechRecognitionUserPermissionPersistence * Headers.cmake: * Shared/API/APIObject.h: * Shared/API/c/WKBase.h: * Sources.txt: * SourcesCocoa.txt: * UIProcess/API/APIUIClient.h: (API::UIClient::decidePolicyForSpeechRecognitionPermissionRequest): * UIProcess/API/C/WKAPICast.h: * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/API/C/WKPageUIClient.h: * UIProcess/API/C/WKSpeechRecognitionPermissionCallback.cpp: Added. (WKSpeechRecognitionPermissionCallbackGetTypeID): (WKSpeechRecognitionPermissionCallbackComplete): * UIProcess/API/C/WKSpeechRecognitionPermissionCallback.h: Added. * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _speechRecognitionEnabled]): (-[WKPreferences _setSpeechRecognitionEnabled:]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/MediaPermissionUtilities.mm: Added. (WebKit::checkSandboxRequirementForType): (WebKit::checkUsageDescriptionStringForType): (WebKit::checkUsageDescriptionStringForSpeechRecognition): (WebKit::requestAVCaptureAccessForType): (WebKit::checkAVCaptureAccessForType): (WebKit::requestSpeechRecognitionAccess): (WebKit::checkSpeechRecognitionServiceAccess): * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::decidePolicyForSpeechRecognitionPermissionRequest): * UIProcess/Cocoa/UserMediaPermissionRequestManagerProxy.mm: (WebKit::UserMediaPermissionRequestManagerProxy::permittedToCaptureAudio): (WebKit::UserMediaPermissionRequestManagerProxy::permittedToCaptureVideo): (WebKit::UserMediaPermissionRequestManagerProxy::requestSystemValidation): (WebKit::requestAVCaptureAccessForMediaType): Deleted. * UIProcess/Cocoa/WebProcessProxyCocoa.mm: * UIProcess/MediaPermissionUtilities.h: Copied from Added. * UIProcess/SpeechRecognitionPermissionManager.cpp: Added. (WebKit::computeMicrophoneAccess): (WebKit::computeSpeechRecognitionServiceAccess): (WebKit::SpeechRecognitionPermissionManager::SpeechRecognitionPermissionManager): (WebKit::SpeechRecognitionPermissionManager::~SpeechRecognitionPermissionManager): (WebKit::SpeechRecognitionPermissionManager::request): (WebKit::SpeechRecognitionPermissionManager::startNextRequest): (WebKit::SpeechRecognitionPermissionManager::startProcessingRequest): (WebKit::SpeechRecognitionPermissionManager::continueProcessingRequest): (WebKit::SpeechRecognitionPermissionManager::completeCurrentRequest): (WebKit::SpeechRecognitionPermissionManager::requestSpeechRecognitionServiceAccess): (WebKit::SpeechRecognitionPermissionManager::requestMicrophoneAccess): (WebKit::SpeechRecognitionPermissionManager::requestUserPermission): * UIProcess/SpeechRecognitionPermissionManager.h: Added. * UIProcess/SpeechRecognitionPermissionRequest.h: Added. (WebKit::SpeechRecognitionPermissionRequest::create): (WebKit::SpeechRecognitionPermissionRequest::complete): (WebKit::SpeechRecognitionPermissionRequest::origin const): (WebKit::SpeechRecognitionPermissionRequest::SpeechRecognitionPermissionRequest): (WebKit::SpeechRecognitionPermissionCallback::create): (WebKit::SpeechRecognitionPermissionCallback::complete): (WebKit::SpeechRecognitionPermissionCallback::SpeechRecognitionPermissionCallback): * UIProcess/SpeechRecognitionServer.cpp: (WebKit::SpeechRecognitionServer::SpeechRecognitionServer): (WebKit::SpeechRecognitionServer::start): (WebKit::SpeechRecognitionServer::requestPermissionForRequest): (WebKit::SpeechRecognitionServer::stop): (WebKit::SpeechRecognitionServer::abort): (WebKit::SpeechRecognitionServer::invalidate): (WebKit::SpeechRecognitionServer::handleRequest): (WebKit::SpeechRecognitionServer::stopRequest): (WebKit::SpeechRecognitionServer::abortRequest): (WebKit::SpeechRecognitionServer::sendUpdate): (WebKit::SpeechRecognitionServer::processNextPendingRequestIfNeeded): Deleted. (WebKit::SpeechRecognitionServer::removePendingRequest): Deleted. (WebKit::SpeechRecognitionServer::startPocessingRequest): Deleted. (WebKit::SpeechRecognitionServer::stopProcessingRequest): Deleted. * UIProcess/SpeechRecognitionServer.h: * UIProcess/SpeechRecognitionServer.messages.in: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didChangeMainDocument): (WebKit::WebPageProxy::resetState): (WebKit::WebPageProxy::requestSpeechRecognitionPermission): * UIProcess/WebPageProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::createSpeechRecognitionServer): * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebSpeechRecognitionConnection.cpp: (WebKit::WebSpeechRecognitionConnection::start): (WebKit::WebSpeechRecognitionConnection::didReceiveUpdate): * WebProcess/WebCoreSupport/WebSpeechRecognitionConnection.h: Source/WTF: * wtf/PlatformHave.h: Tools: * MiniBrowser/mac/Info.plist: * MobileMiniBrowser/MobileMiniBrowser/Info.plist: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WebKitCocoa/SpeechRecognition.mm: Added. (-[SpeechRecognitionPermissionUIDelegate _webView:requestSpeechRecognitionPermissionForOrigin:decisionHandler:]): (-[SpeechRecognitionMessageHandler userContentController:didReceiveScriptMessage:]): (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKitCocoa/speechrecognition-user-permission-persistence.html: Added. * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: * WebKitTestRunner/InjectedBundle/TestRunner.cpp: (WTR::TestRunner::setIsSpeechRecognitionPermissionGranted): * WebKitTestRunner/InjectedBundle/TestRunner.h: * WebKitTestRunner/TestController.cpp: (WTR::decidePolicyForSpeechRecognitionPermissionRequest): (WTR::TestController::completeSpeechRecognitionPermissionCheck): (WTR::TestController::setIsSpeechRecognitionPermissionGranted): (WTR::TestController::createWebViewWithOptions): (WTR::TestController::resetStateToConsistentValues): * WebKitTestRunner/TestController.h: * WebKitTestRunner/TestInvocation.cpp: (WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle): LayoutTests: * TestExpectations: * fast/speechrecognition/permission-error-expected.txt: Added. * fast/speechrecognition/permission-error.html: Added. * fast/speechrecognition/resources/removed-iframe.html: Added. * fast/speechrecognition/start-recognition-in-removed-iframe-expected.txt: Added. * fast/speechrecognition/start-recognition-in-removed-iframe.html: Added. * platform/wk2/TestExpectations: Canonical link: https://commits.webkit.org/231575@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269810 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-11-14 02:16:49 +00:00
#if PLATFORM(IOS) || PLATFORM(MACCATALYST) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500)
#define HAVE_SPEECHRECOGNIZER 1
#endif
#if PLATFORM(IOS) || PLATFORM(MACCATALYST) || PLATFORM(MAC)
#define HAVE_AVCAPTUREDEVICE 1
#endif
#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED > 110000 && defined __has_include && __has_include(<CoreFoundation/CFPriv.h>)
#define HAVE_SANDBOX_MESSAGE_FILTERING 1
#endif
#if (PLATFORM(IOS) && !PLATFORM(IOS_FAMILY_SIMULATOR)) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000)
#define HAVE_COREVIDEO_COMPRESSED_PIXEL_FORMAT_TYPES 1
#endif
#if PLATFORM(IOS_FAMILY)
#define HAVE_APPLE_LOW_POWER_MODE_SUPPORT 1
#endif
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 110200) \
|| (PLATFORM(IOS) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 140400) \
|| (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MAX_ALLOWED >= 70300) \
|| (PLATFORM(APPLETV) && __TV_OS_VERSION_MAX_ALLOWED >= 140400)
#define HAVE_LIBXSLT_FIX_FOR_RADAR_71864140 1
#endif
#if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 140400)
#define HAVE_ASC_AUTH_UI 1
#endif
#if PLATFORM(MAC)
#if !defined(HAVE_MT_PLUGIN_FORMAT_READER)
#define HAVE_MT_PLUGIN_FORMAT_READER 1
#endif
#endif
Source/ThirdParty/libwebrtc: [Mac] Create a MediaToolbox format reader plug-in for WebM https://bugs.webkit.org/show_bug.cgi?id=218908 <rdar://problem/71373264> Reviewed by Eric Carlson. * Source/webrtc/sdk/WebKit/CMBaseObjectSPI.h: Source/WebCore: [Mac] Create a MediaToolbox format reader plug-in for WebM https://bugs.webkit.org/show_bug.cgi?id=218908 <rdar://problem/71373264> Reviewed by Eric Carlson. Updated expected results for existing tests. For contiguous samples, teach MediaSample to remember their position and size in the underlying byte stream. Added a runtime feature flag. Registered the format reader plug-in at runtime. * page/RuntimeEnabledFeatures.h: * platform/MediaSample.h: * platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm: * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h: * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm: * platform/graphics/cocoa/SourceBufferParser.cpp: * platform/graphics/cocoa/SourceBufferParser.h: * platform/graphics/cocoa/SourceBufferParserWebM.cpp: * platform/graphics/cocoa/SourceBufferParserWebM.h: * platform/graphics/gstreamer/MediaSampleGStreamer.h: * platform/mock/mediasource/MockSourceBufferPrivate.cpp: * platform/network/mac/WebCoreURLResponse.mm: Source/WebCore/PAL: [Mac] Create a MediaToolbox format reader plug-in for WebM https://bugs.webkit.org/show_bug.cgi?id=218908 <rdar://problem/71373264> Reviewed by Eric Carlson. * pal/cf/CoreMediaSoftLink.cpp: * pal/cf/CoreMediaSoftLink.h: * pal/cocoa/MediaToolboxSoftLink.cpp: * pal/cocoa/MediaToolboxSoftLink.h: * pal/spi/cf/CoreMediaSPI.h: * pal/spi/cocoa/MediaToolboxSPI.h: Source/WebKit: [Mac] Create a MediaToolbox format reader plug-in for WebM https://bugs.webkit.org/show_bug.cgi?id=218908 <rdar://problem/71373264> Reviewed by Eric Carlson. Implemented a MTPluginFormatReader for WebM containers. The format reader is responsible for parsing a WebM byte stream (using SourceBufferParserWebM) into audio, video, and text tracks. MediaToolbox can then create cursors to step through the tracks' samples in decode or presentation order and access each sample's metadata (e.g., format description, duration, key-frame status) and location in the byte stream. * FeatureFlags/WebKit.plist: * MediaFormatReaderPlugIn/Info.plist: * MediaFormatReaderPlugIn/MediaFormatReaderPlugIn.cpp: * Shared/API/c/mac/WKFormatReader.cpp: Added. * Shared/API/c/mac/WKFormatReader.h: Added. * Shared/WebPreferencesDefaultValues.cpp: * Shared/WebPreferencesDefaultValues.h: * Shared/mac/MediaFormatReader/CoreMediaWrapped.cpp: Added. * Shared/mac/MediaFormatReader/CoreMediaWrapped.h: Added. * Shared/mac/MediaFormatReader/FormatReader.cpp: Added. * Shared/mac/MediaFormatReader/FormatReader.h: Added. * Shared/mac/MediaFormatReader/MediaFormatReader.cpp: Added. * Shared/mac/MediaFormatReader/MediaFormatReader.h: Added. * Shared/mac/MediaFormatReader/SampleCursor.cpp: Added. * Shared/mac/MediaFormatReader/SampleCursor.h: Added. * Shared/mac/MediaFormatReader/TrackReader.cpp: Added. * Shared/mac/MediaFormatReader/TrackReader.h: Added. * SourcesCocoa.txt: * WebKit.xcodeproj/project.pbxproj: Source/WTF: [Mac] Register the format reader plug-in for WebM content types https://bugs.webkit.org/show_bug.cgi?id=218908 <rdar://problem/71373264> Reviewed by Eric Carlson. * Scripts/Preferences/WebPreferencesExperimental.yaml: Added an experimental web preference. Tools: [Mac] Create a MediaToolbox format reader plug-in for WebM https://bugs.webkit.org/show_bug.cgi?id=218908 <rdar://problem/71373264> Reviewed by Eric Carlson. * TestWebKitAPI/Tests/WebCore/SampleMap.cpp: LayoutTests: [Mac] Create a MediaToolbox format reader plug-in for WebM https://bugs.webkit.org/show_bug.cgi?id=218908 <rdar://problem/71373264> Reviewed by Eric Carlson. * platform/mac-catalina/imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/mime-types/canPlayType-expected.txt: * platform/mac-catalina/media/media-can-play-webm-expected.txt: * platform/mac-wk2/imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/mime-types/canPlayType-expected.txt: * platform/mac-wk2/media/media-can-play-webm-expected.txt: Canonical link: https://commits.webkit.org/232421@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270758 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-12-14 03:38:59 +00:00
#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 110300
#if !defined(HAVE_MT_PLUGIN_SAMPLE_CURSOR_PLAYABLE_HORIZON)
#define HAVE_MT_PLUGIN_SAMPLE_CURSOR_PLAYABLE_HORIZON 1
#endif
#endif
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 110200) \
|| (PLATFORM(IOS) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 140400)
#define HAVE_AVCONTENTKEYREQUEST_PENDING_PROTECTION_STATUS 1
#endif
[macOS] Titlebar separator doesn't show when WKWebView is scrolled https://bugs.webkit.org/show_bug.cgi?id=220633 <rdar://problem/71094055> Reviewed by Tim Horton. Source/WebKit: Starting in Big Sur, NSWindows with a titlebar display a separator if there is a scrolled NSScrollView adjacent to the titlebar. Since WKWebViews are scrollable views, but not backed by NSScrollView, we need to adopt SPI to support this functionality. This patch updates WKWebView to conform to the NSScrollViewSeparatorTrackingAdapter protocol, ensuring the titlebar separator is displayed when necessary. Note that since WKWebViews are not actually NSScrollView's we don't already have the scroll position of the view in the UIProcess. To determine whether or not the view is scrolled, this patch adds plumbing so that the WebProcess can tell the UIProcess the new scroll position when a page is scrolled. Tests: WKWebViewTitlebarSeparatorTests.BackForwardCache WKWebViewTitlebarSeparatorTests.ChangeTitlebarAdjacency WKWebViewTitlebarSeparatorTests.ChangeViewVisibility WKWebViewTitlebarSeparatorTests.NavigationResetsTitlebarAppearance WKWebViewTitlebarSeparatorTests.ScrollWithTitlebarAdjacency WKWebViewTitlebarSeparatorTests.ScrollWithoutTitlebarAdjacency * Platform/spi/mac/AppKitSPI.h: * UIProcess/API/mac/WKView.mm: (-[WKView scrollViewFrame]): (-[WKView hasScrolledContentsUnderTitlebar]): (-[WKView _web_registerScrollViewSeparatorTrackingAdapter]): (-[WKView _web_unregisterScrollViewSeparatorTrackingAdapter]): * UIProcess/API/mac/WKWebViewMac.mm: (-[WKWebView scrollViewFrame]): (-[WKWebView hasScrolledContentsUnderTitlebar]): (-[WKWebView _web_registerScrollViewSeparatorTrackingAdapter]): (-[WKWebView _web_unregisterScrollViewSeparatorTrackingAdapter]): * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::updateWindowAndViewFrames): If the WKWebView's frame changes, update the titlebar adjacency state and notify observers of the change. (WebKit::WebViewImpl::viewWillMoveToWindowImpl): Unregister the WKWebView as an NSScrollViewSeparatorTrackingAdapter if it is removed from the window. (WebKit::WebViewImpl::viewDidHide): Hidden views are not adjacent to the titlebar. (WebKit::WebViewImpl::viewDidUnhide): An unhidden view may be adjacent to the titlebar. (WebKit::WebViewImpl::pageDidScroll): Use the scroll position of the page to determine whether or not the WKWebView is scrolled. (WebKit::WebViewImpl::scrollViewFrame): Needed to conform to NSScrollViewSeparatorTrackingAdapter. (WebKit::WebViewImpl::hasScrolledContentsUnderTitlebar): Needed to conform to NSScrollViewSeparatorTrackingAdapter. Returns true if the view is registered as an NSScrollViewSeparatorTrackingAdapter and is scrolled. (WebKit::WebViewImpl::updateTitlebarAdjacencyState): The WKWebView needs to be registered as an NSScrollViewSeparatorTrackingAdapter if it's adjacent to the titlebar and unregistered otherwise. * UIProcess/PageClient.h: (WebKit::PageClient::pageDidScroll): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::pageDidScroll): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/mac/PageClientImplMac.h: * UIProcess/mac/PageClientImplMac.mm: (WebKit::PageClientImpl::didCommitLoadForMainFrame): Reset the scroll position upon navigation, as pageDidScroll does not get called when navigating. (WebKit::PageClientImpl::pageDidScroll): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::pageDidScroll): Pass the current scroll position when the page is scrolled, so that the UIProcess knows whether or not the page has a non-zero scroll position. Source/WTF: * wtf/PlatformHave.h: Defined HAVE_NSSCROLLVIEW_SEPARATOR_TRACKING_ADAPTER. Tools: Added API tests to verify that the delegate implementation returns the correct value for `hasScrolledContentsUnderTitlebar` depending on the view's scroll position, visibility, and frame. * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/TestWebKitAPI/mac/AppKitSPI.h: * TestWebKitAPI/Tests/mac/WKWebViewTitlebarSeparatorTests.mm: Added. (-[TitlebarSeparatorTestWKWebView initWithFrame:configuration:]): (-[TitlebarSeparatorTestWKWebView separatorTrackingAdapter]): (BackForwardCache): (ChangeTitlebarAdjacency): (ChangeViewVisibility): (NavigationResetsTitlebarAppearance): (ScrollWithTitlebarAdjacency): (ScrollWithoutTitlebarAdjacency): Canonical link: https://commits.webkit.org/233200@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-21 15:47:16 +00:00
Add experimental support for separated layers https://bugs.webkit.org/show_bug.cgi?id=220734 Reviewed by Simon Fraser. Source/WebCore: Plumb a "separated" bit through the graphics layer infrastructure. Currently unused but will be used for optimization experimentation. * platform/graphics/GraphicsLayer.cpp: (WebCore::GraphicsLayer::GraphicsLayer): * platform/graphics/GraphicsLayer.h: (WebCore::GraphicsLayer::separated const): (WebCore::GraphicsLayer::setSeparated): * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::setSeparated): (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): (WebCore::GraphicsLayerCA::updateSeparated): * platform/graphics/ca/GraphicsLayerCA.h: * platform/graphics/ca/PlatformCALayer.h: * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h: * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: (WebCore::PlatformCALayerCocoa::separated const): (WebCore::PlatformCALayerCocoa::setSeparated): Source/WebCore/PAL: * pal/spi/cocoa/QuartzCoreSPI.h: Add forward declaration for CALayer's separated property. Source/WebKit: Plumb a "separated" bit through the graphics layer infrastructure. Currently unused but will be used for optimization experimentation. * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm: (WebKit::RemoteLayerTreePropertyApplier::applyPropertiesToLayer): * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h: * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm: (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties): (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode const): (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode): (WebKit::dumpChangedLayers): * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::isSeparated const): (WebKit::PlatformCALayerRemote::setSeparated): * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h: Source/WTF: * wtf/PlatformHave.h: Define HAVE_CORE_ANIMATION_SEPARATED_LAYERS for supported configurations. Canonical link: https://commits.webkit.org/233208@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271699 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-21 18:39:58 +00:00
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000) \
|| ((PLATFORM(IOS) || PLATFORM(MACCATALYST)) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000)
Add experimental support for separated layers https://bugs.webkit.org/show_bug.cgi?id=220734 Reviewed by Simon Fraser. Source/WebCore: Plumb a "separated" bit through the graphics layer infrastructure. Currently unused but will be used for optimization experimentation. * platform/graphics/GraphicsLayer.cpp: (WebCore::GraphicsLayer::GraphicsLayer): * platform/graphics/GraphicsLayer.h: (WebCore::GraphicsLayer::separated const): (WebCore::GraphicsLayer::setSeparated): * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::setSeparated): (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): (WebCore::GraphicsLayerCA::updateSeparated): * platform/graphics/ca/GraphicsLayerCA.h: * platform/graphics/ca/PlatformCALayer.h: * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h: * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: (WebCore::PlatformCALayerCocoa::separated const): (WebCore::PlatformCALayerCocoa::setSeparated): Source/WebCore/PAL: * pal/spi/cocoa/QuartzCoreSPI.h: Add forward declaration for CALayer's separated property. Source/WebKit: Plumb a "separated" bit through the graphics layer infrastructure. Currently unused but will be used for optimization experimentation. * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm: (WebKit::RemoteLayerTreePropertyApplier::applyPropertiesToLayer): * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h: * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm: (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties): (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode const): (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode): (WebKit::dumpChangedLayers): * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::isSeparated const): (WebKit::PlatformCALayerRemote::setSeparated): * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h: Source/WTF: * wtf/PlatformHave.h: Define HAVE_CORE_ANIMATION_SEPARATED_LAYERS for supported configurations. Canonical link: https://commits.webkit.org/233208@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271699 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-21 18:39:58 +00:00
#if !defined(HAVE_CORE_ANIMATION_SEPARATED_LAYERS)
#define HAVE_CORE_ANIMATION_SEPARATED_LAYERS 1
Add stub implementation of CA separated portal bits for GraphicsLayer https://bugs.webkit.org/show_bug.cgi?id=226343 Reviewed by Simon Fraser. Source/WebCore: Plumbs isSeparatedPortal and isDescendentOfSeparatedPortal bits through GraphicsLayer. Renames setSeparated to setIsSeparated for consistency. Currently unused, but getting the bits in is big enough that its helpful to land on its own. * platform/graphics/GraphicsLayer.cpp: (WebCore::GraphicsLayer::GraphicsLayer): * platform/graphics/GraphicsLayer.h: (WebCore::GraphicsLayer::isIsSeparated const): (WebCore::GraphicsLayer::setIsSeparated): (WebCore::GraphicsLayer::isSeparatedPortal const): (WebCore::GraphicsLayer::setIsSeparatedPortal): (WebCore::GraphicsLayer::isDescendentOfSeparatedPortal const): (WebCore::GraphicsLayer::setIsDescendentOfSeparatedPortal): (WebCore::GraphicsLayer::isSeparated const): Deleted. (WebCore::GraphicsLayer::setSeparated): Deleted. * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::setIsSeparated): (WebCore::GraphicsLayerCA::setIsSeparatedPortal): (WebCore::GraphicsLayerCA::setIsDescendentOfSeparatedPortal): (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): (WebCore::GraphicsLayerCA::updateIsSeparated): (WebCore::GraphicsLayerCA::updateIsSeparatedPortal): (WebCore::GraphicsLayerCA::updateIsDescendentOfSeparatedPortal): (WebCore::GraphicsLayerCA::setSeparated): Deleted. (WebCore::GraphicsLayerCA::updateSeparated): Deleted. * platform/graphics/ca/GraphicsLayerCA.h: * platform/graphics/ca/PlatformCALayer.h: * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h: * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: (WebCore::PlatformCALayerCocoa::setIsSeparated): (WebCore::PlatformCALayerCocoa::isSeparatedPortal const): (WebCore::PlatformCALayerCocoa::setIsSeparatedPortal): (WebCore::PlatformCALayerCocoa::isDescendentOfSeparatedPortal const): (WebCore::PlatformCALayerCocoa::setIsDescendentOfSeparatedPortal): (WebCore::PlatformCALayerCocoa::setSeparated): Deleted. * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateGeometry): Source/WebKit: Plumbs isSeparatedPortal and isDescendentOfSeparatedPortal bits through GraphicsLayer. Renames setSeparated to setIsSeparated for consistency. Currently unused, but getting the bits in is big enough that its helpful to land on its own. * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm: (WebKit::RemoteLayerTreePropertyApplier::applyPropertiesToLayer): * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h: * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm: (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties): (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode const): (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode): (WebKit::dumpChangedLayers): (WebKit::RemoteLayerTreeTransaction::RemoteLayerTreeTransaction): Deleted. (WebKit::RemoteLayerTreeTransaction::~RemoteLayerTreeTransaction): Deleted. * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::setIsSeparated): (WebKit::PlatformCALayerRemote::isSeparatedPortal const): (WebKit::PlatformCALayerRemote::setIsSeparatedPortal): (WebKit::PlatformCALayerRemote::isDescendentOfSeparatedPortal const): (WebKit::PlatformCALayerRemote::setIsDescendentOfSeparatedPortal): (WebKit::PlatformCALayerRemote::setSeparated): Deleted. * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h: Source/WTF: * wtf/PlatformHave.h: Add HAVE_CORE_ANIMATION_SEPARATED_PORTALS. Canonical link: https://commits.webkit.org/238256@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278217 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-28 18:54:27 +00:00
#define HAVE_CORE_ANIMATION_SEPARATED_PORTALS 1
Add experimental support for separated layers https://bugs.webkit.org/show_bug.cgi?id=220734 Reviewed by Simon Fraser. Source/WebCore: Plumb a "separated" bit through the graphics layer infrastructure. Currently unused but will be used for optimization experimentation. * platform/graphics/GraphicsLayer.cpp: (WebCore::GraphicsLayer::GraphicsLayer): * platform/graphics/GraphicsLayer.h: (WebCore::GraphicsLayer::separated const): (WebCore::GraphicsLayer::setSeparated): * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::setSeparated): (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): (WebCore::GraphicsLayerCA::updateSeparated): * platform/graphics/ca/GraphicsLayerCA.h: * platform/graphics/ca/PlatformCALayer.h: * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h: * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: (WebCore::PlatformCALayerCocoa::separated const): (WebCore::PlatformCALayerCocoa::setSeparated): Source/WebCore/PAL: * pal/spi/cocoa/QuartzCoreSPI.h: Add forward declaration for CALayer's separated property. Source/WebKit: Plumb a "separated" bit through the graphics layer infrastructure. Currently unused but will be used for optimization experimentation. * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm: (WebKit::RemoteLayerTreePropertyApplier::applyPropertiesToLayer): * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h: * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm: (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties): (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode const): (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode): (WebKit::dumpChangedLayers): * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::isSeparated const): (WebKit::PlatformCALayerRemote::setSeparated): * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h: Source/WTF: * wtf/PlatformHave.h: Define HAVE_CORE_ANIMATION_SEPARATED_LAYERS for supported configurations. Canonical link: https://commits.webkit.org/233208@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271699 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-21 18:39:58 +00:00
#endif
#endif
font-stretch is not applied to system-ui https://bugs.webkit.org/show_bug.cgi?id=221103 <rdar://problem/73719139> Reviewed by Darin Adler. Source/WebCore: We just never hooked it up. Tests: fast/text/system-font-width-2.html fast/text/system-font-width-3.html fast/text/system-font-width-4.html fast/text/system-font-width-5.html fast/text/system-font-width-6.html fast/text/system-font-width-7.html fast/text/system-font-width-8.html fast/text/system-font-width-9.html fast/text/system-font-width.html * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp: (WebCore::SystemFontDatabaseCoreText::createSystemUIFont): (WebCore::SystemFontDatabaseCoreText::createSystemDesignFont): (WebCore::SystemFontDatabaseCoreText::createTextStyleFont): (WebCore::SystemFontDatabaseCoreText::createFontByApplyingWeightWidthItalicsAndFallbackBehavior): (WebCore::mapWeight): (WebCore::mapWidth): (WebCore::SystemFontDatabaseCoreText::systemFontParameters): (WebCore::SystemFontDatabaseCoreText::createFontByApplyingWeightItalicsAndFallbackBehavior): Deleted. * platform/graphics/cocoa/SystemFontDatabaseCoreText.h: (WebCore::SystemFontDatabaseCoreText::CascadeListParameters::operator== const): (WebCore::SystemFontDatabaseCoreText::CascadeListParameters::hash const): Source/WebCore/PAL: * pal/spi/cocoa/CoreTextSPI.h: Source/WTF: * wtf/PlatformHave.h: LayoutTests: * fast/text/system-font-width-2-expected-mismatch.html: Added. * fast/text/system-font-width-2.html: Added. * fast/text/system-font-width-3-expected-mismatch.html: Added. * fast/text/system-font-width-3.html: Added. * fast/text/system-font-width-4-expected-mismatch.html: Added. * fast/text/system-font-width-4.html: Added. * fast/text/system-font-width-5-expected.html: Added. * fast/text/system-font-width-5.html: Added. * fast/text/system-font-width-6-expected-mismatch.html: Added. * fast/text/system-font-width-6.html: Added. * fast/text/system-font-width-7-expected-mismatch.html: Added. * fast/text/system-font-width-7.html: Added. * fast/text/system-font-width-8-expected-mismatch.html: Added. * fast/text/system-font-width-8.html: Added. * fast/text/system-font-width-9-expected-mismatch.html: Added. * fast/text/system-font-width-9.html: Added. * fast/text/system-font-width-expected-mismatch.html: Added. * fast/text/system-font-width.html: Added. * platform/ios/TestExpectations: * platform/mac/TestExpectations: * platform/win/TestExpectations: Canonical link: https://commits.webkit.org/233492@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272073 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-29 20:19:59 +00:00
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 120000) \
|| ((PLATFORM(IOS) || PLATFORM(MACCATALYST)) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 150000) \
|| (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 80000) \
|| (PLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 150000)
#define HAVE_LEVEL_3_SYSTEM_FONT_WIDTH_VALUES 1
#elif (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000) \
|| ((PLATFORM(IOS) || PLATFORM(MACCATALYST)) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000) \
|| (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 70000) \
|| (PLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 140000)
#define HAVE_LEVEL_2_SYSTEM_FONT_WIDTH_VALUES 1
#endif
#if __has_include(<AVFoundation/AVPlayerInterstitialEventController.h>)
#if !defined(HAVE_AVFOUNDATION_INTERSTITIAL_EVENTS)
#define HAVE_AVFOUNDATION_INTERSTITIAL_EVENTS 1
#endif
#endif
Use HAVE(PEPPER_UI_CORE) instead of PLATFORM(WATCHOS) to guard code that uses PepperUICore https://bugs.webkit.org/show_bug.cgi?id=221679 Reviewed by Tim Horton. Source/WebKit: Use `HAVE(PEPPER_UI_CORE)` instead of `PLATFORM(WATCHOS)` in code that depends on PepperUICore, either directly or indirectly. While technically equivalent, the former is more semantically precise. Common examples of this include dependencies on Quickboard for text input, or PepperUICore category extensions on common UIKit classes (e.g. digital crown support in `WKScrollView.mm`). No change in behavior. Inspired by <https://bugs.webkit.org/show_bug.cgi?id=221649#c2>. * Platform/spi/watchos/PepperUICoreSPI.h: * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _willStartScrollingOrZooming]): (-[WKContentView _didEndScrollingOrZooming]): (-[WKContentView _updateTextInputTraits:]): (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:]): (-[WKContentView _elementDidBlur]): (-[WKContentView reloadContextViewForPresentedListViewController]): (-[WKContentView _wheelChangedWithEvent:]): (-[WKContentView _simulateTextEntered:]): (-[WKContentView selectFormAccessoryPickerRow:]): (-[WKContentView selectFormAccessoryHasCheckedItemAtRow:]): (-[WKContentView textContentTypeForTesting]): (-[WKContentView formInputLabel]): (-[WKContentView setTimePickerValueToHour:minute:]): * UIProcess/ios/WKScrollView.mm: (-[WKScrollView initWithFrame:]): * UIProcess/ios/forms/WKDatePickerViewController.h: * UIProcess/ios/forms/WKDatePickerViewController.mm: * UIProcess/ios/forms/WKFocusedFormControlView.h: * UIProcess/ios/forms/WKFocusedFormControlView.mm: * UIProcess/ios/forms/WKNumberPadView.h: * UIProcess/ios/forms/WKNumberPadView.mm: * UIProcess/ios/forms/WKNumberPadViewController.h: * UIProcess/ios/forms/WKNumberPadViewController.mm: * UIProcess/ios/forms/WKQuickboardListViewController.h: * UIProcess/ios/forms/WKQuickboardListViewController.mm: * UIProcess/ios/forms/WKSelectMenuListViewController.h: * UIProcess/ios/forms/WKSelectMenuListViewController.mm: * UIProcess/ios/forms/WKTextInputListViewController.h: * UIProcess/ios/forms/WKTextInputListViewController.mm: * UIProcess/ios/forms/WKTimePickerViewController.h: * UIProcess/ios/forms/WKTimePickerViewController.mm: Source/WTF: Add the `HAVE(PEPPER_UI_CORE)` compile-time flag. * wtf/PlatformHave.h: Tools: * WebKitTestRunner/cocoa/TestRunnerWKWebView.mm: (isQuickboardViewController): Canonical link: https://commits.webkit.org/233926@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272669 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-02-10 19:58:12 +00:00
#if PLATFORM(WATCHOS)
#define HAVE_PEPPER_UI_CORE 1
#endif
Returning sRGB from CG color space functions on failure is too error prone https://bugs.webkit.org/show_bug.cgi?id=221676 Reviewed by Darin Adler. Source/WebCore: * platform/graphics/cg/ColorCG.cpp: (WebCore::leakCGColor): Switch to checking for nullptr rather than sRGB and be explicit about where we can and cannot use conversion to ExtendedSRGB, rather than the old behavior where we would secretly use sRGB on platforms without ExtendedSRGB and expect CG to clamp for us. * platform/graphics/cg/ColorSpaceCG.cpp: (WebCore::sRGBColorSpaceRef): (WebCore::adobeRGB1998ColorSpaceRef): (WebCore::displayP3ColorSpaceRef): (WebCore::extendedSRGBColorSpaceRef): (WebCore::ITUR_2020ColorSpaceRef): (WebCore::labColorSpaceRef): (WebCore::linearSRGBColorSpaceRef): (WebCore::ROMMRGBColorSpaceRef): (WebCore::xyzColorSpaceRef): * platform/graphics/cg/ColorSpaceCG.h: (WebCore::cachedNullableCGColorSpace): (WebCore::cachedCGColorSpace): Rename cachedCGColorSpace to cachedNullableCGColorSpace to indicate that it can now return nullptr for unsupported color spaces. Add explicit guards around color space accessors to ensure they are only called on platforms where they are known to be supported. * platform/graphics/cg/GradientCG.cpp: (WebCore::Gradient::createCGGradient): Be explicit about which color space is being used for the gradien when extended colors are present. This is the same behavior as before, but previously it would happen silently beneath extendedSRGBColorSpaceRef() which is a suprising result. Source/WTF: * wtf/PlatformHave.h: Add specific macros for color spaces supported by Core Graphics. Canonical link: https://commits.webkit.org/233976@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272736 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-02-11 17:43:57 +00:00
#if PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 80000
#define HAVE_QUICKBOARD_CONTROLLER 1
#define HAVE_PUIC_BUTTON_TYPE_PILL 1
#endif
Returning sRGB from CG color space functions on failure is too error prone https://bugs.webkit.org/show_bug.cgi?id=221676 Reviewed by Darin Adler. Source/WebCore: * platform/graphics/cg/ColorCG.cpp: (WebCore::leakCGColor): Switch to checking for nullptr rather than sRGB and be explicit about where we can and cannot use conversion to ExtendedSRGB, rather than the old behavior where we would secretly use sRGB on platforms without ExtendedSRGB and expect CG to clamp for us. * platform/graphics/cg/ColorSpaceCG.cpp: (WebCore::sRGBColorSpaceRef): (WebCore::adobeRGB1998ColorSpaceRef): (WebCore::displayP3ColorSpaceRef): (WebCore::extendedSRGBColorSpaceRef): (WebCore::ITUR_2020ColorSpaceRef): (WebCore::labColorSpaceRef): (WebCore::linearSRGBColorSpaceRef): (WebCore::ROMMRGBColorSpaceRef): (WebCore::xyzColorSpaceRef): * platform/graphics/cg/ColorSpaceCG.h: (WebCore::cachedNullableCGColorSpace): (WebCore::cachedCGColorSpace): Rename cachedCGColorSpace to cachedNullableCGColorSpace to indicate that it can now return nullptr for unsupported color spaces. Add explicit guards around color space accessors to ensure they are only called on platforms where they are known to be supported. * platform/graphics/cg/GradientCG.cpp: (WebCore::Gradient::createCGGradient): Be explicit about which color space is being used for the gradien when extended colors are present. This is the same behavior as before, but previously it would happen silently beneath extendedSRGBColorSpaceRef() which is a suprising result. Source/WTF: * wtf/PlatformHave.h: Add specific macros for color spaces supported by Core Graphics. Canonical link: https://commits.webkit.org/233976@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272736 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-02-11 17:43:57 +00:00
#if PLATFORM(COCOA)
#define HAVE_CORE_GRAPHICS_ADOBE_RGB_1998_COLOR_SPACE 1
#define HAVE_CORE_GRAPHICS_DISPLAY_P3_COLOR_SPACE 1
#define HAVE_CORE_GRAPHICS_EXTENDED_SRGB_COLOR_SPACE 1
#define HAVE_CORE_GRAPHICS_ITUR_2020_COLOR_SPACE 1
#define HAVE_CORE_GRAPHICS_LINEAR_SRGB_COLOR_SPACE 1
#define HAVE_CORE_GRAPHICS_ROMMRGB_COLOR_SPACE 1
#define HAVE_CORE_GRAPHICS_XYZ_COLOR_SPACE 1
#endif
[macOS] Deny mach-lookup to the fonts service https://bugs.webkit.org/show_bug.cgi?id=221610 <rdar://problem/69168609> Reviewed by Brent Fulgham. Source/WebCore: Disable global font prewarming when the platform has a static font registry. Font prewarming will attempt to communicate with the font daemon. Since this usually will take place before the first page load where the decision about using the static registry is made, and this change by default blocks access to the font daemon, the system will automatically choose to use the static registry. This might be the wrong choice, and it is currently not possible to switch to not use the static registry at a later point. No new tests, covered by existing tests. * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::FontCache::prewarmGlobally): Source/WebKit: This change will by default block access to the font daemon when the platform has support for a static font registry. When the client prefers to allow user installed fonts, or Safari Reader configuration has been customized, access to the font daemon will still be allowed by issuing an extension to the font daemon. * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode const): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: * UIProcess/WebPageProxy.cpp: (WebKit::customizedReaderConfiguration): (WebKit::WebPageProxy::creationParameters): * WebProcess/WebPage/WebPage.cpp: (WebKit::m_limitsNavigationsToAppBoundDomains): (WebKit::WebPage::~WebPage): * WebProcess/WebPage/WebPage.h: * WebProcess/com.apple.WebProcess.sb.in: Source/WTF: Add HAVE define for platform static font registry. * wtf/PlatformHave.h: Canonical link: https://commits.webkit.org/234202@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272999 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-02-17 16:16:20 +00:00
#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 120000
#define HAVE_STATIC_FONT_REGISTRY 1
#define HAVE_DATA_DETECTORS_MAC_ACTION 1
[macOS] Titlebar separator doesn't show when WKWebView is scrolled https://bugs.webkit.org/show_bug.cgi?id=220633 <rdar://problem/71094055> Reviewed by Darin Adler. Source/WebKit: Starting in Big Sur, NSWindows with a titlebar display a separator if there is a scrolled NSScrollView adjacent to the titlebar. Since WKWebViews are scrollable views, but not backed by NSScrollView, we need to adopt SPI to support this functionality. This patch updates WKWebView to conform to the NSScrollViewSeparatorTrackingAdapter protocol, ensuring the titlebar separator is displayed when necessary. Note that since WKWebViews are not actually NSScrollView's we don't already have the scroll position of the view in the UIProcess. To determine whether or not the view is scrolled, this patch adds plumbing so that the WebProcess can tell the UIProcess the new scroll position when a page is scrolled. Tests: WKWebViewTitlebarSeparatorTests.BackForwardCache WKWebViewTitlebarSeparatorTests.ChangeTitlebarAdjacency WKWebViewTitlebarSeparatorTests.ChangeViewVisibility WKWebViewTitlebarSeparatorTests.NavigationResetsTitlebarAppearance WKWebViewTitlebarSeparatorTests.ParentWhileScrolled WKWebViewTitlebarSeparatorTests.ScrollWithTitlebarAdjacency WKWebViewTitlebarSeparatorTests.ScrollWithoutTitlebarAdjacency * Platform/spi/mac/AppKitSPI.h: * UIProcess/API/mac/WKView.mm: (-[WKView scrollViewFrame]): (-[WKView hasScrolledContentsUnderTitlebar]): * UIProcess/API/mac/WKWebViewMac.mm: (-[WKWebView scrollViewFrame]): (-[WKWebView hasScrolledContentsUnderTitlebar]): * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::updateWindowAndViewFrames): If the WKWebView's frame changes, update the titlebar adjacency state and notify observers of the change. (WebKit::WebViewImpl::viewWillMoveToWindowImpl): Unregister the WKWebView as an NSScrollViewSeparatorTrackingAdapter if it is removed from the window. (WebKit::WebViewImpl::viewDidHide): Hidden views are not adjacent to the titlebar. (WebKit::WebViewImpl::viewDidUnhide): An unhidden view may be adjacent to the titlebar. (WebKit::WebViewImpl::pageDidScroll): Use the scroll position of the page to determine whether or not the WKWebView is scrolled. (WebKit::WebViewImpl::scrollViewFrame): Needed to conform to NSScrollViewSeparatorTrackingAdapter. (WebKit::WebViewImpl::hasScrolledContentsUnderTitlebar): Needed to conform to NSScrollViewSeparatorTrackingAdapter. Returns true if the view is registered as an NSScrollViewSeparatorTrackingAdapter and is scrolled. (WebKit::WebViewImpl::updateTitlebarAdjacencyState): The WKWebView needs to be registered as an NSScrollViewSeparatorTrackingAdapter if it's adjacent to the titlebar and unregistered otherwise. * UIProcess/PageClient.h: (WebKit::PageClient::pageDidScroll): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::pageDidScroll): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/mac/PageClientImplMac.h: * UIProcess/mac/PageClientImplMac.mm: (WebKit::PageClientImpl::didCommitLoadForMainFrame): Reset the scroll position upon navigation, as pageDidScroll does not get called when navigating. (WebKit::PageClientImpl::pageDidScroll): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::pageDidScroll): Pass the current scroll position when the page is scrolled, so that the UIProcess knows whether or not the page has a non-zero scroll position. Source/WTF: * wtf/PlatformHave.h: Defined HAVE_NSSCROLLVIEW_SEPARATOR_TRACKING_ADAPTER. Tools: Added API tests to verify that the delegate implementation returns the correct value for `hasScrolledContentsUnderTitlebar` depending on the view's scroll position, visibility, and frame. * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/TestWebKitAPI/mac/AppKitSPI.h: * TestWebKitAPI/Tests/mac/WKWebViewTitlebarSeparatorTests.mm: Added. (-[TitlebarSeparatorTestWKWebView initWithFrame:configuration:]): (-[TitlebarSeparatorTestWKWebView separatorTrackingAdapter]): (BackForwardCache): (ChangeTitlebarAdjacency): (ChangeViewVisibility): (NavigationResetsTitlebarAppearance): (ParentWhileScrolled): (ScrollWithTitlebarAdjacency): (ScrollWithoutTitlebarAdjacency): Canonical link: https://commits.webkit.org/237884@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277688 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-18 23:15:23 +00:00
#define HAVE_NSSCROLLVIEW_SEPARATOR_TRACKING_ADAPTER 1
[macOS] Deny mach-lookup to the fonts service https://bugs.webkit.org/show_bug.cgi?id=221610 <rdar://problem/69168609> Reviewed by Brent Fulgham. Source/WebCore: Disable global font prewarming when the platform has a static font registry. Font prewarming will attempt to communicate with the font daemon. Since this usually will take place before the first page load where the decision about using the static registry is made, and this change by default blocks access to the font daemon, the system will automatically choose to use the static registry. This might be the wrong choice, and it is currently not possible to switch to not use the static registry at a later point. No new tests, covered by existing tests. * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::FontCache::prewarmGlobally): Source/WebKit: This change will by default block access to the font daemon when the platform has support for a static font registry. When the client prefers to allow user installed fonts, or Safari Reader configuration has been customized, access to the font daemon will still be allowed by issuing an extension to the font daemon. * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode const): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: * UIProcess/WebPageProxy.cpp: (WebKit::customizedReaderConfiguration): (WebKit::WebPageProxy::creationParameters): * WebProcess/WebPage/WebPage.cpp: (WebKit::m_limitsNavigationsToAppBoundDomains): (WebKit::WebPage::~WebPage): * WebProcess/WebPage/WebPage.h: * WebProcess/com.apple.WebProcess.sb.in: Source/WTF: Add HAVE define for platform static font registry. * wtf/PlatformHave.h: Canonical link: https://commits.webkit.org/234202@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272999 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-02-17 16:16:20 +00:00
#endif
PCM: Generate secret token and corresponding unlinkable token https://bugs.webkit.org/show_bug.cgi?id=222019 <rdar://problem/73581412> Reviewed by John Wilander. Source/WebCore: Covered by API tests. This patch utilizes RSABSSA to generate secret token for PCM fraud prevention. * Configurations/WebCore.xcconfig: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: Paperwork to link CryptoKitCBridging. * loader/PrivateClickMeasurement.cpp: (WebCore::PrivateClickMeasurement::EphemeralSourceNonce::isValid const): (WebCore::PrivateClickMeasurement::setEphemeralSourceNonce): * loader/PrivateClickMeasurement.h: (WebCore::PrivateClickMeasurement::attributeOnSite const): (WebCore::PrivateClickMeasurement::ephemeralSourceNonce const): (WebCore::PrivateClickMeasurement::clearEphemeralSourceNonce): (WebCore::PrivateClickMeasurement::EphemeralSourceNonce::EphemeralSourceNonce): Deleted. (WebCore::PrivateClickMeasurement::EphemeralSourceNonce::isValid const): Deleted. (WebCore::PrivateClickMeasurement::setEphemeralSourceNonce): Deleted. Groups functionalities behind HAVE_RSA_BSSA. * loader/cocoa/PrivateClickMeasurementCocoa.mm: Added. (WebCore::PrivateClickMeasurement::blindedSecretJson): (WebCore::PrivateClickMeasurement::calculatePersistentBlindedToken): Introduces new methods to generate the blinded secrets and unlinkable tokens. Source/WTF: * wtf/PlatformHave.h: Adds a compile time flag for RSABSSA. Tools: * TestWebKitAPI/Tests/WebCore/PrivateClickMeasurement.cpp: (TestWebKitAPI::TEST): Add tests. Canonical link: https://commits.webkit.org/234362@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273167 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-02-19 23:15:22 +00:00
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 120000) \
|| (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 150000)
#define HAVE_RSA_BSSA 1
#endif
[iOS] Specify a _UIDataOwner when reading or writing from the system pasteboard https://bugs.webkit.org/show_bug.cgi?id=222072 <rdar://problem/74208576> Reviewed by Devin Rousso. Source/WebCore: Add a static helper method to `PlatformPasteboard`, so that it can perform arbitrary pasteboard operations within the context of a given `DataOwnerType`. We then use this static helper to wrap all pasteboard access (reading, writing, etc.) inside calls to `+[UIPasteboard _performAsDataOwner:block:]` -- see WebKit ChangeLog for more details. Tests: UIPasteboardTests.PerformAsDataOwnerWhenCopying UIPasteboardTests.PerformAsDataOwnerWhenPasting * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: * platform/DataOwnerType.h: Added. Add a new enum to represent a data owner type. * platform/PlatformPasteboard.h: * platform/ios/PlatformPasteboardIOS.mm: (WebCore::PlatformPasteboard::performAsDataOwner): * platform/libwpe/PlatformPasteboardLibWPE.cpp: (WebCore::PlatformPasteboard::performAsDataOwner): * platform/mac/PlatformPasteboardMac.mm: (WebCore::PlatformPasteboard::performAsDataOwner): Source/WebCore/PAL: Import `UIPasteboard_Private.h` so that `PlatformPasteboardIOS.mm` can use the new SPI. * pal/spi/ios/UIKitSPI.h: Source/WebKit: Adds WebKit2 support for tagging `PlatformPasteboard` with the content view's pasteboard data owner type. See below for more details. * Platform/spi/ios/UIKitSPI.h: Import `UIPasteboard_Private.h` so that we know about `+_performAsDataOwner:block:` in the API tests. * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::getPasteboardTypes): (WebKit::WebPasteboardProxy::getPasteboardPathnamesForType): (WebKit::WebPasteboardProxy::getPasteboardStringForType): (WebKit::WebPasteboardProxy::getPasteboardStringsForType): (WebKit::WebPasteboardProxy::getPasteboardBufferForType): (WebKit::WebPasteboardProxy::getPasteboardChangeCount): (WebKit::WebPasteboardProxy::getPasteboardColor): (WebKit::WebPasteboardProxy::getPasteboardURL): (WebKit::WebPasteboardProxy::addPasteboardTypes): (WebKit::WebPasteboardProxy::setPasteboardTypes): (WebKit::WebPasteboardProxy::setPasteboardURL): (WebKit::WebPasteboardProxy::setPasteboardColor): (WebKit::WebPasteboardProxy::setPasteboardStringForType): (WebKit::WebPasteboardProxy::containsURLStringSuitableForLoading): Make all of these methods use `dataOwner()` with either a `Read` or `Write` pasteboard access intent to grab the data owner type from the view corresponding to the page identifier, and then wrap all pasteboard access within `PlatformPasteboard`'s new `performAsDataOwner` static helper. (WebKit::WebPasteboardProxy::urlStringSuitableForLoading): (WebKit::WebPasteboardProxy::setPasteboardBufferForType): (WebKit::WebPasteboardProxy::getNumberOfFiles): (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite): (WebKit::WebPasteboardProxy::writeCustomData): (WebKit::WebPasteboardProxy::allPasteboardItemInfo): (WebKit::WebPasteboardProxy::informationForItemAtIndex): (WebKit::WebPasteboardProxy::getPasteboardItemsCount): (WebKit::WebPasteboardProxy::readStringFromPasteboard): (WebKit::WebPasteboardProxy::readURLFromPasteboard): (WebKit::WebPasteboardProxy::readBufferFromPasteboard): (WebKit::WebPasteboardProxy::containsStringSafeForDOMToReadForType): (WebKit::WebPasteboardProxy::writeURLToPasteboard): (WebKit::WebPasteboardProxy::writeWebContentToPasteboard): (WebKit::WebPasteboardProxy::writeImageToPasteboard): (WebKit::WebPasteboardProxy::writeStringToPasteboard): (WebKit::WebPasteboardProxy::updateSupportedTypeIdentifiers): (WebKit::WebPasteboardProxy::determineDataOwner const): Use the given page identifier in various pasteboard IPC endpoints in `WebPasteboardProxy` to ask `WebPageProxy` for its pasteboard data owner type when reading or writing pasteboard data. * UIProcess/PageClient.h: Add a client hook to return a `DataOwnerType` enum, given a `PasteboardAccessIntent` -- that is, copy (write) or paste (read). (WebKit::PageClient::dataOwnerForPasteboard const): * UIProcess/PasteboardAccessIntent.h: Added. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::dataOwnerForPasteboard const): * UIProcess/WebPageProxy.h: * UIProcess/WebPasteboardProxy.h: * UIProcess/WebPasteboardProxy.messages.in: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::dataOwnerForPasteboard const): * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (coreDataOwnerType): (-[WKContentView _dataOwnerForPasteboard:]): Return `-_dataOwnerForPaste` or `-_dataOwnerForCopy` (depending on the `PasteboardAccessIntent`). * WebKit.xcodeproj/project.pbxproj: Source/WTF: * wtf/PlatformHave.h: Turn several compile-time guards previously in `PlatformPasteboardIOS.mm` into `HAVE()`-s. Tools: Add a couple of new API tests to verify that `+[UIPasteboard _performAsDataOwner:block:]` is invoked with the expected data owner type when copying and pasting. * TestWebKitAPI/Tests/ios/UIPasteboardTests.mm: (+[TestUIPasteboard _performAsDataOwner:block:]): (TestWebKitAPI::TEST): * TestWebKitAPI/cocoa/TestWKWebView.h: * TestWebKitAPI/cocoa/TestWKWebView.mm: (-[WKWebView contentsAsString]): Additionally add a helper method to grab a `WKWebView`'s contents as an `NSString`, just for convenience. Canonical link: https://commits.webkit.org/234370@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-02-20 00:51:03 +00:00
#if PLATFORM(IOS_FAMILY) && !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
#define HAVE_PASTEBOARD_ITEM_PROVIDERS 1
#endif
#if PLATFORM(IOS_FAMILY) && !PLATFORM(WATCHOS) && !PLATFORM(APPLETV) && !PLATFORM(MACCATALYST)
#define HAVE_PASTEBOARD_PRESENTATION_STYLE_AND_TEAM_DATA 1
#endif
#if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST)
#define HAVE_NSURL_TITLE 1
#endif
Modernize WebKit2 PDFKit softlinking https://bugs.webkit.org/show_bug.cgi?id=222643 Reviewed by Alex Christensen. Source/WebKit: WebKit2 has long had an unusual way of softlinking PDFKit, using NSBundle. It has caused much trouble in the past, because it means that running WebKit against a custom PDFKit requires either installing it into the system, or changing the hardcoded path. Instead of this, just use the normal softlinking macros that the rest of WebKit uses. * Shared/Cocoa/PDFKitSoftLink.h: Added. * Shared/Cocoa/PDFKitSoftLink.mm: Added. * Shared/mac/PDFKitImports.h: Removed. * Shared/mac/PDFKitImports.mm: Removed. * SourcesCocoa.txt: * UIProcess/mac/WKPrintingView.mm: (-[WKPrintingView _drawPDFDocument:page:atPoint:]): (-[WKPrintingView drawRect:]): * WebKit.xcodeproj/project.pbxproj: * WebProcess/Plugins/PDF/PDFPlugin.h: * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::PDFPlugin): (WebKit::PDFPlugin::receivedNonLinearizedPDFSentinel): (WebKit::PDFPlugin::threadEntry): (WebKit::PDFPlugin::documentDataDidFinishLoading): (WebKit::PDFPlugin::setActiveAnnotation): (WebKit::PDFPlugin::nextMatchForString): (WebKit:: const): * WebProcess/Plugins/PDF/PDFPluginAnnotation.mm: (WebKit::PDFPluginAnnotation::create): * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm: * WebProcess/Plugins/PDF/PDFPluginPasswordField.mm: * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm: * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::shouldUsePDFPlugin const): (WebKit::drawPDFPage): Source/WTF: * wtf/PlatformHave.h: Canonical link: https://commits.webkit.org/234803@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273833 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-03 21:04:47 +00:00
#if PLATFORM(MAC) || PLATFORM(IOS) || PLATFORM(MACCATALYST)
#define HAVE_PDFKIT 1
#endif
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000 && __MAC_OS_X_VERSION_MAX_ALLOWED >= 110300) \
|| (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 140500) \
|| (PLATFORM(APPLETV) && __TV_OS_VERSION_MAX_ALLOWED >= 140500) \
|| (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MAX_ALLOWED >= 70400)
#define HAVE_VM_FLAGS_PERMANENT 1
#endif
[Cocoa] Disable hardware decoding in the WebProcess https://bugs.webkit.org/show_bug.cgi?id=226869 <rdar://77548905> Reviewed by Per Arne Vollan and Simon Fraser. Source/WebCore: Pass kCGImageSourceEnableRestrictedDecoding : kCFBooleanTrue when decoding an image frame. Test: fast/images/heic-as-background-image.html * platform/graphics/cg/ImageDecoderCG.cpp: (WebCore::createImageSourceOptions): Source/WebCore/PAL: SoftLink 1. VTRestrictVideoDecoders from VideoToolbox 2. FigPhotoSupportsHEVCHWDecode from MediaToobox * PAL.xcodeproj/project.pbxproj: * pal/cf/VideoToolboxSoftLink.cpp: * pal/cf/VideoToolboxSoftLink.h: * pal/cocoa/MediaToolboxSoftLink.cpp: * pal/cocoa/MediaToolboxSoftLink.h: * pal/spi/cg/ImageIOSPI.h: * pal/spi/cocoa/VideoToolboxSPI.h: Added. Source/WebKit: Restrict video decoders and disable hardware image decoders. A temp extension is created for the service "com.apple.trustd.agent" to allow temporarily calling FigPhotoSupportsHEVCHWDecode(). This function needs access this service but we have recently closed access to it. FigPhotoSupportsHEVCHWDecode() sets a local static variable by using the service "com.apple.trustd.agent" when it is called for the first time. Our purpose of calling it in this context is to initialize the static variable only. And this is why we do not use its return value. This solution is fragile. If MediaToolbox is changed such that it needs 'com.apple.trustd.agent' while decoding an image, the decoding will fail. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): (WebKit::restrictImageAndVideoDecoders): (WebKit::WebProcess::initializeSandbox): Source/WTF: Add have macros for using: 1. kCGImageSourceEnableRestrictedDecoding 2. VTRestrictVideoDecoders() * wtf/PlatformHave.h: LayoutTests: Add a reference test for rendering the HEIF images. * TestExpectations: * fast/images/heic-as-background-image-expected.html: Added. * fast/images/heic-as-background-image.html: Added. * fast/images/resources/green-400x400.heic: Added. * platform/ios/TestExpectations: * platform/mac/TestExpectations: Canonical link: https://commits.webkit.org/238950@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279030 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-18 04:09:24 +00:00
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101600) \
|| (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000) \
|| (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 70000) \
|| (PLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 140000)
#define HAVE_VIDEO_RESTRICTED_DECODING 1
#endif
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 120000) \
|| (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 150000) \
|| (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 80000) \
|| (PLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 150000)
#define HAVE_CFNETWORK_NSURLSESSION_ATTRIBUTED_BUNDLE_IDENTIFIER 1
Use kAudioObjectPropertyElementMain where available https://bugs.webkit.org/show_bug.cgi?id=224635 Patch by Alex Christensen <achristensen@webkit.org> on 2021-05-17 Reviewed by Eric Carlson. Source/WebCore: * platform/audio/mac/AudioHardwareListenerMac.cpp: (WebCore::isAudioHardwareProcessRunning): (WebCore::currentDeviceSupportedBufferSizes): (WebCore::processIsRunningPropertyDescriptor): (WebCore::outputDevicePropertyDescriptor): * platform/audio/mac/AudioSessionMac.mm: (WebCore::defaultDevice): (WebCore::defaultDeviceTransportIsBluetooth): (WebCore::AudioSessionPrivate::addSampleRateObserverIfNeeded): (WebCore::AudioSessionPrivate::addBufferSizeObserverIfNeeded): (WebCore::AudioSession::sampleRate const): (WebCore::AudioSession::bufferSize const): (WebCore::AudioSession::maximumNumberOfOutputChannels const): (WebCore::AudioSession::setPreferredBufferSize): (WebCore::AudioSession::isMuted const): (WebCore::AudioSession::addMutedStateObserver): (WebCore::AudioSession::removeMutedStateObserver): * platform/mediastream/mac/CoreAudioCaptureDevice.cpp: (WebCore::getDeviceInfo): (WebCore::CoreAudioCaptureDevice::CoreAudioCaptureDevice): (WebCore::CoreAudioCaptureDevice::relatedAudioDeviceIDs): * platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp: (WebCore::deviceHasInputStreams): (WebCore::deviceHasOutputStreams): (WebCore::isValidCaptureDevice): (WebCore::CoreAudioCaptureDeviceManager::coreAudioCaptureDevices): (WebCore::computeAudioDeviceList): * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioSharedUnit::defaultOutputDevice): Source/WTF: * wtf/PlatformHave.h: Canonical link: https://commits.webkit.org/237824@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277607 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-17 21:26:59 +00:00
#define HAVE_AUDIO_OBJECT_PROPERTY_ELEMENT_MAIN 1
[Cocoa] Disable hardware decoding in the WebProcess https://bugs.webkit.org/show_bug.cgi?id=226869 <rdar://77548905> Reviewed by Per Arne Vollan and Simon Fraser. Source/WebCore: Pass kCGImageSourceEnableRestrictedDecoding : kCFBooleanTrue when decoding an image frame. Test: fast/images/heic-as-background-image.html * platform/graphics/cg/ImageDecoderCG.cpp: (WebCore::createImageSourceOptions): Source/WebCore/PAL: SoftLink 1. VTRestrictVideoDecoders from VideoToolbox 2. FigPhotoSupportsHEVCHWDecode from MediaToobox * PAL.xcodeproj/project.pbxproj: * pal/cf/VideoToolboxSoftLink.cpp: * pal/cf/VideoToolboxSoftLink.h: * pal/cocoa/MediaToolboxSoftLink.cpp: * pal/cocoa/MediaToolboxSoftLink.h: * pal/spi/cg/ImageIOSPI.h: * pal/spi/cocoa/VideoToolboxSPI.h: Added. Source/WebKit: Restrict video decoders and disable hardware image decoders. A temp extension is created for the service "com.apple.trustd.agent" to allow temporarily calling FigPhotoSupportsHEVCHWDecode(). This function needs access this service but we have recently closed access to it. FigPhotoSupportsHEVCHWDecode() sets a local static variable by using the service "com.apple.trustd.agent" when it is called for the first time. Our purpose of calling it in this context is to initialize the static variable only. And this is why we do not use its return value. This solution is fragile. If MediaToolbox is changed such that it needs 'com.apple.trustd.agent' while decoding an image, the decoding will fail. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): (WebKit::restrictImageAndVideoDecoders): (WebKit::WebProcess::initializeSandbox): Source/WTF: Add have macros for using: 1. kCGImageSourceEnableRestrictedDecoding 2. VTRestrictVideoDecoders() * wtf/PlatformHave.h: LayoutTests: Add a reference test for rendering the HEIF images. * TestExpectations: * fast/images/heic-as-background-image-expected.html: Added. * fast/images/heic-as-background-image.html: Added. * fast/images/resources/green-400x400.heic: Added. * platform/ios/TestExpectations: * platform/mac/TestExpectations: Canonical link: https://commits.webkit.org/238950@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279030 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-18 04:09:24 +00:00
#define HAVE_IMAGE_RESTRICTED_DECODING 1
#endif
[Model] [iOS] Add support for rendering model resources https://bugs.webkit.org/show_bug.cgi?id=227392 <rdar://problem/79770136> Reviewed by Tim Horton. Source/WebCore: Ensure the anchor point is set correctly for model content layers, otherwise the preview layer shows its center at the corner of the parent layer's origin. * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::setContentsToModel): Source/WebCore/PAL: Declare the ASVInlinePreview class. * pal/spi/ios/SystemPreviewSPI.h: Source/WebKit: Add a new WKModelView class which manages an ASVInlinePreview and displays its layer. The current incarnation of the ASVInlinePreview SPI requires a URL to a file to specify the resource, so we write a file to the temporary directory added in 279267 with the data wrapped in the Model object passed through the remote layer tree. Ultimately we will be able to use an SPI that does not require a file and instead will allow data to be passed directly, this is purely for a temporary experimentation. * Platform/Logging.h: * SourcesCocoa.txt: * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm: (WebKit::RemoteLayerTreeHost::makeNode): * UIProcess/ios/WKModelView.h: Added. * UIProcess/ios/WKModelView.mm: Added. (-[WKModelView preview]): (-[WKModelView initWithFrame:]): (-[WKModelView initWithCoder:]): (-[WKModelView initWithModel:]): (-[WKModelView createFileForModel:]): (-[WKModelView layoutSubviews]): (-[WKModelView updateBounds]): * WebKit.xcodeproj/project.pbxproj: Source/WTF: Add a new compile-time flag indicating the availability of the ASVInlinePreview SPI on iOS. We only define it when the header itself is present for now to avoid issues with older iOS 15 SDKs, but ultimately we will only use the iOS version check. * wtf/PlatformHave.h: Canonical link: https://commits.webkit.org/239188@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279312 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-27 08:55:52 +00:00
#if defined __has_include && __has_include(<AssetViewer/ASVInlinePreview.h>)
#if (PLATFORM(IOS) || PLATFORM(MACCATALYST)) && !PLATFORM(IOS_SIMULATOR) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 150000
[Model] [iOS] Add support for rendering model resources https://bugs.webkit.org/show_bug.cgi?id=227392 <rdar://problem/79770136> Reviewed by Tim Horton. Source/WebCore: Ensure the anchor point is set correctly for model content layers, otherwise the preview layer shows its center at the corner of the parent layer's origin. * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::setContentsToModel): Source/WebCore/PAL: Declare the ASVInlinePreview class. * pal/spi/ios/SystemPreviewSPI.h: Source/WebKit: Add a new WKModelView class which manages an ASVInlinePreview and displays its layer. The current incarnation of the ASVInlinePreview SPI requires a URL to a file to specify the resource, so we write a file to the temporary directory added in 279267 with the data wrapped in the Model object passed through the remote layer tree. Ultimately we will be able to use an SPI that does not require a file and instead will allow data to be passed directly, this is purely for a temporary experimentation. * Platform/Logging.h: * SourcesCocoa.txt: * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm: (WebKit::RemoteLayerTreeHost::makeNode): * UIProcess/ios/WKModelView.h: Added. * UIProcess/ios/WKModelView.mm: Added. (-[WKModelView preview]): (-[WKModelView initWithFrame:]): (-[WKModelView initWithCoder:]): (-[WKModelView initWithModel:]): (-[WKModelView createFileForModel:]): (-[WKModelView layoutSubviews]): (-[WKModelView updateBounds]): * WebKit.xcodeproj/project.pbxproj: Source/WTF: Add a new compile-time flag indicating the availability of the ASVInlinePreview SPI on iOS. We only define it when the header itself is present for now to avoid issues with older iOS 15 SDKs, but ultimately we will only use the iOS version check. * wtf/PlatformHave.h: Canonical link: https://commits.webkit.org/239188@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279312 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-27 08:55:52 +00:00
#define HAVE_ARKIT_INLINE_PREVIEW_IOS 1
#endif
[Model] [macOS] Add support for rendering model resources https://bugs.webkit.org/show_bug.cgi?id=227530 <rdar://problem/79968206> Reviewed by Dean Jackson. Source/WebCore: On macOS, ASVInlinePreview requires an instance in both the WebProcess and the UIProcess to exist with a matching UUID. On the WebCore side, in the WebProcess, after writing the model resource as a file to disk, we create an instance when a <model> element is created and message the UIProcess through the ChromeClient providing the UUID generated for it. When the UIProcess is done processing this message, it will reply with another message which calls into HTMLModelElement::inlinePreviewDidObtainContextId() with the matching UUID and a context ID for the remote context. We can then set that remote context ID on our ASVInlinePreview instance. We also introduce a HTMLModelElement::platformLayer() method such that RenderLayerBacking::updateConfiguration() can call it to host the ASVInlinePreview layer. * Modules/model-element/HTMLModelElement.cpp: (WebCore::HTMLModelElement::~HTMLModelElement): (WebCore::HTMLModelElement::setSourceURL): (WebCore::HTMLModelElement::notifyFinished): * Modules/model-element/HTMLModelElement.h: * Modules/model-element/HTMLModelElementCocoa.mm: Added. (WebCore::HTMLModelElement::createFile): (WebCore::HTMLModelElement::clearFile): (WebCore::HTMLModelElement::modelDidChange): (WebCore::HTMLModelElement::inlinePreviewDidObtainContextId): (WebCore::HTMLModelElement::platformLayer const): * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * loader/EmptyClients.cpp: (WebCore::EmptyChromeClient::modelElementDidCreatePreview const): * loader/EmptyClients.h: * page/ChromeClient.h: (WebCore::ChromeClient::modelElementDidCreatePreview const): * platform/Logging.h: * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateConfiguration): Source/WebCore/PAL: Declare the ASVInlinePreview class for macOS. * PAL.xcodeproj/project.pbxproj: * pal/spi/mac/SystemPreviewSPI.h: Added. Source/WebKit: On macOS, ASVInlinePreview requires an instance in both the WebProcess and the UIProcess to exist with a matching UUID. On the WebKit side, in the UIProcess, we receive a message from the WebProcess when the ASVInlinePreview in that process was created with its generated UUID. We provide this to the ModelElementController, set the remote connection up and load the file. When those tasks complete successfully we message back the WebProcess with the UUID and the provided ElementContext to talk back to the HTMLModelElement instance that initiated the message to the UIProcess in the first place. * UIProcess/Cocoa/ModelElementControllerCocoa.mm: (WebKit::ModelElementController::modelElementDidCreatePreview): * UIProcess/ModelElementController.h: * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::modelElementDidCreatePreview): (WebKit::WebPageProxy::modelElementPreviewDidObtainContextId): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::modelElementDidCreatePreview const): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::modelElementDidCreatePreview): (WebKit::WebPage::modelElementPreviewDidObtainContextId): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: Source/WTF: Add a new compile-time flag indicating the availability of the ASVInlinePreview SPI on macOS. We only define it when the header itself is present for now to avoid issues with older macOS 12 SDKs, but ultimately we will only use the macOS version check. * wtf/PlatformHave.h: Canonical link: https://commits.webkit.org/239307@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279451 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-01 06:32:12 +00:00
#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 120000
#define HAVE_ARKIT_INLINE_PREVIEW_MAC 1
#endif
[Model] Restrict IPC calls to ARKit SPI availability and runtime flag https://bugs.webkit.org/show_bug.cgi?id=227581 Reviewed by Tim Horton. Source/WebCore: Guard all IPC calls related to <model> by the most appropriate platform-specific flag and also ensure that those calls don't do anything unless the runtime flag is also enabled. * Modules/model-element/HTMLModelElement.cpp: * Modules/model-element/HTMLModelElement.h: * Modules/model-element/HTMLModelElementCocoa.mm: (WebCore::HTMLModelElement::inlinePreviewDidObtainContextId): * loader/EmptyClients.cpp: (WebCore::EmptyChromeClient::modelElementDidCreatePreview const): * loader/EmptyClients.h: * page/ChromeClient.h: Source/WebKit: Guard all IPC calls related to <model> by the most appropriate platform-specific flag and also ensure that those calls don't do anything unless the runtime flag is also enabled. * Shared/WebProcessDataStoreParameters.h: (WebKit::WebProcessDataStoreParameters::encode const): (WebKit::WebProcessDataStoreParameters::decode): * UIProcess/Cocoa/ModelElementControllerCocoa.mm: (WebKit::ModelElementController::takeModelElementFullscreen): (WebKit::ModelElementController::modelElementDidCreatePreview): * UIProcess/ModelElementController.cpp: * UIProcess/ModelElementController.h: * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didAttachToRunningProcess): (WebKit::WebPageProxy::resetState): (WebKit::WebPageProxy::takeModelElementFullscreen): (WebKit::WebPageProxy::modelElementDidCreatePreview): (WebKit::WebPageProxy::modelElementPreviewDidObtainContextId): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::webProcessDataStoreParameters): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary): * UIProcess/WebsiteData/WebsiteDataStore.h: * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp: (WebKit::WebsiteDataStoreConfiguration::WebsiteDataStoreConfiguration): (WebKit::WebsiteDataStoreConfiguration::copy const): * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::modelElementDidCreatePreview const): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::modelElementPreviewDidObtainContextId): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::setWebsiteDataStoreParameters): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformSetWebsiteDataStoreParameters): Source/WTF: Define a new compile-time flag when either of the iOS or macOS ARKit SPIs are available. * wtf/PlatformHave.h: Canonical link: https://commits.webkit.org/239330@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279477 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-01 19:37:13 +00:00
#if defined(HAVE_ARKIT_INLINE_PREVIEW_IOS) || defined(HAVE_ARKIT_INLINE_PREVIEW_MAC)
#define HAVE_ARKIT_INLINE_PREVIEW 1
#endif
[Model] [iOS] Add support for rendering model resources https://bugs.webkit.org/show_bug.cgi?id=227392 <rdar://problem/79770136> Reviewed by Tim Horton. Source/WebCore: Ensure the anchor point is set correctly for model content layers, otherwise the preview layer shows its center at the corner of the parent layer's origin. * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::setContentsToModel): Source/WebCore/PAL: Declare the ASVInlinePreview class. * pal/spi/ios/SystemPreviewSPI.h: Source/WebKit: Add a new WKModelView class which manages an ASVInlinePreview and displays its layer. The current incarnation of the ASVInlinePreview SPI requires a URL to a file to specify the resource, so we write a file to the temporary directory added in 279267 with the data wrapped in the Model object passed through the remote layer tree. Ultimately we will be able to use an SPI that does not require a file and instead will allow data to be passed directly, this is purely for a temporary experimentation. * Platform/Logging.h: * SourcesCocoa.txt: * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm: (WebKit::RemoteLayerTreeHost::makeNode): * UIProcess/ios/WKModelView.h: Added. * UIProcess/ios/WKModelView.mm: Added. (-[WKModelView preview]): (-[WKModelView initWithFrame:]): (-[WKModelView initWithCoder:]): (-[WKModelView initWithModel:]): (-[WKModelView createFileForModel:]): (-[WKModelView layoutSubviews]): (-[WKModelView updateBounds]): * WebKit.xcodeproj/project.pbxproj: Source/WTF: Add a new compile-time flag indicating the availability of the ASVInlinePreview SPI on iOS. We only define it when the header itself is present for now to avoid issues with older iOS 15 SDKs, but ultimately we will only use the iOS version check. * wtf/PlatformHave.h: Canonical link: https://commits.webkit.org/239188@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279312 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-27 08:55:52 +00:00
#endif
#if PLATFORM(IOS) || PLATFORM(MACCATALYST) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000)
#define HAVE_NSURLPROTOCOL_WITH_SKIPAPPSSO 1
#endif
#if (PLATFORM(IOS) || PLATFORM(MACCATALYST)) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 150000
#define HAVE_UICONTEXTMENU_STYLE_CUSTOM_PRESENTATION 1
#define HAVE_UIDATEPICKER_INSETS 1
#define HAVE_UIDATEPICKER_OVERLAY_PRESENTATION 1
#define HAVE_UIMENUOPTIONS_SINGLE_SELECTION 1
#endif
#if (((PLATFORM(IOS) || PLATFORM(MACCATALYST)) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 150000) \
|| (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 120000))
#define HAVE_UPDATE_WEB_ACCESSIBILITY_SETTINGS 1
#endif
#if PLATFORM(IOS) || PLATFORM(MACCATALYST)
#define HAVE_UIBLUREFFECT_STYLE_SYSTEM_MATERIAL 1
#endif
Prevent sbix glyphs from being rendered in the GPU process https://bugs.webkit.org/show_bug.cgi?id=226159 <rdar://77231959> Reviewed by Darin Adler. Source/WebCore: When GPUP canvas is enabled, the display list recorder handles sbix glyphs by recording drawImage calls. This means that during display list replay, we should not have any sbix glyphs in a DrawGlyphs display list item. This patch checks for such glyphs (like we already do for SVG glyphs) and returns early if they're found. Manually tested. No new tests, since we'd need to add some way inject sbix glyph IDs into display list items. * platform/graphics/Font.h: (WebCore::Font::ComplexColorFormatGlyphs::hasRelevantTables const): (WebCore::Font::ComplexColorFormatGlyphs::bitForInitialized): (WebCore::Font::ComplexColorFormatGlyphs::bitForValue): (WebCore::Font::ComplexColorFormatGlyphs::bitsRequiredForGlyphCount): (WebCore::Font::ComplexColorFormatGlyphs::ComplexColorFormatGlyphs): * platform/graphics/coretext/FontCascadeCoreText.cpp: (WebCore::FontCascade::drawGlyphs): Call new function that checks for SVG and sbix glyph presence. Change release assertion to debug assertion to avoid unnecessarily crashing the GPUP, and instead return early in the presence of these glyphs. * platform/graphics/coretext/FontCoreText.cpp: (WebCore::Font::otSVGTable const): (WebCore::Font::ComplexColorFormatGlyphs::createWithNoRelevantTables): (WebCore::Font::ComplexColorFormatGlyphs::createWithRelevantTablesAndGlyphCount): (WebCore::Font::ComplexColorFormatGlyphs::hasValueFor const): (WebCore::Font::ComplexColorFormatGlyphs::get const): (WebCore::Font::ComplexColorFormatGlyphs::set): (WebCore::Font::hasComplexColorFormatTables const): (WebCore::Font::glyphsWithComplexColorFormat const): (WebCore::Font::glyphHasComplexColorFormat const): (WebCore::Font::findOTSVGGlyphs const): (WebCore::Font::hasAnyComplexColorFormatGlyphs const): New function to check if a list of glyph IDs has any that would be inappropriate to render in the GPU process. Since calling the CoreText function that allows us to check if an sbix glyph exists would be too expensive to call for every drawGlyphs call, we lazily cache (in a BitVector) the presence of sbix and SVG images for glyph IDs we check. Source/WebCore/PAL: * pal/spi/cf/CoreTextSPI.h: Add declaration for an SPI that lets us infer whether a glyph has an sbix image. Source/WTF: * wtf/PlatformHave.h: Add HAVE_CORE_TEXT_SBIX_IMAGE_SIZE_FUNCTIONS. Canonical link: https://commits.webkit.org/238195@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278151 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-27 06:42:52 +00:00
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000 \
|| (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000) \
|| (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 70000) \
|| (PLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 140000) \
|| (PLATFORM(MACCATALYST) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000))
#define HAVE_CORE_TEXT_SBIX_IMAGE_SIZE_FUNCTIONS 1
#endif
[Monterey] Support building WebKit https://bugs.webkit.org/show_bug.cgi?id=226846 <rdar://problem/79095148> Reviewed by Tim Horton. Source/WebCore: Covered by exisiting tests. * testing/Internals.cpp: (WebCore::Internals::installImageOverlay): Explicitly define second arugment to avoid 'missing field' compilation error. Source/WebCore/PAL: * pal/spi/cocoa/CryptoKitCBridgingSPI.h: Add RSA BSSA declarations. * pal/spi/mac/QuickLookMacSPI.h: Add Image Analysis declarations. Source/WebKit: * Platform/cocoa/TextRecognitionUtilities.mm: Import VisionKitSPI.h. * Platform/spi/Cocoa/VisionKitSPI.h: Added. * UIProcess/API/Cocoa/WKBrowsingContextController.mm: (setUpPageLoaderClient): Allow deprecated declarations. (setUpPagePolicyClient): Ditto. * UIProcess/API/Cocoa/WKConnection.mm: (setUpClient): Allow deprecated declarations. * UIProcess/API/Cocoa/WKProcessGroup.mm: (setUpConnectionClient): Allow deprecated declarations. (setUpInjectedBundleClient): Ditto. (setUpHistoryClient): Ditto. * UIProcess/API/Cocoa/WKWebViewTesting.mm: (-[WKWebView _createMediaSessionCoordinatorForTesting:completionHandler:]): Explicitly define second arugment to avoid 'missing field' compilation error. * UIProcess/Cocoa/WebViewImpl.mm: Import VisionKitSPI.h. * UIProcess/ios/WKContentViewInteraction.mm: Ditto. * WebKit.xcodeproj/project.pbxproj: Ditto. Source/WTF: * wtf/PlatformHave.h: Add HAVE(VK_IMAGE_ANALYSIS). * wtf/spi/cocoa/SecuritySPI.h: Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: Add CoreCryptoSPI.h. * TestWebKitAPI/Tests/WebCore/cocoa/CoreCryptoSPI.h: Added. * TestWebKitAPI/Tests/WebCore/cocoa/PrivateClickMeasurementCocoa.mm: Import CoreCryptoSPI.h. * TestWebKitAPI/Tests/WebKitCocoa/EventAttribution.mm: Ditto. Canonical link: https://commits.webkit.org/238737@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278780 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-11 20:44:21 +00:00
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 120000) \
|| ((PLATFORM(IOS) || PLATFORM(MACCATALYST)) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 150000)
#if !defined(HAVE_VK_IMAGE_ANALYSIS)
#define HAVE_VK_IMAGE_ANALYSIS 1
#endif
#endif
#if PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 150000
#if !defined(HAVE_VK_IMAGE_ANALYSIS_FOR_MACHINE_READABLE_CODES)
#define HAVE_VK_IMAGE_ANALYSIS_FOR_MACHINE_READABLE_CODES 1
#endif
#endif
#if PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 150000
#define HAVE_PER_APP_ACCESSIBILITY_PREFERENCES 1
#endif
[Cocoa] Harden WebAuthn process by restricting to browser-entitled processes https://bugs.webkit.org/show_bug.cgi?id=226772 <rdar://problem/74721877> Reviewed by Darin Adler. Source/WebKit: We should ensure that any process attempting to launch the WebAuthn XPC service is entitled as a full web browser. We should also ensure that the process requesting WebAuthn operations over WebKit CoreIPC is the WebContent process. Tested by existing WebAuthn tests. * Platform/Logging.h: Add WebAuthn category. * Shared/Cocoa/DefaultWebBrowserChecks.mm: (WebKit::isInWebKitChildProcess): Recognize 'com.apple.WebKit.WebAuthn' as a WebKit sub-process. * UIProcess/Cocoa/WebProcessProxyCocoa.mm: (WebKit::WebProcessProxy::hasCorrectPACEntitlement): Added. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::getWebAuthnProcessConnection): Add a new MESSAGE_CHECK that the process requesting a WebAuthn process connection is a WebContent process. * UIProcess/WebProcessProxy.h: * WebAuthnProcess/WebAuthnProcess.cpp: (WebKit::WebAuthnProcess::platformInitializeWebAuthnProcess): Add some logging. * WebAuthnProcess/WebAuthnProcess.h: * WebAuthnProcess/ios/WebAuthnProcessIOS.mm: (WebKit::WebAuthnProcess::platformInitializeWebAuthnProcess): Ensure that the application invoking the WebAuthn XPC service is entitled as a default web browser. * WebAuthnProcess/mac/WebAuthnProcessMac.mm: (WebKit::WebAuthnProcess::platformInitializeWebAuthnProcess): Stub. * WebProcess/WebProcess.cpp: (WebKit::getWebAuthnProcessConnection): (WebKit::WebProcess::ensureWebAuthnProcessConnection): Source/WTF: Add a new entitlement utility that returns the String value of a given entitlement for the process with the provided audit token. * wtf/cocoa/Entitlements.h: * wtf/cocoa/Entitlements.mm: (WTF::hasEntitlementValue): * wtf/PlatformHave.h: Add item for PAC shared region feature. Canonical link: https://commits.webkit.org/238820@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278877 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-15 16:46:14 +00:00
#if (PLATFORM(IOS_FAMILY) && !PLATFORM(IOS_FAMILY_SIMULATOR)) || PLATFORM(MACCATALYST) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000)
#define HAVE_PAC_SHARED_REGION_ID 1
#endif
[macOS] Rename WKVisualSearchPreviewController to WKQuickLookPreviewController https://bugs.webkit.org/show_bug.cgi?id=227193 Reviewed by Sam Weinig. Source/WebCore/PAL: Fix up some compiler flags in this SPI header. Instead of using `HAVE(VK_IMAGE_ANALYSIS)` to guard SPI declarations, use the new `HAVE(QUICKLOOK_PREVIEW_ITEM_DATA_PROVIDER)`, `HAVE(QUICKLOOK_ITEM_PREVIEW_OPTIONS)` and `HAVE(QUICKLOOK_PREVIEW_ACTIVITY)` flags. * pal/spi/mac/QuickLookMacSPI.h: Source/WebKit: Rename WKVisualSearchPreviewController to WKQuickLookPreviewController, with the intention of using this logic to implement a new context menu action for opening images in a QuickLook preview panel. See below for more details. * SourcesCocoa.txt: * UIProcess/Cocoa/WebPageProxyCocoa.mm: (WebKit::WebPageProxy::handleContextMenuLookUpImage): Deleted. Move this into WebPageProxyMac.mm, since this is (1) only relevant to macOS, and (2) this logic now requires WKQuickLookPreviewController.h, which WebPageProxyMac.mm already imports. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::acceptsPreviewPanelControl): * UIProcess/WebPageProxy.h: * UIProcess/mac/WKQuickLookPreviewController.h: Renamed from Source/WebKit/UIProcess/mac/WKVisualSearchPreviewController.h. * UIProcess/mac/WKQuickLookPreviewController.mm: Renamed from Source/WebKit/UIProcess/mac/WKVisualSearchPreviewController.mm. (-[WKQuickLookPreviewController initWithPage:imageData:title:imageURL:activity:]): Add QuickLookPreviewActivity, a flag to indicate whether or not WKQuickLookPreviewController should start with QLPreviewActivityVisualSearch or QLPreviewActivityNone. For the time being, we only use this helper object for visual search, so we only pass in QuickLookPreviewActivity::VisualSearch. (-[WKQuickLookPreviewController beginControl:]): (-[WKQuickLookPreviewController endControl:]): (-[WKQuickLookPreviewController closePanelIfNecessary]): (-[WKQuickLookPreviewController isControlling:]): (-[WKQuickLookPreviewController provideDataForItem:]): (-[WKQuickLookPreviewController numberOfPreviewItemsInPreviewPanel:]): (-[WKQuickLookPreviewController previewPanel:previewItemAtIndex:]): (-[WKQuickLookPreviewController previewPanel:initialActivityForItem:]): * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::beginPreviewPanelControl): (WebKit::WebPageProxy::endPreviewPanelControl): (WebKit::WebPageProxy::closeSharedPreviewPanelIfNecessary): (WebKit::WebPageProxy::handleContextMenuLookUpImage): (WebKit::WebPageProxy::showImageInQuickLookPreviewPanel): (WebKit::WebPageProxy::showImageInVisualSearchPreviewPanel): Deleted. * WebKit.xcodeproj/project.pbxproj: Source/WTF: Add some compile-time flags to guard QuickLook SPI declarations. * wtf/PlatformHave.h: Canonical link: https://commits.webkit.org/238980@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279060 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-20 23:22:06 +00:00
#if !defined(HAVE_QUICKLOOK_PREVIEW_ITEM_DATA_PROVIDER) \
&& (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 120000)
#define HAVE_QUICKLOOK_PREVIEW_ITEM_DATA_PROVIDER 1
#define HAVE_QUICKLOOK_ITEM_PREVIEW_OPTIONS 1
#define HAVE_QUICKLOOK_PREVIEW_ACTIVITY 1
#endif
[iOS] Adopt new date picker presentation SPI https://bugs.webkit.org/show_bug.cgi?id=227221 <rdar://problem/77930086> Reviewed by Wenson Hsieh. Source/WebKit: In native applications, tapping on a compact UIDatePicker presents an inline picker using _UIDatePickerOverlayPresentation. To avoid maintaining our own presentation logic, and to better match the native presentation, use _UIDatePickerOverlayPresentation when tapping on a date/time input in WebKit. Covered by existing tests. * Platform/spi/ios/UIKitSPI.h: Declare the SPI rather than importing the header directly, as the _UIDatePickerOverlayAnchor enum is not available in all SDKs with the header. * UIProcess/ios/forms/WKDateTimeInputControl.mm: (-[WKDateTimePickerViewController initWithDatePicker:]): (-[WKDateTimePickerViewController setDelegate:]): (-[WKDateTimePicker initWithView:datePickerMode:]): Create the UIDatePicker here so it can be shared by the old context menu presentation and the new overlay presentation. (-[WKDateTimePicker handleDatePickerPresentationDismissal]): (-[WKDateTimePicker removeDatePickerPresentation]): `accessoryDone` eventually removes the presentation. If the date picker is already being dismissed, do not dismiss it without an animation. For programmatic dismissal (using blur()) this method is called prior to `accessoryDone`, in which case we force dismissal without animation. (-[WKDateTimePicker dateTimePickerViewControllerDidPressResetButton:]): (-[WKDateTimePicker dateTimePickerViewControllerDidPressDoneButton:]): (-[WKDateTimePicker showDateTimePicker]): (-[WKDateTimePicker datePickerChanged:]): (-[WKDateTimePicker reset:]): (-[WKDateTimePicker done:]): (-[WKDateTimePicker dealloc]): (-[WKDateTimePicker _timeZoneOffsetFromGMT:]): (-[WKDateTimePicker dateFormatterForPicker]): (-[WKDateTimePicker _dateChangedSetAsNumber]): (-[WKDateTimePicker _dateChangedSetAsString]): (-[WKDateTimePicker setDateTimePickerToInitialValue]): (-[WKDateTimePicker controlBeginEditing]): (-[WKDateTimePicker controlEndEditing]): (-[WKDateTimePicker calendarType]): (-[WKDateTimePicker hour]): (-[WKDateTimePicker minute]): (-[WKDateTimePicker setHour:minute:]): Source/WTF: * wtf/PlatformHave.h: Add HAVE(UIDATEPICKER_OVERLAY_PRESENTATION) and HAVE(UITOOLBAR_STANDARD_APPEARANCE). LayoutTests: * fast/forms/ios/constant-scroll-area-when-moving-focus-between-fields.html: Re-order the call to wait for the keyboard to dismiss since the presentation SPI doesn't tell us exactly when the presentation animation is complete. The other alternative was to add a manual delay, however, re-ordering the calls is safe and preserves the original test behavior. Canonical link: https://commits.webkit.org/239077@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279181 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-23 20:02:35 +00:00
#if PLATFORM(IOS) || PLATFORM(MACCATALYST)
#define HAVE_UITOOLBAR_STANDARD_APPEARANCE 1
#endif
#if !PLATFORM(IOS_FAMILY_SIMULATOR) && !PLATFORM(WATCHOS)
#define HAVE_SYMPTOMS_FRAMEWORK 1
#endif
#if !defined(HAVE_GROUP_ACTIVITIES) && PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 120000
#define HAVE_GROUP_ACTIVITIES 1
#endif
#if PLATFORM(IOS_FAMILY) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 120000)
#define HAVE_WEBGL_COMPATIBLE_METAL 1
#endif
[Cocoa] Make Coordinator playback commands more precise https://bugs.webkit.org/show_bug.cgi?id=227756 Reviewed by Eric Carlson. Source/WebCore: Add support for precise playback commands from MediaSessionCoordinator to the underlying MediaPlayer. In the case where a play() command is issued to a HTMLMediaElement and: - There is an active MediaSession - The MediaSession's active HTMLMediaElement is the current one - There is a pending playSession command - That command has a hostTime parameter - The MediaPlayer backing the element supports playing at a specific host time Then use the MediaPlayer's playAtHostTime() facility to begin playback, synchronized with the specified hostTime. Add support for playAtHostTime() to both MediaPlayerPrivateAVFoundationObjC and MediaPlayerPrivateMediaSourceAVFObjC. * Modules/mediasession/MediaSession.h: * Modules/mediasession/MediaSessionCoordinator.cpp: (WebCore::MediaSessionCoordinator::playSession): * Modules/mediasession/MediaSessionCoordinator.h: (WebCore::MediaSessionCoordinator::currentPlaySessionCommand const): * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::updatePlayState): (WebCore::HTMLMediaElement::playPlayer): (WebCore::HTMLMediaElement::pausePlayer): * html/HTMLMediaElement.h: * html/MediaElementSession.h: * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::supportsPlayAtHostTime const): (WebCore::MediaPlayer::supportsPauseAtHostTime const): (WebCore::MediaPlayer::playAtHostTime): (WebCore::MediaPlayer::pauseAtHostTime): * platform/graphics/MediaPlayer.h: * platform/graphics/MediaPlayerPrivate.h: (WebCore::MediaPlayerPrivateInterface::supportsPlayAtHostTime const): (WebCore::MediaPlayerPrivateInterface::supportsPauseAtHostTime const): (WebCore::MediaPlayerPrivateInterface::playAtHostTime): (WebCore::MediaPlayerPrivateInterface::pauseAtHostTime): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): (WebCore::MediaPlayerPrivateAVFoundationObjC::playAtHostTime): (WebCore::MediaPlayerPrivateAVFoundationObjC::pauseAtHostTime): (WebCore::MediaPlayerPrivateAVFoundationObjC::setPlayerRate): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::playInternal): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pauseInternal): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::playAtHostTime): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pauseAtHostTime): Source/WebCore/PAL: Add SoftLink macros for CMClockMakeHostTimeFromSystemUnits. * pal/cf/CoreMediaSoftLink.cpp: * pal/cf/CoreMediaSoftLink.h: Source/WebKit: Pass through new {play,pause}AtHostTime() and supports{Play,Pause}AtHostTime() methods to and from the GPU process. * GPUProcess/media/RemoteMediaPlayerProxy.cpp: (WebKit::RemoteMediaPlayerProxy::getConfiguration): (WebKit::RemoteMediaPlayerProxy::playAtHostTime): (WebKit::RemoteMediaPlayerProxy::pauseAtHostTime): * GPUProcess/media/RemoteMediaPlayerProxy.h: * GPUProcess/media/RemoteMediaPlayerProxy.messages.in: * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::playAtHostTime): (WebKit::MediaPlayerPrivateRemote::pauseAtHostTime): * WebProcess/GPU/media/MediaPlayerPrivateRemote.h: * WebProcess/GPU/media/RemoteMediaPlayerConfiguration.h: (WebKit::RemoteMediaPlayerConfiguration::encode const): (WebKit::RemoteMediaPlayerConfiguration::decode): Source/WTF: Add a method to convert from a MonotonicTime to a MachAbsoluteTime. * wtf/CurrentTime.cpp: (WTF::machTimebaseInfo): (WTF::MonotonicTime::fromMachAbsoluteTime): (WTF::MonotonicTime::toMachAbsoluteTime const): * wtf/MonotonicTime.h: * wtf/PlatformHave.h: Canonical link: https://commits.webkit.org/239553@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279786 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-09 16:46:05 +00:00
#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 120000
#define HAVE_CMPHOTO_TILE_DECODER_AVAILABLE 1
#endif
[Cocoa] Make Coordinator playback commands more precise https://bugs.webkit.org/show_bug.cgi?id=227756 Reviewed by Eric Carlson. Source/WebCore: Add support for precise playback commands from MediaSessionCoordinator to the underlying MediaPlayer. In the case where a play() command is issued to a HTMLMediaElement and: - There is an active MediaSession - The MediaSession's active HTMLMediaElement is the current one - There is a pending playSession command - That command has a hostTime parameter - The MediaPlayer backing the element supports playing at a specific host time Then use the MediaPlayer's playAtHostTime() facility to begin playback, synchronized with the specified hostTime. Add support for playAtHostTime() to both MediaPlayerPrivateAVFoundationObjC and MediaPlayerPrivateMediaSourceAVFObjC. * Modules/mediasession/MediaSession.h: * Modules/mediasession/MediaSessionCoordinator.cpp: (WebCore::MediaSessionCoordinator::playSession): * Modules/mediasession/MediaSessionCoordinator.h: (WebCore::MediaSessionCoordinator::currentPlaySessionCommand const): * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::updatePlayState): (WebCore::HTMLMediaElement::playPlayer): (WebCore::HTMLMediaElement::pausePlayer): * html/HTMLMediaElement.h: * html/MediaElementSession.h: * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::supportsPlayAtHostTime const): (WebCore::MediaPlayer::supportsPauseAtHostTime const): (WebCore::MediaPlayer::playAtHostTime): (WebCore::MediaPlayer::pauseAtHostTime): * platform/graphics/MediaPlayer.h: * platform/graphics/MediaPlayerPrivate.h: (WebCore::MediaPlayerPrivateInterface::supportsPlayAtHostTime const): (WebCore::MediaPlayerPrivateInterface::supportsPauseAtHostTime const): (WebCore::MediaPlayerPrivateInterface::playAtHostTime): (WebCore::MediaPlayerPrivateInterface::pauseAtHostTime): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): (WebCore::MediaPlayerPrivateAVFoundationObjC::playAtHostTime): (WebCore::MediaPlayerPrivateAVFoundationObjC::pauseAtHostTime): (WebCore::MediaPlayerPrivateAVFoundationObjC::setPlayerRate): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::playInternal): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pauseInternal): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::playAtHostTime): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pauseAtHostTime): Source/WebCore/PAL: Add SoftLink macros for CMClockMakeHostTimeFromSystemUnits. * pal/cf/CoreMediaSoftLink.cpp: * pal/cf/CoreMediaSoftLink.h: Source/WebKit: Pass through new {play,pause}AtHostTime() and supports{Play,Pause}AtHostTime() methods to and from the GPU process. * GPUProcess/media/RemoteMediaPlayerProxy.cpp: (WebKit::RemoteMediaPlayerProxy::getConfiguration): (WebKit::RemoteMediaPlayerProxy::playAtHostTime): (WebKit::RemoteMediaPlayerProxy::pauseAtHostTime): * GPUProcess/media/RemoteMediaPlayerProxy.h: * GPUProcess/media/RemoteMediaPlayerProxy.messages.in: * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::playAtHostTime): (WebKit::MediaPlayerPrivateRemote::pauseAtHostTime): * WebProcess/GPU/media/MediaPlayerPrivateRemote.h: * WebProcess/GPU/media/RemoteMediaPlayerConfiguration.h: (WebKit::RemoteMediaPlayerConfiguration::encode const): (WebKit::RemoteMediaPlayerConfiguration::decode): Source/WTF: Add a method to convert from a MonotonicTime to a MachAbsoluteTime. * wtf/CurrentTime.cpp: (WTF::machTimebaseInfo): (WTF::MonotonicTime::fromMachAbsoluteTime): (WTF::MonotonicTime::toMachAbsoluteTime const): * wtf/MonotonicTime.h: * wtf/PlatformHave.h: Canonical link: https://commits.webkit.org/239553@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279786 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-09 16:46:05 +00:00
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 110300 \
|| (PLATFORM(IOS) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 140500) \
|| (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MAX_ALLOWED >= 70400) \
|| (PLATFORM(APPLETV) && __TV_OS_VERSION_MAX_ALLOWED >= 140500) \
|| (PLATFORM(MACCATALYST) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 140500))
#define HAVE_AVSAMPLEBUFFERRENDERSYNCHRONIZER_RATEATHOSTTIME 1
#endif
#if (PLATFORM(IOS) && !PLATFORM(IOS_FAMILY_SIMULATOR)) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 150000
#define HAVE_SYSTEM_STATUS 1
#endif