Recursive AI

Changelog

All onehtml Go docs

All notable changes to this library are recorded here. The format follows Keep a Changelog and the project follows Semantic Versioning.

[1.1.1] - 2026-12-03

Added

  • ComputedStyle.SpecifiedDisplay: the element's display as declared, in the short form Get uses, before blockification. A float, an absolutely positioned element, the root element and a flex or grid item compute to a block-level display (CSS Display 3 section 2.7), so Get("display") on a float declared inline-flex reads flex; SpecifiedDisplay still reads inline-flex, which tells a caller the inner display type.

Fixed

  • steps() keeps jump-start, jump-none and jump-both as written when serialized (steps(2, jump-start), no longer steps(2, start)); jump-end and end still read as steps(2).
  • object-position takes a unitless 0 as the offset in its three- and four-value forms (top 0 right 1px is calc(100% - 1px) 0px, no longer refused and reset to 50% 50%).
  • background-size computes as browsers report it: a single value is the value and auto (10px is 10px auto), two autos are auto, and lengths are in px (1em is 16px auto). A negative or malformed size is invalid.
  • The background-* longhand lists (background-position-x and -y, -size, -repeat, -clip, -origin, -attachment, -blend-mode) read back as long as the background-image list: a longer list is cut, and a shorter one repeats from its start (background-position: left, right with one image reads 0% for background-position-x).

Notes

  • The initial font-family stays serif. Browsers take it from the platform's default font settings, so it is not fixed by a standard; callers that need another default set font-family on the root.

[1.1.0] - 2026-12-03

Added

  • Styles.Registrations and PropertyRegistration: the document's @property rules (CSS Properties and Values API 1). A registered custom property now takes its initial value when nothing sets it, does not inherit when inherits is false, and has a value that does not match its syntax treated as unset; a matching value is computed to its canonical form (calc(1px + 2px) is 3px). ResolveAnimations reports a registered custom property that a keyframe sets, so a caller can interpolate it by its syntax.
  • font takes the system font keywords (caption, icon, menu, message-box, small-caption, status-bar), as Chrome reports them on Linux: a 16px Arial in the normal style and weight.
  • The table element's border attribute sets the four border widths (1px when the value does not parse).
  • WithFontMetrics, FontQuery, FontMetrics and FontMetricsFunc: the caller measures the primary font, and the ex, ch, cap and ic units (and the root-relative rex, rch, rcap and ric) take its x-height, zero advance, cap height and ideograph advance. Without it, or for a measurement the function leaves at zero, the estimates stay (half an em, 0.7 em, one em). font-size in ex is relative to the parent's font.
  • ComputedStyle.InvalidDeclarations and Styles.InvalidDeclarations, with InvalidDeclaration: the declarations that won the cascade but are invalid at computed-value time (a var() that does not fit the property, a shorthand that does not expand after substitution, a custom property that refers to nothing or does not fit its registered syntax), with their source.

Changed

  • Several computed values now read back in the forms browsers report, so code that compared serialized values from 1.0.0 sees new strings: multi-word font-family names are quoted, font-stretch is a percentage, a numeric line-height reads as px through Get (descendants still inherit the number), animation times are in seconds, object-position and background-position-x/-y keywords become percentages, and px lengths are written with six significant digits. Details under Fixed.

Fixed

  • Media features with a length now match in vw, vh, vmin, vmax (and the small, large and dynamic forms) and with calc(), min(), max() and clamp(), including on the left of a range: (min-width: 50vw), (min-width: calc(400px + 400px)).
  • width: calc(50% - 10px) no longer drops the length term of a sum with a percentage in a non-negative property.
  • The default style sheet no longer sets unicode-bidi: bidi-override on every element: that block applies to ISO-8859-8 documents only. Block elements are isolate and bdo is isolate-override, as the HTML Standard's rules say.
  • The default style sheet's table rules apply "only if border is not equivalent to zero": cells of table[border=0] no longer get a 1px inset border.
  • Medium monospace is 13px: a font family list that is the generic monospace alone uses the fixed default size (pre, code, kbd, samp, tt), with the keyword scale of that size, and em, larger, smaller and inheritance under a parent that is not monospace start from the parent's size scaled to it. ui-monospace, named families and lists with other families keep 16px.
  • columns, grid-area, grid-row and grid-column set their longhands. place-content, place-items and place-self keep safe and unsafe. font-variant and font-synthesis are expanded, and font resets the font-variant-* longhands instead of inheriting them. column-width has the initial value auto.
  • var() in padding-inline, padding-block, margin-inline, margin-block, inset-inline, inset-block and the border-inline-* and border-block-* shorthands now substitutes into the physical longhands.
  • A quoted url('...') in the background shorthand (a data: URL included) no longer makes background-image compute to none.
  • animation-delay reads back the delay list, also when set through the animation shorthand.
  • In ResolveAnimations, box-shadow is one animated property (not its box-shadow-* longhands) and font-stretch keeps that name (not font-width).
  • The default style sheet is regenerated from the current HTML Standard text.
  • word-spacing takes a percentage and keeps it in the computed value.
  • border-*-width: inherit takes the width the parent specified, not the 0 the parent reads when it has no border style (the child's own style still decides whether the width applies); with nothing specified above it is medium, 3px.
  • align-items and justify-items refuse anchor-center (align-self and justify-self keep it); page takes an identifier and refuses a string; text-transform takes none, capitalize, uppercase and lowercase alone, so full-width and full-size-kana are invalid, as in Chrome 156.
  • An unquoted font-family name of several words that starts with a generic family or a CSS-wide keyword (serif x) is invalid, and the declaration is dropped; x serif is still a family name.
  • Easing functions serialize as browsers do: steps(4, end) is steps(4), step-start is steps(1, start), step-end is steps(1), and linear() lists every stop with its input (linear(0 0%, 0.5 50%, 1 100%); a stop with two inputs becomes two stops).
  • object-position computes as a position: keywords become percentages, an offset from the right or bottom edge becomes calc(100% - 10px), lengths are in px, and a calc() sum puts the percentage first.
  • text-align takes -webkit-left, -webkit-center and -webkit-right; the default sheet makes center and caption -webkit-center, and th centred unless its parent aligns text some other way. The engine keyword -internal-center stands for that last rule and is accepted from any source.
  • text-indent takes hanging and each-line, in either order, and computes them after the length.
  • The color scheme of an element decides its system colors and light-dark(): color-scheme is read (normal is light; dark is dark; light dark follows the host's preference; only is kept and serialized last). An element without color-scheme stays light under a dark host, as Chrome does. The initial color follows the scheme of the root element.
  • The system colors have Chrome's values (ButtonBorder black, Highlight rgba(0, 65, 198, 0.8), SelectedItem #1967d2, GrayText gray), and the deprecated system colors compute as CSS Color 4 section 6.3 maps them (Menu, Window, InfoBackground, Background are Canvas; ThreeDFace and ButtonHighlight are ButtonFace; ActiveBorder and WindowFrame are ButtonBorder; WindowText is CanvasText), in the light and dark scheme.
  • The default style sheet's table[border] rules read the attribute as an integer: border=05 is a border of 5, border=" 0" and border=0px are none. Their specificity is that of table[border], so table[frame] rules after them win again.
  • font-family prints a family name that is more than one word, or that needs escaping, as a quoted string ("Open Sans", fantasy, "Times New Roman"), as browsers do; a single identifier stays bare, also when it was quoted.
  • font-stretch computes to a percentage (condensed is 75%, normal is 100%), also through the font shorthand.
  • A numeric line-height reads as the length it multiplies out to under the element's font size (1.5 at 16px is 24px), also through the font shorthand; descendants still inherit the number.
  • animation-duration with no duration computes to 0s for an animation on the document timeline (it stays auto with a scroll, view or none timeline), and animation-delay is written in seconds (100ms is 0.1s).
  • background-position-x and -y compute as positions: keywords are percentages, 0 is 0px, an offset from the right or bottom edge is calc(100% - 10px), and a sum puts the percentage first.
  • Registered custom properties compute <angle> to deg, <time> to s and <resolution> to dppx, and resolve font-relative lengths against the element's own font size.
  • Lengths in px are written with six significant digits, as browsers do (13.3333px, 37.7953px).
  • The default style sheet gives text inputs 1px 2px padding, a 2px inset border and the text cursor, buttons 1px 6px padding and the default cursor, textarea the monospace font and resize: both, label the default cursor, and meter and progress display: inline-block.

[1.0.0] - 2026-12-02

First release.

Added

  • onehtml/encoding: the Encoding Standard as a package of its own. Lookup by label, All, FromContentType; Encoding.Decode (the standard's "decode" with error count, byte order mark handling and an OffsetMap between text and byte offsets) and Encoding.Encode (the "html" error mode); streaming Decoder and Encoder with Bytes, String, Reader and Writer, correct on any chunk boundary.

  • onehtml: the WHATWG HTML parser (tokenizer, tree construction in full, fragments, foreign content, templates, parse errors, the Encoding Standard's detection and decoders), a read-only DOM in a flat arena with value handles, serialization, and iterator-based traversal.

  • onehtml/css: the CSS Syntax tokenizer and parser as a public syntax tree (ParseStylesheet, ParseBlockContents, ParseDeclarations, ParseRule, ParseDeclaration, ParseValue, ParseValues, ParseAnPlusB) with exact byte ranges for every token, comment, rule and declaration, typed views of @import, @layer, @namespace, @container and @charset, canonical serialization (SerializeIdent, SerializeString, ComponentValues.String), and parse limits (WithMaxInput, WithMaxTokens, WithMaxNesting).

  • onehtml/css: media query lists (ParseMediaQueries: canonical text, per-query facts, evaluation against an Environment) and @supports conditions (ParseSupports, DeclarationSupported, WithSelectorSupport).

  • WithSheetEnvironmentCharset: the encoding of the linking document as the last resort when decoding a stylesheet's bytes.

  • Selectors Level 4 (CompileSelector, Select, Matches, Closest, :has(), :is(), :where(), :nth-child(… of S) and the rest), with limits on selector size and complexity.

  • The CSS cascade: CSS Syntax 3 parsing, @media, @supports, @layer, @scope, nesting, custom properties with var(), calc(), Color 4/5, the user-agent sheet from the HTML rendering section, and computed values serialized as getComputedStyle gives them. Linked sheets are supplied by the caller; the library never fetches.

  • A mutable layer: immutable snapshots, Editor, Document.Apply, change sets, and Styles.Restyle, which follows an edit incrementally.

  • Lossless editing: Rewrite splices only the edited byte ranges into the original document and verifies the result by parsing it again; the family edit-file format (ReadEditFile, Replay); Stylesheet for <style> and linked sheets.

  • onehtml/accessibility: the accessibility tree a browser gives screen readers (WAI-ARIA 1.2, HTML-AAM, Accessible Name and Description 1.2, Core-AAM, SVG-AAM), a reading view and navigation lists.

  • onehtml/accessibility/validation: an accessibility checker over every WCAG level (2.0, 2.1, 2.2; A, AA, AAA) with rules labelled by ACT rule, axe rule and WCAG criterion, suggested fixes as edits, and exports to native JSON, axe-compatible JSON, SARIF 2.1.0 and EARL.

  • Limits on input size, nesting depth, attribute count, node count, selector complexity, stylesheet size and edit-file size, checked before the work they guard. No panic and no hang on any input; traversals use explicit stacks.

  • Animations: Styles.Keyframes with KeyframesRule and KeyframeBlock, Styles.ResolveAnimations and ResolveKeyframes with ResolvedKeyframes, and Styles.ChangedKeyframes to tell which @keyframes rules an edit changed.

  • The animation shorthand sets its longhands.

  • onehtml/css values: ParseQuantity (numbers, percentages, dimensions and calc() and the other math functions, with LengthContext, WithPercentBase and the Accept kinds), ParseColor (every Color 4 and 5 syntax; Color with Convert, gamut-mapped NRGBA, String; NewColor), ExpandShorthand, ValidDeclaration, the property table (LookupProperty, Properties) and var() substitution (SubstituteVars, ResolveCustomProperties).

  • DOM reads: Node.ChildElements, ChildElementCount, FirstElementChild, LastElementChild, NextElementSibling, PrevElementSibling, DescendantElements, TagName, ID, ClassName, Classes, HasClass, Contains, IsConnected, RootNode, ComparePosition with DocumentPosition, ElementsByTagName, ElementsByTagNameNS, ElementsByClassName, AttributeNS, Document.ElementByID.

  • Source map: Attr.QualifiedName, Attr.NameSpan, Node.DataSpan, Node.AnchorSpan and Node.Provenance with the Provenance flags (implied, cloned, reparented, attributes merged, self-closing, merged text, synthesized).

  • Parsing: WithContentType, WithDefaultEncoding and WithPrescanLimit; SniffEncoding reports the encoding a parse starts with; the limits MaxFormattingElements, MaxTotalAttributes and MaxOffsetRuns; FragmentContext.InsideForm, IntegrationPoint and QuirksMode, and FragmentContextOf to take a context from an element; ParseError.TreeConstruction.

  • Tokenizer: byte ranges for tag, doctype and processing-instruction names and for every attribute (TokenAttr.Quote, Duplicates), SetForeignContent, Err, and WithLimits for NewTokenizer.

  • Editing: WithMaxEdits, WithMaxInsertedLength and WithMaxVerifications for Rewrite (and, through WithRewriteOptions, Replay); RewriteResult.Verifications, Changes and SheetReports; ReplayResult.Details and Rewrite; NewEditFile to save in-memory edits as an envelope; Edit.WithMeta; SetStyleKeepImportant; MarshalEditFile takes WithEditFileIndent.

  • Locators: LocatorIndex.Verify, Fingerprint.Compare, Fingerprint.PathText, NormalizeText, IsGeneratedName, and accessibility.Node.Locator. Text and comment targets carry an anchor.

  • Accessibility: AXTree.Update, AXTree.WithContext and UpdateInfo; AXTree.Diff and ReadingView.Diff with TreeDiff and ReadingViewDiff. Updating rebuilds the tree and reports why.

  • Accessibility tree: WithMaxNameLength, WithMaxIDReferences and WithMaxOwnsWork; Node.Autofocus, Labels, RoleOrigin, Relations, Focus and Diagnostics; AXTree.FocusOrder, Hidden, Diagnostics and ElementRole (with WithHasAccessibleName and the WithMaxRole… options); the url property, resolved with the URL Standard (LinkEntry.URL too); WriteChromeJSON for a Chrome-shaped export; ReadingView.Text.

  • Rendered facts: ParseFacts takes FactsOptions (FactsLimits); FactsError and ErrFacts; Facts.Map with FactsMap, ParseBackgroundSamples and FactsFromBoxes. With facts, date, time, month, week and datetime-local inputs, meters and image buttons get the nodes a browser draws inside them.

  • The ARIA role, state and property tables of the tree and the checker now come from one table generated from WAI-ARIA 1.3, DPUB-ARIA and Graphics ARIA.

  • Editor: CreateFragment, Clone, ParseFragment, PrependChild, RemoveChild, ReplaceChild, ReplaceChildren (all or nothing), SetInnerHTML, SetAttributeNS, ToggleAttribute, AddClass, RemoveClass, ToggleClass, SetStyle and RemoveStyle; fragment nodes insert their children; EditError.Kind with EditKind; Document.Edit takes WithEditorLimits (EditorLimits). Change.Classes, Change.InlineStyle (StyleDelta) and Change.InTemplate; ChangeSet.Impact (StyleImpact) and ChangeSet.Merge.

  • Validation: 41 more rules (landmarks, region, skip-link, headings, lists, definition lists, accesskeys, hidden-content, server-side-image-map, focus-order-semantics, the role name rules, aria-allowed-role, aria-text, aria-braille-equivalent, aria-roledescription, label-title-only, form-field-multiple-labels, image-redundant-alt, scope-attr-valid with its fix, and the table rules); target-size asks for rendered facts. Checker.Recheck and Report.Recheck; Report.SuggestedEditFile and the suggestedEdits envelope in the native export; Result.FactsUsed; WithTree; LookupProfile, Profiles, Profile.Criteria, Profile.Version, Profile.Level; the WCAG, ACT and axe tables (ACTRules, LookupACTRule, AxeRules, LookupAxeRule, ParseACTTestCases, Criterion.ID, Criterion.Guideline, Criterion.Automation).

  • onehtml/accessibility/aria: the WAI-ARIA taxonomy as a public package. LookupRole, Roles, ParseRole, LookupProperty and Properties return small read-only Role and Property handles: module (WAI-ARIA, Digital Publishing, Graphics), abstract roles, superclasses and IsA, required context and owned elements (OwnedClosure), required, supported, deprecated and prohibited attributes, name-from rules, implicit values, value types, tokens and defaults, and Property.Valid to check a value against its type.

Notes

  • One sentinel for limits: onehtml.ErrLimit, css.ErrLimit and encoding.ErrLimit are the same value, so errors.Is(err, onehtml.ErrLimit) matches every limit error of the module. Each package's LimitError has the same {Limit, Max} fields.
  • Pure Go, standard library only, no cgo, no unsafe; Go 1.24 or newer.
  • The library opens no files and makes no network requests, and it never runs script.