2021-06-18 Philippe Normand [MSE][GStreamer] Soundcloud serves MP4 audio with empty tfdt boxes https://bugs.webkit.org/show_bug.cgi?id=191419 Reviewed by Michael Catanzaro. When MSE is used the player receives broken audio fragments, perhaps because the server expects the client to repair them. Not much we can do about this on GStreamer side though, so behave as a Chrome UserAgent and then MSE is not used, the player receives an MP3 stream. * platform/UserAgentQuirks.cpp: (WebCore::urlRequiresChromeBrowser): 2021-05-21 Chris Lord [GTK] REGRESSION: Broken scrolling on element.io with async scrolling https://bugs.webkit.org/show_bug.cgi?id=222265 Reviewed by Carlos Garcia Campos. Fix transform order for layer clipping in TextureMapperLayer. No new tests. * platform/graphics/texmap/TextureMapperLayer.cpp: (WebCore::TextureMapperLayer::paintSelfAndChildren): 2021-05-15 Alexander Mikhaylenko [GTK] REGRESSION: Kinetic scrolling on touchpad doesn't work with async scrolling off https://bugs.webkit.org/show_bug.cgi?id=224182 Reviewed by Michael Catanzaro. Don't clear the scroll history every time we scroll, that defeats the whole point of having the scroll history. * platform/generic/ScrollAnimatorGeneric.cpp: (WebCore::ScrollAnimatorGeneric::scrollToPositionWithoutAnimation): 2021-06-15 Philippe Normand [GStreamer] Another crash under gst_element_add_pad https://bugs.webkit.org/show_bug.cgi?id=225765 Reviewed by Adrian Perez de Castro. Decodebin3 in GStreamer <= 1.16 does not respect user-supplied select-stream events. So we need to relax the release assert for these versions. This bug was fixed in: https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/commit/b41b87522f59355bb21c001e9e2df96dc6956928 * platform/graphics/gstreamer/ImageDecoderGStreamer.cpp: (WebCore::ImageDecoderGStreamer::InnerDecoder::connectDecoderPad): 2021-05-24 Zan Dobersek GLContextEGL::swapBuffers() shouldn't do anything for Surfaceless contexts https://bugs.webkit.org/show_bug.cgi?id=226164 Reviewed by Philippe Normand. In case of a surfaceless GLContextEGL, the swapBuffers() method should return early, avoiding an assert expecting a non-null EGLSurface (not viable for surfaceless context) and a call to eglSwapBuffers(), which on some drivers could still fail even when the surfaceless context support is present and active. * platform/graphics/egl/GLContextEGL.cpp: (WebCore::GLContextEGL::swapBuffers): 2021-05-07 Chris Dumez AudioWorkletProcessor which does not extend base class crashes Safari https://bugs.webkit.org/show_bug.cgi?id=225449 Reviewed by Sam Weinig. Update AudioWorkletGlobalScope::createProcessor() to validate the type of the processor after constructing it. * Modules/webaudio/AudioWorkletGlobalScope.cpp: (WebCore::AudioWorkletGlobalScope::createProcessor): 2021-05-06 Philippe Normand [WebAudio][GStreamer] socketpair leaks https://bugs.webkit.org/show_bug.cgi?id=225463 Reviewed by Žan Doberšek. * platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp: (WebCore::AudioSourceProviderGStreamer::~AudioSourceProviderGStreamer): Properly dispose of the GStreamer pipeline and the resources it has hold on. * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp: (webKitWebAudioSrcChangeState): The ref returned by gst_buffer_pool_new() is transfer-full, so we need to adopt it here. 2021-05-06 Philippe Normand [GStreamer] Fallback to texture mapper video orientation handling when glvideoflip is not available https://bugs.webkit.org/show_bug.cgi?id=225454 Reviewed by Xabier Rodriguez-Calvar. r275412 introduced a new runtime dependency on gst-plugins-good's glvideoflip element, which is not desirable for the 2.32 branch. This patch let's the player handle rotation tags if the glvideoflip element wasn't found at runtime. Ideally we should probably not rely on glvideoflip in the first place as it might induce a performance impact, to be handled in a follow-up patch. * platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp: (webKitGLVideoSinkConstructed): (webKitGLVideoSinkGetProperty): (webkit_gl_video_sink_class_init): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::createVideoSinkGL): 2021-05-05 Carlos Garcia Campos [SOUP] Wrong cookie timestamp in case of long expire time https://bugs.webkit.org/show_bug.cgi?id=225389 Reviewed by Adrian Perez de Castro. There's an overflow when converting the dates in both libsoup2 and libsoup3, but for two different reasons. In the case of libsoup2 we are using an int for the conversion of milliseconds to seconds which is not enough. In the case of libsoup3 we are passing the value in milliseconds to g_date_time_new_from_unix_utc() that expects seconds. * platform/network/soup/CookieSoup.cpp: (WebCore::msToSoupDate): Use int64_t instead of int for the cast. (WebCore::Cookie::toSoupCookie const): Convert the value to seconds. 2021-04-22 Carlos Garcia Campos [GTK][WPE] Bump libsoup3 version to 2.99.4 https://bugs.webkit.org/show_bug.cgi?id=224925 Reviewed by Philippe Normand. Update to use the new API. * platform/network/soup/ResourceResponseSoup.cpp: (WebCore::ResourceResponse::ResourceResponse): * platform/network/soup/SoupVersioning.h: (soup_message_get_tls_peer_certificate): (soup_message_get_tls_peer_certificate_errors): (soup_message_get_tls_certificate): Deleted. (soup_message_get_tls_certificate_errors): Deleted. 2021-04-09 Carlos Garcia Campos [GTK][WPE] Bump libsoup3 version to 2.99.3 https://bugs.webkit.org/show_bug.cgi?id=224362 Reviewed by Žan Doberšek. * platform/network/soup/GUniquePtrSoup.h: * platform/network/soup/ResourceResponseSoup.cpp: (WebCore::ResourceResponse::platformSuggestedFilename const): 2021-05-03 Philippe Normand [GTK] Build with VIDEO=OFF fails https://bugs.webkit.org/show_bug.cgi?id=225316 Reviewed by Adrian Perez de Castro. * platform/audio/PlatformMediaSession.cpp: (WebCore::isPlayingAudio): Guard against invalid media types, when video is disabled we can safely return false here as well. * platform/graphics/opengl/GraphicsContextGLOpenGL.h: Include what we use (UniqueRef). 2021-04-16 Basuke Suzuki [PlayStation][OpenSSL] Remove warnings. https://bugs.webkit.org/show_bug.cgi?id=224630 Reviewed by Don Olmstead. There're two kinds of warnings in curl and openssl layer in our platform. a) Unused param b) '__WORDSIZE' is not defined. warning: '__WORDSIZE' is not defined, evaluates to 0 [-Wundef] #if __WORDSIZE >= 64 ^ No new tests because it's only for compilation issue. * crypto/algorithms/CryptoAlgorithmAES_GCM.cpp: (WebCore::CryptoAlgorithmAES_GCM::encrypt): (WebCore::CryptoAlgorithmAES_GCM::decrypt): * crypto/openssl/CryptoKeyECOpenSSL.cpp: (WebCore::CryptoKeyEC::platformGeneratePair): (WebCore::CryptoKeyEC::platformImportRaw): (WebCore::CryptoKeyEC::platformImportJWKPublic): (WebCore::CryptoKeyEC::platformImportJWKPrivate): (WebCore::CryptoKeyEC::platformImportSpki): (WebCore::CryptoKeyEC::platformImportPkcs8): * crypto/openssl/CryptoKeyRSAOpenSSL.cpp: (WebCore::CryptoKeyRSA::create): (WebCore::CryptoKeyRSA::generatePair): (WebCore::CryptoKeyRSA::importSpki): (WebCore::CryptoKeyRSA::importPkcs8): 2021-04-16 Basuke Suzuki Use WebKit macro to detect 64bit in RenderLayerBacking.h https://bugs.webkit.org/show_bug.cgi?id=224707 Reviewed by Yusuke Suzuki. There's no definition of __WORDSIZE in some environment. Also there's WebKit macro for that. > warning: '__WORDSIZE' is not defined, evaluates to 0 [-Wundef] > #if __WORDSIZE == 64 && PLATFORM(COCOA) > ^ No test because it's compiler behavior. * rendering/RenderLayerBacking.h: 2021-04-22 Sergio Villar Senin Do not set synchronous scrolling for layers without relevant scrolling scopes https://bugs.webkit.org/show_bug.cgi?id=221383 Reviewed by Simon Fraser. Fixed backgrounds could force the layer compositor to set synchronous scrolling because they're slow to repaint. However that cannot be done if the layer's boxScrollingScope hasn't been previously updated in RenderLayer::updateLayerPosition. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateSynchronousScrollingNodes): Do not call setSynchronousScrollingReasons() if there is no scrollingScope. 2021-04-22 Alejandro G. Castro REGRESSION(r275790) [GTK][WPE] Scrolling rendering fails after the second page https://bugs.webkit.org/show_bug.cgi?id=224824 Reviewed by Simon Fraser. We are making the implementation more similar to the Apple scrolling coordinator. Now we reimplement willStartRenderingUpdate to be able to synchronize the state there. That way we can avoid the timer and just schedule a rendering update when we want to commit the tree state. Test: Fixes the timeout of the overflow-scrollable-after-back.html, added in the regression. * page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp: (WebCore::ScrollingCoordinatorNicosia::ScrollingCoordinatorNicosia): (WebCore::ScrollingCoordinatorNicosia::pageDestroyed): (WebCore::ScrollingCoordinatorNicosia::commitTreeStateIfNeeded): (WebCore::ScrollingCoordinatorNicosia::scheduleTreeStateCommit): (WebCore::ScrollingCoordinatorNicosia::willStartRenderingUpdate): (WebCore::ScrollingCoordinatorNicosia::commitTreeState): Deleted. * page/scrolling/nicosia/ScrollingCoordinatorNicosia.h: 2021-04-09 Simon Fraser scrollingTreeNodeDidScroll() should just trigger a rendering udpate https://bugs.webkit.org/show_bug.cgi?id=224394 Reviewed by Tim Horton. After handling wheel events on the scrolling thread, ThreadedScrollingTree::scrollingTreeNodeDidScroll() appends to a queue of pending updates and then triggers applyPendingScrollUpdates() on the main thread to process those updates. However, every rendering update also processes pending scroll updates via synchronizeStateFromScrollingTree(), so it's simpler if we just trigger a rendering update. * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::scrollingThreadAddedPendingUpdate): (WebCore::AsyncScrollingCoordinator::scheduleRenderingUpdate): * page/scrolling/AsyncScrollingCoordinator.h: * page/scrolling/ThreadedScrollingTree.cpp: (WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll): * page/scrolling/mac/ScrollingCoordinatorMac.mm: (WebCore::ScrollingCoordinatorMac::scheduleTreeStateCommit): * page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp: (WebCore::ScrollingCoordinatorNicosia::scheduleTreeStateCommit): 2021-04-06 Mike Gorse Build fails when video is disabled https://bugs.webkit.org/show_bug.cgi?id=224198 Reviewed by Adrian Perez de Castro. Add #if ENABLE(VIDEO) where needed. * editing/markup.cpp: (WebCore::createPageForSanitizingWebContent): * page/Page.cpp: * page/Page.h: * platform/graphics/GraphicsContext.cpp: * platform/graphics/GraphicsContext.h: * platform/graphics/GraphicsContextGL.h: * platform/graphics/GraphicsContextImpl.h: * platform/graphics/cairo/GraphicsContextImplCairo.cpp: * platform/graphics/cairo/GraphicsContextImplCairo.h: * platform/graphics/displaylists/DisplayList.cpp: (WebCore::DisplayList::DisplayList::append): * platform/graphics/displaylists/DisplayListItemBuffer.cpp: (WebCore::DisplayList::ItemHandle::apply): (WebCore::DisplayList::ItemHandle::destroy): (WebCore::DisplayList::ItemHandle::safeCopy const): * platform/graphics/displaylists/DisplayListItemType.cpp: (WebCore::DisplayList::sizeOfItemInBytes): (WebCore::DisplayList::isDrawingItem): (WebCore::DisplayList::isInlineItem): * platform/graphics/displaylists/DisplayListItemType.h: * platform/graphics/displaylists/DisplayListItems.cpp: (WebCore::DisplayList::operator<<): * platform/graphics/displaylists/DisplayListItems.h: * platform/graphics/displaylists/DisplayListRecorder.cpp: * platform/graphics/displaylists/DisplayListRecorder.h: * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp: * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h: * platform/graphics/opengl/GraphicsContextGLOpenGL.cpp: * platform/graphics/opengl/GraphicsContextGLOpenGL.h: * platform/graphics/win/GraphicsContextImplDirect2D.cpp: * platform/graphics/win/GraphicsContextImplDirect2D.h: * svg/graphics/SVGImage.cpp: (WebCore::SVGImage::dataChanged): 2021-03-28 Philippe Normand REGRESSION(r274527): [GStreamer] media/webaudio-background-playback.html now failing https://bugs.webkit.org/show_bug.cgi?id=223840 Reviewed by Chris Dumez. r274527 actually exposed a bug that was present since r271197. The AudioDestination pipeline was not stopping properly because webkitGstSetElementStateSynchronously() was returning too early. This patch also includes a few improvements in the webaudiosrc element, most notably regarding its preroll state. The element now stops emitting buffers downstream as soon as the AudioDestination is scheduled to stop. * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp: (webKitWebAudioSrcRenderAndPushFrames): Return early as soon as the destination is scheduled to stop. (webKitWebAudioSrcChangeState): Synchronize preroll state with element state. * platform/graphics/gstreamer/GStreamerCommon.cpp: (WebCore::webkitGstSetElementStateSynchronously): targetState might be lower than current state, e.g, when stopping a running pipeline, so we can't return early for those cases, otherwise the pipeline won't stop. 2021-04-07 Philippe Normand [GStreamer] Videos start playing muted in epiphany with no unmute icon visible in tab, webkit_web_view_get_is_muted() returns incorrect results https://bugs.webkit.org/show_bug.cgi?id=223195 Reviewed by Eric Carlson. For GStreamer ports the semantics of IsPlayingAudio slightly differ from Apple ports. The webkit_web_view_is_playing_audio() API is expected to return true if a page is producing audio even though it might be muted. The second change affects the private player mute state when the page mute state has been updated. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::mediaState const): (WebCore::HTMLMediaElement::pageMutedStateDidChange): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: Logging improvements. (WebCore::MediaPlayerPrivateGStreamer::isMuted const): (WebCore::MediaPlayerPrivateGStreamer::volume const): (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVolumeChange): (WebCore::MediaPlayerPrivateGStreamer::setMuted): (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfMute): 2021-04-06 Philippe Normand REGRESSION(r274358) [GStreamer] http/tests/images/mp4-partial-load.html is flaky crashing inside GStreamer https://bugs.webkit.org/show_bug.cgi?id=223636 Reviewed by Carlos Alberto Lopez Perez. Ensure the GStreamer messages are always processed synchronously, even when the handler is called from another thread. Without blocking in the latter case, the select-streams event might be sent to decodebin too late. It has to be sent as a synchronous reaction to the stream-collection message. * platform/graphics/gstreamer/ImageDecoderGStreamer.cpp: (WebCore::ImageDecoderGStreamer::InnerDecoder::handleMessage): (WebCore::ImageDecoderGStreamer::InnerDecoder::preparePipeline): * platform/graphics/gstreamer/ImageDecoderGStreamer.h: 2021-04-29 Adrian Perez de Castro Unreviewed build fix after r276749 * Modules/webaudio/MediaStreamAudioSourceGStreamer.cpp: (WebCore::copyBusData): Remove usage of DisableMallocRestrictionsForCurrentThreadScope guard, which is a type not available in the 2.32 release branch. 2021-04-06 Philippe Normand [GStreamer][WebRTC] Audio is not played from an audio element when the srcObject object has unstarted video tracks https://bugs.webkit.org/show_bug.cgi?id=209163 Reviewed by Xabier Rodriguez-Calvar. Ensure no MediaStream (active) video tracks can be added in a pipeline representing an