From b01c25c6cd6731320b3d77773ddac3eced580c0e Mon Sep 17 00:00:00 2001 From: Steve Agoston Date: Thu, 19 Sep 2019 18:12:34 -0700 Subject: [PATCH 1/9] added feautre policy section --- index.html | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 5b9047c..959f701 100644 --- a/index.html +++ b/index.html @@ -409,7 +409,7 @@

- getGamepads + getGamepads()
Retrieve a snapshot of the data for the the currently connected and @@ -778,6 +778,27 @@

button.

+
+

+ Feature Policy integration +

+

+ This specification defines a policy-controlled feature identified by + the string "gamepad". + Its default allowlist + is 'self'. +

+
+

+ A document’s feature + policy determines whether any content in that document is allowed + to access {{getGamepads()}}. If disabled in any document, no content + in the document will be allowed to use {{getGamepads()}} + (trying to access will throw). +

+
+

This specification defines conformance criteria that apply to a single From 2360bc45eb5b62576ff3d7d95cb8a853aa5924a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Mon, 23 Sep 2019 15:31:29 +1000 Subject: [PATCH 2/9] Editorial cleanup --- index.html | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/index.html b/index.html index 959f701..2eceb02 100644 --- a/index.html +++ b/index.html @@ -778,24 +778,20 @@

button.

-
+

- Feature Policy integration + Integration with Feature policy

This specification defines a policy-controlled feature identified by - the string "gamepad". - Its default allowlist - is 'self'. + the string "`gamepad`". Its default allowlist is '`self`'.

-
+

- A document’s feature + A document’s feature policy determines whether any content in that document is allowed - to access {{getGamepads()}}. If disabled in any document, no content - in the document will be allowed to use {{getGamepads()}} - (trying to access will throw). + to access {{Navigator/getGamepads()}}. If disabled in any document, no content + in the document will be allowed to use {{Navigator/getGamepads()}}.

From 082254a832ea93f7b08e117a5c20b316f81dd026 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Mon, 23 Sep 2019 15:32:44 +1000 Subject: [PATCH 3/9] tidy up --- index.html | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index 2eceb02..33c883b 100644 --- a/index.html +++ b/index.html @@ -788,10 +788,11 @@

- A document’s feature - 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 allowed to use {{Navigator/getGamepads()}}. + A document’s feature 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 allowed to use + {{Navigator/getGamepads()}}.

From 002bdfeac4338b353a8613a3020fa1f185a350a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Mon, 23 Sep 2019 15:42:56 +1000 Subject: [PATCH 4/9] Throw if not allowed to use gamepad --- index.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/index.html b/index.html index 33c883b..78de678 100644 --- a/index.html +++ b/index.html @@ -411,6 +411,12 @@

getGamepads()
+
+ If the current settings object's [=environment settings object + / responsible document=] is not allowed to use the "`gamepad`" + feature, then [=exception/throw=] a {{"SecurityError"}} + {{DOMException}}. +
Retrieve a snapshot of the data for the the currently connected and interacted-with gamepads. Gamepads MUST only appear in the list if From 6068ef8a98ca32b9615bfa6c5caedd094551b0e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Wed, 25 Sep 2019 17:57:44 +1000 Subject: [PATCH 5/9] Only fire events if allowed to use gamepad --- index.html | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/index.html b/index.html index 78de678..1a7d124 100644 --- a/index.html +++ b/index.html @@ -741,10 +741,10 @@

User agents implementing this specification must provide a new DOM event, named gamepadconnected. The corresponding event - MUST be of type GamepadEvent and MUST fire on the - window object. Registration for and firing of the - gamepadconnected event MUST follow the usual behavior of - DOM Events. [[DOM]] + MUST be of type GamepadEvent and, if allowed to use + the "`gamepad`" feature, MUST fire on the window object. + Registration for and firing of the gamepadconnected event + MUST follow the usual behavior of DOM Events. [[DOM]]

A user agent MUST dispatch this event type to indicate the user @@ -760,10 +760,10 @@

User agents implementing this specification must provide a new DOM event, named gamepaddisconnected. The corresponding event - MUST be of type GamepadEvent and MUST fire on the - window object. Registration for and firing of the - gamepaddisconnected event MUST follow the usual behavior - of DOM Events. [[DOM]] + MUST be of type GamepadEvent and, if allowed to use + the "`gamepad`" feature, MUST fire on the window object. + Registration for and firing of the gamepaddisconnected + event MUST follow the usual behavior of DOM Events. [[DOM]]

When a gamepad is disconnected from the user agent, if the @@ -798,7 +798,8 @@

content in that document is allowed to access {{Navigator/getGamepads()}}. If disabled in any document, no content in the document will be allowed to use - {{Navigator/getGamepads()}}. + {{Navigator/getGamepads()}}, nor will the "gamepadconnected" and + "gamepaddisconnected" events fire.

From 9cb2ba4f2e077a69ce0f36cc5ab2bf91bfbddf64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Fri, 25 Oct 2019 20:58:07 +1100 Subject: [PATCH 6/9] Apply suggestions from code review Co-Authored-By: Sid Vishnoi --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 29e9081..bd4fa13 100644 --- a/index.html +++ b/index.html @@ -805,7 +805,7 @@

- A document’s feature policy determines whether any + A document’s [=Document/feature 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 allowed to use From 9920b30209426bc06a8cd7e04d38e59c919269df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Fri, 17 Jul 2020 18:29:52 +1000 Subject: [PATCH 7/9] s/feature/permission --- index.html | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/index.html b/index.html index 55625c8..6e1bba0 100644 --- a/index.html +++ b/index.html @@ -418,7 +418,7 @@

If the current settings object's [=environment settings object / responsible document=] is not allowed to use the "`gamepad`" - feature, then [=exception/throw=] a {{"SecurityError"}} + permission, then [=exception/throw=] a {{"SecurityError"}} {{DOMException}}.
@@ -759,8 +759,8 @@

User agents implementing this specification must provide a new DOM event, named gamepadconnected. The corresponding event - MUST be of type GamepadEvent and, if allowed to use - the "`gamepad`" feature, MUST fire on the window object. + MUST be of type {{GamepadEvent}} and, if allowed to use the + "`gamepad`" permission, MUST fire on the window object. Registration for and firing of the gamepadconnected event MUST follow the usual behavior of DOM Events. [[DOM]]

@@ -779,9 +779,10 @@

User agents implementing this specification must provide a new DOM event, named gamepaddisconnected. The corresponding event MUST be of type GamepadEvent and, if allowed to use - the "`gamepad`" feature, MUST fire on the window object. - Registration for and firing of the gamepaddisconnected - event MUST follow the usual behavior of DOM Events. [[DOM]] + the "`gamepad`" permission, MUST fire on the window + object. Registration for and firing of the + gamepaddisconnected event MUST follow the usual behavior + of DOM Events. [[DOM]]

When a gamepad is disconnected from the user agent, if the @@ -802,9 +803,9 @@

button.

-
+

- Integration with Feature policy + Integration with permission policy

This specification defines a policy-controlled feature identified by @@ -812,8 +813,8 @@

- A document’s [=Document/feature policy=] determines whether any - content in that document is allowed to access + A document’s [=Document/permission 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 allowed to use {{Navigator/getGamepads()}}, nor will the "gamepadconnected" and From 9a2dc4073a84b31c6e68b042a4a97831887a9cef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Fri, 17 Jul 2020 18:32:47 +1000 Subject: [PATCH 8/9] fix typo --- index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 6e1bba0..e407914 100644 --- a/index.html +++ b/index.html @@ -813,8 +813,8 @@

- A document’s [=Document/permission policy=] determines whether - any content in that document is allowed to access + A document’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 allowed to use {{Navigator/getGamepads()}}, nor will the "gamepadconnected" and From f5554b817b8adafa5b5804bc48f31ae116827740 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Fri, 17 Jul 2020 18:34:19 +1000 Subject: [PATCH 9/9] fix typo --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index e407914..1d0cb8e 100644 --- a/index.html +++ b/index.html @@ -805,7 +805,7 @@

- Integration with permission policy + Integration with Permissions Policy

This specification defines a policy-controlled feature identified by