Repository navigation
Stdlib: DOMNode::replaceChild accept Text/Comment children (#21976) - #22074
Merged
Merged
Conversation
replaceChild incorrectly required Element newChild, so createTextNode replacements threw Hierarchy request error while remove+append worked. Align with php-src tree-mutation child kinds and documentElement updates. Co-authored-by: Cursor <cursoragent@cursor.com>
PurHur
added a commit
that referenced
this pull request
Jul 22, 2026
…) (#22075) Emergency stamp: master lib/ext moved after the last fingerprint stamp, re-breaking north-star5-fast 4f-m (manifest 8b4e4f06… vs live d22247bd…). Honest blob rebuild still deferred; spine sidecar SHA already matches. Co-authored-by: PurHur <PurHur@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DOMNode::replaceChild()rejecting non-Element children (createTextNode→ Hierarchy request error) whileremoveChild+appendChildworked.ext/dom/node.cdom_node_replace_child: allow tree-mutation children (Text/CDATA/Comment/PI/EntityRef/Element); expand DocumentFragment in place; updatedocumentElementonly when replacing with/away from an Element.test/compliance/cases/dom/andtest/repro/.Closes #21976
php-src reference
ext/dom/node.c—dom_node_replace_child/ hierarchy checksPHP implementation
ext/dom/VmDom.php—replaceChild()Test plan
dom_node_replacechild_text.phpt(VM+JIT)createTextNode/toObjecton DOM JIT helpers) — out of issue done-when (VM+JIT)Verification
Pre-claim gates (master): inventory OK 6335/6335; north-star5-fast FAIL gen-0 mismatch #8713 (pre-existing).
Made with Cursor