Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: a0b5d79d7218d0f0405aa3c516d701a9e286c3cd
https://github.com/WebKit/WebKit/commit/a0b5d79d7218d0f0405aa3c516d701a9e286c3cd
Author: Chris Dumez <[email protected]>
Date: 2026-08-04 (Tue, 04 Aug 2026)
Changed paths:
M LayoutTests/TestExpectations
M
LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audioworklet-interface/audioworkletglobalscope-creation-time.https-expected.txt
M Source/WebCore/Modules/webaudio/AudioWorkletGlobalScope.cpp
M Source/WebCore/Modules/webaudio/AudioWorkletMessagingProxy.cpp
M Source/WebCore/worklets/WorkletParameters.h
Log Message:
-----------
AudioWorkletGlobalScope.currentFrame is 0 when a worklet is created while the
context is suspended
https://bugs.webkit.org/show_bug.cgi?id=320971
Reviewed by Darin Adler.
AudioWorkletGlobalScope::m_currentFrame starts at 0 and is only updated in
handlePostRenderTasks(), which runs at the end of each render quantum. Because
the worklet global scope is created lazily by audioWorklet.addModule(), a
worklet
created after the AudioContext is suspended never runs a render quantum, so its
currentFrame stayed at 0 instead of reflecting the context's current frame.
Fix this by seeding the worklet global scope's frame from the context's current
sample frame at creation time. Once rendering starts (or resumes),
handlePostRenderTasks() takes over updating m_currentFrame as before.
No new tests, rebaselined existing test. This WPT test was already passing
in Chrome and Firefox.
* LayoutTests/TestExpectations:
*
LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audioworklet-interface/audioworkletglobalscope-creation-time.https-expected.txt:
* Source/WebCore/Modules/webaudio/AudioWorkletGlobalScope.cpp:
(WebCore::AudioWorkletGlobalScope::AudioWorkletGlobalScope):
* Source/WebCore/Modules/webaudio/AudioWorkletMessagingProxy.cpp:
(WebCore::generateWorkletParameters):
* Source/WebCore/worklets/WorkletParameters.h:
(WebCore::WorkletParameters::isolatedCopy const):
(WebCore::WorkletParameters::isolatedCopy):
Canonical link: https://commits.webkit.org/318601@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications