Re: [w3c/gamepad] Require system focus for gamepad user gesture (PR #207)

@Copilot commented on this pull request.

## Pull request overview

Updates the Gamepad spec’s “gamepad user gesture” handling to require the relevant document to have user attention (i.e., be focused/active) before the initial gesture unlocks exposure of gamepad data, addressing issue #206’s cross-tab gesture concerns.

**Changes:**
- Gate setting `Navigator/[[hasGamepadGesture]]` on the associated document being a fully active descendant of a top-level traversable with user attention.
- Hoist the associated `Document` lookup earlier in the “update gamepad state” algorithm (so it can be used for the new focus/user-attention check).





---

💡 <a href="/w3c/gamepad/new/gh-pages/.github/instructions?filename=*.instructions.md" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Add Copilot custom instructions</a> for smarter, more guided reviews. <a href="https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Learn how to get started</a>.

> +          |document| is a [=Document/fully active descendant of a top-level
+          traversable with user attention=] and |gamepad| [=contains a gamepad
+          user gesture=]:

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.
```suggestion
          |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=]:
```

> +          <li>Let |gamepads:sequence&lt;Gamepad?&gt;| be an empty [=list=].
+          </li>

This algorithm step is duplicated: `Let |gamepads:sequence<Gamepad?>| be an empty list` appears twice in a row. Remove the extra step to avoid confusion about variable re-declaration and keep the algorithm consistent.
```suggestion

```

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/gamepad/pull/207#pullrequestreview-3794503982
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/gamepad/pull/207/review/3794503982@github.com>

Received on Friday, 13 February 2026 00:59:44 UTC