Improve code related to scroll APIs in web view.