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

Add vendorId, productId, name attributes #202

Open
wants to merge 3 commits into
base: gh-pages
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ <h2>
[Exposed=Window]
interface Gamepad {
readonly attribute DOMString id;
readonly attribute unsigned short? vendorId;
marcoscaceres marked this conversation as resolved.
Show resolved Hide resolved
readonly attribute unsigned short? productId;
marcoscaceres marked this conversation as resolved.
Show resolved Hide resolved
readonly attribute DOMString name;
readonly attribute long index;
readonly attribute boolean connected;
readonly attribute DOMHighResTimeStamp timestamp;
Expand Down Expand Up @@ -334,6 +337,47 @@ <h2>
{{Gamepad/id}} string.
</p>
</dd>
<dt>
<dfn>vendorId</dfn> attribute
</dt>
<dd>
<p>
The 16-bit identifier assigned to the device vendor by the USB
Implementers Forum or Bluetooth Special Interest Group, or `null`
if the gamepad has no vendor identifier or it is not available.
</p>
<p>
The [=user agent=] MAY set {{Gamepad/vendorId}} and
{{Gamepad/productId}} to `null` to mitigate the risk of exposing
device identifiers. If one of {{Gamepad/vendorId}} or
{{Gamepad/productId}} is `null` then both MUST be `null`.
</p>
</dd>
<dt>
<dfn>productId</dfn> attribute
</dt>
<dd>
The product identifier assigned by the device vendor, or `null` if
the gamepad has no product identifier or it is not available.
</dd>
<dt>
<dfn>name</dfn> attribute
</dt>
<dd>
<p>
A human-readable identifier for the gamepad. The exact content of
the {{Gamepad/name}} string is left unspecified. The [=user agent=]
MAY use a product name string provided by the device firmware. The
{{Gamepad/name}} MUST NOT be the empty string and MUST NOT include
unique identifiers like serial numbers or Bluetooth device
marcoscaceres marked this conversation as resolved.
Show resolved Hide resolved
addresses.
</p>
<p class="note">
The {{Gamepad/name}} is intended only as a user-facing identifier.
It is not a stable identifier and might change over time due to
updates to the device firmware, browser, or operating system.
</p>
</dd>
<dt>
<dfn>index</dfn> attribute
</dt>
Expand Down Expand Up @@ -659,6 +703,21 @@ <h3>
<li>Initialize |gamepad|'s {{Gamepad/id}} attribute to an
identification string for the gamepad.
</li>
<li>Initialize |gamepad|.{{Gamepad/vendorId}} to `null`</li>
<li>Initialize |gamepad|.{{Gamepad/productId}} to `null`.</li>
<li>If the gamepad has vendor and product identifiers:
<ol>
<li>Set |gamepad|.{{Gamepad/vendorId}} to the vendor
identifier.
</li>
<li>Set |gamepad|.{{Gamepad/productId}} to the product
identifier.
</li>
</ol>
</li>
<li>Initialize |gamepad|'s {{Gamepad/name}} attribute to a
human-readable identifier for the gamepad.
</li>
<li>Initialize |gamepad|'s {{Gamepad/index}} attribute to the
result of [=selecting an unused gamepad index=] for |gamepad|.
</li>
Expand Down
Loading