Skip to content

Create nodes in the realm of the document they are created for#1491

Merged
annevk merged 2 commits into
mainfrom
node-creation-realm
Jul 17, 2026
Merged

Create nodes in the realm of the document they are created for#1491
annevk merged 2 commits into
mainfrom
node-creation-realm

Conversation

@annevk

@annevk annevk commented Jul 10, 2026

Copy link
Copy Markdown
Member

Which realm a node is created in was unspecified, so implementations disagreed when a node was created for a document whose relevant realm differed from the one running the algorithm (e.g., parsing, importing, or cloning into an adopted node's document).

This also makes the HTML parser initialize processing instructions, populating their attribute map as createProcessingInstruction() and the constructor already did.

Fixes #977.

(See WHATWG Working Mode: Changes for more details.)


Preview | Diff

Which realm a node is created in was unspecified, so implementations
disagreed when a node was created for a document whose relevant realm
differed from the one running the algorithm (e.g. parsing, importing, or
cloning into an adopted node's document).

This also makes the HTML parser initialize processing instructions,
populating their attribute map as createProcessingInstruction() and the
constructor already did.

Fixes #977.

Tests: web-platform-tests/wpt#61212
@annevk
annevk force-pushed the node-creation-realm branch from 6430f14 to f9368cd Compare July 10, 2026 09:18
@annevk
annevk requested review from domfarolino and noamr July 10, 2026 09:21
@annevk
annevk merged commit 9596708 into main Jul 17, 2026
2 checks passed
@annevk
annevk deleted the node-creation-realm branch July 17, 2026 12:29
annevk added a commit to whatwg/html that referenced this pull request Jul 17, 2026
Align with DOM in creating parsed nodes in the relevant realm of their node
document rather than the realm running the parser.

DOM PR: whatwg/dom#1491

Tests: web-platform-tests/wpt#61212
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Define the realm of nodes

2 participants