mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-07-31 17:55:59 -04:00
https://github.com/lightpanda-io/browser/pull/3000 improved the correctness of ResizeObserver. The main changes were (a) making sure an observe results in an initial callback and (b) invoking the callback for cases that we can identity (e.g. visibility change). Like the other observers, we triggered a check on domChanged. But, unlike the other observers, the check is relatively expensive, namely because it involves style lookups. This commit introduces a number of performance improvements to reduce the check and dispatch frequency. 1 - Only trigger on an allow list of attribute changed (id, class, hidden, width ...) 2 - Pre-filter only on observed elements 3 - Leverage the visibility cache for more efficient delivery
25 KiB
25 KiB