Background
If a user has a slow connection and views a page and begins opening sections, when the page finishes loading all the sections collapse. This is not a good experience for users.
Steps to replicate the issue (include links if applicable):
- Load enwiki:Earth with device emulation set to a mobile device
- From the Performance tab, apply 4x CPU slowdown and Slow 4G network throttling (for example)
- Reload the page, click section headers to expand some sections before JS modules from the resourceloader are fully loaded
What happens?:
The sections you expanded before JS is loaded collapse, because of the hidden="until-found" attribute is set.
What should have happened instead?:
The sections you expanded before JS is loaded stay expanded, without the hidden attribute.
There should be tests for this behaviour.
Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):
Other information (browser name/version, screenshots, etc.):
QA test steps
Fix should be live on beta, but not yet on enwiki.
Test page "Fox" on beta:
- load https://en.wikipedia.beta.wmcloud.org/wiki/Fox in Chrome with mobile simulation on
- set dev tools network throttle to "3G" and CPU throttle to "4x slowdown"
- reload
- while loading, scroll down and unfold a section or two
- note they will not be re-collapsible until the full JS loads
- wait until the full JS loads
- check the sections you collapsed
- they should remain open
- they should now respond as expected to further taps to re-close/re-open

