Preserve ancestor transforms when CSS-wide keywords reset local transforms

perfloop-oss/satori · Uncatalogued performance

https://perfloop.ai/t/oss/case_tdbmachjp0

Verdict

VERIFIED · settled 2026-11-10 · pull request opened as vercel/satori#967

What happened: The check fails before this change and passes with it.

Hypothesis

A CSS-wide transform reset on a box beneath a transformed element can abort HTML/CSS-to-SVG rendering. The reset drops internal ancestor-transform state that layout still expects. This is a correctness repair; input prevalence and any performance effect are unknown.

compute deletes reset properties from its inherited base at lines 411–418. That includes transform for transform:initial, transform:unset, the documented non-inherited transform:inherit behavior, and all:initial. However, inheritable passes transform down for renderer bookkeeping rather than CSS inheritance. In layout, a value different from the parent's transform is treated as a local transform list, and its length is read at lines 541–545. The removed value is undefined. Inline boxes take a different branch that restores the inherited transform at lines 473–475.

checkProperty(prop_s6dz9m3mtd), run call_42kuKsO6bvJLk4Zz8RbR7ddR, ran pnpm test test/perfloop-transform-keyword-state.test.ts --threads=false and exited 1 on its property assertion. The complete finite search covered six reset declarations, three ancestor transforms, three child displays, two depths, inline/stylesheet delivery and both color modes: 432 inputs, with 192 failures. All failures were block/flex cases for the four reset forms above. Inline-box and revert/revert-layer controls passed within these bounds. The run reduced the witness to a parent with translateX(0px) and an empty child with transform:initial; the reference without the local declaration completed, while the witness threw TypeError reading length. The returned replay input is being retained on the property. An earlier no-font fixture failure exercised no complete search and is not defect evidence.

The supported-operation basis is README's browser-behavior promise for supported CSS, the documented non-inherited inherit exception at line 517, and existing CSS-wide-keyword stylesheet tests. The requested repair does not change that inherit exception into full parent-declaration inheritance. The smallest useful Case check is the deterministic replay, followed by ancestor positioning and descendant/sibling state checks for the affected reset forms. The stored finite SVG comparison and its test placement are provisional proof methods, not additional frozen implementation requirements or an unbounded CSS proof.

https://github.com/vercel/satori/pull/837 changes only parsing of transform:none and its identity-matrix output. Its patch does not touch resolveKeywords or inherited-base resets, so this failure remains distinct from that active work. The complete open-PR listing showed no reset-state implementation. The checkout is shallow, and bounded file-history and GitHub Discussions searches returned HTTP 403; older decisions and discussion-only ownership remain evidence gaps.

Change to test: Keep ancestor-transform bookkeeping valid when a CSS-wide keyword resets the local transform. Preserve the reset’s documented meaning, the ancestor coordinate system and descendant/sibling isolation for inline and stylesheet declarations.

Where it lives

perfloop-oss/satori · src/satori.ts

Evidence

The check fails before this change and passes with it: `In the finite domain of transform:initial/unset/inherit, all:initial and transform/all revert/revert-layer controls, public renders with absent, zero, translated or rotated ancestors, block/flex/inline children, inline/stylesheet declarations, both color modes and nested containing blocks complete with byte-identical SVG to equivalent no-reset renders, preserving descendant and sibling geometry; a later local transform still applies.`

Timeline