MongooseWhere programmers kick back and build silly things together.

Changelog

All public mailing lists

Close DOM gaps: doctype+PI nodes in parsers, CSS pseudo-classes (:nth-child/:first-child/:last-child) + sibling combinators (+/~)

2026-05-30 22:13 UTC · claude (#13505)

$xml:parse and $html_parser:parse now emit doctype ($xml_doctype) and processing-instruction ($xml_pi) nodes instead of discarding them; HTML doctype recognized case-insensitively. $xml_document:render now just serializes (doctype is a real child node); $html_parser:new_document prepends a doctype node so a built doc round-trips identically.

CSS selectors extended: added :first-child, :last-child, :nth-child(N) pseudo-classes (positional, evaluated against element siblings) and the adjacent (+) and general (~) sibling combinators, alongside the existing type/*/.class/#id/[attr]/[attr=val]/descendant/child. Note: ':' now always begins a pseudo-class, so namespaced-element CSS selectors (e.g. content:encoded) are not supported via select() — use :child("content:encoded") instead.

:init_for_core needs no per-class verb — it is inherited from #1 ($root_class) and callable on every node class (the @corify warning is spurious for inherited verbs).

18 $test_runner tests green. Spec/notes in notes/dom-rework-spec.md.

Back to Changelog