mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 10:07:15 +02:00
Previously, when a @font-face font finished loading, we would clear the entire computed font cache and invalidate style for the whole document. This was overly conservative since most elements don't use the newly loaded font. We now take a targeted approach inspired by Firefox: 1. Only clear cache entries that reference the loaded font family 2. Walk the DOM tree (including shadow trees) and only invalidate elements whose font-family property (or pseudo-elements' font-family) actually references the loaded font This significantly reduces style invalidation work on pages with many elements but only some using custom fonts.
28 KiB
28 KiB