Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(118)

Issue 2541513004: Ensure scrollToFragmentAnchor called before restoreScrollPositionAndViewState. (Closed)

Created:
4 years ago by chaopeng
Modified:
4 years ago
Reviewers:
bokan, Charlie Reis
CC:
chromium-reviews, blink-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Ensure scrollToFragmentAnchor called before restoreScrollPositionAndViewState. This issue is caused by FrameLoader::restoreScrollPositionAndViewState being called by FrameView::setContentsSize when reloading. restoreScrollPositionAndViewState calls ScrollableArea::setScrollOffset which clears FrameView::m_fragmentAnchor so the DIV scroll to incorrect position. In this patch we move scrollToFragmentAnchor to setContentsSize before restoreScrollPositionAndViewState. BUG=656658 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation Committed: https://crrev.com/6d072f7c3b55dbe96358cb9623dfce5e756bad54 Cr-Commit-Position: refs/heads/master@{#436682}

Patch Set 1 : move code to linux #

Patch Set 2 : move test to browser test #

Patch Set 3 : revert navigation_controller_impl_browsertest.cc style #

Total comments: 1

Patch Set 4 : bokan@ comments addressed #

Total comments: 3

Patch Set 5 : bokan@ comments addressed #

Patch Set 6 : creis@ comments addressed #

Total comments: 1

Patch Set 7 : add scrollToFragmentAnchor back to performPostLayoutTasks #

Unified diffs Side-by-side diffs Delta from patch set Stats (+39 lines, -0 lines) Patch
M content/browser/frame_host/navigation_controller_impl_browsertest.cc View 1 2 3 4 5 1 chunk +19 lines, -0 lines 0 comments Download
A content/test/data/navigation_controller/reload-with-url-anchor.html View 1 1 chunk +16 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/frame/FrameView.cpp View 4 5 6 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 41 (28 generated)
chaopeng
PTAL
4 years ago (2016-12-01 18:15:54 UTC) #15
bokan
https://codereview.chromium.org/2541513004/diff/120001/third_party/WebKit/Source/core/frame/FrameView.cpp File third_party/WebKit/Source/core/frame/FrameView.cpp (right): https://codereview.chromium.org/2541513004/diff/120001/third_party/WebKit/Source/core/frame/FrameView.cpp#newcode649 third_party/WebKit/Source/core/frame/FrameView.cpp:649: scrollToFragmentAnchor(); I think you can remove it from performPostLayoutTasks.
4 years ago (2016-12-02 17:10:41 UTC) #18
bokan
Also, the title is wrong, you're not preventing restoreScrollPositionAndViewState. You're scrolling to the fragment before ...
4 years ago (2016-12-02 17:12:21 UTC) #19
chaopeng
On 2016/12/02 17:12:21, bokan wrote: > Also, the title is wrong, you're not preventing > ...
4 years ago (2016-12-02 18:35:42 UTC) #21
bokan
I tweaked the commit message a bit but lgtm.
4 years ago (2016-12-02 18:39:14 UTC) #23
chaopeng
creis@chromium.org: Please review changes in content
4 years ago (2016-12-05 16:33:38 UTC) #26
Charlie Reis
Thanks! LGTM with minor nits. https://codereview.chromium.org/2541513004/diff/140001/content/browser/frame_host/navigation_controller_impl_browsertest.cc File content/browser/frame_host/navigation_controller_impl_browsertest.cc (right): https://codereview.chromium.org/2541513004/diff/140001/content/browser/frame_host/navigation_controller_impl_browsertest.cc#newcode1339 content/browser/frame_host/navigation_controller_impl_browsertest.cc:1339: // Verify that reload ...
4 years ago (2016-12-05 18:54:15 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2541513004/180001
4 years ago (2016-12-05 19:05:01 UTC) #30
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/344007)
4 years ago (2016-12-05 21:13:34 UTC) #32
bokan
https://codereview.chromium.org/2541513004/diff/180001/third_party/WebKit/Source/core/frame/FrameView.cpp File third_party/WebKit/Source/core/frame/FrameView.cpp (left): https://codereview.chromium.org/2541513004/diff/180001/third_party/WebKit/Source/core/frame/FrameView.cpp#oldcode2382 third_party/WebKit/Source/core/frame/FrameView.cpp:2382: scrollToFragmentAnchor(); Ok, leaving this in sgtm.
4 years ago (2016-12-06 16:49:28 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2541513004/200001
4 years ago (2016-12-06 16:58:41 UTC) #36
commit-bot: I haz the power
Committed patchset #7 (id:200001)
4 years ago (2016-12-06 19:22:44 UTC) #39
commit-bot: I haz the power
4 years ago (2016-12-06 19:25:04 UTC) #41
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/6d072f7c3b55dbe96358cb9623dfce5e756bad54
Cr-Commit-Position: refs/heads/master@{#436682}

Powered by Google App Engine
This is Rietveld 408576698