A currently experiment API may help opening/closing sections feel smoother. We want to investigate it and report back to the API developers so that we ensure that it is something we benefit from when it is made stable.
description
This new browser feature is currently behind a flag in the latest Chrome stable. It allows to do large DOM updates and insertions while retaining control over when it is rendered. Furthermore, when the locked content is requested to be rendered, it can do so in a non-janky way, while still allowing other browser operations.
At the moment the DOM show/hide done by section toggling is blocking, and we have seen that it can cause significant jank when large sections are opened.
This new API is designed to solve specifically this problem. I think it warrants being experimented on right now, in order to give upstream feedback if it doesn't quite work in its current implementation for section toggling.
Note that it brings one major upside, which is that it would allow browser text search to search within collapsed content, automatically opening a collapsed section when a match is found inside of it.
Finally, here's the latest explainer for a new declarative version of this API: https://github.com/WICG/display-locking/blob/master/README.md
spike outcomes
- a demo
- a write up on performance impact
- Is there anything about this api that needs improving?