{"action":"created","issue":{"url":"https://api.github.com/repos/w3c/web-platform-tests/issues/4533","repository_url":"https://api.github.com/repos/w3c/web-platform-tests","labels_url":"https://api.github.com/repos/w3c/web-platform-tests/issues/4533/labels{/name}","comments_url":"https://api.github.com/repos/w3c/web-platform-tests/issues/4533/comments","events_url":"https://api.github.com/repos/w3c/web-platform-tests/issues/4533/events","html_url":"https://github.com/w3c/web-platform-tests/issues/4533","id":200421906,"number":4533,"title":"Non-interoperable foreign-content parsing edge-case","user":{"login":"travisleithead","id":2152696,"avatar_url":"https://avatars.githubusercontent.com/u/2152696?v=3","gravatar_id":"","url":"https://api.github.com/users/travisleithead","html_url":"https://github.com/travisleithead","followers_url":"https://api.github.com/users/travisleithead/followers","following_url":"https://api.github.com/users/travisleithead/following{/other_user}","gists_url":"https://api.github.com/users/travisleithead/gists{/gist_id}","starred_url":"https://api.github.com/users/travisleithead/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/travisleithead/subscriptions","organizations_url":"https://api.github.com/users/travisleithead/orgs","repos_url":"https://api.github.com/users/travisleithead/repos","events_url":"https://api.github.com/users/travisleithead/events{/privacy}","received_events_url":"https://api.github.com/users/travisleithead/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-01-12T16:56:16Z","updated_at":"2017-01-12T17:19:22Z","closed_at":null,"body":"A crash in Edge recently uncovered an issue where Chrome/Firefox/Edge all had slightly divergent behavior, as seen here (older versions of Edge would crash):\r\n\r\n> https://jsfiddle.net/ppsre82k/1/\r\n\r\nThe scenario where we're going wrong is that we have a tree like this:\r\n```html\r\n<div><foo></foo></div>\r\n```\r\nwhere the `<foo>` element has a null namespaceURI. To expose the issue, perform an innerHTML operation on the foo element like `fooElement.innerHTML = \"<span></span>\"`. This will use the HTML parser since the top-level element is an HTML element.\r\n\r\nLooking at Chrome's behavior seems to be that if the element created by innerHTML has a tag name of a known HTML element, e.g. \"span\", they will create the HTML element in the XHTML namespace. If the element has an unknown tag, e.g. \"bar\", then Chrome will create a generic element with the namespaceURI of the AdjustedCurrentNode. As best I can tell, this behavior is *not* to spec. \r\n\r\nLooking at https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inforeign, the behavior here should be to insert a generic element with namespaceURI matching the AdjustedCurrentNode even if the tag name is some known HTML element like \"span\".\r\n\r\nThis is what we have implemented in Edge to fix the crash. Unfortunately, it's a third state from either of Chrome or Firefox.\r\n\r\nI would like to submit a test for this so that we can align behaviors in this edge case. Due to the existing non-interoperability in this scenario, it's likely that there is not any significant web-compat impact for making this change.\r\n"},"comment":{"url":"https://api.github.com/repos/w3c/web-platform-tests/issues/comments/272224816","html_url":"https://github.com/w3c/web-platform-tests/issues/4533#issuecomment-272224816","issue_url":"https://api.github.com/repos/w3c/web-platform-tests/issues/4533","id":272224816,"user":{"login":"travisleithead","id":2152696,"avatar_url":"https://avatars.githubusercontent.com/u/2152696?v=3","gravatar_id":"","url":"https://api.github.com/users/travisleithead","html_url":"https://github.com/travisleithead","followers_url":"https://api.github.com/users/travisleithead/followers","following_url":"https://api.github.com/users/travisleithead/following{/other_user}","gists_url":"https://api.github.com/users/travisleithead/gists{/gist_id}","starred_url":"https://api.github.com/users/travisleithead/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/travisleithead/subscriptions","organizations_url":"https://api.github.com/users/travisleithead/orgs","repos_url":"https://api.github.com/users/travisleithead/repos","events_url":"https://api.github.com/users/travisleithead/events{/privacy}","received_events_url":"https://api.github.com/users/travisleithead/received_events","type":"User","site_admin":false},"created_at":"2017-01-12T17:19:22Z","updated_at":"2017-01-12T17:19:22Z","body":"Hmm, wondering if http://w3c-test.org/html/syntax/parsing/html5lib_innerHTML_foreign-fragment.html covers this case...? "}}
{"actor":{"display_login":"travisleithead"}}