···298298 if (id === "") continue
299299300300 for (const candidate of candidates) {
301301- if (isElement(candidate) && id === candidate.id) {
301301+ if (isElement(candidate) && node.localName === candidate.localName && id === candidate.id) {
302302 matches.set(node, candidate)
303303 unmatched.delete(node)
304304 candidates.delete(candidate)