{"action":"created","comment":{"url":"https://api.github.com/repos/WICG/focus-ring/pulls/comments/151054259","pull_request_review_id":76697131,"id":151054259,"diff_hunk":"@@ -70,32 +65,43 @@ function init() {\n   function removeFocusRingClass(el) {\n     if (!el.hasAttribute('data-focus-ring-added'))\n       return;\n-    classList(el).remove('focus-ring');\n+    el.classList.remove('focus-ring');\n     el.removeAttribute('data-focus-ring-added');\n   }\n \n   /**\n-   * On `keyup` add `focus-ring` class if the user pressed Tab and the event\n-   * target is an element that will likely require interaction via the\n-   * keyboard (e.g. a text box).\n-   * The `keyup` event is used over the focus event because:\n-   * 1. `focus` is a device-independent event, and `keyup` ensures the\n-   *    `focus-ring` class is only added when focus originates from\n-   *    keyboard navigation.\n-   * 2. Unlike `focus`, keyup` will fire when the user navigates from the\n-   *    browser chrome into the document. (For more, see issue #15)\n+   * On `keydown`, set `hadKeyboardEvent`, add `focus-ring` class if the\n+   * key was Tab/Shift-Tab or Arrow Keys.\n    * @param {Event} e\n    */\n-  function onKeyUp(e) {\n+  function onKeyDown(e) {\n+    const allowedKeys = [9, 37, 38, 39, 40];\n+\n+    // If the user is holding down a modifier key, abort.","path":"src/focus-ring.js","position":58,"original_position":58,"commit_id":"d35b9b97a3978a43a929a84f2e963a950d09c956","original_commit_id":"d35b9b97a3978a43a929a84f2e963a950d09c956","user":{"login":"robdodson","id":1066253,"avatar_url":"https://avatars0.githubusercontent.com/u/1066253?v=4","gravatar_id":"","url":"https://api.github.com/users/robdodson","html_url":"https://github.com/robdodson","followers_url":"https://api.github.com/users/robdodson/followers","following_url":"https://api.github.com/users/robdodson/following{/other_user}","gists_url":"https://api.github.com/users/robdodson/gists{/gist_id}","starred_url":"https://api.github.com/users/robdodson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robdodson/subscriptions","organizations_url":"https://api.github.com/users/robdodson/orgs","repos_url":"https://api.github.com/users/robdodson/repos","events_url":"https://api.github.com/users/robdodson/events{/privacy}","received_events_url":"https://api.github.com/users/robdodson/received_events","type":"User","site_admin":false},"body":"Fixed","created_at":"2017-11-15T07:57:42Z","updated_at":"2017-11-15T08:05:03Z","html_url":"https://github.com/WICG/focus-ring/pull/68#discussion_r151054259","pull_request_url":"https://api.github.com/repos/WICG/focus-ring/pulls/68","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/WICG/focus-ring/pulls/comments/151054259"},"html":{"href":"https://github.com/WICG/focus-ring/pull/68#discussion_r151054259"},"pull_request":{"href":"https://api.github.com/repos/WICG/focus-ring/pulls/68"}},"in_reply_to_id":151046510},"pull_request":{"url":"https://api.github.com/repos/WICG/focus-ring/pulls/68","id":152685990,"html_url":"https://github.com/WICG/focus-ring/pull/68","diff_url":"https://github.com/WICG/focus-ring/pull/68.diff","patch_url":"https://github.com/WICG/focus-ring/pull/68.patch","issue_url":"https://api.github.com/repos/WICG/focus-ring/issues/68","number":68,"state":"closed","locked":false,"title":"Revert behavior to fix failing tests. Add arrow key support. Fixes #65, #54, #63, #44","user":{"login":"robdodson","id":1066253,"avatar_url":"https://avatars0.githubusercontent.com/u/1066253?v=4","gravatar_id":"","url":"https://api.github.com/users/robdodson","html_url":"https://github.com/robdodson","followers_url":"https://api.github.com/users/robdodson/followers","following_url":"https://api.github.com/users/robdodson/following{/other_user}","gists_url":"https://api.github.com/users/robdodson/gists{/gist_id}","starred_url":"https://api.github.com/users/robdodson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robdodson/subscriptions","organizations_url":"https://api.github.com/users/robdodson/orgs","repos_url":"https://api.github.com/users/robdodson/repos","events_url":"https://api.github.com/users/robdodson/events{/privacy}","received_events_url":"https://api.github.com/users/robdodson/received_events","type":"User","site_admin":false},"body":"This reverts the behavior that's currently on master because it was breaking mouse focus and causing most of the tests to fail. It uses a different approach to address the URL bar issue from #15 and adds support for arrow keys to address #54, #63.\r\n\r\nThis also removes the polyfill for classList. This is in accordance with the W3C's new [Polyfill guidance](https://www.w3.org/2001/tag/doc/polyfills/#don-t-serve-unnecessary-polyfills) which suggests that polyfills should not bundle other polyfills. Instead, we'll update our docs to mention that the polyfill depends on classList and users should use a service like polyfill.io to add it.\r\n\r\n@kloots FYI because I needed to back out the previous `onKeyUp` change.","created_at":"2017-11-15T05:08:25Z","updated_at":"2017-11-15T08:05:03Z","closed_at":"2017-11-15T05:51:14Z","merged_at":"2017-11-15T05:51:14Z","merge_commit_sha":"989804de13ae70ea9942dad5374ab4bee4a75e95","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/WICG/focus-ring/pulls/68/commits","review_comments_url":"https://api.github.com/repos/WICG/focus-ring/pulls/68/comments","review_comment_url":"https://api.github.com/repos/WICG/focus-ring/pulls/comments{/number}","comments_url":"https://api.github.com/repos/WICG/focus-ring/issues/68/comments","statuses_url":"https://api.github.com/repos/WICG/focus-ring/statuses/d35b9b97a3978a43a929a84f2e963a950d09c956","head":{"label":"WICG:fix-tests","ref":"fix-tests","sha":"d35b9b97a3978a43a929a84f2e963a950d09c956","user":{"login":"WICG","id":13145324,"avatar_url":"https://avatars2.githubusercontent.com/u/13145324?v=4","gravatar_id":"","url":"https://api.github.com/users/WICG","html_url":"https://github.com/WICG","followers_url":"https://api.github.com/users/WICG/followers","following_url":"https://api.github.com/users/WICG/following{/other_user}","gists_url":"https://api.github.com/users/WICG/gists{/gist_id}","starred_url":"https://api.github.com/users/WICG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WICG/subscriptions","organizations_url":"https://api.github.com/users/WICG/orgs","repos_url":"https://api.github.com/users/WICG/repos","events_url":"https://api.github.com/users/WICG/events{/privacy}","received_events_url":"https://api.github.com/users/WICG/received_events","type":"Organization","site_admin":false},"repo":{"id":84289785,"name":"focus-ring","full_name":"WICG/focus-ring","owner":{"login":"WICG","id":13145324,"avatar_url":"https://avatars2.githubusercontent.com/u/13145324?v=4","gravatar_id":"","url":"https://api.github.com/users/WICG","html_url":"https://github.com/WICG","followers_url":"https://api.github.com/users/WICG/followers","following_url":"https://api.github.com/users/WICG/following{/other_user}","gists_url":"https://api.github.com/users/WICG/gists{/gist_id}","starred_url":"https://api.github.com/users/WICG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WICG/subscriptions","organizations_url":"https://api.github.com/users/WICG/orgs","repos_url":"https://api.github.com/users/WICG/repos","events_url":"https://api.github.com/users/WICG/events{/privacy}","received_events_url":"https://api.github.com/users/WICG/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WICG/focus-ring","description":"Polyfill for `:focus-ring`","fork":false,"url":"https://api.github.com/repos/WICG/focus-ring","forks_url":"https://api.github.com/repos/WICG/focus-ring/forks","keys_url":"https://api.github.com/repos/WICG/focus-ring/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WICG/focus-ring/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WICG/focus-ring/teams","hooks_url":"https://api.github.com/repos/WICG/focus-ring/hooks","issue_events_url":"https://api.github.com/repos/WICG/focus-ring/issues/events{/number}","events_url":"https://api.github.com/repos/WICG/focus-ring/events","assignees_url":"https://api.github.com/repos/WICG/focus-ring/assignees{/user}","branches_url":"https://api.github.com/repos/WICG/focus-ring/branches{/branch}","tags_url":"https://api.github.com/repos/WICG/focus-ring/tags","blobs_url":"https://api.github.com/repos/WICG/focus-ring/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WICG/focus-ring/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WICG/focus-ring/git/refs{/sha}","trees_url":"https://api.github.com/repos/WICG/focus-ring/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WICG/focus-ring/statuses/{sha}","languages_url":"https://api.github.com/repos/WICG/focus-ring/languages","stargazers_url":"https://api.github.com/repos/WICG/focus-ring/stargazers","contributors_url":"https://api.github.com/repos/WICG/focus-ring/contributors","subscribers_url":"https://api.github.com/repos/WICG/focus-ring/subscribers","subscription_url":"https://api.github.com/repos/WICG/focus-ring/subscription","commits_url":"https://api.github.com/repos/WICG/focus-ring/commits{/sha}","git_commits_url":"https://api.github.com/repos/WICG/focus-ring/git/commits{/sha}","comments_url":"https://api.github.com/repos/WICG/focus-ring/comments{/number}","issue_comment_url":"https://api.github.com/repos/WICG/focus-ring/issues/comments{/number}","contents_url":"https://api.github.com/repos/WICG/focus-ring/contents/{+path}","compare_url":"https://api.github.com/repos/WICG/focus-ring/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WICG/focus-ring/merges","archive_url":"https://api.github.com/repos/WICG/focus-ring/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WICG/focus-ring/downloads","issues_url":"https://api.github.com/repos/WICG/focus-ring/issues{/number}","pulls_url":"https://api.github.com/repos/WICG/focus-ring/pulls{/number}","milestones_url":"https://api.github.com/repos/WICG/focus-ring/milestones{/number}","notifications_url":"https://api.github.com/repos/WICG/focus-ring/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WICG/focus-ring/labels{/name}","releases_url":"https://api.github.com/repos/WICG/focus-ring/releases{/id}","deployments_url":"https://api.github.com/repos/WICG/focus-ring/deployments","created_at":"2017-03-08T07:05:18Z","updated_at":"2017-11-14T11:58:24Z","pushed_at":"2017-11-15T06:40:43Z","git_url":"git://github.com/WICG/focus-ring.git","ssh_url":"git@github.com:WICG/focus-ring.git","clone_url":"https://github.com/WICG/focus-ring.git","svn_url":"https://github.com/WICG/focus-ring","homepage":"https://wicg.github.io/focus-ring/demo/","size":215,"stargazers_count":188,"watchers_count":188,"language":"HTML","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":24,"mirror_url":null,"archived":false,"open_issues_count":13,"forks":24,"open_issues":13,"watchers":188,"default_branch":"master"}},"base":{"label":"WICG:master","ref":"master","sha":"87ede562db2fe28c217f16fb44ffec44f7f0dfdb","user":{"login":"WICG","id":13145324,"avatar_url":"https://avatars2.githubusercontent.com/u/13145324?v=4","gravatar_id":"","url":"https://api.github.com/users/WICG","html_url":"https://github.com/WICG","followers_url":"https://api.github.com/users/WICG/followers","following_url":"https://api.github.com/users/WICG/following{/other_user}","gists_url":"https://api.github.com/users/WICG/gists{/gist_id}","starred_url":"https://api.github.com/users/WICG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WICG/subscriptions","organizations_url":"https://api.github.com/users/WICG/orgs","repos_url":"https://api.github.com/users/WICG/repos","events_url":"https://api.github.com/users/WICG/events{/privacy}","received_events_url":"https://api.github.com/users/WICG/received_events","type":"Organization","site_admin":false},"repo":{"id":84289785,"name":"focus-ring","full_name":"WICG/focus-ring","owner":{"login":"WICG","id":13145324,"avatar_url":"https://avatars2.githubusercontent.com/u/13145324?v=4","gravatar_id":"","url":"https://api.github.com/users/WICG","html_url":"https://github.com/WICG","followers_url":"https://api.github.com/users/WICG/followers","following_url":"https://api.github.com/users/WICG/following{/other_user}","gists_url":"https://api.github.com/users/WICG/gists{/gist_id}","starred_url":"https://api.github.com/users/WICG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WICG/subscriptions","organizations_url":"https://api.github.com/users/WICG/orgs","repos_url":"https://api.github.com/users/WICG/repos","events_url":"https://api.github.com/users/WICG/events{/privacy}","received_events_url":"https://api.github.com/users/WICG/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WICG/focus-ring","description":"Polyfill for `:focus-ring`","fork":false,"url":"https://api.github.com/repos/WICG/focus-ring","forks_url":"https://api.github.com/repos/WICG/focus-ring/forks","keys_url":"https://api.github.com/repos/WICG/focus-ring/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WICG/focus-ring/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WICG/focus-ring/teams","hooks_url":"https://api.github.com/repos/WICG/focus-ring/hooks","issue_events_url":"https://api.github.com/repos/WICG/focus-ring/issues/events{/number}","events_url":"https://api.github.com/repos/WICG/focus-ring/events","assignees_url":"https://api.github.com/repos/WICG/focus-ring/assignees{/user}","branches_url":"https://api.github.com/repos/WICG/focus-ring/branches{/branch}","tags_url":"https://api.github.com/repos/WICG/focus-ring/tags","blobs_url":"https://api.github.com/repos/WICG/focus-ring/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WICG/focus-ring/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WICG/focus-ring/git/refs{/sha}","trees_url":"https://api.github.com/repos/WICG/focus-ring/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WICG/focus-ring/statuses/{sha}","languages_url":"https://api.github.com/repos/WICG/focus-ring/languages","stargazers_url":"https://api.github.com/repos/WICG/focus-ring/stargazers","contributors_url":"https://api.github.com/repos/WICG/focus-ring/contributors","subscribers_url":"https://api.github.com/repos/WICG/focus-ring/subscribers","subscription_url":"https://api.github.com/repos/WICG/focus-ring/subscription","commits_url":"https://api.github.com/repos/WICG/focus-ring/commits{/sha}","git_commits_url":"https://api.github.com/repos/WICG/focus-ring/git/commits{/sha}","comments_url":"https://api.github.com/repos/WICG/focus-ring/comments{/number}","issue_comment_url":"https://api.github.com/repos/WICG/focus-ring/issues/comments{/number}","contents_url":"https://api.github.com/repos/WICG/focus-ring/contents/{+path}","compare_url":"https://api.github.com/repos/WICG/focus-ring/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WICG/focus-ring/merges","archive_url":"https://api.github.com/repos/WICG/focus-ring/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WICG/focus-ring/downloads","issues_url":"https://api.github.com/repos/WICG/focus-ring/issues{/number}","pulls_url":"https://api.github.com/repos/WICG/focus-ring/pulls{/number}","milestones_url":"https://api.github.com/repos/WICG/focus-ring/milestones{/number}","notifications_url":"https://api.github.com/repos/WICG/focus-ring/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WICG/focus-ring/labels{/name}","releases_url":"https://api.github.com/repos/WICG/focus-ring/releases{/id}","deployments_url":"https://api.github.com/repos/WICG/focus-ring/deployments","created_at":"2017-03-08T07:05:18Z","updated_at":"2017-11-14T11:58:24Z","pushed_at":"2017-11-15T06:40:43Z","git_url":"git://github.com/WICG/focus-ring.git","ssh_url":"git@github.com:WICG/focus-ring.git","clone_url":"https://github.com/WICG/focus-ring.git","svn_url":"https://github.com/WICG/focus-ring","homepage":"https://wicg.github.io/focus-ring/demo/","size":215,"stargazers_count":188,"watchers_count":188,"language":"HTML","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":24,"mirror_url":null,"archived":false,"open_issues_count":13,"forks":24,"open_issues":13,"watchers":188,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/WICG/focus-ring/pulls/68"},"html":{"href":"https://github.com/WICG/focus-ring/pull/68"},"issue":{"href":"https://api.github.com/repos/WICG/focus-ring/issues/68"},"comments":{"href":"https://api.github.com/repos/WICG/focus-ring/issues/68/comments"},"review_comments":{"href":"https://api.github.com/repos/WICG/focus-ring/pulls/68/comments"},"review_comment":{"href":"https://api.github.com/repos/WICG/focus-ring/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/WICG/focus-ring/pulls/68/commits"},"statuses":{"href":"https://api.github.com/repos/WICG/focus-ring/statuses/d35b9b97a3978a43a929a84f2e963a950d09c956"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"robdodson"}}