var doc = new DOMParser().parseFromString('<keygen/>', 'text/xml') doesn't create the shadow tree for the <keygen> element.
I don’t think this is a bug, because you are parsing a text/xml document. So the parsed <keygen> element isn’t a HTML keygen element, just an element with tag name keygen.