{"action":"created","comment":{"url":"https://api.github.com/repos/ampproject/amphtml/pulls/comments/87855788","pull_request_review_id":8449830,"id":87855788,"diff_hunk":"@@ -0,0 +1,182 @@\n+/**\n+ * Copyright 2016 The AMP HTML Authors. All Rights Reserved.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ *      http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS-IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+\n+import {closest} from '../../../src/dom';\n+import {dev, user} from '../../../src/log';\n+import {isExperimentOn} from '../../../src/experiments';\n+\n+export class AmpSelector extends AMP.BaseElement {\n+  /** @param {!AmpElement} element */\n+  constructor(element) {\n+    super(element);\n+\n+    /** @private {boolean} */\n+    this.isMultiple_ = false;\n+\n+    /** @private {!Array<!Element>} */\n+    this.selectedOptions_ = [];\n+\n+    /** @private {!Array<!Element>} */\n+    this.options_ = [];\n+\n+    /** @private {!Array<!Element>} */\n+    this.inputs_ = [];\n+  }\n+\n+  /** @override */\n+  isLayoutSupported() {\n+    return true;\n+  }\n+\n+  /** @override */\n+  buildCallback() {\n+    user().assert(isExperimentOn(this.win, 'amp-selector'),\n+        `Experiment amp-selector is disabled.`);\n+    this.isMultiple_ = this.element.hasAttribute('multiple');\n+    const isDisabled = this.element.hasAttribute('disabled');\n+\n+    this.element.setAttribute('role', 'listbox');\n+\n+    if (this.isMultiple_) {\n+      this.element.setAttribute('aria-multiselectable', 'true');\n+    }\n+\n+    if (isDisabled) {\n+      this.element.setAttribute('aria-disabled', 'true');\n+    }\n+\n+    if (!isDisabled) {\n+      this.init_();\n+      this.element.addEventListener('click', this.clickHandler_.bind(this));\n+    }\n+  }\n+\n+  /**\n+   * @private\n+   */\n+  init_() {\n+    const options = [].slice.call(this.element.querySelectorAll('[option]'));\n+    options.forEach(option => {\n+      option.setAttribute('role', 'option');\n+      if (option.hasAttribute('disabled')) {\n+        option.setAttribute('aria-disabled', 'true');\n+        option.removeAttribute('selected');","path":"extensions/amp-selector/0.1/amp-selector.js","position":76,"original_position":76,"commit_id":"da0a4f57e59c665719a26fddce5e61b04d06ab5b","original_commit_id":"da0a4f57e59c665719a26fddce5e61b04d06ab5b","user":{"login":"dvoytenko","id":726049,"avatar_url":"https://avatars.githubusercontent.com/u/726049?v=3","gravatar_id":"","url":"https://api.github.com/users/dvoytenko","html_url":"https://github.com/dvoytenko","followers_url":"https://api.github.com/users/dvoytenko/followers","following_url":"https://api.github.com/users/dvoytenko/following{/other_user}","gists_url":"https://api.github.com/users/dvoytenko/gists{/gist_id}","starred_url":"https://api.github.com/users/dvoytenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dvoytenko/subscriptions","organizations_url":"https://api.github.com/users/dvoytenko/orgs","repos_url":"https://api.github.com/users/dvoytenko/repos","events_url":"https://api.github.com/users/dvoytenko/events{/privacy}","received_events_url":"https://api.github.com/users/dvoytenko/received_events","type":"User","site_admin":false},"body":"Is this a valid approach to remove `selected` attribute?","created_at":"2016-11-14T17:58:26Z","updated_at":"2016-11-14T18:02:21Z","html_url":"https://github.com/ampproject/amphtml/pull/5975#discussion_r87855788","pull_request_url":"https://api.github.com/repos/ampproject/amphtml/pulls/5975","_links":{"self":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/comments/87855788"},"html":{"href":"https://github.com/ampproject/amphtml/pull/5975#discussion_r87855788"},"pull_request":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/5975"}}},"pull_request":{"url":"https://api.github.com/repos/ampproject/amphtml/pulls/5975","id":92023484,"html_url":"https://github.com/ampproject/amphtml/pull/5975","diff_url":"https://github.com/ampproject/amphtml/pull/5975.diff","patch_url":"https://github.com/ampproject/amphtml/pull/5975.patch","issue_url":"https://api.github.com/repos/ampproject/amphtml/issues/5975","number":5975,"state":"open","locked":false,"title":"amp-selector","user":{"login":"camelburrito","id":1037311,"avatar_url":"https://avatars.githubusercontent.com/u/1037311?v=3","gravatar_id":"","url":"https://api.github.com/users/camelburrito","html_url":"https://github.com/camelburrito","followers_url":"https://api.github.com/users/camelburrito/followers","following_url":"https://api.github.com/users/camelburrito/following{/other_user}","gists_url":"https://api.github.com/users/camelburrito/gists{/gist_id}","starred_url":"https://api.github.com/users/camelburrito/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/camelburrito/subscriptions","organizations_url":"https://api.github.com/users/camelburrito/orgs","repos_url":"https://api.github.com/users/camelburrito/repos","events_url":"https://api.github.com/users/camelburrito/events{/privacy}","received_events_url":"https://api.github.com/users/camelburrito/received_events","type":"User","site_admin":false},"body":"Ready for review","created_at":"2016-11-02T17:58:48Z","updated_at":"2016-11-14T18:02:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"aeb1842f625ee2f6959f7d19c37abaf7fc8d409b","assignee":{"login":"dvoytenko","id":726049,"avatar_url":"https://avatars.githubusercontent.com/u/726049?v=3","gravatar_id":"","url":"https://api.github.com/users/dvoytenko","html_url":"https://github.com/dvoytenko","followers_url":"https://api.github.com/users/dvoytenko/followers","following_url":"https://api.github.com/users/dvoytenko/following{/other_user}","gists_url":"https://api.github.com/users/dvoytenko/gists{/gist_id}","starred_url":"https://api.github.com/users/dvoytenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dvoytenko/subscriptions","organizations_url":"https://api.github.com/users/dvoytenko/orgs","repos_url":"https://api.github.com/users/dvoytenko/repos","events_url":"https://api.github.com/users/dvoytenko/events{/privacy}","received_events_url":"https://api.github.com/users/dvoytenko/received_events","type":"User","site_admin":false},"assignees":[{"login":"dvoytenko","id":726049,"avatar_url":"https://avatars.githubusercontent.com/u/726049?v=3","gravatar_id":"","url":"https://api.github.com/users/dvoytenko","html_url":"https://github.com/dvoytenko","followers_url":"https://api.github.com/users/dvoytenko/followers","following_url":"https://api.github.com/users/dvoytenko/following{/other_user}","gists_url":"https://api.github.com/users/dvoytenko/gists{/gist_id}","starred_url":"https://api.github.com/users/dvoytenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dvoytenko/subscriptions","organizations_url":"https://api.github.com/users/dvoytenko/orgs","repos_url":"https://api.github.com/users/dvoytenko/repos","events_url":"https://api.github.com/users/dvoytenko/events{/privacy}","received_events_url":"https://api.github.com/users/dvoytenko/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ampproject/amphtml/pulls/5975/commits","review_comments_url":"https://api.github.com/repos/ampproject/amphtml/pulls/5975/comments","review_comment_url":"https://api.github.com/repos/ampproject/amphtml/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ampproject/amphtml/issues/5975/comments","statuses_url":"https://api.github.com/repos/ampproject/amphtml/statuses/da0a4f57e59c665719a26fddce5e61b04d06ab5b","head":{"label":"camelburrito:select","ref":"select","sha":"da0a4f57e59c665719a26fddce5e61b04d06ab5b","user":{"login":"camelburrito","id":1037311,"avatar_url":"https://avatars.githubusercontent.com/u/1037311?v=3","gravatar_id":"","url":"https://api.github.com/users/camelburrito","html_url":"https://github.com/camelburrito","followers_url":"https://api.github.com/users/camelburrito/followers","following_url":"https://api.github.com/users/camelburrito/following{/other_user}","gists_url":"https://api.github.com/users/camelburrito/gists{/gist_id}","starred_url":"https://api.github.com/users/camelburrito/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/camelburrito/subscriptions","organizations_url":"https://api.github.com/users/camelburrito/orgs","repos_url":"https://api.github.com/users/camelburrito/repos","events_url":"https://api.github.com/users/camelburrito/events{/privacy}","received_events_url":"https://api.github.com/users/camelburrito/received_events","type":"User","site_admin":false},"repo":{"id":44337813,"name":"amphtml","full_name":"camelburrito/amphtml","owner":{"login":"camelburrito","id":1037311,"avatar_url":"https://avatars.githubusercontent.com/u/1037311?v=3","gravatar_id":"","url":"https://api.github.com/users/camelburrito","html_url":"https://github.com/camelburrito","followers_url":"https://api.github.com/users/camelburrito/followers","following_url":"https://api.github.com/users/camelburrito/following{/other_user}","gists_url":"https://api.github.com/users/camelburrito/gists{/gist_id}","starred_url":"https://api.github.com/users/camelburrito/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/camelburrito/subscriptions","organizations_url":"https://api.github.com/users/camelburrito/orgs","repos_url":"https://api.github.com/users/camelburrito/repos","events_url":"https://api.github.com/users/camelburrito/events{/privacy}","received_events_url":"https://api.github.com/users/camelburrito/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/camelburrito/amphtml","description":"AMP HTML source code, samples, and documentation.  See below for more info.","fork":true,"url":"https://api.github.com/repos/camelburrito/amphtml","forks_url":"https://api.github.com/repos/camelburrito/amphtml/forks","keys_url":"https://api.github.com/repos/camelburrito/amphtml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/camelburrito/amphtml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/camelburrito/amphtml/teams","hooks_url":"https://api.github.com/repos/camelburrito/amphtml/hooks","issue_events_url":"https://api.github.com/repos/camelburrito/amphtml/issues/events{/number}","events_url":"https://api.github.com/repos/camelburrito/amphtml/events","assignees_url":"https://api.github.com/repos/camelburrito/amphtml/assignees{/user}","branches_url":"https://api.github.com/repos/camelburrito/amphtml/branches{/branch}","tags_url":"https://api.github.com/repos/camelburrito/amphtml/tags","blobs_url":"https://api.github.com/repos/camelburrito/amphtml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/camelburrito/amphtml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/camelburrito/amphtml/git/refs{/sha}","trees_url":"https://api.github.com/repos/camelburrito/amphtml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/camelburrito/amphtml/statuses/{sha}","languages_url":"https://api.github.com/repos/camelburrito/amphtml/languages","stargazers_url":"https://api.github.com/repos/camelburrito/amphtml/stargazers","contributors_url":"https://api.github.com/repos/camelburrito/amphtml/contributors","subscribers_url":"https://api.github.com/repos/camelburrito/amphtml/subscribers","subscription_url":"https://api.github.com/repos/camelburrito/amphtml/subscription","commits_url":"https://api.github.com/repos/camelburrito/amphtml/commits{/sha}","git_commits_url":"https://api.github.com/repos/camelburrito/amphtml/git/commits{/sha}","comments_url":"https://api.github.com/repos/camelburrito/amphtml/comments{/number}","issue_comment_url":"https://api.github.com/repos/camelburrito/amphtml/issues/comments{/number}","contents_url":"https://api.github.com/repos/camelburrito/amphtml/contents/{+path}","compare_url":"https://api.github.com/repos/camelburrito/amphtml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/camelburrito/amphtml/merges","archive_url":"https://api.github.com/repos/camelburrito/amphtml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/camelburrito/amphtml/downloads","issues_url":"https://api.github.com/repos/camelburrito/amphtml/issues{/number}","pulls_url":"https://api.github.com/repos/camelburrito/amphtml/pulls{/number}","milestones_url":"https://api.github.com/repos/camelburrito/amphtml/milestones{/number}","notifications_url":"https://api.github.com/repos/camelburrito/amphtml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/camelburrito/amphtml/labels{/name}","releases_url":"https://api.github.com/repos/camelburrito/amphtml/releases{/id}","deployments_url":"https://api.github.com/repos/camelburrito/amphtml/deployments","created_at":"2015-10-15T18:39:52Z","updated_at":"2016-01-13T02:54:37Z","pushed_at":"2016-11-14T04:02:57Z","git_url":"git://github.com/camelburrito/amphtml.git","ssh_url":"git@github.com:camelburrito/amphtml.git","clone_url":"https://github.com/camelburrito/amphtml.git","svn_url":"https://github.com/camelburrito/amphtml","homepage":"https://ampproject.org","size":184715,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ampproject:master","ref":"master","sha":"f83bfcb439fb4eb1e5d8e5fcddbb9295f283f20b","user":{"login":"ampproject","id":14114390,"avatar_url":"https://avatars.githubusercontent.com/u/14114390?v=3","gravatar_id":"","url":"https://api.github.com/users/ampproject","html_url":"https://github.com/ampproject","followers_url":"https://api.github.com/users/ampproject/followers","following_url":"https://api.github.com/users/ampproject/following{/other_user}","gists_url":"https://api.github.com/users/ampproject/gists{/gist_id}","starred_url":"https://api.github.com/users/ampproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ampproject/subscriptions","organizations_url":"https://api.github.com/users/ampproject/orgs","repos_url":"https://api.github.com/users/ampproject/repos","events_url":"https://api.github.com/users/ampproject/events{/privacy}","received_events_url":"https://api.github.com/users/ampproject/received_events","type":"Organization","site_admin":false},"repo":{"id":41766002,"name":"amphtml","full_name":"ampproject/amphtml","owner":{"login":"ampproject","id":14114390,"avatar_url":"https://avatars.githubusercontent.com/u/14114390?v=3","gravatar_id":"","url":"https://api.github.com/users/ampproject","html_url":"https://github.com/ampproject","followers_url":"https://api.github.com/users/ampproject/followers","following_url":"https://api.github.com/users/ampproject/following{/other_user}","gists_url":"https://api.github.com/users/ampproject/gists{/gist_id}","starred_url":"https://api.github.com/users/ampproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ampproject/subscriptions","organizations_url":"https://api.github.com/users/ampproject/orgs","repos_url":"https://api.github.com/users/ampproject/repos","events_url":"https://api.github.com/users/ampproject/events{/privacy}","received_events_url":"https://api.github.com/users/ampproject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ampproject/amphtml","description":"AMP HTML source code, samples, and documentation.  See below for more info.","fork":false,"url":"https://api.github.com/repos/ampproject/amphtml","forks_url":"https://api.github.com/repos/ampproject/amphtml/forks","keys_url":"https://api.github.com/repos/ampproject/amphtml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ampproject/amphtml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ampproject/amphtml/teams","hooks_url":"https://api.github.com/repos/ampproject/amphtml/hooks","issue_events_url":"https://api.github.com/repos/ampproject/amphtml/issues/events{/number}","events_url":"https://api.github.com/repos/ampproject/amphtml/events","assignees_url":"https://api.github.com/repos/ampproject/amphtml/assignees{/user}","branches_url":"https://api.github.com/repos/ampproject/amphtml/branches{/branch}","tags_url":"https://api.github.com/repos/ampproject/amphtml/tags","blobs_url":"https://api.github.com/repos/ampproject/amphtml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ampproject/amphtml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ampproject/amphtml/git/refs{/sha}","trees_url":"https://api.github.com/repos/ampproject/amphtml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ampproject/amphtml/statuses/{sha}","languages_url":"https://api.github.com/repos/ampproject/amphtml/languages","stargazers_url":"https://api.github.com/repos/ampproject/amphtml/stargazers","contributors_url":"https://api.github.com/repos/ampproject/amphtml/contributors","subscribers_url":"https://api.github.com/repos/ampproject/amphtml/subscribers","subscription_url":"https://api.github.com/repos/ampproject/amphtml/subscription","commits_url":"https://api.github.com/repos/ampproject/amphtml/commits{/sha}","git_commits_url":"https://api.github.com/repos/ampproject/amphtml/git/commits{/sha}","comments_url":"https://api.github.com/repos/ampproject/amphtml/comments{/number}","issue_comment_url":"https://api.github.com/repos/ampproject/amphtml/issues/comments{/number}","contents_url":"https://api.github.com/repos/ampproject/amphtml/contents/{+path}","compare_url":"https://api.github.com/repos/ampproject/amphtml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ampproject/amphtml/merges","archive_url":"https://api.github.com/repos/ampproject/amphtml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ampproject/amphtml/downloads","issues_url":"https://api.github.com/repos/ampproject/amphtml/issues{/number}","pulls_url":"https://api.github.com/repos/ampproject/amphtml/pulls{/number}","milestones_url":"https://api.github.com/repos/ampproject/amphtml/milestones{/number}","notifications_url":"https://api.github.com/repos/ampproject/amphtml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ampproject/amphtml/labels{/name}","releases_url":"https://api.github.com/repos/ampproject/amphtml/releases{/id}","deployments_url":"https://api.github.com/repos/ampproject/amphtml/deployments","created_at":"2015-09-01T22:10:53Z","updated_at":"2016-11-14T16:46:22Z","pushed_at":"2016-11-14T17:30:59Z","git_url":"git://github.com/ampproject/amphtml.git","ssh_url":"git@github.com:ampproject/amphtml.git","clone_url":"https://github.com/ampproject/amphtml.git","svn_url":"https://github.com/ampproject/amphtml","homepage":"https://ampproject.org","size":226858,"stargazers_count":9045,"watchers_count":9045,"language":"JavaScript","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":1388,"mirror_url":null,"open_issues_count":985,"forks":1388,"open_issues":985,"watchers":9045,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/5975"},"html":{"href":"https://github.com/ampproject/amphtml/pull/5975"},"issue":{"href":"https://api.github.com/repos/ampproject/amphtml/issues/5975"},"comments":{"href":"https://api.github.com/repos/ampproject/amphtml/issues/5975/comments"},"review_comments":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/5975/comments"},"review_comment":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/5975/commits"},"statuses":{"href":"https://api.github.com/repos/ampproject/amphtml/statuses/da0a4f57e59c665719a26fddce5e61b04d06ab5b"}}}}
{"actor":{"display_login":"dvoytenko"}}