Skip to content

Test foster parenting into a Document with an element child#61396

Open
annevk wants to merge 1 commit into
masterfrom
foster-parenting-document-element-child
Open

Test foster parenting into a Document with an element child#61396
annevk wants to merge 1 commit into
masterfrom
foster-parenting-document-element-child

Conversation

@annevk

@annevk annevk commented Jul 19, 2026

Copy link
Copy Markdown
Member

When the HTML parser's adjusted insertion location is a Document that already has an element child, the foster-parented node is dropped on the floor: "insert an element at the adjusted insertion location" aborts, and "insert a character" likewise for text. This is reachable when script reparents an on-stack <table> to be a Document's document element.

  • resources/scripted_foster01.dat: same-document element and text cases.
  • foster-parenting-into-document-with-element-child.html: the multi-document case, where the foster target is a separate Document.

See whatwg/html#1706

When the HTML parser's adjusted insertion location is a Document that already
has an element child, the foster-parented node is dropped on the floor:
"insert an element at the adjusted insertion location" aborts, and "insert a
character" likewise for text. This is reachable when script reparents an
on-stack <table> to be a Document's document element.

- resources/scripted_foster01.dat: same-document element and text cases.
- foster-parenting-into-document-with-element-child.html: the multi-document
  case, where the foster target is a separate Document.

See whatwg/html#1706
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants