Files
obscura/crates/obscura-js/js
SGavrl dc2a2e3b52 feat(js): DOM, namespace, validity, and parsing APIs surfaced by WPT conformance work (#230)
* feat(js): DOMException, ParentNode methods, composedPath, HTMLCollection/NodeList

Add the DOMException global (name, message, code, and the legacy code
constants on both the constructor and instances). It was referenced by
AbortSignal and others but never defined, so any test touching it failed
with 'DOMException is not defined'.

ParentNode append/prepend/replaceChildren now live on Element, Document,
and DocumentFragment and use the spec node conversion: a non-Node
argument (including null and undefined) becomes a Text node instead of
being dropped or throwing. replaceChildren was missing entirely; append
and prepend were Element-only and skipped null/undefined.

Add Event.composedPath() and the HTMLCollection and NodeList globals.

Verified with fetch --eval; integration suite still 28/28.

* feat(js): setHTMLUnsafe/getHTML, namespace lookups, getElementsByTagNameNS, Attr, form validity, Response.blob

Element and ShadowRoot setHTMLUnsafe / getHTML as shims over innerHTML.

Node lookupNamespaceURI / lookupPrefix / isDefaultNamespace walking the
element ancestry and xmlns declarations, with the built-in xml and xmlns
namespaces.

Element and Document getElementsByTagNameNS with namespace and localName
wildcard support.

Attr nodes plus Document createAttribute / createAttributeNS and Element
getAttributeNode(NS) / setAttributeNode(NS) / removeAttributeNode, bridged
to get and set attribute.

Form control constraint validation (ValidityState, validity,
willValidate, checkValidity, reportValidity, setCustomValidity,
validationMessage) and text selection (selectionStart / End / Direction,
setSelectionRange, setRangeText, select) as Element.prototype shims.

Patch blob / text / json onto the engine Response prototype so
fetch(...).blob() works; the real Response prototype lacked blob.

Verified with fetch --eval; integration suite still 28/28.
2026-06-03 09:14:11 +00:00
..