Closed omril1 closed 4 months ago
const html = parser.parseFromString(`<div template="this content breaks querySelector">😊</div>`, 'text/html').documentElement; html.querySelectorAll('*'); // throws TypeError: Cannot read properties of undefined (reading 'nodeType')
The cause seems to be next = next.localName === 'template' ? next[END] : next[NEXT];
next = next.localName === 'template' ? next[END] : next[NEXT];
I assume the check with localName should happen only if next is an ELEMENT_NODE and not an attribute as the code there was meant for template elements
localName
next
ELEMENT_NODE
It's up, thank you 👋
The cause seems to be
next = next.localName === 'template' ? next[END] : next[NEXT];
I assume the check with
localName
should happen only ifnext
is anELEMENT_NODE
and not an attribute as the code there was meant for template elements