Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Remove NodeBB scroll anchoring/anti-jellypotato code #6150
For the purposes of discussion, "scroll anchoring", "jellypotato fix", and "scroll shifting" all refer to the same thing.
As discussed on The Daily WTF, the old jellypotato fix code is no longer of sufficient quality and is in need of replacement. This degradation is likely due to the scroll shifting code being reliant on precise calculations of relative elements that either no longer exist or have moved, thus causing the calculation to no longer be correct. It also happened to not work with iframely, or any other plugin that manipulated the DOM after initial page load, as this code reacted only to images.
Overall, the jellypotato-fix code was meant to be a band-aid while a more robust solution was developed. Not long afterwards, scroll anchoring was introduced in Chrome via a flag.
Rationale for complete removal:
In the end the decision was made to schedule removal of the scroll anchoring code if significant headway was made by a major browser vendor towards a solution. As of 6 Dec, Chrome has made this standard, while development of it still seems ongoing in Firefox. Perhaps we are already at this point:
Upon testing the removal of NodeBB's scroll anchoring code, both Chrome and Firefox seem to handle image loading adequately. Firefox's throttling seems a little wonky, so navigating to a particular post didn't work, but Chrome's scroll anchoring works quite well.
It seems that us moving the minfile to the footer may have had an unintended side effect in that images are now loaded first before requisite require.js modules, and so