{"action":"created","issue":{"url":"https://api.github.com/repos/tmpvar/jsdom/issues/1676","repository_url":"https://api.github.com/repos/tmpvar/jsdom","labels_url":"https://api.github.com/repos/tmpvar/jsdom/issues/1676/labels{/name}","comments_url":"https://api.github.com/repos/tmpvar/jsdom/issues/1676/comments","events_url":"https://api.github.com/repos/tmpvar/jsdom/issues/1676/events","html_url":"https://github.com/tmpvar/jsdom/pull/1676","id":195980465,"number":1676,"title":"Support `insertAdjacentHTML` without a parent element","user":{"login":"alexlafroscia","id":1645881,"avatar_url":"https://avatars.githubusercontent.com/u/1645881?v=3","gravatar_id":"","url":"https://api.github.com/users/alexlafroscia","html_url":"https://github.com/alexlafroscia","followers_url":"https://api.github.com/users/alexlafroscia/followers","following_url":"https://api.github.com/users/alexlafroscia/following{/other_user}","gists_url":"https://api.github.com/users/alexlafroscia/gists{/gist_id}","starred_url":"https://api.github.com/users/alexlafroscia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexlafroscia/subscriptions","organizations_url":"https://api.github.com/users/alexlafroscia/orgs","repos_url":"https://api.github.com/users/alexlafroscia/repos","events_url":"https://api.github.com/users/alexlafroscia/events{/privacy}","received_events_url":"https://api.github.com/users/alexlafroscia/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-16T04:49:48Z","updated_at":"2016-12-18T19:22:48Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/tmpvar/jsdom/pulls/1676","html_url":"https://github.com/tmpvar/jsdom/pull/1676","diff_url":"https://github.com/tmpvar/jsdom/pull/1676.diff","patch_url":"https://github.com/tmpvar/jsdom/pull/1676.patch"},"body":"I was trying to get [Glimmer](https://github.com/tildeio/glimmer) running in JSDOM and ran into an issue where it attempts to use `insertAdjacentHTML` with an element that has no parent element. After digging into the code I was that JSDOM was set up to always error if the given element does not have a parent.\n\nI did some research and it seems like `insertAdjacentHTML` should only require a parent element when inserting `beforebeing` or `afterend`, since that actually puts the text before or after the element that the method is called on.  However, `afterbegin` and `beforeend` do not require a parent, because the text is placed within the element itself.\n\nThe docs from MDN can be found [here](https://developer.mozilla.org/en-US/docs/Web/API/Element/insertAdjacentHTML)"},"comment":{"url":"https://api.github.com/repos/tmpvar/jsdom/issues/comments/267840373","html_url":"https://github.com/tmpvar/jsdom/pull/1676#issuecomment-267840373","issue_url":"https://api.github.com/repos/tmpvar/jsdom/issues/1676","id":267840373,"user":{"login":"domenic","id":617481,"avatar_url":"https://avatars.githubusercontent.com/u/617481?v=3","gravatar_id":"","url":"https://api.github.com/users/domenic","html_url":"https://github.com/domenic","followers_url":"https://api.github.com/users/domenic/followers","following_url":"https://api.github.com/users/domenic/following{/other_user}","gists_url":"https://api.github.com/users/domenic/gists{/gist_id}","starred_url":"https://api.github.com/users/domenic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/domenic/subscriptions","organizations_url":"https://api.github.com/users/domenic/orgs","repos_url":"https://api.github.com/users/domenic/repos","events_url":"https://api.github.com/users/domenic/events{/privacy}","received_events_url":"https://api.github.com/users/domenic/received_events","type":"User","site_admin":false},"created_at":"2016-12-18T19:22:48Z","updated_at":"2016-12-18T19:22:48Z","body":"Thanks! I'll touch this up and turn it into something mergeable. Unfortunately your change doesn't actually work, since you are testing `text` instead of `position`."}}
{"actor":{"display_login":"domenic"}}