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

Issue 52893003: scrollTop and scrollLeft always 0 in DOMContentLoaded handler on a scrolled page (Closed)

Created:
7 years, 1 month ago by tonikitoo_
Modified:
7 years, 1 month ago
Reviewers:
Nate Chapin
CC:
blink-reviews, Nate Chapin, gavinp+loader_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

scrollTop and scrollLeft always 0 in DOMContentLoaded handler on a scrolled page Currently, when performing a "back" navigation, the scroll position is restored at the time the first layout happens (see FrameLoader::didFirstLayout). If that does not go through, another attempt to restore the scroll position is made when the frame completes loading (see FrameLoader::checkLoadCompleteForThisFrame). In a closer look, one might notice that in the later, not only the "back" navigation case is covered, but also "reload". Patch makes these two attempts of restore the scroll position to operate under the same circumstances: back and reload. Apart from bringing them in pair, it also makes it possible to query the scroll position at the time DOMContentLoaded fires, as Gecko and Presto engines do. Test: fast/loader/scroll-position-restored-on-reload-at-load-event.html fast/loader/scroll-position-restored-on-back-at-load-event.html R=Nate Chapin BUG=290895 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=161098

Patch Set 1 #

Total comments: 1

Patch Set 2 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+114 lines, -1 line) Patch
A LayoutTests/fast/loader/scroll-position-restored-on-back-at-load-event.html View 1 1 chunk +38 lines, -0 lines 0 comments Download
A LayoutTests/fast/loader/scroll-position-restored-on-back-at-load-event-expected.txt View 1 1 chunk +17 lines, -0 lines 0 comments Download
A LayoutTests/fast/loader/scroll-position-restored-on-reload-at-load-event.html View 1 1 chunk +38 lines, -0 lines 0 comments Download
A LayoutTests/fast/loader/scroll-position-restored-on-reload-at-load-event-expected.txt View 1 1 chunk +17 lines, -0 lines 0 comments Download
M Source/core/loader/FrameLoader.cpp View 1 1 chunk +4 lines, -1 line 0 comments Download

Messages

Total messages: 3 (0 generated)
Nate Chapin
lgtm https://codereview.chromium.org/52893003/diff/1/Source/core/loader/FrameLoader.cpp File Source/core/loader/FrameLoader.cpp (right): https://codereview.chromium.org/52893003/diff/1/Source/core/loader/FrameLoader.cpp#newcode1045 Source/core/loader/FrameLoader.cpp:1045: && (isBackForwardLoadType(m_loadType) || m_loadType == FrameLoadTypeReload || m_loadType ...
7 years, 1 month ago (2013-10-30 19:00:44 UTC) #1
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/a1.gomes@sisa.samsung.com/52893003/70001
7 years, 1 month ago (2013-10-31 20:49:47 UTC) #2
commit-bot: I haz the power
7 years, 1 month ago (2013-10-31 22:14:29 UTC) #3
Message was sent while issue was closed.
Change committed as 161098

Powered by Google App Engine
This is Rietveld 408576698