ibm-js / delite

HTML Custom Element / Widget infrastructure
http://ibm-js.github.io/delite/
Other
68 stars 28 forks source link

shouldn't upgrade custom elements inside <template> #408

Closed wkeese closed 9 years ago

wkeese commented 9 years ago

Custom Elements inside a <template> or <script type=x-template> tag should not be upgraded. There's no issue on Safari, Chrome, and FF, since querySelectorAll() on those platforms ignores the contents of <template> tags. But it's broken on IE10.

This presumably breaks liaison.

One possible approach would be to temporarily orphan the contents of <template> and <script type=x-template> tags while the parser is searching for elements to be upgraded. It would only need to be done for platforms where querySelectorAll() finds elements inside a <template> node (or equivalently, check if templateNode.firstElementChild is defined).

cc @asudoh

PS: I checked Polymer's behavior and surprisingly it has the same issue... even though it does a DFS to find elements, like dojo's parser, rather than using querySelectorAll(); I filed webcomponents/webcomponentsjs#302.