-
Notifications
You must be signed in to change notification settings - Fork 163
Closed
Description
The VideoColorSpaceInit definition does not allow fields to be null, but since the fields are optional they can be set to undefined:
dictionary VideoColorSpaceInit {
VideoColorPrimaries primaries;
VideoTransferCharacteristics transfer;
VideoMatrixCoefficients matrix;
boolean fullRange;
};
VideoColorSpace, however, has nullable fields:
interface VideoColorSpace {
readonly attribute VideoColorPrimaries? primaries;
readonly attribute VideoTransferCharacteristics? transfer;
readonly attribute VideoMatrixCoefficients? matrix;
readonly attribute boolean? fullRange;
...
};
As a result, missing values can become null, and a VideoColorSpace cannot be reliably used in place of a VideoColorSpaceInit. This same pattern appears in several different places in WebCodecs.
The two fixes I can see are:
- Change the interfaces to allow undefined but not null.
- Change the dictionaries to allow null.
I'm leaning towards (2) as the least surprising option. Any objections?
Metadata
Metadata
Assignees
Labels
No labels