Skip to content

Stdlib: DOMText::splitText() text node split (#17513)#17523

Merged
PurHur merged 1 commit into
masterfrom
agent/advanced-stdlib-dom-split-text-17513
Jul 9, 2026
Merged

Stdlib: DOMText::splitText() text node split (#17513)#17523
PurHur merged 1 commit into
masterfrom
agent/advanced-stdlib-dom-split-text-17513

Conversation

@PurHur

@PurHur PurHur commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • Implement DOMText::splitText(int $offset) in ext/dom/TextSplitText.php + VmDom::textSplitText() (php-src ext/dom/text.c)
  • Fix syncNodeLinks() to refresh previousSibling/nextSibling when a parent already has a cached childNodes list (required for split + sibling mutation paths)

php-src reference

  • ext/dom/text.cdom_text_split_text()
  • ext/dom/characterdata.c — shared CharacterData mutation

Verification

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/vm.php test/repro/maintainer_gap_dom_split_text.php'
# ok

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter DomModuleTest::test_dom_text_split_text'
# OK (1 test)

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter dom_text_split_text'
# OK (3 tests — VM + JIT compliance)

Closes #17513

Made with Cursor

Wire DOMText::splitText() on the VM DOM path and fix sibling-link
refresh when a parent already has a cached childNodes list.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur PurHur merged commit 41fc5a9 into master Jul 9, 2026
1 check failed
@PurHur PurHur deleted the agent/advanced-stdlib-dom-split-text-17513 branch July 9, 2026 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stdlib: DOMText::splitText() missing — text node split fatal (ext/dom/text.c)

1 participant