{"action":"created","comment":{"url":"https://api.github.com/repos/WICG/inert/pulls/comments/74637448","id":74637448,"diff_hunk":"@@ -69,13 +69,44 @@ class InertRoot {\n     // Make all focusable elements in the subtree unfocusable and add them to _managedNodes\n     this._makeSubtreeUnfocusable(this._rootElement);\n \n+    const boundOnMutation = this._onMutation.bind(this);\n     // Watch for:\n     // - any additions in the subtree: make them unfocusable too\n     // - any removals from the subtree: remove them from this inert root's managed nodes\n     // - attribute changes: if `tabindex` is added, or removed from an intrinsically focusable element,\n     //   make that node a managed node.\n-    this._observer = new MutationObserver(this._onMutation.bind(this));\n+    this._observer = new MutationObserver(boundOnMutation);\n     this._observer.observe(this._rootElement, { attributes: true, childList: true, subtree: true });\n+\n+    // Watch for:\n+    // - any additions in the shadowRoot subtree: make them unfocusable too\n+    // - any removals from the shadowRoot subtree: remove them from this inert root's managed nodes\n+    const rootObserver = new MutationObserver(boundOnMutation);\n+    const shadowRoot = this._rootElement.shadowRoot || this._rootElement.webkitShadowRoot;\n+    if (shadowRoot) {\n+      rootObserver.observe(shadowRoot, { childList: true, subtree: true });","path":"inert.js","position":20,"original_position":20,"commit_id":"583472372b4c395d28a11b21461a73a9b4e79b04","original_commit_id":"583472372b4c395d28a11b21461a73a9b4e79b04","user":{"login":"valdrinkoshi","id":6173664,"avatar_url":"https://avatars.githubusercontent.com/u/6173664?v=3","gravatar_id":"","url":"https://api.github.com/users/valdrinkoshi","html_url":"https://github.com/valdrinkoshi","followers_url":"https://api.github.com/users/valdrinkoshi/followers","following_url":"https://api.github.com/users/valdrinkoshi/following{/other_user}","gists_url":"https://api.github.com/users/valdrinkoshi/gists{/gist_id}","starred_url":"https://api.github.com/users/valdrinkoshi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/valdrinkoshi/subscriptions","organizations_url":"https://api.github.com/users/valdrinkoshi/orgs","repos_url":"https://api.github.com/users/valdrinkoshi/repos","events_url":"https://api.github.com/users/valdrinkoshi/events{/privacy}","received_events_url":"https://api.github.com/users/valdrinkoshi/received_events","type":"User","site_admin":false},"body":"memo to self: we should be observing also the attributes..!","created_at":"2016-08-12T18:22:04Z","updated_at":"2016-08-12T18:22:04Z","html_url":"https://github.com/WICG/inert/pull/18#discussion_r74637448","pull_request_url":"https://api.github.com/repos/WICG/inert/pulls/18","_links":{"self":{"href":"https://api.github.com/repos/WICG/inert/pulls/comments/74637448"},"html":{"href":"https://github.com/WICG/inert/pull/18#discussion_r74637448"},"pull_request":{"href":"https://api.github.com/repos/WICG/inert/pulls/18"}}},"pull_request":{"url":"https://api.github.com/repos/WICG/inert/pulls/18","id":80324158,"html_url":"https://github.com/WICG/inert/pull/18","diff_url":"https://github.com/WICG/inert/pull/18.diff","patch_url":"https://github.com/WICG/inert/pull/18.patch","issue_url":"https://api.github.com/repos/WICG/inert/issues/18","number":18,"state":"open","locked":false,"title":"Observe shadowRoot mutations","user":{"login":"valdrinkoshi","id":6173664,"avatar_url":"https://avatars.githubusercontent.com/u/6173664?v=3","gravatar_id":"","url":"https://api.github.com/users/valdrinkoshi","html_url":"https://github.com/valdrinkoshi","followers_url":"https://api.github.com/users/valdrinkoshi/followers","following_url":"https://api.github.com/users/valdrinkoshi/following{/other_user}","gists_url":"https://api.github.com/users/valdrinkoshi/gists{/gist_id}","starred_url":"https://api.github.com/users/valdrinkoshi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/valdrinkoshi/subscriptions","organizations_url":"https://api.github.com/users/valdrinkoshi/orgs","repos_url":"https://api.github.com/users/valdrinkoshi/repos","events_url":"https://api.github.com/users/valdrinkoshi/events{/privacy}","received_events_url":"https://api.github.com/users/valdrinkoshi/received_events","type":"User","site_admin":false},"body":"Fixes https://github.com/WICG/inert/issues/17 by observing node changes on the `shadowRoot` of each `InertRoot`. If a node doesn't have yet a shadow root, we patch the methods to create a shadow root and we add our observer then!","created_at":"2016-08-06T00:35:20Z","updated_at":"2016-08-12T18:22:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"20057523a3714e2632612f9266b7cc4c06a7723f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/WICG/inert/pulls/18/commits","review_comments_url":"https://api.github.com/repos/WICG/inert/pulls/18/comments","review_comment_url":"https://api.github.com/repos/WICG/inert/pulls/comments{/number}","comments_url":"https://api.github.com/repos/WICG/inert/issues/18/comments","statuses_url":"https://api.github.com/repos/WICG/inert/statuses/583472372b4c395d28a11b21461a73a9b4e79b04","head":{"label":"valdrinkoshi:handle-shadow-roots","ref":"handle-shadow-roots","sha":"583472372b4c395d28a11b21461a73a9b4e79b04","user":{"login":"valdrinkoshi","id":6173664,"avatar_url":"https://avatars.githubusercontent.com/u/6173664?v=3","gravatar_id":"","url":"https://api.github.com/users/valdrinkoshi","html_url":"https://github.com/valdrinkoshi","followers_url":"https://api.github.com/users/valdrinkoshi/followers","following_url":"https://api.github.com/users/valdrinkoshi/following{/other_user}","gists_url":"https://api.github.com/users/valdrinkoshi/gists{/gist_id}","starred_url":"https://api.github.com/users/valdrinkoshi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/valdrinkoshi/subscriptions","organizations_url":"https://api.github.com/users/valdrinkoshi/orgs","repos_url":"https://api.github.com/users/valdrinkoshi/repos","events_url":"https://api.github.com/users/valdrinkoshi/events{/privacy}","received_events_url":"https://api.github.com/users/valdrinkoshi/received_events","type":"User","site_admin":false},"repo":{"id":63903012,"name":"inert","full_name":"valdrinkoshi/inert","owner":{"login":"valdrinkoshi","id":6173664,"avatar_url":"https://avatars.githubusercontent.com/u/6173664?v=3","gravatar_id":"","url":"https://api.github.com/users/valdrinkoshi","html_url":"https://github.com/valdrinkoshi","followers_url":"https://api.github.com/users/valdrinkoshi/followers","following_url":"https://api.github.com/users/valdrinkoshi/following{/other_user}","gists_url":"https://api.github.com/users/valdrinkoshi/gists{/gist_id}","starred_url":"https://api.github.com/users/valdrinkoshi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/valdrinkoshi/subscriptions","organizations_url":"https://api.github.com/users/valdrinkoshi/orgs","repos_url":"https://api.github.com/users/valdrinkoshi/repos","events_url":"https://api.github.com/users/valdrinkoshi/events{/privacy}","received_events_url":"https://api.github.com/users/valdrinkoshi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/valdrinkoshi/inert","description":"Exploring the `inert` attribute","fork":true,"url":"https://api.github.com/repos/valdrinkoshi/inert","forks_url":"https://api.github.com/repos/valdrinkoshi/inert/forks","keys_url":"https://api.github.com/repos/valdrinkoshi/inert/keys{/key_id}","collaborators_url":"https://api.github.com/repos/valdrinkoshi/inert/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/valdrinkoshi/inert/teams","hooks_url":"https://api.github.com/repos/valdrinkoshi/inert/hooks","issue_events_url":"https://api.github.com/repos/valdrinkoshi/inert/issues/events{/number}","events_url":"https://api.github.com/repos/valdrinkoshi/inert/events","assignees_url":"https://api.github.com/repos/valdrinkoshi/inert/assignees{/user}","branches_url":"https://api.github.com/repos/valdrinkoshi/inert/branches{/branch}","tags_url":"https://api.github.com/repos/valdrinkoshi/inert/tags","blobs_url":"https://api.github.com/repos/valdrinkoshi/inert/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/valdrinkoshi/inert/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/valdrinkoshi/inert/git/refs{/sha}","trees_url":"https://api.github.com/repos/valdrinkoshi/inert/git/trees{/sha}","statuses_url":"https://api.github.com/repos/valdrinkoshi/inert/statuses/{sha}","languages_url":"https://api.github.com/repos/valdrinkoshi/inert/languages","stargazers_url":"https://api.github.com/repos/valdrinkoshi/inert/stargazers","contributors_url":"https://api.github.com/repos/valdrinkoshi/inert/contributors","subscribers_url":"https://api.github.com/repos/valdrinkoshi/inert/subscribers","subscription_url":"https://api.github.com/repos/valdrinkoshi/inert/subscription","commits_url":"https://api.github.com/repos/valdrinkoshi/inert/commits{/sha}","git_commits_url":"https://api.github.com/repos/valdrinkoshi/inert/git/commits{/sha}","comments_url":"https://api.github.com/repos/valdrinkoshi/inert/comments{/number}","issue_comment_url":"https://api.github.com/repos/valdrinkoshi/inert/issues/comments{/number}","contents_url":"https://api.github.com/repos/valdrinkoshi/inert/contents/{+path}","compare_url":"https://api.github.com/repos/valdrinkoshi/inert/compare/{base}...{head}","merges_url":"https://api.github.com/repos/valdrinkoshi/inert/merges","archive_url":"https://api.github.com/repos/valdrinkoshi/inert/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/valdrinkoshi/inert/downloads","issues_url":"https://api.github.com/repos/valdrinkoshi/inert/issues{/number}","pulls_url":"https://api.github.com/repos/valdrinkoshi/inert/pulls{/number}","milestones_url":"https://api.github.com/repos/valdrinkoshi/inert/milestones{/number}","notifications_url":"https://api.github.com/repos/valdrinkoshi/inert/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/valdrinkoshi/inert/labels{/name}","releases_url":"https://api.github.com/repos/valdrinkoshi/inert/releases{/id}","deployments_url":"https://api.github.com/repos/valdrinkoshi/inert/deployments","created_at":"2016-07-21T21:17:54Z","updated_at":"2016-07-21T21:17:56Z","pushed_at":"2016-08-10T23:57:23Z","git_url":"git://github.com/valdrinkoshi/inert.git","ssh_url":"git@github.com:valdrinkoshi/inert.git","clone_url":"https://github.com/valdrinkoshi/inert.git","svn_url":"https://github.com/valdrinkoshi/inert","homepage":null,"size":43,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"WICG:master","ref":"master","sha":"7c3baec656632c58369a5cf6d1cc820c5de8d125","user":{"login":"WICG","id":13145324,"avatar_url":"https://avatars.githubusercontent.com/u/13145324?v=3","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":62260985,"name":"inert","full_name":"WICG/inert","owner":{"login":"WICG","id":13145324,"avatar_url":"https://avatars.githubusercontent.com/u/13145324?v=3","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/inert","description":"Exploring the `inert` attribute","fork":true,"url":"https://api.github.com/repos/WICG/inert","forks_url":"https://api.github.com/repos/WICG/inert/forks","keys_url":"https://api.github.com/repos/WICG/inert/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WICG/inert/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WICG/inert/teams","hooks_url":"https://api.github.com/repos/WICG/inert/hooks","issue_events_url":"https://api.github.com/repos/WICG/inert/issues/events{/number}","events_url":"https://api.github.com/repos/WICG/inert/events","assignees_url":"https://api.github.com/repos/WICG/inert/assignees{/user}","branches_url":"https://api.github.com/repos/WICG/inert/branches{/branch}","tags_url":"https://api.github.com/repos/WICG/inert/tags","blobs_url":"https://api.github.com/repos/WICG/inert/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WICG/inert/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WICG/inert/git/refs{/sha}","trees_url":"https://api.github.com/repos/WICG/inert/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WICG/inert/statuses/{sha}","languages_url":"https://api.github.com/repos/WICG/inert/languages","stargazers_url":"https://api.github.com/repos/WICG/inert/stargazers","contributors_url":"https://api.github.com/repos/WICG/inert/contributors","subscribers_url":"https://api.github.com/repos/WICG/inert/subscribers","subscription_url":"https://api.github.com/repos/WICG/inert/subscription","commits_url":"https://api.github.com/repos/WICG/inert/commits{/sha}","git_commits_url":"https://api.github.com/repos/WICG/inert/git/commits{/sha}","comments_url":"https://api.github.com/repos/WICG/inert/comments{/number}","issue_comment_url":"https://api.github.com/repos/WICG/inert/issues/comments{/number}","contents_url":"https://api.github.com/repos/WICG/inert/contents/{+path}","compare_url":"https://api.github.com/repos/WICG/inert/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WICG/inert/merges","archive_url":"https://api.github.com/repos/WICG/inert/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WICG/inert/downloads","issues_url":"https://api.github.com/repos/WICG/inert/issues{/number}","pulls_url":"https://api.github.com/repos/WICG/inert/pulls{/number}","milestones_url":"https://api.github.com/repos/WICG/inert/milestones{/number}","notifications_url":"https://api.github.com/repos/WICG/inert/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WICG/inert/labels{/name}","releases_url":"https://api.github.com/repos/WICG/inert/releases{/id}","deployments_url":"https://api.github.com/repos/WICG/inert/deployments","created_at":"2016-06-29T22:05:17Z","updated_at":"2016-08-12T16:48:09Z","pushed_at":"2016-08-10T23:58:48Z","git_url":"git://github.com/WICG/inert.git","ssh_url":"git@github.com:WICG/inert.git","clone_url":"https://github.com/WICG/inert.git","svn_url":"https://github.com/WICG/inert","homepage":null,"size":48,"stargazers_count":58,"watchers_count":58,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":4,"mirror_url":null,"open_issues_count":9,"forks":4,"open_issues":9,"watchers":58,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/WICG/inert/pulls/18"},"html":{"href":"https://github.com/WICG/inert/pull/18"},"issue":{"href":"https://api.github.com/repos/WICG/inert/issues/18"},"comments":{"href":"https://api.github.com/repos/WICG/inert/issues/18/comments"},"review_comments":{"href":"https://api.github.com/repos/WICG/inert/pulls/18/comments"},"review_comment":{"href":"https://api.github.com/repos/WICG/inert/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/WICG/inert/pulls/18/commits"},"statuses":{"href":"https://api.github.com/repos/WICG/inert/statuses/583472372b4c395d28a11b21461a73a9b4e79b04"}}}}
{"actor":{"display_login":"valdrinkoshi"}}