Skip to content
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
13 changes: 8 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -801,8 +801,15 @@ <h3>
<li>Let |navigator:Navigator| be |gamepad|'s [=relevant global
object=]'s {{Navigator}} object.
</li>
<li>Let |document:Document?| be |gamepad|'s [=relevant global
object=]'s [=associated `Document`=]; otherwise `null`.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the document is null then that's exceptional... InvalidStateError?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it doesn't make sense to throw here because we're inside "When the system receives new button or axis input values", if we throw an error there's nothing to catch it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, good point. Yes, it should just return gracefully.

</li>
<li>If |document| is `null`, abort these steps.
</li>
<li>If |navigator|.{{Navigator/[[hasGamepadGesture]]}} is `false` and
|gamepad| [=contains a gamepad user gesture=]:
|document| is a [=Document/fully active descendant of a top-level
traversable with user attention=] and |gamepad| [=contains a gamepad
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we create an alias for "focused"?

"A [=Document=] |document| is focused if |document| is a [=Document/fully active descendant of a top-level traversable with user attention=] and |gamepad| [=contains a gamepad user gesture=]:"?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t think we should do that, to be honest. If we need the concept of focus, we should link out to HTML (which defines it).

user gesture=]:
Comment on lines +810 to +812
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The condition uses “|document| is a Document/fully active descendant …” but |document| is defined as Document? and can be null. Add an explicit |document| is not null (or change the condition to handle null) before applying the HTML definition, to avoid a type-mismatched check and make the focus requirement unambiguous.

Suggested change
|document| is a [=Document/fully active descendant of a top-level
traversable with user attention=] and |gamepad| [=contains a gamepad
user gesture=]:
|document| is not `null` and is a [=Document/fully active descendant
of a top-level traversable with user attention=] and |gamepad|
[=contains a gamepad user gesture=]:

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, yeah... maybe this check should also happen earlier. If you don't have a document anyway, then none of the above really matters, right?

<ol>
<li>Set |navigator|.{{Navigator/[[hasGamepadGesture]]}} to
`true`.
Expand All @@ -818,10 +825,6 @@ <h3>
<li>Set |connectedGamepad|.{{Gamepad/[[timestamp]]}} to
|now|.
</li>
<li>Let |document:Document?| be |gamepad|'s [=relevant
global object=]'s [=associated `Document`=]; otherwise
`null`.
</li>
<li>If |document| is not `null` and is [=Document/fully
active=], then [=queue a global task=] on the [=gamepad
task source=] to [=fire an event=] named
Expand Down
Loading