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

Issue 1239463005: Replace history.options with history.scrollRestoration attribute (Closed)

Created:
5 years, 5 months ago by majidvp
Modified:
5 years, 3 months ago
Reviewers:
Nate Chapin
CC:
blink-reviews, vivekg, arv+blink, Inactive, vivekg_samsung, skobes
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Replace history.options with history.scrollRestoration attribute Remove both history.options and optional fourth arguments from {replace,push}State and instead allow a single attribute (history.scrollRestoration) to control the page scroll restoration. Also fix a existing issue where scrolling to fragment was incorrectly getting precedent over history restoration scrolls when 'manual' scroll restoration was used and add additional web-platform-tests covering this issue and changes in the API. These changes are based on latest discussion on whatwg list and changes in the unofficial spec: http://majido.github.io/scroll-restoration-proposal/history- based-api.html BUG=444094 TEST=fast/history/scroll-restoration Committed: https://crrev.com/e59dcbff357afc2cd52d67267e3ee32e9f005bf1 git-svn-id: svn://svn.chromium.org/blink/trunk@199597 bbb929c8-8fbe-4397-9dbb-9b2b20218538

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : update #

Patch Set 4 : rebase #

Patch Set 5 : Add tests for fragment scroll and fix ordering issue #

Patch Set 6 : Reloads gives precedents to fragment scrolling #

Patch Set 7 : Fix broken tests #

Patch Set 8 : minor cleanup #

Total comments: 9

Patch Set 9 : address review feedback #

Total comments: 5

Patch Set 10 : Move setScrollRestorationType to History #

Unified diffs Side-by-side diffs Delta from patch set Stats (+460 lines, -114 lines) Patch
M LayoutTests/fast/css/target-fragment-match.html View 1 2 3 4 5 6 1 chunk +34 lines, -24 lines 0 comments Download
A LayoutTests/fast/css/target-fragment-match-expected.txt View 1 2 3 4 5 6 1 chunk +11 lines, -0 lines 0 comments Download
M LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-navigated-expected.txt View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed-and-gced-expected.txt View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed-expected.txt View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-navigated-expected.txt View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-and-gced-expected.txt View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-expected.txt View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/dom/Window/resources/window-property-collector.js View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/dom/Window/window-appendages-cleared.html View 1 2 3 4 5 6 1 chunk +0 lines, -1 line 0 comments Download
M LayoutTests/fast/dom/Window/window-appendages-cleared-expected.txt View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
A LayoutTests/fast/history/scroll-restoration/resources/blank1.html View 1 2 1 chunk +8 lines, -0 lines 0 comments Download
A LayoutTests/fast/history/scroll-restoration/resources/blank2.html View 1 2 1 chunk +8 lines, -0 lines 0 comments Download
A LayoutTests/fast/history/scroll-restoration/resources/page-with-fragment.html View 1 2 3 4 1 chunk +20 lines, -0 lines 0 comments Download
A LayoutTests/fast/history/scroll-restoration/scroll-restoration-basic.html View 1 2 1 chunk +36 lines, -0 lines 0 comments Download
A LayoutTests/fast/history/scroll-restoration/scroll-restoration-fragment-navigation-crossdoc.html View 1 2 3 4 5 6 7 1 chunk +74 lines, -0 lines 0 comments Download
A LayoutTests/fast/history/scroll-restoration/scroll-restoration-fragment-navigation-samedoc.html View 1 2 3 4 5 6 7 1 chunk +54 lines, -0 lines 0 comments Download
A LayoutTests/fast/history/scroll-restoration/scroll-restoration-navigation.html View 1 2 3 4 5 6 7 1 chunk +70 lines, -0 lines 0 comments Download
A LayoutTests/fast/history/scroll-restoration/scroll-restoration-push-replace.html View 1 2 1 chunk +75 lines, -0 lines 0 comments Download
M LayoutTests/fast/loader/scroll-position-restoration-for-history-api.html View 2 chunks +3 lines, -2 lines 0 comments Download
D LayoutTests/platform/linux/fast/css/target-fragment-match-expected.png View 1 2 3 4 5 6 Binary file 0 comments Download
D LayoutTests/platform/linux/fast/css/target-fragment-match-expected.txt View 1 2 3 4 5 6 1 chunk +0 lines, -9 lines 0 comments Download
D LayoutTests/platform/mac/fast/css/target-fragment-match-expected.png View 1 2 3 4 5 6 Binary file 0 comments Download
D LayoutTests/platform/mac/fast/css/target-fragment-match-expected.txt View 1 2 3 4 5 6 1 chunk +0 lines, -9 lines 0 comments Download
D LayoutTests/platform/win-xp/fast/css/target-fragment-match-expected.png View 1 2 3 4 5 6 Binary file 0 comments Download
D LayoutTests/platform/win-xp/fast/css/target-fragment-match-expected.txt View 1 2 3 4 5 6 1 chunk +0 lines, -9 lines 0 comments Download
D LayoutTests/platform/win/fast/css/target-fragment-match-expected.png View 1 2 3 4 5 6 Binary file 0 comments Download
D LayoutTests/platform/win/fast/css/target-fragment-match-expected.txt View 1 2 3 4 5 6 1 chunk +0 lines, -9 lines 0 comments Download
M LayoutTests/webexposed/global-interface-listing-expected.txt View 1 2 3 4 5 6 2 chunks +2 lines, -1 line 0 comments Download
M Source/core/core.gypi View 1 2 3 2 chunks +0 lines, -3 lines 0 comments Download
M Source/core/frame/History.h View 1 2 3 4 5 6 7 8 3 chunks +9 lines, -7 lines 0 comments Download
M Source/core/frame/History.cpp View 1 2 3 4 5 6 7 8 9 4 chunks +25 lines, -9 lines 0 comments Download
M Source/core/frame/History.idl View 2 chunks +5 lines, -4 lines 0 comments Download
D Source/core/frame/StateOptions.idl View 1 chunk +0 lines, -12 lines 0 comments Download
M Source/core/loader/FrameLoader.cpp View 1 2 3 4 5 6 7 9 6 chunks +18 lines, -7 lines 0 comments Download

Messages

Total messages: 15 (2 generated)
majidvp
5 years, 5 months ago (2015-07-16 16:04:26 UTC) #2
Nate Chapin
https://codereview.chromium.org/1239463005/diff/140001/Source/core/frame/History.cpp File Source/core/frame/History.cpp (right): https://codereview.chromium.org/1239463005/diff/140001/Source/core/frame/History.cpp#newcode85 Source/core/frame/History.cpp:85: HistoryScrollRestorationType scrollRestoration = value == "manual" ? ScrollRestorationManual : ...
5 years, 5 months ago (2015-07-16 21:34:01 UTC) #3
majidvp
https://codereview.chromium.org/1239463005/diff/140001/Source/core/frame/History.cpp File Source/core/frame/History.cpp (right): https://codereview.chromium.org/1239463005/diff/140001/Source/core/frame/History.cpp#newcode85 Source/core/frame/History.cpp:85: HistoryScrollRestorationType scrollRestoration = value == "manual" ? ScrollRestorationManual : ...
5 years, 5 months ago (2015-07-16 22:11:50 UTC) #4
Nate Chapin
https://codereview.chromium.org/1239463005/diff/140001/Source/core/frame/History.cpp File Source/core/frame/History.cpp (right): https://codereview.chromium.org/1239463005/diff/140001/Source/core/frame/History.cpp#newcode89 Source/core/frame/History.cpp:89: m_frame->loader().updateForSameDocumentNavigation(m_frame->loader().currentItem()->url(), SameDocumentNavigationHistoryApi, stateInternal(), scrollRestoration, FrameLoadTypeReplaceCurrentItem); On 2015/07/16 22:11:49, majidvp ...
5 years, 5 months ago (2015-07-16 22:19:32 UTC) #5
majidvp
PTAL. On 2015/07/16 22:19:32, Nate Chapin wrote: > https://codereview.chromium.org/1239463005/diff/140001/Source/core/frame/History.cpp > File Source/core/frame/History.cpp (right): > > ...
5 years, 5 months ago (2015-07-20 23:57:00 UTC) #6
majidvp
On 2015/07/20 23:57:00, majidvp wrote: > PTAL. > > On 2015/07/16 22:19:32, Nate Chapin wrote: ...
5 years, 5 months ago (2015-07-24 16:42:45 UTC) #7
Nate Chapin
The new test don't have expectations? https://codereview.chromium.org/1239463005/diff/160001/Source/core/loader/FrameLoader.cpp File Source/core/loader/FrameLoader.cpp (right): https://codereview.chromium.org/1239463005/diff/160001/Source/core/loader/FrameLoader.cpp#newcode253 Source/core/loader/FrameLoader.cpp:253: void FrameLoader::setScrollRestorationType(HistoryScrollRestorationType scrollRestoration) ...
5 years, 4 months ago (2015-07-27 23:46:55 UTC) #8
majidvp
> The new test don't have expectations? I wrote these as w3c web platform tests ...
5 years, 4 months ago (2015-07-28 12:19:06 UTC) #9
majidvp
PTAL. https://codereview.chromium.org/1239463005/diff/160001/Source/core/loader/FrameLoader.cpp File Source/core/loader/FrameLoader.cpp (right): https://codereview.chromium.org/1239463005/diff/160001/Source/core/loader/FrameLoader.cpp#newcode253 Source/core/loader/FrameLoader.cpp:253: void FrameLoader::setScrollRestorationType(HistoryScrollRestorationType scrollRestoration) On 2015/07/28 12:19:06, majidvp wrote: ...
5 years, 4 months ago (2015-07-28 15:44:11 UTC) #10
Nate Chapin
lgtm
5 years, 4 months ago (2015-07-28 18:49:22 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1239463005/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1239463005/180001
5 years, 4 months ago (2015-07-28 19:03:12 UTC) #13
commit-bot: I haz the power
Committed patchset #10 (id:180001) as https://src.chromium.org/viewvc/blink?view=rev&revision=199597
5 years, 4 months ago (2015-07-28 19:06:16 UTC) #14
commit-bot: I haz the power
5 years, 3 months ago (2015-09-23 11:51:22 UTC) #15
Message was sent while issue was closed.
Patchset 10 (id:??) landed as
https://crrev.com/e59dcbff357afc2cd52d67267e3ee32e9f005bf1

Powered by Google App Engine
This is Rietveld 408576698