googlearchive / TemplateBinding

TemplateBinding Prolyfill
290 stars 61 forks source link

document.webkitRegister does not function as expected with template.createInstance #96

Closed sorvell closed 11 years ago

sorvell commented 11 years ago

Note: these tests were run in Chrome 29.0.1529.3 canary with experimental webkit features turned on.

document.webkitRegister does not work as expected on template content when template.createInstance is used to generate nodes. See the example here and view the dev tools console output:

http://jsbin.com/uqeqen/1/edit

However, when cloneNode is used to generate nodes, the elements do upgrade. See:

http://jsbin.com/uqeqen/2/edit

Based on this Custom Elements spec bug, this behavior is somewhat surprising.

That createInstance fails where cloneNode does not suggests that there is a bug in the implementation of createInstance.

rafaelw commented 11 years ago

http://jsbin.com/uqeqen/6/edit

The issue appears to be that if you touch the node before it's put into the right document, it isn't upgraded (try commenting out the instance.firstChild; line