Skip to content

Stdlib: Dom\HTMLDocument/XMLDocument Document API (#20556) - #20582

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-20556-dom-document-api
Jul 18, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-20556-dom-document-api

Conversation

@PurHur

@PurHur PurHur commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • Wire Dom\HTMLDocument / Dom\XMLDocument Document methods (createElement*, getElementsByTagName*, getElementsByClassName, importNode/adoptNode, saveXml/saveXmlFile/saveHtmlFile, ParentNode append/prepend/replaceChildren) by sharing legacy DOMDocument handlers and accepting living documents in VmDom::requireReceiver.
  • Add getElementsByClassName live NodeList collection; fix saveXML DocumentType child serialization (HTML docs with doctype).
  • php-src ref: ext/dom/php_dom.stub.php (Dom\Document / HTMLDocument / XMLDocument). PHP-in-PHP only — no new runtime/*.c.

Closes #20556

Test plan

  • PHP_COMPILER_PROFILE=8.4 php bin/vm.php test/repro/issue_20556_dom_document_api.php — all methods yes; create/query/import/save/adopt ok
  • vendor/bin/phpunit test/compliance/VMTest.php --filter dom_living_document_api — OK
  • PHP_COMPILER_PROFILE=8.4 vendor/bin/phpunit test/compliance/VMTest.php --filter dom_html_document — OK (no regression)
  • php script/bootstrap-inventory.php --check — OK 5681/5681
  • JIT/AOT: host LLVM path currently fails unrelated MathBaseConvertRuntime::constFloat / cold helper emit; issue done-when is VM php-src-strict

Trust snapshot

  • Inventory green before/after; AOT smoke deferred (infra helper rebuild, not this diff)

Made with Cursor

Share DOMDocument create/query/import/adopt/save handlers with living Dom\
Document classes, add getElementsByClassName, and fix saveXml doctype
serialization for HTML documents with DocumentType children.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur force-pushed the agent/issue-20556-dom-document-api branch from 5a57dc1 to f644def Compare July 18, 2026 15:13
@PurHur
PurHur merged commit b97b611 into master Jul 18, 2026
1 check failed
@PurHur
PurHur deleted the agent/issue-20556-dom-document-api branch July 18, 2026 15:13
PurHur added a commit that referenced this pull request Jul 18, 2026
Unblocks spine sync for the pgsql PHP 8.4 helpers PR (#7083).
PurHur added a commit that referenced this pull request Jul 18, 2026
* Stdlib: ext/pgsql PHP 8.4 helpers (pg_jit/copy/memory/…) (#7083)

Register pg_change_password, pg_jit, pg_put_copy_data/end,
pg_result_memory_size, pg_set_chunked_rows_size, and pg_socket_poll when
libpq FFI is available. Real PQresultMemorySize / COPY / SHOW jit paths;
chunked-rows and socket-poll idle-return on older libpq without those APIs.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Bootstrap: spine-cover Dom GetElementsByClassName after #20582

Unblocks spine sync for the pgsql PHP 8.4 helpers PR (#7083).

---------

Co-authored-by: PurHur <PurHur@users.noreply.github.com>
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