Bug 1308436 - Allow inserting an event strictly after the a value curve. r?karlt
From the spec:
> If setValueCurveAtTime() is called for time T and duration D and there are any
> events having a time greater than T, but less than T+D, then a NotSupportedError
> exception MUST be thrown. In other words, it’s not ok to schedule a value curve
> during a time period containing other events.
i.e., "less" and not "less or equal to". It is valid to place an event exactly
at T+D.
MozReview-Commit-ID: AjgZR1pywwC
--- a/dom/media/webaudio/AudioEventTimeline.h
+++ b/dom/media/webaudio/AudioEventTimeline.h
@@ -164,18 +164,18 @@ public:
// Make sure that non-curve events don't fall within the duration of a
// curve event.
for (unsigned i = 0; i < mEvents.Length(); ++i) {
if (mEvents[i].mType == AudioTimelineEvent::SetValueCurve &&
!(aEvent.mType == AudioTimelineEvent::SetValueCurve &&
TimeOf(aEvent) == TimeOf(mEvents[i])) &&
TimeOf(mEvents[i]) <= TimeOf(aEvent) &&
- TimeOf(mEvents[i]) + mEvents[i].mDuration >= TimeOf(aEvent)) {
- aRv.Throw(NS_ERROR_DOM_SYNTAX_ERR);
+ TimeOf(mEvents[i]) + mEvents[i].mDuration > TimeOf(aEvent)) {
+ aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
return false;
}
}
// Make sure that curve events don't fall in a range which includes other
// events.
if (aEvent.mType == AudioTimelineEvent::SetValueCurve) {
for (unsigned i = 0; i < mEvents.Length(); ++i) {