2022-02-03 Carlos Garcia Campos Unreviewed. Fix GTK make distcheck Move mac specific file from Sources.txt to SourcesCocoa.txt * Sources.txt: * SourcesCocoa.txt: 2022-02-03 Martin Robinson Transform interpolation should blend between shared transform function primitives https://bugs.webkit.org/show_bug.cgi?id=235311 Reviewed by Simon Fraser. No new tests. This is covered by existing WPT tests. Allow direct interpolation between mismatching transform functions that share a primitive. This fixes many tests expecting a certain computed transformation matrix in WPT, but also allows using hardware animations more often for the CoreAnimation backend. Rotation, scale, and translate are the only functions that have shared primitives, so they are the only ones in this change to allow for this new behavior. When determining if a list of keyframes has shared compatible lists of transforms, return the vector of primitives that can represent them. In addition code for calculating big rotations has been removed, because it was unused. * platform/graphics/GraphicsLayer.cpp: (WebCore::gSharedPrimitivesForTransformKeyframe): Added. (WebCore::GraphicsLayer::getSharedPrimitivesForTransformKeyframes): Added. * platform/graphics/GraphicsLayer.h: * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::appendToUncommittedAnimations): Modified to take a vector of shared primitive types instead of a pointer to an array of operations. (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): * platform/graphics/ca/GraphicsLayerCA.h: * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp: (WebCore::GraphicsLayerTextureMapper::addAnimation): Use new method. * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: (WebCore::CoordinatedGraphicsLayer::addAnimation): Ditto. * platform/graphics/transforms/Matrix3DTransformOperation.cpp: (WebCore::Matrix3DTransformOperation::blend): Use the new sharedPrimitiveType method to determine if the two operations can blend. * platform/graphics/transforms/MatrixTransformOperation.cpp: (WebCore::MatrixTransformOperation::blend): Ditto. * platform/graphics/transforms/PerspectiveTransformOperation.cpp: (WebCore::PerspectiveTransformOperation::blend): Ditto. * platform/graphics/transforms/RotateTransformOperation.cpp: (WebCore::RotateTransformOperation::blend): Ditto. * platform/graphics/transforms/RotateTransformOperation.h: * platform/graphics/transforms/ScaleTransformOperation.cpp: (WebCore::ScaleTransformOperation::blend): Ditto. * platform/graphics/transforms/ScaleTransformOperation.h: * platform/graphics/transforms/SkewTransformOperation.cpp: (WebCore::SkewTransformOperation::blend): Ditto. * platform/graphics/transforms/TransformOperation.cpp: (WebCore::TransformOperation::sharedPrimitiveType const): * platform/graphics/transforms/TransformOperation.h: (WebCore::TransformOperation::primitiveType const): Added this virtual function which return the type for the base class. Rotation, scale, and translate specialize this to return a compatible primitive type. * platform/graphics/transforms/TransformOperations.cpp: (WebCore::TransformOperations::operationsMatch const): Modified to check whether operations share primitives. * platform/graphics/transforms/TranslateTransformOperation.cpp: (WebCore::TranslateTransformOperation::blend): Use the new sharedPrimitiveType method. * platform/graphics/transforms/TranslateTransformOperation.h: 2022-02-03 Tim Nguyen Create PDFDocument stub https://bugs.webkit.org/show_bug.cgi?id=235970 Reviewed by Brent Fulgham. Create an empty stub with an iframe where the viewer will be loaded. Changing about:blank?file= to https://mozilla.github.io/pdf.js/web/viewer.html?file= is one way to test the stub. That stub is guarded behind the PDF.js viewer internal setting which is only enabled in captive portal mode. * Headers.cmake: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * dom/DOMImplementation.cpp: (WebCore::DOMImplementation::createDocument): * dom/Document.h: (WebCore::Document::isPDFDocument const): * html/PDFDocument.cpp: Added. (WebCore::PDFDocument::PDFDocument): (WebCore::m_viewerRendered): (WebCore::PDFDocumentParser::document const): (WebCore::PDFDocumentParser::appendBytes): (WebCore::PDFDocumentParser::finish): (WebCore::PDFDocument::createParser): (WebCore::PDFDocument::createDocumentStructure): (WebCore::PDFDocument::updateDuringParsing): (WebCore::PDFDocument::finishedParsing): * html/PDFDocument.h: Added. (isType): 2022-02-02 Pablo Saavedra [WPE] Fix for non-unified builds with ACCESSIBILITY=OFF https://bugs.webkit.org/show_bug.cgi?id=236024 Reviewed by Darin Adler. * accessibility/atspi/AXObjectCacheAtspi.cpp: * accessibility/atspi/AccessibilityAtspi.cpp: * accessibility/atspi/AccessibilityAtspi.h: * accessibility/atspi/AccessibilityAtspiEnums.h: * accessibility/atspi/AccessibilityObjectActionAtspi.cpp: * accessibility/atspi/AccessibilityObjectAtspi.cpp: * accessibility/atspi/AccessibilityObjectAtspi.h: * accessibility/atspi/AccessibilityObjectComponentAtspi.cpp: * accessibility/atspi/AccessibilityObjectDocumentAtspi.cpp: * accessibility/atspi/AccessibilityObjectHyperlinkAtspi.cpp: * accessibility/atspi/AccessibilityObjectHypertextAtspi.cpp: * accessibility/atspi/AccessibilityObjectImageAtspi.cpp: * accessibility/atspi/AccessibilityObjectSelectionAtspi.cpp: * accessibility/atspi/AccessibilityObjectTableAtspi.cpp: * accessibility/atspi/AccessibilityObjectTableCellAtspi.cpp: * accessibility/atspi/AccessibilityObjectTextAtspi.cpp: * accessibility/atspi/AccessibilityObjectValueAtspi.cpp: * accessibility/atspi/AccessibilityRootAtspi.cpp: * accessibility/atspi/AccessibilityRootAtspi.h: * editing/atspi/FrameSelectionAtspi.cpp: * html/HTMLOptionElement.cpp: (WebCore::HTMLOptionElement::setSelectedState): * page/Page.h: 2022-02-02 Chris Dumez Move connect event dispatch logic to SharedWorkerGlobalScope https://bugs.webkit.org/show_bug.cgi?id=236038 Reviewed by Darin Adler. Move connect event dispatch logic to SharedWorkerGlobalScope and add logging. * WebCore.xcodeproj/project.pbxproj: * platform/Logging.h: * workers/shared/SharedWorkerGlobalScope.cpp: (WebCore::SharedWorkerGlobalScope::SharedWorkerGlobalScope): (WebCore::SharedWorkerGlobalScope::thread): (WebCore::SharedWorkerGlobalScope::close): (WebCore::SharedWorkerGlobalScope::postConnectEvent): * workers/shared/SharedWorkerGlobalScope.h: * workers/shared/SharedWorkerIdentifier.h: Copied from Source/WebCore/workers/shared/context/SharedWorkerThread.h. * workers/shared/SharedWorkerManager.cpp: (WebCore::SharedWorkerManager::scriptLoadedSuccessfully): * workers/shared/context/SharedWorkerThread.cpp: (WebCore::SharedWorkerThread::SharedWorkerThread): (WebCore::SharedWorkerThread::createWorkerGlobalScope): * workers/shared/context/SharedWorkerThread.h: (WebCore::SharedWorkerThread::identifier const): * workers/shared/context/SharedWorkerThreadProxy.cpp: (WebCore::SharedWorkerThreadProxy::startWorkerGlobalScope): (WebCore::SharedWorkerThreadProxy::identifier const): * workers/shared/context/SharedWorkerThreadProxy.h: 2022-02-02 Patrick Griffis CSP: Implement wasm-unsafe-eval https://bugs.webkit.org/show_bug.cgi?id=235408 Reviewed by Kate Cheney. This is similar to 'unsafe-eval' except limited in scope to WebAssembly. * page/csp/ContentSecurityPolicyDirectiveList.cpp: (WebCore::checkWasmEval): (WebCore::ContentSecurityPolicyDirectiveList::create): * page/csp/ContentSecurityPolicySourceList.cpp: (WebCore::ContentSecurityPolicySourceList::parseSource): * page/csp/ContentSecurityPolicySourceList.h: (WebCore::ContentSecurityPolicySourceList::allowWasmEval const): * page/csp/ContentSecurityPolicySourceListDirective.h: (WebCore::ContentSecurityPolicySourceListDirective::allowWasmEval const): 2022-02-02 Patrick Griffis CSP: Fix matching wildcard hosts https://bugs.webkit.org/show_bug.cgi?id=235992 Reviewed by Kate Cheney. As per the spec wildcard hosts must include the leading '.' for matches: https://www.w3.org/TR/CSP3/#match-hosts. Test: http/tests/security/contentSecurityPolicy/image-full-host-wildcard-blocked.html * page/csp/ContentSecurityPolicySource.cpp: (WebCore::ContentSecurityPolicySource::hostMatches const): 2022-02-02 Alex Christensen Use private relay for all subresources if the main document main resource was loaded using private relay https://bugs.webkit.org/show_bug.cgi?id=236000 Reviewed by Brady Eidson. This can be manually tested using instructions in the radar. * loader/DocumentLoader.h: (WebCore::DocumentLoader::setMainResourceWasPrivateRelayed): (WebCore::DocumentLoader::mainResourceWasPrivateRelayed const): 2022-02-02 Lauro Moura [GLIB] Unreviewed debug buildfix after r288872 https://bugs.webkit.org/show_bug.cgi?id=236036 The actual issue was the roleNames array provided to SortedArrayMap constructor wasn't fully ordered, making isSortedConstExpr to fail, generating the call to WTFReport..., which is non-constexpr and thus the compile failure. This commit revert the previous fix from r288990 and fix the ordering of roleNames. * accessibility/atspi/AccessibilityAtspi.cpp: (WebCore::AccessibilityAtspi::localizedRoleName): 2022-02-02 Antoine Quint Keyframe resolution methods should use reference instead of pointer parameters https://bugs.webkit.org/show_bug.cgi?id=236020 Reviewed by Dean Jackson. The Style::Resolver::styleForKeyframe() method would take in a `const RenderStyle*` and a `const StyleRuleKeyframe*` but these parameters were used without null checks. This patch changes this method signature to take in references instead, which involves also changing the signature for Style::Resolver::keyframeStylesForAnimation(). * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::getKeyframes): (WebCore::KeyframeEffect::updateBlendingKeyframes): (WebCore::KeyframeEffect::computeCSSAnimationBlendingKeyframes): (WebCore::KeyframeEffect::applyPendingAcceleratedActions): * rendering/style/KeyframeList.cpp: (WebCore::KeyframeList::fillImplicitKeyframes): * rendering/style/KeyframeList.h: * style/StyleResolver.cpp: (WebCore::Style::Resolver::styleForKeyframe): (WebCore::Style::Resolver::keyframeStylesForAnimation): * style/StyleResolver.h: 2022-02-02 Myles C. Maxfield Percentage word spacing doesn't incorporate synthetic bold expansion https://bugs.webkit.org/show_bug.cgi?id=236007 Reviewed by Alan Bujtas. The solution is to copy the approach in https://trac.webkit.org/changeset/288944/webkit to make sure the space glyph works correctly with synthetic bold and fallback fonts. This also renames FontCascade::spaceWidth() to FontCascade::widthOfSpaceString(), so it's more clear what it's actually doing. Test: fast/text/synthetic-bold-percentage-word-spacing.html * platform/graphics/FontCascade.h: (WebCore::FontCascade::metricsOfPrimaryFont const): (WebCore::FontCascade::spaceWidth const): Deleted. * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::setWordSpacing): 2022-02-02 Chris Dumez Move TransferredMessagePort to its own header https://bugs.webkit.org/show_bug.cgi?id=236028 Reviewed by Geoffrey Garen. Move TransferredMessagePort to its own header so that Shared Worker doesn't need to include the whole MessageWithMessagePorts.h header. It also facilitates passing a TransferredMessagePort in IPC, which will be needed. * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: * dom/MessagePort.cpp: (WebCore::MessagePort::postMessage): (WebCore::MessagePort::disentanglePorts): (WebCore::MessagePort::entanglePorts): * dom/MessagePort.h: * dom/messageports/MessageWithMessagePorts.h: * dom/messageports/TransferredMessagePort.h: Copied from Source/WebCore/dom/messageports/MessageWithMessagePorts.h. 2022-02-02 Timothy Hatcher Web Inspector: didShowExtensionTab needs to pass the frameID of the tab https://bugs.webkit.org/show_bug.cgi?id=236023 rdar://problem/88383984 Reviewed by BJ Burg. * inspector/InspectorFrontendClient.h: (WebCore::InspectorFrontendClient::didShowExtensionTab): * inspector/InspectorFrontendHost.cpp: (WebCore::InspectorFrontendHost::didShowExtensionTab): * inspector/InspectorFrontendHost.h: * inspector/InspectorFrontendHost.idl: 2022-02-02 Said Abou-Hallawa [GPU Process] Remove DisplayList::Replayer::Delegate and DisplayList::RecorderImpl::Delegate https://bugs.webkit.org/show_bug.cgi?id=235939 Reviewed by Wenson Hsieh. These classes are abstract classes and they are not overridden by any client right now. These unused classes should be removed after the display list stream connection refactoring. * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::displayListForTextRun const): * platform/graphics/ImageBuffer.h: (WebCore::ImageBuffer::changeDestinationImageBuffer): Deleted. (WebCore::ImageBuffer::prepareToAppendDisplayListItems): Deleted. * platform/graphics/displaylists/DisplayListDrawingContext.cpp: (WebCore::DisplayList::DrawingContext::DrawingContext): * platform/graphics/displaylists/DisplayListDrawingContext.h: (WebCore::DisplayList::DrawingContext::DrawingContext): * platform/graphics/displaylists/DisplayListImageBuffer.h: (WebCore::DisplayList::ImageBuffer::ImageBuffer): * platform/graphics/displaylists/DisplayListRecorder.h: * platform/graphics/displaylists/DisplayListRecorderImpl.cpp: (WebCore::DisplayList::RecorderImpl::RecorderImpl): (WebCore::DisplayList::RecorderImpl::recordResourceUse): (WebCore::DisplayList::RecorderImpl::canAppendItemOfType const): Deleted. (WebCore::DisplayList::RecorderImpl::canDrawImageBuffer const): Deleted. (WebCore::DisplayList::RecorderImpl::renderingMode const): Deleted. * platform/graphics/displaylists/DisplayListRecorderImpl.h: (WebCore::DisplayList::RecorderImpl::append): (WebCore::DisplayList::RecorderImpl::Delegate::~Delegate): Deleted. (WebCore::DisplayList::RecorderImpl::Delegate::canAppendItemOfType): Deleted. (WebCore::DisplayList::RecorderImpl::Delegate::recordNativeImageUse): Deleted. (WebCore::DisplayList::RecorderImpl::Delegate::isCachedImageBuffer const): Deleted. (WebCore::DisplayList::RecorderImpl::Delegate::recordFontUse): Deleted. (WebCore::DisplayList::RecorderImpl::Delegate::recordImageBufferUse): Deleted. (WebCore::DisplayList::RecorderImpl::Delegate::renderingMode const): Deleted. * platform/graphics/displaylists/DisplayListReplayer.cpp: (WebCore::DisplayList::Replayer::Replayer): (WebCore::DisplayList::applyImageBufferItem): (WebCore::DisplayList::applyNativeImageItem): (WebCore::DisplayList::applySetStateItem): (WebCore::DisplayList::applyFontItem): (WebCore::DisplayList::Replayer::applyItem): * platform/graphics/displaylists/DisplayListReplayer.h: (WebCore::DisplayList::Replayer::Delegate::~Delegate): Deleted. (WebCore::DisplayList::Replayer::Delegate::apply): Deleted. (WebCore::DisplayList::Replayer::Delegate::didCreateMaskImageBuffer): Deleted. (WebCore::DisplayList::Replayer::Delegate::didResetMaskImageBuffer): Deleted. (WebCore::DisplayList::Replayer::Delegate::recordResourceUse): Deleted. 2022-02-02 Lauro Moura [GLIB] Unreviewed debug buildfix after r288872 https://bugs.webkit.org/show_bug.cgi?id=236036 * accessibility/atspi/AccessibilityAtspi.cpp: (WebCore::AccessibilityAtspi::localizedRoleName): 2022-02-02 Asumu Takikawa Unmute link errors for ES module scripts https://bugs.webkit.org/show_bug.cgi?id=235925 Reviewed by Yusuke Suzuki. * bindings/js/ScriptController.cpp: (WebCore::ScriptController::linkAndEvaluateModuleScriptInWorld): 2022-02-02 Pablo Saavedra Fixes for non-unified builds after r288868 https://bugs.webkit.org/show_bug.cgi?id=235984 Reviewed by Chris Dumez. * layout/integration/InlineIteratorInlineBox.cpp: * rendering/RenderBlockFlow.cpp: * rendering/RenderInline.cpp: 2022-02-02 Said Abou-Hallawa REGRESSION(r288865): SourceImage should never sink its ImageBuffer to a NativeImage https://bugs.webkit.org/show_bug.cgi?id=236005 Reviewed by Simon Fraser. The r288865 changes SourceImage::nativeImage() such that if the image variant has an ImageBuffer, it will sink this ImageBuffer into a NativeImage and return this NativeImage to the caller. This was incorrect change because this would invalidate the ImageBufferBackend of the SourceImage. The fix is to copy the ImageBuffer to a NativeImage (DontCopyBackingStore) and store it into another image variant. This will keep the ImageBuffer valid and will prevent subsequent conversion if this function is called multiple times. Similar changes should be applied to SourceImage::imageBuffer(). Test: svg/custom/pattern-multiple-referencing.html * platform/graphics/SourceImage.cpp: (WebCore::nativeImageOf): (WebCore::SourceImage::nativeImageIfExists const): (WebCore::SourceImage::nativeImage const): (WebCore::imageBufferOf): (WebCore::SourceImage::imageBufferIfExists const): (WebCore::SourceImage::imageBuffer const): * platform/graphics/SourceImage.h: 2022-02-02 Chris Dumez Move SharedWorkerThread & SharedWorkerProxy to workers/shared/context/ https://bugs.webkit.org/show_bug.cgi?id=236017 Reviewed by Youenn Fablet. Move SharedWorkerThread & SharedWorkerProxy to workers/shared/context/, for consistency with service workers. Also rename SharedWorkerProxy to SharedWorkerThreadProxy. * CMakeLists.txt: * Headers.cmake: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * workers/shared/SharedWorker.cpp: (WebCore::SharedWorker::SharedWorker): * workers/shared/SharedWorker.h: * workers/shared/SharedWorkerManager.cpp: * workers/shared/context/SharedWorkerThread.cpp: Renamed from Source/WebCore/workers/shared/SharedWorkerThread.cpp. * workers/shared/context/SharedWorkerThread.h: Renamed from Source/WebCore/workers/shared/SharedWorkerThread.h. * workers/shared/context/SharedWorkerThreadProxy.cpp: Renamed from Source/WebCore/workers/shared/SharedWorkerProxy.cpp. * workers/shared/context/SharedWorkerThreadProxy.h: Renamed from Source/WebCore/workers/shared/SharedWorkerProxy.h. 2022-02-02 Chris Dumez Support sending WorkerOptions over IPC https://bugs.webkit.org/show_bug.cgi?id=236026 Reviewed by Sam Weinig. Support sending WorkerOptions over IPC, as this is will needed by Shared Workers. * workers/WorkerGlobalScopeProxy.h: * workers/WorkerOptions.h: (WebCore::WorkerOptions::encode const): (WebCore::WorkerOptions::decode): * workers/WorkerType.h: * workers/service/ServiceWorkerContainer.h: * workers/service/ServiceWorkerRegistrationOptions.h: * workers/service/server/SWServerWorker.h: 2022-02-02 Chris Dumez Move and rename ServiceWorkerFrameLoaderClient & ServiceWorkerLibWebRTCProvider https://bugs.webkit.org/show_bug.cgi?id=236016 Reviewed by Youenn Fablet. Move and rename ServiceWorkerFrameLoaderClient & ServiceWorkerLibWebRTCProvider so that they can be reused by Shared Workers. * loader/FrameLoaderClient.h: 2022-02-02 Philippe Normand [GStreamer] Generate webrtc encoder src pad template based on supported platform encoders https://bugs.webkit.org/show_bug.cgi?id=235964 Reviewed by Xabier Rodriguez-Calvar. Without this patch there was no guarantee the encoder would setup correctly in case the encoder matching the requested caps is not available at runtime. * platform/mediastream/gstreamer/GStreamerVideoEncoder.cpp: (Encoders::registerEncoder): (createSrcPadTemplateCaps): (webkit_webrtc_video_encoder_class_init): 2022-02-02 Antoine Quint CSSPropertyAnimation::animatableShorthandsAffectingProperty() is unused https://bugs.webkit.org/show_bug.cgi?id=236022 Reviewed by Dean Jackson. This method is a remnant from the legacy animation engine and should be removed. * animation/CSSPropertyAnimation.cpp: (WebCore::CSSPropertyAnimation::animatableShorthandsAffectingProperty): Deleted. * animation/CSSPropertyAnimation.h: * animation/CSSPropertyAnimation.cpp: (WebCore::gatherEnclosingShorthandProperties): Deleted. (WebCore::CSSPropertyAnimation::animatableShorthandsAffectingProperty): Deleted. * animation/CSSPropertyAnimation.h: 2022-02-02 Andres Gonzalez Make modifications to the isolated Tree atomic. https://bugs.webkit.org/show_bug.cgi?id=235683 Reviewed by Chris Fleizach. Covered by existing tests. The isolated tree is currently updated in a non-atomic fashion, i.e., nodes are added or removed while clients are accessing the tree in an inconsistent state. The idea of this patch is to make all necessary changes in the tree in one atomic operation while the client thread, or AX secondary thread, is blocked. To accomplish this and still be responsive to client's requests on the AX thread, it is necessary that all the processing in preparation for the update of the isolated tree happens on the main thread without blocking the AX thread, and then do the update of the tree in one atomic operation. * accessibility/AXLogger.cpp: (WebCore::operator<<): Rearranged the properties of the AXCoreObject to log most relevant on top. * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored const): Removed AXTRACE from this method since it is called so often that it is just noise in the log. * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::generateSubtree): It now collects all the changes to be perform and queues them in one operation under lock. (WebCore::AXIsolatedTree::nodeChangeForObject): (WebCore::AXIsolatedTree::queueChange): Queues one single change, must be called under lock. (WebCore::AXIsolatedTree::queueChangesAndRemovals): Queues all necessary changes to the isolated tree, additions and removals. (WebCore::AXIsolatedTree::collectNodeChangesForSubtree): Collects on the main thread all the additions/changes to be done to the isolated tree. (WebCore::AXIsolatedTree::updateNode): (WebCore::AXIsolatedTree::nodeAncestryChanges): Connects a new isolated node to the existing hierarchy. (WebCore::AXIsolatedTree::updateChildren): (WebCore::AXIsolatedTree::removeSubtreeFromNodeMap): (WebCore::AXIsolatedTree::updateChildrenIDs): Deleted. (WebCore::AXIsolatedTree::createSubtree): Deleted. Replaced with collectNodeChanges and queueChangesAndRemovals. (WebCore::AXIsolatedTree::updateSubtree): Deleted, not used. (WebCore::AXIsolatedTree::removeSubtree): Deleted, not used. * accessibility/isolatedtree/AXIsolatedTree.h: (WebCore::AXIsolatedTree::queueChangesAndRemovals): 2022-02-02 Gabriel Nava Marino null ptr deref in Editor::pasteWithPasteboard https://bugs.webkit.org/show_bug.cgi?id=235966 Reviewed by Wenson Hsieh. Add an additional check as pasteAsFragment's dispatchEvent can end up removing the client. No new tests due to requiring Node web server (and cannot reproduce in LayoutTests/http/tests). * editing/mac/EditorMac.mm: (WebCore::Editor::pasteWithPasteboard): 2022-02-02 Commit Queue Unreviewed, reverting r286988. https://bugs.webkit.org/show_bug.cgi?id=236006 Broke form submission for multiple Reverted changeset: "A FormData constructed in the form's submit event listener shouldn't include the submitter" https://bugs.webkit.org/show_bug.cgi?id=234069 https://commits.webkit.org/r286988 2022-02-02 Youenn Fablet RealtimeVideoSource::adaptVideoSample should not create IOSurfaces when running in WebProcess https://bugs.webkit.org/show_bug.cgi?id=236011 Reviewed by Eric Carlson. Add a way to not use IOSurfaces when using ImageTransferSessionVT. Use this in RealtimeVideoSource to toggle IOSurface use on and off when downsampling samples. Covered by existing tests. * platform/graphics/cv/CVUtilities.h: * platform/graphics/cv/CVUtilities.mm: * platform/graphics/cv/ImageTransferSessionVT.h: * platform/graphics/cv/ImageTransferSessionVT.mm: * platform/mediastream/RealtimeVideoSource.cpp: * platform/mediastream/RealtimeVideoSource.h: 2022-02-02 Tyler Wilcock AX: Display startObject and anchorObject objectID when logging AccessibilitySearchCriteria from AXLogger https://bugs.webkit.org/show_bug.cgi?id=235997 Reviewed by Chris Fleizach. With this patch, logging AccessibilitySearchCriteria will look like: (SearchCriteria 0x2a7d13a80 (anchorObject 0x315ba9980, ID 492) (startObject 0x0, ID 0) ...truncated... This will help us correlate the IDs of anchorObject and startObject with other log statements. * accessibility/AXLogger.cpp: (WebCore::operator<<): 2022-02-02 Youenn Fablet LibWebRTCCodecs should not need to create IOSurfaces https://bugs.webkit.org/show_bug.cgi?id=235951 Reviewed by Eric Carlson. Introduce SharedVideoFrameInfo as a helper class to serialize a CVPixelBuffer into memory and create a CVPixelBuffer from reading memory. Covered by existing webrtc tests. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/cocoa/SharedVideoFrameInfo.h: Added. * platform/cocoa/SharedVideoFrameInfo.mm: Added. * platform/cocoa/CoreVideoSoftLink.cpp: * platform/cocoa/CoreVideoSoftLink.h: * platform/graphics/RemoteVideoSample.cpp: * platform/graphics/RemoteVideoSample.h: 2022-02-02 Youenn Fablet Clarify that some UUID routines are dedicated to UUID v4 https://bugs.webkit.org/show_bug.cgi?id=235430 Reviewed by Darin Adler. No change of behavior, this is renaming only. * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp: (WebCore::CDMSessionClearKey::CDMSessionClearKey): * Modules/entriesapi/DOMFileSystem.cpp: (WebCore::DOMFileSystem::DOMFileSystem): * Modules/highlight/AppHighlightStorage.cpp: (WebCore::createAppHighlightRangeData): * Modules/mediacontrols/MediaControlsHost.cpp: (WebCore::MediaControlsHost::generateUUID): * Modules/mediastream/MediaDevices.cpp: (WebCore::MediaDevices::MediaDevices): * Modules/paymentrequest/PaymentRequest.cpp: (WebCore::PaymentRequest::create): * Modules/webdatabase/DatabaseTracker.cpp: (WebCore::generateDatabaseFileName): * accessibility/atspi/AccessibilityAtspi.cpp: (WebCore::AccessibilityAtspi::registerRoot): (WebCore::AccessibilityAtspi::registerObject): (WebCore::AccessibilityAtspi::registerHyperlink): * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::copyPropertiesFromSource): (WebCore::KeyframeEffect::updateBlendingKeyframes): (WebCore::KeyframeEffect::computeCSSTransitionBlendingKeyframes): * dom/Document.cpp: (WebCore::Document::originIdentifierForPasteboard const): (WebCore::Document::didInsertAttachmentElement): * fileapi/BlobURL.cpp: (WebCore::BlobURL::createBlobURL): * html/HTMLAttachmentElement.cpp: (WebCore::HTMLAttachmentElement::ensureUniqueIdentifier): * loader/appcache/ApplicationCacheStorage.cpp: (WebCore::ApplicationCacheStorage::writeDataToUniqueFileInDirectory): * page/Crypto.cpp: (WebCore::Crypto::randomUUID const): * platform/ScriptExecutionContextIdentifier.h: (WebCore::ProcessQualified::generate): * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp: (WebCore::CDMSessionAVFoundationCF::CDMSessionAVFoundationCF): * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm: (WebCore::CDMSessionAVFoundationObjC::CDMSessionAVFoundationObjC): * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm: (WebCore::CDMSessionAVStreamSession::update): * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::updateAnimations): * platform/mediastream/MediaStreamPrivate.h: * platform/mediastream/MediaStreamTrackPrivate.cpp: (WebCore::MediaStreamTrackPrivate::create): * platform/mediastream/RealtimeMediaSource.cpp: (WebCore::RealtimeMediaSource::RealtimeMediaSource): * platform/mediastream/gstreamer/GStreamerDisplayCaptureDeviceManager.cpp: (WebCore::GStreamerDisplayCaptureDeviceManager::computeCaptureDevices): * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp: (webkitMediaStreamSrcPostStreamCollection): * platform/mediastream/ios/ReplayKitCaptureSource.mm: (WebCore::screenDeviceUUID): * testing/Internals.cpp: (WebCore::Internals::isDocumentAlive const): * testing/MockCDMFactory.cpp: (WebCore::MockCDMInstanceSession::requestLicense): 2022-02-02 Philippe Normand [GStreamer] Add support for custom message handling in simpleBusMessageCallback https://bugs.webkit.org/show_bug.cgi?id=235822 Reviewed by Xabier Rodriguez-Calvar. Refactor most custom GStreamer message handlers to rely on the common "simple" handler, which can now be augmented with an optional closure to do further message processing. * platform/audio/gstreamer/AudioDestinationGStreamer.cpp: (WebCore::AudioDestinationGStreamer::AudioDestinationGStreamer): (WebCore::AudioDestinationGStreamer::~AudioDestinationGStreamer): (WebCore::AudioDestinationGStreamer::handleMessage): (WebCore::messageCallback): Deleted. * platform/audio/gstreamer/AudioDestinationGStreamer.h: * platform/graphics/gstreamer/GStreamerCommon.cpp: (WebCore::disconnectSimpleBusMessageCallback): (WebCore::CustomMessageHandlerHolder::CustomMessageHandlerHolder): (WebCore::connectSimpleBusMessageCallback): (WebCore::simpleBusMessageCallback): Deleted. * platform/graphics/gstreamer/GStreamerCommon.h: (WebCore::connectSimpleBusMessageCallback): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer): (WebCore::MediaPlayerPrivateGStreamer::handleMessage): (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): 2022-02-02 Martin Robinson scroll-margin-top doesn't work on inline elements https://bugs.webkit.org/show_bug.cgi?id=235933 Reviewed by Simon Fraser. Test: imported/w3c/web-platform-tests/css/css-scroll-snap/scroll-target-margin-005.html Move the implementation of absoluteAnchorRectWithScrollMargin which actually processes the CSS scroll-margin property to RenderElement. This allows it to be used for inline as well as block elements. The specification says it should apply to both. The box sizes passed in here do not matter too much, because the Length should never be a percentage. * rendering/RenderBox.cpp: (WebCore::RenderBox::absoluteAnchorRectWithScrollMargin const): Deleted. * rendering/RenderBox.h: * rendering/RenderElement.cpp: (WebCore::RenderElement::absoluteAnchorRectWithScrollMargin const): * rendering/RenderElement.h: 2022-02-01 Alan Bujtas [LFC][IFC] Using Fontcascade::spaceWidth to subtract the trailing space width may result in incorrect layout https://bugs.webkit.org/show_bug.cgi?id=235937 Reviewed by Antti Koivisto and Simon Fraser. Since Fontcascade::spaceWidth always consult the primary font, it may return unexpected width value when (in rare cases) the primary font does not have a space glyph. Legacy line layout works as expected as it always runs a full width computation on the space character (instead of directly calling FontCascade::spaceWidth). * layout/formattingContexts/inline/InlineItemsBuilder.cpp: (WebCore::Layout::InlineItemsBuilder::computeInlineTextItemWidths): * layout/formattingContexts/inline/text/TextUtil.cpp: (WebCore::Layout::TextUtil::width): (WebCore::Layout::TextUtil::spaceWidth): * layout/formattingContexts/inline/text/TextUtil.h: 2022-02-01 Myles C. Maxfield Rename FontCascade::fontMetrics() and RenderStyle::fontMetrics() to fontMetricsOfPrimaryFont() https://bugs.webkit.org/show_bug.cgi?id=235938 Unreviewed. Addressing post-review comments. No new tests because there is no behavior change. * accessibility/atk/WebKitAccessibleInterfaceText.cpp: (baselinePositionForRenderObject): * css/CSSPrimitiveValue.cpp: (WebCore::CSSPrimitiveValue::computeNonCalcLengthDouble): (WebCore::CSSPrimitiveValue::equalForLengthResolution): * display/css/DisplayBoxPainter.cpp: (WebCore::Display::BoxPainter::paintBoxContent): * display/css/DisplayStyle.h: (WebCore::Display::Style::metricsOfPrimaryFont const): (WebCore::Display::Style::fontMetricsOfPrimaryFont const): Deleted. * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::createInnerTextStyle): * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::FontProxy::metricsOfPrimaryFont const): (WebCore::CanvasRenderingContext2DBase::drawTextUnchecked): (WebCore::CanvasRenderingContext2DBase::measureTextInternal): (WebCore::CanvasRenderingContext2DBase::textOffset): (WebCore::CanvasRenderingContext2DBase::FontProxy::fontMetricsOfPrimaryFont const): Deleted. * html/canvas/CanvasRenderingContext2DBase.h: * inspector/InspectorOverlay.cpp: (WebCore::InspectorOverlay::drawRulers): (WebCore::InspectorOverlay::drawElementTitle): (WebCore::expectedSizeForLayoutLabel): (WebCore::drawLayoutLabel): * layout/formattingContexts/inline/InlineFormattingQuirks.cpp: (WebCore::Layout::InlineFormattingQuirks::initialLineHeight const): * layout/formattingContexts/inline/InlineLevelBox.h: (WebCore::Layout::m_style): (WebCore::Layout::InlineLevelBox::preferredLineHeight const): (WebCore::Layout::InlineLevelBox::primarymetricsOfPrimaryFont const): (WebCore::Layout::InlineLevelBox::primaryfontMetricsOfPrimaryFont const): Deleted. * layout/formattingContexts/inline/InlineLineBox.cpp: (WebCore::Layout::LineBox::logicalRectForTextRun const): * layout/formattingContexts/inline/InlineLineBoxBuilder.cpp: (WebCore::Layout::LineBoxBuilder::setVerticalGeometryForLineBreakBox const): (WebCore::Layout::LineBoxBuilder::setInitialVerticalGeometryForInlineBox const): * layout/formattingContexts/inline/InlineLineBoxVerticalAligner.cpp: (WebCore::Layout::LineBoxVerticalAligner::computeLineBoxLogicalHeight const): (WebCore::Layout::LineBoxVerticalAligner::computeRootInlineBoxVerticalPosition const): (WebCore::Layout::LineBoxVerticalAligner::alignInlineLevelBoxes const): * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::floatWidthForSimpleText const): (WebCore::FontCascade::floatWidthForComplexText const): * platform/graphics/FontCascade.h: (WebCore::FontCascade::metricsOfPrimaryFont const): (WebCore::FontCascade::fontMetricsOfPrimaryFont const): Deleted. * platform/win/DragImageWin.cpp: (WebCore::createDragImageForLink): * platform/win/PopupMenuWin.cpp: (WebCore::PopupMenuWin::calculatePositionAndSize): (WebCore::PopupMenuWin::paint): * rendering/CaretRectComputation.cpp: (WebCore::computeCaretRectForEmptyElement): (WebCore::computeCaretRectForBox): * rendering/LegacyEllipsisBox.cpp: (WebCore::LegacyEllipsisBox::paint): (WebCore::LegacyEllipsisBox::paintMarkupBox): (WebCore::LegacyEllipsisBox::nodeAtPoint): * rendering/LegacyInlineBox.cpp: (WebCore::LegacyInlineBox::logicalHeight const): * rendering/LegacyInlineFlowBox.cpp: (WebCore::LegacyInlineFlowBox::addToLine): (WebCore::placeChildInlineBoxesInBlockDirection): (WebCore::LegacyInlineFlowBox::placeBoxesInBlockDirection): * rendering/LegacyLineLayout.cpp: (WebCore::setLogicalWidthForTextRun): * rendering/LegacyRootInlineBox.cpp: (WebCore::LegacyRootInlineBox::lineSnapAdjustment const): (WebCore::LegacyRootInlineBox::ascentAndDescentForBox const): (WebCore::LegacyRootInlineBox::verticalPositionForBox): * rendering/RenderBlock.cpp: (WebCore::RenderBlock::baselinePosition const): (WebCore::RenderBlock::inlineBlockBaseline const): * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::adjustInitialLetterPosition): (WebCore::RenderBlockFlow::firstLineBaseline const): (WebCore::RenderBlockFlow::inlineBlockBaseline const): * rendering/RenderEmbeddedObject.cpp: (WebCore::RenderEmbeddedObject::paintReplaced): * rendering/RenderImage.cpp: (WebCore::RenderImage::setImageSizeForAltText): (WebCore::RenderImage::paintReplaced): * rendering/RenderInline.cpp: (WebCore::RenderInline::mayAffectLayout const): (WebCore::RenderInline::baselinePosition const): * rendering/RenderLineBreak.cpp: (WebCore::RenderLineBreak::baselinePosition const): * rendering/RenderListBox.cpp: (WebCore::itemOffsetForAlignment): (WebCore::RenderListBox::itemHeight const): * rendering/RenderListMarker.cpp: (WebCore::RenderListMarker::paint): (WebCore::RenderListMarker::layout): (WebCore::RenderListMarker::updateContent): (WebCore::RenderListMarker::computePreferredLogicalWidths): (WebCore::RenderListMarker::updateMargins): (WebCore::RenderListMarker::relativeMarkerRect): * rendering/RenderRubyRun.cpp: (WebCore::RenderRubyRun::layoutBlock): * rendering/RenderThemeWin.cpp: (WebCore::RenderThemeWin::adjustMenuListButtonStyle const): * rendering/TextBoxPainter.cpp: (WebCore::TextBoxPainter::paintForeground): (WebCore::TextBoxPainter::paintCompositionUnderline): (WebCore::TextBoxPainter::calculateDocumentMarkerBounds): (WebCore::TextBoxPainter::textOriginFromPaintRect const): * rendering/TextDecorationPainter.cpp: (WebCore::TextDecorationPainter::paintBackgroundDecorations): (WebCore::TextDecorationPainter::paintForegroundDecorations): (WebCore::TextDecorationPainter::paintLineThrough): * rendering/TextPainter.cpp: (WebCore::TextPainter::paintTextAndEmphasisMarksIfNeeded): * rendering/line/LineInlineHeaders.h: (WebCore::requiresLineBoxForContent): * rendering/mathml/RenderMathMLBlock.cpp: (WebCore::axisHeight): (WebCore::toUserUnits): * rendering/mathml/RenderMathMLRoot.cpp: (WebCore::RenderMathMLRoot::verticalParameters): * rendering/mathml/RenderMathMLScripts.cpp: (WebCore::RenderMathMLScripts::verticalParameters const): * rendering/mathml/RenderMathMLUnderOver.cpp: (WebCore::RenderMathMLUnderOver::verticalParameters const): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::metricsOfPrimaryFont const): (WebCore::RenderStyle::computeLineHeight const): (WebCore::RenderStyle::fontMetricsOfPrimaryFont const): Deleted. * rendering/style/RenderStyle.h: * rendering/svg/RenderSVGInlineText.cpp: (WebCore::RenderSVGInlineText::positionForPoint): * rendering/svg/SVGInlineTextBox.cpp: (WebCore::SVGInlineTextBox::selectionRectForTextFragment const): (WebCore::SVGInlineTextBox::paintDecorationWithStyle): (WebCore::SVGInlineTextBox::paintTextWithShadows): (WebCore::SVGInlineTextBox::calculateBoundaries const): (WebCore::SVGInlineTextBox::nodeAtPoint): * rendering/svg/SVGTextLayoutEngineBaseline.cpp: (WebCore::SVGTextLayoutEngineBaseline::calculateBaselineShift const): (WebCore::SVGTextLayoutEngineBaseline::calculateAlignmentBaselineShift const): (WebCore::SVGTextLayoutEngineBaseline::calculateGlyphAdvanceAndOrientation const): * rendering/svg/SVGTextMetrics.cpp: (WebCore::SVGTextMetrics::SVGTextMetrics): * rendering/svg/SVGTextQuery.cpp: (WebCore::calculateGlyphBoundaries): * rendering/updating/RenderTreeBuilderFirstLetter.cpp: (WebCore::styleForFirstLetter): * style/InlineTextBoxStyle.cpp: (WebCore::visualOverflowForDecorations): * style/StyleResolveForFontRaw.cpp: (WebCore::Style::resolveForFontRaw): * svg/SVGLengthContext.cpp: (WebCore::SVGLengthContext::convertValueFromUserUnitsToEXS const): (WebCore::SVGLengthContext::convertValueFromEXSToUserUnits const): 2022-02-01 Lauro Moura Unreviewed, non-unified buildfix after latest accessibility commits https://bugs.webkit.org/show_bug.cgi?id=235999 * accessibility/atspi/AccessibilityAtspi.cpp: * accessibility/atspi/AccessibilityObjectAtspi.cpp: * accessibility/atspi/AccessibilityObjectSelectionAtspi.cpp: * accessibility/atspi/AccessibilityObjectTableAtspi.cpp: 2022-02-01 Commit Queue Unreviewed, reverting r288914. https://bugs.webkit.org/show_bug.cgi?id=235998 Broke some layout tests Reverted changeset: "[LFC][IFC] Using Fontcascade::spaceWidth to subtract the trailing space width may result in incorrect layout" https://bugs.webkit.org/show_bug.cgi?id=235937 https://commits.webkit.org/r288914 2022-02-01 Chris Dumez Rename ServiceWorkerFetchResult to WorkerFetchResult and make it more generic https://bugs.webkit.org/show_bug.cgi?id=235983 Reviewed by Geoffrey Garen. Rename ServiceWorkerFetchResult to WorkerFetchResult and make it more generic so that it can be reused by Shared Workers. * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: * workers/service/SWClientConnection.cpp: (WebCore::SWClientConnection::startScriptFetchForServer): * workers/service/SWClientConnection.h: * workers/service/ServiceWorkerContainer.cpp: (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript): (WebCore::ServiceWorkerContainer::notifyFailedFetchingScript): * workers/service/ServiceWorkerFetchResult.h: Removed. (WebCore::ServiceWorkerFetchResult::isolatedCopy const): Deleted. (WebCore::serviceWorkerFetchError): Deleted. (WebCore::ServiceWorkerFetchResult::encode const): Deleted. (WebCore::ServiceWorkerFetchResult::decode): Deleted. * workers/service/WorkerSWClientConnection.cpp: (WebCore::WorkerSWClientConnection::finishFetchingScriptInServer): * workers/service/WorkerSWClientConnection.h: * workers/service/server/SWServer.cpp: (WebCore::SWServer::Connection::finishFetchingScriptInServer): (WebCore::SWServer::startScriptFetch): (WebCore::SWServer::scriptFetchFinished): * workers/service/server/SWServer.h: * workers/service/server/SWServerJobQueue.cpp: (WebCore::SWServerJobQueue::scriptFetchFinished): * workers/service/server/SWServerJobQueue.h: * workers/service/server/SWServerRegistration.h: * workers/WorkerFetchResult.h: Added. 2022-02-01 Andres Gonzalez Check AccessibilityRenderObject::m_renderer for null before using it. https://bugs.webkit.org/show_bug.cgi?id=235950 Reviewed by Chris Fleizach. AccessibilityRenderObject::m_renderer is a WeakPtr that can become null due to a variety of changes in the render tree. This patch fixes a number of cases where AccessibilityRenderObject::m_renderer was being used without checking for null which leads to crashes such as: https://bugs.webkit.org/show_bug.cgi?id=235945 https://bugs.webkit.org/show_bug.cgi?id=235827 * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::parentObjectIfExists const): (WebCore::AccessibilityRenderObject::selection const): (WebCore::AccessibilityRenderObject::setSelectedTextRange): (WebCore::AccessibilityRenderObject::documentLinks): (WebCore::AccessibilityRenderObject::setSelectedVisiblePositionRange const): 2022-02-01 Chris Dumez Replace WebCore::topOriginURL() to SecurityOrigin::toURL() https://bugs.webkit.org/show_bug.cgi?id=235987 Reviewed by Geoffrey Garen. Replace WebCore::topOriginURL() to SecurityOrigin::toURL() so that it can be reused by Shared Workers. * page/SecurityOrigin.cpp: (WebCore::SecurityOrigin::toURL const): * page/SecurityOrigin.h: * page/SecurityOriginData.cpp: (WebCore::SecurityOriginData::toURL const): * page/SecurityOriginData.h: * workers/service/context/ServiceWorkerThreadProxy.cpp: (WebCore::ServiceWorkerThreadProxy::setupPageForServiceWorker): (WebCore::topOriginURL): Deleted. 2022-02-01 Simon Fraser Crash under ScrollingCoordinatorMac::hasNodeWithAnimatedScrollChanged() https://bugs.webkit.org/show_bug.cgi?id=235989 Reviewed by Wenson Hsieh. Crash data suggest that m_scrollingCoordinator can be null in ThreadedScrollingTree::hasNodeWithAnimatedScrollChanged(), which is true if the scrolling tree keeps ThreadedScrollingTree alive longer than the scrolling coordinator. As in the other functions in this file, early return if m_scrollingCoordinator is null. * page/scrolling/ThreadedScrollingTree.cpp: (WebCore::ThreadedScrollingTree::hasNodeWithAnimatedScrollChanged): 2022-02-01 Pablo Saavedra Fix build error with VIDEO=ON https://bugs.webkit.org/show_bug.cgi?id=235982 Reviewed by Eric Carlson. * Modules/WebGPU/GPUExternalTextureDescriptor.idl: * Modules/webcodecs/VideoColorPrimaries.idl: * Modules/webcodecs/VideoMatrixCoefficients.idl: * Modules/webcodecs/VideoTransferCharacteristics.idl: * platform/MediaSample.h: 2022-02-01 Ben Nham Forward messages from NetworkProcess to webpushd https://bugs.webkit.org/show_bug.cgi?id=235855 Reviewed by Brent Fulgham. Make ExceptionData use modern encoding since the daemon IPC encoder doesn't support legacy encoding. * dom/ExceptionData.h: (WebCore::ExceptionData::decode): 2022-02-01 Per Arne Vollan [WP] Remove PostScript conversion code https://bugs.webkit.org/show_bug.cgi?id=235892 Reviewed by Tim Horton. The WebContent process no longer has access to the PostScript conversion service, so there is no need to keep this code. * loader/cache/CachedImage.cpp: (WebCore::CachedImage::convertedDataIfNeeded const): * platform/graphics/cg/PDFDocumentImage.cpp: (WebCore::PDFDocumentImage::convertPostScriptDataToPDF): Deleted. * platform/graphics/cg/PDFDocumentImage.h: 2022-02-01 Alan Bujtas [LFC][IFC] Using Fontcascade::spaceWidth to subtract the trailing space width may result in incorrect layout https://bugs.webkit.org/show_bug.cgi?id=235937 Reviewed by Antti Koivisto. Since Fontcascade::spaceWidth always consult the primary font, it may return unexpected width value when (in rare cases) the primary font does not have a space glyph. Legacy line layout works as expected as it always runs a full width computation on the space character (instead of directly calling FontCascade::spaceWidth). * layout/formattingContexts/inline/InlineItemsBuilder.cpp: (WebCore::Layout::InlineItemsBuilder::computeInlineTextItemWidths): * layout/formattingContexts/inline/text/TextUtil.cpp: (WebCore::Layout::TextUtil::width): (WebCore::Layout::TextUtil::spaceWidth): * layout/formattingContexts/inline/text/TextUtil.h: 2022-02-01 Fujii Hironori MSVC reports "SVGPropertyAnimator.h(94): error C2839: invalid return type 'T *' for overloaded 'operator ->'" with /std:c++20 https://bugs.webkit.org/show_bug.cgi?id=234546 Reviewed by Darin Adler. r287300 was a wrong fix that used a raw pointer to work around an MSVC's RefPtr compilation error. We should use smart pointers for local variables. This seems a MSVC bug that the class template argument deduction doesn't work in this case. Explicitly specifying a class template argument is a workaround. * svg/properties/SVGPropertyAnimator.h: (WebCore::SVGPropertyAnimator::computeInheritedCSSPropertyValue const): Changed the type of the local variable 'parent' from a raw pointer to RefPtr. 2022-02-01 Ryosuke Niwa Use more AtomString and un-inline code for ScriptElementCachedScriptFetcher and its subclasses https://bugs.webkit.org/show_bug.cgi?id=235919 Address Darin's review comment. nonce in LoadableClassicScript's constructor should also have been converted to AtomString in r288900. * dom/LoadableClassicScript.cpp: (WebCore::LoadableClassicScript::LoadableClassicScript): * dom/LoadableClassicScript.h: 2022-02-01 Antoine Quint Refactor KeyframesRuleMap to use AtomString for the key https://bugs.webkit.org/show_bug.cgi?id=235962 Reviewed by Antti Koivisto. It was noted during review of https://bugs.webkit.org/show_bug.cgi?id=229437 that we ought to use an AtomString instead of an AtomStringImpl* as a key for m_keyframesRuleMap. * style/StyleResolver.cpp: (WebCore::Style::Resolver::addKeyframeStyle): (WebCore::Style::Resolver::isAnimationNameValid): (WebCore::Style::Resolver::keyframeRulesForName const): * style/StyleResolver.h: 2022-02-01 Antti Koivisto [CSS Container Queries] Ensure query containers have valid layout before resolving the subtree https://bugs.webkit.org/show_bug.cgi?id=235896 Reviewed by Alan Bujtas. To resolve container queries we need to have up-to-date layout for the query containers before style resolution advances to their descendants. With this patch we bounce between style resolution and layout until all query containers are resolved. * dom/Document.cpp: (WebCore::Document::resolveStyle): Loop style resolution/render tree update/layout until we have resolved everything. * dom/Document.h: (WebCore::Document::isResolvingContainerQueries const): * page/FrameViewLayoutContext.cpp: (WebCore::FrameViewLayoutContext::layout): (WebCore::FrameViewLayoutContext::runOrScheduleAsynchronousTasks): Don't run post-layout tasks when resolving query containers. * style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::resolveComposedTree): (WebCore::Style::TreeResolver::updateQueryContainer): Track what has been resolved. (WebCore::Style::TreeResolver::resolve): * style/StyleTreeResolver.h: (WebCore::Style::TreeResolver::hasUnresolvedQueryContainers const): * style/StyleUpdate.h: (WebCore::Style::Update::isEmpty const): 2022-02-01 Pablo Saavedra [GTK][WPE] Fixes for non-unified builds after r288807 and r288820 https://bugs.webkit.org/show_bug.cgi?id=235956 Reviewed by Mark Lam. * bindings/js/ScriptModuleLoader.cpp: (WebCore::rejectWithFetchError): 2022-02-01 Ryosuke Niwa Use more AtomString and un-inline code for ScriptElementCachedScriptFetcher and its subclasses https://bugs.webkit.org/show_bug.cgi?id=235919 Reviewed by Darin Adler. Use more AtomString and moved code from header files to cpp files where appropriate. * dom/InlineClassicScript.cpp: (WebCore::InlineClassicScript::InlineClassicScript): * dom/InlineClassicScript.h: * dom/LoadableClassicScript.cpp: (WebCore::LoadableClassicScript::create): (WebCore::LoadableClassicScript::LoadableClassicScript): * dom/LoadableClassicScript.h: * dom/LoadableModuleScript.cpp: (WebCore::LoadableModuleScript::create): (WebCore::LoadableModuleScript::LoadableModuleScript): * dom/LoadableModuleScript.h: * dom/LoadableScript.h: (WebCore::LoadableScript::LoadableScript): * dom/ScriptElement.cpp: (WebCore::ScriptElement::ScriptElement): Call document() and scriptableDocumentParser() once. (WebCore::ScriptElement::requestClassicScript): (WebCore::ScriptElement::requestModuleScript): * dom/ScriptElementCachedScriptFetcher.h: (WebCore::ScriptElementCachedScriptFetcher::ScriptElementCachedScriptFetcher): 2022-02-01 Jer Noble [Cocoa] "index 0 out of bounds" exception in AVTrackPrivateAVFObjCImpl::videoTrackConfiguration() https://bugs.webkit.org/show_bug.cgi?id=235918 Reviewed by Eric Carlson. Crash data shows a rare exception thrown from inside a static method formatDescriptionFor() in AVTrackPrivateAVFObjCImpl. The method first queries whether the .formatDescriptions NSArray property is queryable, then for its count, then retrieves the first object in the array. It's possible that the array is mutated on a background thread between the count check and when the first object is retrieved. To eliminate the possibility that the property is mutated between queries, pull the value into a RetainPtr and run the query on that retained object. Use -[NSArray firstObject] rather than -objectAtIndex:0, as the former will return nil if the -count is 0, while the latter will throw an exception. To guard against the possibility that the CMFormatDescriptionRef will go out of scope after the return, return the format description itself wrapped in a RetainPtr as well. * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm: (WebCore::formatDescriptionFor): (WebCore::AVTrackPrivateAVFObjCImpl::codec const): (WebCore::AVTrackPrivateAVFObjCImpl::colorSpace const): (WebCore::AVTrackPrivateAVFObjCImpl::sampleRate const): (WebCore::AVTrackPrivateAVFObjCImpl::numberOfChannels const): 2022-02-01 Ada Chan [WebXR] Handle changes in XRSession's visibility state https://bugs.webkit.org/show_bug.cgi?id=235898 Reviewed by Sergio Villar Senin. Add a new method in WebXRSession for handling visibility state updates. When the session regains visibility and there are pending frame update requests, trigger a frame request. Also dispatch a visibilitychange event when the visibility state changes. * Modules/webxr/WebXRSession.cpp: (WebCore::WebXRSession::updateSessionVisibilityState): (WebCore::WebXRSession::onFrame): Bail early if the visibility state is hidden. * Modules/webxr/WebXRSession.h: * Modules/webxr/XRVisibilityState.h: * platform/xr/PlatformXR.h: * testing/WebFakeXRDevice.cpp: (WebCore::SimulatedXRDevice::setVisibilityState): (WebCore::WebFakeXRDevice::simulateVisibilityChange): * testing/WebFakeXRDevice.h: 2022-02-01 Eric Carlson [macOS] Expose screen and window capture state to WKWebView https://bugs.webkit.org/show_bug.cgi?id=235838 Reviewed by Youenn Fablet. Updated GetDisplayMediaWindowAndScreen API test. * Modules/mediastream/MediaDevices.cpp: (WebCore::toMediaDeviceInfoKind): Add SystemAudio. * Modules/mediastream/MediaStreamTrack.cpp: (WebCore::sourceCaptureState): Differentiate state of window and screen capture tracks. (WebCore::MediaStreamTrack::updateToPageMutedState): New. (WebCore::trackTypeForMediaProducerCaptureKind): (WebCore::trackMatchesKind): Deleted. * Modules/mediastream/MediaStreamTrack.h: * Modules/mediastream/UserMediaRequest.cpp: (WebCore::UserMediaRequest::mediaStreamDidFail): Include new source types. * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::addTrack): Ditto. (WebCore::LibWebRTCMediaEndpoint::createSourceAndRTCTrack): * page/MediaProducer.h: * platform/mediarecorder/MediaRecorderPrivate.cpp: (WebCore::MediaRecorderPrivate::selectTracks): Include new track types. * platform/mediastream/CaptureDevice.h: * platform/mediastream/RealtimeMediaSource.h: * platform/mediastream/cocoa/DisplayCaptureSourceCocoa.cpp: (WebCore::DisplayCaptureSourceCocoa::create): Ditto. * platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp: (WebCore::DisplayCaptureManagerCocoa::captureDeviceWithPersistentID): Ditto. * platform/mediastream/mac/ScreenCaptureKitCaptureSource.mm: * platform/mock/MockRealtimeMediaSourceCenter.cpp: * testing/Internals.cpp: (WebCore::Internals::pageMediaState): Update with new and changed type names. (WebCore::Internals::stopObservingRealtimeMediaSource): Include new track types. (WebCore::Internals::observeMediaStreamTrack): Ditto. 2022-02-01 Gabriel Nava Marino null ptr deref in LayoutIntegrationLineLayout LineLayout::adjustForPagination and LineLayout::visualOverflowBoundingBoxRectFor https://bugs.webkit.org/show_bug.cgi?id=235907 Reviewed by Antti Koivisto. m_inlineContent could become nullptr (such as after calling LineLayout::clearInlineContent()) so we add these nullptr checks to protect against an nullptr deref, in a similar way to how it's done in the other methods. Test: fast/layoutformattingcontext/visual-overflow-bounding-box-rect-crash.html * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::adjustForPagination): (WebCore::LayoutIntegration::LineLayout::visualOverflowBoundingBoxRectFor const): 2022-02-01 Philippe Normand [GStreamer] Update flags in internal GStreamer source and sink elements https://bugs.webkit.org/show_bug.cgi?id=235871 Reviewed by Xabier Rodriguez-Calvar. For custom source and sinks subclassing GstBin it's good practice to suppress SOURCE and SINK flags and to keep the subclass flags as matching the element type. * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp: (webKitWebAudioSrcConstructed): * platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp: (webKitGLVideoSinkConstructed): * platform/graphics/gstreamer/WebKitAudioSinkGStreamer.cpp: (webKitAudioSinkConstructed): (webkit_audio_sink_class_init): * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp: (webkitMediaStreamSrcConstructed): 2022-02-01 Philippe Normand [GStreamer] Support for vpx in webrtc encoder https://bugs.webkit.org/show_bug.cgi?id=235870 Reviewed by Xabier Rodriguez-Calvar. Add support for encoding to VP8 and VP9. The encoder is now available outside of the WebRTC backend, so that it can potentially be auto-plugged (which will be useful for the MediaRecorder support). In order to allow this metadata and pad templates were also added to the element. * platform/graphics/gstreamer/GStreamerCommon.cpp: (WebCore::registerWebKitGStreamerElements): * platform/mediastream/gstreamer/GStreamerVideoEncoder.cpp: (webkit_webrtc_video_encoder_class_init): 2022-02-01 Antoine Quint Redefining @keyframes does not work https://bugs.webkit.org/show_bug.cgi?id=229437 Reviewed by Antti Koivisto. Notify the document upon insertion of a new @keyframes rule such that any running CSS Animation using that rule name may update its computed keyframes. Test: imported/w3c/web-platform-tests/css/css-animations/animation-style-element-replaced-with-keyframes-rule-of-same-name.html * style/StyleResolver.cpp: (WebCore::Style::Resolver::addKeyframeStyle): 2022-02-01 Antoine Quint Animation from scale(0) has missing backing store https://bugs.webkit.org/show_bug.cgi?id=227733 Reviewed by Simon Fraser. Use the style recorded before we applied animations to this element the last time we resolved style for keyframes that don't set a value for the "transform" property. * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::computeExtentOfTransformAnimation const): 2022-02-01 Oriol Brufau [css-cascade] Fix removal of not yet loaded CSS @import https://bugs.webkit.org/show_bug.cgi?id=235930 Reviewed by Antti Koivisto. When removing a not yet loaded CSS @import, the hasPendingSheet() flag was not cleared. This resulted in a completely blank page. This patch makes sure to cancel the load before deleting the rule. Test: imported/w3c/web-platform-tests/css/css-cascade/import-removal.html * css/StyleRuleImport.cpp: (WebCore::StyleRuleImport::cancelLoad): * css/StyleRuleImport.h: * css/StyleSheetContents.cpp: (WebCore::StyleSheetContents::wrapperDeleteRule): 2022-02-01 Antti Koivisto AX: nullptr crash under AccessibilityRenderObject::computeAccessibilityIsIgnored https://bugs.webkit.org/show_bug.cgi?id=235945 rdar://88217815 Reviewed by Andres Gonzalez. This is similar to https://bugs.webkit.org/show_bug.cgi?id=161276. * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored const): m_renderer is a WeakPtr and can become null during parentObjectUnignored call, same as the case below. 2022-02-01 Carlos Garcia Campos Unreviewed. [GTK][WPE] Fix compile warning * accessibility/atspi/AccessibilityObjectAtspi.cpp: (WebCore::atspiRole): Add AccessibilityRole::Model to switch. 2022-02-01 Tim Nguyen Entirely remove support for -apple-trailing-word https://bugs.webkit.org/show_bug.cgi?id=234672 Reviewed by Simon Fraser. * css/CSSProperties.json: * css/CSSValueKeywords.in: 2022-01-31 Myles C. Maxfield Rename FontCascade::fontMetrics() and RenderStyle::fontMetrics() to fontMetricsOfPrimaryFont() https://bugs.webkit.org/show_bug.cgi?id=235938 Reviewed by Alan Bujtas. It's probably good to remind people that when they call this function, they might not be getting what they might think they're getting. No new tests because there is no behavior change. * css/CSSPrimitiveValue.cpp: (WebCore::CSSPrimitiveValue::computeNonCalcLengthDouble): (WebCore::CSSPrimitiveValue::equalForLengthResolution): * display/css/DisplayBoxPainter.cpp: (WebCore::Display::BoxPainter::paintBoxContent): * display/css/DisplayStyle.h: (WebCore::Display::Style::fontMetricsOfPrimaryFont const): (WebCore::Display::Style::fontMetrics const): Deleted. * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::createInnerTextStyle): * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::FontProxy::fontMetricsOfPrimaryFont const): (WebCore::CanvasRenderingContext2DBase::drawTextUnchecked): (WebCore::CanvasRenderingContext2DBase::measureTextInternal): (WebCore::CanvasRenderingContext2DBase::textOffset): (WebCore::CanvasRenderingContext2DBase::FontProxy::fontMetrics const): Deleted. * html/canvas/CanvasRenderingContext2DBase.h: * inspector/InspectorOverlay.cpp: (WebCore::InspectorOverlay::drawRulers): (WebCore::InspectorOverlay::drawElementTitle): (WebCore::expectedSizeForLayoutLabel): (WebCore::drawLayoutLabel): * layout/formattingContexts/inline/InlineFormattingQuirks.cpp: (WebCore::Layout::InlineFormattingQuirks::initialLineHeight const): * layout/formattingContexts/inline/InlineLevelBox.h: (WebCore::Layout::m_style): (WebCore::Layout::InlineLevelBox::preferredLineHeight const): (WebCore::Layout::InlineLevelBox::primaryfontMetricsOfPrimaryFont const): (WebCore::Layout::InlineLevelBox::primaryFontMetrics const): Deleted. * layout/formattingContexts/inline/InlineLineBox.cpp: (WebCore::Layout::LineBox::logicalRectForTextRun const): * layout/formattingContexts/inline/InlineLineBoxBuilder.cpp: (WebCore::Layout::LineBoxBuilder::setVerticalGeometryForLineBreakBox const): (WebCore::Layout::LineBoxBuilder::setInitialVerticalGeometryForInlineBox const): * layout/formattingContexts/inline/InlineLineBoxVerticalAligner.cpp: (WebCore::Layout::LineBoxVerticalAligner::computeLineBoxLogicalHeight const): (WebCore::Layout::LineBoxVerticalAligner::computeRootInlineBoxVerticalPosition const): (WebCore::Layout::LineBoxVerticalAligner::alignInlineLevelBoxes const): * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::floatWidthForSimpleText const): (WebCore::FontCascade::floatWidthForComplexText const): * platform/graphics/FontCascade.h: (WebCore::FontCascade::fontMetricsOfPrimaryFont const): (WebCore::FontCascade::fontMetrics const): Deleted. * rendering/CaretRectComputation.cpp: (WebCore::computeCaretRectForEmptyElement): (WebCore::computeCaretRectForBox): * rendering/LegacyEllipsisBox.cpp: (WebCore::LegacyEllipsisBox::paint): (WebCore::LegacyEllipsisBox::paintMarkupBox): (WebCore::LegacyEllipsisBox::nodeAtPoint): * rendering/LegacyInlineBox.cpp: (WebCore::LegacyInlineBox::logicalHeight const): * rendering/LegacyInlineFlowBox.cpp: (WebCore::LegacyInlineFlowBox::addToLine): (WebCore::placeChildInlineBoxesInBlockDirection): (WebCore::LegacyInlineFlowBox::placeBoxesInBlockDirection): * rendering/LegacyLineLayout.cpp: (WebCore::setLogicalWidthForTextRun): * rendering/LegacyRootInlineBox.cpp: (WebCore::LegacyRootInlineBox::lineSnapAdjustment const): (WebCore::LegacyRootInlineBox::ascentAndDescentForBox const): (WebCore::LegacyRootInlineBox::verticalPositionForBox): * rendering/RenderBlock.cpp: (WebCore::RenderBlock::baselinePosition const): (WebCore::RenderBlock::inlineBlockBaseline const): * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::adjustInitialLetterPosition): (WebCore::RenderBlockFlow::firstLineBaseline const): (WebCore::RenderBlockFlow::inlineBlockBaseline const): * rendering/RenderEmbeddedObject.cpp: (WebCore::RenderEmbeddedObject::paintReplaced): * rendering/RenderImage.cpp: (WebCore::RenderImage::setImageSizeForAltText): (WebCore::RenderImage::paintReplaced): * rendering/RenderInline.cpp: (WebCore::RenderInline::mayAffectLayout const): (WebCore::RenderInline::baselinePosition const): * rendering/RenderLineBreak.cpp: (WebCore::RenderLineBreak::baselinePosition const): * rendering/RenderListBox.cpp: (WebCore::itemOffsetForAlignment): (WebCore::RenderListBox::itemHeight const): * rendering/RenderListMarker.cpp: (WebCore::RenderListMarker::paint): (WebCore::RenderListMarker::layout): (WebCore::RenderListMarker::updateContent): (WebCore::RenderListMarker::computePreferredLogicalWidths): (WebCore::RenderListMarker::updateMargins): (WebCore::RenderListMarker::relativeMarkerRect): * rendering/RenderRubyRun.cpp: (WebCore::RenderRubyRun::layoutBlock): * rendering/TextBoxPainter.cpp: (WebCore::TextBoxPainter::paintForeground): (WebCore::TextBoxPainter::paintCompositionUnderline): (WebCore::TextBoxPainter::calculateDocumentMarkerBounds): (WebCore::TextBoxPainter::textOriginFromPaintRect const): * rendering/TextDecorationPainter.cpp: (WebCore::TextDecorationPainter::paintBackgroundDecorations): (WebCore::TextDecorationPainter::paintForegroundDecorations): (WebCore::TextDecorationPainter::paintLineThrough): * rendering/TextPainter.cpp: (WebCore::TextPainter::paintTextAndEmphasisMarksIfNeeded): * rendering/line/LineInlineHeaders.h: (WebCore::requiresLineBoxForContent): * rendering/mathml/RenderMathMLBlock.cpp: (WebCore::axisHeight): (WebCore::toUserUnits): * rendering/mathml/RenderMathMLRoot.cpp: (WebCore::RenderMathMLRoot::verticalParameters): * rendering/mathml/RenderMathMLScripts.cpp: (WebCore::RenderMathMLScripts::verticalParameters const): * rendering/mathml/RenderMathMLUnderOver.cpp: (WebCore::RenderMathMLUnderOver::verticalParameters const): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::fontMetricsOfPrimaryFont const): (WebCore::RenderStyle::computeLineHeight const): (WebCore::RenderStyle::fontMetrics const): Deleted. * rendering/style/RenderStyle.h: * rendering/svg/RenderSVGInlineText.cpp: (WebCore::RenderSVGInlineText::positionForPoint): * rendering/svg/SVGInlineTextBox.cpp: (WebCore::SVGInlineTextBox::selectionRectForTextFragment const): (WebCore::SVGInlineTextBox::paintDecorationWithStyle): (WebCore::SVGInlineTextBox::paintTextWithShadows): (WebCore::SVGInlineTextBox::calculateBoundaries const): (WebCore::SVGInlineTextBox::nodeAtPoint): * rendering/svg/SVGTextLayoutEngineBaseline.cpp: (WebCore::SVGTextLayoutEngineBaseline::calculateBaselineShift const): (WebCore::SVGTextLayoutEngineBaseline::calculateAlignmentBaselineShift const): (WebCore::SVGTextLayoutEngineBaseline::calculateGlyphAdvanceAndOrientation const): * rendering/svg/SVGTextMetrics.cpp: (WebCore::SVGTextMetrics::SVGTextMetrics): * rendering/svg/SVGTextQuery.cpp: (WebCore::calculateGlyphBoundaries): * rendering/updating/RenderTreeBuilderFirstLetter.cpp: (WebCore::styleForFirstLetter): * style/InlineTextBoxStyle.cpp: (WebCore::visualOverflowForDecorations): * style/StyleResolveForFontRaw.cpp: (WebCore::Style::resolveForFontRaw): * svg/SVGLengthContext.cpp: (WebCore::SVGLengthContext::convertValueFromUserUnitsToEXS const): (WebCore::SVGLengthContext::convertValueFromEXSToUserUnits const): 2022-01-31 Brent Fulgham Fix handling of access key events https://bugs.webkit.org/show_bug.cgi?id=234147 Reviewed by David Kilzer. Improve focus handling for HTMLElement-based elements to ensure accessKey events are properly dispatched. * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::press): Ensure correct object is used after 'accessKeyAction' is invoked. * dom/EventDispatcher.cpp: (WebCore::callDefaultEventHandlersInBubblingOrder) Protect element during default event bubbling. * html/HTMLFormControlElement.cpp: (WebCore::HTMLFormControlElement::reportValidity): Ensure correct element is used after focus event. * page/EventHandler.cpp: (WebCore::EventHandler::handleAccessKey): Ensure correct object is used after 'accessKeyAction' is invoked. 2022-01-31 Said Abou-Hallawa [GPU Process] Pattern should hold SourceImage which can be converted to a NativeImage only when needed https://bugs.webkit.org/show_bug.cgi?id=232411 Reviewed by Darin Adler. Make Pattern hold a SourceImage and add getters to retrieve a NativeImage and an ImageBuffer. In these getters the SourceImage will either return the current image source or get one from the other if needed. * html/canvas/CanvasPattern.cpp: (WebCore::CanvasPattern::create): (WebCore::CanvasPattern::CanvasPattern): * html/canvas/CanvasPattern.h: * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::createPattern): * inspector/InspectorCanvas.cpp: (WebCore::InspectorCanvas::buildArrayForCanvasPattern): * platform/graphics/NativeImage.h: Make NativeImage a thread-safe RefCounted and make its destruction happen on the main thread. This is similar to what we do for ImageBuffer. And the reason for this is the message handler in the GPUProcess may create NativeImages on the main thread as the SourceImages for the Patterns of the SetState item. These NativeImages will be deleted in the replaying thread after applying the SetState item. * platform/graphics/Pattern.cpp: (WebCore::Pattern::create): (WebCore::Pattern::Pattern): * platform/graphics/Pattern.h: (WebCore::Pattern::encode const): (WebCore::Pattern::decode): Add encoding and decoding mehods for Pattern which will be called from SetState::encode() and SetState::decode(). * platform/graphics/SourceImage.cpp: (WebCore::SourceImage::nativeImage const): (WebCore::SourceImage::imageBuffer const): (WebCore::SourceImage::size const): (WebCore::SourceImage::nativeImage): Deleted. (WebCore::SourceImage::imageBuffer): Deleted. * platform/graphics/SourceImage.h: Make SourceImage keep the image source it was created with. Get a temporary image source if it is different from what is stored in m_imageVariant. * platform/graphics/cairo/PatternCairo.cpp: (WebCore::Pattern::createPlatformPattern const): * platform/graphics/cg/PatternCG.cpp: (WebCore::Pattern::createPlatformPattern const): * platform/graphics/displaylists/DisplayListItems.cpp: (WebCore::DisplayList::SetState::SetState): (WebCore::DisplayList::SetState::apply): * platform/graphics/displaylists/DisplayListItems.h: (WebCore::DisplayList::SetState::stateChange): (WebCore::DisplayList::SetState::encode const): (WebCore::DisplayList::SetState::decode): (WebCore::DisplayList::SetState::strokePatternParameters const): Deleted. (WebCore::DisplayList::SetState::fillPatternParameters const): Deleted. (WebCore::DisplayList::SetState::strokePatternImageIdentifier const): Deleted. (WebCore::DisplayList::SetState::fillPatternImageIdentifier const): Deleted. Simplify SetState by deleting the PatternData members. Replace these members by the strokePattern and fillPattern since these patterns can be encoded and decoded. * platform/graphics/displaylists/DisplayListReplayer.cpp: (WebCore::DisplayList::applySetStateItem): * platform/graphics/displaylists/DisplayListResourceHeap.h: Add the helper LocalResourceHeap::getSourceImage() to be used by applySetStateItem(). * platform/graphics/filters/software/FETileSoftwareApplier.cpp: (WebCore::FETileSoftwareApplier::apply const): * rendering/RenderLayerBacking.cpp: (WebCore::patternForDescription): * rendering/svg/RenderSVGResourcePattern.cpp: (WebCore::RenderSVGResourcePattern::buildPattern): 2022-01-31 Andres Gonzalez Add to AXLogger the ability to log only from the specified thread. https://bugs.webkit.org/show_bug.cgi?id=235843 Reviewed by Chris Fleizach. No change in functionality, debugging code. Determine whether to log messages for the invoking thread based on the value of a static hardcoded variable. It makes figuring out the flow of method calls and messages when you can log only from the main thread, off the main thread, or the combination. * accessibility/AXLogger.cpp: (WebCore::shouldLog): (WebCore::AXLogger::AXLogger): (WebCore::AXLogger::~AXLogger): (WebCore::AXLogger::log): (WebCore::AXLogger::add): (WebCore::operator<<): * accessibility/AXLogger.h: 2022-01-31 Ryosuke Niwa Delete runtime flag for subresource integrity https://bugs.webkit.org/show_bug.cgi?id=235876 Reviewed by Darin Adler. * dom/ScriptElement.cpp: (WebCore::ScriptElement::requestClassicScript): (WebCore::ScriptElement::requestModuleScript): * html/HTMLLinkElement.cpp: (WebCore::HTMLLinkElement::process): * html/HTMLLinkElement.idl: * html/HTMLScriptElement.idl: 2022-01-31 Antti Koivisto LineLayout::collectOverflow() should null check m_inlineContent https://bugs.webkit.org/show_bug.cgi?id=235902 rdar://87402815 Reviewed by Alan Bujtas. Speculative fix but it can be null. * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::collectOverflow): 2022-01-31 Takeshi Sone Changed playbackRate and defaultPlaybackRate from unrestricted double to double. https://bugs.webkit.org/show_bug.cgi?id=235174 rdar://problem/87815745 Reviewed by Eric Carlson. Test: media/video-playbackrate-undefined.html * html/HTMLMediaElement.idl: 2022-01-31 Asumu Takikawa Fix handling of module script errors in WebCore https://bugs.webkit.org/show_bug.cgi?id=218284 Reviewed by Yusuke Suzuki. According to the HTML spec, script fetch errors get dispatched to the script (with no error value), but load errors should get reported to the global object and dispatched with an error value included. This patch implements that behavior for module scripts. In addition, reported errors from module scripts are never expected to be muted. To implement this, we add a fromModule flag to suppress the error muting in canIncludeErrorDetails. * bindings/js/JSDOMExceptionHandling.cpp: (WebCore::reportException): * bindings/js/JSDOMExceptionHandling.h: * bindings/js/ModuleFetchFailureKind.h: * bindings/js/ScriptController.cpp: (WebCore::ScriptController::evaluateInWorld): (WebCore::ScriptController::setupModuleScriptHandlers): (WebCore::ScriptController::callInWorld): (WebCore::ScriptController::reportExceptionFromScriptError): * bindings/js/ScriptController.h: * bindings/js/ScriptModuleLoader.cpp: (WebCore::rejectWithFetchError): (WebCore::ScriptModuleLoader::fetch): (WebCore::rejectPromise): (WebCore::ScriptModuleLoader::notifyFinished): * dom/LoadableClassicScript.cpp: (WebCore::LoadableClassicScript::error const): (WebCore::LoadableClassicScript::notifyFinished): * dom/LoadableScript.h: * dom/ScriptElement.cpp: (WebCore::ScriptElement::executeScriptAndDispatchEvent): * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::canIncludeErrorDetails): (WebCore::ScriptExecutionContext::reportException): (WebCore::ScriptExecutionContext::dispatchErrorEvent): * dom/ScriptExecutionContext.h: * workers/WorkerOrWorkletScriptController.cpp: (WebCore::WorkerOrWorkletScriptController::loadModuleSynchronously): (WebCore::WorkerOrWorkletScriptController::loadAndEvaluateModule): 2022-01-31 Per Arne Vollan [iOS][WP] Restrict image decoders https://bugs.webkit.org/show_bug.cgi?id=234175 Reviewed by Brent Fulgham. Enable restriced decoding for images. * platform/graphics/cg/ImageDecoderCG.cpp: (WebCore::createImageSourceOptions): 2022-01-31 J Pascoe [WebAuthn] Provide SPI to export/import local credentials https://bugs.webkit.org/show_bug.cgi?id=234112 rdar://84822000 Reviewed by Brent Fulgham. This change adds SPI to _WKWebAuthenticationPanel to provide the ability to import / export local credentials. Constants are used during serialization as keys. * Modules/webauthn/WebAuthenticationConstants.h: constants for credential serialization 2022-01-31 Antti Koivisto [CSS Container Queries] Check for query containers when matching rules https://bugs.webkit.org/show_bug.cgi?id=235881 Reviewed by Antoine Quint. Skip rules inside container queries when there are no container ancestors. * style/ElementRuleCollector.cpp: (WebCore::Style::ElementRuleCollector::collectMatchingRulesForList): (WebCore::Style::ElementRuleCollector::containerQueryMatches): Add the matching function. This patch doesn't yet do any actual container query matching, it just checks if we are inside a query container. * style/ElementRuleCollector.h: * style/RuleSet.h: (WebCore::Style::RuleSet::containerQueryFor const): * style/SelectorMatchingState.h: Add the container stack. * style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::popParent): (WebCore::Style::TreeResolver::resolveComposedTree): (WebCore::Style::TreeResolver::updateQueryContainer): Maintain the container stack. * style/StyleTreeResolver.h: 2022-01-31 Carlos Garcia Campos [GTK][a11y] WTR: use AXMenuItemSelected for menu item selection change with ATSPI https://bugs.webkit.org/show_bug.cgi?id=235890 Reviewed by Adrian Perez de Castro. ATSPI uses selection-changed signal for both combo box menus and list boxes, but layout tests expect then to be different events AXMenuItemSelected and AXSelectedChildrenChanged. * accessibility/atspi/AccessibilityAtspi.cpp: (WebCore::AccessibilityAtspi::selectionChanged): Call notifyMenuSelectionChanged() for menus. (WebCore::AccessibilityAtspi::notifyMenuSelectionChanged const): Emit AXMenuItemSelected. * accessibility/atspi/AccessibilityAtspi.h: 2022-01-31 Carlos Garcia Campos [GTK][a11y] Add support for password fields to ATSPI https://bugs.webkit.org/show_bug.cgi?id=235778 Reviewed by Adrian Perez de Castro. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::postTextStateChangeNotification): Do not return early for password entries. * accessibility/atspi/AccessibilityObjectAtspi.cpp: (WebCore::AccessibilityObjectAtspi::effectiveRole const): Return PasswordText role for password fields. (WebCore::AccessibilityObjectAtspi::effectiveRoleName const): Ditto. (WebCore::AccessibilityObjectAtspi::effectiveLocalizedRoleName const): Ditto. (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const): Ignore text control inner text elements. * accessibility/atspi/AccessibilityObjectTextAtspi.cpp: (WebCore::AccessibilityObjectAtspi::textInserted): Expose the rendered text in case of password field. * html/HTMLTextFormControlElement.cpp: (WebCore::HTMLTextFormControlElement::setInnerTextValue): Ditto. 2022-01-30 Yusuke Suzuki [WTF] Add GenericHashKey https://bugs.webkit.org/show_bug.cgi?id=235872 Reviewed by Darin Adler. No behavior change. We should use StdMap. This should be StdMap since it requires ordered iterations by the key, so it should not be a HashMap. * platform/graphics/avfoundation/objc/QueuedVideoOutput.h: 2022-01-30 Ryosuke Niwa Delete code for keygen element https://bugs.webkit.org/show_bug.cgi?id=235867 Reviewed by Antti Koivisto and Darin Adler. Deleted most of code for keygen since it has been always disabled for a while but preserve the HTML tree builder behavior for compatibility purposes as required by the HTML5 specification. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Headers.cmake: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: Also remove the entry for HTMLSlotElement which is no longer used since the runtime flag for enabling shadow DOM had been removed. * css/html.css: * css/legacyFormControlsIOS.css: * css/themeWin.css: * editing/MarkupAccumulator.cpp: (WebCore::elementCannotHaveEndTag): * html/HTMLKeygenElement.cpp: Removed. * html/HTMLKeygenElement.h: Removed. * html/HTMLKeygenElement.idl: Removed. * html/HTMLTagNames.in: * html/shadow/ShadowPseudoIds.cpp: (WebCore::ShadowPseudoIds::webkitKeygenSelect): Deleted. * html/shadow/ShadowPseudoIds.h: * mathml/MathMLPresentationElement.cpp: (WebCore::MathMLPresentationElement::isPhrasingContent): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setKeygenElementEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::keygenElementEnabled const): Deleted. 2022-01-30 Ryosuke Niwa Delete runtime preference for enabling input events https://bugs.webkit.org/show_bug.cgi?id=235864 Reviewed by Wenson Hsieh. * dom/InputEvent.idl: * editing/Editor.cpp: 2022-01-30 Alan Bujtas (REGRESSION)[IFC][RTL] wpt/css/css-text/white-space/trailing-space-and-text-alignment-rtl-003.html https://bugs.webkit.org/show_bug.cgi?id=235823 Reviewed by Antti Koivisto. Reset the trailing whitespace bidi level before handing them over to visual reordering. see https://unicode.org/reports/tr9/#L1 "L1. On each line, reset the embedding level of the following characters to the paragraph embedding level: ... Any sequence of whitespace characters ... at the end of the line." It ensures that
AB C
and
AB
both have the trailing whitespace positioned _visually_ as trailing (and not leading) content. After the bidi paragraph processing "AB C" gets a uniform bidi level of 2, while "AB " is split into "AB" and " " with bidi levels of 2 and 1 respectively. In the latter case, the difference in bidi levels makes the runs flip visually at reordering. It makes the trailing whitespace "pushed" to the left side of the "AB" making it _visually_ trailing (the content renders as " AB"). However in case of "AB C" with the line breaking position after " ", we would end up with a single run of "AB " with the bidi level of 2. This run would render as "AB " turning the trailing whitespace into a _visually_ leading whitespace. In this patch we ensure that the trailing (non-collapsible) whitespace runs 1. are detached from their adjoining non-whitespace text runs and 2. they get their bidi levels reset Test: fast/text/rtl-pre-wrap-hanging-offset.html * layout/formattingContexts/inline/display/InlineDisplayLineBuilder.cpp: (WebCore::Layout::InlineDisplayLineBuilder::build const): 2022-01-30 Alan Bujtas [LFC][IFC] Do not break content at an inline box boundary https://bugs.webkit.org/show_bug.cgi?id=235868 Reviewed by Antti Koivisto. Handle nested inline boxes, when the breaking position is between at an inline box boundary. e.g.
this_content_overflow
while the breaking position is between the 3rd and the letter 't', we should not let the first line have all the content only, but instead find a more reasonable breaking position by looking at the previous runs. This patch expands "findTrailingRunIndex" to find multiple, subsequent (nested) inline boxes. Test: fast/inline/nested-inline-box-with-word-break.html * layout/formattingContexts/inline/InlineContentBreaker.cpp: (WebCore::Layout::findTrailingRunIndex): 2022-01-30 Philippe Normand [GStreamer] GstStructure to JSON serialization https://bugs.webkit.org/show_bug.cgi?id=235760 Reviewed by Xabier Rodriguez-Calvar. For GstWebRTC stats logging purposes JSON is a good payload format. As the stats are initially notified via GstStructures we need a way to export those to JSON, using a new API in GStreamerCommon. Covered by API tests. * platform/graphics/gstreamer/GStreamerCommon.cpp: (WebCore::structureValueToJSON): (WebCore::parseStructureValue): (WebCore::structureToJSON): (WebCore::structureToJSONString): * platform/graphics/gstreamer/GStreamerCommon.h: 2022-01-29 Ryosuke Niwa Delete runtime preference for enabling request animation frame https://bugs.webkit.org/show_bug.cgi?id=235866 Reviewed by Darin Adler. * dom/ScriptedAnimationController.cpp: (WebCore::ScriptedAnimationController::serviceRequestAnimationFrameCallbacks): (WebCore::ScriptedAnimationController::scheduleAnimation): (WebCore::ScriptedAnimationController::requestAnimationFrameEnabled const): Deleted. * dom/ScriptedAnimationController.h: (WebCore::ScriptedAnimationController::clearDocumentPointer): * workers/WorkerAnimationController.cpp: (WebCore::WorkerAnimationController::scheduleAnimation): (WebCore::WorkerAnimationController::serviceRequestAnimationFrameCallbacks): 2022-01-29 Alexey Shvayka [WebIDL] Add a sensible error message for a primitive non-null EventListener https://bugs.webkit.org/show_bug.cgi?id=235863 Reviewed by Darin Adler. This patch moves isObject() check to JSEventListener converter, aligning it with callback interface converter and removing now unused create() overload, and makes code generator pass an exception thrower with a user-friendly TypeError message. Since JSEventListener is quite different from other callback interfaces, we can't make IsCallbackInterface() recognize it just yet, thus the type name has to be hard-coded if we want the error message to be consistent with other generated ones. Test: fast/events/event-listener-not-an-object.html * bindings/js/JSDOMConvertEventListener.h: (WebCore::Converter>::convert): * bindings/js/JSEventListener.cpp: * bindings/js/JSEventListener.h: * bindings/scripts/CodeGeneratorJS.pm: (GetArgumentExceptionFunction): * bindings/scripts/test/JS/*: Updated. * dom/EventTarget.idl: Rename EventListener parameter to "listener" to match MDN / Chrome DevTools / matchMedia(). 2022-01-29 Ryosuke Niwa Delete EventQueue.h https://bugs.webkit.org/show_bug.cgi?id=235862 Reviewed by Wenson Hsieh. Deleted the useless header file. * Headers.cmake: * Modules/indexeddb/IDBDatabase.cpp: * Modules/indexeddb/IDBRequest.cpp: * Modules/indexeddb/IDBTransaction.cpp: * WebCore.xcodeproj/project.pbxproj: * dom/EventQueue.h: Removed. 2022-01-29 Ryosuke Niwa Delete most code for beforeload event https://bugs.webkit.org/show_bug.cgi?id=234804 Reviewed by Antti Koivisto. Delete code for beforeload event as the event has been disabled successfully in r261946. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: * dom/BeforeLoadEvent.cpp: Removed. * dom/BeforeLoadEvent.h: Removed. * dom/BeforeLoadEvent.idl: Removed. * dom/Document.cpp: (WebCore::Document::addListenerTypeIfNeeded): * dom/Document.h: * dom/EventNames.in: * dom/Node.cpp: (WebCore::Node::dispatchBeforeLoadEvent): Deleted. * dom/Node.h: * dom/ProcessingInstruction.cpp: (WebCore::ProcessingInstruction::checkStyleSheet): m_isHandlingBeforeLoad is never true. * dom/ProcessingInstruction.h: * dom/ScriptElement.cpp: (WebCore::ScriptElement::requestClassicScript): dispatchBeforeLoadEvent always returned true when beforeload event is disabled, and the element is always connected here. (WebCore::ScriptElement::requestModuleScript): Ditto. * html/HTMLEmbedElement.cpp: (WebCore::HTMLEmbedElement::updateWidget): Deleted the no-op code. * html/HTMLLinkElement.cpp: (WebCore::HTMLLinkElement::shouldLoadLink): * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::selectMediaResource): (WebCore::HTMLMediaElement::selectNextSourceChild): * html/HTMLObjectElement.cpp: (WebCore::HTMLObjectElement::updateWidget): * html/HTMLPlugInElement.cpp: (WebCore::HTMLPlugInElement::guardedDispatchBeforeLoadEvent): Deleted. (WebCore::HTMLPlugInElement::pluginWidget const): m_inBeforeLoadEventHandler is never true. * html/HTMLPlugInElement.h: * html/HTMLTrackElement.cpp: (WebCore::HTMLTrackElement::canLoadURL): * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadWithDocumentLoader): Deleted the no-op code. * loader/ImageLoader.cpp: (WebCore::ImageLoader::updateFromElement): Document will never have beforeload event listener but keep the call to dispatchPendingBeforeLoadEvent since we depend on it updating renderer. (WebCore::ImageLoader::dispatchPendingBeforeLoadEvent): Keep the only side effect left which is to update the renderer. * loader/ImageLoader.h: * page/Settings.yaml: Deleted the option to enable beforeload event. 2022-01-29 Patrick Griffis CSP: Properly block image content in object elements https://bugs.webkit.org/show_bug.cgi?id=235837 Reviewed by Kate Cheney. When an image is loaded through an object element it now passes through the object-src directive check as the spec documents: https://www.w3.org/TR/CSP3/#directive-object-src * loader/ImageLoader.cpp: (WebCore::ImageLoader::updateFromElement): * loader/ResourceLoaderOptions.h: (WebCore::ResourceLoaderOptions::loadedFromPluginElement): (WebCore::ResourceLoaderOptions::ResourceLoaderOptions): (WebCore::ResourceLoaderOptions::loadedFromOpaqueSource): Deleted. * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::allowedByContentSecurityPolicy const): * page/csp/ContentSecurityPolicy.cpp: (WebCore::ContentSecurityPolicy::allowObjectFromSource const): * page/csp/ContentSecurityPolicy.h: 2022-01-29 Tyler Wilcock AX: Isolated tree objects don't update their AXPropertyName::ElementRect or AXPropertyName::BoundingBoxRect in response to dynamic page changes https://bugs.webkit.org/show_bug.cgi?id=235833 Reviewed by Chris Fleizach. Because isolated tree objects don't update their AXPropertyName::ElementRect or AXPropertyName::BoundingBoxRect anytime after AXIsolatedObject::initializeAttributeData, any dynamic page change that causes the element to move or change size will result in the isolated AX object holding out-of-date values for these properties. This patch remedies this deferring to the live, main-thread AX object when serving elementRect and boundingBoxRect. Test: accessibility/dynamic-changes-update-position.html * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::initializeAttributeData): Stop caching the now removed properties AXPropertyName::ElementRect and AXPropertyName::BoundingBoxRect. (WebCore::AXIsolatedObject::boundingBoxRect const): (WebCore::AXIsolatedObject::elementRect const): Retrieve these values from the main-thread instead of the now removed AXPropertyName::ElementRect and AXPropertyName::BoundingBoxRect. * accessibility/isolatedtree/AXIsolatedObject.h: * accessibility/isolatedtree/AXIsolatedTree.h: Remove AXPropertyName::ElementRect and AXPropertyName::BoundingBoxRect. 2022-01-29 Philippe Normand [LibWebRTC] ifdef cleanups https://bugs.webkit.org/show_bug.cgi?id=235858 Reviewed by Youenn Fablet. ENABLE(WEB_RTC) does not necessarily imply USE(LIBWEBRTC), so guard libwebrtc-specific files with explicit USE(LIBWEBRTC) ifdefs. * Modules/mediastream/STUNMessageParsing.cpp: * Modules/mediastream/libwebrtc/LibWebRTCDtlsTransportBackend.h: * Modules/mediastream/libwebrtc/LibWebRTCIceTransportBackend.h: * Modules/mediastream/libwebrtc/LibWebRTCSctpTransportBackend.h: * platform/mediastream/libwebrtc/LibWebRTCDTMFSenderBackend.cpp: * platform/mediastream/libwebrtc/LibWebRTCDTMFSenderBackend.h: 2022-01-29 Kimmo Kinnunen Capturing WebGL canvas through peer connection shows the image flipped https://bugs.webkit.org/show_bug.cgi?id=235600 Reviewed by Dean Jackson. Mirror and rotate the WebGL image at the source since WebRTC does not support mirroring. Test: webrtc/canvas-to-peer-connection.html * platform/graphics/cocoa/GraphicsContextGLCocoa.h: * platform/graphics/cocoa/GraphicsContextGLCocoa.mm: (WebCore::GraphicsContextGLCocoa::paintCompositedResultsToMediaSample): * platform/graphics/cocoa/IOSurface.h: * platform/graphics/cocoa/IOSurface.mm: (WebCore::IOSurface::setOwnershipIdentity): * platform/graphics/cv/CVUtilities.h: * platform/graphics/cv/CVUtilities.mm: (WebCore::setOwnershipIdentityForCVPixelBuffer): 2022-01-28 Antti Koivisto [CSS container Queries] Include container queries in RuleSets https://bugs.webkit.org/show_bug.cgi?id=235763 Reviewed by Simon Fraser. Build the data structures in RuleSets. They are not yet used, all queries behave as if they match. * style/RuleSet.cpp: (WebCore::Style::RuleSet::addRule): * style/RuleSet.h: * style/RuleSetBuilder.cpp: (WebCore::Style::RuleSetBuilder::addChildRules): (WebCore::Style::RuleSetBuilder::addStyleRule): * style/RuleSetBuilder.h: 2022-01-28 Diego Pino Garcia [WPE] Unreviewed, fix non-unified build after r288759 https://bugs.webkit.org/show_bug.cgi?id=235853 * Modules/webaudio/AudioWorkletNode.cpp: 2022-01-28 Myles C. Maxfield REGRESSION(r281687): Space widths have synthetic bold applied to them in the fast text codepath but not the complex text codepath https://bugs.webkit.org/show_bug.cgi?id=235755 Reviewed by Simon Fraser. r281687 made Font::widthForGlyph() return the non-synthetically-expanded width, instead of the synthetically-expanded width. I think this is philosophically correct, because Font::widthForGlyph() is called before shaping, and shaping requires the original width. If some custom code is asking for the width of specific characters without going through WidthIterator or ComplexTextController, that code needs to determine whether or not it's going to run shaping, and thus when it should be adding in the synthetic offset. adjustGlyphsAndAdvances() used to subtract out the synthetic offset because it was expecting Font::widthForGlyph() to return the already-expanded width. So, the solution is just stop subtracting the offset, because it hasn't been applied in the first place. Test: imported/w3c/web-platform-tests/css/css-fonts/synthetic-bold-space-width.html * platform/graphics/ComplexTextController.cpp: (WebCore::ComplexTextController::adjustGlyphsAndAdvances): * platform/graphics/Font.h: 2022-01-28 Nikolaos Mouchtaris Implement CSS overscroll-behavior for asynchronous scroll on Mac https://bugs.webkit.org/show_bug.cgi?id=220139 Reviewed by Simon Fraser. Split up patch by Cathie Chen and Frederic Wang. Add function for blocking scroll chaining and filtering scroll delta depending on the values of overscroll behavior for a scrolling node. This patch is for asynchronous scrolling only. Tests: fast/scrolling/mac/async-overscroll-behavior-element.html fast/scrolling/mac/async-overscroll-behavior-iframe.html fast/scrolling/mac/async-overscroll-behavior-unscrollable-element.html fast/scrolling/mac/async-overscroll-behavior-unscrollable-iframe.html * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::shouldBlockScrollChainingWithNode): (WebCore::ScrollingTree::handleWheelEventWithNode): * page/scrolling/ScrollingTree.h: * page/scrolling/ScrollingTreeScrollingNode.h: * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm: (WebCore::ScrollingTreeScrollingNodeDelegateMac::allowsHorizontalStretching const): (WebCore::ScrollingTreeScrollingNodeDelegateMac::allowsVerticalStretching const): * rendering/RenderLayerCompositor.cpp: (WebCore::recompositeChangeRequiresGeometryUpdate): (WebCore::RenderLayerCompositor::rootOrBodyStyleChanged): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::changeRequiresRecompositeLayer const): 2022-01-28 Tyler Wilcock AX: AccessibilitySlider::inputElement should check if the renderer has become null https://bugs.webkit.org/show_bug.cgi?id=235827 Reviewed by Chris Fleizach. After https://bugs.webkit.org/show_bug.cgi?id=235715, we no longer call the update version of children() from logging. This has made accessibility/mac/spinbutton-valuedescription.html a constant failure in debug mode only, since the logging is trying to print an AX tree that is out of sync with the DOM. This test uses JS to remove an `` renderer + node. Fixes accessibility/mac/spinbutton-valuedescription.html in debug. * accessibility/AccessibilitySlider.cpp: (WebCore::AccessibilitySlider::inputElement const): Null check m_renderer before using it. (WebCore::AccessibilitySlider::getAttribute const): (WebCore::AccessibilitySlider::valueForRange const): (WebCore::AccessibilitySlider::maxValueForRange const): (WebCore::AccessibilitySlider::minValueForRange const): Null check the result of inputElement() before dereferencing it. 2022-01-28 Michael Saboff Catalyst builds for WebCore and WebKitLegacy don't create proper symlinks for builds with system content path https://bugs.webkit.org/show_bug.cgi?id=235839 Reviewed by Saam Barati. Fixed ALTERNATE_ROOT_PATH to have a proper path for Catalyst builds, but not for normal macOS builds since they are under WebKit.framework. * Configurations/WebCore.xcconfig: 2022-01-28 Alexey Shvayka Remove showModalDialog-specific logic from JSDOMWindow::getOwnPropertySlot() https://bugs.webkit.org/show_bug.cgi?id=234282 Reviewed by Yusuke Suzuki. This change removes showModalDialog-specific logic from JSDOMWindow::getOwnPropertySlot() in favor of a setter-less CustomValue property on `window`, which returns a function only if modals are allowed, and can be overriden by userland code. Since we need to support setCanRunModal(true) being called after DOMWindow is initialized, [EnabledByQuirk] and friends could not be used. However, once the function was exposed, there is no point in hiding it, so the CustomValue getter replaces itself with a regular data property to preserve function's identity (covered by fast/dom/wrapper-identity.html). The patch makes JSDOMWindow's getOwnPropertySlot() consistent with its getOwnPropertyNames() regarding the presence of "showModalDialog" property, and fixes JSDOMWindow::getOwnPropertySlot() being ignored by LLInt when accessing "showModalDialog" from scope, which resulted in exposing the function even if modals were disallowed. Test: fast/dom/Window/forbid-showModalDialog.html * bindings/js/JSDOMWindowBase.cpp: (WebCore::JSDOMWindowBase::finishCreation): * bindings/js/JSDOMWindowCustom.cpp: (WebCore::JSDOMWindow::getOwnPropertySlot): (WebCore::JSC_DEFINE_CUSTOM_GETTER): (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::JSDOMWindow::showModalDialog): Deleted. * bindings/js/JSDOMWindowCustom.h: * page/DOMWindow.idl: 2022-01-28 Chris Dumez ASSERTION FAILED: m_processCallback in WebCore::AudioWorkletProcessor::process https://bugs.webkit.org/show_bug.cgi?id=235529 Reviewed by Geoffrey Garen and Darin Adler. m_processCallback stores the JS wrapper for the AudioWorkletProcessor and the crash was due to that JS wrapper getting garbage collected while the AudioWorkletNode was still rendering. The JS wrapper for AudioWorkletProcessor is actually created by AudioWorkletGlobalScope::createProcessor() and the JavaScript does not usually keep a reference to it. To address the issue, I added a visitor to the AudioWorkletGlobalScope wrapper which visits the processors that it created and that still have an associated AudioWorkletNode owner. * Modules/webaudio/AudioWorkletGlobalScope.cpp: (WebCore::AudioWorkletGlobalScope::createProcessor): (WebCore::AudioWorkletGlobalScope::processorIsNoLongerNeeded): (WebCore::AudioWorkletGlobalScope::visitProcessors): * Modules/webaudio/AudioWorkletGlobalScope.h: * Modules/webaudio/AudioWorkletGlobalScope.idl: * Modules/webaudio/AudioWorkletNode.cpp: (WebCore::AudioWorkletNode::~AudioWorkletNode): * Modules/webaudio/AudioWorkletProcessor.cpp: (WebCore::AudioWorkletProcessor::create): (WebCore::AudioWorkletProcessor::AudioWorkletProcessor): (WebCore::AudioWorkletProcessor::process): (WebCore::AudioWorkletProcessor::setWrapper): (WebCore::AudioWorkletProcessor::setProcessCallback): Deleted. * Modules/webaudio/AudioWorkletProcessor.h: (WebCore::AudioWorkletProcessor::wrapper): (WebCore::AudioWorkletProcessor::processCallbackWrapper): Deleted. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSAudioWorkletProcessorCustom.cpp: (WebCore::JSAudioWorkletProcessor::visitAdditionalChildren): 2022-01-28 Alexey Shvayka JSEventListener::replaceJSFunctionForAttributeListener() should not replace m_wrapper unconditionally https://bugs.webkit.org/show_bug.cgi?id=235658 Unreviewed, follow-up to r288648 based on Geoff's feedback. Assert that if replaceJSFunctionForAttributeListener() is invoked, m_wrapper is alive and remains unchanged. Remove writeBarrier() as ensureJSFunction() sets it up only for functions created from source code. To meet the expectation for Window-reflecting event handlers, ensure that setAttributeEventListener() is called with the correct wrapper, and also call it directly on DOMWindow to improve readability. * bindings/js/JSEventListener.cpp: (WebCore::JSEventListener::replaceJSFunctionForAttributeListener): * bindings/js/JSEventListener.h: (WebCore::setWindowEventHandlerAttribute): 2022-01-28 Michael Saboff Catalyst builds fail for WebCore, WebKi and WebKitLegacy for builds with system content path https://bugs.webkit.org/show_bug.cgi?id=235821 Reviewed by Saam Barati. The value of JAVASCRIPTCORE_PRIVATE_HEADERS_DIR for Catalyst builds had the system content prefix after the Catalyst prefix. I reversed them. * Configurations/WebCore.xcconfig: 2022-01-28 Carlos Garcia Campos [GTK][a11y] WTR: implement AccessibilityUIElement::isIgnored() for ATSPI https://bugs.webkit.org/show_bug.cgi?id=235761 Reviewed by Adrian Perez de Castro. * accessibility/atspi/AccessibilityObjectAtspi.cpp: (WebCore::AccessibilityObjectAtspi::isIgnored const): * accessibility/atspi/AccessibilityObjectAtspi.h: 2022-01-28 Carlos Garcia Campos [GTK][a11y] Return the list of column/row headers from header cells too with ATSPI https://bugs.webkit.org/show_bug.cgi?id=235711 Reviewed by Adrian Perez de Castro. We are only returning the list of column/row headers from cells that are not headers for consistency with chromium. However, our layout tests don't expect that and firefox doesn't do it either. * accessibility/atspi/AccessibilityObjectTableCellAtspi.cpp: (WebCore::AccessibilityObjectAtspi::cellRowHeaders const): (WebCore::AccessibilityObjectAtspi::cellColumnHeaders const): 2022-01-27 Chris Dumez Radio buttons with no form owner are not grouped https://bugs.webkit.org/show_bug.cgi?id=220502 Reviewed by Darin Adler. Per the HTML specification and to match the behavior of both Gecko and Blink, radio buttons should still be grouped, even if they are disconnected and not owned by a form. This patch aligns our behavior with Gecko and Blink and is based on the following Blink commit: - https://chromium-review.googlesource.com/c/chromium/src/+/1988087 No new tests, rebaselined existing tests. * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::setChecked): (WebCore::HTMLInputElement::didChangeForm): (WebCore::HTMLInputElement::insertedIntoAncestor): (WebCore::HTMLInputElement::removedFromAncestor): (WebCore::HTMLInputElement::checkedRadioButtonForGroup const): * html/InputType.h: (WebCore::InputType::willUpdateCheckedness): * html/RadioInputType.cpp: (WebCore::RadioInputType::valueMissing const): (WebCore::RadioInputType::willUpdateCheckedness): * html/RadioInputType.h: 2022-01-27 Diego Pino Garcia [WPE] Unreviewed, fix non-unified build after r288672 https://bugs.webkit.org/show_bug.cgi?id=235756 * Modules/webxr/XRReferenceSpaceEvent.cpp: * loader/ProgressTracker.h: 2022-01-27 Aditya Keerthi Introduce WebFoundTextRange and WebFoundTextRangeController to support restorable find results https://bugs.webkit.org/show_bug.cgi?id=235691 rdar://88117167 Reviewed by Wenson Hsieh. * editing/TextIterator.cpp: (WebCore::findIteratorOptions): Deleted. * editing/TextIterator.h: (WebCore::findIteratorOptions): Moved method into header to share logic. * page/Page.cpp: (WebCore::Page::findTextMatches): Added a way to suppress marking text matches. * page/Page.h: 2022-01-27 Carlos Garcia Campos [WPE][a11y] Add option to build with ATSPI https://bugs.webkit.org/show_bug.cgi?id=235701 Reviewed by Adrian Perez de Castro. * PlatformWPE.cmake: * SourcesWPE.txt: 2022-01-27 Carlos Garcia Campos [GTK][a11y] Do not set the accessibility root object on svg image page elements with ATSPI https://bugs.webkit.org/show_bug.cgi?id=235705 Reviewed by Adrian Perez de Castro. This was needed only because of isolated tree mode. * accessibility/AccessibilityRenderObject.cpp: * accessibility/atspi/AXObjectCacheAtspi.cpp: * accessibility/atspi/AccessibilityObjectAtspi.cpp: * accessibility/atspi/AccessibilityObjectAtspi.h: 2022-01-27 Carlos Garcia Campos [GTK][a11y] Ignore span elements with ATSPI https://bugs.webkit.org/show_bug.cgi?id=235704 Reviewed by Adrian Perez de Castro. Their text contents are exposed as part of the parent object. * accessibility/atspi/AccessibilityObjectAtspi.cpp: (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const): 2022-01-27 Antoine Quint [Model] Allow disabling interaction https://bugs.webkit.org/show_bug.cgi?id=227621 Reviewed by Darin Adler. We add support for the "interactive" IDL property and HTML attribute as discussed in the explainer at https://github.com/WebKit/explainers/tree/main/model. If the "interactive" property is "true", then the HTML "interactive" attribute is set on the element. If the property is "false", then the HTML attribute is absent. Likewise, if the HTML attribute is present, the property returns "true". If the HTML attribute is midding, the property returns "false". Note that the value held by the HTML attribute is not taken into account, its mere presence is all that is required. Based on the value of the "interactive" property, we either disable or enable interaction. On macOS, we check the property in HTMLModelElement::defaultEventHandler() while on iOS, where dragging is performed entirely in the UI process, we use the new ModelPlayer::setInteractionEnabled() method. By default, interaction is disabled. Tests: model-element/model-element-interactive-dragging.html model-element/model-element-interactive.html * Modules/model-element/HTMLModelElement.cpp: (WebCore::HTMLModelElement::isInteractive const): (WebCore::HTMLModelElement::attributeChanged): (WebCore::HTMLModelElement::defaultEventHandler): * Modules/model-element/HTMLModelElement.h: * Modules/model-element/HTMLModelElement.idl: * Modules/model-element/ModelPlayer.cpp: (WebCore::ModelPlayer::setInteractionEnabled): * Modules/model-element/ModelPlayer.h: * html/HTMLAttributeNames.in: 2022-01-27 Carlos Garcia Campos [GTK][a11y] Do not set the children count when serializing objects for the ATSPI cache https://bugs.webkit.org/show_bug.cgi?id=235700 Reviewed by Adrian Perez de Castro. It's confusing the cache if things don't happen in the expected order. We handle the children by emitting the children-changed signals. When the children count is set in the cache by AddAccessible signal or as a response to GetItems, atspi sets the accessible children vector size to the given value. If children-changed:add is emitted after that, it's considered a new child and the children vector grows. So, we end up with the double of children, but half of them are just null. * accessibility/atspi/AccessibilityAtspi.cpp: (WebCore::AccessibilityAtspi::registerObject): Add the registered object to the update cache list. (WebCore::AccessibilityAtspi::unregisterObject): Remove the object from the cache and emit RemoveAccessible signal if needed. (WebCore::AccessibilityAtspi::parentChanged): Stop registering the objects here, they will be registered when actually needed. Also don't emit the signal if the object is pending, because AddAccessible will update the cache. (WebCore::AccessibilityAtspi::childrenChanged): Do not add the pending objects to the cache, we can just emit the signal now and cache will be updated later. (WebCore::AccessibilityAtspi::stateChanged): Ditto. (WebCore::AccessibilityAtspi::textChanged): Ditto. (WebCore::AccessibilityAtspi::textAttributesChanged): Ditto. (WebCore::AccessibilityAtspi::textCaretMoved): Ditto. (WebCore::AccessibilityAtspi::textSelectionChanged): Ditto. (WebCore::AccessibilityAtspi::valueChanged): Ditto. (WebCore::AccessibilityAtspi::selectionChanged): Ditto. (WebCore::AccessibilityAtspi::loadEvent): Ditto. (WebCore::AccessibilityAtspi::cacheUpdateTimerFired): Copy the list because addToCacheIfNeeded() might add new items to the that we don't want to process in this iteration. (WebCore::AccessibilityAtspi::addToCacheIfPending): Deleted. (WebCore::AccessibilityAtspi::addAccessible): Deleted. (WebCore::AccessibilityAtspi::removeAccessible): Deleted. * accessibility/atspi/AccessibilityAtspi.h: * accessibility/atspi/AccessibilityObjectAtspi.cpp: (WebCore::AccessibilityObjectAtspi::registerObject): Remove the call to addAccessible, it's now done in AccessibilityAtspi::registerObject. (WebCore::AccessibilityObjectAtspi::serialize const): Pass -1 as children count to ensure the children vector is not modified. * accessibility/atspi/AccessibilityRootAtspi.cpp: (WebCore::AccessibilityRootAtspi::serialize const): Ditto. 2022-01-27 Carlos Garcia Campos [GTK][a11y] Keep a reference to the parent wrapper with ATSPI https://bugs.webkit.org/show_bug.cgi?id=235699 Reviewed by Adrian Perez de Castro. When wrappers are destroyed it doesn't necessarily happen in the tree order, we need to keep the parent alive to emit the children-changed signal. * accessibility/atspi/AccessibilityObjectAtspi.h: 2022-01-27 Carlos Garcia Campos [GTK][a11y] Return null reference for root parent reference if queried before being embedded https://bugs.webkit.org/show_bug.cgi?id=235698 Reviewed by Adrian Perez de Castro. Once embedded parent-changed will be emitted. * accessibility/atspi/AccessibilityRootAtspi.cpp: (WebCore::AccessibilityRootAtspi::parentReference const): 2022-01-27 Antoine Quint should not be draggable on macOS https://bugs.webkit.org/show_bug.cgi?id=235697 Reviewed by Dean Jackson. As part of bug 229246 we added support for dragging elements. However, it did not work on macOS in practice so we make that explicit. This is also important leading up to bug 227621, where we'll implement the "interactive" HTML attribute and IDL property, since disabling dragging over a element to adjust the camera would trigger a crash under Pasteboard::write() on macOS due to not having an image set on the pasteboard data. * Modules/model-element/HTMLModelElement.cpp: (WebCore::HTMLModelElement::supportsDragging const): (WebCore::HTMLModelElement::isDraggableIgnoringAttributes const): * Modules/model-element/HTMLModelElement.h: * Modules/model-element/ModelPlayer.cpp: (WebCore::ModelPlayer::supportsDragging): * Modules/model-element/ModelPlayer.h: * page/DragController.cpp: (WebCore::modelElementIsDraggable): 2022-01-27 Megan Gardner DocumentContext gives empty rects for blank lines. https://bugs.webkit.org/show_bug.cgi?id=235695 Reviewed by Wenson Hsieh. Test: DocumentEditingContext::RectsRequestInContentEditable When requesting the document context for the end of a document, we would give empty rects for blank lines. This was because when calculating the absoluteBoundingRect for the range, we would use a normal unionRect call, which would use the basic unite call, which does not combine empty rects. And empty rect is defined as a rect that does not have a non-zero hight and width. Since we were calculating information about
lines, this was causing us to union a list of a single rect, which was an empty rect. This left us with a zero rect after unioning. The solution is to unionIfNonZero when calculating these rects for DocumentContext. I also took the opportunity to make some of this code more parallel to other implementations. * platform/graphics/GeometryUtilities.cpp: (WebCore::unionRectIfNonZero): * platform/graphics/GeometryUtilities.h: * platform/graphics/IntRect.cpp: (WebCore::IntRect::uniteIfNonZero): * platform/graphics/IntRect.h: (WebCore::IntRect::isZero const): 2022-01-27 Michael Saboff com.apple.WebKit.WebAuthn.xpc fails to build with system content path https://bugs.webkit.org/show_bug.cgi?id=235734 Reviewed by Filip Pizlo. Since WebCore is installed under the WebKit framework on macOS, we don't need a symlink for the WebCore.framework itself. As a result, modified the create symlink script to not be dependent on the target location, since it isn't created when doing a catalyst build. Instead the script creates the parent directory of the symlink if it doesn't exisst. * Configurations/WebCore.xcconfig: * Scripts/create-symlink-to-altroot.sh: * WebCore.xcodeproj/project.pbxproj: 2022-01-27 Chris Dumez Geolocation API should callback with error if doc is not fully active https://bugs.webkit.org/show_bug.cgi?id=228319 Reviewed by Ryosuke Niwa. Test: imported/w3c/web-platform-tests/geolocation-API/non-fully-active.https.html * Modules/geolocation/Geolocation.cpp: (WebCore::Geolocation::getCurrentPosition): (WebCore::Geolocation::watchPosition): Schedule a task to call the error callback if the document is not fully active, as per the specification: - https://github.com/w3c/geolocation-api/issues/96 - https://github.com/w3c/geolocation-api/pull/97 * dom/TaskSource.h: As Geolocation task source for the HTML5 event loop, as per the Geolocation specification. 2022-01-27 Andres Gonzalez AXIsolatedObject::children should honor the parameter updateChildrenIfNeeded. https://bugs.webkit.org/show_bug.cgi?id=235728 Reviewed by Chris Fleizach. This will allow to get a more accurate smapshot of the isolated tree during debugging. For instance it will allow to do AXLOG of the isolated tree in applyPendingChanges which is currently not possible because results in infinite recursion. * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::children): 2022-01-27 Kate Cheney "Unrecognized Content-Security-Policy directive 'worker-src'." https://bugs.webkit.org/show_bug.cgi?id=235260 Reviewed by Brent Fulgham. Implementation of worker-src directive. According to https://www.w3.org/TR/CSP3/#changes-from-level-2 the worker-src directive now restricts URLs that can be loaded by workers, and defers to child-src if not specified. * bindings/js/WorkerModuleScriptLoader.cpp: (WebCore::WorkerModuleScriptLoader::load): Check worker-src instead of child-src for worker loads. * loader/DocumentThreadableLoader.cpp: (WebCore::DocumentThreadableLoader::isAllowedByContentSecurityPolicy): * loader/ThreadableLoader.h: Check worker-src instead of child-src for worker loads. * page/csp/ContentSecurityPolicy.cpp: We can remove allowChildContextFromSource which is now fully replaced by allowWorkerFromSource. (WebCore::ContentSecurityPolicy::allowWorkerFromSource const): (WebCore::ContentSecurityPolicy::allowChildContextFromSource const): Deleted. * page/csp/ContentSecurityPolicy.h: * page/csp/ContentSecurityPolicyDirectiveList.cpp: (WebCore::ContentSecurityPolicyDirectiveList::operativeDirectiveForWorkerSrc const): worker-src defers to child-src, then script-src, then default-src. (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForWorker): (WebCore::ContentSecurityPolicyDirectiveList::addDirective): * page/csp/ContentSecurityPolicyDirectiveList.h: * page/csp/ContentSecurityPolicyDirectiveNames.cpp: * page/csp/ContentSecurityPolicyDirectiveNames.h: * workers/AbstractWorker.cpp: (WebCore::AbstractWorker::resolveURL): * workers/AbstractWorker.h: We check LegacySchemeRegistry::schemeShouldBypassContentSecurityPolicy in allowWorkerFromSource, so we don't need to check in in AbstractWorker::resolveURL anymore. We can also replace the child-src checks with worker-src ones. * workers/Worker.cpp: (WebCore::Worker::create): * workers/WorkerFontLoadRequest.cpp: (WebCore::WorkerFontLoadRequest::load): * workers/service/ServiceWorkerContainer.cpp: (WebCore::ServiceWorkerContainer::addRegistration): Block service worker registrations not specified by worker-src. * workers/shared/SharedWorker.cpp: (WebCore::SharedWorker::create): Block shared worker urls not specified by worker-src. * workers/shared/SharedWorkerScriptLoader.cpp: (WebCore::SharedWorkerScriptLoader::SharedWorkerScriptLoader): 2022-01-27 Don Olmstead Fix !ENABLE(ACCESSIBILITY) after r288674 https://bugs.webkit.org/show_bug.cgi?id=235727 Unreviewed build fix. In r288674 AXObjectCache had updateLoadingProgress added but it wasn't added to the block of inlined !ENABLE(ACCESSIBILITY) methods further down the file. * accessibility/AXObjectCache.h: (WebCore::AXObjectCache::updateLoadingProgress): 2022-01-27 Devin Rousso [Payment Request] allow additional payment method specific data to be passed to `complete()` https://bugs.webkit.org/show_bug.cgi?id=235415 Reviewed by Darin Adler. This allows for developers/merchants to give additional details to Apple Pay on completion. Issue: Spec PR: Test: http/tests/paymentrequest/ApplePayPaymentCompleteDetails.https.html * Modules/paymentrequest/PaymentCompleteDetails.h: Added. * Modules/paymentrequest/PaymentCompleteDetails.idl: Added. * Modules/paymentrequest/PaymentResponse.h: * Modules/paymentrequest/PaymentResponse.idl: * Modules/paymentrequest/PaymentResponse.cpp: (WebCore::PaymentResponse::complete): * Modules/paymentrequest/PaymentRequest.h: * Modules/paymentrequest/PaymentRequest.cpp: (WebCore::PaymentRequest::complete): * Modules/paymentrequest/PaymentHandler.h: Add new `dictionary PaymentCompleteDetails` that's allowed as an optional second argument to `PaymentResponse.prototype.complete`. If provided, JSON stringify it and pass the serialized string data along to the relevant `PaymentHandler` for JSON (re)parsing if the associated payment method requires it. * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h: * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp: (WebCore::convertAndValidate): (WebCore::merge): (WebCore::ApplePayPaymentHandler::complete): (WebCore::ApplePayPaymentHandler::retry): * Modules/applepay/paymentrequest/ApplePayPaymentCompleteDetails.idl: Added. * Modules/applepay/paymentrequest/ApplePayPaymentCompleteDetails.h: Added. (WebCore::ApplePayPaymentCompleteDetails::encode const): (WebCore::ApplePayPaymentCompleteDetails::decode): Convert the JSON (re)parsed object into a `ApplePayPaymentCompleteDetails`, merging it into the `ApplePayPaymentAuthorizationResult` passed to the `PaymentCoordinator` (see below). * Modules/applepay/ApplePayPaymentAuthorizationResult.h: * Modules/applepay/ApplePayPaymentAuthorizationResult.cpp: Added. (WebCore::ApplePayPaymentAuthorizationResult::isFinalState const): (WebCore::ApplePayPaymentAuthorizationResult::encode const): (WebCore::ApplePayPaymentAuthorizationResult::decode): * Modules/applepay/ApplePaySessionPaymentRequest.h: * Modules/applepay/ApplePaySessionPaymentRequest.cpp: (WebCore::isFinalStateResult): Deleted. * Modules/applepay/ApplePaySession.h: * Modules/applepay/ApplePaySession.cpp: (WebCore::convertAndValidate): (WebCore::ApplePaySession::completePayment): * Modules/applepay/PaymentCoordinator.h: * Modules/applepay/PaymentCoordinator.cpp: (WebCore::PaymentCoordinator::completePaymentSession): * Modules/applepay/PaymentCoordinatorClient.h: * loader/EmptyClients.cpp: * testing/MockPaymentCoordinator.h: * testing/MockPaymentCoordinator.cpp: (WebCore::MockPaymentCoordinator::completePaymentSession): Replace `PaymentAuthorizationResult` with `ApplePayPaymentAuthorizationResult` so that data doesn't need to be moved between identically shaped structs for sending to the UIProcess. * Modules/applepay/cocoa/PaymentAPIVersionCocoa.mm: (WebCore::PaymentAPIVersion::current): Increment the current version. * Modules/applepay-ams-ui/ApplePayAMSUIPaymentHandler.h: * Modules/applepay-ams-ui/ApplePayAMSUIPaymentHandler.cpp: (WebCore::ApplePayAMSUIPaymentHandler::complete): AMS UI does not allow/require any data to be provided on completion. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Headers.cmake: * PlatformMac.cmake: * Sources.txt: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: 2022-01-27 Elliott Williams [XCBuild] Add missing task dependencies on generate-unified-source-bundles.rb https://bugs.webkit.org/show_bug.cgi?id=235724 Reviewed by Alexey Proskuryakov. The targets which generate unified sources all use /usr/local/include/wtf/Scripts/generate-unified-source-bundles.rb, but do not declare it. In workspace builds, WTF may not have been built and this header may not exist yet. * WebCore.xcodeproj/project.pbxproj: 2022-01-27 Commit Queue Unreviewed, reverting r288670. https://bugs.webkit.org/show_bug.cgi?id=235725 broke TestWebKitAPI.DragAndDropTests.CanStartDragOnModel on iOS Reverted changeset: " should only be draggable on iOS" https://bugs.webkit.org/show_bug.cgi?id=235697 https://commits.webkit.org/r288670 2022-01-27 Tyler Wilcock AX: Remove ancestor flag initialized ASSERT in AXIsolatedObject::initializeAttributeData https://bugs.webkit.org/show_bug.cgi?id=235717 Reviewed by Andres Gonzalez. This patch removes: ASSERT(isRoot || object.ancestorFlagsAreInitialized()); From AXIsolatedObject::initializeAttributeData. This ASSERT is not very useful, since after https://bugs.webkit.org/show_bug.cgi?id=235189 we do a single traversal to compute all flags in the rare but legitimate cases they aren't already initialized. * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::initializeAttributeData): 2022-01-27 Elliott Williams Generated xcfilelists contain symlinks when building for macOS https://bugs.webkit.org/show_bug.cgi?id=235663 rdar://88054903 Introduce a build variable that expands to `Versions/A` when building for macOS, so that our input filelists refer to the resolved location of headers and other files inside of framework bundles. This fixes task dependencies which were not being detected by XCBuild. Reviewed by Alexey Proskuryakov. * Configurations/Base.xcconfig: * Configurations/WebCore.xcconfig: 2022-01-27 Wenson Hsieh ImageAnalysisQueue should prioritize elements that intersect the visible viewport https://bugs.webkit.org/show_bug.cgi?id=235664 rdar://88131827 Reviewed by Darin Adler. Make few adjustments to the image analysis queueing mechanism, such that we prioritize analyzing images that are in the visible document rect over offscreen images. To do this, we turn the current image element queue into a PriorityQueue instead, which treats images that are in the visible viewport (at enqueueing time) as higher priority over images that are not in the visible viewport, and otherwise treats images that were queued earlier as higher priority in the case where both images are either visible or not visible. Test: ImageAnalysisTests.ImageAnalysisPrioritizesVisibleImages * page/ImageAnalysisQueue.cpp: (WebCore::ImageAnalysisQueue::enqueueIfNeeded): (WebCore::ImageAnalysisQueue::resumeProcessingSoon): (WebCore::ImageAnalysisQueue::resumeProcessing): (WebCore::ImageAnalysisQueue::clear): * page/ImageAnalysisQueue.h: Swap out the Deque for a PriorityQueue, and introduce ImageAnalysisQueue::Task to represent an image analysis task (which can be compared against other tasks to determine priority using `firstIsHigherPriority()` below). (WebCore::ImageAnalysisQueue::firstIsHigherPriority): 2022-01-27 Gavin Phillips Detect failed ThreadableLoader creation in FileReaderLoader. https://bugs.webkit.org/show_bug.cgi?id=235566 Reviewed by Youenn Fablet. When we fail to successfully create a ThreadableLoader in FileReaderLoader we should catch the failure and return early. * Modules/fetch/FormDataConsumer.cpp: (WebCore::FormDataConsumer::consumeBlob): * fileapi/FileReaderLoader.cpp: (WebCore::FileReaderLoader::start): 2022-01-27 Alexander Mikhaylenko [GTK] Support accent colors https://bugs.webkit.org/show_bug.cgi?id=235706 Reviewed by Michael Catanzaro. Use the accent color UI process provides rather than fetching it here. Remove the last bits of ThemeGtk and stop using foreign drawing for text selection on GTK3. Use dark foreground color if the accent color is bright. * PlatformGTK.cmake: * SourcesGTK.txt: * platform/adwaita/ThemeAdwaita.cpp: (WebCore::Theme::singleton): (WebCore::ThemeAdwaita::activeSelectionForegroundColor const): (WebCore::ThemeAdwaita::activeSelectionBackgroundColor const): (WebCore::ThemeAdwaita::inactiveSelectionForegroundColor const): (WebCore::ThemeAdwaita::setAccentColor): * platform/adwaita/ThemeAdwaita.h: * platform/gtk/ThemeGtk.cpp: Removed. * platform/gtk/ThemeGtk.h: Removed. * rendering/RenderThemeAdwaita.cpp: (WebCore::RenderThemeAdwaita::setAccentColor): * rendering/RenderThemeAdwaita.h: 2022-01-27 Patrick Griffis CSP: Clean up effective-violation handling in reports https://bugs.webkit.org/show_bug.cgi?id=235602 Reviewed by Kate Cheney. The CSP 3 spec uses the same value for effectiveDirective and violatedDirective noting that is now now just an alias for historical purposes. https://www.w3.org/TR/CSP3/#violation-events I have refactored this so we only pass around a single string instead of constantly repeating the directive which was error prone. This does result in a lot of `script-src` changing to `script-src-elem` in reports however this behavior matches what Chromium is already reporting and it fixes some WPT results where it expects `frame-src` instead of `child-src`. * page/csp/ContentSecurityPolicy.cpp: (WebCore::consoleMessageForViolation): (WebCore::ContentSecurityPolicy::allowRunningOrDisplayingInsecureContent): (WebCore::ContentSecurityPolicy::allowJavaScriptURLs const): (WebCore::ContentSecurityPolicy::allowInlineEventHandlers const): (WebCore::ContentSecurityPolicy::allowNonParserInsertedScripts const): (WebCore::ContentSecurityPolicy::allowInlineScript const): (WebCore::ContentSecurityPolicy::allowInlineStyle const): (WebCore::ContentSecurityPolicy::allowEval const): (WebCore::ContentSecurityPolicy::allowFrameAncestors const): (WebCore::ContentSecurityPolicy::allowPluginType const): (WebCore::ContentSecurityPolicy::allowObjectFromSource const): (WebCore::ContentSecurityPolicy::allowChildFrameFromSource const): (WebCore::ContentSecurityPolicy::allowResourceFromSource const): (WebCore::ContentSecurityPolicy::allowChildContextFromSource const): (WebCore::ContentSecurityPolicy::allowScriptFromSource const): (WebCore::ContentSecurityPolicy::allowImageFromSource const): (WebCore::ContentSecurityPolicy::allowStyleFromSource const): (WebCore::ContentSecurityPolicy::allowFontFromSource const): (WebCore::ContentSecurityPolicy::allowManifestFromSource const): (WebCore::ContentSecurityPolicy::allowMediaFromSource const): (WebCore::ContentSecurityPolicy::allowConnectToSource const): (WebCore::ContentSecurityPolicy::allowFormAction const): (WebCore::ContentSecurityPolicy::allowBaseURI const): (WebCore::ContentSecurityPolicy::reportViolation const): * page/csp/ContentSecurityPolicy.h: * page/csp/ContentSecurityPolicyDirectiveList.cpp: (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForNonParserInsertedScripts const): 2022-01-27 Tyler Wilcock AXLogger::add should not cause tree updates via children() https://bugs.webkit.org/show_bug.cgi?id=235715 Reviewed by Chris Fleizach. AXLogger::add(TextStream&, const RefPtr&, bool) currently calls the update version of AXCoreObject::children(bool), causing behavior to potentially be different between builds with logging enabled and logging disabled. The logger should only read the current state of the object / tree, never modify it. * accessibility/AXLogger.cpp: (WebCore::AXLogger::add): 2022-01-27 Antti Koivisto [CSS Container Queries] Basic parsing support for query syntax https://bugs.webkit.org/show_bug.cgi?id=235712 Reviewed by Darin Adler. https://drafts.csswg.org/css-contain-3/#at-ruledef-container Use MediaQueryParser to parse the query syntax. Note that because the limitations of MediaQueryParser only simple non-nested queries can be parsed for now. * css/StyleRule.h: * css/parser/CSSParserImpl.cpp: (WebCore::filterProperties): (WebCore::CSSParserImpl::consumeAtRule): (WebCore::CSSParserImpl::consumeContainerRule): * css/parser/CSSPropertyParser.cpp: (WebCore::consumeContainerName): * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::consumeSingleContainerName): * css/parser/CSSPropertyParserHelpers.h: * css/parser/MediaQueryParser.cpp: (WebCore::MediaQueryParser::parseContainerQuery): (WebCore::MediaQueryParser::MediaQueryParser): (WebCore::MediaQueryParser::readContainerQuery): (WebCore::MediaQueryParser::handleBlocks): (WebCore::MediaQueryParser::processToken): (WebCore::MediaQueryParser::parseInternal): * css/parser/MediaQueryParser.h: 2022-01-27 Tyler Wilcock AX ITM: Defer to the tree when determining AX object loading progress https://bugs.webkit.org/show_bug.cgi?id=235646 Reviewed by Andres Gonzalez. Currently, we set AXPropertyName::IsLoaded and AXPropertyName::EstimatedLoadingProgress once in AXIsolatedObject::initializeAttributeData and never update it. This means that if an object is created while the page is at some non-100% load percentage, AX clients that request these attributes will always think the object isn't loaded. This patch removes these two properties and instead defers to the isolated tree associated with each object when determining the load percentage. Both of these properties were based on the entire page / document load progress anyways, so it doesn't make sense to set the same value for all of them. We track loading progress by changing ProgressTracker to also notify the page when progress changes, which in turn updates the associated AXObjectCache with the new progress value. Covered by accessibility/mac/document-attributes.html which verifies the AXLoad and AXLoadingProgress attributes. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::AXObjectCache): (WebCore::AXObjectCache::updateLoadingProgress): Added. * accessibility/AXObjectCache.h: (WebCore::AXObjectCache::loadingFinished): (WebCore::AXObjectCache::loadingProgress const): Added. * accessibility/AccessibilityObject.h: * accessibility/AccessibilityObjectInterface.h: * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::loadingProgress const): (WebCore::AccessibilityRenderObject::estimatedLoadingProgress const): Rename estimatedLoadingProgress methods to loadingProgress. * accessibility/AccessibilityRenderObject.h: * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::initializeAttributeData): * accessibility/isolatedtree/AXIsolatedObject.h: * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::create): (WebCore::AXIsolatedTree::updateLoadingProgress): (WebCore::AXIsolatedTree::applyPendingChanges): Apply m_pendingEstimatedLoadingProgress. * accessibility/isolatedtree/AXIsolatedTree.h: (WebCore::AXIsolatedTree::loadingProgress): Added. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): Handle rename of estimatedLoadingProgress methods to loadingProgress. * loader/ProgressTracker.cpp: (WebCore::ProgressTracker::ProgressTracker): Store a reference to the associated page in new m_page member. (WebCore::ProgressTracker::progressStarted): (WebCore::ProgressTracker::progressEstimateChanged): (WebCore::ProgressTracker::finalProgressComplete): (WebCore::ProgressTracker::incrementProgress): Notify the Page when progress changes or completes. * loader/ProgressTracker.h: * page/Page.cpp: (WebCore::Page::Page): (WebCore::Page::progressEstimateChanged const): Added. (WebCore::Page::progressFinished const): Added. * page/Page.h: 2022-01-27 Gabriel Nava Marino jsc_fuz/wktr: crash with new XRReferenceSpaceEvent('', {referenceSpace}) https://bugs.webkit.org/show_bug.cgi?id=235456 Reviewed by Chris Dumez. FastMalloc.h specifies that each derived class needs to be annotated as well with WTF_MAKE_ISO_ALLOCATED if the base class is annotated with WTF_MAKE_ISO_ALLOCATED. After doing this, the crash in WebCore::Event::operator new(unsigned long) is no longer reproducible. However, this caused ASSERT(m_transform) to be hit in debug builds with the attached test case. The XRReferenceSpaceEvent spec specifies the transform attribute as nullable (https://immersive-web.github.io/webxr/#dictdef-xrreferencespaceeventinit), so this patch updates the XRReferenceSpaceEvent IDL and implementation to match the spec, and removes the ASSERT accordingly. Test: webxr/xr-reference-space-event-crash.html * Modules/webxr/XRReferenceSpaceEvent.cpp: (WebCore::XRReferenceSpaceEvent::XRReferenceSpaceEvent): (WebCore::XRReferenceSpaceEvent::transform const): * Modules/webxr/XRReferenceSpaceEvent.h: * Modules/webxr/XRReferenceSpaceEvent.idl: 2022-01-27 Antoine Quint should only be draggable on iOS https://bugs.webkit.org/show_bug.cgi?id=235697 Reviewed by Dean Jackson. As part of bug 229246 we added support for dragging elements. However, it only worked on iOS in practice so we make that explicit so that other platforms that do not have complete support for dragging do not have that feature. This is also important leading up to bug 227621, where we'll implement the "interactive" HTML attribute and IDL property, since disabling dragging over a element to adjust the camera would trigger a crash under Pasteboard::write() on macOS due to not having an image set on the pasteboard data. * Modules/model-element/HTMLModelElement.cpp: (WebCore::HTMLModelElement::supportsDragging const): (WebCore::HTMLModelElement::isDraggableIgnoringAttributes const): * Modules/model-element/HTMLModelElement.h: * Modules/model-element/ModelPlayer.cpp: (WebCore::ModelPlayer::supportsDragging): * Modules/model-element/ModelPlayer.h: * page/DragController.cpp: (WebCore::modelElementIsDraggable): 2022-01-27 Cameron McCormack Avoid setting and clearing :active state when dispatching synthetic click events when possible https://bugs.webkit.org/show_bug.cgi?id=235672 Reviewed by Simon Fraser. Simulated click events are dispatched with two options: - whether to send associated events mouseover, mouseup, mousedown - whether to repaint the target element with its pressed look We currently always set the element's :active state just after when we'd send the mousedown event, and clear it just after that. When we dispatch a simulated click event with neither of the above options set, there's no way to observe the temporary :active state on the element. We can skip it in that case. We need to continue clearing clearing the :active state regardless, because some callers have already set :active and are relying on simulateClick to clear it. This patch is a 0.3-0.4% improvement on Speedometer 2. * dom/SimulatedClick.cpp: (WebCore::simulateClick): 2022-01-26 Jean-Yves Avenard REGRESSION(r287684) speedtest.net uses many GB of memory https://bugs.webkit.org/show_bug.cgi?id=235615 rdar://87830583 Reviewed by Youenn Fablet. The regression was introduced with r286937 and is a good example of errors introduced when attempting to optimise things too early. CachedRawResource::updateBuffer does a search in the accumulating resource's SharedBuffer, search that was taking O(log(n)+1) prior r286937 where n is the number of DataView segments in the SharedBuffer. This was simplified as a O(1) operation by using the combined contiguous SharedBuffer instead. However, that caused every single intermediary accumulated buffers to be kept referenced by the XMLHttpRequest SharedBufferBuilder leading to massive memory use. In other words: For each update, we did the following steps: - Set m_data to a new big continuous chunk of data that stores all received data - Create a view of the new data as a SharedBuffer. This SharedBuffer references the big continuous chunk above - XHR stores a ref to the view, hence keep the big chunk alive. Each XHR chunk, although small in data that can be accessed, is actually keeping in memory all temporary created m_data chunks. Following this change, XHR will now only keeps a reference to the new DataSegment added since the last run rather than the entire previous content. Fly-by: add some comments describing the running of the method. * loader/cache/CachedRawResource.cpp: (WebCore::CachedRawResource::updateBuffer): 2022-01-26 Diego Pino Garcia [WPE] Unreviewed, fix non-unified build after r288640 https://bugs.webkit.org/show_bug.cgi?id=235682 * bindings/js/JSDOMMicrotask.cpp: Add missing header. 2022-01-26 Per Arne Vollan [WP] Avoid calling IOSurfaceAlignProperty https://bugs.webkit.org/show_bug.cgi?id=235659 Reviewed by Simon Fraser. Add information about alignment of bytes per row to IOSurface class. * platform/graphics/cocoa/IOSurface.h: * platform/graphics/cocoa/IOSurface.mm: (WebCore::surfaceBytesPerRowAlignment): (WebCore::IOSurface::bytesPerRowAlignment): (WebCore::IOSurface::setBytesPerRowAlignment): 2022-01-26 Alexey Shvayka Remove the now-unused JSGlobalObjectTask class https://bugs.webkit.org/show_bug.cgi?id=235675 Reviewed by Darin Adler. It was named quite poorly and replaced with JSMicrotaskCallback. No new tests, no behavior change. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDOMGlobalObjectTask.cpp: Removed. * bindings/js/JSDOMGlobalObjectTask.h: Removed. * bindings/js/JSDOMWindowBase.cpp: * bindings/js/JSWorkerGlobalScopeBase.cpp: * bindings/js/JSWorkletGlobalScopeBase.cpp: 2022-01-26 Ryan Haddad Unreviewed, reverting r288614. Caused layout test crashes Reverted changeset: "REGRESSION(r287684) speedtest.net uses many GB of memory" https://bugs.webkit.org/show_bug.cgi?id=235615 https://commits.webkit.org/r288614 2022-01-26 Wenson Hsieh Make some minor adjustments after r288621 https://bugs.webkit.org/show_bug.cgi?id=235598 rdar://88032375 Reviewed by Darin Adler. Address some post-commit review comments. * dom/ImageOverlay.cpp: (WebCore::ImageOverlay::updateSubtree): * testing/Internals.cpp: (WebCore::Internals::installImageOverlay): * testing/Internals.mm: (WebCore::Internals::fakeDataDetectorResultForTesting): 2022-01-26 Alan Bujtas REGRESSION (r281306): Non-breaking space incorrectly collapsed when webkit-nbsp-mode is set to "space" https://bugs.webkit.org/show_bug.cgi?id=235627 Reviewed by Antti Koivisto. "-webkit-nbsp-mode: space" has a peculiar collapsing behavior. It only collapses as leading content preceded by forced line break.
first_line     second_line
The non-breaking space is collapsed. It does not show on the second line as leading content.
first_line
     second_line
The non-breaking space is NOT collapsed. It shows up as leading content on the second line, indenting the "second_line" text content. To mimic this legacy behavior, it's easier just to switch back to handling nbsp; as a non-whitespace inline item and collapse it as leading content (depending on the breaking context). (as opposed to customize regular whitespace content collapsing behavior just to support this quirk) Test: fast/text/collapsible-non-breaking-space.html * layout/formattingContexts/inline/InlineItemsBuilder.cpp: (WebCore::Layout::moveToNextNonWhitespacePosition): remove special nbsp; handling (WebCore::Layout::InlineItemsBuilder::handleTextContent): create an inline text item for the special mon-breaking space content. * layout/formattingContexts/inline/InlineLine.cpp: (WebCore::Layout::Line::initialize): (WebCore::Layout::Line::appendTextContent): * layout/formattingContexts/inline/InlineLine.h: * layout/formattingContexts/inline/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::inlineItemWidth const): (WebCore::Layout::LineBuilder::initialize): (WebCore::Layout::LineBuilder::candidateContentForLine): (WebCore::Layout::LineBuilder::handleInlineContent): (WebCore::Layout::LineBuilder::rebuildLine): * layout/formattingContexts/inline/InlineLineBuilder.h: (WebCore::Layout::LineBuilder::isFirstLine const): * layout/formattingContexts/inline/InlineTextItem.cpp: (WebCore::Layout::InlineTextItem::isCollapsibleNonBreakingSpace const): * layout/formattingContexts/inline/InlineTextItem.h: 2022-01-26 Alexey Shvayka JSEventListener::replaceJSFunctionForAttributeListener() should not replace m_wrapper unconditionally https://bugs.webkit.org/show_bug.cgi?id=235658 Reviewed by Yusuke Suzuki. This is a follow-up to r287293, which aligns JSEventListener::replaceJSFunctionForAttributeListener() with JSEventListener::ensureJSFunction() in terms of handling uninitilized lazy event listeners. Without this change, the microbenchmark in consumes 16 GB of memory in 30 seconds and crashes, which even isn't a regression: the same issue was observed before r287293. According to new microbenchmark samples, I'm hopeful that with this patch, Speedometer2/Inferno-TodoMVC will progress as promised in r287293. No new tests, no behavior change. * bindings/js/JSEventListener.cpp: (WebCore::JSEventListener::replaceJSFunctionForAttributeListener): 2022-01-26 Fujii Hironori REGRESSION(r288623) MSVC reports "InspectorDOMAgent.cpp(558,40): error C2059: syntax error: ':'" https://bugs.webkit.org/show_bug.cgi?id=235667 Unreviewed build fix. * inspector/agents/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::pushStyleableElementToFrontend): (WebCore::InspectorDOMAgent::pushStyleablePathToFrontend): Don't use GNU extension `?:`. 2022-01-26 Antoine Quint Add an iterator to KeyframeList https://bugs.webkit.org/show_bug.cgi?id=235652 Reviewed by Darin Adler. Add an iterator for KeyframeList and remove the keyframes() method which serves no purpose now. * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::getKeyframes): (WebCore::KeyframeEffect::computeCSSAnimationBlendingKeyframes): (WebCore::KeyframeEffect::computedNeedsForcedLayout): (WebCore::KeyframeEffect::computeSomeKeyframesUseStepsTimingFunction): (WebCore::KeyframeEffect::setAnimatedPropertiesInStyle): (WebCore::KeyframeEffect::computeExtentOfTransformAnimation const): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::startAnimation): * rendering/style/KeyframeList.cpp: (WebCore::KeyframeList::copyKeyframes): * rendering/style/KeyframeList.h: (WebCore::KeyframeList::operator[] const): (WebCore::KeyframeList::begin const): (WebCore::KeyframeList::end const): (WebCore::KeyframeList::keyframes const): Deleted. 2022-01-26 Alexey Shvayka globalThis.queueMicrotask() should report thrown exceptions https://bugs.webkit.org/show_bug.cgi?id=235614 Reviewed by Geoff Garen. This patch introduces WebCore::JSDOMMicrotask so the queueMicrotask() could report a thrown exception as per spec [1] and to avoid invocation of a userland function from detached