Skip to content

adoptNode() needs to account for <iframe> and friends #1428

@annevk

Description

@annevk

What is the issue with the DOM Standard?

In particular, if you run adoptNode() on an iframe with the iframe's nested document as this, all browsers throw.

I don't think we can really use the "adopting steps" for this as they run too late and it also seems like it's specific to adoptNode() and not adopt in general. I'm not entirely sure why it happens as the iframe element could certainly be removed and all would be fine I think, but that's just not the reality.

https://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%0A%3Ciframe%3E%3C%2Fiframe%3E%0A%3Cscript%3E%0Aself%5B0%5D.document.adoptNode(self%5B0%5D.frameElement)%3B%0A%3C%2Fscript%3E

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions