Skip to content

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

Merged
annevk merged 1 commit into
mainfrom
node-creation-realm
Jul 17, 2026
Merged

Create nodes in the realm of the document they are created for#12669
annevk merged 1 commit into
mainfrom
node-creation-realm

Conversation

@annevk

@annevk annevk commented Jul 10, 2026

Copy link
Copy Markdown
Member

Follow DOM in creating parsed nodes in the relevant realm of their node document rather than the realm running the parser, resolving a cross-browser interoperability issue.

Depends on whatwg/dom#1491.

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


/common-dom-interfaces.html ( diff )
/dom.html ( diff )
/dynamic-markup-insertion.html ( diff )
/form-elements.html ( diff )
/infrastructure.html ( diff )
/parsing.html ( diff )
/scripting.html ( diff )
/xhtml.html ( diff )

Follow DOM in creating parsed nodes in the relevant realm of their node
document rather than the realm running the parser, resolving a
cross-browser interoperability issue.

Depends on whatwg/dom#1491.
annevk added a commit to whatwg/dom that referenced this pull request Jul 17, 2026
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.

Tests: web-platform-tests/wpt#61212

HTML PR: whatwg/html#12669

Fixes #977.
@annevk
annevk merged commit 85f453b into main Jul 17, 2026
2 checks passed
@annevk
annevk deleted the node-creation-realm branch July 17, 2026 12:30
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.

2 participants