mirror of
https://github.com/bitwarden/clients.git
synced 2026-11-16 07:03:29 +00:00
The spinner in the popup page shell is always in the DOM and merely hidden with
tw-invisible. visibility:hidden does not stop a CSS animation, so bwi-spin keeps
running for the life of the popup at ~30 fps on a page that is doing nothing.
Every frame forces a style recalculation across the page. With the Tailwind
:has() variants on each item row that is expensive: the renderer allocates about
8 MB/s, some 500 MB a minute. It is freed again, just not fast enough -- VmData
climbs until it hits the 8 GiB RLIMIT_DATA Chromium applies to renderers, mmap
fails and V8 aborts, leaving a SIGILL core dump of that one renderer while the
browser keeps running.
That is the crash behind #23309, #23431 and #23022. None could be reproduced,
which fits: nothing leaks, the DOM does not grow and the JS heap stays flat, so
a heap snapshot shows nothing. Measured on a local build with the popup open and
untouched, growth went from +500 MB/min to -1.5 MB/min, while
document.getAnimations() reported exactly one running animation -- bwi-spin, on
a bit-icon whose computed visibility was hidden.
Guarding with @if is what every other spinner in the codebase already does. The
overlay is absolutely positioned, so not rendering it costs no layout.
(cherry picked from commit d1d1224ef0)
Co-authored-by: Urias Uhle <101756727+Lolig4@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>