{"action":"created","issue":{"url":"https://api.github.com/repos/w3c/webcomponents/issues/288","repository_url":"https://api.github.com/repos/w3c/webcomponents","labels_url":"https://api.github.com/repos/w3c/webcomponents/issues/288/labels{/name}","comments_url":"https://api.github.com/repos/w3c/webcomponents/issues/288/comments","events_url":"https://api.github.com/repos/w3c/webcomponents/issues/288/events","html_url":"https://github.com/w3c/webcomponents/issues/288","id":96637025,"number":288,"title":"Need \"slotchange\" event","user":{"login":"dglazkov","id":1934,"avatar_url":"https://avatars.githubusercontent.com/u/1934?v=3","gravatar_id":"","url":"https://api.github.com/users/dglazkov","html_url":"https://github.com/dglazkov","followers_url":"https://api.github.com/users/dglazkov/followers","following_url":"https://api.github.com/users/dglazkov/following{/other_user}","gists_url":"https://api.github.com/users/dglazkov/gists{/gist_id}","starred_url":"https://api.github.com/users/dglazkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dglazkov/subscriptions","organizations_url":"https://api.github.com/users/dglazkov/orgs","repos_url":"https://api.github.com/users/dglazkov/repos","events_url":"https://api.github.com/users/dglazkov/events{/privacy}","received_events_url":"https://api.github.com/users/dglazkov/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/w3c/webcomponents/labels/shadow-dom","name":"shadow-dom","color":"207de5"},{"url":"https://api.github.com/repos/w3c/webcomponents/labels/v1","name":"v1","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":89,"created_at":"2015-07-22T18:44:34Z","updated_at":"2016-04-07T09:43:16Z","closed_at":null,"body":"For developers, it will be good to have an event that is fired whenever slotting algorithm runs within a shadow tree. Maybe runs _and_ produces changes compared to the previous result? Don't know. Also don't know if this is v1 or v2."},"comment":{"url":"https://api.github.com/repos/w3c/webcomponents/issues/comments/206787360","html_url":"https://github.com/w3c/webcomponents/issues/288#issuecomment-206787360","issue_url":"https://api.github.com/repos/w3c/webcomponents/issues/288","id":206787360,"user":{"login":"annevk","id":1544111,"avatar_url":"https://avatars.githubusercontent.com/u/1544111?v=3","gravatar_id":"","url":"https://api.github.com/users/annevk","html_url":"https://github.com/annevk","followers_url":"https://api.github.com/users/annevk/followers","following_url":"https://api.github.com/users/annevk/following{/other_user}","gists_url":"https://api.github.com/users/annevk/gists{/gist_id}","starred_url":"https://api.github.com/users/annevk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/annevk/subscriptions","organizations_url":"https://api.github.com/users/annevk/orgs","repos_url":"https://api.github.com/users/annevk/repos","events_url":"https://api.github.com/users/annevk/events{/privacy}","received_events_url":"https://api.github.com/users/annevk/received_events","type":"User","site_admin":false},"created_at":"2016-04-07T09:43:16Z","updated_at":"2016-04-07T09:43:16Z","body":"I'm still struggling a bit with how to best define this. My idea was to effectively run slotting whenever you insert, but if we want to define \"slotchange\", we'll need to keep records to know something actually changed as a result of an insert or remove.\r\n\r\nFor insert, it seems these two are significant:\r\n* The node is being inserted into a parent node that also has a shadow root\r\n* An inclusive-descendant of node is a slot element and node's (new) root is a shadow root\r\n\r\nFor remove:\r\n* The parent was a slot element\r\n* The parent was a node with a shadow root (shadow host)\r\n* Node has a slot element as inclusive-descendant and node's root was a shadow root\r\n\r\nSo when those happen we need to \"reslot\" a bit and I guess we'd simply check whether an element was already assigned somewhere and if it remains assigned to the same slot it doesn't count as a change.\r\n\r\nDoes this brain storm sound reasonable?"}}