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 permission policy integration #112

Merged
merged 13 commits into from
Oct 29, 2020
40 changes: 33 additions & 7 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,14 @@ <h2>
</pre>
<dl>
<dt>
<dfn>getGamepads</dfn>
<dfn>getGamepads()</dfn>
</dt>
<dd>
If the <a>current settings object</a>'s [=environment settings object
/ responsible document=] is not <a>allowed to use</a> the "`gamepad`"
permission, then [=exception/throw=] a {{"SecurityError"}}
{{DOMException}}.
</dd>
<dd>
Retrieve a snapshot of the data for the the currently connected and
interacted-with gamepads. Gamepads MUST only appear in the list if
Expand Down Expand Up @@ -733,10 +739,10 @@ <h3 id="event-gamepadconnected">
<p>
User agents implementing this specification must provide a new DOM
event, named <code>gamepadconnected</code>. The corresponding event
MUST be of type <code>GamepadEvent</code> and MUST fire on the
<code>window</code> object. Registration for and firing of the
<code>gamepadconnected</code> event MUST follow the usual behavior of
DOM Events. [[DOM]]
MUST be of type {{GamepadEvent}} and, if <a>allowed to use</a> the
"`gamepad`" permission, MUST fire on the <code>window</code> object.
Registration for and firing of the <code>gamepadconnected</code> event
MUST follow the usual behavior of DOM Events. [[DOM]]
</p>
<p>
A <a>user agent</a> MUST dispatch this event type to indicate the user
Expand All @@ -752,8 +758,9 @@ <h3 id="event-gamepaddisconnected">
<p>
User agents implementing this specification must provide a new DOM
event, named <code>gamepaddisconnected</code>. The corresponding event
MUST be of type <code>GamepadEvent</code> and MUST fire on the
<code>window</code> object. Registration for and firing of the
MUST be of type <code>GamepadEvent</code> and, if <a>allowed to use</a>
the "`gamepad`" permission, MUST fire on the <code>window</code>
object. Registration for and firing of the
<code>gamepaddisconnected</code> event MUST follow the usual behavior
of DOM Events. [[DOM]]
</p>
Expand All @@ -776,6 +783,25 @@ <h3>
button.</i>
</p>
</section>
<section id="permission-policy" data-cite="Feature-Policy">
<h2>
Integration with Permissions Policy
</h2>
<p>
This specification defines a policy-controlled feature identified by
the string "`gamepad`". Its <a>default allowlist</a> is '`self`'.
</p>
<div class="note">
<p>
A <a>document</a>’s [=Document/permissions policy=] determines
whether any content in that document is allowed to access
{{Navigator/getGamepads()}}. If disabled in any document, no content
in the document will be <a>allowed to use</a>
{{Navigator/getGamepads()}}, nor will the "gamepadconnected" and
"gamepaddisconnected" events fire.
</p>
</div>
</section>
<section id='conformance'>
<p>
This specification defines conformance criteria that apply to a single
Expand Down