4 ms·
It depends on how you define "Visibility changes". What might he be talking about? Well, it works something like this... - The app fetches data from a server.
by Filligree 10y ago
It depends on how you define "Visibility changes".
What might he be talking about? Well, it works something like this...
- The app fetches data from a server.
- The data is processed. This may be cheap, or expensive.
- The DOM is updated.
- The page layout is recomputed.
- The browser window is redrawn.
Certainly, the browser could skip the last step for invisible tabs. It can't skip redoing the layout, as the JS can read the computed layout back out; at most it could do the computation lazily, but that would be extra code and complexity. Everything prior to that step isn't under the browser's control.
The web-app coder could act on every single step in the chain, starting by throttling data fetches.