Skip to content

fix(ui): modal z-promote MutationObserver loops to renderer OOM when OS reduce-motion is on #156

Description

@jdmanring

With OS reduce-motion enabled, opening cookbook crashes the renderer (out of memory, ~60 MB/s of mutation records).

Mechanism: style.css's reduce-motion catch-all sets transition-duration: 0.01ms !important while the default transition-property: all remains — so z-index writes become 10 µs transitions, and transitions outrank inline !important in the cascade. The ui.js _promote guard compares the COMPUTED z-index against what it wrote; MutationObserver storms run as microtasks during which document time is frozen, so the transition never completes, the computed value stays pinned, the guard is never satisfied, and the observer loops until the renderer runs out of memory ("Target crashed").

Fix on develop: 47b8a6c — the guard reads the inline style first (its own write), falling back to computed, making it immune to in-flight transitions.

Reproduces on any platform with reduce-motion enabled (Windows animation-effects-off, GNOME/KDE reduce-animations, macOS). Diagnosed via CDP Debugger.pause on the busy loop on the macOS Tahoe bench. Upstream-candidate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions