Microsoft is actively contributing to the Chromium open source project which powers Edge, Google Chrome and many other web browsers. Google Chrome comes with its own smooth scrolling functionality and Microsoft is now contributing in this area to further enhance the experience.
Earlier this year, Microsoft shared its thoughts on Chromium’s mouse behaviour and the company revealed that it plans to improve scrolling in Chromium browsers on Windows.
In Chromium browsers, scrolling by clicking on the scrollbar could appear to be janky when the main thread is busy. Microsoft plans to implement the classic Edge-like smooth scrolling to fix the janky movements in Chromium.
Currently, Chromium appears to handle scrollbar scrolling in the main thread and possible workaround to address the janky movements is to allow mouse event to happen elsewhere.
“This proposal is to move composited scrollbar scrolling to the impl thread so that even when the main thread is busy, users can continue to interact with and scroll using scrollbars,” writes Microsoft engineer.
Microsoft’s proposal will also address the high latency that is experienced when customers use a mouse to slide a page up and down from the scrollbar in Chrome.
“We observe on average scrollbar drags have ~2-4x higher latency in Chromium as compared to EdgeHTML today, worse on particularly busy sites,” the explanation reads.
“By avoiding the main thread in Chromium as well, we believe we can bring the performance of scrollbar drags more in line with what we observe in EdgeHTML,” explains a Microsoft engineer.
This could mean that even when the main thread is busy, users should be able to scroll using scrollbars without experiencing degraded performance.
Work on smooth scrolling advances
It looks like a part of work done by Microsoft engineers has been accepted by the Chromium community. A new commit reveals that code has been merged into Chromium and Canary builds.
“This CL enables fast scrollers to scroll on the compositor thread when a user clicks on any of the arrows on a composited root scrollbar,” explains a Microsoft engineer.
A flag titled “Enable Compositor threaded scrollbar scrolling” is also live, but it may not work properly at the moment.
“Enables pointer-based scrollbar scrolling on the compositor thread instead of the main thread – Mac, Windows, Linux, Chrome OS, Android,” the description of flag reads.
It’s worth noting that the flag is also live in Microsoft Edge Canary and you can find the option in flags menu.
Microsoft has also shared a detailed description of compositor threaded scrollbar scrolling:
“When a mousedown arrives at the renderer, it gets hit tested. If a composited scrollbar was hit, the MouseEvent gets dropped and a GestureScrollBegin and a GestureScrollUpdate get added to the CompositorThreadEventQueue. These gesture scroll events contain scroll deltas based on which scrollbar part was hit (arrows for now). On a mouseup, a GestureScrollEnd is added to the queue. They are then dispatched (as Gesture events) in a VSync aligned manner,” the description of the functionality reads.
Another commit, which hasn’t been merged yet, revealed that Microsoft is also working on other parts of the scrolling improvements.