Skip to content

Parser doesn't accept the correct syntax for required [XAttr] typename attributename; #70

@padenot

Description

@padenot

Here are two fragments of WebCodecs WebIDL:

dictionary AudioDecoderConfig {
  required DOMString codec;
  [EnforceRange] required unsigned long sampleRate;
  [EnforceRange] required unsigned long numberOfChannels;
  BufferSource description;
};

and

dictionary AudioDecoderConfig {
  required DOMString codec;
  required [EnforceRange] unsigned long sampleRate;
  required [EnforceRange] unsigned long numberOfChannels;
  BufferSource description;
};

The former is incorrect per spec, and the latter is the correct way to do this. Chromium's parser accepts the correct syntax (https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/modules/webcodecs/audio_decoder_config.idl;l=10-22?q=audiodecoderconfig&ss=chromium&start=11 is what they have in tree). Similarly, Firefox's WebIDL parser only accepts the correct syntax.

widlparser only seem to accept the syntax of the former example, and this is what we have in the spec today, but we'd like to merge w3c/webcodecs#488 to align with actual implementations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions