Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: be4009feb0c469264698b51c4e48757a8327df12
      
https://github.com/WebKit/WebKit/commit/be4009feb0c469264698b51c4e48757a8327df12
  Author: Gerald Squelart <[email protected]>
  Date:   2026-07-06 (Mon, 06 Jul 2026)

  Changed paths:
    A 
LayoutTests/fast/canvas/offscreencanvas-in-dedicated-worker-readback-expected.txt
    A LayoutTests/fast/canvas/offscreencanvas-in-dedicated-worker-readback.html
    A 
LayoutTests/fast/canvas/offscreencanvas-in-shared-worker-readback-expected.txt
    A LayoutTests/fast/canvas/offscreencanvas-in-shared-worker-readback.html
    A 
LayoutTests/fast/canvas/resources/offscreencanvas-readback-shared-worker.js
    A LayoutTests/fast/canvas/resources/offscreencanvas-readback-worker.js
    A 
LayoutTests/http/wpt/service-workers/offscreencanvas-in-separate-service-worker-process-cpu-fallback.https-expected.txt
    A 
LayoutTests/http/wpt/service-workers/offscreencanvas-in-separate-service-worker-process-cpu-fallback.https.html
    A 
LayoutTests/http/wpt/service-workers/offscreencanvas-in-separate-service-worker-process-worker.js
    A 
LayoutTests/http/wpt/service-workers/offscreencanvas-in-separate-service-worker-process.https-expected.txt
    A 
LayoutTests/http/wpt/service-workers/offscreencanvas-in-separate-service-worker-process.https.html
    M LayoutTests/platform/win/TestExpectations
    M Source/WebCore/html/CanvasBase.cpp
    M Source/WebCore/platform/graphics/ImageBuffer.cpp
    M Source/WebCore/platform/graphics/ImageBuffer.h
    M Source/WebCore/testing/ServiceWorkerInternals.cpp
    M Source/WebCore/testing/ServiceWorkerInternals.h
    M Source/WebCore/testing/ServiceWorkerInternals.idl
    M Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferProxy.h
    M Source/WebKit/WebProcess/WebCoreSupport/WebWorkerClient.cpp

  Log Message:
  -----------
  Worker OffscreenCanvas crashes in a page-less worker process
https://bugs.webkit.org/show_bug.cgi?id=318403
rdar://173713514

Reviewed by Dan Glastonbury.

A 2D OffscreenCanvas used by a shared or service worker that was running
in its own process was backed by a local accelerated IOSurface ImageBuffer
in that worker's WebContent process.
Reading that canvas back (convertToBlob/getImageData) flushed deferred
CoreAnimation draws in-process, but The WebContent sandbox denies the
com.apple.MTLCompilerService calls, so CoreAnimation aborted and the
process crashed at CA::OGL::MetalContext::create_fragment_shader.

Fix GPUProcessWebWorkerClient::createImageBuffer to return an
unaccelerated ImageBuffer instead of nullptr when the buffer cannot be
remoted to the GPU process. This keeps the worker from ever creating a
local IOSurface-backed canvas, so no in-process CoreAnimation/Metal work
is triggered.

(This change here just removes the crash; A future change could instead
remote worker canvases to the GPU process to retain acceleration, see
bug 318656.)

* 
LayoutTests/fast/canvas/offscreencanvas-in-dedicated-worker-readback-expected.txt:
 Added.
* LayoutTests/fast/canvas/offscreencanvas-in-dedicated-worker-readback.html: 
Added.
* 
LayoutTests/fast/canvas/offscreencanvas-in-shared-worker-readback-expected.txt: 
Added.
* LayoutTests/fast/canvas/offscreencanvas-in-shared-worker-readback.html: Added.
* LayoutTests/fast/canvas/resources/offscreencanvas-readback-shared-worker.js: 
Added.
* LayoutTests/fast/canvas/resources/offscreencanvas-readback-worker.js: Added.
* 
LayoutTests/http/wpt/service-workers/offscreencanvas-in-separate-service-worker-process-cpu-fallback.https-expected.txt:
 Added.
* 
LayoutTests/http/wpt/service-workers/offscreencanvas-in-separate-service-worker-process-cpu-fallback.https.html:
 Added.
* 
LayoutTests/http/wpt/service-workers/offscreencanvas-in-separate-service-worker-process-worker.js:
 Added.
* 
LayoutTests/http/wpt/service-workers/offscreencanvas-in-separate-service-worker-process.https-expected.txt:
 Added.
* 
LayoutTests/http/wpt/service-workers/offscreencanvas-in-separate-service-worker-process.https.html:
 Added.
* LayoutTests/platform/win/TestExpectations:
* Source/WebCore/html/CanvasBase.cpp:
(WebCore::CanvasBase::makeRenderingResultsAvailable):
* Source/WebCore/platform/graphics/ImageBuffer.cpp:
(WebCore::ImageBuffer::isRemoteImageBufferProxy const):
* Source/WebCore/platform/graphics/ImageBuffer.h:
* Source/WebCore/testing/ServiceWorkerInternals.cpp:
(WebCore::ServiceWorkerInternals::effectiveRenderingModeOfNewlyCreatedAcceleratedCanvasBuffer):
* Source/WebCore/testing/ServiceWorkerInternals.h:
* Source/WebCore/testing/ServiceWorkerInternals.idl:
* Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferProxy.h:
* Source/WebKit/WebProcess/WebCoreSupport/WebWorkerClient.cpp:
(WebKit::GPUProcessWebWorkerClient::createImageBuffer const):

Canonical link: https://commits.webkit.org/316585@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to