Skip to content

Fix DOM setAttributeNS namespace lookup on createElementNS elements (#15380, #15381) - #15394

Merged
PurHur merged 1 commit into
masterfrom
agent/dom-batch-15380-15381
Jul 3, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/dom-batch-15380-15381

Conversation

@PurHur

@PurHur PurHur commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Summary

php-src reference

  • ext/dom/element.c — dom_element_set_attribute_ns, dom_element_get_attribute_ns, dom_element_has_attribute_ns
  • ext/dom/node.c — dom_node_namespace_uri_read, dom_node_prefix_read

PHP implementation

  • ext/dom/DomNodeState.php — attributeNamespaces map
  • ext/dom/VmDom.php — resolveAttributeNamespaceUri() helper; wire through set/get/has/remove NS paths and cloneNode

Verification

./script/docker-exec.sh -- bash -lc 'php test/repro/maintainer_gap_dom_get_attribute_ns.php'
./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/maintainer_gap_dom_get_attribute_ns.php'
./script/docker-exec.sh -- bash -lc 'php test/repro/maintainer_gap_dom_element_ns_properties.php'
./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/maintainer_gap_dom_element_ns_properties.php'
./script/docker-exec.sh -- bash -lc 'php test/repro/maintainer_gap_dom_namespace_attributes.php'
./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/maintainer_gap_dom_namespace_attributes.php'
./script/docker-exec.sh -- bash -lc './vendor/bin/phpunit --filter "dom_set_attribute_ns_create_element|dom_create_element_ns_properties|dom_namespace_attributes"'

Output: all repros exit 0; PHPUnit OK (6 tests, 6 assertions).

Closes #15380
Closes #15381

Made with Cursor

…15380).

Store explicit attribute namespace URIs from setAttributeNS() so getAttributeNS/hasAttributeNS work without xmlns declarations; add repro and compliance guards for #15380 and #15381.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant