HTML parser should not be instantiating the custom elements inside a template element using the containing document's registry. Instead, it should be using the registry of the inert template document: https://html.spec.whatwg.org/#associated-inert-template-document
<rdar://problem/24943002>
Created attachment 272703 [details] Fixes the bug
Comment on attachment 272703 [details] Fixes the bug View in context: https://bugs.webkit.org/attachment.cgi?id=272703&action=review > LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-template-element/additions-to-parsing-xhtml-documents/node-document.html:35 > + assert_not_equals(template.content.ownerDocument, doc, I don't think we should diverge from upstream. If the test is wrong, we need to do a pull-request and re-sync the tests. I would land any change here that has not landed yet upstream.
Comment on attachment 272703 [details] Fixes the bug r=me with comment
Committed r197481: <http://trac.webkit.org/changeset/197481>
*** Bug 148850 has been marked as a duplicate of this bug. ***
Sorry, this patch was meant for the bug 148850 :( The patch didn't fix custom elements at all. Will file a new bug to track that.