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'sdisplayas declared, in the short formGetuses, before blockification. A float, an absolutely positioned element, the root element and a flex or grid item compute to a block-leveldisplay(CSS Display 3 section 2.7), soGet("display")on a float declaredinline-flexreadsflex;SpecifiedDisplaystill readsinline-flex, which tells a caller the inner display type.
Fixed
steps()keepsjump-start,jump-noneandjump-bothas written when serialized (steps(2, jump-start), no longersteps(2, start));jump-endandendstill read assteps(2).object-positiontakes a unitless0as the offset in its three- and four-value forms (top 0 right 1pxiscalc(100% - 1px) 0px, no longer refused and reset to50% 50%).background-sizecomputes as browsers report it: a single value is the value andauto(10pxis10px auto), twoautos areauto, and lengths are in px (1emis16px auto). A negative or malformed size is invalid.- The
background-*longhand lists (background-position-xand-y,-size,-repeat,-clip,-origin,-attachment,-blend-mode) read back as long as thebackground-imagelist: a longer list is cut, and a shorter one repeats from its start (background-position: left, rightwith one image reads0%forbackground-position-x).
Notes
- The initial
font-familystaysserif. Browsers take it from the platform's default font settings, so it is not fixed by a standard; callers that need another default setfont-familyon the root.
[1.1.0] - 2026-12-03
Added
Styles.RegistrationsandPropertyRegistration: the document's@propertyrules (CSS Properties and Values API 1). A registered custom property now takes its initial value when nothing sets it, does not inherit wheninheritsis 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)is3px).ResolveAnimationsreports a registered custom property that a keyframe sets, so a caller can interpolate it by its syntax.fonttakes 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
tableelement'sborderattribute sets the four border widths (1px when the value does not parse). WithFontMetrics,FontQuery,FontMetricsandFontMetricsFunc: the caller measures the primary font, and theex,ch,capandicunits (and the root-relativerex,rch,rcapandric) 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-sizeinexis relative to the parent's font.ComputedStyle.InvalidDeclarationsandStyles.InvalidDeclarations, withInvalidDeclaration: the declarations that won the cascade but are invalid at computed-value time (avar()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-familynames are quoted,font-stretchis a percentage, a numericline-heightreads as px throughGet(descendants still inherit the number), animation times are in seconds,object-positionandbackground-position-x/-ykeywords 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 withcalc(),min(),max()andclamp(), 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-overrideon every element: that block applies to ISO-8859-8 documents only. Block elements areisolateandbdoisisolate-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
monospaceis 13px: a font family list that is the genericmonospacealone uses the fixed default size (pre,code,kbd,samp,tt), with the keyword scale of that size, andem,larger,smallerand 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-rowandgrid-columnset their longhands.place-content,place-itemsandplace-selfkeepsafeandunsafe.font-variantandfont-synthesisare expanded, andfontresets thefont-variant-*longhands instead of inheriting them.column-widthhas the initial valueauto.var()inpadding-inline,padding-block,margin-inline,margin-block,inset-inline,inset-blockand theborder-inline-*andborder-block-*shorthands now substitutes into the physical longhands.- A quoted
url('...')in thebackgroundshorthand (a data: URL included) no longer makesbackground-imagecompute tonone. animation-delayreads back the delay list, also when set through theanimationshorthand.- In
ResolveAnimations,box-shadowis one animated property (not itsbox-shadow-*longhands) andfont-stretchkeeps that name (notfont-width). - The default style sheet is regenerated from the current HTML Standard text.
word-spacingtakes a percentage and keeps it in the computed value.border-*-width: inherittakes 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 ismedium, 3px.align-itemsandjustify-itemsrefuseanchor-center(align-selfandjustify-selfkeep it);pagetakes an identifier and refuses a string;text-transformtakesnone,capitalize,uppercaseandlowercasealone, sofull-widthandfull-size-kanaare invalid, as in Chrome 156.- An unquoted
font-familyname of several words that starts with a generic family or a CSS-wide keyword (serif x) is invalid, and the declaration is dropped;x serifis still a family name. - Easing functions serialize as browsers do:
steps(4, end)issteps(4),step-startissteps(1, start),step-endissteps(1), andlinear()lists every stop with its input (linear(0 0%, 0.5 50%, 1 100%); a stop with two inputs becomes two stops). object-positioncomputes as a position: keywords become percentages, an offset from the right or bottom edge becomescalc(100% - 10px), lengths are in px, and acalc()sum puts the percentage first.text-aligntakes-webkit-left,-webkit-centerand-webkit-right; the default sheet makescenterandcaption-webkit-center, andthcentred unless its parent aligns text some other way. The engine keyword-internal-centerstands for that last rule and is accepted from any source.text-indenttakeshangingandeach-line, in either order, and computes them after the length.- The color scheme of an element decides its system colors and
light-dark():color-schemeis read (normalis light;darkis dark;light darkfollows the host's preference;onlyis kept and serialized last). An element withoutcolor-schemestays light under a dark host, as Chrome does. The initialcolorfollows the scheme of the root element. - The system colors have Chrome's values (
ButtonBorderblack,Highlightrgba(0, 65, 198, 0.8),SelectedItem#1967d2,GrayTextgray), and the deprecated system colors compute as CSS Color 4 section 6.3 maps them (Menu,Window,InfoBackground,BackgroundareCanvas;ThreeDFaceandButtonHighlightareButtonFace;ActiveBorderandWindowFrameareButtonBorder;WindowTextisCanvasText), in the light and dark scheme. - The default style sheet's
table[border]rules read the attribute as an integer:border=05is a border of 5,border=" 0"andborder=0pxare none. Their specificity is that oftable[border], sotable[frame]rules after them win again. font-familyprints 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-stretchcomputes to a percentage (condensedis75%,normalis100%), also through thefontshorthand.- A numeric
line-heightreads as the length it multiplies out to under the element's font size (1.5at 16px is24px), also through thefontshorthand; descendants still inherit the number. animation-durationwith no duration computes to0sfor an animation on the document timeline (it staysautowith a scroll, view ornonetimeline), andanimation-delayis written in seconds (100msis0.1s).background-position-xand-ycompute as positions: keywords are percentages,0is0px, an offset from the right or bottom edge iscalc(100% - 10px), and a sum puts the percentage first.- Registered custom properties compute
<angle>todeg,<time>tosand<resolution>todppx, 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 2pxpadding, a 2px inset border and the text cursor, buttons1px 6pxpadding and the default cursor,textareathe monospace font andresize: both,labelthe default cursor, andmeterandprogressdisplay: inline-block.
[1.0.0] - 2026-12-02
First release.
Added
onehtml/encoding: the Encoding Standard as a package of its own.Lookupby label,All,FromContentType;Encoding.Decode(the standard's "decode" with error count, byte order mark handling and anOffsetMapbetween text and byte offsets) andEncoding.Encode(the "html" error mode); streamingDecoderandEncoderwithBytes,String,ReaderandWriter, 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,@containerand@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 anEnvironment) and@supportsconditions (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 withvar(),calc(), Color 4/5, the user-agent sheet from the HTML rendering section, and computed values serialized asgetComputedStylegives them. Linked sheets are supplied by the caller; the library never fetches.A mutable layer: immutable snapshots,
Editor,Document.Apply, change sets, andStyles.Restyle, which follows an edit incrementally.Lossless editing:
Rewritesplices only the edited byte ranges into the original document and verifies the result by parsing it again; the family edit-file format (ReadEditFile,Replay);Stylesheetfor<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.KeyframeswithKeyframesRuleandKeyframeBlock,Styles.ResolveAnimationsandResolveKeyframeswithResolvedKeyframes, andStyles.ChangedKeyframesto tell which@keyframesrules an edit changed.The
animationshorthand sets its longhands.onehtml/cssvalues:ParseQuantity(numbers, percentages, dimensions andcalc()and the other math functions, withLengthContext,WithPercentBaseand theAcceptkinds),ParseColor(every Color 4 and 5 syntax;ColorwithConvert, gamut-mappedNRGBA,String;NewColor),ExpandShorthand,ValidDeclaration, the property table (LookupProperty,Properties) andvar()substitution (SubstituteVars,ResolveCustomProperties).DOM reads:
Node.ChildElements,ChildElementCount,FirstElementChild,LastElementChild,NextElementSibling,PrevElementSibling,DescendantElements,TagName,ID,ClassName,Classes,HasClass,Contains,IsConnected,RootNode,ComparePositionwithDocumentPosition,ElementsByTagName,ElementsByTagNameNS,ElementsByClassName,AttributeNS,Document.ElementByID.Source map:
Attr.QualifiedName,Attr.NameSpan,Node.DataSpan,Node.AnchorSpanandNode.Provenancewith theProvenanceflags (implied, cloned, reparented, attributes merged, self-closing, merged text, synthesized).Parsing:
WithContentType,WithDefaultEncodingandWithPrescanLimit;SniffEncodingreports the encoding a parse starts with; the limitsMaxFormattingElements,MaxTotalAttributesandMaxOffsetRuns;FragmentContext.InsideForm,IntegrationPointandQuirksMode, andFragmentContextOfto 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, andWithLimitsforNewTokenizer.Editing:
WithMaxEdits,WithMaxInsertedLengthandWithMaxVerificationsforRewrite(and, throughWithRewriteOptions,Replay);RewriteResult.Verifications,ChangesandSheetReports;ReplayResult.DetailsandRewrite;NewEditFileto save in-memory edits as an envelope;Edit.WithMeta;SetStyleKeepImportant;MarshalEditFiletakesWithEditFileIndent.Locators:
LocatorIndex.Verify,Fingerprint.Compare,Fingerprint.PathText,NormalizeText,IsGeneratedName, andaccessibility.Node.Locator. Text and comment targets carry an anchor.Accessibility:
AXTree.Update,AXTree.WithContextandUpdateInfo;AXTree.DiffandReadingView.DiffwithTreeDiffandReadingViewDiff. Updating rebuilds the tree and reports why.Accessibility tree:
WithMaxNameLength,WithMaxIDReferencesandWithMaxOwnsWork;Node.Autofocus,Labels,RoleOrigin,Relations,FocusandDiagnostics;AXTree.FocusOrder,Hidden,DiagnosticsandElementRole(withWithHasAccessibleNameand theWithMaxRole…options); theurlproperty, resolved with the URL Standard (LinkEntry.URLtoo);WriteChromeJSONfor a Chrome-shaped export;ReadingView.Text.Rendered facts:
ParseFactstakesFactsOptions (FactsLimits);FactsErrorandErrFacts;Facts.MapwithFactsMap,ParseBackgroundSamplesandFactsFromBoxes. 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,SetStyleandRemoveStyle; fragment nodes insert their children;EditError.KindwithEditKind;Document.EdittakesWithEditorLimits(EditorLimits).Change.Classes,Change.InlineStyle(StyleDelta) andChange.InTemplate;ChangeSet.Impact(StyleImpact) andChangeSet.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-validwith its fix, and the table rules);target-sizeasks for rendered facts.Checker.RecheckandReport.Recheck;Report.SuggestedEditFileand thesuggestedEditsenvelope 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,LookupPropertyandPropertiesreturn small read-onlyRoleandPropertyhandles: module (WAI-ARIA, Digital Publishing, Graphics), abstract roles, superclasses andIsA, required context and owned elements (OwnedClosure), required, supported, deprecated and prohibited attributes, name-from rules, implicit values, value types, tokens and defaults, andProperty.Validto check a value against its type.
Notes
- One sentinel for limits:
onehtml.ErrLimit,css.ErrLimitandencoding.ErrLimitare the same value, soerrors.Is(err, onehtml.ErrLimit)matches every limit error of the module. Each package'sLimitErrorhas 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.