# Changelog

All notable changes to svgdom will be documented in this file.

## Unreleased

## 0.1.29 - 2026-09-09

### Changed

- Moved CI to a working pnpm release, since 11.13.0 is refused as a broken release by the installer.

### Fixed

- Serialized `xmlns` attributes created with `setAttribute()` as default namespace declarations instead of throwing, which broke `svg()` for svg.js canvases since 0.1.25 (#141).

## 0.1.28 - 2026-07-20

### Added

- Added CI coverage for supported Node.js versions, linting, formatting, and pinned svg.js integration.

### Changed

- Composed DOM interfaces explicitly and removed the internal `query()` and `matchWithScope()` helpers from the public Element surface.
- Separated selector parsing from matching, bounded selector caching, and tightened combinator, pseudo-class, and attribute matching.
- Removed obsolete implementation scaffolding, legacy bundle code, and unused geometry helpers.
- Removed the obsolete Reify test hook and its dependencies.

### Fixed

- Preserved DOM tree mutation invariants by validating edits atomically, adopting cross-document subtrees, and maintaining parent and owner links.
- Kept `CharacterData.data` and `nodeValue` synchronized and corrected range-based mutation methods.
- Corrected recursive node normalization and structural equality without mutating compared trees.
- Made document types safely assignable, reusable after failed document creation, and metadata-preserving.
- Preserved node subtype state, ownership, attributes, and namespace-unaware names when cloning.
- Made XML fragment and document parsing transactional while retaining namespaces, CDATA, and doctype metadata.
- Made `outerHTML` replacement atomic for attached elements and a no-op for detached elements.
- Corrected SVG absolute length conversion factors to use the 96 dpi CSS basis.
- Preserved zero-valued rotation centers in SVG matrix transformations.
- Made `getElementsByClassName()` handle missing and multiple classes consistently.
- Normalized all `ParentNode` and `ChildNode` variadic arguments and preserved insertion positions when nodes move.
- Made `Document.head` and `Document.body` return `null` for empty, partial, and non-HTML trees.
- Made `Node.contains()` include the node itself and handle detached nodes correctly.
- Serialized the complete HTML void-element set only under HTML serialization rules.

## 0.1.27 - 2026-07-18

### Changed

- Documented common server-side, testing, and asset-pipeline use cases for svgdom.

### Fixed

- Fixed `getBoundingClientRect()` for SVG elements embedded under plain HTML parents.
- Bounded arc-length approximation to prevent stack overflows and return finite lengths for difficult arcs.
- Preserved extrema of nearly quadratic cubic curves in path bounding boxes.
- Included `letter-spacing` when calculating text bounding boxes.

## 0.1.26 - 2026-07-17

### Changed

- Raised the minimum supported Node.js version to 22.13, allowing CommonJS consumers to load svgdom directly with `require()`.
- Updated `image-size` and Mocha, removed the obsolete webpack toolchain, and patched transitive test dependencies.

## 0.1.25 - 2026-07-16

### Added

- Added selector support for `:empty`, `:has()`, `:is()`, `:where()`, nested functional pseudo-classes, and the `of <selector>` syntax for `:nth-child()` and `:nth-last-child()`.
- Added a `CSSStyleDeclaration` implementation for `Element.style` with `cssText`, custom properties, priorities, ordered enumeration, and synchronized style attributes.

### Changed

- Moved development and dependency management from npm to pnpm.
- Separated semantic linting with ESLint from code formatting with Prettier.

### Fixed

- Structural child pseudo-classes now count only element siblings and correctly support `An+B` formulas, including negative coefficients and whitespace.
- Fixed namespace-aware DOM creation, lookup, fragment parsing, and XML serialization, including inherited bindings, prefix collisions, namespaced attributes, CDATA, and foreign elements.
