I am trying to walk through the shadow and light DOM recursively (looking for the first input
, wherever it may be). This didn\'t seem to be such a hard
The solution is to wait that polymer is ready:
document.addEventListener('polymer-ready', function() {
recursiveWalk(document.body, function (node) {
console.log(node.nodeName);
});
})
and to use the shadowDom property:
if ('shadowRoot' in node && node.shadowRoot) {
var done = recursiveWalk(node.shadowRoot, func);
if (done) {
return true;
}
}
http://jsfiddle.net/za1gn0pe/7/