`HIDCollectionInfo` dictionary contains a sequence of `HIDCollectionInfo`, which the WebIDL spec forbids.

Open
#175 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
15/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Domain
api

Research direction

The problem is the HIDCollectionInfo dictionary definition in the WebHID spec source, where its children member is a sequence of the same dictionary. Read that definition, then the WebIDL rule on dictionary member types it cites. Done means maintainers agree on a resolution, such as changing WebIDL, adding a spec note, or restructuring the type, and that decision is recorded. Writing a patch first would be premature.

Written by the indexing model from the issue text.

Description

What is the issue with the WebHID Standard?

The HIDCollectionInfo dictionary has a member sequence<HIDCollectionInfo> children;. However, the WebIDL spec states that for dictionaries:

The type of a dictionary member must not include the dictionary it appears on. A type includes a dictionary D if at least one of the following is true:

  • ...
  • the type is a dictionary, one of whose members or inherited members has a type that includes D

So HIDCollectionInfo having a member of type sequence<HIDCollectionInfo> seems to be forbidden.

I don't have a great idea for what to do about this, since it seems like HID requires this recursive type. Maybe we could change the WebIDL spec? Or at least put a note in the WebHID spec about this?

Dominant language
HTML
Stars
166
Forks
38
Avg merge
2d 6h
Merged PRs (30d)
9

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from whatwg/hid

All issues in whatwg/hid

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.