2020-06-23 Sergio Villar Senin [WebXR] Fix PlatformXR initialization/destruction https://bugs.webkit.org/show_bug.cgi?id=213509 Reviewed by Youenn Fablet. There were two different issues, one at creation time and the other one at destruction. At creation time we were not calling construct() for the LazyNeverDestroyed object. That was making the WebProcess crash in Debug builds. At destruction time we were calling xrDestroyInstance() without checking that the passed instance was a valid one, although OpenXR implementations deal with it the spec is pretty clear. * platform/xr/PlatformXR.h: Mark LazyNeverDestroyed as friend and default constructor&destructor. * platform/xr/openxr/PlatformXROpenXR.cpp: (PlatformXR::Instance::Impl::~Impl): Check that instance is not XR_NULL_HANDLE before destroying. (PlatformXR::Instance::singleton): Call construct() on the Lazy instance. 2020-06-24 Youenn Fablet Use signalling thread as worker thread instead of network thread https://bugs.webkit.org/show_bug.cgi?id=213512 Reviewed by Eric Carlson. This is probably better since network thread is always busy while the siganlling thread is mostly busy at negotiation time. This also aligns with Chromium current setup. No change of behavior. * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: (WebCore::LibWebRTCProvider::createPeerConnectionFactory): 2020-06-24 Rob Buis Add referrerpolicy attribute support for https://bugs.webkit.org/show_bug.cgi?id=213342 Reviewed by Darin Adler. Give the referrer policy member a clear default. * loader/LinkLoader.h: 2020-06-23 Zalan Bujtas [Multicol] Reset the childrenInline state on the RenderBlockFlow when destroying the multicolumn context https://bugs.webkit.org/show_bug.cgi?id=213535 Reviewed by Simon Fraser. The "childrenInline" flags tells the tree builder whether a newly inserted inline content needs an anonymous block wrapper or not. RenderBlockFlows with multicolumn content have this flag set to false as the RenderMultiColumnFlowThread is a block renderer. As part of the mulicolumn context destruction, we move all the descendants from RenderMultiColumnFlowThread back to the original parent (the parent of the RenderMultiColumnFlowThread renderer). This patch sets this flag back to the initial value of true so that we don't end up constructing redundant wrappers for the incoming inline content. * rendering/updating/RenderTreeBuilderMultiColumn.cpp: (WebCore::RenderTreeBuilder::MultiColumn::destroyFragmentedFlow): 2020-06-23 Geoffrey Garen Remove WTF::setMainThreadCallbacksPaused https://bugs.webkit.org/show_bug.cgi?id=213112 Reviewed by Tim Horton. * inspector/PageScriptDebugServer.cpp: (WebCore::PageScriptDebugServer::setJavaScriptPaused): 2020-06-23 Chris Dumez Unreviewed, update xcfilelist files after some recent WebXR changes. * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: 2020-06-23 Chris Dumez Remove a lot of unnecessary calls to Ref::copyRef() https://bugs.webkit.org/show_bug.cgi?id=213533 Reviewed by Darin Adler. Remove a lot of unnecessary calls to Ref::copyRef() now that Ref is copyable. * Modules/cache/DOMCache.cpp: (WebCore::DOMCache::addAll): * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::doRequestOpenCursor): (WebCore::IDBTransaction::requestGetAllObjectStoreRecords): (WebCore::IDBTransaction::requestGetAllIndexRecords): (WebCore::IDBTransaction::requestGetRecord): (WebCore::IDBTransaction::requestIndexRecord): (WebCore::IDBTransaction::requestCount): (WebCore::IDBTransaction::requestDeleteRecord): (WebCore::IDBTransaction::requestClearObjectStore): (WebCore::IDBTransaction::requestPutOrAdd): * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::create): * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp: (WebCore::CanvasCaptureMediaStreamTrack::Source::create): * Modules/webdatabase/Database.cpp: (WebCore::Database::scheduleTransactionCallback): * Modules/websockets/WorkerThreadableWebSocketChannel.cpp: (WebCore::WorkerThreadableWebSocketChannel::Peer::send): (WebCore::WorkerThreadableWebSocketChannel::Peer::bufferedAmount): (WebCore::WorkerThreadableWebSocketChannel::Peer::didConnect): (WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveMessage): (WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveBinaryData): (WebCore::WorkerThreadableWebSocketChannel::Peer::didUpdateBufferedAmount): (WebCore::WorkerThreadableWebSocketChannel::Peer::didStartClosingHandshake): (WebCore::WorkerThreadableWebSocketChannel::Peer::didClose): (WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveMessageError): (WebCore::WorkerThreadableWebSocketChannel::Peer::didUpgradeURL): (WebCore::WorkerThreadableWebSocketChannel::Bridge::mainThreadInitialize): (WebCore::WorkerThreadableWebSocketChannel::Bridge::initialize): * bindings/js/ScriptController.cpp: (WebCore::ScriptController::executeAsynchronousUserAgentScriptInWorld): * crypto/SubtleCrypto.cpp: (WebCore::SubtleCrypto::wrapKey): * loader/DocumentWriter.cpp: (WebCore::DocumentWriter::begin): * loader/NetscapePlugInStreamLoader.cpp: (WebCore::NetscapePlugInStreamLoader::create): * loader/SubresourceLoader.cpp: (WebCore::SubresourceLoader::create): * platform/graphics/ImageSource.cpp: (WebCore::ImageSource::startAsyncDecodingQueue): * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm: (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequests): * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: * platform/mediastream/mac/AudioMediaStreamTrackRendererCocoa.cpp: (WebCore::AudioMediaStreamTrackRendererCocoa::pushSamples): * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::wrapCryptoKey): (WebCore::WorkerGlobalScope::unwrapCryptoKey): * workers/service/WorkerSWClientConnection.cpp: (WebCore::WorkerSWClientConnection::matchRegistration): (WebCore::WorkerSWClientConnection::getRegistrations): (WebCore::WorkerSWClientConnection::whenRegistrationReady): (WebCore::WorkerSWClientConnection::scheduleUnregisterJobInServer): * workers/service/context/ServiceWorkerFetch.cpp: (WebCore::ServiceWorkerFetch::dispatchFetchEvent): * workers/service/context/ServiceWorkerThread.cpp: (WebCore::ServiceWorkerThread::queueTaskToFireFetchEvent): (WebCore::ServiceWorkerThread::queueTaskToPostMessage): (WebCore::ServiceWorkerThread::queueTaskToFireInstallEvent): (WebCore::ServiceWorkerThread::queueTaskToFireActivateEvent): 2020-06-23 Chris Dumez Drop AudioContextBase class https://bugs.webkit.org/show_bug.cgi?id=213522 Reviewed by Geoffrey Garen. Drop AudioContextBase class and have WebKitAudioContext subclass the new BaseAudioContext class instead. We recently introduced BaseAudioContext to match the specification and keeping AudioContextBase is now confusing. No new tests, this simplifies our code but there is no Web-facing behavior change. * Modules/webaudio/AnalyserNode.cpp: (WebCore::AnalyserNode::AnalyserNode): * Modules/webaudio/AnalyserNode.h: * Modules/webaudio/AudioBasicInspectorNode.cpp: (WebCore::AudioBasicInspectorNode::AudioBasicInspectorNode): * Modules/webaudio/AudioBasicInspectorNode.h: * Modules/webaudio/AudioBasicProcessorNode.cpp: (WebCore::AudioBasicProcessorNode::AudioBasicProcessorNode): * Modules/webaudio/AudioBasicProcessorNode.h: * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::create): (WebCore::AudioBufferSourceNode::AudioBufferSourceNode): (WebCore::AudioBufferSourceNode::setBuffer): * Modules/webaudio/AudioBufferSourceNode.h: * Modules/webaudio/AudioContext.cpp: * Modules/webaudio/AudioDestinationNode.cpp: (WebCore::AudioDestinationNode::AudioDestinationNode): * Modules/webaudio/AudioDestinationNode.h: * Modules/webaudio/AudioNode.cpp: (WebCore::AudioNode::AudioNode): (WebCore::AudioNode::connect): (WebCore::AudioNode::disconnect): (WebCore::AudioNode::setChannelCount): (WebCore::AudioNode::setChannelCountMode): (WebCore::AudioNode::setChannelInterpretation): (WebCore::AudioNode::enableOutputsIfNecessary): * Modules/webaudio/AudioNode.h: (WebCore::AudioNode::context): (WebCore::AudioNode::context const): * Modules/webaudio/AudioNode.idl: * Modules/webaudio/AudioNodeOutput.h: (WebCore::AudioNodeOutput::context): * Modules/webaudio/AudioParam.cpp: (WebCore::AudioParam::AudioParam): * Modules/webaudio/AudioParam.h: * Modules/webaudio/AudioParamTimeline.cpp: (WebCore::AudioParamTimeline::valueForContextTime): * Modules/webaudio/AudioParamTimeline.h: * Modules/webaudio/AudioScheduledSourceNode.cpp: (WebCore::AudioScheduledSourceNode::AudioScheduledSourceNode): * Modules/webaudio/AudioScheduledSourceNode.h: * Modules/webaudio/AudioSummingJunction.cpp: (WebCore::AudioSummingJunction::AudioSummingJunction): * Modules/webaudio/AudioSummingJunction.h: (WebCore::AudioSummingJunction::context): * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::BaseAudioContext): (WebCore::BaseAudioContext::document const): (WebCore::BaseAudioContext::scriptExecutionContext const): * Modules/webaudio/BaseAudioContext.h: (WebCore::BaseAudioContext::isOfflineContext const): (WebCore::BaseAudioContext::isWebKitAudioContext const): (WebCore::BaseAudioContext::currentSampleFrame const): (WebCore::BaseAudioContext::currentTime const): (WebCore::BaseAudioContext::sampleRate const): (WebCore::BaseAudioContext::incrementConnectionCount): (WebCore::BaseAudioContext::setAudioThread): (WebCore::BaseAudioContext::isAudioThreadFinished): (WebCore::BaseAudioContext::behaviorRestrictions const): (WebCore::BaseAudioContext::addBehaviorRestriction): (WebCore::BaseAudioContext::removeBehaviorRestriction): (WebCore::BaseAudioContext::nextAudioNodeLogIdentifier): (WebCore::BaseAudioContext::nextAudioParameterLogIdentifier): (WebCore::BaseAudioContext::isStopped const): (WebCore::BaseAudioContext::AutoLocker::AutoLocker): (WebCore::BaseAudioContext::AutoLocker::~AutoLocker): * Modules/webaudio/BiquadFilterNode.cpp: (WebCore::BiquadFilterNode::BiquadFilterNode): * Modules/webaudio/BiquadFilterNode.h: * Modules/webaudio/BiquadProcessor.cpp: (WebCore::BiquadProcessor::BiquadProcessor): * Modules/webaudio/BiquadProcessor.h: * Modules/webaudio/ChannelMergerNode.cpp: (WebCore::ChannelMergerNode::create): (WebCore::ChannelMergerNode::ChannelMergerNode): * Modules/webaudio/ChannelMergerNode.h: * Modules/webaudio/ChannelSplitterNode.cpp: (WebCore::ChannelSplitterNode::create): (WebCore::ChannelSplitterNode::ChannelSplitterNode): * Modules/webaudio/ChannelSplitterNode.h: * Modules/webaudio/ConvolverNode.cpp: (WebCore::ConvolverNode::ConvolverNode): * Modules/webaudio/ConvolverNode.h: * Modules/webaudio/DefaultAudioDestinationNode.cpp: (WebCore::DefaultAudioDestinationNode::DefaultAudioDestinationNode): * Modules/webaudio/DefaultAudioDestinationNode.h: * Modules/webaudio/DelayNode.cpp: (WebCore::DelayNode::DelayNode): (WebCore::DelayNode::create): * Modules/webaudio/DelayNode.h: * Modules/webaudio/DelayProcessor.cpp: (WebCore::DelayProcessor::DelayProcessor): * Modules/webaudio/DelayProcessor.h: * Modules/webaudio/DynamicsCompressorNode.cpp: (WebCore::DynamicsCompressorNode::DynamicsCompressorNode): * Modules/webaudio/DynamicsCompressorNode.h: * Modules/webaudio/GainNode.cpp: (WebCore::GainNode::GainNode): * Modules/webaudio/GainNode.h: * Modules/webaudio/MediaElementAudioSourceNode.cpp: (WebCore::MediaElementAudioSourceNode::create): (WebCore::MediaElementAudioSourceNode::MediaElementAudioSourceNode): (WebCore::MediaElementAudioSourceNode::setFormat): * Modules/webaudio/MediaElementAudioSourceNode.h: * Modules/webaudio/MediaStreamAudioDestinationNode.cpp: (WebCore::MediaStreamAudioDestinationNode::create): (WebCore::MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode): * Modules/webaudio/MediaStreamAudioDestinationNode.h: * Modules/webaudio/MediaStreamAudioSourceNode.cpp: (WebCore::MediaStreamAudioSourceNode::create): (WebCore::MediaStreamAudioSourceNode::MediaStreamAudioSourceNode): * Modules/webaudio/MediaStreamAudioSourceNode.h: * Modules/webaudio/OfflineAudioDestinationNode.cpp: (WebCore::OfflineAudioDestinationNode::OfflineAudioDestinationNode): * Modules/webaudio/OfflineAudioDestinationNode.h: * Modules/webaudio/OscillatorNode.cpp: (WebCore::OscillatorNode::create): (WebCore::OscillatorNode::OscillatorNode): * Modules/webaudio/OscillatorNode.h: * Modules/webaudio/PannerNode.cpp: (WebCore::PannerNodeBase::PannerNodeBase): * Modules/webaudio/PannerNode.h: * Modules/webaudio/ScriptProcessorNode.cpp: (WebCore::ScriptProcessorNode::create): (WebCore::ScriptProcessorNode::ScriptProcessorNode): * Modules/webaudio/ScriptProcessorNode.h: * Modules/webaudio/WaveShaperNode.cpp: (WebCore::WaveShaperNode::WaveShaperNode): * Modules/webaudio/WaveShaperNode.h: * Modules/webaudio/WebKitAudioContext.cpp: (WebCore::WebKitAudioContext::WebKitAudioContext): (WebCore::WebKitAudioContext::createMediaElementSource): (WebCore::WebKitAudioContext::createMediaStreamSource): (WebCore::WebKitAudioContext::createMediaStreamDestination): (WebCore::WebKitAudioContext::createWebKitPanner): (WebCore::WebKitAudioContext::close): * Modules/webaudio/WebKitAudioContext.h: (isType): * Modules/webaudio/WebKitAudioContext.idl: * dom/EventTargetFactory.in: * testing/Internals.cpp: (WebCore::Internals::setAudioContextRestrictions): * testing/Internals.h: * testing/Internals.idl: 2020-06-22 Sergio Villar Senin [WebXR] Introducing XRLayer https://bugs.webkit.org/show_bug.cgi?id=213462 Reviewed by Youenn Fablet. The most recent drafts of the WebXR spec have added a new object called XRLayer which is the base class of the already known XRWebGLLayer. The spec only defines the latter but future extensions might define some other layer subclasses. This patch fixes several checks in the IDL tests. * CMakeLists.txt: Added new files. * DerivedSources.make: Ditto. * WebCore.xcodeproj/project.pbxproj: Ditto. * Modules/webxr/WebXRLayer.cpp: Added. (WebCore::WebXRLayer::WebXRLayer): * Modules/webxr/WebXRLayer.h: Ditto. * Modules/webxr/WebXRLayer.idl: Ditto. * Modules/webxr/WebXRSession.h: Export scriptExecutionContext() so it could be used from the outside. * Modules/webxr/WebXRWebGLLayer.cpp: (WebCore::WebXRWebGLLayer::WebXRWebGLLayer): Call the superclass. * Modules/webxr/WebXRWebGLLayer.h: Inherit from WebXRLayer. * Modules/webxr/WebXRWebGLLayer.idl: Ditto. * Sources.txt: Added new files. * bindings/js/WebCoreBuiltinNames.h: Added XRLayer. * dom/EventTargetFactory.in: Ditto. 2020-06-23 Devin Rousso Keyframe animation doesn't 't show up in the Animations timeline https://bugs.webkit.org/show_bug.cgi?id=213441 Reviewed by Brian Burg. Test: inspector/animation/lifecycle-css-animation.html * inspector/agents/InspectorAnimationAgent.cpp: (WebCore::buildObjectForEffect): 2020-06-23 Sergio Villar Senin [css-flex] Allow indefinite size flex items to be definite wrt resolving percentages inside them https://bugs.webkit.org/show_bug.cgi?id=212264 Reviewed by Manuel Rego Casasnovas. Implement https://github.com/w3c/csswg-drafts/commit/5b5db39d21f3658ae2f4d7992daaf822aca178d8 which modified the way percentages were resolved in flexible items with indefinite sizes. From now on we can pretend that they're really definite. This allows us to mark 3 tests which were testing percentages in flex items as correct. Based on Blink's crrev.com/1247184 by This is a reland of r262124 which got reverted due to the bug fixed in r263389. * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::mainSizeForPercentageResolution): Do only check flex container main size definiteness when computing the main size for percentage resolution, no need to check flex basis at all. 2020-06-18 Sergio Villar Senin REGRESSION (r262124): Twitter videos go blank after exiting fullscreen https://bugs.webkit.org/show_bug.cgi?id=213110 Reviewed by Darin Adler. Test: fullscreen/video-inside-flex-item.html Setting/unsetting position:absolute on a flex/grid item can potentially create/remove flex/grid items because absolutely positioned children of those containers are out-of-flow and thus, do not generate flex/grid items. Flex/grid items are potentially stretched by their containers so the style recalculation is not enough to get a correct layout because the override size set by flex/grid containers is not reset. In the particular case of this bug we had this hierarchy (highly simplified from twitter page): Flexbox container |___DIV (absolutelly positioned) |___