Bug 1308436 - Allow inserting an event strictly after the a value curve. r?karlt draft
authorPaul Adenot <paul@paul.cx>
Thu, 26 Jul 2018 14:29:16 +0200
changeset 824302 c4f30d22fef0d060b8e61ca5e6a532aa82453307
parent 824301 fbc877e07d2866a85dba04a611e43441471f9364
child 824303 af6bc52da43983d9383f3a0dc4e63006768dbd1b
push id117873
push userpaul@paul.cx
push dateMon, 30 Jul 2018 16:35:38 +0000
reviewerskarlt
bugs1308436
milestone63.0a1
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
dom/media/webaudio/AudioEventTimeline.h
--- 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) {