commit | c13c16a87cd7bfb4b4883311cd1a2b7343311a57 | [log] [tgz] |
---|---|---|
author | arthursonzogni <arthursonzogni@chromium.org> | Thu May 03 14:53:33 2018 |
committer | Commit Bot <commit-bot@chromium.org> | Thu May 03 14:53:33 2018 |
tree | 8aaee203eb78cac24b7bd55059e47c43990ce475 | |
parent | 5decc53ab1b02778a8e05400efafd45424132a28 [diff] |
Update two scroll tests. This updates the following tests: - NavigationControllerBrowserTest.ReloadWithUrlAnchor - NavigationControllerBrowserTest.ReloadWithUrlAnchorAndScroll This two tests are making a <div> to scroll because of a navigation to an anchor. Then the tests check the scroll position is restored after a reload. The issue is that it is not deterministic when the scrolled area is not the root area. It is working consistently only because the main resource's response is small (e.g <64ko) and FrameLoader::ProcessFragment() is called before FrameLoader::RestoreScrollPositionAndViewState(). This CL make the tests uses the root area instead of the <div>. --- Description of what happens in the current code: 1) When ProcessFragment() is called first: a) ProcessFragment(): Several scrollable layers are scrolled such that the anchor is displayed. It may includes the root one, but also some children. b) RestoreScrollPositionAndViewState(): The root layer is scrolled using what is stored in the HistoryItem. It overrides the scroll done in a) for the root layer. Children layers are not overridden. 2) When RestoreScrollPositionAndViewState() is called first: a) RestoreScrollPositionAndViewState(): The root layer is scrolled using what is stored in the HistoryItem. Children layers are not scrolled. b) ProcessFragment(): Nothing happens because InitialScrollState::did_restore_from_history has been set to true in a). The ProcessFragment() will skip the fragment scroll. At the end, the difference is that the children layers are scrolled in 1), but not in 2). --- Bug: 821877, 831155, 839292 Change-Id: I11c74224ba42ad58814c4d4e185d7db189551775 Reviewed-on: https://chromium-review.googlesource.com/1039827 Reviewed-by: Jianpeng Chao <chaopeng@chromium.org> Reviewed-by: Camille Lamy <clamy@chromium.org> Reviewed-by: Steve Kobes <skobes@chromium.org> Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org> Cr-Commit-Position: refs/heads/master@{#555727}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .