Skip to content

Commit 142c506

Browse files
committed
Reject promise instead of throwing
1 parent 33f79ae commit 142c506

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

index.src.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3756,10 +3756,10 @@
37563756
were returned.
37573757

37583758
When invoked, run these steps:
3759-
1. If {{platform object/[[Detached]]}} is `true`, throw an
3760-
{{InvalidStateError}} {{DOMException}}.
3761-
2. If {{VideoFrame/[[format]]}} is `null`, throw a {{NotSupportedError}}
3762-
{{DOMException}}.
3759+
1. If {{platform object/[[Detached]]}} is `true`, return a promise rejected
3760+
with a {{InvalidStateError}} {{DOMException}}.
3761+
2. If {{VideoFrame/[[format]]}} is `null`, return a promise rejected with a
3762+
{{NotSupportedError}} {{DOMException}}.
37633763
3. Let |combinedLayout| be the result of running the [=Parse
37643764
VideoFrameCopyToOptions=] algorithm with |options|.
37653765
4. If |combinedLayout| is an exception, return a promise rejected with
@@ -3778,7 +3778,7 @@
37783778
4. Return the result of calling {{VideoFrame/copyTo()}} on |rgbFrame| with
37793779
|destination| and |newOptions|.
37803780
7. Otherwise, if |options|.{{VideoFrameCopyToOptions/format}} is not `undefined` or `null`
3781-
throw a {{NotSupportedError}} {{DOMException}}.
3781+
return a promise rejected with a {{NotSupportedError}} {{DOMException}}.
37823782
8. Let |p| be a new {{Promise}}.
37833783
9. Let |copyStepsQueue| be the result of starting a new [=parallel queue=].
37843784
10. Let |planeLayouts| be a new [=list=].
@@ -4206,9 +4206,9 @@
42064206
9. Return |combinedLayout|.
42074207

42084208
: <dfn for=VideoFrame>Convert to RGB frame</dfn> (with |frame|, |format| and |colorSpace|)
4209-
:: 1. If |format| is not equal to one {{RGBA}}, {{RGBX}}, {{BGRA}}, {{BGRX}},
4210-
throw a {{NotSupportedError}}
4211-
1. Let |convertedFrame| be a new {{VideoFrame}}, constructed as follows:
4209+
:: 1. This algorithm <em class="rfc2119">MUST</em> be called only if |format|
4210+
is equal to one of {{RGBA}}, {{RGBX}}, {{BGRA}}, {{BGRX}}.
4211+
2. Let |convertedFrame| be a new {{VideoFrame}}, constructed as follows:
42124212
1. Assign `false` to {{platform object/[[Detached]]}}.
42134213
2. Assign |format| to {{VideoFrame/[[format]]}}.
42144214
3. Let |width| be |frame|'s {{VideoFrame/[[visible width]]}}.
@@ -4227,7 +4227,7 @@
42274227
{{VideoFrame/[[resource reference]]}} into a color space and pixel
42284228
format specified by |colorSpace| and |format| respectively.
42294229
9. Assign the reference to |resource| to {{VideoFrame/[[resource reference]]}}
4230-
2. Return |convertedFrame|.
4230+
3. Return |convertedFrame|.
42314231

42324232
: <dfn for=VideoFrame>Copy VideoFrame metadata</dfn> (with |metadata|)
42334233
:: 1. Let |metadataCopySerialized| be [$StructuredSerialize$](|metadata|).

0 commit comments

Comments
 (0)