[w3c/DOM-Parsing] Serialize custom element registry boundaries in XML (PR #92)

Serialize null and scoped custom element registry boundaries on HTML-namespace elements in XML output, matching the HTML serialization behavior proposed in https://github.com/whatwg/html/pull/12000.

The XML serialization algorithms take a registry context, defaulting to the node document's registry for standalone serialization, and carry it through element, document, and fragment recursion. An HTML element gets a generated no-namespace `customelementregistry=""` attribute when its null or scoped registry differs from that context and the attribute is not already present. Descendants use the element's registry, or the template contents' registry for a template element.

Existing attributes and namespace handling are preserved, and serialization does not mutate the DOM. As with the HTML proposal, the attribute does not encode scoped registry identity or global-registry boundaries inside null/scoped subtrees.

Companion changes:

- HTML entry points and fragment serialization: https://github.com/whatwg/html/pull/12000
- Existing DOM infrastructure: https://github.com/whatwg/dom/pull/1500
- Tests, including new HTML-document and XHTML XML serialization cases: https://github.com/web-platform-tests/wpt/pull/65320

Validation:

- ReSpec rendering with `--haltonerror`: passed, including canonical registry references.
- `git diff --check`: passed.
- HTML companion: source lint and the official remote build passed (`exit-code: 0`).
- WPT lint, shared JavaScript syntax, and XHTML well-formedness checks: passed.
- Edge 158.0.4370.33 ran both new test files using the WPT testharness, with no harness/script errors: 17 subtests passed and 33 failed. The failures expose missing registry-boundary generation and an existing XHTML descendant-registry discrepancy; this PR does not include a browser implementation.
- Unchanged comparison tests in the same browser: scoped HTML serialization had 14 passes/11 failures, and general XMLSerializer serialization had 27 passes/6 failures. These existing browser failures are not claimed as passing.

The normal `wpt run` setup stalled before executing tests and was stopped. The browser results above were collected by serving the unmodified test files locally and using a testharness completion callback with headless Edge.

You can view, comment on, or merge this pull request online at:

  https://github.com/w3c/DOM-Parsing/pull/92

-- Commit Summary --

  * Serialize custom element registry boundaries in XML

-- File Changes --

    M index.html (74)

-- Patch Links --

https://github.com/w3c/DOM-Parsing/pull/92.patch
https://github.com/w3c/DOM-Parsing/pull/92.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/DOM-Parsing/pull/92
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/DOM-Parsing/pull/92@github.com>

Received on Friday, 20 November 2026 21:31:13 UTC