2022-04-19 Alan Coon Cherry-pick r289531. rdar://problem/88023949 Introduce SignedPtrTraits which enables Ref pointers to be protected with PtrTags. https://bugs.webkit.org/show_bug.cgi?id=235588 rdar://88023849 Patch by Gavin Phillips on 2022-02-10 Reviewed by Mark Lam. Create and adopt SignedPtrTraits which can be used to apply and verify PtrTag signatures to pointers stored in and tracked by WTF:Ref. Source/WebCore: * bindings/js/JSDOMWrapper.h: (WebCore::JSDOMWrapper::wrapped const): (WebCore::JSDOMWrapper::offsetOfWrapped): (WebCore::JSDOMWrapper::hasCustomPtrTraits): * bindings/scripts/CodeGeneratorJS.pm: (GetParentClassName): (GetImplClassPtrTag): (GenerateHeader): (GetTaggedWrapperForInterface): * bindings/scripts/IDLAttributes.json: * bindings/scripts/test/BindingTestGlobalConstructors.idl: * bindings/scripts/test/JS/JSTestGlobalObject.cpp: (WebCore::jsTestGlobalObject_TestTaggedWrapperConstructorGetter): (WebCore::JSC_DEFINE_CUSTOM_GETTER): * bindings/scripts/test/JS/JSTestTaggedWrapper.cpp: Added. (WebCore::JSTestTaggedWrapperDOMConstructor::prototypeForStructure): (WebCore::JSTestTaggedWrapperDOMConstructor::initializeProperties): (WebCore::JSTestTaggedWrapperPrototype::finishCreation): (WebCore::JSTestTaggedWrapper::JSTestTaggedWrapper): (WebCore::JSTestTaggedWrapper::finishCreation): (WebCore::JSTestTaggedWrapper::createPrototype): (WebCore::JSTestTaggedWrapper::prototype): (WebCore::JSTestTaggedWrapper::getConstructor): (WebCore::JSTestTaggedWrapper::destroy): (WebCore::JSC_DEFINE_CUSTOM_GETTER): (WebCore::JSTestTaggedWrapper::subspaceForImpl): (WebCore::JSTestTaggedWrapper::analyzeHeap): (WebCore::JSTestTaggedWrapperOwner::isReachableFromOpaqueRoots): (WebCore::JSTestTaggedWrapperOwner::finalize): (WebCore::toJSNewlyCreated): (WebCore::toJS): (WebCore::JSTestTaggedWrapper::toWrapped): * bindings/scripts/test/JS/JSTestTaggedWrapper.h: Added. (WebCore::JSTestTaggedWrapper::create): (WebCore::JSTestTaggedWrapper::createStructure): (WebCore::JSTestTaggedWrapper::subspaceFor): (WebCore::wrapperOwner): (WebCore::wrapperKey): (WebCore::toJS): (WebCore::toJSNewlyCreated): * bindings/scripts/test/SupplementalDependencies.dep: * bindings/scripts/test/TestTaggedWrapper.idl: Added. * css/DOMMatrixReadOnly.idl: * dom/DOMPointReadOnly.idl: * dom/DOMQuad.idl: * dom/DOMRectReadOnly.idl: * domjit/JSDocumentDOMJIT.cpp: (WebCore::compileDocumentDocumentElementAttribute): (WebCore::compileDocumentBodyAttribute): * domjit/JSNodeDOMJIT.cpp: (WebCore::createCallDOMGetterForOffsetAccess): (WebCore::compileNodeOwnerDocumentAttribute): * html/TimeRanges.idl: * html/canvas/OffscreenCanvasRenderingContext2D.idl: * html/canvas/PaintRenderingContext2D.idl: * svg/SVGMatrix.idl: Source/WTF: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/SignedPtr.h: Added. (WTF::SignedPtr::SignedPtr): (WTF::SignedPtr::get const): (WTF::SignedPtr::set): (WTF::SignedPtr::clear): (WTF::SignedPtr::operator-> const): (WTF::SignedPtr::operator* const): (WTF::SignedPtr::operator! const): (WTF::SignedPtr::operator UnspecifiedBoolType const): (WTF::SignedPtr::operator bool const): (WTF::SignedPtr::operator=): (WTF::SignedPtr::exchange): (WTF::SignedPtr::swap): (WTF::SignedPtrTraits::exchange): (WTF::SignedPtrTraits::swap): (WTF::SignedPtrTraits::unwrap): (WTF::SignedPtrTraits::hashTableDeletedValue): (WTF::SignedPtrTraits::isHashTableDeletedValue): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@289531 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-02-10 Gavin Phillips Introduce SignedPtrTraits which enables Ref pointers to be protected with PtrTags. https://bugs.webkit.org/show_bug.cgi?id=235588 rdar://88023849 Reviewed by Mark Lam. Create and adopt SignedPtrTraits which can be used to apply and verify PtrTag signatures to pointers stored in and tracked by WTF:Ref. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/SignedPtr.h: Added. (WTF::SignedPtr::SignedPtr): (WTF::SignedPtr::get const): (WTF::SignedPtr::set): (WTF::SignedPtr::clear): (WTF::SignedPtr::operator-> const): (WTF::SignedPtr::operator* const): (WTF::SignedPtr::operator! const): (WTF::SignedPtr::operator UnspecifiedBoolType const): (WTF::SignedPtr::operator bool const): (WTF::SignedPtr::operator=): (WTF::SignedPtr::exchange): (WTF::SignedPtr::swap): (WTF::SignedPtrTraits::exchange): (WTF::SignedPtrTraits::swap): (WTF::SignedPtrTraits::unwrap): (WTF::SignedPtrTraits::hashTableDeletedValue): (WTF::SignedPtrTraits::isHashTableDeletedValue): 2022-04-11 Yusuke Suzuki [JSC] Reduce use of unnecessary cryptographicallyRandom numbers https://bugs.webkit.org/show_bug.cgi?id=239026 Reviewed by Saam Barati. We add createVersion4UUIDStringWeak, which can generate UUID with WeakRandom numbers. * wtf/UUID.cpp: (WTF::convertRandomUInt128ToUUIDVersion4): (WTF::generateCryptographicallyRandomUUIDVersion4): (WTF::generateWeakRandomUUIDVersion4): (WTF::UUID::UUID): (WTF::createVersion4UUIDStringWeak): * wtf/UUID.h: * wtf/WeakRandom.h: 2022-04-18 Kocsen Chung Cherry-pick r292609. rdar://problem/90882766 Broaden TypedArray API fix to all apps not just Bleacher Report https://bugs.webkit.org/show_bug.cgi?id=238955 Reviewed by Saam Barati. Source/JavaScriptCore: * API/JSTypedArray.cpp: (isLinkedBeforeTypedArrayLengthQuirk): (JSObjectGetArrayBufferByteLength): (isBleecherReport): Deleted. Source/WTF: * wtf/cocoa/RuntimeApplicationChecksCocoa.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@292609 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-04-08 Keith Miller Broaden TypedArray API fix to all apps not just Bleacher Report https://bugs.webkit.org/show_bug.cgi?id=238955 Reviewed by Saam Barati. * wtf/cocoa/RuntimeApplicationChecksCocoa.h: 2022-03-23 Alan Coon Cherry-pick r290985. rdar://problem/78421282 Add a preference to mute video capture in case audio capture gets interrupted https://bugs.webkit.org/show_bug.cgi?id=237524 Reviewed by Eric Carlson. Source/WebCore: In case we detect that a microphone track source gets muted due to interruption, we mute capture video tracks based if allowed by the new MuteCameraOnMicrophoneInterruptionEnabled setting. Add support for mock microphone interruption and remove previous in process internals API. Test: fast/mediastream/media-stream-video-track-interrupted-from-audio.html * Modules/mediastream/MediaStreamTrack.cpp: * Modules/mediastream/MediaStreamTrack.h: * platform/mediastream/mac/CoreAudioCaptureSource.cpp: * platform/mediastream/mac/CoreAudioCaptureSource.h: * platform/mock/MockRealtimeAudioSource.cpp: (WebCore::MockRealtimeAudioSource::setIsInterrupted): * platform/mock/MockRealtimeAudioSource.h: * platform/mock/MockRealtimeMediaSourceCenter.cpp: (WebCore::MockRealtimeMediaSourceCenter::setMockCaptureDevicesInterrupted): (WebCore::MockRealtimeMediaSourceCenter::setMockCameraIsInterrupted): Deleted. * platform/mock/MockRealtimeMediaSourceCenter.h: Source/WebKit: Add support for interrupt mock microphone devices. Send to WebProcess sources whether sources are interrupted each time the source muted value changes. Store that value in remote sources. * GPUProcess/GPUProcess.cpp: * GPUProcess/GPUProcess.h: * GPUProcess/GPUProcess.messages.in: * UIProcess/API/C/WKPage.cpp: * UIProcess/API/C/WKPagePrivate.h: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: * UIProcess/GPU/GPUProcessProxy.cpp: * UIProcess/GPU/GPUProcessProxy.h: * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: * WebProcess/WebPage/WebPage.cpp: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/cocoa/RemoteRealtimeAudioSource.h: * WebProcess/cocoa/RemoteRealtimeDisplaySource.h: * WebProcess/cocoa/RemoteRealtimeMediaSourceProxy.cpp: * WebProcess/cocoa/RemoteRealtimeMediaSourceProxy.h: * WebProcess/cocoa/RemoteRealtimeVideoSource.h: * WebProcess/cocoa/UserMediaCaptureManager.cpp: * WebProcess/cocoa/UserMediaCaptureManager.h: * WebProcess/cocoa/UserMediaCaptureManager.messages.in: Source/WTF: * Scripts/Preferences/WebPreferencesInternal.yaml: Tools: Add support for interrupt mock microphone devices. * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: * WebKitTestRunner/InjectedBundle/TestRunner.cpp: * WebKitTestRunner/InjectedBundle/TestRunner.h: * WebKitTestRunner/TestController.cpp: * WebKitTestRunner/TestController.h: * WebKitTestRunner/TestInvocation.cpp: LayoutTests: * fast/mediastream/media-stream-video-track-interrupted-from-audio-expected.txt: Added. * fast/mediastream/media-stream-video-track-interrupted-from-audio.html: Added. * fast/mediastream/media-stream-video-track-interrupted.html: Migrated to testRunner API. * fast/mediastream/track-ended-while-muted.html: * platform/glib/TestExpectations: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290985 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-03-08 Youenn Fablet Add a preference to mute video capture in case audio capture gets interrupted https://bugs.webkit.org/show_bug.cgi?id=237524 Reviewed by Eric Carlson. * Scripts/Preferences/WebPreferencesInternal.yaml: 2022-03-23 Alan Coon Cherry-pick r290978. rdar://problem/89901536 Add early return for empty path in makeAllDirectories https://bugs.webkit.org/show_bug.cgi?id=237540 rdar://89901536 Reviewed by Chris Dumez. Source/WTF: * wtf/posix/FileSystemPOSIX.cpp: (WTF::FileSystemImpl::makeAllDirectories): Tools: * TestWebKitAPI/Tests/WTF/FileSystem.cpp: (TestWebKitAPI::TEST_F): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290978 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-03-08 Sihui Liu Add early return for empty path in makeAllDirectories https://bugs.webkit.org/show_bug.cgi?id=237540 rdar://89901536 Reviewed by Chris Dumez. * wtf/posix/FileSystemPOSIX.cpp: (WTF::FileSystemImpl::makeAllDirectories): 2022-03-21 Alan Coon Cherry-pick r291009. rdar://problem/89952347 AX: Speech Synthesis no longer returning list of voices in macOS 12.3 https://bugs.webkit.org/show_bug.cgi?id=237584 Reviewed by Andres Gonzalez. Source/WTF: The minimum macOS version was meant to be 13 and above, but we started including 12.x releases inadvertently. * wtf/PlatformHave.h: LayoutTests: * fast/speechsynthesis/voices-non-mock-expected.txt: Added. * fast/speechsynthesis/voices-non-mock.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@291009 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-03-08 Chris Fleizach AX: Speech Synthesis no longer returning list of voices in macOS 12.3 https://bugs.webkit.org/show_bug.cgi?id=237584 Reviewed by Andres Gonzalez. The minimum macOS version was meant to be 13 and above, but we started including 12.x releases inadvertently. * wtf/PlatformHave.h: 2022-03-21 Alan Coon Cherry-pick r290969. rdar://problem/89638872 Preconnecting after process swap is a page load time improvement on some devices https://bugs.webkit.org/show_bug.cgi?id=237055 Reviewed by Geoffrey Garen. Source/WebCore: Export method. * platform/network/NetworkLoadMetrics.h: Source/WebKit: On some devices we see that doing a second preconnect on HTTP/1.1 is a significant page load time improvement. This is due to the fact that most page loads on HTTP/1.1 will open several connections, and having two preconnected connections instead of one, will speed up page load time. This patch implements this by starting a second preconnect after the first has finished. It is important to wait until the first preconnect has finished, otherwise the second preconnect will go to waste, since the underlying network layer does not yet know if this is HTTP/1.1 or not. Since we do not see page load time improvement on iOS with this behavior, it is currently only enabled for macOS. The next step is to investigate why it does not seem to be a page load time improvement on iOS. We probably need to make sure the main resource load has started before we start the second preconect. This will avoid that the second preconnect returns immediately. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::sendH2Ping): (WebKit::NetworkConnectionToWebProcess::preconnectTo): * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::preconnectTo): * NetworkProcess/PreconnectTask.cpp: (WebKit::PreconnectTask::PreconnectTask): (WebKit::PreconnectTask::didFinishLoading): (WebKit::PreconnectTask::didFailLoading): (WebKit::PreconnectTask::didFinish): * NetworkProcess/PreconnectTask.h: * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp: (WebKit::NetworkCache::SpeculativeLoadManager::preconnectForSubresource): Source/WTF: Add ENABLE guard for this behavior. * wtf/PlatformEnableCocoa.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290969 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-03-07 Per Arne Vollan Preconnecting after process swap is a page load time improvement on some devices https://bugs.webkit.org/show_bug.cgi?id=237055 Reviewed by Geoffrey Garen. Add ENABLE guard for this behavior. * wtf/PlatformEnableCocoa.h: 2022-03-07 Russell Epstein Cherry-pick r288746. rdar://problem/88093198 Enable inert attribute feature flag https://bugs.webkit.org/show_bug.cgi?id=235668 Reviewed by Darin Adler. * Scripts/Preferences/WebPreferencesExperimental.yaml: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288746 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-28 Tim Nguyen Enable inert attribute feature flag https://bugs.webkit.org/show_bug.cgi?id=235668 Reviewed by Darin Adler. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2022-03-07 Russell Epstein Cherry-pick r288700. rdar://problem/86602114 Default to 32 bit refcount for CanMakeCheckedPtr https://bugs.webkit.org/show_bug.cgi?id=235723 rdar://86602114 Reviewed by Darin Adler. Source/WTF: It is currently uint16_t for no good reason. It is no unreasonable to have an object being referenced by a large number of other objects. We just hit the first bug caused by overrunning it (in IFC). * wtf/CheckedRef.h: uint16_t -> uint32_t Tools: * TestWebKitAPI/Tests/WTF/CheckedPtr.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WTF/CheckedRef.cpp: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288700 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-27 Antti Koivisto Default to 32 bit refcount for CanMakeCheckedPtr https://bugs.webkit.org/show_bug.cgi?id=235723 rdar://86602114 Reviewed by Darin Adler. It is currently uint16_t for no good reason. It is no unreasonable to have an object being referenced by a large number of other objects. We just hit the first bug caused by overrunning it (in IFC). * wtf/CheckedRef.h: uint16_t -> uint32_t 2022-03-01 Russell Epstein Cherry-pick r289974. rdar://problem/89008799 Unreviewed, reverting r286874. https://bugs.webkit.org/show_bug.cgi?id=236734 Broke Apple Music pages which use the resolution media query Reverted changeset: "Enable the 'resolution' media query by default" https://bugs.webkit.org/show_bug.cgi?id=78087 https://commits.webkit.org/r286874 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@289974 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-02-16 Commit Queue Unreviewed, reverting r286874. https://bugs.webkit.org/show_bug.cgi?id=236734 Broke Apple Music pages which use the resolution media query Reverted changeset: "Enable the 'resolution' media query by default" https://bugs.webkit.org/show_bug.cgi?id=78087 https://commits.webkit.org/r286874 2022-02-16 Russell Epstein Apply patch. rdar://problem/87486284 2022-02-07 Russell Epstein Cherry-pick r288885. rdar://problem/88591342 Enhance sanitizeStackForVM() to assist with crash analysis. https://bugs.webkit.org/show_bug.cgi?id=235752 rdar://81014601 Reviewed by Michael Saboff. Source/JavaScriptCore: 1. Remove the AssemblyHelpers version of sanitizeStack. Instead, make the 3 JIT operation functions call sanitizeStackForVM() instead. This ensures that sanitizeStack crashes are not obscured as generic JIT crashes. 2. Add sanity check RELEASE_ASSERTs to VM::setLastStackTop() with a capture of the relevant variables for crash analysis. 3. Fix logSanitizeStack() so that it no longer relies on vm.topCallFrame. vm.topCallFrame may not be properly initialized at all the places that sanitizeStackForVM() is called. 4. Add a JSLock check to sanitizeStackForVM(), and return early if not owned by the current thread. If the JSLock is not owned by the current thread, we can't rely on vm.lastStackTop() being a sane value. Hence, it's not possible to do stack sanitization correctly. Add sanity check RELEASE_ASSERTs to sanitizeStackForVM() with a capture of the relevant variables for crash analysis. * jit/AssemblyHelpers.cpp: (JSC::AssemblyHelpers::sanitizeStackInline): Deleted. * jit/AssemblyHelpers.h: * jit/JITOperations.cpp: (JSC::JSC_DEFINE_JIT_OPERATION): * jit/ThunkGenerators.cpp: (JSC::slowPathFor): * runtime/JSLock.cpp: (JSC::JSLock::didAcquireLock): (JSC::JSLock::grabAllLocks): * runtime/VM.cpp: (JSC::VM::VM): (JSC::VM::setLastStackTop): (JSC::logSanitizeStack): (JSC::sanitizeStackForVM): * runtime/VM.h: Source/WTF: * wtf/Threading.h: (WTF::Thread::savedStackPointerAtVMEntry const): (WTF::Thread::savedLastStackTop const): (WTF::Thread::savedStackPointerAtVMEntry): Deleted. (WTF::Thread::savedLastStackTop): Deleted. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288885 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-02-01 Mark Lam Enhance sanitizeStackForVM() to assist with crash analysis. https://bugs.webkit.org/show_bug.cgi?id=235752 rdar://81014601 Reviewed by Michael Saboff. * wtf/Threading.h: (WTF::Thread::savedStackPointerAtVMEntry const): (WTF::Thread::savedLastStackTop const): (WTF::Thread::savedStackPointerAtVMEntry): Deleted. (WTF::Thread::savedLastStackTop): Deleted. 2022-02-07 Russell Epstein Cherry-pick r288831. rdar://problem/88268450 [iOS] SharePlay is shown prominently for system-provided Share Sheets https://bugs.webkit.org/show_bug.cgi?id=235895 rdar://88268450 Reviewed by Wenson Hsieh. Source/WebKit: Content shared using the Web Share API should not display a SharePlay action. * UIProcess/Cocoa/WKShareSheet.mm: (-[WKShareSheet presentWithShareDataArray:inRect:]): Use `-[UIActivityViewController setExcludedActivityTypes:]` to ensure a SharePlay action is not displayed. Source/WTF: * wtf/PlatformHave.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288831 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-31 Aditya Keerthi [iOS] SharePlay is shown prominently for system-provided Share Sheets https://bugs.webkit.org/show_bug.cgi?id=235895 rdar://88268450 Reviewed by Wenson Hsieh. * wtf/PlatformHave.h: 2022-02-07 Russell Epstein Cherry-pick r288706. rdar://problem/88152385 Change version number for HAVE_PASSKIT_DEFAULT_SHIPPING_METHOD https://bugs.webkit.org/show_bug.cgi?id=235732 Reviewed by Wenson Hsieh. * wtf/PlatformHave.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288706 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-27 Devin Rousso Change version number for HAVE_PASSKIT_DEFAULT_SHIPPING_METHOD https://bugs.webkit.org/show_bug.cgi?id=235732 Reviewed by Wenson Hsieh. * wtf/PlatformHave.h: 2022-02-07 Russell Epstein Cherry-pick r288590. rdar://problem/87984277 Disable input-security CSS property https://bugs.webkit.org/show_bug.cgi?id=235557 rdar://87984277 Reviewed by Dean Jackson. Source/WebCore: CSSWG is planning to remove input-security from CSS UI 4 (https://github.com/w3c/csswg-drafts/issues/6788). Keep the property around as an experimental feature, so that it can be used in the UA stylesheet, and easily turned on if the resolution is not finalized. * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::valueForPropertyInStyle): * css/CSSProperties.json: * css/parser/CSSParserContext.cpp: (WebCore::CSSParserContext::CSSParserContext): Enable input-security when parsing the UA stylesheet, as it is used to obscure text in password inputs. (WebCore::operator==): (WebCore::add): (WebCore::CSSParserContext::isPropertyRuntimeDisabled const): * css/parser/CSSParserContext.h: * css/parser/CSSParserFastPaths.cpp: (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue): Source/WebKitLegacy/win: Add support for tests enabling the CSSInputSecurityEnabled preference. * WebPreferences.cpp: (WebPreferences::cssInputSecurityEnabled): * WebPreferences.h: * WebView.cpp: (WebView::notifyPreferencesChanged): Source/WTF: * Scripts/Preferences/WebPreferencesExperimental.yaml: Make input-security a disabled-by-default experimental feature. Tools: * DumpRenderTree/TestOptions.cpp: (WTR::TestOptions::defaults): Add default for WebKitLegacy on Windows. LayoutTests: * fast/css/computed-text-security-for-input-security.html: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288590 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-25 Aditya Keerthi Disable input-security CSS property https://bugs.webkit.org/show_bug.cgi?id=235557 rdar://87984277 Reviewed by Dean Jackson. * Scripts/Preferences/WebPreferencesExperimental.yaml: Make input-security a disabled-by-default experimental feature. 2022-02-16 Keith Miller Disable some options that don't need to be on. * Scripts/Preferences/WebPreferences.yaml: * wtf/PlatformEnableCocoa.h: * wtf/PlatformHave.h 2022-01-28 Russell Epstein Cherry-pick r287961. rdar://problem/86282584 [Re-landing] Update hashThreadState() to exclude __opaque_flags. https://bugs.webkit.org/show_bug.cgi?id=235081 rdar://86282584 Reviewed by Keith Miller. Source/JavaScriptCore: Removed some unused code. * runtime/MachineContext.h: (JSC::MachineContext::stackPointer): (JSC::MachineContext::framePointer): (JSC::MachineContext::instructionPointer): (JSC::MachineContext::linkRegister): (JSC::MachineContext::setStackPointer): Deleted. (JSC::MachineContext::setFramePointer): Deleted. (JSC::MachineContext::setLinkRegister): Deleted. Source/WTF: The __opaque_flags may be used by the OS, and may be altered without our knowledge. Hence, our hash should not include the __opaque_flags field. Also remove some unused code. * wtf/PlatformRegisters.h: * wtf/threads/Signals.cpp: (WTF::hashThreadState): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@287961 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-12 Mark Lam [Re-landing] Update hashThreadState() to exclude __opaque_flags. https://bugs.webkit.org/show_bug.cgi?id=235081 rdar://86282584 Reviewed by Keith Miller. The __opaque_flags may be used by the OS, and may be altered without our knowledge. Hence, our hash should not include the __opaque_flags field. Also remove some unused code. * wtf/PlatformRegisters.h: * wtf/threads/Signals.cpp: (WTF::hashThreadState): 2022-01-24 Alan Coon Cherry-pick r288389. rdar://problem/85405320 Disable CFURLCache in WebKit2 https://bugs.webkit.org/show_bug.cgi?id=234988 Reviewed by Geoffrey Garen. Source/WebCore: _CFURLStorageSessionCopyCache can be slow (see rdar://85418732) and UI process may kill network process for being unresponsive. Since WebKit does not use CFURLCache, we should disable it to avoid the hang. * platform/network/NetworkStorageSession.h: * platform/network/cf/NetworkStorageSessionCFNet.cpp: (WebCore::NetworkStorageSession::createCFStorageSessionForIdentifier): * platform/network/cocoa/NetworkStorageSessionCocoa.mm: (WebCore::createPrivateStorageSession): Source/WebCore/PAL: * pal/spi/cf/CFNetworkSPI.h: Source/WebKit: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::newTestingSession): (WebKit::NetworkProcess::ensureSession): Source/WebKitLegacy: * WebCoreSupport/NetworkStorageSessionMap.cpp: (NetworkStorageSessionMap::ensureSession): Source/WTF: * wtf/PlatformHave.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288389 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-21 Sihui Liu Disable CFURLCache in WebKit2 https://bugs.webkit.org/show_bug.cgi?id=234988 Reviewed by Geoffrey Garen. * wtf/PlatformHave.h: 2022-01-24 Alan Coon Cherry-pick r287941. rdar://problem/87472589 [JSC] Enable libpas jit-heap when libpas is enabled https://bugs.webkit.org/show_bug.cgi?id=235042 Reviewed by Filip Pizlo. Previously, we enabled jit-heap only in ARM64 macOS. We should enable it when libpas is enabled. * wtf/PlatformUse.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@287941 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-10 Yusuke Suzuki [JSC] Enable libpas jit-heap when libpas is enabled https://bugs.webkit.org/show_bug.cgi?id=235042 Reviewed by Filip Pizlo. Previously, we enabled jit-heap only in ARM64 macOS. We should enable it when libpas is enabled. * wtf/PlatformUse.h: 2022-01-10 Youenn Fablet Compile out ENABLE_MEDIA_CAPTURE on WATCHOS and APPLETV https://bugs.webkit.org/show_bug.cgi?id=234946 Reviewed by Sam Weinig. * wtf/PlatformEnableCocoa.h: 2022-01-09 Sam Weinig Remove support for Direct2D https://bugs.webkit.org/show_bug.cgi?id=234999 Reviewed by Darin Adler. * wtf/PlatformFTW.cmake: Removed. 2022-01-09 Sam Weinig Add helpers to access CoreGraphics color spaces more easily in generic contexts https://bugs.webkit.org/show_bug.cgi?id=235004 Reviewed by Darin Adler. * wtf/PlatformHave.h: Update have macro, HAVE_CORE_GRAPHICS_XYZ_COLOR_SPACE, to have a more specific name, HAVE_CORE_GRAPHICS_XYZ_D50_COLOR_SPACE, which is really what it is. 2022-01-07 Tim Horton Adopt linkedOnOrAfter() in more places https://bugs.webkit.org/show_bug.cgi?id=234951 Reviewed by Wenson Hsieh. * wtf/cocoa/LanguageCocoa.mm: (WTF::canMinimizeLanguages): Adopt linkedOnOrAfter and simplify. * wtf/cocoa/RuntimeApplicationChecksCocoa.h: The weird mismatch between the iOS and macOS values for FirstVersionThatSupportsInitConstructors is correct; the iOS version was bumped in r202670. 2022-01-07 Alex Christensen Unreviewed, reverting r287698. Broke an internal build Reverted changeset: "Start using C++20" https://bugs.webkit.org/show_bug.cgi?id=233963 https://commits.webkit.org/r287698 2022-01-07 Alex Christensen Unreviewed, reverting r287718. Broke an internal build Reverted changeset: "[PlayStation] Fix build break after r287698" https://bugs.webkit.org/show_bug.cgi?id=234931 https://commits.webkit.org/r287718 2022-01-06 Tim Horton Move linkedOnOrAfter() to WTF https://bugs.webkit.org/show_bug.cgi?id=234942 Reviewed by Darin Adler. Move linkedOnOrAfter() and the associated SDKVersion enum to WTF from WebCore. This precedes a series of patches that will adopt it in WTF and JavaScriptCore, and then replace the underlying mechanism with a slightly more flexible one. * wtf/cocoa/RuntimeApplicationChecksCocoa.cpp: (WTF::linkedOnOrAfter): * wtf/cocoa/RuntimeApplicationChecksCocoa.h: 2022-01-06 Wenson Hsieh Add a helper function that returns the value of a std::optional or constructs T if needed https://bugs.webkit.org/show_bug.cgi?id=234865 Reviewed by Darin Adler. Add a new helper function that returns the value of a given `std::optional` if it exists, and otherwise constructs and returns `Type { }`. Currently, the alternative to this is writing out the `Type { }` in full when passing in an argument to `value_or`; using this avoids some redundancy and makes the expression a bit easier to read. * wtf/StdLibExtras.h: (WTF::valueOrDefault): 2022-01-06 Tim Horton Separate "linked-on-or-{before, after}-everything" override from the SDK version https://bugs.webkit.org/show_bug.cgi?id=234930 Reviewed by Wenson Hsieh. * wtf/cocoa/RuntimeApplicationChecksCocoa.cpp: (WTF::linkedOnOrAfterOverrideValue): (WTF::setLinkedOnOrAfterOverride): (WTF::linkedOnOrAfterOverride): * wtf/cocoa/RuntimeApplicationChecksCocoa.h: Add an explicit optional bit for "this application should pretend to be linked on or {after, before} everything" instead of just overriding the SDK version. This is a prerequisite for getting rid of applicationSDKVersion(), which will happen in a future patch. This is in WTF because linkedOnOrAfter() is going to move here in a future patch as well. 2022-01-06 Stephan Szabo [PlayStation] Fix build break after r287698 https://bugs.webkit.org/show_bug.cgi?id=234931 Unreviewed build fix * wtf/PlatformHave.h: Use MISSING_STD_FILESYSTEM_PATH_CONSTRUCTOR on PlayStation 2022-01-06 Alex Christensen Start using C++20 https://bugs.webkit.org/show_bug.cgi?id=233963 Reviewed by Yusuke Suzuki. * Configurations/Base.xcconfig: * wtf/DisallowCType.h: * wtf/FileSystem.cpp: (WTF::FileSystemImpl::toStdFileSystemPath): (WTF::FileSystemImpl::fromStdFileSystemPath): * wtf/PlatformHave.h: * wtf/VectorTraits.h: * wtf/text/StringOperators.h: 2022-01-05 John Wilander Change version number for HAVE_RSA_PSS_OID https://bugs.webkit.org/show_bug.cgi?id=234904 Reviewed by Alex Christensen. * wtf/PlatformHave.h: 2022-01-05 Tim Horton Momentum Event Dispatcher: Momentum tails may get truncated if the duration runs longer than the system's https://bugs.webkit.org/show_bug.cgi?id=234535 Reviewed by Simon Fraser. * wtf/PlatformHave.h: Add a HAVE for kIOHIDEventScrollMomentumInterrupted. 2021-12-31 Yusuke Suzuki [JSC] Replace UDIS86 with Zydis https://bugs.webkit.org/show_bug.cgi?id=234765 Reviewed by Michael Saboff. * wtf/PlatformEnable.h: 2021-12-29 Sam Weinig Add additional named color spaces for extended rgb color types and HSL/HWB in preparation for out of gamut and missing component support https://bugs.webkit.org/show_bug.cgi?id=234741 Reviewed by Dean Jackson. * wtf/PlatformHave.h: Add new HAVE macros for additional CoreGraphics named color spaces and the CGColorSpaceCreateExtended function. 2021-12-28 Sam Weinig Support color interpolation methods for CSS Gradients https://bugs.webkit.org/show_bug.cgi?id=234711 Reviewed by Simon Fraser. Add new experimental feature flag, CSSGradientInterpolationColorSpacesEnabled, to gate support for interpolation methods in CSS gradients. Off by default. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-12-28 Sam Weinig Enhance Vector::map to allow specifying what kind of Vector to return (e.g. inline capacity, overflow, etc.) https://bugs.webkit.org/show_bug.cgi?id=234683 Reviewed by Darin Adler. * wtf/Vector.h: (WTF::Vector::map const): Add an overload of Vector::map() that allows specifying the type of the result Vector. To make this work without giving up the argument deduction in the common case, SFINAE is used to determine which overload to use. 2021-12-28 Zan Dobersek [RISCV64] Enable signal-based VM traps for CPU(RISCV64) https://bugs.webkit.org/show_bug.cgi?id=234719 Reviewed by Yusuke Suzuki. * wtf/PlatformEnable.h: Define ENABLE_SIGNAL_BASED_VM_TRAPS for CPU(RISCV64). 2021-12-28 Zan Dobersek [RISCV64] Define HAVE_MACHINE_CONTEXT, provide mcontext_t accessors for CPU(RISCV64) https://bugs.webkit.org/show_bug.cgi?id=234718 Reviewed by Yusuke Suzuki. * wtf/PlatformHave.h: Define HAVE_MACHINE_CONTEXT for CPU(RISCV64). 2021-12-23 Sam Weinig Gradient color interpolation incorrect for colors with alpha (need to interpolate premultiplied colors) https://bugs.webkit.org/show_bug.cgi?id=150940 Reviewed by Simon Fraser. Enable CSSGradientPremultipliedAlphaInterpolationEnabled by default. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-12-23 Brady Eidson Add WTF::UUID class which is natively a 128-bit integer https://bugs.webkit.org/show_bug.cgi?id=234571 Reviewed by Alex Christensen. This patch adds a new WTF::UUID class. For now, it is simply a wrapper around a 128-bit integer, and creating a new one primes that integer with cryptographically random data. It can be encoded/decoded as well as used as a HashKey. And it will be a great utility to use as a unique object identifier for objects that logically exist in multiple processes. On that note, it also changes "UUIDIdentifier" to use this new UUID class instead of a v4 UUID string. * wtf/Identified.h: (WTF::UUIDIdentified::UUIDIdentified): * wtf/UUID.cpp: (WTF::UUID::UUID): (WTF::UUID::toVector const): (WTF::UUID::hash const): * wtf/UUID.h: (WTF::UUID::create): (WTF::UUID::UUID): (WTF::UUID::operator== const): (WTF::UUID::data const): (WTF::UUID::isHashTableDeletedValue const): (WTF::UUIDHash::hash): (WTF::UUIDHash::equal): (WTF::HashTraits::emptyValue): (WTF::HashTraits::constructDeletedValue): (WTF::HashTraits::isDeletedValue): (WTF::UUID::encode const): (WTF::UUID::decode): 2021-12-23 Sihui Liu Ensure file handles used in FileSystemAccess API are closed https://bugs.webkit.org/show_bug.cgi?id=234520 Reviewed by Darin Adler. * wtf/CrossThreadCopier.h: 2021-12-22 Sihui Liu WebsiteDataStore::excludeDirectoryFromBackup should set attribute for existing directories https://bugs.webkit.org/show_bug.cgi?id=234404 Reviewed by Youenn Fablet. * wtf/FileSystem.cpp: (WTF::FileSystemImpl::excludeFromBackup): (WTF::FileSystemImpl::canExcludeFromBackup): Deleted. * wtf/FileSystem.h: * wtf/cocoa/FileSystemCocoa.mm: (WTF::FileSystemImpl::excludeFromBackup): * wtf/mac/FileSystemMac.mm: (WTF::FileSystem::canExcludeFromBackup): Deleted. (WTF::FileSystem::excludeFromBackup): Deleted. 2021-12-22 Commit Queue Unreviewed, reverting r287364. https://bugs.webkit.org/show_bug.cgi?id=234620 broke 3 API tests Reverted changeset: "Preferences that read from NSUserDefaults need to be initialied from platformInitializeStore()" https://bugs.webkit.org/show_bug.cgi?id=234488 https://commits.webkit.org/r287364 2021-12-22 Zan Dobersek [RISCV64] Add RISCV64 support in YARR https://bugs.webkit.org/show_bug.cgi?id=234547 Reviewed by Yusuke Suzuki. * wtf/PlatformEnable.h: Also enable different YARR-related flags for RISCV64. 2021-12-22 Simon Fraser Preferences that read from NSUserDefaults need to be initialied from platformInitializeStore() https://bugs.webkit.org/show_bug.cgi?id=234488 Reviewed by Sam Weinig. Having the default value for a preference read from NSUserDefaults can cause issues if the UIProcess and WebProcess values don't match. Instead, have platformInitializeStore() explicitly add values for these keys; this is done for scrollAnimatorEnabledKey. * Scripts/Preferences/WebPreferences.yaml: 2021-12-22 J Pascoe [WebAuthn] Set Web Authentication experimental feature flag as default true https://bugs.webkit.org/show_bug.cgi?id=234533 Reviewed by Brent Fulgham. The Web Authentication feature has been shipping for a while. Default value for experimental feature flag should be true. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-12-21 Brady Eidson Make Notification identifiers be a UUID string instead of a uint64_t https://bugs.webkit.org/show_bug.cgi?id=234534 Reviewed by Alex Christensen. Add a new form of Identified that uses a UUID String as the identifier. * wtf/Identified.h: (WTF::UUIDIdentified::UUIDIdentified): 2021-12-21 Sam Weinig Add support for premultiplied alpha interpolated gradients and defaulted off option to use them for CSS Gradients https://bugs.webkit.org/show_bug.cgi?id=234492 Reviewed by Simon Fraser. * Scripts/Preferences/WebPreferencesExperimental.yaml: Add a new experimental setting to enable premultiplied alpha CSS gradients. 2021-12-21 Yusuke Suzuki [WTF] Remove RefCountedArray and use RefCountedFixedVector https://bugs.webkit.org/show_bug.cgi?id=234484 Reviewed by Dean Jackson. Use RefCountedFixedVector instead of RefCountedArray and remove RefCountedArray. RefCountedFixedVector is much simpler interface: it is just using Ref<> / RefPtr<> instead of integrating ref-counting holder semantics into the class itself. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/FixedVector.h: * wtf/RefCountedArray.cpp: Removed. * wtf/RefCountedArray.h: Removed. * wtf/WTFAssertions.cpp: 2021-12-20 Alexey Shvayka [WebIDL] convertVariadicArguments() should return a FixedVector https://bugs.webkit.org/show_bug.cgi?id=232639 Reviewed by Yusuke Suzuki. Introduce std::initializer_list constructor for FixedVector and a WTF::map() overload. * wtf/FixedVector.h: (WTF::FixedVector::FixedVector): (WTF::map): * wtf/VectorTraits.h: 2021-12-20 Fujii Hironori MSVC reports "wtf/RetainPtr.h(196): error C3861: 'CFAutorelease': identifier not found " with /permissive- on Windows https://bugs.webkit.org/show_bug.cgi?id=202842 Reviewed by Darin Adler. r287200 fixed the problem, but not a right fix. * wtf/PlatformHave.h: Defined a new macro HAVE_CFAUTORELEASE for PLATFORM(COCOA). * wtf/RetainPtr.h: Use HAVE(CFAUTORELEASE) instead of PLATFORM(COCOA). 2021-12-19 Brady Eidson Stub out NotificationEvent and related https://bugs.webkit.org/show_bug.cgi?id=234420 Reviewed by Alex Christensen. * Scripts/Preferences/WebPreferencesInternal.yaml: * wtf/PlatformEnable.h: 2021-12-18 Darin Adler Hash tables, read/write, and heap memory are used unnecessarily, which may hurt performance https://bugs.webkit.org/show_bug.cgi?id=234438 Reviewed by Anders Carlsson. * wtf/SortedArrayMap.h: (WTF::SortedArrayMap::contains const): Added. More elegant than calling tryGet and treating the pointer as a boolean. (WTF::makeOptionalFromPointer): Moved here so it can be reused. Might rename later, since it's only used in a few places. 2021-12-17 Simon Fraser Read the default value of the ScrollAnimatorEnabled setting from NSUserDefaults https://bugs.webkit.org/show_bug.cgi?id=234456 Reviewed by Tim Horton. It's impossible for a test to run with an animated keyboard scroll because platformAllowsScrollAnimation(), which reads from NSUserDefaults, always trumps the Setting. Fix by initializing the setting from NSUserDefaults and removing the platformAllowsScrollAnimation() check. This allows for a WebKitTestRunner test override the setting. Remove the WTR code that sets @"NSScrollAnimationEnabled" to @NO. Unfortunately in WebKitLegacy AppKit code consults the @"NSScrollAnimationEnabled" key, so DumpRenderTree has to continue to initialize this NSUserDefault to @NO and tests that try to change the Setting will fail. * Scripts/Preferences/WebPreferences.yaml: 2021-12-17 Simon Fraser Rename MockScrollAnimatorEnabled to MockScrollbarsControllerEnabled https://bugs.webkit.org/show_bug.cgi?id=234452 Reviewed by Anders Carlsson. The class formerly known as MockScrollAnimatorEnabled is used for logging when scrollbars get events, so fix the name. It's a subclass of ScrollbarsController. * Scripts/Preferences/WebPreferences.yaml: 2021-12-17 Yusuke Suzuki [WTF] Introduce TrailingArray https://bugs.webkit.org/show_bug.cgi?id=234201 Reviewed by Darin Adler. This patch implements TrailingArray, which allows us to implement class with trailing array easily. By using this, we implement EmbeddedFixedVector and RefCountedFixedVector. Plus, we replace underlying implementation of FixedVector from RefCountedArray to EmbeddedFixedVector since ref-counting is not necessary. This is great for swapping: while RefCountedArray will decrease ref and touching memory when destryoing, EmbeddedFixedVector does not, so we can keep memory untouched if EmbeddedFixedVector's T is POD when destroying. In a subsequent patch, we will remove RefCountedArray and use RefCountedFixedVector since RefCountedFixedVector is following normal Ref / RefPtr protocol, so easy to understand the semantics. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/EmbeddedFixedVector.h: Added. * wtf/FixedVector.h: (WTF::FixedVector::FixedVector): (WTF::FixedVector::operator=): (WTF::FixedVector::size const): (WTF::FixedVector::isEmpty const): (WTF::FixedVector::byteSize const): (WTF::FixedVector::data): (WTF::FixedVector::begin): (WTF::FixedVector::end): (WTF::FixedVector::rbegin): (WTF::FixedVector::rend): (WTF::FixedVector::rbegin const): (WTF::FixedVector::rend const): (WTF::FixedVector::at): (WTF::FixedVector::at const): (WTF::FixedVector::operator[]): (WTF::FixedVector::operator[] const): (WTF::FixedVector::fill): (WTF::FixedVector::operator!= const): (WTF::FixedVector::operator== const): (WTF::FixedVector::swap): (WTF::FixedVector::getStorage): * wtf/RefCountedFixedVector.h: Added. * wtf/TrailingArray.h: Added. (WTF::TrailingArray::TrailingArray): (WTF::TrailingArray::~TrailingArray): (WTF::TrailingArray::allocationSize): (WTF::TrailingArray::size const): (WTF::TrailingArray::isEmpty const): (WTF::TrailingArray::byteSize const): (WTF::TrailingArray::data): (WTF::TrailingArray::data const): (WTF::TrailingArray::begin): (WTF::TrailingArray::end): (WTF::TrailingArray::begin const): (WTF::TrailingArray::end const): (WTF::TrailingArray::cbegin const): (WTF::TrailingArray::cend const): (WTF::TrailingArray::rbegin): (WTF::TrailingArray::rend): (WTF::TrailingArray::rbegin const): (WTF::TrailingArray::rend const): (WTF::TrailingArray::crbegin const): (WTF::TrailingArray::crend const): (WTF::TrailingArray::at): (WTF::TrailingArray::at const): (WTF::TrailingArray::operator[]): (WTF::TrailingArray::operator[] const): (WTF::TrailingArray::first): (WTF::TrailingArray::first const): (WTF::TrailingArray::last): (WTF::TrailingArray::last const): (WTF::TrailingArray::fill): (WTF::TrailingArray::offsetOfSize): (WTF::TrailingArray::offsetOfData): 2021-12-17 Sihui Liu Add custom copy() method for Ref to CrossThreadCopier https://bugs.webkit.org/show_bug.cgi?id=234411 Reviewed by Youenn Fablet. * wtf/CrossThreadCopier.cpp: * wtf/CrossThreadCopier.h: 2021-12-17 Fujii Hironori MSVC reports "wtf/RetainPtr.h(196): error C3861: 'CFAutorelease': identifier not found " with /permissive- on Windows https://bugs.webkit.org/show_bug.cgi?id=202842 Reviewed by Alex Christensen and Darin Adler. MSVC /std:c++20 option implicitly enables /permissive- option. However, RetainPtr.h can't compile because 'CFAutorelease' is not defined. CFAutorelease isn't available in AppleWin's CoreFoundation and WinCairo's OpenCFLite as of now. * wtf/RetainPtr.h: Enclosed RetainPtr::autorelease with #if !OS(WINDOWS). 2021-12-16 Alex Christensen Unreviewed, reverting r287056. Caused performance regression...again Reverted changeset: "Remove properties set by NSURLProtocol on NSURLRequest before serializing" https://bugs.webkit.org/show_bug.cgi?id=232332 https://commits.webkit.org/r287056 2021-12-15 Darin Adler Many call sites use makeNeverDestroyed, but could instead take advantage of the NeverDestroyed deduction guide https://bugs.webkit.org/show_bug.cgi?id=234350 Reviewed by Sam Weinig. * wtf/NeverDestroyed.h: (WTF::makeNeverDestroyed): Deleted. * wtf/text/cf/StringImplCF.cpp: (WTF::StringWrapperCFAllocator::allocator): Use deduction guide. 2021-12-15 Alex Christensen Remove unreachable code in Plugin and PluginController https://bugs.webkit.org/show_bug.cgi?id=234365 Reviewed by Geoff Garen and Anders Carlsson. * Scripts/Preferences/WebPreferences.yaml: * Scripts/Preferences/WebPreferencesInternal.yaml: 2021-12-15 Chris Dumez Support passing an old-style enum to add(Hasher&, ...) https://bugs.webkit.org/show_bug.cgi?id=234368 Reviewed by Darin Adler. Support passing an old-style enum to add(Hasher&, ...). Previously, it would work for enum classes but lead to ambiguity errors with some compiler when passing a plain enum. * wtf/Hasher.h: (WTF::Hasher::add): (WTF::add): 2021-12-15 Jer Noble [Mac] Adopt -[NSScreen safeAreaInsets] https://bugs.webkit.org/show_bug.cgi?id=234291 Reviewed by Eric Carlson. * wtf/PlatformHave.h: 2021-12-15 Chris Dumez Move SWServers from NetworkProcess to NetworkSession https://bugs.webkit.org/show_bug.cgi?id=234179 Reviewed by Darin Adler. * wtf/MemoryPressureHandler.h: Using a bool as underlying type for those enum classes is sufficient. 2021-12-15 Tomoki Imai [PlayStation] Use FileSystem instead of FileSystemPlayStation except several unsupported APIs https://bugs.webkit.org/show_bug.cgi?id=234337 Reviewed by Don Olmstead. PlayStation should use FileSystem as its current SDK supports std::filesystem. We have to maintain FileSystemPlayStation for now to supply some of FileSystem APIs because the following functions are not supported yet. - std::filesystem::space - std::filesystem::rename - std::filesystem::canonical - std::filesystem::directory_iterator - std::filesystem::remove_all The plan is to remove FileSystemPlayStation entirely after the SDK supports these functions. This patch also fixes the incompatible issue of FileSystem::listDirectory of FileSystemPlayStation. FileSystem::listDirectory is expected to return only the names, but it actually returns full paths. Confirmed that there is no regression in FileSystem related testcases in TestWTF. * wtf/FileSystem.cpp: Add PLATFORM(PLAYSTATION) guards not to use unsupported std::filesystem APIs. * wtf/playstation/FileSystemPlayStation.cpp: Remove the functions duplicated with FileSystem. Make FileSystem::listDirectory returns only names. Add listDirectorySub which can return a full path because deleteNonEmptyDirectory depends on it. 2021-12-15 Youenn Fablet Make use of PLATFORM(COCOA) in MediaRecorder WebPreference https://bugs.webkit.org/show_bug.cgi?id=234339 Reviewed by Eric Carlson. * Scripts/Preferences/WebPreferencesExperimental.yaml: HAVE(AVASSETWRITERDELEGATE) has been removed from PlatformHave.h given it was true on all supported platforms. But it was still used to guard MediaRecorder preference, thus MediaRecorder got disabled inadvertently. Let's guard MediaRecorder with PLATFORM(COCOA). 2021-12-14 Alex Christensen Remove properties set by NSURLProtocol on NSURLRequest before serializing https://bugs.webkit.org/show_bug.cgi?id=232332 Reviewed by Geoff Garen. * wtf/PlatformHave.h: 2021-12-14 Darin Adler Automatically generate event handler content attribute maps so they are easier to maintain https://bugs.webkit.org/show_bug.cgi?id=234254 Reviewed by Alexey Shvayka. * wtf/NeverDestroyed.h: Add a deduction guide for NeverDestroyed. In the future we can use this instead of makeNeverDestroyed or writing out the entire template class type including template arguments. 2021-12-13 Saam Barati Roll back r286345, r286387, r286471, r286667, r286849 https://bugs.webkit.org/show_bug.cgi?id=234268 Reviewed by Mark Lam. * wtf/OSAllocator.h: * wtf/posix/OSAllocatorPOSIX.cpp: (WTF::OSAllocator::reserveUncommittedAligned): Deleted. 2021-12-13 Antoine Quint CustomEffect and animation frame rate should be disabled by default in STP https://bugs.webkit.org/show_bug.cgi?id=234251 Reviewed by Dean Jackson. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-12-13 Chris Dumez Unreviewed build fix after r286971. * wtf/spi/darwin/dyldSPI.h: 2021-12-13 Chris Dumez Regression(r283565) Unable to report private messages as Spam in Twitter app https://bugs.webkit.org/show_bug.cgi?id=234253 Reviewed by Alex Christensen. Add some new iOS / macOS versions. * wtf/spi/darwin/dyldSPI.h: 2021-12-13 Elliott Williams Deployment target for macOS 11+ does not follow minor version bumps https://bugs.webkit.org/show_bug.cgi?id=233906 Reviewed by Alexey Proskuryakov. * Configurations/DebugRelease.xcconfig: * wtf/PlatformHave.h: Add feature define which has been public since macOS 11.0 2021-12-11 Don Olmstead Add a std::nullptr_t constructor for RefPtr https://bugs.webkit.org/show_bug.cgi?id=234192 Reviewed by Yusuke Suzuki. Add the constexpr constructor RefPtr(std::nullptr_t) with the same behavior as the default constructor. Both std::unique_ptr and std::shared_ptr have this same overload to optimize for the nullptr case. As an added bonus this also makes it so `0` can't fill in as a nullptr since the ambiguity will cause a compilation error. * wtf/RefPtr.h: (WTF::RefPtr::RefPtr): 2021-12-11 Commit Queue Unreviewed, reverting r286893. https://bugs.webkit.org/show_bug.cgi?id=234197 Breaks the build Reverted changeset: "[macOS] Add new screen and window capture backend" https://bugs.webkit.org/show_bug.cgi?id=234029 https://commits.webkit.org/r286893 2021-12-11 Jer Noble Add an experimental VideoTrackConfiguration class and accessor on VideoTrack https://bugs.webkit.org/show_bug.cgi?id=230841 Reviewed by Eric Carlson. Drive-by change: add a Vector::reverseFindMatching convenience method. * Scripts/Preferences/WebPreferencesExperimental.yaml: * wtf/Vector.h: (WTF::Malloc>::reverseFindMatching const): 2021-12-10 Eric Carlson [macOS] Add new screen and window capture backend https://bugs.webkit.org/show_bug.cgi?id=234029 Reviewed by Jer Noble and Youenn Fablet. * Scripts/Preferences/WebPreferencesExperimental.yaml: Add UseScreenCaptureKit. * wtf/PlatformHave.h: Define HAVE_SCREEN_CAPTURE_KIT. * wtf/cocoa/SoftLinking.h: Add softlink macros that take an API_AVAILABLE check. 2021-12-10 Don Olmstead Add FileSystem function to read a file at a path https://bugs.webkit.org/show_bug.cgi?id=234103 Reviewed by Alex Christensen. Add FileSystem::readEntireFile which takes a path and attempts to read the whole contents of the file into a Vector. If the file is not found or is empty then it returns nullopt. Internally it manages the opening and closing of the file to prevent file handles from leaking. Modify FileSystem::readEntireFile which takes a handle to continue reading until the entire file has been read. Previously it could've just done a partial read as FileSystem::readFromFile does not guarantee it will read all the bytes requested. * wtf/FileSystem.cpp: (WTF::FileSystemImpl::readEntireFile): * wtf/FileSystem.h: 2021-12-10 Antoine Quint Expose the maximum device frame rate to the Web Animations model https://bugs.webkit.org/show_bug.cgi?id=234161 rdar://85983792 Reviewed by Simon Fraser. Add a new experimental feature controlling the availability of per-animation frame rate. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-12-10 Sam Sneddon Enable the 'resolution' media query by default https://bugs.webkit.org/show_bug.cgi?id=78087 Reviewed by Simon Fraser. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-12-09 Darin Adler Use simpler idioms for std::less and std::greater possible in modern C++ https://bugs.webkit.org/show_bug.cgi?id=234117 Reviewed by Anders Carlsson. * wtf/ListDump.h: (WTF::sortedListDump): Removed unnecessary template arguments to std::less. 2021-12-10 Keith Miller Reduce maximum mmap size for Structure regions to help placate ios https://bugs.webkit.org/show_bug.cgi?id=234091 Reviewed by Saam Barati. Use mach_vm_map since that supports memory alignement so we don't have to map 2x desired address space then free then trim. * wtf/PlatformHave.h: * wtf/posix/OSAllocatorPOSIX.cpp: (WTF::OSAllocator::reserveUncommittedAligned): 2021-12-10 Antti Koivisto [CSS Container Queries] Basic @container at-rule parsing support https://bugs.webkit.org/show_bug.cgi?id=234135 Reviewed by Antoine Quint. * Scripts/Preferences/WebPreferencesExperimental.yaml: Add preference for container queries, disabled by default. 2021-12-09 Alan Bujtas Enable the CSS Contain property by default https://bugs.webkit.org/show_bug.cgi?id=234020 Reviewed by Brent Fulgham. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-12-09 Ryan Haddad Unreviewed, reverting r286804. Breaks internal builds. Reverted changeset: "Reduce maximum mmap size for Structure regions to help placate ios" https://bugs.webkit.org/show_bug.cgi?id=234091 https://commits.webkit.org/r286804 2021-12-09 Alex Christensen Prepare for transition to C++20 https://bugs.webkit.org/show_bug.cgi?id=234022 Reviewed by Yusuke Suzuki. In C++20, volitile is deprecated, operator== is stricter (related to the introduction of operator <=>), and operations on enums of different types are stricter too. This does the changes we can do before the transition, which will be done in bug 233963. * wtf/DateMath.h: (WTF::LocalTimeOffset::operator== const): (WTF::LocalTimeOffset::operator!= const): (WTF::LocalTimeOffset::operator==): Deleted. (WTF::LocalTimeOffset::operator!=): Deleted. * wtf/FastBitVector.h: (WTF::FastBitVectorImpl::operator== const): (WTF::FastBitVectorImpl::operator!= const): * wtf/GenericTimeMixin.h: (WTF::GenericTimeMixin::operator== const): (WTF::GenericTimeMixin::operator!= const): (WTF::GenericTimeMixin::operator< const): (WTF::GenericTimeMixin::operator> const): (WTF::GenericTimeMixin::operator<= const): (WTF::GenericTimeMixin::operator>= const): * wtf/IteratorAdaptors.h: (WTF::FilterIterator::operator== const): (WTF::FilterIterator::operator!= const): (WTF::TransformIterator::operator== const): (WTF::TransformIterator::operator!= const): * wtf/Liveness.h: (WTF::Liveness::LocalCalc::Iterable::iterator::operator== const): (WTF::Liveness::LocalCalc::Iterable::iterator::operator!= const): (WTF::Liveness::LocalCalc::Iterable::iterator::operator==): Deleted. (WTF::Liveness::LocalCalc::Iterable::iterator::operator!=): Deleted. 2021-12-09 Alex Christensen Use Span for IPC::ArrayReference and DataReference https://bugs.webkit.org/show_bug.cgi?id=233931 Reviewed by Wenson Hsieh. * wtf/Vector.h: (WTF::Vector::Vector): (WTF::Vector::span const): 2021-12-09 Robert Jenner Unreviewed, reverting r286754. Broke 2 tests on all mac an iOS Reverted changeset: "Add an experimental trackConfiguration accessor on AudioTrack & VideoTrack." https://bugs.webkit.org/show_bug.cgi?id=230841 https://commits.webkit.org/r286754 2021-12-09 Keith Miller Reduce maximum mmap size for Structure regions to help placate ios https://bugs.webkit.org/show_bug.cgi?id=234091 Reviewed by Saam Barati. Use mach_vm_map since that supports memory alignement so we don't have to map 2x desired address space then free then trim. * wtf/PlatformHave.h: * wtf/posix/OSAllocatorPOSIX.cpp: (WTF::OSAllocator::reserveUncommittedAligned): 2021-12-09 Antti Koivisto Enable :focus-visible pseudo-class by default https://bugs.webkit.org/show_bug.cgi?id=234019 Reviewed by Brent Fulgham. This enables :focus-visible pseudo-class for authors. It also changes :focus-visible behavior in the user agent stylesheet so that -
(or any element with 'tabindex' attribute that is not focusable otherwise) will not show focus indicator when focused via click/tap/script. -
element will not show focus indicator when focused via click/tap/script. Both still show focus indicator when focused via keyboard (tab) navigation. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-12-09 Myles C. Maxfield and Don Olmstead Move TextCodec files from WebCore/platform/text to WebCore/PAL/text https://bugs.webkit.org/show_bug.cgi?id=233683 Reviewed by Yusuke Suzuki. Update to use the new PAL files. * Scripts/Preferences/WebPreferences.yaml: 2021-12-08 Jer Noble Add an experimental VideoTrackConfiguration class and accessor on VideoTrack https://bugs.webkit.org/show_bug.cgi?id=230841 Reviewed by Eric Carlson. Drive-by change: add a Vector::reverseFindMatching convenience method. * Scripts/Preferences/WebPreferencesExperimental.yaml: * wtf/Vector.h: (WTF::Malloc>::reverseFindMatching const): 2021-12-08 Philippe Normand [GStreamer] Enable mediaSourceInlinePainting https://bugs.webkit.org/show_bug.cgi?id=233813 Reviewed by Xabier Rodriguez-Calvar. * Scripts/Preferences/WebPreferencesExperimental.yaml: GStreamer ports can already run tests requiring this setting, without change in the platform layer, until we migrate to the GPUProcess. 2021-12-07 Aditya Keerthi [iOS] Add initial support for find-in-page SPI https://bugs.webkit.org/show_bug.cgi?id=233915 rdar://86140501 Reviewed by Wenson Hsieh. * wtf/PlatformHave.h: 2021-12-07 Wenson Hsieh Add support for `navigator.requestCookieConsent()` behind a disabled feature flag https://bugs.webkit.org/show_bug.cgi?id=233890 rdar://86117718 Reviewed by Darin Adler. Add the new feature flag (off by default). Note that this is also only an internal feature flag for the time being (rather than an experimental feature flag), such that it cannot (yet) be turned on by non-Apple internal users. * Scripts/Preferences/WebPreferencesInternal.yaml: 2021-12-07 Sihui Liu Fetch and remove file system data via WKWebsiteDataStore https://bugs.webkit.org/show_bug.cgi?id=233567 Reviewed by Youenn Fablet. * wtf/FileSystem.cpp: (WTF::FileSystemImpl::readEntireFile): Read whole file content into a Vector. (WTF::FileSystemImpl::deleteAllFilesModifiedSince): Recursively delete files and folders modified after specified time in a directory. * wtf/FileSystem.h: 2021-12-06 Ryan Haddad REGRESSION (r286507): [macOS] Many file system access layout tests became flaky failures https://bugs.webkit.org/show_bug.cgi?id=233892 Unreviewed, revert r286507. * wtf/FileSystem.cpp: (WTF::FileSystemImpl::readEntireFile): Deleted. (WTF::FileSystemImpl::deleteAllFilesModifiedSince): Deleted. * wtf/FileSystem.h: 2021-12-06 Simon Fraser Add a call to os_signpost to tag a momentum scroll animation https://bugs.webkit.org/show_bug.cgi?id=233885 Reviewed by Tim Horton. * wtf/SystemTracing.h: 2021-12-06 Antoine Quint [Web Animations] Add a way to run scripted animations https://bugs.webkit.org/show_bug.cgi?id=233869 rdar://85983542 Reviewed by Dean Jackson. Add a new experimental feature for the CustomEffect interface. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-12-06 Jon Lee Update GPU Process feature flags https://bugs.webkit.org/show_bug.cgi?id=232547 rdar://83905400 Reviewed by Wenson Hsieh. Move features enabled by default to internal. DOM and WebGL are experimental. * Scripts/Preferences/WebPreferencesExperimental.yaml: * Scripts/Preferences/WebPreferencesInternal.yaml: 2021-12-06 Nikolas Zimmermann [LBSE] Toggling the Settings -> Enabled LBSE flag has no immediate effect https://bugs.webkit.org/show_bug.cgi?id=233871 Reviewed by Rob Buis. Toggling "Enable layer-based SVG engine" in e.g. MiniBrowser or from JS has no immediate effect. A relayout is not enough: a full style / render tree rebuild is needed. * Scripts/Preferences/WebPreferencesInternal.yaml: When "LayerBasedSVGEngineEnabled" changes call WebCore::SettingsBase::layerBasedSVGEngineEnabledChanged() to assure the switch from legacy to LBSE engine and vice-versa is live and doesn't need reloads to take effect. 2021-12-06 Youenn Fablet Enable NavigationPreloadManager by default https://bugs.webkit.org/show_bug.cgi?id=233755 Reviewed by Chris Dumez. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-12-05 Simon Fraser Add trace points for generated momentum events https://bugs.webkit.org/show_bug.cgi?id=233857 Reviewed by Tim Horton. * wtf/SystemTracing.h: 2021-12-03 Chris Dumez [WK2] Turn on Web Locks API support https://bugs.webkit.org/show_bug.cgi?id=233816 Reviewed by Darin Adler. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-12-03 Sihui Liu Fetch and remove file system data via WKWebsiteDataStore https://bugs.webkit.org/show_bug.cgi?id=233567 Reviewed by Youenn Fablet. * wtf/FileSystem.cpp: (WTF::FileSystemImpl::readEntireFile): Read whole file content into a Vector. (WTF::FileSystemImpl::deleteAllFilesModifiedSince): Recursively delete files and folders modified after specified time in a directory. * wtf/FileSystem.h: 2021-12-03 Tim Horton Enable Momentum Event Generator by default https://bugs.webkit.org/show_bug.cgi?id=233807 Reviewed by Simon Fraser. * Scripts/Preferences/WebPreferencesInternal.yaml: Turn it on for modern WebKit. Adjust the description slightly. 2021-12-03 Antti Koivisto [:has() pseudo-class] Enable by default https://bugs.webkit.org/show_bug.cgi?id=233809 Reviewed by Simon Fraser. Flip the switch. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-12-02 Per Arne Vollan [WP] Strengthen sandbox when AppCache is disabled https://bugs.webkit.org/show_bug.cgi?id=233746 Reviewed by Brent Fulgham. Add HAVE macro for sandbox state flags support. * wtf/PlatformHave.h: 2021-12-02 Megan Gardner Re-add support of image control menus. https://bugs.webkit.org/show_bug.cgi?id=233305 Reviewed by Tim Horton. * Scripts/Preferences/WebPreferences.yaml: 2021-12-02 Myles C. Maxfield [WebGPU] Hook up navigator.gpu.requestAdapter() https://bugs.webkit.org/show_bug.cgi?id=233619 Reviewed by Dean Jackson. * wtf/PlatformHave.h: Create a HAVE() macro, by default off. As we bring more infrastructure online, this will eventually flip to on. 2021-12-02 Wenson Hsieh [ Monterey ] fast/images/text-recognition/mac/image-overlay-text-disables-app-highlight-menu-items.html (layout-test) is a constant text failure https://bugs.webkit.org/show_bug.cgi?id=233658 rdar://problem/85886424 Reviewed by Tim Horton. Define ENABLE_APP_HIGHLIGHTS for iOS 15+ and macOS Monterey+. This ensures that `internals.appHighlightContextMenuItemTitles` is defined in layout tests on Monterey. * wtf/PlatformEnableCocoa.h: 2021-12-02 Commit Queue Unreviewed, reverting r286437. https://bugs.webkit.org/show_bug.cgi?id=233776 Introduced test failure Reverted changeset: "[WP] Strengthen sandbox when AppCache is disabled" https://bugs.webkit.org/show_bug.cgi?id=233746 https://commits.webkit.org/r286437 2021-12-02 Per Arne Vollan [WP] Strengthen sandbox when AppCache is disabled https://bugs.webkit.org/show_bug.cgi?id=233746 Reviewed by Brent Fulgham. Add HAVE macro for sandbox state flags support. * wtf/PlatformHave.h: 2021-12-02 Aditya Keerthi [macCatalyst] Enable support for date/time inputs https://bugs.webkit.org/show_bug.cgi?id=233710 rdar://80108114 Reviewed by Tim Horton. Date/time inputs were unsupported due to the lack of support for custom views inside UIContextMenuInteractions on macCatalyst. However, after date/time pickers transitioned to use _UIDatePickerOverlayPresentation in iOS 15, there is nothing preventing them from functioning on macCatalyst. * Scripts/Preferences/WebPreferencesInternal.yaml: 2021-12-02 Alexey Proskuryakov macOS Monterey build fix after r286420 (suggested by Brady). * wtf/PlatformHave.h: 2021-12-02 Brady Eidson AVDelegatingPlaybackCoordinator error compiling on macOS 11 https://bugs.webkit.org/show_bug.cgi?id=232454 Reviewed by Tim Horton. * wtf/PlatformHave.h: 2021-12-02 Youenn Fablet Add support for NavigationPreloadManager https://bugs.webkit.org/show_bug.cgi?id=233523 Reviewed by Chris Dumez. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-12-01 Fujii Hironori [Win] OSAllocator::reserveUncommittedAligned should use aligned allocation https://bugs.webkit.org/show_bug.cgi?id=233674 Reviewed by Keith Miller. OSAllocator::reserveUncommittedAligned reserved 2GiB for 1GiB aligned allocation request. Windows 10 (Desktop) has VirtualAlloc2 API to aligned allocation. * wtf/win/OSAllocatorWin.cpp: (WTF::OSAllocator::reserveUncommittedAligned): Use VirtualAlloc2 API if available. Use SOFT_LINK_OPTIONAL for VirtualAlloc2. 2021-12-01 Lauro Moura Unreviewed. Fix -Wformat warning after in ThreadingPosix logging * wtf/posix/ThreadingPOSIX.cpp: (WTF::Thread::establishHandle): 2021-12-01 J Pascoe Fix NEAR_FIELD macro to support iOS devices again https://bugs.webkit.org/show_bug.cgi?id=233671 rdar://85318070 In a previous change, https://bugs.webkit.org/show_bug.cgi?id=231085, the definition for the NEAR_FIELD macro removed support for iOS. This change adds it back, fixing NFC webauthn support. Reviewed by Brent Fulgham. Tested manually on an iPhone. * wtf/PlatformHave.h: 2021-12-01 Philippe Normand [GStreamer] requestVideoFrameCallback support https://bugs.webkit.org/show_bug.cgi?id=233541 Reviewed by Xabier Rodriguez-Calvar. * Scripts/Preferences/WebPreferencesExperimental.yaml: Enable rvfc support in GStreamer ports. 2021-12-01 Martin Robinson Add a runtime flag to enable CSS Transforms Level 2 spec compliant behavior https://bugs.webkit.org/show_bug.cgi?id=232618 Reviewed by Simon Fraser. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-11-30 Tim Horton Add a momentum event synthesizer https://bugs.webkit.org/show_bug.cgi?id=233653 Reviewed by Simon Fraser. * wtf/PlatformEnable.h: Add an ENABLE(). 2021-11-30 Keith Miller Structures should be allocated out of an aligned pool of memory so StructureID->Structure* is fast. https://bugs.webkit.org/show_bug.cgi?id=233379 Reviewed by Yusuke Suzuki. Add an aligned flavor of reserveUncommited, reserveUncommittedAligned. * wtf/OSAllocator.h: * wtf/posix/OSAllocatorPOSIX.cpp: (WTF::OSAllocator::reserveUncommittedAligned): * wtf/win/OSAllocatorWin.cpp: (WTF::OSAllocator::reserveUncommittedAligned): 2021-11-30 Antoine Quint [Model] Update required macOS version for camera, animation and audio APIs https://bugs.webkit.org/show_bug.cgi?id=233656 Reviewed by Tim Horton. * wtf/PlatformEnableCocoa.h: 2021-11-30 Commit Queue Unreviewed, reverting r286227. https://bugs.webkit.org/show_bug.cgi?id=233652 Broke some Apple-internal builds Reverted changeset: "[Model] clean up compile-time flags and condition IDL methods behind them" https://bugs.webkit.org/show_bug.cgi?id=233407 https://commits.webkit.org/r286227 2021-11-30 Youenn Fablet [Cocoa] Enable HTMLVideoElement.requestVideoFrameCallback by default https://bugs.webkit.org/show_bug.cgi?id=233306 Reviewed by Eric Carlson. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-11-30 Commit Queue Unreviewed, reverting r286272. https://bugs.webkit.org/show_bug.cgi?id=233641 Wrong approach to disabling experimental features. Reverted changeset: "Disable experimental web features on platforms without UI to enable them" https://bugs.webkit.org/show_bug.cgi?id=233152 https://commits.webkit.org/r286272 2021-11-30 Youenn Fablet Move TransformStreamAPIEnabled flag to Settings https://bugs.webkit.org/show_bug.cgi?id=233524 Reviewed by Chris Dumez. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-11-29 Chris Dumez Add initial implementation for the Web Lock API https://bugs.webkit.org/show_bug.cgi?id=233289 Reviewed by Geoff Garen. Update Deque::removeAllMatching() to return the number of items removed, similarly to the corresponding API on Vector. * wtf/Deque.h: (WTF::inlineCapacity>::removeAllMatching): 2021-11-29 David Kilzer Disable experimental web features on platforms without UI to enable them Reviewed by Brent Fulgham. * wtf/PlatformEnableCocoa.h: (ENABLE_CORE_IMAGE_ACCELERATED_FILTER_RENDER): (ENABLE_CSS_PAINTING_API): (ENABLE_CSS_TYPED_OM): (ENABLE_MODEL_ELEMENT): (ENABLE_SEPARATED_MODEL): - Disable if HAVE(EXPERIMENTAL_WEB_FEATURES_UI) is defined. * wtf/PlatformHave.h: (HAVE_EXPERIMENTAL_WEB_FEATURES_UI): Add. - Define for tvOS and watchOS, which don't have UI to enable experimental web features. (HAVE_CELESTIAL): (HAVE_CFNETWORK_ALTERNATIVE_SERVICE): (HAVE_NETWORK_LOADER): (HAVE_AVSAMPLEBUFFERVIDEOOUTPUT): - Disable if HAVE(EXPERIMENTAL_WEB_FEATURES_UI) is defined. 2021-11-29 Chris Fleizach AX: Unify speech synthesizer platform usage for Mac/iOS https://bugs.webkit.org/show_bug.cgi?id=231895 Reviewed by Andres Gonzalez. * wtf/PlatformHave.h: 2021-11-29 Yusuke Suzuki [JSC] Public Class Field initialization is slow https://bugs.webkit.org/show_bug.cgi?id=232479 Reviewed by Alexey Shvayka. * wtf/text/ASCIILiteral.h: 2021-11-29 Yusuke Suzuki [JSC] Move m_incomingPolymorphicCalls out of CodeBlock::JITData https://bugs.webkit.org/show_bug.cgi?id=233415 Reviewed by Mark Lam and Darin Adler. Make sizeof(SentinelLinkedList) small. We do not need to have two sentinel for the list. * wtf/SentinelLinkedList.h: (WTF::SentinelLinkedList::SentinelLinkedList): (WTF::RawNode>::begin): (WTF::RawNode>::end): (WTF::RawNode>::push): (WTF::RawNode>::append): (WTF::RawNode>::takeFrom): (WTF::RawNode>::SentinelLinkedList): Deleted. 2021-11-24 Antoine Quint [Model] clean up compile-time flags and condition IDL methods behind them https://bugs.webkit.org/show_bug.cgi?id=233407 Reviewed by Tim Horton. We refactor and augment the flags related to the element. First, we change the following existing flags from ENABLE to HAVE since they are about the availability of specific APIs in ARKit, and more specific ASVInlinePreview. The changes are as follows: ENABLE_ARKIT_INLINE_PREVIEW_IOS => HAVE_ASV_INLINE_PREVIEW_IOS ENABLE_ARKIT_INLINE_PREVIEW_MAC => HAVE_ASV_INLINE_PREVIEW_MAC ENABLE_ARKIT_INLINE_PREVIEW_CAMERA_TRANSFORM => HAVE_ASV_INLINE_PREVIEW_CAMERA_CONTROL ENABLE_ARKIT_INLINE_PREVIEW_ANIMATIONS_CONTROL => HAVE_ASV_INLINE_PREVIEW_ANIMATION_CONTROL ENABLE_ARKIT_INLINE_PREVIEW_AUDIO_CONTROL => HAVE_ASV_INLINE_PREVIEW_AUDIO_CONTROL We retain the ENABLE_ARKIT_INLINE_PREVIEW flag however as, even when the ASVInlinePreview API is available, we may elect to not use this API. Then, we add three new flags to specify whether some features exposed to the Web are enabled, all currently conditioned by the matching HAVE_ASV_INLINE_PREVIEW_ flags, but those could be subject to more complex rules when other backends expose supporting APIs for these features. ENABLE_MODEL_ELEMENT_CAMERA_CONTROL ENABLE_MODEL_ELEMENT_ANIMATION_CONTROL ENABLE_MODEL_ELEMENT_AUDIO_CONTROL Finally, we modify the macOS version used to define the HAVE_ASV_INLINE_PREVIEW_XXX_CONTROL flags. * wtf/PlatformEnableCocoa.h: * wtf/PlatformHave.h: 2021-11-29 Youenn Fablet Apply WebPreferences on ServiceWorker settings https://bugs.webkit.org/show_bug.cgi?id=233466 Reviewed by Chris Dumez. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-11-29 Nikolas Zimmermann [LBSE] Add runtime flag for Layer-based SVG engine (LBSE) https://bugs.webkit.org/show_bug.cgi?id=233211 Reviewed by Sam Weinig. Add build option ('build-webkit --(no-)layer-based-svg-engine') and runtime flag ('LayerBasedSVGEngineEnabled' in LBSE enabled builds) to switch between the SVG engines. The actual SVG code changes will follow in subsequent patches, this just adds the infrastructure for LBSE. * Scripts/Preferences/WebPreferencesInternal.yaml: Add 'LayerBasedSVGEngineEnabled' option. * wtf/PlatformEnable.h: Disable LBSE by default. (Toggable with build settings in CMake-based builds) * wtf/PlatformEnableCocoa.h: Enable for PLATFORM(MAC). 2021-11-19 Antoine Quint [Model] add audio support https://bugs.webkit.org/show_bug.cgi?id=233365 Reviewed by Wenson Hsieh. Add a new compile-time flag for the new autio-related ARQL SPIs we are using. * wtf/PlatformEnableCocoa.h: 2021-11-19 Alex Christensen Remove allocation in JSON::Value::parseJSON https://bugs.webkit.org/show_bug.cgi?id=233346 Reviewed by Yusuke Suzuki. Parse the characters as Latin1 characters if we have an 8 bit string rather than converting them to UTF-16 just to be parsed. * wtf/JSONValues.cpp: (WTF::JSONImpl::Value::parseJSON): 2021-11-18 Antoine Quint [Model] add support for pausing and resuming animations https://bugs.webkit.org/show_bug.cgi?id=233319 Reviewed by Wenson Hsieh. Add a new compile-time flag for the new ARQL SPIs we are using. * wtf/PlatformEnableCocoa.h: 2021-11-18 Antoine Quint [Model] add support for getting and setting the camera https://bugs.webkit.org/show_bug.cgi?id=233265 Reviewed by Darin Adler. Add a new compile-time flag for the new ARQL SPIs we are using. * wtf/PlatformEnableCocoa.h: 2021-11-17 John Wilander PCM: Add capability for click destination to fire triggering event without cross-site requests to the click source https://bugs.webkit.org/show_bug.cgi?id=233173 Reviewed by Alex Christensen. * wtf/URL.cpp: (WTF::queryParameters): New convenience getter. * wtf/URL.h: 2021-11-17 Chris Dumez Web Locks API does get enabled in Service Workers when running layout tests https://bugs.webkit.org/show_bug.cgi?id=233273 Reviewed by Geoffrey Garen. Use RuntimeEnabledFeatures to back the Web Lock API since regular settings do not get properly propagated to service workers at the moment. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-11-17 Dean Jackson Add ModelDocument for directly showing content that can be handled by https://bugs.webkit.org/show_bug.cgi?id=233057 rdar://85265880 Reviewed by Darin Adler. Add a experimental feature: ModelDocumentEnabled for loading content that can be handled by . * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-11-16 Devin Rousso [iOS] use PhotosUIPrivate instead of PhotosUI https://bugs.webkit.org/show_bug.cgi?id=233213 Reviewed by Aditya Keerthi. * wtf/PlatformHave.h: 2021-11-15 Sam Weinig Add another backend backed by SceneKit to prove out ModelPlayer infrastructure a bit more https://bugs.webkit.org/show_bug.cgi?id=233112 Reviewed by Dean Jackson. * Scripts/Preferences/WebPreferencesInternal.yaml: Add some internal settings to enable/disable the ARKit and SceneKit based backends. * wtf/PlatformHave.h: Add HAVE macro for SceneKit. Only enabled for macOS at the moment, but could probably be enabled for iOS if it is useful. 2021-11-15 Eric Liang _AXSCopyPathForAccessibilityBundle is going to be deprecated. https://bugs.webkit.org/show_bug.cgi?id=233081 Reviewed by Andres Gonzalez. To support macOS Accessibility v2 runtime, on macOS there are two places where bundles can live. By doing so, `_AXSCopyPathForAccessibilityBundle` will going to be deprecated because it won’t always return the correct path you would expect. * wtf/PlatformHave.h: 2021-11-15 Wenson Hsieh Unreviewed, fix the internal iOS 15 build Add a new compile-time flag. * wtf/PlatformHave.h: 2021-11-13 Simon Fraser Run a ScrollAnimationMomentum for the momentum phase of a scroll https://bugs.webkit.org/show_bug.cgi?id=232897 Reviewed by Tim Horton. Set the MomentumScrollingAnimatorEnabled internal setting to off by default while we bring up tests. * Scripts/Preferences/WebPreferencesInternal.yaml: 2021-11-12 Chris Dumez Disable MathML when in Captive Portal Mode https://bugs.webkit.org/show_bug.cgi?id=233013 Reviewed by Brent Fulgham. Add runtime feature flag for MathML. * Scripts/Preferences/WebPreferences.yaml: 2021-11-12 Chris Dumez Unreviewed, partial revert of r285565 to resolve a PLT5 regression. * wtf/PlatformHave.h: 2021-11-11 Michael Saboff Inline RegExp.test JIT code in DFG and FTL https://bugs.webkit.org/show_bug.cgi?id=230469 Reviewed by Saam Barati. Added a new enablement: ENABLE_YARR_JIT_ALL_PARENS_EXPRESSIONS. * wtf/PlatformEnable.h: 2021-11-11 Ben Nham Log memory usage metadata when WebContent crosses critical or warning level memory thresholds https://bugs.webkit.org/show_bug.cgi?id=232976 Reviewed by Darin Adler. Fixed several issues with memory usage tracking: - pagesPerVMTag now properly accounts for swapped-out pages in its footprint calculation, as footprint(1) already does. - displayNamePerVMTag now includes all of the most common VM tags associated with WebKit. - MemoryPressureHandler now knows the specific type of pressure event that occurred. This allows it to differentiate between the entire system being at a warning pressure level vs. just this process hitting its warning memory level limit. * wtf/MemoryPressureHandler.cpp: (WTF::MemoryPressureHandler::setMemoryPressureStatus): (WTF::MemoryPressureHandler::memoryPressureStatusChanged): (WTF::MemoryPressureHandler::setUnderMemoryPressure): Deleted. * wtf/MemoryPressureHandler.h: (WTF::MemoryPressureHandler::setMemoryPressureStatusChangedCallback): (WTF::MemoryPressureHandler::isUnderMemoryPressure const): * wtf/ResourceUsage.h: * wtf/cocoa/MemoryPressureHandlerCocoa.mm: (WTF::MemoryPressureHandler::install): * wtf/cocoa/ResourceUsageCocoa.cpp: (WTF::displayNameForVMTag): (WTF::pagesPerVMTag): * wtf/unix/MemoryPressureHandlerUnix.cpp: (WTF::MemoryPressureHandler::triggerMemoryPressureEvent): * wtf/win/MemoryPressureHandlerWin.cpp: (WTF::MemoryPressureHandler::windowsMeasurementTimerFired): 2021-11-11 Jer Noble [iOS] Adopt -[AVAudioSession setAuditTokensForProcessAssertion:] https://bugs.webkit.org/show_bug.cgi?id=232909 Reviewed by Chris Dumez. * wtf/PlatformHave.h: 2021-11-10 Darin Adler [CF] Reduce duplication and unneeded buffer allocations and copying in URL code, also remove unused methods and functions https://bugs.webkit.org/show_bug.cgi?id=232220 Reviewed by Alex Christensen. * wtf/URL.h: Removed unneeded includes. Use default instead of { } for empty destructor. Added emptyCFURL function. * wtf/cf/CFURLExtras.cpp: (WTF::bytesAsCFData): Added. Replaces originalURLData from NSURLExtras.mm, but with a simpler implementation and more error checking. Here it's also alongside the other nearly identical functions. (WTF::bytesAsString): Added. Replaces getURLBytes for callers that are going to turn the bytes into a WTF::String. Before this patch, the callers were converting from CFURLRef to WTF::CString and then to WTF::String, so this eliminates the malloc/free pair for CString. (WTF::bytesAsVector): Added. Replaces getURLBytes using a return value instead of an out argument. Adds the optimization of filling the buffer if the inline capacity is sufficient, which was in originalURLData, but not here in getURLBytes before. (WTF::isSameOrigin): Renamed from isCFURLSameOrigin and rewrote this to have fewer type casts and more parallel structure so it's easier to read, while adapting it to use bytesAsVector. * wtf/cf/CFURLExtras.h: Replaced URLCharBuffer, getURLBytes, and isCFURLSameOrigin with URLBytesVectorInlineCapacity, bytesAsCFData, bytesAsString, bytesAsVector, and isSameOrigin. Got rid of unneeded includes. * wtf/cf/URLCF.cpp: (WTF::URL::URL): Use bytesAsString to streamline implementation and remove allocation/deallcation of a CString. (WTF::URL::emptyCFURL): Added. Used to refactor createCFURL so we can share it across Foundation and non-Foundation versions. (WTF::URL::createCFURL const): Added the logic that was in the version in URLCocoa.mm so we can share this single version, and removed the #if surrounding this. (WTF::URL::fileSystemPath const): Use auto. * wtf/cocoa/NSURLExtras.h: Changed URLWithUserTypedString to ignore the baseURL argument. It's not used, but the function is exported and currently used in Safari source code, which, like all callers passes a nil for baseURL. so, for now left the argument. Removed the baseURL argument from URLWithUserTypedStringDeprecated. Removed unused functions rangeOfURLScheme and looksLikeAbsoluteURL. * wtf/cocoa/NSURLExtras.mm: Removed "using namespace URLHelpers". (WTF::readIDNAllowedScriptListFile): Use URLHelpers explicitly. (WTF::decodeHostName): Ditto. (WTF::encodeHostName): Ditto. (WTF::URLByTruncatingOneCharacterBeforeComponent): Simplified by using the bytesAsVector function. (WTF::URLByRemovingResourceSpecifier): Deleted. (WTF::URLWithData): Call URLByTruncatingOneCharacterBeforeComponent directly. (WTF::URLWithUserTypedString): Removed the unneeded support for a base URL. Use URLHelpers explicitly. (WTF::URLWithUserTypedStringDeprecated): Ditto. (WTF::hasQuestionMarkOnlyQueryString): Use bridge_cast. (WTF::dataForURLComponentType): Rearranged to simplify a bit, remove support for special value for CFURLComponentType that means the complete URL, since no callers were using that, and use bytesAsVector. (WTF::URLByRemovingComponentAndSubsequentCharacter): Use bridge_cast and bytesAsVector. (WTF::originalURLData): Use bridge_cast and bytesAsCFData. (WTF::userVisibleString): Use URLHelpers explicitly. (WTF::isUserVisibleURL): Rewrote for simplicity and coding style; since the local characters are a null-terminated C string, we don't need length checks as long as we validate characters first, since a '\0' character can be read and will not be valid. (WTF::rangeOfURLScheme): Deleted. (WTF::looksLikeAbsoluteURL): Deleted. * wtf/cocoa/URLCocoa.mm: (WTF::URL::URL): Changed to just call the CFURLRef constructor so we don't need to repeat things twice. (WTF::URL::emptyCFURL): Added. This is the one part of the createCFURL function that depends on Objective-C. (WTF::URL::createCFURL const): Merged into the function in URLCF.cpp. (WTF::makeNSArrayElement): Use bridge_cast instead of the trickier idiom with explicit calls to leakRef and __bridge_transfer. * wtf/mac/FileSystemMac.mm: (WTF::FileSystem::setMetadataURL): Updated since URLWithUserTypedString no longer requires a baseURL of nil to be passed. Also removed explicit WTF namespace since this code itself is in the WTF namespace. * wtf/text/cocoa/StringCocoa.mm: (WTF::String::String): Use bridge_cast. (WTF::makeNSArrayElement): Use bridge_cast. 2021-11-10 Tim Nguyen Migrate DialogElementEnabled from RuntimeFlags to Settings https://bugs.webkit.org/show_bug.cgi?id=232926 Reviewed by Youenn Fablet. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-11-10 Antti Koivisto Hasher should be able to hash pointers https://bugs.webkit.org/show_bug.cgi?id=232927 Reviewed by Kimmo Kinnunen. * wtf/Hasher.h: (WTF::add): 2021-11-09 Chris Dumez [macOS] Enable NSURLSession partitioning based on first-party domain at CFNetwork level https://bugs.webkit.org/show_bug.cgi?id=230750 Reviewed by Alex Christensen. Add HAVE(CFNETWORK_SESSION_PARTITIONING_BASED_ON_FIRST_PARTY_DOMAIN) build time flag that is true on newer Apple OSes where CFNetwork does NSURLSession partitioning based on first-party domain for us. * wtf/PlatformHave.h: 2021-11-09 Megan Gardner Turn on selection flipping by default. https://bugs.webkit.org/show_bug.cgi?id=232853 Reviewed by Wenson Hsieh. * Scripts/Preferences/WebPreferencesInternal.yaml: 2021-11-09 Commit Queue Unreviewed, reverting r285536. https://bugs.webkit.org/show_bug.cgi?id=232915 causes API test crashes Reverted changeset: "[CF] Reduce duplication and unneeded buffer allocations and copying in URL code, also remove unused methods and functions" https://bugs.webkit.org/show_bug.cgi?id=232220 https://commits.webkit.org/r285536 2021-11-09 Commit Queue Unreviewed, reverting r285246. https://bugs.webkit.org/show_bug.cgi?id=232907 Broke FixedVector Reverted changeset: "[JSC] Clean up StructureStubInfo initialization" https://bugs.webkit.org/show_bug.cgi?id=232652 https://commits.webkit.org/r285246 2021-10-28 Darin Adler [CF] Reduce duplication and unneeded buffer allocations and copying in URL code, also remove unused methods and functions https://bugs.webkit.org/show_bug.cgi?id=232220 Reviewed by Alex Christensen. * wtf/URL.h: Removed unneeded includes. Use default instead of { } for empty destructor. Added emptyCFURL function. * wtf/cf/CFURLExtras.cpp: (WTF::bytesAsCFData): Added. Replaces originalURLData from NSURLExtras.mm, but with a simpler implementation and more error checking. Here it's also alongside the other nearly identical functions. (WTF::bytesAsString): Added. Replaces getURLBytes for callers that are going to turn the bytes into a WTF::String. Before this patch, the callers were converting from CFURLRef to WTF::CString and then to WTF::String, so this eliminates the malloc/free pair for CString. (WTF::bytesAsVector): Added. Replaces getURLBytes using a return value instead of an out argument. Adds the optimization of filling the buffer if the inline capacity is sufficient, which was in originalURLData, but not here in getURLBytes before. (WTF::isSameOrigin): Renamed from isCFURLSameOrigin and rewrote this to have fewer type casts and more parallel structure so it's easier to read, while adapting it to use bytesAsVector. * wtf/cf/CFURLExtras.h: Replaced URLCharBuffer, getURLBytes, and isCFURLSameOrigin with URLBytesVectorInlineCapacity, bytesAsCFData, bytesAsString, bytesAsVector, and isSameOrigin. Got rid of unneeded includes. * wtf/cf/URLCF.cpp: (WTF::URL::URL): Use bytesAsString to streamline implementation and remove allocation/deallcation of a CString. (WTF::URL::emptyCFURL): Added. Used to refactor createCFURL so we can share it across Foundation and non-Foundation versions. (WTF::URL::createCFURL const): Added the logic that was in the version in URLCocoa.mm so we can share this single version, and removed the #if surrounding this. (WTF::URL::fileSystemPath const): Use auto. * wtf/cocoa/NSURLExtras.h: Changed URLWithUserTypedString to ignore the baseURL argument. It's not used, but the function is exported and currently used in Safari source code, which, like all callers passes a nil for baseURL. so, for now left the argument. Removed the baseURL argument from URLWithUserTypedStringDeprecated. Removed unused functions rangeOfURLScheme and looksLikeAbsoluteURL. * wtf/cocoa/NSURLExtras.mm: Removed "using namespace URLHelpers". (WTF::readIDNAllowedScriptListFile): Use URLHelpers explicitly. (WTF::decodeHostName): Ditto. (WTF::encodeHostName): Ditto. (WTF::URLByTruncatingOneCharacterBeforeComponent): Simplified by using the bytesAsVector function. (WTF::URLByRemovingResourceSpecifier): Deleted. (WTF::URLWithData): Call URLByTruncatingOneCharacterBeforeComponent directly. (WTF::URLWithUserTypedString): Removed the unneeded support for a base URL. Use URLHelpers explicitly. (WTF::URLWithUserTypedStringDeprecated): Ditto. (WTF::hasQuestionMarkOnlyQueryString): Use bridge_cast. (WTF::dataForURLComponentType): Rearranged to simplify a bit, remove support for special value for CFURLComponentType that means the complete URL, since no callers were using that, and use bytesAsVector. (WTF::URLByRemovingComponentAndSubsequentCharacter): Use bridge_cast and bytesAsVector. (WTF::originalURLData): Use bridge_cast and bytesAsCFData. (WTF::userVisibleString): Use URLHelpers explicitly. (WTF::isUserVisibleURL): Rewrote for simplicity and coding style; since the local characters are a null-terminated C string, we don't need length checks as long as we validate characters first, since a '\0' character can be read and will not be valid. (WTF::rangeOfURLScheme): Deleted. (WTF::looksLikeAbsoluteURL): Deleted. * wtf/cocoa/URLCocoa.mm: (WTF::URL::URL): Changed to just call the CFURLRef constructor so we don't need to repeat things twice. (WTF::URL::emptyCFURL): Added. This is the one part of the createCFURL function that depends on Objective-C. (WTF::URL::createCFURL const): Merged into the function in URLCF.cpp. (WTF::makeNSArrayElement): Use bridge_cast instead of the trickier idiom with explicit calls to leakRef and __bridge_transfer. * wtf/mac/FileSystemMac.mm: (WTF::FileSystem::setMetadataURL): Updated since URLWithUserTypedString no longer requires a baseURL of nil to be passed. Also removed explicit WTF namespace since this code itself is in the WTF namespace. * wtf/text/cocoa/StringCocoa.mm: (WTF::String::String): Use bridge_cast. (WTF::makeNSArrayElement): Use bridge_cast. 2021-11-09 Chris Dumez BroadcastChannel is still disabled in service workers https://bugs.webkit.org/show_bug.cgi?id=232855 Reviewed by Darin Adler. Turn on BroadcastChannel experimental feature in WebCore since this is the value that Service Workers end up using. We only need to disable it in WebKitLegacy. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-11-09 Zan Dobersek [RISCV64] Add assembly, disassembly infrastructure https://bugs.webkit.org/show_bug.cgi?id=232870 Reviewed by Yusuke Suzuki. * wtf/PlatformEnable.h: Enable RISCV64_DISASSEMBLER when necessary. 2021-11-09 Megan Gardner Scroll To Text Fragment directive parsing https://bugs.webkit.org/show_bug.cgi?id=231410 Reviewed by Chris Dumez. Text directive parsing for https://wicg.github.io/scroll-to-text-fragment/ * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-11-09 Tim Horton Add runtime flag for momentum scrolling https://bugs.webkit.org/show_bug.cgi?id=232898 Reviewed by Simon Fraser. * Scripts/Preferences/WebPreferencesInternal.yaml: Add the preference. 2021-11-09 Devin Rousso REGRESSION(r271735): PaymentShippingOption.selected ignored https://bugs.webkit.org/show_bug.cgi?id=221960 Reviewed by Tim Horton. Leverage new `PKShippingMethods` SPI to provide both the general list of `PKShippingMethod` and the default selected `PKShippingMethods` when creating/updating a payment request. * wtf/PlatformEnableCocoa.h: * wtf/PlatformHave.h: 2021-11-08 Myles C. Maxfield Make WebGPU.xcodeproj and WebGPU.framework https://bugs.webkit.org/show_bug.cgi?id=231661 Reviewed by Dean Jackson and Robin Morisset. * wtf/DisallowCType.h: 2021-11-08 Alex Christensen Parse redirect and modify-headers actions for WKContentRuleList https://bugs.webkit.org/show_bug.cgi?id=232838 Reviewed by Tim Hatcher. * wtf/JSONValues.cpp: (WTF::JSONImpl::Value::asObject const): (WTF::JSONImpl::ObjectBase::asObject const): * wtf/JSONValues.h: 2021-11-08 Wenson Hsieh Enabling "media source inline painting" by default should work when using GPU Process for media https://bugs.webkit.org/show_bug.cgi?id=232802 Reviewed by Eric Carlson. Clean up this experimental feature -- since it's backed by a global RuntimeEnabledFeature, we should: 1. Add `webcoreBinding: RuntimeEnabledFeatures`, and also: 2. Not be adding the corresponding page-scoped WebCore setting as well. This adjustment makes it possible to enable this experimental feature when the GPU process is disabled, since we now actually call into RuntimeEnabledFeatures to set the value (instead of just setting the WebCore setting which wasn't consulted by anything). * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-11-08 Yusuke Suzuki [libpas] Enable libpas on macOS https://bugs.webkit.org/show_bug.cgi?id=231815 Reviewed by Filip Pizlo. * WTF.xcodeproj/project.pbxproj: 2021-11-08 Kate Cheney trustd network connections occasionally omitted from App Privacy report https://bugs.webkit.org/show_bug.cgi?id=232770 Reviewed by Alex Christensen. * wtf/spi/cocoa/SecuritySPI.h: 2021-11-04 Myles C. Maxfield [WebGPU] Bindings part 1: Bring back Adapter/Device bindings code https://bugs.webkit.org/show_bug.cgi?id=232550 Reviewed by Alex Christensen. * Scripts/Preferences/WebPreferences.yaml: 2021-11-05 Alex Christensen Restructure WKContentRuleList Action storage during compilation and interpretation https://bugs.webkit.org/show_bug.cgi?id=232692 Reviewed by Brady Eidson. * wtf/CrossThreadCopier.h: * wtf/StdLibExtras.h: 2021-11-04 Diego Pino Garcia Require MediaSession enabled to enable MediaSession PlayList API https://bugs.webkit.org/show_bug.cgi?id=232694 Reviewed by Žan Doberšek. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-11-04 Antoine Quint Make PreferPageRenderingUpdatesNear60FPSEnabled experimental rather than internal https://bugs.webkit.org/show_bug.cgi?id=232702 Reviewed by Tim Horton. * Scripts/Preferences/WebPreferencesExperimental.yaml: * Scripts/Preferences/WebPreferencesInternal.yaml: 2021-11-03 Yusuke Suzuki [JSC] Clean up StructureStubInfo initialization https://bugs.webkit.org/show_bug.cgi?id=232652 Reviewed by Saam Barati. * wtf/FixedVector.h: (WTF::FixedVector::FixedVector): (WTF::FixedVector::operator=): * wtf/RefCountedArray.h: (WTF::RefCountedArray::RefCountedArray): (WTF::RefCountedArray::operator=): * wtf/SegmentedVector.h: * wtf/Vector.h: (WTF::VectorTypeOperations::uninitializedCopy): 2021-11-03 David Kilzer Disable WebXR on tvOS and watchOS Reviewed by Brent Fulgham. * wtf/PlatformEnableCocoa.h: (ENABLE_WEBXR): (ENABLE_WEBXR_HANDS): - Disable features on tvOS and watchOS. 2021-11-03 Jer Noble [macOS] MediaSession coordinator enabled in UIProcess, disabled in WebContent https://bugs.webkit.org/show_bug.cgi?id=232687 Reviewed by Eric Carlson. Have the MediaSessionPlaylistEnabled preference use the same defaults as MediaSessionCoordinatorEnabled. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-11-03 Chris Dumez _pasteboardWithName should be thread-safe https://bugs.webkit.org/show_bug.cgi?id=232670 Reviewed by Tim Horton. wtf/Atomics.h uses WTF_MAKE_STRUCT_FAST_ALLOCATED which is declared in wtf/FastMalloc.h but was failing to include it. This was leading to a build error when I tried including wtf/Lock.h in WKTR. * wtf/Atomics.h: 2021-11-02 Brady Eidson Notifications on iOS enabled at compile-time, disabled at runtime https://bugs.webkit.org/show_bug.cgi?id=232649 Reviewed by Tim Horton. * wtf/PlatformEnableCocoa.h: 2021-11-02 David Kilzer [WTF] Minor clean-up for format-related functions Reviewed by Yusuke Suzuki. * wtf/Assertions.cpp: (WTF::createWithFormatAndArguments): - Put WTF_ATTRIBUTE_PRINTF() on its own line to match other functions. (WTF::vprintf_stderr_with_prefix): (WTF::vprintf_stderr_with_trailing_newline): - Move ALLOW_NONLITERAL_FORMAT_{BEGIN,END} around specific function calls that need them. 2021-11-02 Michael Catanzaro Fails to execute JavaScript when soft stack limit is unlimited https://bugs.webkit.org/show_bug.cgi?id=232328 Reviewed by Yusuke Suzuki. Fall back to assuming an 8 MB stack limit when the real limit is unlimited. JSC needs to have some maximum stack size to work with, and this is as good as any. * wtf/StackBounds.cpp: (WTF::StackBounds::currentThreadStackBoundsInternal): 2021-11-02 Philip Chimento [JSC] Implement Temporal.Instant https://bugs.webkit.org/show_bug.cgi?id=229826 Reviewed by Yusuke Suzuki. * wtf/CheckedArithmetic.h: Don't use builtin operations if __int128 is being emulated using WTF::Int128. Also work around Clang/Linux bug where __builtin_mul_overflow() doesn't work on __int128. See https://bugs.llvm.org/show_bug.cgi?id=16404 * wtf/DateMath.h: (WTF::timeToMS): Moved from JSDateMath.h. 2021-11-02 Chris Dumez Use higher QoS for WheelEvent and DisplayWasRefreshed IPCs https://bugs.webkit.org/show_bug.cgi?id=232458 Reviewed by Simon Fraser. Add dispatchWithQOS() function to WorkQueue to dispatch a task with a given QoS. * wtf/WorkQueue.cpp: (WTF::WorkQueueBase::dispatchWithQOS): * wtf/WorkQueue.h: * wtf/cocoa/WorkQueueCocoa.cpp: (WTF::WorkQueueBase::dispatchWithQOS): 2021-11-01 Per Arne [macOS] Opening local html files is failing https://bugs.webkit.org/show_bug.cgi?id=232572 Reviewed by Brent Fulgham. Declare sandbox flag. * wtf/spi/darwin/SandboxSPI.h: 2021-11-01 Tim Horton Add a testing preference to replay CG display lists manually https://bugs.webkit.org/show_bug.cgi?id=232566 Reviewed by Wenson Hsieh. * Scripts/Preferences/WebPreferencesInternal.yaml: 2021-10-29 Yusuke Suzuki [JSC] Clean up Baseline StructureStubInfo management https://bugs.webkit.org/show_bug.cgi?id=232513 Reviewed by Saam Barati. * wtf/SegmentedVector.h: 2021-10-29 Darin Adler Create constants for all special frame names used in anchor target attribute values and elsewhere https://bugs.webkit.org/show_bug.cgi?id=232488 Reviewed by Anders Carlsson. * wtf/Forward.h: Declare ASCIILiteral. * wtf/text/ASCIILiteral.h: Update for above. 2021-10-29 Alex Christensen Remove code inside ENABLE(NETSCAPE_PLUGIN_API) https://bugs.webkit.org/show_bug.cgi?id=232462 Reviewed by Anders Carlsson. It is not used anywhere since https://trac.webkit.org/changeset/285003/webkit * wtf/PlatformEnable.h: * wtf/PlatformEnableCocoa.h: 2021-10-29 Ayumi Kojima Unreviewed, reverting r285038. Reverting the commit because it broke the open source test runs and also caused an impanct on EWS queues Reverted changeset: "Create constants for all special frame names used in anchor target attribute values and elsewhere" https://bugs.webkit.org/show_bug.cgi?id=232488 https://commits.webkit.org/r285038 2021-10-29 Darin Adler Create constants for all special frame names used in anchor target attribute values and elsewhere https://bugs.webkit.org/show_bug.cgi?id=232488 Reviewed by Anders Carlsson. * wtf/Forward.h: Declare ASCIILiteral. * wtf/text/ASCIILiteral.h: Update for above. 2021-10-29 Saam Barati Disable ENABLE_JIT on arm64_32 https://bugs.webkit.org/show_bug.cgi?id=232468 Reviewed by Yusuke Suzuki. We were disabling JIT via a runtime configuration before since we haven't yet implemented the JIT on arm64_32. However, not compiling ENABLE(JIT) code on arm64_32 saves 11MB in the binary size of JavaScriptCore. In my local compiles, I'm going from 24M to 13M. * wtf/PlatformEnable.h: 2021-10-28 Adrian Perez de Castro [WTF] Use mcontext_t on OpenBSD https://bugs.webkit.org/show_bug.cgi?id=232451 In OpenBSD there is no mcontext_t, but the needed information is contained directly in ucontext_t, so use the latter instead. This is essentially these two patches from the OpenBSD packaging of WebKitGTK: https://github.com/openbsd/ports/blob/865bd13/www/webkitgtk4/patches/patch-Source_WTF_wtf_PlatformRegisters_h https://github.com/openbsd/ports/blob/865bd13/www/webkitgtk4/patches/patch-Source_WTF_wtf_PlatformHave_h Reviewed by Carlos Garcia Campos. * wtf/PlatformHave.h: * wtf/PlatformRegisters.h: (WTF::registersFromUContext): 2021-10-28 Chris Dumez Add stubs for the Web Locks API https://bugs.webkit.org/show_bug.cgi?id=232438 Reviewed by Geoffrey Garen. Add experimental feature flag, off by default. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-10-28 Alex Christensen Disable NETSCAPE_PLUGIN_API at build time on macOS and Windows https://bugs.webkit.org/show_bug.cgi?id=232396 Reviewed by Geoff Garen. It has been disabled at run time since https://trac.webkit.org/changeset/276720/webkit and https://trac.webkit.org/changeset/275910/webkit but is still able to be reached by tests. This begins the removal of the code and tests with what is close to the smallest change possible. * wtf/PlatformEnable.h: 2021-10-28 Nikolaos Mouchtaris Enable lazy image loading by default https://bugs.webkit.org/show_bug.cgi?id=208094 Reviewed by Simon Fraser. Fix merge error of commit queue. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-10-28 Youenn Fablet [ Mac wk1 ] 2 media-capabilities/webrtc tests are flaky failures https://bugs.webkit.org/show_bug.cgi?id=232283 Reviewed by Eric Carlson. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-10-26 Alex Christensen Update PCM test public key to one with RSA-PSS OID https://bugs.webkit.org/show_bug.cgi?id=231048 Reviewed by John Wilander. * wtf/PlatformHave.h: 2021-10-26 Fujii Hironori [WebCore] Remove unneeded WTF:: namespace prefix https://bugs.webkit.org/show_bug.cgi?id=232226 Reviewed by Myles C. Maxfield. * wtf/Forward.h: 2021-10-25 Yusuke Suzuki [WTF] Make Int128 operator* constexpr https://bugs.webkit.org/show_bug.cgi?id=232270 Reviewed by Mark Lam. We remove MSVC X64 (so, Windows only) switching in Int128 operator* since it breaks constexpr-ness of operator*, which makes writing code difficult. We can bring this kind of optimization back when C++20 std::is_constant_evaluated() becomes available. * wtf/Int128.h: (WTF::operator*): 2021-10-25 Alex Christensen Use xpc_connection_copy_invalidation_reason where available for debugging daemon connection failures https://bugs.webkit.org/show_bug.cgi?id=232152 Reviewed by Brady Eidson. * wtf/PlatformHave.h: * wtf/spi/darwin/XPCSPI.h: 2021-10-25 Ayumi Kojima Unreviewed, reverting r284742. Reverting because this commit may have casued a regression on imported/w3c/web-platform-tests/speech-api/SpeechSynthesis- speak-events.html Reverted changeset: "AX: Unify speech synthesizer platform usage for Mac/iOS" https://bugs.webkit.org/show_bug.cgi?id=231895 https://commits.webkit.org/r284742 2021-10-24 Darin Adler [Cocoa] Adopt bridge_cast and makeVector in a few more places, including cases where adoptCF/NS was used incorrectly https://bugs.webkit.org/show_bug.cgi?id=232200 Reviewed by Anders Carlsson. * wtf/cocoa/URLCocoa.mm: (WTF::URL::URL): Use bridge_cast. (WTF::URL::createCFURL const): Ditto, using the RetainPtr version to avoid retain count churn. 2021-10-23 Alan Bujtas Addressing post-commit review (r284744). * wtf/unicode/CharacterNames.h: 2021-10-23 Yusuke Suzuki [WTF] Replace current LLVM flang's Int128 with abseil-cpp's Int128 https://bugs.webkit.org/show_bug.cgi?id=232129 Reviewed by Darin Adler. We found that flang's signed Int128 implementation is not tested, and it has several issues about sign extension and division. Instead, we import abseil-cpp[1]'s int128 implementation. abseil-cpp is more battle-tested, and abseil is already used in WebKit too (ANGLE and libwebrtc use abseil-cpp as their utility library). For Apple readers, abseil-cpp for WebKit is approved in OSS-351. [1]: https://github.com/abseil/abseil-cpp * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/Int128.cpp: Added. (WTF::UInt128Impl::UInt128Impl): (WTF::operator/): (WTF::operator%): (WTF::operator<<): (WTF::Int128Impl::Int128Impl): * wtf/Int128.h: (WTF::UInt128Max): (std::numeric_limits::min): (std::numeric_limits::lowest): (std::numeric_limits::max): (std::numeric_limits::epsilon): (std::numeric_limits::round_error): (std::numeric_limits::infinity): (std::numeric_limits::quiet_NaN): (std::numeric_limits::signaling_NaN): (std::numeric_limits::denorm_min): (WTF::Int128Max): (WTF::Int128Min): (std::numeric_limits::min): (std::numeric_limits::lowest): (std::numeric_limits::max): (std::numeric_limits::epsilon): (std::numeric_limits::round_error): (std::numeric_limits::infinity): (std::numeric_limits::quiet_NaN): (std::numeric_limits::signaling_NaN): (std::numeric_limits::denorm_min): (WTF::MakeUInt128): (WTF::UInt128Impl::operator=): (WTF::UInt128Impl::operator<<=): (WTF::UInt128Impl::operator>>=): (WTF::UInt128Impl::operator+=): (WTF::UInt128Impl::operator-=): (WTF::UInt128Impl::operator*=): (WTF::UInt128Impl::operator/=): (WTF::UInt128Impl::operator%=): (WTF::UInt128Low64): (WTF::UInt128High64): (WTF::UInt128Impl::UInt128Impl): (WTF::UInt128Impl::operator bool const): (WTF::UInt128Impl::operator char const): (WTF::UInt128Impl::operator signed char const): (WTF::UInt128Impl::operator unsigned char const): (WTF::UInt128Impl::operator char16_t const): (WTF::UInt128Impl::operator char32_t const): (WTF::UInt128Impl::operator ABSL_INTERNAL_WCHAR_T const): (WTF::UInt128Impl::operator short const): (WTF::UInt128Impl::operator unsigned short const): (WTF::UInt128Impl::operator int const): (WTF::UInt128Impl::operator unsigned int const): (WTF::UInt128Impl::operator long const): (WTF::UInt128Impl::operator unsigned long const): (WTF::UInt128Impl::operator long long const): (WTF::UInt128Impl::operator unsigned long long const): (WTF::UInt128Impl::operator float const): (WTF::UInt128Impl::operator double const): (WTF::UInt128Impl::operator long double const): (WTF::operator==): (WTF::operator!=): (WTF::operator<): (WTF::operator>): (WTF::operator<=): (WTF::operator>=): (WTF::operator+): (WTF::operator-): (WTF::operator!): (WTF::operator~): (WTF::operator|): (WTF::operator&): (WTF::operator^): (WTF::UInt128Impl::operator|=): (WTF::UInt128Impl::operator&=): (WTF::UInt128Impl::operator^=): (WTF::operator<<): (WTF::operator>>): (WTF::int128_internal::AddResult): (WTF::int128_internal::SubstructResult): (WTF::operator*): (WTF::UInt128Impl::operator++): (WTF::UInt128Impl::operator--): (WTF::MakeInt128): (WTF::Int128Impl::operator=): (WTF::Int128Impl::operator+=): (WTF::Int128Impl::operator-=): (WTF::Int128Impl::operator*=): (WTF::Int128Impl::operator/=): (WTF::Int128Impl::operator%=): (WTF::Int128Impl::operator|=): (WTF::Int128Impl::operator&=): (WTF::Int128Impl::operator^=): (WTF::Int128Impl::operator<<=): (WTF::Int128Impl::operator>>=): (WTF::int128_internal::BitCastToSigned): (WTF::Int128Low64): (WTF::Int128High64): (WTF::Int128Impl::Int128Impl): (WTF::Int128Impl::operator bool const): (WTF::Int128Impl::operator char const): (WTF::Int128Impl::operator signed char const): (WTF::Int128Impl::operator unsigned char const): (WTF::Int128Impl::operator char16_t const): (WTF::Int128Impl::operator char32_t const): (WTF::Int128Impl::operator ABSL_INTERNAL_WCHAR_T const): (WTF::Int128Impl::operator short const): (WTF::Int128Impl::operator unsigned short const): (WTF::Int128Impl::operator int const): (WTF::Int128Impl::operator unsigned int const): (WTF::Int128Impl::operator long const): (WTF::Int128Impl::operator unsigned long const): (WTF::Int128Impl::operator long long const): (WTF::Int128Impl::operator unsigned long long const): (WTF::Int128Impl::operator float const): (WTF::Int128Impl::operator double const): (WTF::Int128Impl::operator long double const): (WTF::int128_internal::SignedAddResult): (WTF::int128_internal::SignedSubstructResult): (WTF::Int128Impl::operator++): (WTF::Int128Impl::operator--): (WTF::Int128Impl::operator+ const): Deleted. (WTF::Int128Impl::operator~ const): Deleted. (WTF::Int128Impl::operator- const): Deleted. (WTF::Int128Impl::operator! const): Deleted. (WTF::Int128Impl::operator std::uint64_t const): Deleted. (WTF::Int128Impl::operator std::int64_t const): Deleted. (WTF::Int128Impl::high const): Deleted. (WTF::Int128Impl::low const): Deleted. (WTF::Int128Impl::operator& const): Deleted. (WTF::Int128Impl::operator | const): Deleted. (WTF::Int128Impl::operator^ const): Deleted. (WTF::Int128Impl::operator<< const): Deleted. (WTF::Int128Impl::operator>> const): Deleted. (WTF::Int128Impl::operator* const): Deleted. (WTF::Int128Impl::operator/ const): Deleted. (WTF::Int128Impl::operator% const): Deleted. (WTF::Int128Impl::operator< const): Deleted. (WTF::Int128Impl::operator<= const): Deleted. (WTF::Int128Impl::operator== const): Deleted. (WTF::Int128Impl::operator!= const): Deleted. (WTF::Int128Impl::operator>= const): Deleted. (WTF::Int128Impl::operator> const): Deleted. (WTF::Int128Impl::leadingZeroes const): Deleted. * wtf/LeadingZeroBitCount.cpp: Removed. * wtf/LeadingZeroBitCount.h: Removed. 2021-10-23 Alan Bujtas [LFC][IFC] Breaking before hyphen is only allowed when line-break is loose https://bugs.webkit.org/show_bug.cgi?id=232191 Reviewed by Antti Koivisto. * wtf/unicode/CharacterNames.h: 2021-10-23 Chris Fleizach AX: Unify speech synthesizer platform usage for Mac/iOS https://bugs.webkit.org/show_bug.cgi?id=231895 Reviewed by Andres Gonzalez. * wtf/PlatformHave.h: 2021-10-22 Joonghun Park Integer interpolation in animations should be rounded towards positive infinity, not away from zero. https://bugs.webkit.org/show_bug.cgi?id=232013 Currently, interpolation of is rounding away from 0. The interpolation's result should be rounded according to the spec, https://drafts.csswg.org/css-values-4/#combine-integers, which is "the result is converted to an by rounding to the nearest integer, with values halfway between adjacent integers rounded towards positive infinity." Reviewed by Darin Adler. * wtf/MathExtras.h: (roundTowardsPositiveInfinity): 2021-10-22 Pablo Correa Gómez Enable logging in under non-systemd linux distros https://bugs.webkit.org/show_bug.cgi?id=232080 Reviewed by Michael Catanzaro. * wtf/Assertions.h: Rename USE(JOURNALD) to ENABLE(JOURNALD_LOG) * wtf/Logger.h: (WTF::Logger::willLog const): Rename USE(JOURNALD) to ENABLE(JOURNALD_LOG) * wtf/PlatformGTK.cmake: Use renamed Journald library * wtf/PlatformWPE.cmake: Use renamed Journald library 2021-10-21 Aditya Keerthi [Cocoa] Enable accent-color by default https://bugs.webkit.org/show_bug.cgi?id=232032 rdar://84474404 Reviewed by Wenson Hsieh. * Scripts/Preferences/WebPreferencesExperimental.yaml: Enable only on Cocoa platforms, as other platforms do not support painting accent colors yet. 2021-10-21 Aditya Keerthi [Cocoa] Enable 'accent-color' by default https://bugs.webkit.org/show_bug.cgi?id=232032 rdar://84474404 Reviewed by Wenson Hsieh. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-10-21 Chris Lord [WPE][GTK] Enable smooth scrolling by default https://bugs.webkit.org/show_bug.cgi?id=220512 Reviewed by Carlos Garcia Campos. Enable smooth scrolling by default on GTK and WPE platforms. * Scripts/Preferences/WebPreferences.yaml: 2021-10-20 Brady Eidson WebKit Managed Notifications: Skeleton NotificationProvider https://bugs.webkit.org/show_bug.cgi?id=231786 Reviewed by Alex Christensen. * Scripts/Preferences/WebPreferencesExperimental.yaml: * wtf/PlatformEnableCocoa.h: 2021-10-20 Alex Christensen URLParser should reject hosts with C0 control characters or U+007F https://bugs.webkit.org/show_bug.cgi?id=232034 Reviewed by Tim Horton. This matches Chrome and Firefox and was proposed to the standard at https://github.com/whatwg/url/issues/627 * wtf/URLParser.cpp: (WTF::isC0Control): (WTF::isForbiddenHostCodePoint): 2021-10-20 Michael Catanzaro Do not use strerror() https://bugs.webkit.org/show_bug.cgi?id=231913 Reviewed by Chris Dumez. Add a new safeStrerror function that we can use without worrying about thread safety. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/SafeStrerror.cpp: Added. (WTF::safeStrerror): * wtf/SafeStrerror.h: Added. * wtf/linux/RealTimeThreads.cpp: (WTF::RealTimeThreads::promoteThreadToRealTime): * wtf/playstation/FileSystemPlayStation.cpp: (WTF::FileSystemImpl::deleteFile): * wtf/posix/FileSystemPOSIX.cpp: (WTF::FileSystemImpl::deleteFile): * wtf/posix/ThreadingPOSIX.cpp: (WTF::Thread::establishHandle): * wtf/threads/Signals.cpp: (WTF::jscSignalHandler): 2021-10-20 Youenn Fablet Add support for requestVideoFrameCallback API and MediaStreamTrack-based backend support https://bugs.webkit.org/show_bug.cgi?id=231803 Reviewed by Eric Carlson. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-10-20 Carlos Garcia Campos [GTK][WPE] UserInteractive threads are not Real-time in Linux https://bugs.webkit.org/show_bug.cgi?id=220115 Reviewed by Michael Catanzaro. Add RealTimeThreads singleton to register real time threads. * wtf/PlatformGTK.cmake: * wtf/PlatformJSCOnly.cmake: * wtf/PlatformWPE.cmake: * wtf/Threading.cpp: (WTF::Thread::setCurrentThreadIsUserInteractive): * wtf/generic/WorkQueueGeneric.cpp: (WTF::WorkQueueBase::platformInitialize): * wtf/linux/RealTimeThreads.cpp: Added. (WTF::RealTimeThreads::singleton): (WTF::RealTimeThreads::RealTimeThreads): (WTF::RealTimeThreads::registerThread): (WTF::RealTimeThreads::setEnabled): (WTF::RealTimeThreads::promoteThreadToRealTime): (WTF::RealTimeThreads::demoteThreadFromRealTime): (WTF::RealTimeThreads::demoteAllThreadsFromRealTime): (WTF::isRunningInSandbox): (WTF::realTimeKitGetProperty): (WTF::RealTimeThreads::realTimeKitMakeThreadRealTime): (WTF::RealTimeThreads::scheduleDiscardRealTimeKitProxy): (WTF::RealTimeThreads::discardRealTimeKitProxyTimerFired): * wtf/linux/RealTimeThreads.h: Added. * wtf/posix/ThreadingPOSIX.cpp: (WTF::schedPolicy): (WTF::Thread::establishHandle): 2021-10-19 Yusuke Suzuki Remove old GCC workaround for Allocator https://bugs.webkit.org/show_bug.cgi?id=231978 Reviewed by Darin Adler. This is for old GCC. Since our GCC baseline is 8.3.0, this is no longer necessary. * wtf/FastMalloc.h: (WTF::FastAllocator::deallocate): (WTF::FastAllocator::construct): Deleted. (WTF::FastAllocator::destroy): Deleted. (WTF::FastAllocator::max_size const): Deleted. (WTF::FastAllocator::select_on_container_copy_construction const): Deleted. 2021-10-18 Filip Pizlo StringBuffer should really know that strings might be 8-bit https://bugs.webkit.org/show_bug.cgi?id=231937 Reviewed by Yusuke Suzuki. We somehow forgot to change this to use CharType instead of UChar. * wtf/text/StringBuffer.h: (WTF::StringBuffer::resize): 2021-10-19 Cameron McCormack Ensure CanvasRenderingContext2D.drawImage(video) uses the right color space https://bugs.webkit.org/show_bug.cgi?id=229025 Reviewed by Sam Weinig. * wtf/PlatformHave.h: Add HAVE_CVBUFFERCOPYATTACHMENTS. 2021-10-18 Commit Queue Unreviewed, reverting r284240. https://bugs.webkit.org/show_bug.cgi?id=231931 NeedDifferentArchitectureToWorkWithWebpushd Reverted changeset: "WebKit Managed Notifications: Skeleton NotificationProvider." https://bugs.webkit.org/show_bug.cgi?id=231786 https://commits.webkit.org/r284240 2021-10-18 Alex Christensen Remove TCPServer https://bugs.webkit.org/show_bug.cgi?id=231912 Reviewed by Chris Dumez. * wtf/PlatformHave.h: 2021-10-18 Alex Christensen [ iOS15 Monterey ] TestWTF.WTF_URLExtras.URLExtras is a constant failure https://bugs.webkit.org/show_bug.cgi?id=231454 Reviewed by Chris Dumez. * wtf/PlatformHave.h: 2021-10-18 Carlos Garcia Campos [GLIB] Simplify SleepDisabler by checking if we are under sandbox https://bugs.webkit.org/show_bug.cgi?id=231670 Reviewed by Adrian Perez de Castro. Move function to check if running inside a sandbox and add shouldUsePortal() to check whether portal sandbox should be used. WEBKIT_USE_PORTAL environment variable can be used to force the use of portals when not running under the sandbox. * wtf/PlatformGTK.cmake: * wtf/PlatformWPE.cmake: * wtf/glib/Sandbox.cpp: Added. (WTF::isInsideFlatpak): (WTF::isInsideDocker): (WTF::isInsideSnap): (WTF::shouldUsePortal): * wtf/glib/Sandbox.h: Added. 2021-10-18 Yusuke Suzuki Remove AVOID_NATIVE_INT128_T https://bugs.webkit.org/show_bug.cgi?id=231888 Reviewed by Mark Lam. * wtf/Int128.h: 2021-10-18 Kiet Ho Implement parsing and animation support for offset-distance, offset-position, offset-anchor https://bugs.webkit.org/show_bug.cgi?id=231491 Reviewed by Antoine Quint. * Scripts/Preferences/WebPreferencesExperimental.yaml: Add new preference for CSS Motion Path support. 2021-10-17 Dean Jackson [WebXR] Stubs for WebXR Hand Input Module https://bugs.webkit.org/show_bug.cgi?id=231123 Reviewed by Sam Weinig. Add an ENABLE_WEBXR_HANDS compile time flag and a WebXRHandsEnabled preference. * Scripts/Preferences/WebPreferencesExperimental.yaml: * wtf/PlatformEnable.h: * wtf/PlatformEnableCocoa.h: 2021-10-17 David Kilzer Build fix #3: Adopt attribution AVCaptureSession SPI for GPU process https://bugs.webkit.org/show_bug.cgi?id=231621 Unreviewed build fix. * wtf/PlatformHave.h: (HAVE_TCC_IOS_14_BIG_SUR_SPI): Add. - Used for TCC.framework SPI available in iOS 14 and macOS 11 Big Sur and later. 2021-10-17 David Kilzer Add tests for WTF::OSObjectPtr/adoptOSObject in Cocoa with and without ARC Reviewed by Darin Adler. * wtf/OSObjectPtr.h: (WTF::adoptOSObject): - Rename when building with ARC enabled to prevent leaks or over-releases when linking ARC and non-ARC code. - Add WARN_UNUSED_RETURN attribute to match WTF::adoptNS(). 2021-10-16 Robin Morisset Allow WASM to use up to 4GB https://bugs.webkit.org/show_bug.cgi?id=229353 rdar://81603447 Reviewed by Yusuke Suzuki. Made some of CheckedArithmetic constexpr, and added isSumSmallerThanOrEqual since it is a commonly used test in ArrayBuffer and easy to get wrong in terms of overflow. * wtf/CheckedArithmetic.h: (WTF::isInBounds): (WTF::convertSafely): (WTF::isSumSmallerThanOrEqual): 2021-10-16 Tim Horton Unreviewed, reverting r284143. Caused a series of assertions in layout tests in EWS Reverted changeset: "Scroll To Text Fragment directive parsing" https://bugs.webkit.org/show_bug.cgi?id=231410 https://commits.webkit.org/r284143 2021-10-15 Basuke Suzuki Add flag to turn off Iso heap https://bugs.webkit.org/show_bug.cgi?id=231823 Reviewed by Yusuke Suzuki. If this flag is off, then all allocations are replaced with FastMalloc. * wtf/IsoMalloc.h: * wtf/IsoMallocInlines.h: * wtf/PlatformUse.h: 2021-10-15 Ross Kirsling Realize Mac CMake build of WebCore and WebKit https://bugs.webkit.org/show_bug.cgi?id=231749 Reviewed by Alex Christensen. * wtf/PlatformMac.cmake: 2021-10-15 Sihui Liu Enable Storage API by default https://bugs.webkit.org/show_bug.cgi?id=231826 Reviewed by Alexey Shvayka. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-10-15 Myles C. Maxfield Clean up font-related USE(...) macros https://bugs.webkit.org/show_bug.cgi?id=231793 Reviewed by Wenson Hsieh. IOS_FAMILY is true for tvOS and watchOS, so we should be using (PLATFORM(IOS) || PLATFORM(MACCATALYST) instead. Also, the simulator is not special here - it should get the same policy as the system it's simulating. * wtf/PlatformUse.h: 2021-10-15 Myles C. Maxfield [Cocoa] Design System UI fonts exist on MacCatalyst https://bugs.webkit.org/show_bug.cgi?id=231792 Reviewed by Wenson Hsieh. They shouldn't be disabled there. * wtf/PlatformHave.h: 2021-10-15 Brady Eidson WebKit Managed Notifications: Skeleton NotificationProvider. and https://bugs.webkit.org/show_bug.cgi?id=231786 Reviewed by Alex Christensen. * Scripts/Preferences/WebPreferencesDebug.yaml: * wtf/PlatformEnableCocoa.h: 2021-10-15 Robin Morisset Revert r284230, my last fixes to the watch build make it break tests https://bugs.webkit.org/show_bug.cgi?id=231797 Unreviewed. Revert "Allow WASM to use up to 4GB" * wtf/CheckedArithmetic.h: (WTF::isInBounds): (WTF::convertSafely): (WTF::isSumSmallerThanOrEqual): Deleted. * wtf/PlatformUse.h: 2021-10-14 Alex Christensen Add AdAttributionDaemon plist on iOS https://bugs.webkit.org/show_bug.cgi?id=231309 Reviewed by John Wilander. * wtf/spi/darwin/XPCSPI.h: 2021-10-14 Robin Morisset Allow WASM to use up to 4GB https://bugs.webkit.org/show_bug.cgi?id=229353 rdar://81603447 Reviewed by Yusuke Suzuki. Made some of CheckedArithmetic constexpr, and added isSumSmallerThanOrEqual since it is a commonly used test in ArrayBuffer and easy to get wrong in terms of overflow. * wtf/CheckedArithmetic.h: (WTF::isInBounds): (WTF::convertSafely): (WTF::isSumSmallerThanOrEqual): 2021-10-14 Nikos Mouchtaris Enable lazy image loading by default https://bugs.webkit.org/show_bug.cgi?id=208094 Reviewed by Simon Fraser. Turn on lazy image load by default in WebKit. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-10-14 Yusuke Suzuki Fix build failures with newer clang https://bugs.webkit.org/show_bug.cgi?id=231783 Reviewed by Chris Dumez. In Identified case, we make copy constructor and assignment operator protected in IdentifiedBase to hide the ability to copy Identified / ThreadSafeIdentified to be copied to IdentifiedBase. So, in the derived classes, we should define both copy constructor and assignment operator. * wtf/Identified.h: 2021-10-14 Alex Christensen Remove Variant.h https://bugs.webkit.org/show_bug.cgi?id=231744 Reviewed by Darin Adler. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/LikelyDenseUnsignedIntegerSet.h: * wtf/StdLibExtras.h: (WTF::switchOn): * wtf/Variant.h: Removed. * wtf/text/TextBreakIterator.h: 2021-10-14 Alex Christensen Share IPC communication code between webpushd and adattributiond https://bugs.webkit.org/show_bug.cgi?id=231718 Reviewed by Brady Eidson. * wtf/spi/darwin/XPCSPI.h: 2021-10-14 Myles C. Maxfield All the SDKVariant.xcconfig files should match https://bugs.webkit.org/show_bug.cgi?id=231663 Reviewed by Youenn Fablet. * Configurations/SDKVariant.xcconfig: 2021-10-14 Chris Dumez Unreviewed build fix with recent SDKs. Use std::invoke_result<> instead of std::result_of<>, as it was deprecated in C++17. * wtf/IndexedContainerIterator.h: (WTF::IndexedContainerIterator::operator* const): (WTF::IndexedContainerIterator::operator*): Deleted. * wtf/Vector.h: * wtf/WeakHashSet.h: 2021-10-14 Yusuke Suzuki Remove std::iterator usage https://bugs.webkit.org/show_bug.cgi?id=231728 Reviewed by Keith Miller. std::iterator<> is deprecated and defining 5 type aliases is encouraged[1]. With new clang, using std::iterator<> causes compile error because of deprecation warnings. This patch removes std::iterator usage. [1]: https://www.fluentcpp.com/2018/05/08/std-iterator-deprecated/ * wtf/HashIterators.h: (WTF:: const const): Deleted. * wtf/HashTable.h: * wtf/WeakHashMap.h: * wtf/WeakHashSet.h: 2021-10-14 Carlos Garcia Campos [GTK][WPE] Move getCurrentExecutablePath() and getCurrentExecutableName() to FileSystem https://bugs.webkit.org/show_bug.cgi?id=231732 Reviewed by Michael Catanzaro. * wtf/FileSystem.h: * wtf/PlatformGTK.cmake: * wtf/PlatformWPE.cmake: * wtf/glib/FileSystemGlib.cpp: (WTF::FileSystemImpl::currentExecutablePath): (WTF::FileSystemImpl::currentExecutableName): * wtf/glib/GLibUtilities.cpp: Removed. (getCurrentExecutablePath): Deleted. (getCurrentExecutableName): Deleted. * wtf/glib/GLibUtilities.h: Removed. 2021-10-14 Tim Nguyen Enable element by default https://bugs.webkit.org/show_bug.cgi?id=231307 Reviewed by Brent Fulgham. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-10-14 Carlos Garcia Campos [GTK][WPE] Bump GLib version to 2.58.3 https://bugs.webkit.org/show_bug.cgi?id=231726 Reviewed by Philippe Normand. Remove enumToString() since we can use g_enum_to_string(). * wtf/glib/GLibUtilities.cpp: (enumToString): Deleted. * wtf/glib/GLibUtilities.h: 2021-10-13 Megan Gardner Scroll To Text Fragment directive parsing https://bugs.webkit.org/show_bug.cgi?id=231410 Reviewed by Chris Dumez. Text directive parsing for https://wicg.github.io/scroll-to-text-fragment/ * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-10-13 Chris Dumez Drop makeWeakPtr() and use WeakPtr { } directly https://bugs.webkit.org/show_bug.cgi?id=231679 Reviewed by Darin Adler. * wtf/WeakHashMap.h: * wtf/WeakHashSet.h: (WTF::copyToVector): * wtf/WeakPtr.h: (WTF::makeWeakPtr): Deleted. 2021-10-13 Jean-Yves Avenard Clearly distinguish serial from concurrent WorkQueue https://bugs.webkit.org/show_bug.cgi?id=231418 rdar://problem/84021977 Reviewed by Chris Dumez. We split the WorkQueue code so that it becomes either a serial or concurrent one. A concurrent WorkQueue doesn't guarantee the order in which the queued tasks will run. That makes for a footgun if a consumer took a WorkQueue and was expecting it to be a serial one. WorkQueue (serial) and ConcurrentWorkQueue are made to both inherit from WorkQueueBase. A class should inherit from either the WorkQueue or the ConcurrentWorkQueue class. The Storage class present in NetworkCacheStore is the only code that was using a WorkQueue that could be either. For this class we will pass a WorkQueueBase; use of the base class directly is discouraged. No change in observable behaviour. * wtf/SuspendableWorkQueue.cpp: (WTF::SuspendableWorkQueue::SuspendableWorkQueue): * wtf/WorkQueue.cpp: (WTF::WorkQueueBase::create): removed (WTF::WorkQueueBase::WorkQueueBase): (WTF::WorkQueueBase::~WorkQueueBase): (WTF::WorkQueue::create): (WTF::ConcurrentWorkQueue::create): (WTF::WorkQueueBase::dispatchSync): (WTF::ConcurrentWorkQueue:apply): * wtf/WorkQueue.h: (WTF::WorkQueueBase::dispatchQueue const): (WTF::executeFunction): remove unused method declaration. (WTF::WorkQueue::runLoop const): (WTF::WorkQueue::WorkQueue): (WTF::ConcurrentWorkQueue::ConcurrentWorkQueue): * wtf/cocoa/WorkQueueCocoa.cpp: (WTF::WorkQueueBase::dispatch): (WTF::WorkQueueBase::dispatchAfter): (WTF::WorkQueueBase::dispatchSync): (WTF::WorkQueueBase::WorkQueueBase): (WTF::WorkQueueBase::platformInitialize): (WTF::WorkQueueBase::platformInvalidate): (WTF::WorkQueue::WorkQueue): (WTF::WorkQueue::constructMainWorkQueue): (WTF::ConcurrentWorkQueue::apply): * wtf/generic/WorkQueueGeneric.cpp: (WorkQueue::WorkQueue): (WorkQueueBase::WorkQueueBase): (WorkQueueBase::platformInitialize): (WorkQueueBase::platformInvalidate): (WorkQueueBase::dispatch): (WorkQueueBase::dispatchAfter): 2021-10-13 Sihui Liu Enable FileSystemAccess and AccessHandle by default https://bugs.webkit.org/show_bug.cgi?id=231677 Reviewed by Youenn Fablet. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-10-13 Alex Christensen Remove WTF::Variant and WTF::get https://bugs.webkit.org/show_bug.cgi?id=231675 Reviewed by Chris Dumez. * wtf/Variant.h: (WTF::get): Deleted. 2021-10-13 Chris Dumez Stop using makeWeakPtr() in WebCore https://bugs.webkit.org/show_bug.cgi?id=231651 Reviewed by Alex Christensen. * wtf/WeakPtr.h: (WTF::WeakPtr::WeakPtr): (WTF::WeakPtr::implForObject): 2021-10-13 Philippe Normand CLang build warning in CheckedPtr.h https://bugs.webkit.org/show_bug.cgi?id=231672 Reviewed by Alex Christensen. Assert on the wrapped pointer. Asserting on `this` always results to true, defeating the purpose of the ASSERT. * wtf/CheckedPtr.h: (WTF::CheckedPtr::operator* const): (WTF::CheckedPtr::operator*): 2021-10-12 Alex Christensen Use std::variant instead of WTF::Variant https://bugs.webkit.org/show_bug.cgi?id=231629 Reviewed by Chris Dumez. * wtf/LikelyDenseUnsignedIntegerSet.h: * wtf/SmallSet.h: * wtf/text/TextBreakIterator.cpp: (WTF::mapModeToBackingIterator): * wtf/text/TextBreakIterator.h: * wtf/text/cocoa/TextBreakIteratorInternalICUCocoa.cpp: (WTF::mapModeToBackingIterator): 2021-10-12 Tim Horton Remove some unused UIKit SPI declarations https://bugs.webkit.org/show_bug.cgi?id=231646 Reviewed by Wenson Hsieh. * wtf/PlatformHave.h: 2021-10-12 Sihui Liu Implement FileSystemSyncAccessHandle read() and write() https://bugs.webkit.org/show_bug.cgi?id=231466 Reviewed by Youenn Fablet. * wtf/PlatformHave.h: 2021-10-12 Chris Dumez Decrease use of makeWeakPtr() https://bugs.webkit.org/show_bug.cgi?id=231615 Reviewed by Alex Christensen. Decrease use of makeWeakPtr() and use WeakPtr { } directly instead. * wtf/CancellableTask.h: (WTF::TaskCancellationGroup::Handle::Handle): * wtf/ListHashSet.h: (WTF::ListHashSetConstIterator::ListHashSetConstIterator): (WTF::ListHashSetConstIterator::operator++): (WTF::ListHashSetConstIterator::operator--): * wtf/WeakHashSet.h: 2021-10-12 David Kilzer Switch WTF::bridge_cast to use type traits Reviewed by Darin Adler. * wtf/cocoa/TollFreeBridging.h: Add. (WTF::CFTollFreeBridgingTraits): Add. (WTF::NSTollFreeBridgingTraits): Add. - Define type traits for CF and NS classes with toll-free bridging. * wtf/cocoa/TypeCastsCocoa.h: (WTF::bridge_cast): - Make use of type traits in TollFreeBridging.h. 2021-10-12 Simon Fraser Add support for ScrollOptions' ScrollBehavior and CSS scroll-behavior properties https://bugs.webkit.org/show_bug.cgi?id=188043 Reviewed by Myles C. Maxfield. Enable CSS smooth scrolling by default. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-10-12 Alex Christensen Use STL instead of WTF::get_if, WTF::Monostate, WTF::visit, and WTF::holds_alternative https://bugs.webkit.org/show_bug.cgi?id=231582 Reviewed by Darin Adler. * wtf/Variant.h: (WTF::switchOn): (): Deleted. (WTF::visit): Deleted. (WTF::get_if): Deleted. 2021-10-12 Chris Dumez Allow direct construction of WeakPtr without makeWeakPtr() https://bugs.webkit.org/show_bug.cgi?id=231580 Reviewed by Darin Adler. Allow direct construction of WeakPtr without makeWeakPtr(), and deprecate makeWeakPtr(). * wtf/WeakPtr.h: (WTF::WeakPtr::WeakPtr): (WTF::WeakPtr::implForObject): (WTF::makeWeakPtr): 2021-10-12 Ross Kirsling Unreviewed WinCairo build fix for r283943. * wtf/JSONValues.h: 2021-10-12 Alex Christensen Remove non-HAVE(CFNETWORK_NSURLSESSION_STRICTRUSTEVALUATE) code https://bugs.webkit.org/show_bug.cgi?id=231579 Reviewed by Chris Dumez. * wtf/PlatformHave.h: This was incorrectly marked as not being available on watchOS and tvOS. It is. 2021-10-12 Alex Christensen Begin migration from WTF::Variant to std::variant https://bugs.webkit.org/show_bug.cgi?id=231086 Reviewed by Chris Dumez. This is reasonably close to just changing the header and all the code stays the same until later. Templates that were only used once like std::variant_size I just changed inline instead of adding a wrapper to Variant.h. WTF::get still means something else, so I just changed the few that take a Variant parameter to std::get in the code. WTF::in_place maps to std::in_place_type and std::in_place_index_t, so I just changed those in the code too. There was also another visitor added since r283906 with different return types among the lambdas, so I just fixed it with the switch. * wtf/Forward.h: * wtf/Hasher.h: (WTF::add): * wtf/Variant.h: (WTF::get): (WTF::visit): (WTF::get_if): (WTF::in_place): Deleted. (WTF::__throw_bad_variant_access): Deleted. (WTF::=): Deleted. (WTF::__variant_storage::__get): Deleted. (WTF::__variant_storage::__get_rref): Deleted. (WTF::__variant_storage::__destroy): Deleted. (WTF::__storage_wrapper::__construct): Deleted. (WTF::__storage_wrapper::__storage_wrapper): Deleted. (WTF::__storage_wrapper::__get): Deleted. (WTF::__storage_wrapper::__get const): Deleted. (WTF::__storage_wrapper::__destroy): Deleted. (WTF::__storage_wrapper<_Type::__storage_wrapper): Deleted. (WTF::__storage_wrapper<_Type::__get): Deleted. (WTF::__storage_wrapper<_Type::__get const): Deleted. (WTF::__variant_base::~__variant_base): Deleted. (WTF::__backup_storage_ops::__move_construct_func): Deleted. (WTF::__backup_storage_ops::__destroy_func): Deleted. (WTF::__backup_storage::__backup_storage): Deleted. (WTF::__backup_storage::__destroy): Deleted. (WTF::__backup_storage::~__backup_storage): Deleted. (WTF::Variant<>::swap): Deleted. (WTF::__NOEXCEPT_): Deleted. (WTF::__variant_accessor::get): Deleted. (WTF::__visitor_table::__trampoline_func): Deleted. (WTF::__arg_selector): Deleted. (WTF::__visit_helper2::__visit): Deleted. (WTF::operator==): Deleted. (WTF::operator!=): Deleted. (WTF::operator<): Deleted. (WTF::operator>): Deleted. (WTF::operator>=): Deleted. (WTF::operator<=): Deleted. (WTF::__hash_visitor::operator()): Deleted. 2021-10-11 Alex Christensen Only mark needed JSONImpl::ObjectBase functions with WTF_EXPORT_PRIVATE https://bugs.webkit.org/show_bug.cgi?id=231521 Reviewed by Chris Dumez. I'm trying some wild experiments with the linker, and when I do the weak symbol checker fails because it is trying to export some of the inline functions at the bottom of JSONValues.h. Moving WTF_EXPORT_PRIVATE from exporting the whole class to only exporting the non-inline functions fixes it. * wtf/JSONValues.h: 2021-10-11 Dean Jackson Disable SystemPreview in WKContentProviderRegistry https://bugs.webkit.org/show_bug.cgi?id=231538 rdar://84110761 Reviewed by Tim Horton. Revert the change in r283811. * wtf/PlatformUse.h: 2021-10-11 Alex Christensen Prepare to switch from WTF::Variant to std::variant https://bugs.webkit.org/show_bug.cgi?id=231239 Reviewed by Chris Dumez. This is the pieces of bug 231086 that can be done without changing behavior. 1. It makes WTF::get_if look more like std::get_if by taking a pointer to a variant instead of a reference. 2. std::visit is pickier than WTF::visit. The former allows taking lambdas with different return types as long as the return types can be converted to the overall desired return type. std::visit has a static_assert that the return types of all the lambdas are all exactly the same type, so I explicitly declare the return type of many lambdas. 3. It also resolves some types that will become ambiguous by using WTF::in_place, which will become wrapped by std::in_place_type then removed. 4. It adds a few explicit WTF:: and #include that will be needed after removing Variant from Forward.h. 5. It removes the fast malloc check in the one place a Variant is dynamically allocated in KeyedDecoderGeneric.cpp (which is for non-cocoa platforms) because std::variant isn't fast allocated. * wtf/LikelyDenseUnsignedIntegerSet.h: (WTF::LikelyDenseUnsignedIntegerSet::iterator::operator* const): * wtf/Variant.h: (WTF::get_if): 2021-10-08 Tim Horton defaultAlternateFormControlDesignEnabled() can't read UIUserInterfaceIdiom in the Web Content process https://bugs.webkit.org/show_bug.cgi?id=231416 Reviewed by Anders Carlsson. * Scripts/Preferences/WebPreferences.yaml: Remove the autogenerated default. 2021-10-08 Dean Jackson Disable SYSTEM_PREVIEW when UIKit internals is enabled https://bugs.webkit.org/show_bug.cgi?id=231438 rdar://84019482 Reviewed by Tim Horton. We're going to replace SystemPreview with the element, so disable it when UIKit internals are enabled. * wtf/PlatformUse.h: 2021-10-08 Antti Koivisto Make WTF::IteratorRange reversible https://bugs.webkit.org/show_bug.cgi?id=231415 Reviewed by Darin Adler. Also export some names out of the WTF namespace. * wtf/IteratorRange.h: (WTF::IteratorRange::rbegin const): (WTF::IteratorRange::rend const): 2021-10-07 Aditya Keerthi [css-ui] Parsing support for accent-color https://bugs.webkit.org/show_bug.cgi?id=231334 rdar://83955508 Reviewed by Antti Koivisto. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-10-07 Chris Dumez Add feature flag for COOP / COEP violation reporting and turn off by default https://bugs.webkit.org/show_bug.cgi?id=231371 Reviewed by Youenn Fablet. Add feature flag for COOP / COEP violation reporting and turn off by default since our implementation doesn't match the latest specification. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-10-06 Sihui Liu Add support for FileSystemSyncAccessHandle https://bugs.webkit.org/show_bug.cgi?id=231185 Reviewed by Youenn Fablet. * Scripts/Preferences/WebPreferencesExperimental.yaml: * wtf/FileSystem.h: * wtf/glib/FileSystemGlib.cpp: (WTF::FileSystemImpl::flushFile): * wtf/posix/FileSystemPOSIX.cpp: (WTF::FileSystemImpl::flushFile): * wtf/win/FileSystemWin.cpp: (WTF::FileSystemImpl::flushFile): 2021-10-06 Aditya Keerthi Fix watchOS, tvOS, and macCatalyst builds after r283592 https://bugs.webkit.org/show_bug.cgi?id=231300 rdar://83936867 Reviewed by Wenson Hsieh. * wtf/PlatformEnableCocoa.h: * wtf/PlatformHave.h: 2021-10-06 Megan Gardner Allow text selection to flip. https://bugs.webkit.org/show_bug.cgi?id=231234 rdar://83889188 Reviewed by Wenson Hsieh. Add an internal flag to guard text selection flipping while we test to make sure this is reasonable to turn on everywhere. * Scripts/Preferences/WebPreferencesInternal.yaml: 2021-10-05 Tim Horton Add an alternate style for form controls, and implement it for checkboxes and radio buttons https://bugs.webkit.org/show_bug.cgi?id=231160 Reviewed by Sam Weinig. * Scripts/Preferences/WebPreferences.yaml: 2021-10-05 David Kilzer Follow-up #2: WTF::RetainPtr<> allows assignment of two pointer types that are not assignable Unreviewed attempt to fix API tests. * wtf/cocoa/TypeCastsCocoa.h: (WTF::checked_objc_cast): - Rename checked_objc_cast<> to checked_objc_castARC<> when compiling with ARC enabled. - Also mark as `inline` function to allow for optimization. 2021-10-05 Cameron McCormack Enable 2D canvas color space support on Apple platforms https://bugs.webkit.org/show_bug.cgi?id=231145 Reviewed by Simon Fraser. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-10-04 Chris Dumez Add SPI to launch a service service worker in a WKWebView and expose service worker to injected bundle https://bugs.webkit.org/show_bug.cgi?id=231045 Reviewed by Geoff Garen. * wtf/URL.cpp: (WTF::protocolHostAndPortAreEqual): Fix issue where protocolHostAndPortAreEqual() was doing a case-sensitive check. My new service worker API test was initially failing because of this since it is using an upper-case domain name. 2021-10-04 Sam Weinig Split WebXR extension module IDLs into their own files and settings https://bugs.webkit.org/show_bug.cgi?id=231149 Reviewed by Dean Jackson. * Scripts/Preferences/WebPreferencesExperimental.yaml: Adds WebXRAugmentedRealityModuleEnabled and WebXRGamepadsModuleEnabled to gate enabling the WebXR AR Module and the WebXR Gamepads Module on. 2021-10-03 David Kilzer WTF::RetainPtr<> allows assignment of two pointer types that are not assignable Reviewed by Darin Adler. * wtf/RetainPtr.h: (WTF::RetainPtr::RetainPtr): (WTF::RetainPtr::checkType): Add. - Add type check for move constructor. * wtf/cocoa/TypeCastsCocoa.h: - Change #include to #import. (WTF_CF_TO_NS_BRIDGE_TRANSFER): Add. (WTF_CF_TO_NS_BRIDGE_TRANSFER): Add. - Helper macros for bridge_cast() and bridge_id_cast(). (WTF_DECLARE_CF_NS_BRIDGE_CAST): Add. - Macro used to define bridge_cast() functions for all known toll-free-bridged types. (WTF::bridge_cast): Add. - Helper macro for toll-free-bridge casting from a known CF type to and from their Objective-C NS type. Prevents ref churn for rvale RetainPtr<> objects. (WTF::bridge_id_cast): Add. - Helper macro for casting from any CFTypeRef to id. Prevents ref churn for rvalue RetainPtr<> objects. (WTF::checked_objc_cast): - Simplified to match dynamic_objc_cast<> implementation in RetainPtr.h. * wtf/cocoa/VectorCocoa.h: (WTF::createNSArray): - Change return type to match object. 2021-10-03 Basuke Suzuki Enable release log to stderr https://bugs.webkit.org/show_bug.cgi?id=230725 Reviewed by Michael Catanzaro. Define new compiler definitions, USE_LOG_STDERR for release logging. We don't have modern logging backend so that dumping out to stdout/stderr is still very valuable. * wtf/Assertions.cpp: * wtf/Assertions.h: * wtf/Logger.h: (WTF::Logger::log): (WTF::Logger::logVerbose): 2021-10-02 Philippe Normand [GLib] Media session manager unable to handle more than one session https://bugs.webkit.org/show_bug.cgi?id=230250 Reviewed by Adrian Perez de Castro. * wtf/glib/GRefPtr.h: Forward-declare GDBusConnection. 2021-10-01 Yusuke Suzuki Upgrade in-tree OSS ICU header to 64.2 because macOS Mojave build will be dropped https://bugs.webkit.org/show_bug.cgi?id=231104 Reviewed by Myles C. Maxfield. WebKit no longer supports macOS Mojave build. This means that we can upgrade in-tree ICU header, which is only used when OSS WebKit is built. ICU 64.2 is ICU shipped in macOS Catalina. * icu/LICENSE: * icu/README: * icu/unicode/alphaindex.h: * icu/unicode/brkiter.h: * icu/unicode/bytestream.h: (StringByteSink::StringByteSink): * icu/unicode/calendar.h: * icu/unicode/caniter.h: * icu/unicode/casemap.h: * icu/unicode/char16ptr.h: (Char16Ptr::Char16Ptr): (Char16Ptr::~Char16Ptr): (Char16Ptr::get const): (ConstChar16Ptr::ConstChar16Ptr): (ConstChar16Ptr::~ConstChar16Ptr): (ConstChar16Ptr::get const): (toUCharPtr): (toOldUCharPtr): * icu/unicode/coll.h: * icu/unicode/compactdecimalformat.h: * icu/unicode/currpinf.h: (CurrencyPluralInfo::operator!= const): * icu/unicode/currunit.h: * icu/unicode/datefmt.h: * icu/unicode/dcfmtsym.h: * icu/unicode/decimfmt.h: * icu/unicode/docmain.h: * icu/unicode/dtintrv.h: * icu/unicode/dtitvfmt.h: * icu/unicode/dtitvinf.h: * icu/unicode/dtptngen.h: * icu/unicode/edits.h: * icu/unicode/enumset.h: * icu/unicode/filteredbrk.h: * icu/unicode/fmtable.h: * icu/unicode/formattedvalue.h: Added. * icu/unicode/gender.h: * icu/unicode/icuplug.h: * icu/unicode/listformatter.h: * icu/unicode/localebuilder.h: Added. * icu/unicode/localpointer.h: (LocalPointer::LocalPointer): (LocalPointer::operator std::unique_ptr ): (LocalArray::LocalArray): (LocalArray::operator std::unique_ptr ): * icu/unicode/locdspnm.h: * icu/unicode/locid.h: (Locale::toLanguageTag const): (Locale::getKeywords const): (Locale::getUnicodeKeywords const): (Locale::getKeywordValue const): (Locale::getUnicodeKeywordValue const): * icu/unicode/measfmt.h: * icu/unicode/measunit.h: * icu/unicode/messagepattern.h: * icu/unicode/msgfmt.h: * icu/unicode/normalizer2.h: * icu/unicode/nounit.h: * icu/unicode/numberformatter.h: * icu/unicode/numberrangeformatter.h: Added. * icu/unicode/numfmt.h: * icu/unicode/numsys.h: * icu/unicode/parsepos.h: * icu/unicode/platform.h: * icu/unicode/plurfmt.h: * icu/unicode/plurrule.h: * icu/unicode/ptypes.h: * icu/unicode/rbbi.h: * icu/unicode/rbnf.h: * icu/unicode/regex.h: * icu/unicode/region.h: * icu/unicode/reldatefmt.h: * icu/unicode/simpleformatter.h: * icu/unicode/smpdtfmt.h: * icu/unicode/stringoptions.h: * icu/unicode/stringtriebuilder.h: * icu/unicode/timezone.h: * icu/unicode/translit.h: * icu/unicode/tzfmt.h: * icu/unicode/ubidi.h: * icu/unicode/ubiditransform.h: * icu/unicode/ucal.h: * icu/unicode/uchar.h: * icu/unicode/ucnv.h: * icu/unicode/ucol.h: * icu/unicode/uconfig.h: * icu/unicode/ucpmap.h: Added. * icu/unicode/ucptrie.h: Added. * icu/unicode/ucurr.h: * icu/unicode/udat.h: * icu/unicode/udateintervalformat.h: * icu/unicode/udatpg.h: * icu/unicode/uenum.h: * icu/unicode/uformattedvalue.h: Added. * icu/unicode/ugender.h: * icu/unicode/ulistformatter.h: * icu/unicode/umachine.h: * icu/unicode/umutablecptrie.h: Added. * icu/unicode/uniset.h: * icu/unicode/unistr.h: * icu/unicode/unum.h: * icu/unicode/unumberformatter.h: * icu/unicode/unumsys.h: * icu/unicode/uobject.h: * icu/unicode/upluralrules.h: * icu/unicode/uregex.h: * icu/unicode/ureldatefmt.h: * icu/unicode/urename.h: * icu/unicode/ures.h: * icu/unicode/uscript.h: * icu/unicode/usearch.h: * icu/unicode/uset.h: * icu/unicode/uspoof.h: * icu/unicode/ustring.h: * icu/unicode/utext.h: * icu/unicode/utf16.h: * icu/unicode/utf8.h: * icu/unicode/utypes.h: * icu/unicode/uvernum.h: 2021-10-01 Chris Dumez Drop support for macOS < 10.15 https://bugs.webkit.org/show_bug.cgi?id=231085 Reviewed by Darin Adler. * wtf/PlatformEnableCocoa.h: * wtf/PlatformHave.h: * wtf/PlatformUse.h: 2021-10-01 Youenn Fablet Add support for PushEvent https://bugs.webkit.org/show_bug.cgi?id=231007 Reviewed by Chris Dumez. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-10-01 Chris Dumez Drop legacy USE(LEGACY_CFNETWORK_DOWNLOADS) code paths https://bugs.webkit.org/show_bug.cgi?id=231081 Reviewed by Alex Christensen. Drop legacy USE(LEGACY_CFNETWORK_DOWNLOADS) code paths, as we no longer support Mac OS 14 Mojave. * wtf/PlatformUse.h: 2021-09-30 Sihui Liu Make File System Access API available in Worker https://bugs.webkit.org/show_bug.cgi?id=230805 Reviewed by Youenn Fablet. * wtf/CrossThreadCopier.h: 2021-09-30 Eddy Wong Adopt presentationSceneIdentifierForPaymentAuthorizationController delegate call from PassKit https://bugs.webkit.org/show_bug.cgi?id=230874 Reviewed by Devin Rousso. * wtf/PlatformEnableCocoa.h: Defines new flag ENABLE_APPLE_PAY_REMOTE_UI_USES_SCENE 2021-09-30 Darin Adler Add StdLibExtras.h include to a file that uses bitwise_cast without including it https://bugs.webkit.org/show_bug.cgi?id=231027 Reviewed by Yusuke Suzuki. * wtf/RawPtrTraits.h: Include StdLibExtras.h. 2021-09-29 Fujii Hironori [WinCairo] REGRESSION(r280726): registry keys enabling GPU process mode don't work https://bugs.webkit.org/show_bug.cgi?id=230871 Reviewed by Don Olmstead. * wtf/PlatformHave.h: r270175 defined HAVE_SYSTEM_FEATURE_FLAGS for Windows to use WebKit::isFeatureFlagEnabled. But, it is no longer needed. 2021-09-29 Kiet Ho Implement the 'ic' unit from CSS Values 4 https://bugs.webkit.org/show_bug.cgi?id=204276 Reviewed by Myles C. Maxfield. * wtf/unicode/CharacterNames.h: add CJK water glyph (U+6C34) constant. 2021-09-29 Antti Koivisto [CSS Cascade Layers] Enable by default https://bugs.webkit.org/show_bug.cgi?id=230948 Reviewed by Simon Fraser. Flip the switch. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-09-28 Yusuke Suzuki iOS simulator build should use PTHREAD_JIT_PERMISSIONS_API https://bugs.webkit.org/show_bug.cgi?id=230920 rdar://77494871 Reviewed by Filip Pizlo. In AppleSilicon macOS, we should use PTHREAD_JIT_PERMISSIONS_API for OSS build. However, we are not enabling that for iOS simulator build. This patch enables that. This API exists after iOS 14.0 SDK. * wtf/PlatformUse.h: 2021-09-28 Alex Christensen Mostly fix Mac CMake build https://bugs.webkit.org/show_bug.cgi?id=230868 Reviewed by Don Olmstead. * wtf/PlatformMac.cmake: 2021-09-28 Yusuke Suzuki Unreviewed, fix Windows build https://bugs.webkit.org/show_bug.cgi?id=230876 * wtf/GenericTimeMixin.h: (WTF::GenericTimeMixin::operator+=): (WTF::GenericTimeMixin::operator-=): 2021-09-27 Yusuke Suzuki [WTF] Add ApproximateTime https://bugs.webkit.org/show_bug.cgi?id=230876 Reviewed by Filip Pizlo. * WTF.xcodeproj/project.pbxproj: * wtf/ApproximateTime.cpp: Copied from Source/WTF/wtf/ClockType.cpp. (WTF::ApproximateTime::approximateWallTime const): (WTF::ApproximateTime::approximateMonotonicTime const): (WTF::ApproximateTime::dump const): * wtf/ApproximateTime.h: Copied from Source/WTF/wtf/MonotonicTime.h. (WTF::ApproximateTime::MarkableTraits::isEmptyValue): (WTF::ApproximateTime::MarkableTraits::emptyValue): (std::isnan): (std::isinf): (std::isfinite): * wtf/CMakeLists.txt: * wtf/ClockType.cpp: (WTF::printInternal): * wtf/ClockType.h: * wtf/CurrentTime.cpp: (WTF::MonotonicTime::fromMachAbsoluteTime): (WTF::MonotonicTime::toMachAbsoluteTime const): (WTF::ApproximateTime::fromMachApproximateTime): (WTF::ApproximateTime::toMachApproximateTime const): (WTF::ApproximateTime::now): * wtf/MonotonicTime.h: * wtf/Seconds.cpp: (WTF::Seconds::operator+ const): (WTF::Seconds::operator- const): * wtf/Seconds.h: * wtf/TimeWithDynamicClockType.cpp: (WTF::TimeWithDynamicClockType::now): (WTF::TimeWithDynamicClockType::approximateTime const): (WTF::TimeWithDynamicClockType::approximateWallTime const): (WTF::TimeWithDynamicClockType::approximateMonotonicTime const): * wtf/TimeWithDynamicClockType.h: * wtf/WallTime.h: 2021-09-27 Antti Koivisto [LFC] Use CheckedRef/Ptr instead of WeakPtr https://bugs.webkit.org/show_bug.cgi?id=230821 Reviewed by Alan Bujtas. * wtf/CheckedRef.h: (WTF::CanMakeCheckedPtrBase::incrementPtrCount const): (WTF::CanMakeCheckedPtrBase::decrementPtrCount const): (WTF::CanMakeCheckedPtrBase::incrementPtrCount): Deleted. (WTF::CanMakeCheckedPtrBase::decrementPtrCount): Deleted. Make const so CheckedPtr works. 2021-09-27 Jean-Yves Avenard Vorbis decoder can't be instantiated - Remove workaround added in bug 228139 https://bugs.webkit.org/show_bug.cgi?id=230742 rdar://83484414 Reviewed by Eric Carlson. * wtf/PlatformUse.h: Add USE_VORBIS_AUDIOCOMPONENT_WORKAROUND 2021-09-27 Saam Barati Build an unlinked baseline JIT https://bugs.webkit.org/show_bug.cgi?id=229223 Reviewed by Yusuke Suzuki. * wtf/Bag.h: * wtf/Packed.h: (WTF::PackedAlignedPtr::operator* const): 2021-09-27 Commit Queue Unreviewed, reverting r283102, r283103 and r283104. https://bugs.webkit.org/show_bug.cgi?id=230854 It regresses JetStream2 on iOS devices Reverted changesets: "Build an unlinked baseline JIT" https://bugs.webkit.org/show_bug.cgi?id=229223 https://commits.webkit.org/r283102 "Unreviewed, fix CLoop build" https://bugs.webkit.org/show_bug.cgi?id=229223 https://commits.webkit.org/r283103 "Unreviewed, fix CLoop build part 2" https://bugs.webkit.org/show_bug.cgi?id=229223 https://commits.webkit.org/r283104 2021-09-27 Saam Barati Build an unlinked baseline JIT https://bugs.webkit.org/show_bug.cgi?id=229223 Reviewed by Yusuke Suzuki. * wtf/Bag.h: * wtf/Packed.h: (WTF::PackedAlignedPtr::operator* const): 2021-09-26 Commit Queue Unreviewed, reverting r283083 and r283088. https://bugs.webkit.org/show_bug.cgi?id=230806 Windows pors are crashing Reverted changesets: "Build an unlinked baseline JIT" https://bugs.webkit.org/show_bug.cgi?id=229223 https://commits.webkit.org/r283083 "Make byte codes with arithmetic profiles switch to using an index instead of a pointer in metadata" https://bugs.webkit.org/show_bug.cgi?id=230798 https://commits.webkit.org/r283088 2021-09-25 Saam Barati Build an unlinked baseline JIT https://bugs.webkit.org/show_bug.cgi?id=229223 Reviewed by Yusuke Suzuki. * wtf/Bag.h: * wtf/Packed.h: (WTF::PackedAlignedPtr::operator* const): 2021-09-24 Devin Rousso Add typechecking `is` overloads for `std::unique_ptr`, `WTF::UniqueRef`, and `WTF::WeakPtr` https://bugs.webkit.org/show_bug.cgi?id=230734 Reviewed by Chris Dumez. * wtf/StdLibExtras.h: * wtf/TypeCasts.h: (WTF::is): * wtf/UniqueRef.h: (WTF::GetPtrHelper>::getPtr): Added. (WTF::is): Added. * wtf/WeakPtr.h: (WTF::is): Added. 2021-09-24 Jonathan Bedard [iOS 15] Support building WebKit (Part 3) https://bugs.webkit.org/show_bug.cgi?id=227002 Reviewed by Ryan Haddad. * wtf/spi/darwin/XPCSPI.h: Import NSError header. 2021-09-23 Tim Horton Move more linked-on-or-after checks to WebCore::linkedOnOrAfter() https://bugs.webkit.org/show_bug.cgi?id=230694 Reviewed by Wenson Hsieh. * wtf/spi/darwin/dyldSPI.h: 2021-09-23 Jean-Yves Avenard Opus and Vorbis codecs aren't available on iPad. https://bugs.webkit.org/show_bug.cgi?id=230595 rdar://problem/83382734 Vorbis and Opus are usable on platforms other than macOS and are being checked at runtime already. Reviewed by Eric Carlson. * wtf/PlatformEnableCocoa.h: 2021-09-22 Chris Dumez Drop makeRef() and use Ref { } instead https://bugs.webkit.org/show_bug.cgi?id=230626 Reviewed by Alex Christensen. * wtf/Ref.h: 2021-09-22 Brady Eidson Disable FTP. and https://bugs.webkit.org/show_bug.cgi?id=230477 Reviewed by Geoff Garen. * Scripts/Preferences/WebPreferencesExperimental.yaml: * wtf/URL.cpp: (WTF::URL::protocolIsInFTPFamily const): (WTF::protocolIsInFTPFamily): * wtf/URL.h: 2021-09-22 Simon Fraser Remove ENABLE(SMOOTH_SCROLLING) https://bugs.webkit.org/show_bug.cgi?id=230587 Reviewed by Tim Horton. ENABLE(SMOOTH_SCROLLING) was always enabled on macOS, so remove it. The pref defaults to true on macOS, and false elsewhere. * Scripts/Preferences/WebPreferences.yaml: * wtf/PlatformEnable.h: * wtf/PlatformEnableCocoa.h: 2021-09-21 Simon Fraser Change from ENABLE(RUBBER_BANDING) to HAVE(RUBBER_BANDING) https://bugs.webkit.org/show_bug.cgi?id=230583 Reviewed by Tim Horton. RUBBER_BANDING is not a feature we'll ever turn off on macOS, and it was only ever enabled for that platform. However, it's also used in some cross-platform code, so HAVE(RUBBER_BANDING) makes more sense for that use. Also remove ENABLE(RUBBER_BANDING) #ifdefs from inside PLATFORM(MAC) code. * Scripts/Preferences/WebPreferences.yaml: * wtf/PlatformHave.h: 2021-09-21 Chris Dumez Reduce use of makeRef() and use Ref { } instead https://bugs.webkit.org/show_bug.cgi?id=230585 Reviewed by Alex Christensen. * wtf/WeakPtr.h: (WTF::WeakPtrFactory::createWeakPtr const): 2021-09-21 Yusuke Suzuki [WTF] Use Int128 in MediaTime https://bugs.webkit.org/show_bug.cgi?id=230575 Reviewed by Eric Carlson. Previously, __int128_t exists only in 64bit clang and GCC environments. But now we always have Int128. Int128 is __int128_t in 64bit clang and GCC, and Int128 library implementation in the other environments. So we always use Int128 code in MediaTime. * wtf/MediaTime.cpp: (WTF::MediaTime::setTimeScale): 2021-09-21 Chris Dumez Drop makeRefPtr() and use RefPtr { } directly instead https://bugs.webkit.org/show_bug.cgi?id=230564 Reviewed by Alex Christensen. * wtf/RefPtr.h: 2021-09-21 David Kilzer Rename {checked,dynamic}_ns_cast<> to {checked,dynamic}_objc_cast<> Reviewed by Brent Fulgham. * WTF.xcodeproj/project.pbxproj: * wtf/PlatformMac.cmake: - Update for rename of TypeCastsNS.h to TypeCastsCocoa.h. * wtf/RetainPtr.h: (WTF::dynamic_objc_cast): - Move dynamic_ns_cast<> from TypeCastsNS.h to here. - Remove `using` statements to limit Objective-C types without asterisks to match RetainPtr<>. * wtf/cocoa/TypeCastsCocoa.h: Rename from TypeCastsNS.h. (WTF::checked_objc_cast): (WTF::dynamic_objc_cast): - Do the rename. - Remove "using WTF::dynamic_ns_cast;" instead of renaming it since this is already in RetainPtr.h. 2021-09-21 Jer Noble [iOS] Enable MSE in WKWebViews by default on iPad https://bugs.webkit.org/show_bug.cgi?id=230426 Reviewed by Tim Horton. Give a default value getter for the MediaSourceEnabled preference. * Scripts/Preferences/WebPreferences.yaml: 2021-09-21 Philip Chimento Add LLVM/FLang's int128_t implementation to WTF https://bugs.webkit.org/show_bug.cgi?id=230437 Added int128_t implementation from LLVM, and its dependency LeadingZeroBitCount.h. Both reformatted according to WebKit style. Reviewed by Yusuke Suzuki. * LICENSE-LLVM.txt: Added. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/Int128.h: Added. (WTF::Int128Impl::Int128Impl): (WTF::Int128Impl::operator+ const): (WTF::Int128Impl::operator~ const): (WTF::Int128Impl::operator- const): (WTF::Int128Impl::operator! const): (WTF::Int128Impl::operator bool const): (WTF::Int128Impl::operator std::uint64_t const): (WTF::Int128Impl::operator std::int64_t const): (WTF::Int128Impl::operator int const): (WTF::Int128Impl::high const): (WTF::Int128Impl::low const): (WTF::Int128Impl::operator++): (WTF::Int128Impl::operator--): (WTF::Int128Impl::operator& const): (WTF::Int128Impl::operator | const): (WTF::Int128Impl::operator^ const): (WTF::Int128Impl::operator<< const): (WTF::Int128Impl::operator>> const): (WTF::Int128Impl::operator* const): (WTF::Int128Impl::operator/ const): (WTF::Int128Impl::operator% const): (WTF::Int128Impl::operator< const): (WTF::Int128Impl::operator<= const): (WTF::Int128Impl::operator== const): (WTF::Int128Impl::operator!= const): (WTF::Int128Impl::operator>= const): (WTF::Int128Impl::operator> const): (WTF::Int128Impl::operator&=): (WTF::Int128Impl::operator|=): (WTF::Int128Impl::operator^=): (WTF::Int128Impl::operator<<=): (WTF::Int128Impl::operator>>=): (WTF::Int128Impl::operator+=): (WTF::Int128Impl::operator-=): (WTF::Int128Impl::operator*=): (WTF::Int128Impl::operator/=): (WTF::Int128Impl::operator%=): (WTF::Int128Impl::leadingZeroes const): * wtf/LeadingZeroBitCount.cpp: Added. * wtf/LeadingZeroBitCount.h: Added. (WTF::leadingZeroBitCount): (WTF::bitsNeededFor): 2021-09-20 Chris Dumez Reduce use of makeRefPtr() and use RefPtr { } directly https://bugs.webkit.org/show_bug.cgi?id=230503 Reviewed by Geoffrey Garen. * wtf/CrossThreadTask.h: (WTF::createCrossThreadTask): 2021-09-20 Wenson Hsieh Refactor some code that controls Live Text selection behavior https://bugs.webkit.org/show_bug.cgi?id=230482 rdar://83173597 Reviewed by Megan Gardner. Add an (off-by-default) internal feature to enable certain enhancements to Live Text. * Scripts/Preferences/WebPreferencesInternal.yaml: 2021-09-20 Brent Fulgham Remove XSS Auditor: Part 1 (Turn off by default) https://bugs.webkit.org/show_bug.cgi?id=230483 Reviewed by Yusuke Suzuki. As an initial step in removing the XSS Auditor, turn it off by default. * Scripts/Preferences/WebPreferences.yaml: 2021-09-20 Chris Dumez Stop using makeRef(*this) / makeRefPtr(this) https://bugs.webkit.org/show_bug.cgi?id=230464 Reviewed by Alex Christensen. * wtf/cocoa/WorkQueueCocoa.cpp: (WTF::WorkQueue::dispatch): (WTF::WorkQueue::dispatchAfter): * wtf/glib/SocketConnection.cpp: (WTF::SocketConnection::SocketConnection): (WTF::SocketConnection::waitForSocketWritability): 2021-09-20 Jer Noble [Cocoa] Make AVSampleBufferVideoOutput support an Experimental Feature https://bugs.webkit.org/show_bug.cgi?id=230424 Reviewed by Eric Carlson. * Scripts/Preferences/WebPreferencesExperimental.yaml: * wtf/PlatformHave.h: 2021-09-18 Myles C. Maxfield [iOS Family] Delete letterpress support https://bugs.webkit.org/show_bug.cgi?id=230441 Reviewed by Tim Horton. * wtf/PlatformEnable.h: * wtf/PlatformEnableCocoa.h: 2021-09-17 David Kilzer Build fix: WebKit::WebProcessPool should use a weak observer with CFNotificationCenter * wtf/spi/cocoa/NSObjCRuntimeSPI.h: - Fix internal Catalina builds by including NSObjCRuntime_Private.h, but falling through to define NS_DIRECT and NS_DIRECT_MEMBERS if they weren't defined in the private header. 2021-09-17 Tim Horton Enable UseCGDisplayListsForDOMRendering by default where it is available https://bugs.webkit.org/show_bug.cgi?id=230387 Reviewed by Dean Jackson. * Scripts/Preferences/WebPreferencesInternal.yaml: 2021-09-17 Cameron McCormack Preserve color space when creating ImageBuffers for ImageBitmaps https://bugs.webkit.org/show_bug.cgi?id=229022 Reviewed by Sam Weinig. * wtf/PlatformHave.h: 2021-09-17 Simon Fraser Convert usesMockScrollAnimator from a DeprecatedGlobalSettings to a WebPreference https://bugs.webkit.org/show_bug.cgi?id=230371 Reviewed by Tim Horton. Add a MockScrollAnimatorEnabled setting. * Scripts/Preferences/WebPreferences.yaml: 2021-09-17 Carlos Garcia Campos [GTK][a11y] Add a build option to enable ATSPI https://bugs.webkit.org/show_bug.cgi?id=230254 Reviewed by Adrian Perez de Castro. Enable isolated tree when building with ATSPI. * Scripts/Preferences/WebPreferences.yaml: 2021-09-16 David Kilzer WebKit::WebProcessPool should use a weak observer with CFNotificationCenter Reviewed by Darin Adler. Tests (API): TestWTF.TypeCastsNS.checked_ns_cast TestWTF.TypeCastsNS.dynamic_ns_cast TestWTF.TypeCastsNS.dynamic_ns_cast_RetainPtr * WTF.xcodeproj/project.pbxproj: * wtf/PlatformMac.cmake: - Add new header files to the project. * wtf/cocoa/TypeCastsNS.h: Add. (WTF::checked_ns_cast): (WTF::dynamic_ns_cast): - Add casts for NS objects similar to TypeCastsCF.h. * wtf/PlatformHave.h: (HAVE_NS_DIRECT_SUPPORT): Add. - Note that clang for macOS 11 Big Sur claims to know about the attributes, but will fail to compile if they are actually used. * wtf/spi/cocoa/NSObjCRuntimeSPI.h: Add. (NS_DIRECT): (NS_DIRECT_MEMBERS): - Define compiler attributes for direct dispatch of Objective-C methods. 2021-09-16 Philip Chimento Fixes for build-webkit --minimal https://bugs.webkit.org/show_bug.cgi?id=229780 Reviewed by Fujii Hironori. Remove ENABLE_RESIZE_OBSERVER build-time option. This option is quite broken if you try to disable it. * Scripts/Preferences/WebPreferencesExperimental.yaml: * wtf/PlatformEnableCocoa.h: 2021-09-16 Tim Horton Adjust ARKIT_INLINE_PREVIEW* compile time flags https://bugs.webkit.org/show_bug.cgi?id=230332 Reviewed by Sam Weinig. * wtf/PlatformEnableCocoa.h: Make these ENABLE()s instead of HAVE()s (as they control a WebKit feature). Also, disable the ASVInlinePreview version if WKSeparatedModelView is enabled, we don't need both, and we currently always make a WKSeparatedModelView in that case anyway. * wtf/PlatformHave.h: Stop using __has_include in favor of version checks, now that the header has been around for a while. 2021-09-16 Youenn Fablet Enable RTCRtpScriptTransform by default https://bugs.webkit.org/show_bug.cgi?id=230220 Reviewed by Eric Carlson. Splitting WebRTCInsertableStreamsEnabled to WebRTCEncodedTransformEnabled and WebRTCSFrameTransformEnabled. Keeping WebRTCSFrameTransformEnabled as off by default until SFrame solidifies and mark WebRTCEncodedTransformEnabled as on by default. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-09-16 Cameron McCormack Disable display-p3 canvas and ImageData on platforms other than Monterey+ and iOS 15+ https://bugs.webkit.org/show_bug.cgi?id=230139 Reviewed by Sam Weinig. Add HAVE(CORE_ANIMATION_FIX_FOR_RADAR_78402035) to represent whether CoreAnimation has a fix for a bug that prevents Display P3 canvas rendering operations from behaving correctly. Add ENABLE(PREDEFINED_COLOR_SPACE_DISPLAY_P3) to represent whether the "display-p3" values of the PredefinedColorSpace IDL enum is enabled. This in turn controls whether Display P3 canvases and ImageData objects can be created. We turn this on only for platforms where ENABLE(DESTINATION_COLOR_SPACE_DISPLAY_P3), since that is what the canvas and ImageData backing stores use, and only if HAVE(CORE_ANIMATION_FIX_FOR_RADAR_78402035). The result is that these features are only enabled on macOS Monterey+ and iOS 15+. * wtf/PlatformEnable.h: * wtf/PlatformEnableCocoa.h: * wtf/PlatformHave.h: 2021-09-15 Philip Chimento Fixes for build-webkit --minimal https://bugs.webkit.org/show_bug.cgi?id=229780 Reviewed by Fujii Hironori. Remove ENABLE_INTERSECTION_OBSERVER build-time option. This option is quite broken if you try to disable it. * Scripts/Preferences/WebPreferencesExperimental.yaml: * wtf/PlatformEnableCocoa.h: 2021-09-15 Alex Christensen Add IDL skeleton for SharedWorker https://bugs.webkit.org/show_bug.cgi?id=230293 Reviewed by Geoff Garen. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-09-14 John Wilander Rename RESOURCE_LOAD_STATISTICS to INTELLIGENT_TRACKING_PREVENTION https://bugs.webkit.org/show_bug.cgi?id=230279 Reviewed by Darin Adler. * wtf/PlatformEnableCocoa.h: 2021-09-14 Chris Dumez Enable BroadcastChannel for modern WebKit https://bugs.webkit.org/show_bug.cgi?id=230235 Reviewed by Geoffrey Garen. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-09-14 Ryan Haddad Unreviewed, reverting r282408. Breaks internal builds. Reverted changeset: "Enable RTCRtpScriptTransform by default" https://bugs.webkit.org/show_bug.cgi?id=230220 https://commits.webkit.org/r282408 2021-09-14 Myles C. Maxfield CSSFontFaceSrcValue.cssText should be quoted consistently with other browsers https://bugs.webkit.org/show_bug.cgi?id=230273 Reviewed by Darin Adler. * wtf/unicode/CharacterNames.h: 2021-09-14 Youenn Fablet Enable RTCRtpScriptTransform by default https://bugs.webkit.org/show_bug.cgi?id=230220 Reviewed by Eric Carlson. Splitting WebRTCInsertableStreamsEnabled to WebRTCEncodedTransformEnabled and WebRTCSFrameTransformEnabled. Keeping WebRTCSFrameTransformEnabled as off by default until SFrame solidifies and mark WebRTCEncodedTransformEnabled as on by default. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-09-14 Fujii Hironori StackTrace outputs a garbage prefix because WTF::StackTrace::m_prefix is filled with the stack content https://bugs.webkit.org/show_bug.cgi?id=230207 Reviewed by Yusuke Suzuki. r278474 (Bug 226390) added a new member m_prefix to StackTrace at the bottom of the structure. However, StackTrace isn't a normal structure. The members are filled with the stack content. * wtf/StackTrace.h: Moved the m_prefix to the top of the members. 2021-09-14 Kate Cheney Followup to https://bugs.webkit.org/show_bug.cgi?id=217784 Reviewed by Wenson Hsieh. Update platform name for watchOS. * Scripts/Preferences/WebPreferences.yaml: 2021-09-14 Myles C. Maxfield [Cocoa] Migrate to CTFontHasTable() from CTFontCopyAvailableTables() https://bugs.webkit.org/show_bug.cgi?id=230248 Reviewed by Anders Carlsson. * wtf/PlatformUse.h: 2021-09-13 Alex Christensen Add unit test that uses PCM daemon https://bugs.webkit.org/show_bug.cgi?id=230191 Reviewed by Chris Dumez. * wtf/PlatformHave.h: * wtf/spi/darwin/XPCSPI.h: 2021-09-13 Sihui Liu Add stub for File System Access API https://bugs.webkit.org/show_bug.cgi?id=230101 Reviewed by Youenn Fablet. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-09-13 Sam Sneddon Move ENABLE_RESOLUTION_MEDIA_QUERY to a runtime flag, start running tests again https://bugs.webkit.org/show_bug.cgi?id=229776 Reviewed by Simon Fraser. * Scripts/Preferences/WebPreferencesExperimental.yaml: Add ResolutionMediaFeatureEnabled 2021-09-13 Youenn Fablet Remove WritableStream runtime flag https://bugs.webkit.org/show_bug.cgi?id=230148 Reviewed by Sihui Liu. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-09-11 Philippe Normand [GLIB] MediaSession is not enabled https://bugs.webkit.org/show_bug.cgi?id=217991 Reviewed by Michael Catanzaro. GRefPtr template specialization for GDBusNodeInfo. * wtf/glib/GRefPtr.cpp: (WTF::refGPtr): (WTF::derefGPtr): * wtf/glib/GRefPtr.h: 2021-09-10 Alex Christensen Use std::not_fn instead of lambda in URLParser https://bugs.webkit.org/show_bug.cgi?id=230058 Reviewed by Darin Adler. Since the return type of std::not_fn is not specified, it can't be converted to a bool(*)(UChar). This necessitates the templatizing of CodeUnitMatchFunction to be anything that is invocable with a UChar and returns a type that is convertable to a bool. * wtf/URLParser.cpp: (WTF::dnsNameEndsInNumber): * wtf/text/StringCommon.h: * wtf/text/StringImpl.h: (WTF::find): Deleted. * wtf/text/StringView.h: * wtf/text/WTFString.h: 2021-09-09 Chris Dumez Unreviewed follow-up to r282105. Add description for "BroadcastChannel Origin Partitioning" experimental feature. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-09-09 Chris Dumez Unreviewed, follow-up after r282007 Somehow, the wrong settings got enabled by the patch landed. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-09-09 Darin Adler Improve performance by using StringView, not "const StringView&" https://bugs.webkit.org/show_bug.cgi?id=229834 Reviewed by Anders Carlsson. Since StringView is a small structure that fits into two registers, it's not good to pass a pointer to it; better performance to pass it by value. Note that this is for release builds, not debug builds where StringView has significant additional overhead when copying. * wtf/PrintStream.cpp: (WTF::printInternal): * wtf/PrintStream.h: * wtf/text/StringConcatenate.h: * wtf/text/StringView.cpp: (WTF::StringView::containsIgnoringASCIICase const): (WTF::StringView::findIgnoringASCIICase const): (WTF::StringView::startsWith const): (WTF::StringView::startsWithIgnoringASCIICase const): (WTF::StringView::endsWith const): (WTF::StringView::endsWithIgnoringASCIICase const): (WTF::StringView::GraphemeClusters::Iterator::Impl::Impl): (WTF::StringView::GraphemeClusters::Iterator::Iterator): * wtf/text/StringView.h: * wtf/text/WTFString.h: Use StringView, not const StringView&. 2021-09-09 Alex Christensen Add PrivateClickMeasurement daemon https://bugs.webkit.org/show_bug.cgi?id=230052 Reviewed by Chris Dumez. * wtf/spi/darwin/XPCSPI.h: 2021-09-09 Patrick Angle run-webkit-archive crashes with dyld error https://bugs.webkit.org/show_bug.cgi?id=228060 Reviewed by Alex Christensen. Bump the maximum macOS version that `HAVE_SAFARI_FOR_WEBKIT_DEVELOPMENT_REQUIRING_EXTRA_SYMBOLS` will be enabled to provide compatibility with changes made in macOS 12. * wtf/PlatformHave.h: 2021-09-08 Jean-Yves Avenard Safari TP 131 audio canPlayType() reports false negatives https://bugs.webkit.org/show_bug.cgi?id=229799 rdar://problem/82776747 Reviewed by Youenn Fablet. * Scripts/Preferences/WebPreferencesExperimental.yaml: Remove preference. 2021-09-07 Sihui Liu Add basic support for Storage API https://bugs.webkit.org/show_bug.cgi?id=229925 Reviewed by Darin Adler. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-09-07 Yusuke Suzuki [JSC] Implement Temporal.PlainTime https://bugs.webkit.org/show_bug.cgi?id=229892 Reviewed by Darin Adler. * wtf/text/IntegerToStringConversion.h: * wtf/text/StringParsingBuffer.h: 2021-09-07 Cameron McCormack Add an IPCMessages channel to log all IPC messages https://bugs.webkit.org/show_bug.cgi?id=229664 Reviewed by Alex Christensen. Two changes to TextStream in this patch. The first is a new argument to the constructor to allow limiting the number of elements in a container when appending it to a TextStream. This is intended to be used when the output is for human consumption and could potentially be uselessly large. The second is a value adapter ValueOrEllipsis. This allows appending a value to a TextStream even if it doesn't have an operator<<(TextStream&) defined. If it doesn't, then the fallback value "..." is used instead. An implementation detail of ValueOrEllipsis is a new type trait supports_text_stream_insertion, which detects at compile time whether a given type can be appended to a TextStream. It works by using "expression SFINAE" and partial template specialization. The base, unspecialized version of the template inherits from std::false_type, and is selected for all types by default. A partial specialization that uses decltype() to check whether a `TextStream() << value` expression would compile inherits from std::true_type. Sadly, C++ SFINAE has a limitation that means template definitions that would be instantiated inside the decltype() are not checked to ensure they would compile. This would mean container types whose elements are types that don't have an operator<< defined would still report true from supports_text_stream_insertion. We work around this by having more specific partial specializations for all of the container types we have operator<< definitions for, which defer to the supports_text_stream_insertion value for the element type(s). If an operator<< is added for a new container type without a corresponding supports_text_stream_insertion specialization, and that type is used with ValueOrEllipsis, it will cause a compile error. The supports_text_stream_insertion template takes six template arguments, which looks odd, but is needed because all specializations must have the same number (and kind) of template arguments. The six include five type template arguments (which is how many HashMap has) plus a size_t value template argument (for Vector's inlineCapacity argument). * wtf/text/TextStream.h: (WTF::TextStream::TextStream): (WTF::TextStream::containerSizeLimit const): (WTF::operator<<): (WTF::ValueOrEllipsis::ValueOrEllipsis): 2021-09-07 Chris Dumez Implement origin partitioning (top-origin/frame-origin) for BroadcastChannel https://bugs.webkit.org/show_bug.cgi?id=229814 Reviewed by Alex Christensen. Add experimental preference for BroadcastChannel origin partitioning. This is useful because we currently disable this when running web-platform-tests in WKTR / DRT for now. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-09-06 Dmitry Kalinkin Fix WebKitGTK build on MacOS https://bugs.webkit.org/show_bug.cgi?id=225850 Reviewed by Michael Catanzaro. Define HAVE_AUDIT_TOKEN only for Cocoa backend. * wtf/PlatformHave.h: 2021-09-03 Basuke Suzuki Use USE(SYSTEM_MALLOC) macro in all cases https://bugs.webkit.org/show_bug.cgi?id=229902 Reviewed by Yusuke Suzuki. Convert old style macro check to USE() macro for USE_SYSTEM_MALLOC. * wtf/FastMalloc.cpp: * wtf/Gigacage.cpp: * wtf/Gigacage.h: * wtf/IsoMalloc.h: * wtf/IsoMallocInlines.h: * wtf/JSValueMalloc.cpp: * wtf/PlatformUse.h: * wtf/RAMSize.cpp: * wtf/VMTags.h: * wtf/WTFConfig.h: 2021-09-03 Yusuke Suzuki [JSC] Implement Temporal.TimeZone https://bugs.webkit.org/show_bug.cgi?id=229703 Reviewed by Ross Kirsling. * wtf/text/IntegerToStringConversion.h: Support integer serialization into Vector. * wtf/text/StringConcatenate.h: Extends StringConcatenate feature for Vector with UChar/LChar + N size. 2021-09-03 Chris Dumez [WK2] Turn on support for Cross-Origin-Opener-Policy / Cross-Origin-Embedder-Policy https://bugs.webkit.org/show_bug.cgi?id=229818 Reviewed by Sam Weinig. Turn on support for Cross-Origin-Opener-Policy / Cross-Origin-Embedder-Policy on WebKit2 now that the feature is complete and all known issues have been fixed. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-09-02 Alex Christensen Reject non-IPv4 hostnames that end in numbers https://bugs.webkit.org/show_bug.cgi?id=228826 Reviewed by Tim Horton. This implements a recent change to the URL specification at https://github.com/whatwg/url/pull/619 Chrome has made the same change in https://crbug.com/1237032 Since there are no TLDs that are only numbers and some think it might be confusing to have a valid URL like http://example.com.127.0.0.1/ we prevent URLs that end in a segment between dots that contains only numbers from parsing successfully. * wtf/URLParser.cpp: (WTF::URLParser::parse): (WTF::dnsNameEndsInNumber): (WTF::URLParser::parseHostAndPort): I give more information in the return type so one can tell what the code is doing. We only check if it is valid or not, but for documentation purposes I think it's useful to return more information. * wtf/URLParser.h: 2021-09-02 Mark Lam Add more support for JIT operation validation testing. https://bugs.webkit.org/show_bug.cgi?id=229534 rdar://81526335 Reviewed by Saam Barati. * wtf/PlatformCallingConventions.h: * wtf/PtrTag.h: (WTF::PtrTagTraits::isTagged): (WTF::isTaggedNativeCodePtrImpl): (WTF::isTaggedWith): (WTF::assertIsTaggedWith): 2021-08-26 Darin Adler Cut down on use of CFGetTypeID, using dynamic_cf_cast instead; related streamlining https://bugs.webkit.org/show_bug.cgi?id=229414 Reviewed by Tim Horton. * wtf/cf/TypeCastsCF.h: Added WTF_DECLARE_CF_TYPE_TRAIT(CFURL). Added a dynamic_cf_cast overload that converts from one RetainPtr type to another and avoids reference count churn. Tweaked comments. * wtf/cocoa/Entitlements.mm: (WTF::hasEntitlement): Use kCFBooleanTrue instead of CFBooleanGetValue. * wtf/text/cocoa/TextBreakIteratorInternalICUCocoa.cpp: (WTF::textBreakLocalePreference): Use dynamic_cf_cast. 2021-08-30 Yusuke Suzuki [JSC] Implement Temporal.Calendar https://bugs.webkit.org/show_bug.cgi?id=229651 Reviewed by Ross Kirsling. Add UChar version of createStaticStringImpl to make immortal thread-safe StringImpl with UChar. * wtf/text/StringImpl.cpp: (WTF::StringImpl::createStaticStringImpl): * wtf/text/StringImpl.h: (WTF::StringImpl::createStaticStringImpl): 2021-08-30 Sihui Liu Add stubs for Permissions API https://bugs.webkit.org/show_bug.cgi?id=229339 Reviewed by Chris Dumez. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-08-30 Zan Dobersek RISCV64 support in LLInt https://bugs.webkit.org/show_bug.cgi?id=229035 Reviewed by Yusuke Suzuki. * wtf/PlatformEnable.h: Define ENABLE_LLINT_EMBEDDED_OPCODE_ID to 1 for CPU(RISCV64). 2021-08-28 Cameron McCormack Miscellaneous typo fixes https://bugs.webkit.org/show_bug.cgi?id=229642 Reviewed by Fujii Hironori. * wtf/CrossThreadTask.h: (WTF::callMemberFunctionForCrossThreadTask): * wtf/text/StringImpl.h: (WTF::StringImpl::createSubstringSharingImpl): 2021-08-28 David Kilzer [WTF] Fix static analyzer warnings about nullptr derefs in StringImpl::copyCharacters() and tryMakeStringFromAdapters() Reviewed by Darin Adler. * wtf/text/StringConcatenate.h: (WTF::tryMakeStringFromAdapters): - Add nullptr checks for `buffer` since it makes no sense to call stringTypeAdapterAccumulator() with a nullptr argument, and it fixes static analyzer warnings about dereferencing nullptr. * wtf/text/StringImpl.h: (WTF::StringImpl::copyCharacters): - Add `ASSERT(destination || !numCharacters)` statement to describe an invariant when calling this method. This stops the static analyzer from emitting false positive warnings about `destination` being nullptr. 2021-08-27 Simon Fraser Define ENABLE_CONTENT_CHANGE_OBSERVER for IOS_FAMILY and use it to wrap content observation code https://bugs.webkit.org/show_bug.cgi?id=229624 Reviewed by Alan Bujtas. Deploy ENABLE(CONTENT_CHANGE_OBSERVER). * Scripts/Preferences/WebPreferences.yaml: * wtf/PlatformEnable.h: * wtf/PlatformEnableCocoa.h: 2021-08-27 Eric Carlson [ Catalina EWS ] media/track/track-disabled-addcue.html is flaky crashing https://bugs.webkit.org/show_bug.cgi?id=229462 Reviewed by Darin Adler. * wtf/SetForScope.h: (WTF::SetForScope::SetForScope): Add a constructor that takes the value to set on scope exit. 2021-08-27 Russell Epstein Land Windows build fixes from safari-612.1.29.14-branch https://bugs.webkit.org/show_bug.cgi?id=229627 Reviewed by Per Arne Vollan. * WTF.vcxproj/WTF.proj: 2021-08-27 Antti Koivisto [CSS Cascade Layers] Initial support https://bugs.webkit.org/show_bug.cgi?id=229542 Reviewed by Simon Fraser. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-08-27 Mikhail R. Gadelha Avoid increasing required alignment of target type warning on ARM 32 bits https://bugs.webkit.org/show_bug.cgi?id=229151 Reviewed by Mark Lam. Same approach as https://bugs.webkit.org/show_bug.cgi?id=38045 cast pointers to void* to bypass warning about increasing pointer alingment. reinterpret_cast_ptr has custom behaviour only on ARM and MIPS 32 bits, and doesn't change the behaviour in 64 bits archs (reinterpret_cast_ptr is preprocessed to reinterpret_cast in 64 bits archs) * wtf/BloomFilter.h: (WTF::BloomFilter::keysFromHash): * wtf/FileSystem.cpp: (WTF::FileSystemImpl::makeSalt): 2021-08-26 Risul Islam Add new experimental feature flag for sanitizing links https://bugs.webkit.org/show_bug.cgi?id=229451 Reviewed by Kate Cheney. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-08-25 Wenson Hsieh Remove some iOS-specific compile-time guards that are no longer needed https://bugs.webkit.org/show_bug.cgi?id=229500 Reviewed by Tim Horton. Remove the feature flags. See WebKit/ChangeLog for more details. * wtf/PlatformHave.h: * wtf/PlatformUse.h: 2021-08-24 Yusuke Suzuki [JSC] Add Intl Enumeration APIs https://bugs.webkit.org/show_bug.cgi?id=214795 Reviewed by Ross Kirsling. * wtf/text/StringImpl.cpp: (WTF::StringImpl::createFromLiteral): * wtf/text/StringImpl.h: 2021-08-24 Tim Nguyen Implement inert attribute behind feature flag https://bugs.webkit.org/show_bug.cgi?id=165279 Reviewed by Chris Dumez. Add runtime InertAttributeEnabled feature flag disabled by default. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-08-21 Myles C. Maxfield overwriteCodePoint() in createAndFillGlyphPage() is wrong https://bugs.webkit.org/show_bug.cgi?id=215643 Reviewed by Alan Bujtas. * wtf/unicode/CharacterNames.h: 2021-08-21 Sihui Liu IndexedDB: crash when triggering IDBOpenRequest completion back on a worker thread https://bugs.webkit.org/show_bug.cgi?id=229375 Protect callee in CrossThreadTask if it inherits from ThreadSafeRefCounted. Reviewed by Brady Eidson. * wtf/CrossThreadTask.h: 2021-08-20 Mark Lam Make ptrTagName and tagForPtr WTF_EXPORT_PRIVATE. https://bugs.webkit.org/show_bug.cgi?id=229328 Reviewed by Yusuke Suzuki. If ptrTagName and tagForPtr are defined, make them WTF_EXPORT_PRIVATE instead of static functions. This allows us to call them from the debugger during interactive debugging sessions. * wtf/PtrTag.cpp: (WTF::tagForPtr): (WTF::ptrTagName): * wtf/PtrTag.h: 2021-08-20 Mark Lam Remove assertIsTagged and assertIsNullOrTagged. https://bugs.webkit.org/show_bug.cgi?id=229329 rdar://82162851 Reviewed by Yusuke Suzuki. These assertion utility functions rely on tagged pointers always having non-zero PAC bits. This is an incorrect assumption. A tagged pointer can have PAC bits that are completely zero. Hence, these assert functions cannot be made to work reliably. We should remove them to prevent them from being used, and potentially resulting in flaky assertion failures that will be hard to debug later. Note: assertIsNotTagged is fine to keep. It asserts that PAC bits of a pointer are all 0. As a result, this assertion can have false positives where it may think a tagged pointer is an untagged pointer. However, this is rare because it is not common to have 0 PAC bits in tagged pointers. False positives on this assertion won't result in flaky test failures that will waste our time later. Hence, keeping the assertion will do more good (it will tend to help us find bugs) than bad (it will rarely let false positives thru). As a result, I'm opting to not remove it. * wtf/PtrTag.h: (WTF::assertIsTagged): Deleted. (WTF::assertIsNullOrTagged): Deleted. 2021-08-19 Antti Koivisto [:has() pseudo-class] Basic support https://bugs.webkit.org/show_bug.cgi?id=228894 Reviewed by Simon Fraser. * Scripts/Preferences/WebPreferencesExperimental.yaml: Add off-by-default HasPseudoClassEnabled preference value. 2021-08-19 Myles C. Maxfield [Cocoa] Stop treating the system font as a non-variable font https://bugs.webkit.org/show_bug.cgi?id=228176 Reviewed by Sam Weinig. * wtf/PlatformUse.h: 2021-08-19 Aditya Keerthi Remove __has_include guard for _UIDatePickerOverlayPresentation https://bugs.webkit.org/show_bug.cgi?id=227298 rdar://79970171 Reviewed by Tim Horton. * wtf/PlatformHave.h: 2021-08-19 David Kilzer [WTF] Fix static analyzer warnings for clang tidy bugprone-move-forwarding-reference checker Reviewed by Darin Adler. * wtf/Deque.h: (WTF::inlineCapacity>::appendAndBubble): * wtf/Scope.h: (WTF::ScopeExit::ScopeExit): * wtf/ScopedLambda.h: (WTF::scopedLambda): * wtf/SharedTask.h: (WTF::createSharedTask): - Replace WTFMove() with std::forward<>(). 2021-08-19 Alex Christensen Remove more non-inclusive language from Source https://bugs.webkit.org/show_bug.cgi?id=229230 Reviewed by Myles C. Maxfield. * icu/unicode/uspoof.h: This comment change comes from upstream ICU. * wtf/URL.h: 2021-08-18 Ryosuke Niwa [ iOS Debug ] 12 TestWebKitAPI.WebKitLegacy. tests are crashing https://bugs.webkit.org/show_bug.cgi?id=229250 Reviewed by Wenson Hsieh. Disable the assertion when Web Thread is enabled for now. * wtf/CheckedRef.h: (WTF::SingleThreadIntegralWrapper::assertThread const): 2021-08-18 Megan Gardner Remove unneeded UIKitSPI declarations https://bugs.webkit.org/show_bug.cgi?id=210075 Reviewed by Wenson Hsieh. Remove unneeded feature define. * wtf/PlatformHave.h: 2021-08-18 Xabier Rodriguez Calvar [GStreamer][EME] Try to parse XML init datas that could possibly come from MPD manifests https://bugs.webkit.org/show_bug.cgi?id=229145 Reviewed by Alicia Boya Garcia. * wtf/glib/GUniquePtr.h: Added deleter for GMarkupParseContext. 2021-08-16 Alex Christensen Enable PerformanceNavigationAPI by default https://bugs.webkit.org/show_bug.cgi?id=227336 Reviewed by Chris Dumez. It passes WPT tests except the following: navigation-timing/nav2_test_redirect_chain_xserver_partial_opt_in.html and navigation-timing/nav2_test_redirect_xserver.html pass when run from wpt.live, and other browsers also don't pass when run from our local hosting infrastructure, which doesn't have a good cross-domain redirect. nav2_test_attributes_values.html fails in Chrome and Firefox. There's something wrong with the port detection in the test. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-08-16 Ryosuke Niwa Add thread safe version of CanMakeCheckedPtr https://bugs.webkit.org/show_bug.cgi?id=229018 Reviewed by Geoffrey Garen. Introduce CanMakeThreadSafeCheckedPtr which is a thread safe version of CanMakeCheckedPtr. * wtf/CheckedRef.h: (WTF::CanMakeCheckedPtrBase): Extracted from CanMakeCheckedPtr. (WTF::CanMakeCheckedPtrBase::~CanMakeCheckedPtrBase): (WTF::CanMakeCheckedPtrBase::ptrCount const): (WTF::SingleThreadIntegralWrapper): Added. (WTF::SingleThreadIntegralWrapper::SingleThreadIntegralWrapper): (WTF::SingleThreadIntegralWrapper::operator IntegralType const): (WTF::SingleThreadIntegralWrapper::operator! const): (WTF::SingleThreadIntegralWrapper::operator++): (WTF::SingleThreadIntegralWrapper::operator--): (WTF::SingleThreadIntegralWrapper::assertThread const): (WTF::CanMakeCheckedPtr): Redefined using CanMakeCheckedPtrBase and SimpleNonAtomicType. (WTF::CanMakeThreadSafeCheckedPtr): Added. 2021-08-16 David Kilzer ThreadSanitizer: ignore uninteresting data races for reference counting of static WTF::StringImpl objects Reviewed by Chris Dumez. * wtf/text/StringImpl.h: (WTF::StringImpl::isStatic const): - Add SUPPRESS_TSAN attribute since the 0x1 bit is set at construction and refcounting occurs in increments of 0x2, so the static bit never changes. (WTF::StringImpl::ref): (WTF::StringImpl::deref): - Return early for static WTF::StringImpl objects to prevent TSan from reporting data races for m_refCount. 2021-08-15 Miguel Gomez [GTK][WPE] Add API to pass WebKitMemoryPressureHandler parameters to the network processes https://bugs.webkit.org/show_bug.cgi?id=228227 Reviewed by Carlos Garcia Campos. Added a new method to MemoryPressureHandler to set the configuration by copying the parameter instead of moving it. * wtf/MemoryPressureHandler.h: (WTF::MemoryPressureHandler::setConfiguration): 2021-08-11 Chris Dumez Add initial support for Cross-Origin-Embedder-Policy (COEP) https://bugs.webkit.org/show_bug.cgi?id=228754 Reviewed by Alex Christensen. Add experimental feature flag for Cross-Origin-Embedder-Policy (COEP), off by default. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-08-11 Darin Adler Add deduction guide to RetainPtr, use constexpr a bit more, and streamline the implementation https://bugs.webkit.org/show_bug.cgi?id=228852 Reviewed by Sam Weinig. * wtf/RetainPtr.h: Sort includes. Made many functions constexpr including the move constructors and adoptCF. Use using instead of typedef in most places. Use remove_pointer_t, conditional_t, is_convertible_v, is_same_v, and other such templates to simplify expressions. Initialize the m_ptr data member and use the default constructor. Removed unneeded StorageType synonym for CFTypeRef. Move some inline function bodies out of the class template definition. Use if constexpr to get rid of the need for the overloaded autoreleaseHelper function. Added a deduction guide so we can use expressions with the type RetainPtr on the left side, and an Objective-C pointer or CFTypeRef on the right side, and have the appropriate RetainPtr type deduced. 2021-08-11 Sihui Liu Suspend WorkQueue of ResourceLoadStatistics and LocalStorage sooner https://bugs.webkit.org/show_bug.cgi?id=228748 Reviewed by Chris Dumez. Add SuspendableWorkQueue that would perform suspend check before each task. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/Forward.h: * wtf/SuspendableWorkQueue.cpp: Added. (WTF::SuspendableWorkQueue::create): (WTF::SuspendableWorkQueue::SuspendableWorkQueue): (WTF::SuspendableWorkQueue::suspend): (WTF::SuspendableWorkQueue::resume): (WTF::SuspendableWorkQueue::dispatch): (WTF::SuspendableWorkQueue::dispatchAfter): (WTF::SuspendableWorkQueue::dispatchSync): (WTF::SuspendableWorkQueue::invokeAllSuspensionCompletionHandlers): (WTF::SuspendableWorkQueue::suspendIfNeeded): * wtf/SuspendableWorkQueue.h: Added. * wtf/WorkQueue.h: (): Deleted. 2021-08-11 Youenn Fablet Enable WebRTC relay by default https://bugs.webkit.org/show_bug.cgi?id=229000 Reviewed by Eric Carlson. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-08-10 Peng Liu Disable SYSTEM_FEATURE_FLAGS on iOS 14 https://bugs.webkit.org/show_bug.cgi?id=228979 Reviewed by Tim Horton. Stop using feature flags mechanism on iOS 14 to avoid some issues on iOS simulators. * wtf/PlatformHave.h: 2021-08-10 Stephan Szabo [WTF][PlayStation] REGRESSION(r280795) error: undefined symbol: WTF::logLevelString() https://bugs.webkit.org/show_bug.cgi?id=228959 Reviewed by Fujii Hironori. As per followup win fix, for declspec platforms, LoggingUnix needs to include LogInitialization to get the export declaration. * wtf/unix/LoggingUnix.cpp: 2021-08-10 Keith Miller CallFrame::returnPC should untag the return address before passing it to ReturnAddressPtr https://bugs.webkit.org/show_bug.cgi?id=228931 Reviewed by Mark Lam. Add a new helper to untag the return pc from a stack frame. * wtf/PtrTag.h: (WTF::untagReturnPC): 2021-08-09 Fujii Hironori [GTK][WPE] REGRESSION(r280795): MemoryPressureHandlerUnix.cpp:45:28: error: ‘LogMemoryPressure’ was not declared in this scope https://bugs.webkit.org/show_bug.cgi?id=228938 Unreviewed build fix. * wtf/unix/MemoryPressureHandlerUnix.cpp: 2021-08-09 Fujii Hironori [WTF][Win] REGRESSION(r280795) error LNK2019: unresolved external symbol "class WTF::String __cdecl WTF::logLevelString(void)" https://bugs.webkit.org/show_bug.cgi?id=228937 Unresolved build fix. The previous attempt (r280819) didn't actually fix the build error. LoggingWin.cpp has to include LogInitialization.h. * wtf/win/LoggingWin.cpp: 2021-08-09 Fujii Hironori [WTF][Win] REGRESSION(r280795) error LNK2019: unresolved external symbol "class WTF::String __cdecl WTF::logLevelString(void)" https://bugs.webkit.org/show_bug.cgi?id=228937 Unreviewed build fix. > error LNK2019: unresolved external symbol "class WTF::String __cdecl WTF::logLevelString(void)" (?logLevelString@WTF@@YA?AVString@1@XZ) > referenced in function "private: void __cdecl WebKit::GPUProcessProxy::platformInitializeGPUProcessParameters(struct WebKit::GPUProcessCreationParameters &)" > (?platformInitializeGPUProcessParameters@GPUProcessProxy@WebKit@@AEAAXAEAUGPUProcessCreationParameters@2@@Z) > bin64\WebKit2.dll : fatal error LNK1120: 1 unresolved externals * wtf/LogInitialization.h: Added WTF_EXPORT_PRIVATE for logLevelString. 2021-08-09 Myles C. Maxfield Create a Language log channel https://bugs.webkit.org/show_bug.cgi?id=228764 Reviewed by Simon Fraser. There have been a variety of bug reports over the past months/years about the procedure by which we determine navigator.language. It's actually somewhat convoluted, so this patch adds a (debug) log channel for it so we can follow what it's doing easily. To enable all the logging, run these commands: % defaults write com.apple.WebKit.WebContent.Development WTFLogging Language % defaults write com.apple.WebKit.WebContent.Development WebKit2Logging Language % defaults write com.apple.WebKit.WebContent WTFLogging Language % defaults write com.apple.WebKit.WebContent WebKit2Logging Language % defaults write -g WTFLogging Language % defaults write -g WebKit2Logging Language % defaults write /Users/$USER/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari.plist WTFLogging Language % defaults write /Users/$USER/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari.plist WebKit2Logging Language * wtf/Language.cpp: (WTF::defaultLanguage): (WTF::overrideUserPreferredLanguages): (WTF::userPreferredLanguages): * wtf/Logging.cpp: * wtf/Logging.h: * wtf/cf/LanguageCF.cpp: (WTF::platformUserPreferredLanguages): * wtf/cocoa/LanguageCocoa.mm: (WTF::minimizedLanguagesFromLanguages): 2021-08-09 Myles C. Maxfield Support WTF logging channels https://bugs.webkit.org/show_bug.cgi?id=228768 This patch builds on top of https://bugs.webkit.org/show_bug.cgi?id=228809, which added shared infrastructure for logging. This patch simply triggers that shared infrastructure for WTF. There is no change in behavior - the existing WTF logging channels currently are all implemented independently in custom ways, so this patch just migrates them over to use the shared infrastructure. Reviewed by Fujii Hironori. * WTF.xcodeproj/project.pbxproj: * wtf/Assertions.h: * wtf/CMakeLists.txt: * wtf/LogInitialization.cpp: Added. (WTF::logChannels): * wtf/LogInitialization.h: Added. * wtf/Logging.cpp: Added. * wtf/Logging.h: Added. * wtf/MemoryPressureHandler.cpp: (WTF::MemoryPressureHandler::singleton): * wtf/MemoryPressureHandler.h: * wtf/PlatformFTW.cmake: * wtf/PlatformGTK.cmake: * wtf/PlatformJSCOnly.cmake: * wtf/PlatformMac.cmake: * wtf/PlatformPlayStation.cmake: * wtf/PlatformWPE.cmake: * wtf/PlatformWin.cmake: * wtf/RefCountedLeakCounter.cpp: * wtf/cocoa/LoggingCocoa.mm: Copied from Source/WebKit/UIProcess/Cocoa/GPUProcessProxyCocoa.mm. (WTF::logLevelString): * wtf/cocoa/MachSendRight.cpp: * wtf/cocoa/MainThreadCocoa.mm: * wtf/cocoa/MemoryPressureHandlerCocoa.mm: * wtf/unix/LoggingUnix.cpp: Added. (WTF::logLevelString): * wtf/win/LoggingWin.cpp: Added. (WTF::logLevelString): 2021-08-07 Myles C. Maxfield Deduplicate logging channel algorithms https://bugs.webkit.org/show_bug.cgi?id=228809 Reviewed by Fujii Hironori. The current infrastructure (before this patch) had the following duplicated for each framework: - A .cpp file declared the list of logging channels for that framework - The .cpp file also had algorithms to search, modify, and initialize these logging channels Each framework's .cpp file had duplicate algorithms. (The initialization algorithm was even duplicated 3 times!) Because the algorithms directly name their specific list of logging channels, a naive deduplication would have had to add new parameters to these algorithms to pass in the appropriate framework's list. That's fine, but this is exactly the sort of thing classes were designed for - classes are an association of algorithms and data. The algorithms are shared but the data isn't, which really just means we should have 3 instances of a shared class - one for the 3 sets of data. So, this patch creates the LogChannels class which contains the deduplicated algorithms, and each framework has a NeverDestroyed singleton instance of that class. There is a single virtual method in the class, so the appropriate "default write" variable can be queried for each framework. The instances cannot be declared in the Logging.h files in the frameworks, because certain WebKit2 files want to initialize all 3 instances of LogChannels, but you can't #include multiple Logging.h files at the same time because their LOG_CHANNEL_PREFIX #defines will collide with each other. Luckily, LogInitialization.h files exist exactly to solve this purpose, so that's where the LogChannels instances are declared in. After this change, the Logging.h files are just for the declarations of the logging channels themselves, and the LogInitialization.h files are for the LogChannels instances which contain the searching/modifying/initializing algorithms on the list of logging channels. If you just want to LOG(...) something, #include the relevant Logging.h file, and if you want to search/modify/initialize across the entire list of channels, then #include the relevant LogInitialization.h file. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/LogChannels.cpp: Copied from Source/WebCore/platform/Logging.cpp. (WTF::LogChannels::isLogChannelEnabled): (WTF::LogChannels::setLogChannelToAccumulate): (WTF::LogChannels::clearAllLogChannelsToAccumulate): (WTF::LogChannels::initializeLogChannelsIfNecessary): (WTF::LogChannels::getLogChannel): * wtf/LogChannels.h: Copied from Source/WebCore/platform/LogInitialization.h. 2021-08-07 Commit Queue Unreviewed, reverting r280756. https://bugs.webkit.org/show_bug.cgi?id=228897 Broke gtk build Reverted changeset: "Deduplicate logging channel algorithms" https://bugs.webkit.org/show_bug.cgi?id=228809 https://commits.webkit.org/r280756 2021-08-07 Myles C. Maxfield Deduplicate logging channel algorithms https://bugs.webkit.org/show_bug.cgi?id=228809 Reviewed by Fujii Hironori. The current infrastructure (before this patch) had the following duplicated for each framework: - A .cpp file declared the list of logging channels for that framework - The .cpp file also had algorithms to search, modify, and initialize these logging channels Each framework's .cpp file had duplicate algorithms. (The initialization algorithm was even duplicated 3 times!) Because the algorithms directly name their specific list of logging channels, a naive deduplication would have had to add new parameters to these algorithms to pass in the appropriate framework's list. That's fine, but this is exactly the sort of thing classes were designed for - classes are an association of algorithms and data. The algorithms are shared but the data isn't, which really just means we should have 3 instances of a shared class - one for the 3 sets of data. So, this patch creates the LogChannels class which contains the deduplicated algorithms, and each framework has a NeverDestroyed singleton instance of that class. There is a single virtual method in the class, so the appropriate "default write" variable can be queried for each framework. The instances cannot be declared in the Logging.h files in the frameworks, because certain WebKit2 files want to initialize all 3 instances of LogChannels, but you can't #include multiple Logging.h files at the same time because their LOG_CHANNEL_PREFIX #defines will collide with each other. Luckily, LogInitialization.h files exist exactly to solve this purpose, so that's where the LogChannels instances are declared in. After this change, the Logging.h files are just for the declarations of the logging channels themselves, and the LogInitialization.h files are for the LogChannels instances which contain the searching/modifying/initializing algorithms on the list of logging channels. If you just want to LOG(...) something, #include the relevant Logging.h file, and if you want to search/modify/initialize across the entire list of channels, then #include the relevant LogInitialization.h file. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/LogChannels.cpp: Copied from Source/WebCore/platform/Logging.cpp. (WTF::LogChannels::isLogChannelEnabled): (WTF::LogChannels::setLogChannelToAccumulate): (WTF::LogChannels::clearAllLogChannelsToAccumulate): (WTF::LogChannels::initializeLogChannelsIfNecessary): (WTF::LogChannels::getLogChannel): * wtf/LogChannels.h: Copied from Source/WebCore/platform/LogInitialization.h. 2021-08-05 Michael Catanzaro GCC 11 builds should use -Wno-array-bounds, -Wno-nonnull https://bugs.webkit.org/show_bug.cgi?id=228601 Reviewed by Carlos Garcia Campos. * wtf/Bitmap.h: (WTF::WordType>::clear): * wtf/Compiler.h: * wtf/Packed.h: (WTF::PackedAlignedPtr::get const): * wtf/RefPtr.h: (WTF::DefaultRefDerefTraits::derefIfNotNull): 2021-08-05 Zan Dobersek Avoid reinterpret_cast alignment increase warnings with GCC on CPU(RISCV64) https://bugs.webkit.org/show_bug.cgi?id=228818 Reviewed by Adrian Perez de Castro. * wtf/StdLibExtras.h: As with 32-bit ARM and MIPS targets, RISC-V 64-bit builds with GCC also spawn warnings when the use of reinterpret_cast causes an increase in alignment. Workaround via reinterpret_cast_ptr is thus required for CPU(RISCV64). 2021-08-03 Myles C. Maxfield [Cocoa] Tweak the formatting for passing NSArrays to TextStreams https://bugs.webkit.org/show_bug.cgi?id=228766 Reviewed by Simon Fraser. Instead of using -[NSArray description], which puts its output on multiple lines, instead use the same formatting as WTF::Vector, which puts its output on a single line. We can also use this opportunity to tweak the implementation of operator<<(id) to allow it to be called with Core Foundation types in raw C++ code. * wtf/text/TextStream.h: * wtf/text/cocoa/TextStreamCocoa.mm: (WTF::TextStream::operator<<): 2021-08-03 Risul Islam Add functions for parsing URL query string https://bugs.webkit.org/show_bug.cgi?id=228122 Reviewed by Darin Adler. Added parsing of URL query strings. * wtf/KeyValuePair.h: (WTF::operator== const): * wtf/URL.cpp: (WTF::URL::differingQueryParameters): (WTF::lengthOfURLIgnoringQueryAndFragments): (WTF::URL::isEqualIgnoringQueryAndFragments): (WTF::URL::removeQueryParameters): * wtf/URL.h: 2021-08-03 Youenn Fablet RealtimeMediaSource::audioSamplesAvailable is calling malloc as part of locking in audio thread https://bugs.webkit.org/show_bug.cgi?id=228688 Reviewed by Eric Carlson. Allow allocations in lockSlow since allocations might happen in rare case and not for each lockSlow call. * wtf/Lock.cpp: (WTF::Lock::lockSlow): (WTF::Lock::unlockSlow): (WTF::Lock::unlockFairlySlow): 2021-08-02 Ryosuke Niwa Add CheckedRef https://bugs.webkit.org/show_bug.cgi?id=227164 Reviewed by Geoffrey Garen. Like r278344, this patch introduces a new type of smart pointer, CheckedRef, which lets each object keep track of pointers pointing to the object. As with CheckedPtr, the purpose of the internal counter for CheckedRef is to release assert that there is no outstanding pointer at the time of destruction instead of keeping the object alive when there is one. This patch also removes makeCheckedPtr in favor of using CheckedPtr with template argument deduction in C++17. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/CheckedPtr.h: (WTF::CheckedPtr::CheckedPtr): Added variants which take CheckedRef as arguments. (WTF::makeCheckedPtr): Deleted. (WTF::CanMakeCheckedPtr): Moved to CheckedRef.h * wtf/CheckedRef.h: Added. (WTF::CheckedRef::~CheckedRef): Added. (WTF::CheckedRef::CheckedRef): Added. (WTF::CheckedRef::isHashTableDeletedValue const): Added. (WTF::CheckedRef::isHashTableEmptyValue const): Added. (WTF::CheckedRef::hashTableEmptyValue): Added. (WTF::CheckedRef::ptrAllowingHashTableEmptyValue const): Added. (WTF::CheckedRef::ptrAllowingHashTableEmptyValue): Added. (WTF::CheckedRef::ptr const): Added. (WTF::CheckedRef::ptr): Added. (WTF::CheckedRef::get const): Added. (WTF::CheckedRef::get): Added. (WTF::CheckedRef::operator-> const): Added. (WTF::CheckedRef::operator->): Added. (WTF::CheckedRef::operator const T& const): Added. (WTF::CheckedRef::operator T&): Added. (WTF::CheckedRef::operator! const): Added. (WTF::CheckedRef::operator=): Added. (WTF::CheckedRef::releasePtr): Added. Returns m_ptr without calling decrementPtrCount. This is equivalent of leakPtr in Ref but we don't call this that since CheckedRef or CheckedPtr is generally not used to manage the object lifetime. (WTF::CheckedRef::poison): Added. (WTF::CheckedRef::unpoison): Added. (WTF::is): Added. (WTF::CheckedRefHashTraits): Added. (WTF::CheckedRefHashTraits::emptyValue): Added. (WTF::CheckedRefHashTraits::constructEmptyValue): Added. (WTF::CheckedRefHashTraits::isEmptyValue): Added. (WTF::CheckedRefHashTraits::peek): Added. (WTF::CheckedRefHashTraits::take): Added. (WTF::CanMakeCheckedPtr): Moved from CheckedPtr.h * wtf/Forward.h: 2021-08-02 Devin Rousso [Live Text] SPI for machine readable codes is only available on iOS https://bugs.webkit.org/show_bug.cgi?id=228711 Reviewed by Tim Horton. * wtf/PlatformEnableCocoa.h: * wtf/PlatformHave.h: 2021-08-02 Youenn Fablet Enable WebRTCPlatformUDPSocketsEnabled experimental feature by default https://bugs.webkit.org/show_bug.cgi?id=228689 Reviewed by Eric Carlson. Enable WebRTCPlatformUDPSocketsEnabled experimental feature by default, WebRTC proxying being off by default for now. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-08-02 Yusuke Suzuki [JSC] Yarr should use Bitmap instead of ByteVector for BoyerMoore search https://bugs.webkit.org/show_bug.cgi?id=228676 Reviewed by Saam Barati. * wtf/Bitmap.h: 2021-08-01 Youenn Fablet Introduce an experimental feature to toggle WebRTC socket proxying https://bugs.webkit.org/show_bug.cgi?id=228681 Reviewed by Eric Carlson. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-07-31 Yusuke Suzuki [JSC] Move JIT_UNICODE_EXPRESSIONS to ENABLE(YARR_JIT_UNICODE_EXPRESSIONS) in PlatformEnable.h https://bugs.webkit.org/show_bug.cgi?id=228669 Reviewed by Alexey Shvayka. * wtf/PlatformEnable.h: 2021-07-30 Rob Buis [css-overflow] Implement clip value for overflow https://bugs.webkit.org/show_bug.cgi?id=198230 Reviewed by Simon Fraser. Add preference for overflow: clip support. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-07-30 Chris Dumez Add initial support for 'Cross-Origin-Opener-Policy' HTTP header https://bugs.webkit.org/show_bug.cgi?id=192193 Reviewed by Geoff Garen. Add experimental feature flag for 'Cross-Origin-Opener-Policy' HTTP header support. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-07-29 Myles C. Maxfield Stop building WebGPU and the WHLSL compiler to decrease binary size https://bugs.webkit.org/show_bug.cgi?id=228179 Reviewed by Dean Jackson, Robin Morisset, and Devin Rousso. * Scripts/Preferences/WebPreferencesExperimental.yaml: * wtf/PlatformEnable.h: * wtf/PlatformEnableCocoa.h: 2021-07-29 Devin Rousso [Payment Request] `additionalShippingMethods` are not used if a `paymentMethodType` is provided https://bugs.webkit.org/show_bug.cgi?id=228599 Reviewed by Andy Estes. 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 *`, 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. 2021-07-28 Yusuke Suzuki [JSC] Yarr should perform BoyerMoore search https://bugs.webkit.org/show_bug.cgi?id=228301 Reviewed by Saam Barati. * wtf/BitVector.cpp: (WTF::BitVector::dump const): * wtf/Bitmap.h: (WTF::WordType>::dump const): * wtf/UniqueRef.h: (WTF::makeUniqueRefFromNonNullUniquePtr): (WTF::UniqueRef::UniqueRef): 2021-07-29 Kate Cheney REGRESSION (r278877) [Cocoa] WebAuthn stopped working for non-Safari browsers https://bugs.webkit.org/show_bug.cgi?id=228116 Patch by Brent Fulgham. Reviewed by Per Arne Vollan. Add new SPI header for code signing features. * WTF.xcodeproj/project.pbxproj: * wtf/spi/cocoa/SecuritySPI.h: * wtf/spi/darwin/CodeSignSPI.h: Added. 2021-07-29 Eric Carlson [iOS] Don't set capture attribution dynamically in the simulator https://bugs.webkit.org/show_bug.cgi?id=228596 rdar://81176531 Reviewed by Jer Noble. * wtf/PlatformHave.h: Don't define HAVE_SYSTEM_STATUS for the simulator. 2021-07-29 Kate Cheney GetIdentifierStringForPreferredVoiceInListWithLocale() is deprecated in Monterey Patch by David Kilzer. Reviewed by David Kilzer. * wtf/PlatformHave.h: - Add HAVE(SPEECHSYNTHESIS_MONTEREY_SPI). 2021-07-28 Jean-Yves Avenard [WebAudio] Add webm/opus container support https://bugs.webkit.org/show_bug.cgi?id=227110 Reviewed by Jer Noble. Add WebMWebAudioEnabled preference to make canPlayType return probably for mimetype: "audio/webm; codecs=opus" Disabled by default. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-07-28 Ryosuke Niwa makeWeakPtr should support Ref and RefPtr as the argument https://bugs.webkit.org/show_bug.cgi?id=228574 Reviewed by Wenson Hsieh. This patch adds variants of makeWeakPtr which take Ref and RefPtr. Tests: TestWebKitAPI.WTF_WeakPtr.MakeWeakPtrTakesRef TestWebKitAPI.WTF_WeakPtr.MakeWeakPtrTakesRefPtr * wtf/WeakPtr.h: (WTF::makeWeakPtr): 2021-07-28 Myles C. Maxfield [Cocoa] macOS Monterey and parallel OSes no longer need r280103 https://bugs.webkit.org/show_bug.cgi?id=228539 Reviewed by Alan Bujtas. Core Text's behavior changed on these OSes. * wtf/PlatformUse.h: 2021-07-26 Yusuke Suzuki Unreviewed, speculative revert of r280193 https://bugs.webkit.org/show_bug.cgi?id=228142 * wtf/Vector.h: (WTF::Malloc>::shrinkCapacity): (WTF::Malloc>::shrinkToBestFit): Deleted. * wtf/text/AtomStringImpl.cpp: (WTF::UCharBufferTranslator::equal): (WTF::LCharBufferTranslator::equal): (WTF::BufferFromStaticDataTranslator::equal): * wtf/text/StringView.h: (WTF::StringView::stripLeadingMatchedCharacters): Deleted. 2021-07-26 Jer Noble [Cocoa] WebKit is making GroupActivities API calls for all WebKit clients https://bugs.webkit.org/show_bug.cgi?id=228299 Reviewed by Eric Carlson. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-07-26 Per Arne The layout test fast/images/heic-as-background-image.html is a constant failure https://bugs.webkit.org/show_bug.cgi?id=228195 Reviewed by Said Abou-Hallawa. Add HAVE macro for the system function CMPhotoIsTileDecoderAvailable. * wtf/PlatformHave.h: 2021-07-26 Jer Noble [iOS] All home screen web apps resume when any home screen web app is foregrounded https://bugs.webkit.org/show_bug.cgi?id=228246 Reviewed by Eric Carlson. * Scripts/Preferences/WebPreferences.yaml: 2021-07-23 Chris Dumez SharedBuffer::takeData() is a bit dangerous https://bugs.webkit.org/show_bug.cgi?id=228161 Reviewed by Darin Adler. Add Vector::uncheckedAppend() overload that takes in a Span. * wtf/Vector.h: (WTF::Vector::uncheckedAppend): (WTF::Malloc>::uncheckedAppend): 2021-07-23 Robert Jenner Unreviewed, reverting r280205. Broke multiple WebAuthn tests. Reverted changeset: "REGRESSION (r278877) [Cocoa] WebAuthn stopped working for non-Safari browsers" https://bugs.webkit.org/show_bug.cgi?id=228116 https://commits.webkit.org/r280205 2021-07-23 Philippe Normand [GLib] Remove libportal dependency https://bugs.webkit.org/show_bug.cgi?id=228056 Reviewed by Carlos Garcia Campos. * Scripts/Preferences/WebPreferencesExperimental.yaml: Enable screen capture on GStreamer ports. The PIPEWIRE ifdef is redundant. 2021-07-22 Brent Fulgham REGRESSION (r278877) [Cocoa] WebAuthn stopped working for non-Safari browsers https://bugs.webkit.org/show_bug.cgi?id=228116 Reviewed by Per Arne Vollan. Add new SPI header for code signing features. * WTF.xcodeproj/project.pbxproj: * wtf/spi/cocoa/SecuritySPI.h: Move some SecTask calls out of PLATFORM(MAC). * wtf/spi/darwin/CodeSignSPI.h: Added. 2021-07-22 Saam Barati Fix uses of Dependency::fence with respect to the compiler outsmarting us https://bugs.webkit.org/show_bug.cgi?id=227757 Reviewed by Robin Morisset. * wtf/Atomics.h: (WTF::opaque): (WTF::Dependency::loadAndFence): 2021-07-22 Yusuke Suzuki Unreviewed, follow-up after r280193 https://bugs.webkit.org/show_bug.cgi?id=228142 I accidentally reverted auto change when switching branches. * wtf/text/AtomStringImpl.cpp: (WTF::UCharBufferTranslator::equal): (WTF::LCharBufferTranslator::equal): (WTF::BufferFromStaticDataTranslator::equal): 2021-07-22 Yusuke Suzuki Micro-optimize innerHTML https://bugs.webkit.org/show_bug.cgi?id=228142 Reviewed by Simon Fraser. * wtf/Vector.h: (WTF::Malloc>::shrinkToBestFit): This shrinks the backing storage to "appropriate for the living Vector". * wtf/text/AtomStringImpl.cpp: (WTF::UCharBufferTranslator::equal): WTF::equal for String does not check hash. This is because computing hash is expensive and we would like to avoid that if it is not necessary. But when inserting string into AtomStringTable, we can use hash value since they must be already computed because of HashMap's requirement. So let's use it before calling WTF::equal. (WTF::LCharBufferTranslator::equal): (WTF::BufferFromStaticDataTranslator::equal): * wtf/text/StringView.h: (WTF::StringView::stripLeadingMatchedCharacters): Add this and use it in HTMLTreeBuilder. 2021-07-22 Alex Christensen XHR.send(Document) should replace mismatched surrogates with replacement character before sending https://bugs.webkit.org/show_bug.cgi?id=228170 Reviewed by Chris Dumez. * wtf/text/WTFString.cpp: (WTF::replaceUnpairedSurrogatesWithReplacementCharacter): * wtf/text/WTFString.h: Move from WebCore, rename as suggested, update spec link to one that works. 2021-07-22 Zan Dobersek Add CPU(RISCV64) https://bugs.webkit.org/show_bug.cgi?id=228178 Reviewed by Adrian Perez de Castro. Detect when compiling for the RISC-V 64-bit architecture and define the WTF_CPU_RISCV64 macro under that condition, enabling use of CPU(RISCV64) build guards. * wtf/PageBlock.h: Use 4 kB as the page size ceiling for CPU(RISCV64). * wtf/PlatformCPU.h: 2021-07-21 Miguel Gomez [GTK][WPE] Allow the user to configure the MemoryPressureHandler inside the web process https://bugs.webkit.org/show_bug.cgi?id=222738 Reviewed by Carlos Garcia Campos. Add a configuration structure to MemoryPressureHandler, with the methods to encode/decode it. Also add a method to set a configuration structure to a MemoryPressureHandler instance, and modify the behavior so the the configuration is used when checking the memory used by the process. * wtf/MemoryPressureHandler.cpp: (WTF::MemoryPressureHandler::setShouldUsePeriodicMemoryMonitor): (WTF::MemoryPressureHandler::thresholdForMemoryKill): (WTF::MemoryPressureHandler::thresholdForPolicy): (WTF::MemoryPressureHandler::policyForFootprint): (WTF::MemoryPressureHandler::Configuration::Configuration): * wtf/MemoryPressureHandler.h: (WTF::MemoryPressureHandler::Configuration::encode const): (WTF::MemoryPressureHandler::Configuration::decode): (WTF::MemoryPressureHandler::setConfiguration): 2021-07-21 Chris Dumez Unreviewed, reverting r280129. Broke the internal Monterey build bots Reverted changeset: "GetIdentifierStringForPreferredVoiceInListWithLocale() is deprecated in Monterey" https://bugs.webkit.org/show_bug.cgi?id=228066 https://commits.webkit.org/r280129 2021-07-21 David Kilzer GetIdentifierStringForPreferredVoiceInListWithLocale() is deprecated in Monterey Reviewed by Alexey Proskuryakov. * wtf/PlatformHave.h: - Add HAVE(SPEECHSYNTHESIS_MONTEREY_SPI). 2021-07-20 Myles C. Maxfield r280103 is not necessary on all operating systems https://bugs.webkit.org/show_bug.cgi?id=228136 Reviewed by Alan Bujtas. * wtf/PlatformUse.h: 2021-07-16 Alexander Mikhaylenko [GTK][WPE] Support color-schemes CSS property https://bugs.webkit.org/show_bug.cgi?id=208204 Reviewed by Adrian Perez de Castro. * wtf/PlatformHave.h: Enable HAVE_OS_DARK_MODE_SUPPORT for GTK and WPE. 2021-07-15 Jean-Yves Avenard [Wk1] media/media-source/media-webm-opus-partial.html is a consistent failure (Enable VP8/VP9/Vorbis/Opus in WebKitLegacy) https://bugs.webkit.org/show_bug.cgi?id=228005 rdar://80346720 Reviewed by Jer Noble. * Scripts/Preferences/WebPreferencesExperimental.yaml: Enable VP8/VP9/Vorbis/Opus codecs for WebKitLegacy, no reasons they weren't already enabled. 2021-07-15 Joonghun Park Unreviewed. Fix the build warning below since r279895. warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare] * wtf/URL.cpp: (WTF::URL::setPath): 2021-07-15 Chris Dumez Add initial support for BroadcastChannel behind a runtime flag https://bugs.webkit.org/show_bug.cgi?id=227924 Reviewed by Sam Weinig. Add experimental feature flag for BroadcastChannel, off by default. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-07-15 Philippe Normand [GStreamer][Pipewire] Implement getDisplayMedia() backend https://bugs.webkit.org/show_bug.cgi?id=210926 Reviewed by Xabier Rodriguez-Calvar. * Scripts/Preferences/WebPreferencesExperimental.yaml: Enable screen-capture if libportal was found. 2021-07-14 Jer Noble Unreviewed build fix after r279912 (239661@main); Add a HAVE(SYSTEM_STATUS) macro. * wtf/PlatformHave.h: 2021-07-13 Alex Christensen Update and fix URL WPT tests https://bugs.webkit.org/show_bug.cgi?id=227820 Reviewed by Chris Dumez. There was an edge case where if we set a path to an empty string, it would add a slash. No more. * wtf/URL.cpp: (WTF::URL::setPath): 2021-07-13 Michael Catanzaro Remove USE_64KB_PAGE_BLOCK https://bugs.webkit.org/show_bug.cgi?id=227905 Reviewed by Yusuke Suzuki. * wtf/PageBlock.h: 2021-07-12 Filip Pizlo and Yusuke Suzuki New malloc algorithm https://bugs.webkit.org/show_bug.cgi?id=226404 Reviewed by Yusuke Suzuki. Introduce flags for using libpas as the ExecutableAllocator. Explicitly ask for gigacage initialization, since libpas prefers it this way right now. * wtf/FastTLS.h: * wtf/PlatformUse.h: * wtf/Threading.cpp: (WTF::initialize): 2021-07-12 Wenson Hsieh [Cocoa] Turn on `USE(OS_STATE)` when building with a non-Apple-internal SDK https://bugs.webkit.org/show_bug.cgi?id=227884 Reviewed by Tim Horton. Enable the compile-time flag for all Cocoa builds. * wtf/PlatformUse.h: 2021-07-12 Chris Fleizach AX: Make WebKit observe spatial audio accessibility settings https://bugs.webkit.org/show_bug.cgi?id=227848 Reviewed by Sam Weinig. This flag was using the wrong format for a HAVE setting, so the code wasn't being compiled in. * wtf/PlatformHave.h: 2021-07-12 Simon Fraser Add a StyleSheets log channel and some logging https://bugs.webkit.org/show_bug.cgi?id=227880 Reviewed by Alan Bujtas. Make it possible to feed Ref<> and RefPtr<> into TextStream. * wtf/text/TextStream.h: (WTF::operator<<): 2021-07-09 Jer Noble [Cocoa] Make Coordinator playback commands more precise https://bugs.webkit.org/show_bug.cgi?id=227756 Reviewed by Eric Carlson. 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: 2021-07-08 Alex Christensen Fix some whitespace handling issues in URL setters https://bugs.webkit.org/show_bug.cgi?id=227806 Reviewed by Chris Dumez. Setters should ignore tabs and newlines like the main parser does. The protocol setter is problematic, which I reported in https://github.com/whatwg/url/issues/620 * wtf/URL.cpp: (WTF::URL::setFragmentIdentifier): * wtf/URLParser.cpp: (WTF::URLParser::isSpecialScheme): (WTF::URLParser::parse): * wtf/URLParser.h: The URL.hash setter should allow trailing C0 and control characters, which we would otherwise trim. Rather than introduce a new parameter, use a sentinel value for when we need to do this. 2021-07-08 Brent Fulgham [Cocoa] Expose SPI to opt out of Extensible SSO authentication https://bugs.webkit.org/show_bug.cgi?id=227729 Reviewed by Tim Horton. Create new WKPreference to allow WebKit clients to opt out of Extensible SSO authentication. * Scripts/Preferences/WebPreferences.yaml: 2021-07-07 Alex Christensen URL host setter should pass host to URLParser instead of trying to encode it itself https://bugs.webkit.org/show_bug.cgi?id=227749 Reviewed by Chris Dumez. For non-special schemes, the host is percent-encoded instead of punycode-encoded. Allowing the URL parser to handle all input directly does the right thing for non-special schemes. * wtf/URL.cpp: (WTF::URL::setHost): (WTF::URL::setHostAndPort): 2021-07-07 Alex Christensen URL path setter should add "./" before non-empty path and after empty host for URLs with non-special schemes https://bugs.webkit.org/show_bug.cgi?id=227750 Reviewed by Chris Dumez. This is related to r267837 but in the path setter, too. This helps preserve idempotence in parsed URLs. This is an edge case that will rarely be hit in practice, but now the path setter matches the parser. * wtf/URL.cpp: (WTF::URL::setPath): 2021-07-07 Christopher Reid [PlayStation] Don't assume 4KB block size when estimating Network Cache disk usage https://bugs.webkit.org/show_bug.cgi?id=227502 Reviewed by Chris Dumez. Add getVolumeFileBlockSize to fetch the block size from the filesystem. Currently only implemented for Windows and POSIX filesystems. * wtf/FileSystem.cpp: * wtf/FileSystem.h: * wtf/playstation/FileSystemPlayStation.cpp: 2021-07-07 Alex Christensen Use more Span https://bugs.webkit.org/show_bug.cgi?id=227606 Reviewed by Darin Adler. New is always better, right? * wtf/FileSystem.cpp: (WTF::FileSystemImpl::mapToFile): * wtf/FileSystem.h: * wtf/persistence/PersistentCoders.cpp: (WTF::Persistence::Coder::encode): (WTF::Persistence::Coder::decode): (WTF::Persistence::Coder::encode): (WTF::Persistence::decodeStringText): (WTF::Persistence::Coder::encode): (WTF::Persistence::Coder::decode): * wtf/persistence/PersistentCoders.h: * wtf/persistence/PersistentDecoder.cpp: (WTF::Persistence::Decoder::Decoder): (WTF::Persistence::Decoder::bufferIsLargeEnoughToContain const): (WTF::Persistence::Decoder::bufferPointerForDirectRead): (WTF::Persistence::Decoder::decodeFixedLengthData): (WTF::Persistence::Decoder::decodeNumber): (WTF::Persistence::Decoder::verifyChecksum): * wtf/persistence/PersistentDecoder.h: (WTF::Persistence::Decoder::length const): (WTF::Persistence::Decoder::currentOffset const): * wtf/persistence/PersistentEncoder.cpp: (WTF::Persistence::Encoder::updateChecksumForData): (WTF::Persistence::Encoder::encodeFixedLengthData): (WTF::Persistence::Encoder::encodeChecksum): * wtf/persistence/PersistentEncoder.h: 2021-07-05 Yusuke Suzuki [JSC] Optimize Object.assign and putDirectInternal https://bugs.webkit.org/show_bug.cgi?id=227677 Reviewed by Filip Pizlo. * wtf/HashMap.h: * wtf/HashSet.h: * wtf/HashTable.h: (WTF::HashTable::isNullStorage const): 2021-07-02 Brent Fulgham [macOS] Only use WebGL on Metal by default on safe versions of macOS https://bugs.webkit.org/show_bug.cgi?id=227633 Reviewed by Dean Jackson. Tested by WebGL test suite. * Scripts/Preferences/WebPreferencesExperimental.yaml: * wtf/PlatformHave.h: 2021-07-01 Youenn Fablet Disable relay for UDP sockets when not needed https://bugs.webkit.org/show_bug.cgi?id=227253 Reviewed by Eric Carlson. * wtf/PlatformHave.h: Add a macro for new NW methods. 2021-07-01 Antoine Quint [Model] Restrict IPC calls to ARKit SPI availability and runtime flag https://bugs.webkit.org/show_bug.cgi?id=227581 Reviewed by Tim Horton. Define a new compile-time flag when either of the iOS or macOS ARKit SPIs are available. * wtf/PlatformHave.h: 2021-07-01 Aditya Keerthi [iOS] in watchOS 8 https://bugs.webkit.org/show_bug.cgi?id=226955 Reviewed by Darin Adler. Add compile-time flags to guard the presence of `PUICQuickboardController` and `PUICButtonTypePill`. * wtf/PlatformHave.h: 2021-06-11 Ryosuke Niwa Add WeakHashMap https://bugs.webkit.org/show_bug.cgi?id=226872 Reviewed by Geoffrey Garen. Added WeakHashMap which deletes entries during rehashing and amortized over time (based on the number of read & write accesses done on a given WeakHashMap instance). * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/WeakHashMap.h: Added. (WTF::WeakHashMap): Added. (WTF::WeakHashMap::PeekKeyValuePairTraits): Added. (WTF::WeakHashMap::PeekType): Added. (WTF::WeakHashMap::PeekPtrType): Added. Unlike a regular HashMap, we need to fake the iterator pointer value with this struct since key-value pair doesn't exist in HashTable itself as it stores Ref instead. (WTF::WeakHashMap::WeakHashMapIteratorBase): Added. Has a bunch of helper functions so that WeakHashMapIterator and WeakHashMapConstIterator can share the code. (WTF::WeakHashMap::WeakHashMapIterator): Added. (WTF::WeakHashMap::WeakHashMapConstIterator): Added. (WTF::WeakHashMap::AddResult): Added. (WTF::WeakHashMap::begin): Added. (WTF::WeakHashMap::end): Added. (WTF::WeakHashMap::add): Added. (WTF::WeakHashMap::set): Added. (WTF::WeakHashMap::find): Added. (WTF::WeakHashMap::contains): Added. (WTF::WeakHashMap::get): Added. (WTF::WeakHashMap::remove): Added. (WTF::WeakHashMap::removeIf): Added. (WTF::WeakHashMap::clear): Added. (WTF::WeakHashMap::capacity): Added. (WTF::WeakHashMap::isEmptyIgnoringNullReferences): Added. This is akin to WeakHashSet::computesEmpty. Per prior discussion, we intend to rename WeakHashSet's version to this name as well for clarity. Note that this function will clear the hash table completely if the map is semantically empty but HashTable contains null references as keys. (WTF::WeakHashMap::hasNullReferences): Added. Triggers amortized cleanup based on the number of iterations performed. If there are no null references, it resets m_operationCountSinceLastCleanup. (WTF::WeakHashMap::computeSize): Added. (WTF::WeakHashMap::removeNullReferences): Added. Since WeakHashMap doesn't eagerly delete the value when the key goes away, this function should be called when values held onto by WeakRefImpl with the nullptr back pointer should be deleted en masse. (WTF::WeakHashMap::checkConsistency): Added. (WTF::WeakHashMap::makeKeyImpl): Added. (WTF::WeakHashMap::keyImplIfExists): Added. * wtf/WeakPtr.h: 2021-06-11 Jonathan Bedard [Monterey] Support building WebKit https://bugs.webkit.org/show_bug.cgi?id=226846 Reviewed by Tim Horton. * wtf/PlatformHave.h: Add HAVE(VK_IMAGE_ANALYSIS). * wtf/spi/cocoa/SecuritySPI.h: 2021-06-09 Chris Dumez Avoid some calls to StringView::toString() / StringView::toStringWithoutCopying() https://bugs.webkit.org/show_bug.cgi?id=226803 Reviewed by Darin Adler. Add support to TextStream for printing a StringView directly, without having to convert it to a String first. * wtf/text/TextStream.cpp: (WTF::TextStream::operator<<): * wtf/text/TextStream.h: 2021-06-09 Alicia Boya García [WTF][GStreamer] Add RAII lockers for 3rd party locks https://bugs.webkit.org/show_bug.cgi?id=225650 Reviewed by Xabier Rodriguez-Calvar. This patch introduces WTF::ExternalLocker, which allows to lock 3rd party mutexes in a RAII fashion, very similar to WTF::Locker. This is used also in WebCore to provide RAII lockers for GStreamer. * wtf/Locker.h: (WTF::unlockFunction): 2021-06-08 Alex Christensen Move PrivacyStance code from WebKitAdditions https://bugs.webkit.org/show_bug.cgi?id=226774 Reviewed by Jer Noble. * wtf/PlatformHave.h: 2021-06-08 Ben Nham Use access instead of stat in some filesystem functions https://bugs.webkit.org/show_bug.cgi?id=226667 Reviewed by Chris Dumez. We are spending a bit more time in WTF::FileSystemImpl functions after the move to std::filesystem (https://bugs.webkit.org/show_bug.cgi?id=225255). In particular, several std::filesystem functions (like the ones called by fileExists and makeAllDirectories) prefer to use stat() over access() for file existence checks. Since our sandbox has a fast path for access(path, F_OK) but not for stat, we ended up spending more time in sandbox evaluation in the kernel after the move to std::filesystem. Note that the two checks don't do exactly the same thing. access(path, F_OK) only checks for path existence, while stat(path) additionally fetches metadata, which requires checking the file-read-metadata permission. But in practice our code was written to be fine with just checking for existence. To work around this, I've re-introduced some of the old WTF::FileSystemImpl functions from FileSystemPosix.cpp. They are the ones that are called by NetworkCache, which seems to be the biggest consumer of these functions. The rest of the functions are still implemented using std::filesystem. * wtf/FileSystem.cpp: (WTF::FileSystemImpl::fileExists): (WTF::FileSystemImpl::deleteFile): (WTF::FileSystemImpl::makeAllDirectories): (WTF::FileSystemImpl::pathByAppendingComponent): (WTF::FileSystemImpl::pathByAppendingComponents): * wtf/PlatformEnableCocoa.h: * wtf/posix/FileSystemPOSIX.cpp: (WTF::FileSystemImpl::fileExists): (WTF::FileSystemImpl::deleteFile): (WTF::FileSystemImpl::makeAllDirectories): (WTF::FileSystemImpl::pathByAppendingComponent): (WTF::FileSystemImpl::pathByAppendingComponents): 2021-06-08 Devin Rousso [Payment Request] upstream new features https://bugs.webkit.org/show_bug.cgi?id=226740 Reviewed by Andy Estes. - 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: 2021-06-08 Chris Dumez Reduce use of reinterpret_cast<> in the codebase https://bugs.webkit.org/show_bug.cgi?id=226743 Reviewed by Darin Adler. * wtf/CryptographicallyRandomNumber.cpp: * wtf/FastMalloc.h: (WTF::FastAllocator::allocate): * wtf/SHA1.h: (WTF::SHA1::addBytes): * wtf/StackCheck.h: (WTF::StackCheck::Scope::Scope): (WTF::StackCheck::StackCheck): * wtf/URLHelpers.cpp: (WTF::URLHelpers::userVisibleURL): * wtf/URLParser.cpp: (WTF::URLParser::formURLDecode): * wtf/cf/URLCF.cpp: (WTF::URL::createCFURL const): * wtf/cocoa/URLCocoa.mm: (WTF::URL::createCFURL const): * wtf/persistence/PersistentCoders.cpp: (WTF::Persistence::Coder::encode): (WTF::Persistence::Coder::encode): * wtf/text/CString.h: * wtf/text/WTFString.cpp: (WTF::String::latin1 const): * wtf/text/cf/StringImplCF.cpp: (WTF::StringImpl::createCFString): 2021-06-08 Devin Rousso [Modern Media Controls] upstream new features https://bugs.webkit.org/show_bug.cgi?id=226736 Reviewed by Eric Carlson. - bring the "Audio"/"Languages" tracks menu to iOS - add a new "Playback Speed" menu on iOS and macOS in the overflow menu - add support for showing the most relevant `` in the overflow menu * wtf/PlatformEnableCocoa.h: 2021-06-08 Sam Weinig Add copy of std::span so that we can use it pre-moving to c++20 https://bugs.webkit.org/show_bug.cgi?id=226351 Reviewed by Alex Christensen. Imports a copy of Tristan Brindle's Boost licensed implementation of std::span from 5d8d366eca918d0ed3d2d196cbeae6abfd874736 of https://github.com/tcbrindle/span. It has been further modified to rename tcb::span to WTF::Span. * LICENSE_1_0-Boost.txt: Added. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/Span.h: Added. 2021-06-07 Alex Christensen Adopt SecTrustGetCertificateAtIndex replacement where available https://bugs.webkit.org/show_bug.cgi?id=225893 Reviewed by Chris Dumez. rdar://74752046 introduced a new way to access the same thing. * wtf/PlatformHave.h: 2021-06-07 Chris Dumez Drop legacy MainThreadTaskQueue & EventLoopTaskQueue classes https://bugs.webkit.org/show_bug.cgi?id=226734 Reviewed by Ryosuke Niwa. We recently introduced the WTF::CancellableTask in order to be able to cancel a pending task in the event loop, and/or check if the task is still pending. It worked great as a replacement for EventLoopDeferrableTask. However, it was insufficient as a replacement for task queues (such as MainThreadTaskQueue & EventLoopTaskQueue) since there was no convenient way to cancel a group of tasks. To address this, I am introducing WTF::TaskCancellationGroup. Whenever one needs to create a CancellableTask, it now needs to provide a TaskCancellationGroup. Several CancellableTask objects can share the same TaskCancellationGroup. Code now now schedule one or more CancellableTasks on the event loop and hold on to a TaskCancellationGroup. If they need to cancel those tasks, they can simply call cancel() on the TaskCancellationGroup. They can also check if previously scheduled tasks are still pending via TaskCancellationGroup::hasPendingTask(). * wtf/CancellableTask.h: (WTF::TaskCancellationGroup::TaskCancellationGroup): (WTF::TaskCancellationGroup::cancel): (WTF::TaskCancellationGroup::hasPendingTask const): (WTF::TaskCancellationGroup::Impl::cancel): (WTF::TaskCancellationGroup::Impl::hasPendingTask const): (WTF::TaskCancellationGroup::Handle::isCancelled const): (WTF::TaskCancellationGroup::Handle::Handle): (WTF::TaskCancellationGroup::createHandle): (WTF::CancellableTask::CancellableTask): (WTF::CancellableTask::operator()): * wtf/WeakPtr.h: (WTF::WeakPtrFactory::weakPtrCount const): 2021-06-07 Wenson Hsieh Upstream WebKit support for Live Text https://bugs.webkit.org/show_bug.cgi?id=226706 Reviewed by Tim Horton. * wtf/PlatformEnableCocoa.h: Move the feature flag out of WebKitAdditions and into OpenSource as IMAGE_ANALYSIS. 2021-06-07 Alicia Boya García [WTF][GStreamer] Fix clang TSA warnings in WTF::DataMutex https://bugs.webkit.org/show_bug.cgi?id=226719 Reviewed by Xabier Rodriguez-Calvar. Fix the remaning clang thread safety warnings in WTF::DataMutex. The goal of this patch is to reduce the number of warnings in the GStreamer codebase. Whether DataMutex should be deprecated in favor of Locker with the clang TSA annotations is outside of the scope of this patch. * wtf/DataMutex.h: 2021-06-07 Alicia Boya García [GStreamer] Remove spurious assert in WTF::DataMutex https://bugs.webkit.org/show_bug.cgi?id=226714 Reviewed by Michael Catanzaro. Remove DATA_MUTEX_CHECK(!mutex().isHeld()); from the DataMutexLocker constructor, introduced in r278248. Trying to lock a currently held mutex is not an error condition that should crash the process, it will just wait for its turn to lock it. * wtf/DataMutex.h: 2021-06-06 Chris Dumez Stop using legacy EventLoopDeferrableTask https://bugs.webkit.org/show_bug.cgi?id=226700 Reviewed by Darin Adler. Introduce new WTF::CancellableTask type which is a wrapper around a WTF::Function. It can create a handle for the task and this handle can be used to check if the task is still pending and to cancel it. This is useful when scheduling tasks in the event loop for example as there are cases where we need to know if a task we scheduled is still pending (to avoid double scheduling) or where we need to cancel a previously scheduled task. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/CancellableTask.h: Added. (WTF::CancellableTask::CancellableTask): (WTF::CancellableTask::operator()): (WTF::CancellableTask::isPending const): (WTF::CancellableTask::cancel): (WTF::CancellableTask::Handle::Handle): (WTF::CancellableTask::Handle::isPending const): (WTF::CancellableTask::Handle::cancel): (WTF::CancellableTask::createHandle): 2021-06-04 Chris Dumez FileSystem::readFromFile() should return data as `void*` https://bugs.webkit.org/show_bug.cgi?id=226671 Reviewed by Darin Adler. FileSystem::readFromFile() should return data as `void*` instead of `char*`. This is more flexible and consistent with FileSystem::writeToFile(). * wtf/FileSystem.cpp: (WTF::FileSystemImpl::appendFileContentsToFileHandle): (WTF::FileSystemImpl::readOrMakeSalt): * wtf/FileSystem.h: * wtf/glib/FileSystemGlib.cpp: (WTF::FileSystemImpl::readFromFile): * wtf/posix/FileSystemPOSIX.cpp: (WTF::FileSystemImpl::readFromFile): * wtf/win/FileSystemWin.cpp: (WTF::FileSystemImpl::readFromFile): 2021-06-04 Alex Christensen Implement off-by-default experimental feature for PerformanceResourceTiming.transferSize, encodedBodySize, and decodedBodySize https://bugs.webkit.org/show_bug.cgi?id=226629 Reviewed by Brady Eidson. * Scripts/Preferences/WebPreferencesExperimental.yaml: 2021-06-04 Devin Rousso Add a way to prefix output of `WTFReportBacktrace` to make log filtering easier https://bugs.webkit.org/show_bug.cgi?id=226390 Reviewed by Megan Gardner. Often times while debugging I add `WTFLogAlways(" ...")` to various places as indicators that "logic has reached here". This is especially useful when debugging iOS as unlike macOS there's no console output from `run-safari`, meaning that I have to use system logging, which is often a deluge of unrelated information. Having "" as a prefix makes filtering through the system logging trivial as I can ignore logs that don't have it. Unfortunately, `WTFReportBacktrace` does not have a way to add this prefix, so it becomes much harder to find in the logs. This patch enables adding a prefix to each line of `WTFReportBacktrace` via a new function `WTFReportBactraceWithPrefix`. * wtf/Assertions.h: * wtf/Assertions.cpp: (WTFReportBacktraceWithPrefix): Added. (WTFPrintBacktraceWithPrefix): Added. * wtf/StackTrace.h: (WTF::StackTrace::StackTrace): * wtf/StackTrace.cpp: (WTF::StackTrace::dump const): 2021-06-04 Michael Catanzaro Fix more GCC warnings https://bugs.webkit.org/show_bug.cgi?id=226193 Reviewed by Adrian Perez de Castro. Add missing static_cast required to suppress GCC's -Wclass-memaccess warning when intentionally not running constructors/destructors. There's already a static_assert to ensure this is safe, which is better than usual for us. * wtf/SmallSet.h: 2021-06-03 Chris Dumez Unreviewed build fix after r277881. Fix warning about unused function. * wtf/cocoa/FileSystemCocoa.mm: 2021-06-03 Michael Catanzaro REGRESSION(r277744): Broke build on s390x mainframes https://bugs.webkit.org/show_bug.cgi?id=226497 Reviewed by Darin Adler. The problem is we have a template defined in a C++ source file, used by multiple source files. This is not valid C++, so let's split the templates defined in StringBuilder.cpp out into a new StringBuilderInternals.h that we can #include in both StringBuilder.cpp and StringBuilderJSON.cpp. Ideally we would move the template defined in StringBuilderJSON.cpp as well, and then eliminate StringBuilderJSON.cpp since there would only be one function left. But that file has an MPL license. It's easier to leave it be to keep the license situation simpler. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/text/StringBuilder.cpp: (WTF::StringBuilder::expandedCapacity): (WTF::expandedCapacity): Deleted. (WTF::StringBuilder::allocateBuffer): Deleted. (WTF::StringBuilder::extendBufferForAppending): Deleted. (WTF::StringBuilder::extendBufferForAppendingSlowCase): Deleted. * wtf/text/StringBuilder.h: * wtf/text/StringBuilderInternals.h: Added. (WTF::StringBuilder::allocateBuffer): (WTF::StringBuilder::reallocateBuffer): (WTF::StringBuilder::extendBufferForAppending): (WTF::StringBuilder::extendBufferForAppendingSlowCase): * wtf/text/StringBuilderJSON.cpp: 2021-06-02 Chris Dumez Drop WTF::Vector overloads taking index as Checked https://bugs.webkit.org/show_bug.cgi?id=226553 Reviewed by Geoffrey Garen. Drop WTF::Vector overloads taking index as Checked. They are no longer needed now that Checked can implicitly get converted to size_t (r278338). * wtf/Vector.h: (WTF::Vector::at const): (WTF::Vector::operator[] const): 2021-06-02 Chris Dumez Drop Checked::safeGet() https://bugs.webkit.org/show_bug.cgi?id=226537 Reviewed by Geoffrey Garen. Drop Checked::safeGet() and replace with uses of Checked::operator T() or Checked::value(). safeGet() is a bit akward, having both a return value and an out-parameter. * wtf/CheckedArithmetic.h: (WTF::Checked::value const): (WTF::operator+): (WTF::operator-): (WTF::operator*): (WTF::operator/): 2021-06-02 Antti Koivisto Style::Scope should use CheckedPtr https://bugs.webkit.org/show_bug.cgi?id=226530 Reviewed by Sam Weinig. * wtf/CMakeLists.txt: 2021-06-02 Chris Dumez Use Checked aliases instead of Checked https://bugs.webkit.org/show_bug.cgi?id=226535 Reviewed by Keith Miller. * wtf/URLHelpers.cpp: (WTF::URLHelpers::userVisibleURL): * wtf/URLParser.cpp: (WTF::URLParser::parseIPv4Piece): * wtf/cocoa/NSURLExtras.mm: (WTF::dataWithUserTypedString): * wtf/glib/SocketConnection.cpp: (WTF::SocketConnection::sendMessage): 2021-05-23 Ryosuke Niwa Add CheckedPtr https://bugs.webkit.org/show_bug.cgi?id=226158 Reviewed by Antti Koivisto. This patch introduces a new type of smart pointer, CheckedPtr, which behaves like RefPtr and let each object keep track of pointers pointing to the object. Unlike CheckedPtr, the purpose of this internal counter is to release assert that there is no outstanding pointer at the time of destruction instead of keeping the object alive when there is one. * WTF.xcodeproj/project.pbxproj: * wtf/CheckedPtr.h: Added. (WTF::CheckedPtr): Added. (WTF::CheckedPtr::CheckedPtr): Added. (WTF::CheckedPtr::~CheckedPtr): Added. (WTF::CheckedPtr::isHashTableDeletedValue const): Added. (WTF::CheckedPtr::operator UnspecifiedBoolType const): Added. (WTF::CheckedPtr::operator! const): Added. (WTF::CheckedPtr::get const): Added. (WTF::CheckedPtr::get): Added. (WTF::CheckedPtr::operator* const): Added. (WTF::CheckedPtr::operator*): Added. (WTF::CheckedPtr::operator-> const): Added. (WTF::CheckedPtr::operator->): Added. (WTF::CheckedPtr::operator== const): Added. (WTF::CheckedPtr::operator=): Added. (WTF::CheckedPtr::unspecifiedBoolTypeInstance const): Added. (WTF::CheckedPtr::refIfNotNull): Added. (WTF::CheckedPtr::derefIfNotNull): Added. (WTF::makeCheckedPtr): Added. (WTF::is): Added. (WTF::CanMakeCheckedPtr): Added. (WTF::CanMakeCheckedPtr::~CanMakeCheckedPtr): Added. Release assert that m_ptrCount is 0. (WTF::CanMakeCheckedPtr::ptrCount const): Added. (WTF::CanMakeCheckedPtr::incrementPtrCount): Added. (WTF::CanMakeCheckedPtr::decrementPtrCount): Added. Note that we don't do anything when m_ptrCount becomes 0 unlike RefPtr. (WTF::HashTraits>): Added. (WTF::HashTraits>::emptyValue): Added. (WTF::HashTraits>::peek): Added. (WTF::HashTraits>::customDeleteBucket): Added. 2021-06-01 Darin Adler Remove https://bugs.webkit.org/show_bug.cgi?id=226437 Reviewed by Chris Dumez. * : Removed include of . * WTF.xcodeproj/project.pbxproj: Removed Optional.h. * wtf/Markable.h: Added include of . * wtf/OptionSet.h: Ditto. * wtf/Optional.h: Emptied this file. On the Windows build system, we can't seem to build successfully without an empty file here. The copied forwarding header seems to linger even if we remove the original. Until we fix the Windows build system, if we want to support incremental builds, we need to keep this empty file around. * wtf/PrintStream.h: Added include of . * wtf/Seconds.h: Ditto. * wtf/StackTrace.h: Ditto. * wtf/StdLibExtras.h: Moved the valueOrCompute function here from Optional.h. Re-sorted the "using" at the bottom of the file. * wtf/URLHelpers.h: Added include of . * wtf/Vector.h: Ditto. 2021-06-01 Chris Dumez Rename Checked::unsafeGet() to Checked::value() https://bugs.webkit.org/show_bug.cgi?id=226514 Reviewed by Darin Adler. Rename Checked::unsafeGet() to Checked::value(). The "unsafeGet" naming is confusing as this function isn't really unsafe since it will crash if the value has overflowed. Also add an `operator T()` to implicitly convert a Checked to its underlying type without needing to call value(). * wtf/CheckedArithmetic.h: (WTF::Checked::operator! const): (WTF::Checked::operator bool const): (WTF::Checked::operator T const): (WTF::Checked::value const): (WTF::Checked::operator==): (WTF::Checked::operator< const): (WTF::Checked::operator<= const): (WTF::Checked::operator> const): (WTF::Checked::operator>= const): * wtf/ConcurrentBuffer.h: * wtf/FastMalloc.cpp: (WTF::fastCalloc): (WTF::tryFastCalloc): * wtf/Gigacage.cpp: (Gigacage::tryMallocArray): * wtf/URLHelpers.cpp: (WTF::URLHelpers::userVisibleURL): * wtf/URLParser.cpp: (WTF::URLParser::parseIPv4Piece): * wtf/UniqueArray.h: * wtf/cocoa/NSURLExtras.mm: (WTF::dataWithUserTypedString): * wtf/glib/SocketConnection.cpp: (WTF::SocketConnection::readMessage): (WTF::SocketConnection::sendMessage): * wtf/text/CString.cpp: (WTF::CStringBuffer::createUninitialized): * wtf/text/StringBuffer.h: (WTF::StringBuffer::StringBuffer): * wtf/text/StringBuilderJSON.cpp: (WTF::StringBuilder::appendQuotedJSONString): * wtf/text/StringConcatenate.h: (WTF::tryMakeStringFromAdapters): * wtf/text/StringImpl.h: (WTF::StringImpl::allocationSize): * wtf/text/StringToIntegerConversion.h: (WTF::parseInteger): 2021-06-01 Chris Dumez Unreviewed build fix after r277881. Silence unused parameter warnings. * wtf/cocoa/FileSystemCocoa.mm: (WTF::FileSystemImpl::setAllowsMaterializingDatalessFiles): (WTF::FileSystemImpl::allowsMaterializingDatalessFiles): Deleted. (WTF::FileSystemImpl::isSafeToUseMemoryMapForPath): Deleted. (WTF::FileSystemImpl::makeSafeToUseMemoryMapForPath): Deleted. 2021-06-01 Adrian Perez de Castro [WPE][GTK] Support building against uClibc https://bugs.webkit.org/show_bug.cgi?id=226244 Reviewed by Michael Catanzaro. * wtf/PlatformRegisters.h: Use the header instead of , which is enough to gain access to the type definitions for CPU registers and is available on every libc. On the other hand, uClibc does not have , so this fixes the build in that case. 2021-05-30 Chris Dumez Drop UncheckedCondition / UncheckedLock https://bugs.webkit.org/show_bug.cgi?id=226432 Reviewed by Darin Adler. Drop UncheckedCondition / UncheckedLock now that the whole codebase has been ported to Condition / Lock, which support Clang thread safety analysis. * wtf/Condition.h: * wtf/Forward.h: * wtf/Lock.cpp: (WTF::Lock::lockSlow): (WTF::Lock::unlockSlow): (WTF::Lock::unlockFairlySlow): (WTF::Lock::safepointSlow): * wtf/Lock.h: (WTF::assertIsHeld): (WTF::WTF_ASSERTS_ACQUIRED_LOCK): 2021-05-30 Darin Adler Remove WTF::Optional synonym for std::optional, using that class template directly instead https://bugs.webkit.org/show_bug.cgi?id=226433 Reviewed by Chris Dumez. * : Let the do-webcore-rename script rename Optional<> to std::optional<>. * wtf/Optional.h: Remove WTF::Optional. 2021-05-29 Chris Dumez Stop using UncheckedLock in JSC::VMInspector https://bugs.webkit.org/show_bug.cgi?id=226427 Reviewed by Mark Lam. Add Lock::tryLockWithTimeout(), similar to tryLock() but gives up after a specified timeout. This used to be implemented in VMInspector but I think Lock is a better place for it. * wtf/Lock.cpp: (WTF::Lock::tryLockWithTimeout): * wtf/Lock.h: 2021-05-29 Chris Dumez Adopt clang thread safety annotations in WTF::DataMutex https://bugs.webkit.org/show_bug.cgi?id=226431 Reviewed by Darin Adler. Adopt clang thread safety annotations in WTF::DataMutex. This allows us to stop using UncheckedCondition in a few places. * wtf/DataMutex.h: (WTF::DataMutex::DataMutex): 2021-05-28 Darin Adler Clients of optional should use has_value instead of relying on hasValue macro https://bugs.webkit.org/show_bug.cgi?id=226395 Reviewed by Chris Dumez. * wtf/Hasher.h: Use has_value. * wtf/Optional.h: Remove hasValue macro. Not needed any more, but also a bit dangerous because of how widespread the use of hasValue is for things other than WTF::Optional. 2021-05-28 Alex Christensen Punycode encode U+0BE6 when not in context of other Tamil characters https://bugs.webkit.org/show_bug.cgi?id=226409 Reviewed by Tim Horton. It has quite legitimate use, so we don't want to always punycode encode it, but when used in the context of non-Tamil characters we want to punycode encode it. * wtf/URLHelpers.cpp: (WTF::URLHelpers::isLookalikeCharacterOfScriptType): (WTF::URLHelpers::isLookalikeCharacterOfScriptType): (WTF::URLHelpers::isOfScriptType): (WTF::URLHelpers::isLookalikeSequence): (WTF::URLHelpers::isLookalikeCharacter): (WTF::URLHelpers::isArmenianLookalikeCharacter): Deleted. (WTF::URLHelpers::isArmenianScriptCharacter): Deleted. (WTF::URLHelpers::isArmenianLookalikeSequence): Deleted. 2021-05-28 Chris Dumez Stop using UncheckedLock in WTF::MetaAllocator https://bugs.webkit.org/show_bug.cgi?id=226396 Reviewed by Darin Adler. Stop using UncheckedLock in WTF::MetaAllocator, as it is being phased out in favor on Lock, which supports Clang thread safety analysis. * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::release): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): * wtf/MetaAllocator.h: 2021-05-28 Robin Morisset Fix LikelyDenseUnsignedIntegerSet::clear() https://bugs.webkit.org/show_bug.cgi?id=226388 Reviewed by Mark Lam. There are two problems with it: 1) It calls BitVector::clearAll(), which does not free any memory. Instead, it should call BitVector::~BitVector(), then do a placement new of a fresh BitVector (to get it back to its inline condition) 2) More problematically, it changes m_size before calling isBitVector() which relies crucially on the value of m_size. So it is going to believe that it is in BitVector mode even when it is actually in HashSet mode. * wtf/LikelyDenseUnsignedIntegerSet.h: (WTF::LikelyDenseUnsignedIntegerSet::clear): 2021-05-28 Sam Weinig Add stub implementation of CA separated portal bits for GraphicsLayer https://bugs.webkit.org/show_bug.cgi?id=226343 Reviewed by Simon Fraser. * wtf/PlatformHave.h: Add HAVE_CORE_ANIMATION_SEPARATED_PORTALS. 2021-05-28 Chris Dumez Unreviewed build fix after r277881. Deal with IOPOL_TYPE_VFS_MATERIALIZE_DATALESS_FILES potentially not being defined on older OSes. * wtf/cocoa/FileSystemCocoa.mm: (WTF::FileSystemImpl::setAllowsMaterializingDatalessFiles): (WTF::FileSystemImpl::allowsMaterializingDatalessFiles): 2021-05-28 Chris Dumez Unreviewed build fix after r277881. Add missing header include. * wtf/cocoa/FileSystemCocoa.mm: 2021-05-27 Said Abou-Hallawa Values of keySplines control points must all be in the range 0 to 1 https://bugs.webkit.org/show_bug.cgi?id=226336 Reviewed by Sam Weinig. * wtf/MathExtras.h: (isInRange): There are a least couple of implementations of this function in WebCore. The next step is to remove the redundant code in WebCore and use this one. 2021-05-27 Robin Morisset AirAllocateStackByGraphColoring should use the optimized interference graphs from AirAllocateRegistersByGraphColoring https://bugs.webkit.org/show_bug.cgi?id=226258 Reviewed by Phil Pizlo. I moved the interference graphs datastructures from AirAllocateRegistersByGraphColoring to their own wtf/InterferenceGraph.h file. There are three of them: - SmallInterferenceGraph, best for n < 400 - LargeInterferenceGraph, for n < 2**16 - HugeInterferenceGraph, for n up to 2**32 I also added "Iterable" versions of them, that have an operator[] method whose result you can iterate on to get all the indices which interfere with a given index. SmallIterableInterferenceGraph is the same as the non-iterable version, but the Large and Huge versions are a bit slower than their counterparts and use 2x memory. All of these were tested by running JetStream2 with the TEST_OPTIMIZED_INTERFERENCE_GRAPH set to 1. This flag makes the optimized datastructures run in parallel with a reference implementation, and their results are checked for equality on every method call. There is one small difference allowed: iteration is not guaranteed to go through elements in the same order. I also added a clear() method to LikelyDenseUnsignedIntegerSet, and added the NotNull flag to its various uses of placement new. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/HashSet.h: (WTF::W>::memoryUse const): * wtf/InterferenceGraph.h: Added. (WTF::InterferenceBitVector::contains): (WTF::InterferenceBitVector::addAndReturnIsNewEntry): (WTF::InterferenceBitVector::add): (WTF::InterferenceBitVector::clear): (WTF::InterferenceBitVector::mayClear): (WTF::InterferenceBitVector::setMaxIndex): (WTF::InterferenceBitVector::forEach): (WTF::InterferenceBitVector::size const): (WTF::InterferenceBitVector::memoryUse const): (WTF::InterferenceBitVector::dumpMemoryUseInKB const): (WTF::InterferenceBitVector::Iterable::iterator::operator++): (WTF::InterferenceBitVector::Iterable::iterator::operator* const): (WTF::InterferenceBitVector::Iterable::iterator::operator== const): (WTF::InterferenceBitVector::Iterable::iterator::operator!= const): (WTF::InterferenceBitVector::Iterable::begin const): (WTF::InterferenceBitVector::Iterable::end const): (WTF::InterferenceBitVector::operator[] const): (WTF::InterferenceBitVector::index const): (WTF::InterferenceVector::contains): (WTF::InterferenceVector::addAndReturnIsNewEntry): (WTF::InterferenceVector::add): (WTF::InterferenceVector::clear): (WTF::InterferenceVector::mayClear): (WTF::InterferenceVector::setMaxIndex): (WTF::InterferenceVector::forEach): (WTF::InterferenceVector::size const): (WTF::InterferenceVector::memoryUse const): (WTF::InterferenceVector::dumpMemoryUseInKB const): (WTF::InterferenceVector::Iterable::begin const): (WTF::InterferenceVector::Iterable::end const): (WTF::InterferenceVector::operator[] const): (WTF::UndirectedEdgesDuplicatingAdapter::contains): (WTF::UndirectedEdgesDuplicatingAdapter::addAndReturnIsNewEntry): (WTF::UndirectedEdgesDuplicatingAdapter::add): (WTF::UndirectedEdgesDuplicatingAdapter::clear): (WTF::UndirectedEdgesDuplicatingAdapter::mayClear): (WTF::UndirectedEdgesDuplicatingAdapter::setMaxIndex): (WTF::UndirectedEdgesDuplicatingAdapter::forEach): (WTF::UndirectedEdgesDuplicatingAdapter::size const): (WTF::UndirectedEdgesDuplicatingAdapter::memoryUse const): (WTF::UndirectedEdgesDuplicatingAdapter::dumpMemoryUseInKB const): (WTF::UndirectedEdgesDuplicatingAdapter::operator[] const): (WTF::UndirectedEdgesDedupAdapter::contains): (WTF::UndirectedEdgesDedupAdapter::addAndReturnIsNewEntry): (WTF::UndirectedEdgesDedupAdapter::add): (WTF::UndirectedEdgesDedupAdapter::clear): (WTF::UndirectedEdgesDedupAdapter::mayClear): (WTF::UndirectedEdgesDedupAdapter::setMaxIndex): (WTF::UndirectedEdgesDedupAdapter::forEach): (WTF::UndirectedEdgesDedupAdapter::size const): (WTF::UndirectedEdgesDedupAdapter::memoryUse const): (WTF::UndirectedEdgesDedupAdapter::dumpMemoryUseInKB const): (WTF::InterferenceHashSet::contains): (WTF::InterferenceHashSet::addAndReturnIsNewEntry): (WTF::InterferenceHashSet::add): (WTF::InterferenceHashSet::clear): (WTF::InterferenceHashSet::setMaxIndex): (WTF::InterferenceHashSet::forEach): (WTF::InterferenceHashSet::size const): (WTF::InterferenceHashSet::memoryUse const): (WTF::InterferenceHashSet::dumpMemoryUseInKB const): (WTF::InstrumentedInterferenceGraph::contains): (WTF::InstrumentedInterferenceGraph::addAndReturnIsNewEntry): (WTF::InstrumentedInterferenceGraph::add): (WTF::InstrumentedInterferenceGraph::clear): (WTF::InstrumentedInterferenceGraph::mayClear): (WTF::InstrumentedInterferenceGraph::setMaxIndex): (WTF::InstrumentedInterferenceGraph::forEach): (WTF::InstrumentedInterferenceGraph::size const): (WTF::InstrumentedInterferenceGraph::memoryUse const): (WTF::InstrumentedInterferenceGraph::dumpMemoryUseInKB const): (WTF::InstrumentedIterableInterferenceGraph::Iterable::Iterable): (WTF::InstrumentedIterableInterferenceGraph::Iterable::begin const): (WTF::InstrumentedIterableInterferenceGraph::Iterable::end const): (WTF::InstrumentedIterableInterferenceGraph::operator[] const): * wtf/LikelyDenseUnsignedIntegerSet.h: (WTF::LikelyDenseUnsignedIntegerSet::LikelyDenseUnsignedIntegerSet): (WTF::LikelyDenseUnsignedIntegerSet::clear): (WTF::LikelyDenseUnsignedIntegerSet::add): (WTF::LikelyDenseUnsignedIntegerSet::estimateHashSetSize): (WTF::LikelyDenseUnsignedIntegerSet::transitionToHashSet): (WTF::LikelyDenseUnsignedIntegerSet::transitionToBitVector): 2021-05-27 Darin Adler Next step toward using std::optional directly instead of through WTF::Optional typedef https://bugs.webkit.org/show_bug.cgi?id=226280 Reviewed by Chris Dumez. * : Accept the renaming done by do-webcore-rename. * wtf/Optional.h: Remove WTF::nullopt_t and WTF::makeOptional. * wtf/URLHelpers.cpp: (WTF::URLHelpers::mapHostName): Convert from nullopt to std::nullopt. 2021-05-27 Sihui Liu Abandon pending tasks on background thread when WebIDBServer is closed https://bugs.webkit.org/show_bug.cgi?id=226295 Reviewed by Chris Dumez. Make the wait end with either a new message or queue being killed. * wtf/CrossThreadQueue.h: (WTF::CrossThreadQueue::waitForMessage): * wtf/CrossThreadTask.h: (WTF::CrossThreadTask::operator bool const): * wtf/CrossThreadTaskHandler.cpp: (WTF::CrossThreadTaskHandler::taskRunLoop): 2021-05-27 Don Olmstead [CMake] Add check for timingsafe_bcmp https://bugs.webkit.org/show_bug.cgi?id=226347 Reviewed by Chris Dumez. Use HAVE(TIMINGSAFE_BCMP) in CryptographicUtilities code. Set its value in PlatformHave for platforms not using CMake. * wtf/CryptographicUtilities.cpp: * wtf/CryptographicUtilities.h: * wtf/PlatformHave.h: 2021-05-27 Mikhail R. Gadelha Increase NumberToStringBuffer to account for negative number https://bugs.webkit.org/show_bug.cgi?id=226014 Reviewed by Robin Morisset. In r250389, NumberToStringBuffer length was increased from 96 to 123 because: <21 digits> + decimal point + <100 digits> + null char = 123. however, a = -100000000000000000000 a.toFixed(100) is a valid conversion and it is 124 chars long, because of the "-" sign. So this patch increases the length of NumberToStringBuffer to 124 and adds new test cases. Reviewed by Ryosuke Niwa. * wtf/dtoa.h: 2021-05-27 Alex Christensen Revert r277344 https://bugs.webkit.org/show_bug.cgi?id=225602 * wtf/PlatformHave.h: 2021-05-27 Devin Rousso Use `NSLocale` SPI for comparing language identifiers instead of string comparison https://bugs.webkit.org/show_bug.cgi?id=226252 Reviewed by Wenson Hsieh. The existing `indexOfBestMatchingLanguageInList` logic uses (sub)string comparison of BCP47 language tags (e.g. looking for a `'-'` and comparing the substring before and after in the input language and each item in the language list). While this does work for some languages, it's really not the correct way to compare BCP47 language tags. Additionally, it basically ignores the text after the first `'-'`, unless there's an exact match with the input language. This leads to `"zh-CN"` and `"zh-HK"` being considered a (not exact) match, which isn't ideal. * wtf/Language.cpp: * wtf/cocoa/LanguageCocoa.mm: (WTF::indexOfBestMatchingLanguageInList): Added. * wtf/spi/cocoa/NSLocaleSPI.h: 2021-05-26 Cameron McCormack Prevent sbix glyphs from being rendered in the GPU process https://bugs.webkit.org/show_bug.cgi?id=226159 Reviewed by Darin Adler. * wtf/PlatformHave.h: Add HAVE_CORE_TEXT_SBIX_IMAGE_SIZE_FUNCTIONS. 2021-05-26 Chris Dumez Leverage the new Vector(const T*, size_t) constructor https://bugs.webkit.org/show_bug.cgi?id=226304 Reviewed by Darin Adler. Leverage the new Vector(const T*, size_t) constructor in existing code. * wtf/text/WTFString.cpp: (asciiDebug): 2021-05-26 Chris Dumez Use timingsafe_bcmp() in WTF::constantTimeMemcmp() when available https://bugs.webkit.org/show_bug.cgi?id=226294 Reviewed by Darin Adler. Follow-up to r278140 to address post-landing feedback. * wtf/CryptographicUtilities.cpp: (WTF::constantTimeMemcmp): * wtf/CryptographicUtilities.h: (WTF::constantTimeMemcmp): 2021-05-26 Chris Dumez Use timingsafe_bcmp() in WTF::constantTimeMemcmp() when available https://bugs.webkit.org/show_bug.cgi?id=226294 Reviewed by Alex Christensen. Use timingsafe_bcmp() in WTF::constantTimeMemcmp() when available (iOS, macOS, FreeBSD, OpenBSD), instead of our own custom implementation. * wtf/CryptographicUtilities.cpp: (WTF::constantTimeMemcmp): 2021-05-26 Chris Dumez [Hardening] Have the Ref<> destructor null out its pointer https://bugs.webkit.org/show_bug.cgi?id=226293 Reviewed by Geoffrey Garen. * wtf/Ref.h: (WTF::Ref::~Ref): 2021-05-26 Alex Christensen URL path setter messes up UTF-8 encoding after ? https://bugs.webkit.org/show_bug.cgi?id=226136 Reviewed by Chris Dumez. escapePathWithoutCopying needs to tell percentEncodeCharacters to percent encode all non-ASCII characters in the output of UTF-8 encoding in addition to ? and #. Otherwise, we take the output of UTF-8 encoding and append each code unit to the input of URL parsing as if it were Latin-1. This matches Chrome, Firefox, and reason. Covered by a newly passing WPT test. Other callers of percentEncodeCharacters use functions that already encode all non-ASCII characters. * wtf/URL.cpp: (WTF::escapePathWithoutCopying): 2021-05-26 Chris Dumez Stop using UncheckedLock in WTF::AutomaticThread https://bugs.webkit.org/show_bug.cgi?id=226255 Reviewed by Keith Miller. Stop using UncheckedLock in WTF::AutomaticThread as it is being phased out in favor of Lock, which supports Clang thread safety analysis. * wtf/AutomaticThread.cpp: (WTF::AutomaticThreadCondition::wait): (WTF::AutomaticThreadCondition::waitFor): (WTF::AutomaticThread::AutomaticThread): * wtf/AutomaticThread.h: * wtf/ParallelHelperPool.cpp: (WTF::ParallelHelperClient::~ParallelHelperClient): (WTF::ParallelHelperClient::finish): (WTF::ParallelHelperClient::finishWithLock): (WTF::ParallelHelperPool::ParallelHelperPool): * wtf/ParallelHelperPool.h: (WTF::ParallelHelperPool::numberOfThreads const): * wtf/WorkerPool.cpp: (WTF::WorkerPool::WorkerPool): * wtf/WorkerPool.h: 2021-05-25 Chris Dumez Use UncheckedLock less in JavaScriptCore https://bugs.webkit.org/show_bug.cgi?id=226212 Reviewed by Saam Barati. Add support for unlockEarly() to Locker specialization, for consistency with the generic Locker. * wtf/Lock.h: 2021-05-25 Devin Rousso [Modern Media Controls] REGRESSION(r254389) media controls needs the full list of language preferences for ordering tracks https://bugs.webkit.org/show_bug.cgi?id=226038 Reviewed by Myles C. Maxfield and Eric Carlson. Media controls need access to the full list of language preferences in order to properly sort/order the list of tracks in the controls UI. For example, if a `