Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EnforceRange] required is out of spec #488

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ChunMinChang
Copy link
Member

@ChunMinChang ChunMinChang commented Apr 28, 2022

By the spec here [1], it seems [EnforceRange] required * should be
replaced by required [EnforceRange] *.

[1] https://webidl.spec.whatwg.org/#extended-attributes-applicable-to-types


Preview | Diff

By the spec here [1], it seems `[EnforceRange] required *` should be
replaced by `required [EnforceRange] *`.

[1] https://webidl.spec.whatwg.org/#extended-attributes-applicable-to-types
@padenot
Copy link
Collaborator

padenot commented Apr 29, 2022

Looks correct, but the IDL parser chokes on the correct syntax.

I filed plinss/widlparser#70 for this.

@saschanaz
Copy link
Member

saschanaz commented Oct 31, 2023

Does it really choke? The spec had required [EnforceRange] since fe1b1f6 in 2021.

Edit: And the diff is properly generated, so I don't think there's any blocker here.

@padenot
Copy link
Collaborator

padenot commented Nov 2, 2023

I double-checked, this is a bikeshed issue it seems like. It's when we attempt to describe the attribute that it fails:

<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}}.

This fails like this:

$ make
Building index.html
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 [EnforeRange] unsigned long and that's not a thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants