Stdlib: AOT loadXML user-script textContent detach + childNodes (#23251)#23255
Merged
Conversation
Keep the thin user-script loadXML path but materialize live children, route textContent writes through the DOM bridge, and serialize saveXML($node) from updated slots so held parentNode/childNodes match Zend. Co-authored-by: Cursor <cursoragent@cursor.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
loadXMLuser-script path sotextContentwrites detach held children (parentNode === null), updatechildNodes->length, and keeptextContentreadable without segfault (Regression: AOT DOMDocument::loadXML() user-script path skips DomRegistry — textContent write / childNodes / parentNode broken (ext/dom) #23251).objecttextContent stores through the DOM bridge; serializesaveXML($node)from updated slots.ext/dom/document.c(dom_document_load),ext/dom/node.c(dom_node_textContent_write). PHP-in-PHP inext/dom/+ thin JIT store hook — no newruntime/*.c.Test plan
php bin/vm.php test/repro/issue_23251_aot_loadxml_textcontent_detach.phpPHP_COMPILER_HELPER_RUNTIME_O=1 php bin/compile.php -o …/i23251.bin test/repro/issue_23251_aot_loadxml_textcontent_detach.php && ./i23251.bina_parent_null=true,b_parent_null=true,kids=1,text=z,xml=<r>z</r>, exit 0php vendor/bin/phpunit --filter "dom_textcontent_set_detaches|dom_loadxml_textcontent"→ OKphp vendor/bin/phpunit --group aot-link --filter "dom_loadxml_textcontent_detach|dom_loadxml_getelementbyid_user_script|dom_get_elements_by_tag_name_live"→ OK (3)php script/bootstrap-inventory.php --check→ OK 6563/6563./script/check-generated-docs.sh→ all in syncCloses #23251
Made with Cursor