Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: c5b0051e172e0ea5bab5188bddc403bbd03a09b0
https://github.com/WebKit/WebKit/commit/c5b0051e172e0ea5bab5188bddc403bbd03a09b0
Author: Ahmad Saleem <[email protected]>
Date: 2026-08-09 (Sun, 09 Aug 2026)
Changed paths:
A
LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audioparam-interface/audioparam-zero-duration-ramp-expected.txt
A
LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audioparam-interface/audioparam-zero-duration-ramp.html
M Source/WebCore/Modules/webaudio/AudioParamTimeline.cpp
Log Message:
-----------
Zero-duration exponentialRampToValueAtTime() at a non-frame-aligned time
renders NaN
https://bugs.webkit.org/show_bug.cgi?id=321383
rdar://184434164
Reviewed by Chris Dumez.
This patch aligns WebKit with Gecko / Firefox and Blink / Chromium.
Coincident automation event times are legal, so an exponential ramp can have
zero
duration. processExponentialRamp() had no guard for that, unlike
processLinearRamp().
With deltaTime == 0 the per-sample multiplier is infinite and the starting
value's
exponent is 0 / 0. When the event time is not frame-aligned the write cursor is
already
at fillToFrame, so the sample loop runs zero times -- but the trailing restore
step keys
off writeIndex rather than off whether the loop ran, and computes inf / inf.
isEventCurrent()
then skips the ramp, so the branch that would reset the value never runs; a
following
setTargetAtTime() writes the NaN to the output until it force-converges after
10 time
constants.
Guard deltaTime the way processLinearRamp() does. A zero-duration ramp has no
frames left
to interpolate, so the value is value2 -- which is also what WebKit already
produces when
the same events are frame-aligned.
Test:
imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audioparam-interface/audioparam-zero-duration-ramp.html
*
LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audioparam-interface/audioparam-zero-duration-ramp-expected.txt:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audioparam-interface/audioparam-zero-duration-ramp.html:
Added.
* Source/WebCore/Modules/webaudio/AudioParamTimeline.cpp:
(WebCore::AudioParamTimeline::processExponentialRamp):
Canonical link: https://commits.webkit.org/318868@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications