Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wkeese opened this issue May 13, 2015 · 0 comments · Fixed by #409
Closed

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

wkeese opened this issue May 13, 2015 · 0 comments · Fixed by #409
Assignees
Labels
Milestone

Comments

@wkeese
Copy link
Member

wkeese commented May 13, 2015

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.

@wkeese wkeese added the bug label May 14, 2015
@wkeese wkeese self-assigned this May 14, 2015
wkeese added a commit to wkeese/delite that referenced this issue May 14, 2015
Avoids accidentally instantiating custom elements inside templates.

Fixes ibm-js#408.
wkeese added a commit that referenced this issue May 20, 2015
Avoids accidentally instantiating custom elements inside templates.

Fixes #408.
@cjolif cjolif added this to the 0.8.0 milestone May 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants