Skip to content

Fix AOT DOM id-map rebind, isId(), getElementById disconnected guard - #35573

Merged
PurHur merged 1 commit into
masterfrom
fix/dom-aot-gei-isid-rebind
Aug 28, 2026
Merged

Fix AOT DOM id-map rebind, isId(), getElementById disconnected guard#35573
PurHur merged 1 commit into
masterfrom
fix/dom-aot-gei-isid-rebind

Conversation

@PurHur

@PurHur PurHur commented Aug 28, 2026

Copy link
Copy Markdown
Owner

Summary

php-src: ext/dom/attr.c (dom_attr_is_id), ext/dom/document.c (dom_get_element_by_id), ext/dom/node.c (detach clears links).

Test plan

./script/aot-smoke.sh
# aot-smoke: 8 passed, 0 failed

./script/phpunit.sh --filter 'Issue34821DomDtdIsIdAotTest|Issue29694DomGetElementByIdReplaceChildAotTest|DomGetElementByIdSetAttributeIdAotTest|DomReplaceChildSetIdAttributeIdMapAotTest|DomSetAttributeIdRebind35321AotTest'
# OK (6 tests, 25 assertions)

./script/docker-exec.sh -- bash -lc './test/repro/maintainer_gap_dom_getelementbyid_setattribute_id && ./test/repro/maintainer_gap_dom_getelementbyid_replacechild_same_id'
# before=x / after_b=1 / after_a=0 / … ; null / c

Closes #34821
Closes #29694
Closes #19870

Made with Cursor

…ard.

loadHTML setAttribute id rebind now keys off receiver attrs and getElementById
pairing instead of the global Attr cache; replaceChild clears detached link
slots; map fallback rejects disconnected id-map hits while the single-slot cache
stays authoritative for rebind temps lacking parent slots (#19870 / #29694 / #34821).

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 2ecdec3 into master Aug 28, 2026
1 check failed
@PurHur
PurHur deleted the fix/dom-aot-gei-isid-rebind branch August 28, 2026 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment