Skip to content

Can't describe required [EnforceRange] typename attributeName #2705

@padenot

Description

@padenot

This stems from w3c/webcodecs#488

STR

  • Have a fragment like this:
<xmp class='idl'>
dictionary PlaneLayout {
  required [EnforceRange] unsigned long offset;
  required [EnforceRange] unsigned long stride;
};
</xmp>

: <dfn dict-member for=PlaneLayout>offset</dfn>
:: The offset in bytes where the given plane begins within a {{BufferSource}}.

: <dfn dict-member for=PlaneLayout>stride</dfn>
:: The number of bytes, including padding, used by each row of the plane within
    a {{BufferSource}}.

Expected

  • it works, everything is linked appropriately

Actual

$ bikeshed --die-on=warning spec index.src.html index.html
LINK ERROR: No 'idl-name' refs found for '[EnforceRange] unsigned long'.
<a data-link-type="idl-name" data-lt="[EnforceRange] unsigned long">[EnforceRange] unsigned long</a>
 ✘  Did not generate, due to errors exceeding the allowed error level.
make: *** [index.html] Error 2

bikeshed attempts to reference a type that's [EnforceRange] unsigned long and that's not a thing.

Instead, we have to write:

<xmp class='idl'>
dictionary PlaneLayout {
  [EnforceRange] required unsigned long offset;
  [EnforceRange] required unsigned long stride;
};
</xmp>

: <dfn dict-member for=PlaneLayout>offset</dfn>
:: The offset in bytes where the given plane begins within a {{BufferSource}}.

: <dfn dict-member for=PlaneLayout>stride</dfn>
:: The number of bytes, including padding, used by each row of the plane within
    a {{BufferSource}}.

with [EnforceRange] and required swapped, which is incorrect WebIDL.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions