|
|
DescriptionCheck scrollRestorationType explicitly in FrameLoader::processFragment()
This is preparation for [1], fixing test failure of
virtual/rootlayerscrolls/fast/history/scroll-restoration/scroll-restoration-fragment-navigation-crossdoc.html
with [1].
Before [1], the test is passing because, in FrameLoader::finishedParsing(),
restoreScrollPositionAndViewState() is called (in checkCompleted()) before
processFragment(), and thus processFragment() doesn't cause scroll
because |shouldScrollToFragment| is false because
|didRestoreFromHistory| is set to true by restoreScrollPositionAndViewState().
However, after [1], restoreScrollPositionAndViewState() is NOT called in
checkCompleted() because [1] causes the document onload to be called after
finishedParsing(), and thus processFragment() causes scrolling unexpectedly,
not reflecting history.scrollRestoration = 'manual'.
This CL makes processFragment() to check scrollRestorationType explicitly,
not depending on previous restoreScrollPositionAndViewState() call.
[1] https://codereview.chromium.org/2269043002/.
BUG=624697, 417782
TEST=virtual/rootlayerscrolls/fast/history/scroll-restoration/scroll-restoration-fragment-navigation-crossdoc.html
Committed: https://crrev.com/41ca771082edfcdbe304abbce42fce6de58c0657
Cr-Commit-Position: refs/heads/master@{#430237}
Patch Set 1 #Patch Set 2 : Rebase #Patch Set 3 : Check scrollRestorationType directly #Patch Set 4 : fix #Messages
Total messages: 33 (24 generated)
The CQ bit was checked by hiroshige@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== Call restoreScrollPositionAndViewState() before processFragment() BUG= ========== to ========== Call restoreScrollPositionAndViewState() before processFragment() This is preparation for [1], fixing test failure of virtual/rootlayerscrolls/fast/history/scroll-restoration/scroll-restoration-fragment-navigation-crossdoc.html with [1]. Before [1], in FrameLoader::finishedParsing(), restoreScrollPositionAndViewState() is called (in checkCompleted()) before processFragment(), and thus processFragment() doesn't cause scroll because |shouldScrollToFragment| is false because |didRestoreFromHistory| is set to true by restoreScrollPositionAndViewState(). However, after [1], restoreScrollPositionAndViewState() is NOT called in checkCompleted() because [1] causes the document onload to be called after finishedParsing(), and thus processFragment() causes scrolling unexpectedly. This CL calls restoreScrollPositionAndViewState() before the processFragment() call in finishedParsing() to fix the test. [1] https://codereview.chromium.org/2269043002/. BUG=624697 ==========
The CQ bit was checked by hiroshige@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== Call restoreScrollPositionAndViewState() before processFragment() This is preparation for [1], fixing test failure of virtual/rootlayerscrolls/fast/history/scroll-restoration/scroll-restoration-fragment-navigation-crossdoc.html with [1]. Before [1], in FrameLoader::finishedParsing(), restoreScrollPositionAndViewState() is called (in checkCompleted()) before processFragment(), and thus processFragment() doesn't cause scroll because |shouldScrollToFragment| is false because |didRestoreFromHistory| is set to true by restoreScrollPositionAndViewState(). However, after [1], restoreScrollPositionAndViewState() is NOT called in checkCompleted() because [1] causes the document onload to be called after finishedParsing(), and thus processFragment() causes scrolling unexpectedly. This CL calls restoreScrollPositionAndViewState() before the processFragment() call in finishedParsing() to fix the test. [1] https://codereview.chromium.org/2269043002/. BUG=624697 ========== to ========== Call restoreScrollPositionAndViewState() before processFragment() This is preparation for [1], fixing test failure of virtual/rootlayerscrolls/fast/history/scroll-restoration/scroll-restoration-fragment-navigation-crossdoc.html with [1]. Before [1], in FrameLoader::finishedParsing(), restoreScrollPositionAndViewState() is called (in checkCompleted()) before processFragment(), and thus processFragment() doesn't cause scroll because |shouldScrollToFragment| is false because |didRestoreFromHistory| is set to true by restoreScrollPositionAndViewState(). However, after [1], restoreScrollPositionAndViewState() is NOT called in checkCompleted() because [1] causes the document onload to be called after finishedParsing(), and thus processFragment() causes scrolling unexpectedly. This CL calls restoreScrollPositionAndViewState() before the processFragment() call in finishedParsing() to fix the test. [1] https://codereview.chromium.org/2269043002/. BUG=624697, 417782 ==========
hiroshige@chromium.org changed reviewers: + skobes@chromium.org
Description was changed from ========== Call restoreScrollPositionAndViewState() before processFragment() This is preparation for [1], fixing test failure of virtual/rootlayerscrolls/fast/history/scroll-restoration/scroll-restoration-fragment-navigation-crossdoc.html with [1]. Before [1], in FrameLoader::finishedParsing(), restoreScrollPositionAndViewState() is called (in checkCompleted()) before processFragment(), and thus processFragment() doesn't cause scroll because |shouldScrollToFragment| is false because |didRestoreFromHistory| is set to true by restoreScrollPositionAndViewState(). However, after [1], restoreScrollPositionAndViewState() is NOT called in checkCompleted() because [1] causes the document onload to be called after finishedParsing(), and thus processFragment() causes scrolling unexpectedly. This CL calls restoreScrollPositionAndViewState() before the processFragment() call in finishedParsing() to fix the test. [1] https://codereview.chromium.org/2269043002/. BUG=624697, 417782 ========== to ========== Call restoreScrollPositionAndViewState() before processFragment() This is preparation for [1], fixing test failure of virtual/rootlayerscrolls/fast/history/scroll-restoration/scroll-restoration-fragment-navigation-crossdoc.html with [1]. Before [1], in FrameLoader::finishedParsing(), restoreScrollPositionAndViewState() is called (in checkCompleted()) before processFragment(), and thus processFragment() doesn't cause scroll because |shouldScrollToFragment| is false because |didRestoreFromHistory| is set to true by restoreScrollPositionAndViewState(). However, after [1], restoreScrollPositionAndViewState() is NOT called in checkCompleted() because [1] causes the document onload to be called after finishedParsing(), and thus processFragment() causes scrolling unexpectedly, not reflecting history.scrollRestoration = 'manual'. This CL calls restoreScrollPositionAndViewState() before the processFragment() call in finishedParsing() to fix the test. [1] https://codereview.chromium.org/2269043002/. BUG=624697, 417782 ==========
Could you take a look?
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
You wrote: "after [1], restoreScrollPositionAndViewState() is NOT called in checkCompleted() because [1] causes the document onload to be called after finishedParsing()" I'm afraid I don't understand this. It looks like checkCompleted still calls restoreScrollPositionAndViewState. Can you clarify why we need it in two places?
On 2016/11/02 04:05:40, skobes wrote: > You wrote: > > "after [1], restoreScrollPositionAndViewState() is NOT called in > checkCompleted() because [1] causes the document onload to be called after > finishedParsing()" > > I'm afraid I don't understand this. It looks like checkCompleted still calls > restoreScrollPositionAndViewState. Can you clarify why we need it in two > places? checkCompleted() calls restoreScrollPositionAndViewState(), only if shouldComplete() returns true. My CL [1] causes shouldComplete() to return false in the case of virtual/rootlayerscrolls/fast/history/scroll-restoration/scroll-restoration-fragment-navigation-crossdoc.html and thus restoreScrollPositionAndViewState() would not be called.
skobes@chromium.org changed reviewers: + majidvp@chromium.org
On 2016/11/02 04:20:04, hiroshige wrote: > checkCompleted() calls restoreScrollPositionAndViewState(), only if > shouldComplete() returns true. > My CL [1] causes shouldComplete() to return false in the case of > virtual/rootlayerscrolls/fast/history/scroll-restoration/scroll-restoration-fragment-navigation-crossdoc.html > and thus restoreScrollPositionAndViewState() would not be called. I see, thanks for explaining. Couldn't FrameLoader::processFragment just check m_currentItem->scrollRestorationType() and set shouldScrollToFragment to false if it's 'manual'? That seems safer than relying on didRestoreFromHistory to be set first.
Description was changed from ========== Call restoreScrollPositionAndViewState() before processFragment() This is preparation for [1], fixing test failure of virtual/rootlayerscrolls/fast/history/scroll-restoration/scroll-restoration-fragment-navigation-crossdoc.html with [1]. Before [1], in FrameLoader::finishedParsing(), restoreScrollPositionAndViewState() is called (in checkCompleted()) before processFragment(), and thus processFragment() doesn't cause scroll because |shouldScrollToFragment| is false because |didRestoreFromHistory| is set to true by restoreScrollPositionAndViewState(). However, after [1], restoreScrollPositionAndViewState() is NOT called in checkCompleted() because [1] causes the document onload to be called after finishedParsing(), and thus processFragment() causes scrolling unexpectedly, not reflecting history.scrollRestoration = 'manual'. This CL calls restoreScrollPositionAndViewState() before the processFragment() call in finishedParsing() to fix the test. [1] https://codereview.chromium.org/2269043002/. BUG=624697, 417782 ========== to ========== Call restoreScrollPositionAndViewState() before processFragment() This is preparation for [1], fixing test failure of virtual/rootlayerscrolls/fast/history/scroll-restoration/scroll-restoration-fragment-navigation-crossdoc.html with [1]. Before [1], in FrameLoader::finishedParsing(), restoreScrollPositionAndViewState() is called (in checkCompleted()) before processFragment(), and thus processFragment() doesn't cause scroll because |shouldScrollToFragment| is false because |didRestoreFromHistory| is set to true by restoreScrollPositionAndViewState(). However, after [1], restoreScrollPositionAndViewState() is NOT called in checkCompleted() because [1] causes the document onload to be called after finishedParsing(), and thus processFragment() causes scrolling unexpectedly, not reflecting history.scrollRestoration = 'manual'. This CL calls restoreScrollPositionAndViewState() before the processFragment() call in finishedParsing() to fix the test. [1] https://codereview.chromium.org/2269043002/. BUG=624697, 417782 TEST=virtual/rootlayerscrolls/fast/history/scroll-restoration/scroll-restoration-fragment-navigation-crossdoc.html ==========
The CQ bit was checked by hiroshige@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== Call restoreScrollPositionAndViewState() before processFragment() This is preparation for [1], fixing test failure of virtual/rootlayerscrolls/fast/history/scroll-restoration/scroll-restoration-fragment-navigation-crossdoc.html with [1]. Before [1], in FrameLoader::finishedParsing(), restoreScrollPositionAndViewState() is called (in checkCompleted()) before processFragment(), and thus processFragment() doesn't cause scroll because |shouldScrollToFragment| is false because |didRestoreFromHistory| is set to true by restoreScrollPositionAndViewState(). However, after [1], restoreScrollPositionAndViewState() is NOT called in checkCompleted() because [1] causes the document onload to be called after finishedParsing(), and thus processFragment() causes scrolling unexpectedly, not reflecting history.scrollRestoration = 'manual'. This CL calls restoreScrollPositionAndViewState() before the processFragment() call in finishedParsing() to fix the test. [1] https://codereview.chromium.org/2269043002/. BUG=624697, 417782 TEST=virtual/rootlayerscrolls/fast/history/scroll-restoration/scroll-restoration-fragment-navigation-crossdoc.html ========== to ========== Check scrollRestorationType explicitly in FrameLoader::processFragment() This is preparation for [1], fixing test failure of virtual/rootlayerscrolls/fast/history/scroll-restoration/scroll-restoration-fragment-navigation-crossdoc.html with [1]. Before [1], the test is passing because, in FrameLoader::finishedParsing(), restoreScrollPositionAndViewState() is called (in checkCompleted()) before processFragment(), and thus processFragment() doesn't cause scroll because |shouldScrollToFragment| is false because |didRestoreFromHistory| is set to true by restoreScrollPositionAndViewState(). However, after [1], restoreScrollPositionAndViewState() is NOT called in checkCompleted() because [1] causes the document onload to be called after finishedParsing(), and thus processFragment() causes scrolling unexpectedly, not reflecting history.scrollRestoration = 'manual'. This CL makes processFragment() to check scrollRestorationType explicitly, not depending on previous restoreScrollPositionAndViewState() call. [1] https://codereview.chromium.org/2269043002/. BUG=624697, 417782 TEST=virtual/rootlayerscrolls/fast/history/scroll-restoration/scroll-restoration-fragment-navigation-crossdoc.html ==========
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by hiroshige@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
On 2016/11/02 04:39:45, skobes wrote: > On 2016/11/02 04:20:04, hiroshige wrote: > > checkCompleted() calls restoreScrollPositionAndViewState(), only if > > shouldComplete() returns true. > > My CL [1] causes shouldComplete() to return false in the case of > > > virtual/rootlayerscrolls/fast/history/scroll-restoration/scroll-restoration-fragment-navigation-crossdoc.html > > and thus restoreScrollPositionAndViewState() would not be called. > > I see, thanks for explaining. > > Couldn't FrameLoader::processFragment just check > m_currentItem->scrollRestorationType() and set shouldScrollToFragment to false > if it's 'manual'? That seems safer than relying on didRestoreFromHistory to be > set first. Thanks for suggestion! How about Patch Set 4?
lgtm
The CQ bit was checked by hiroshige@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Description was changed from ========== Check scrollRestorationType explicitly in FrameLoader::processFragment() This is preparation for [1], fixing test failure of virtual/rootlayerscrolls/fast/history/scroll-restoration/scroll-restoration-fragment-navigation-crossdoc.html with [1]. Before [1], the test is passing because, in FrameLoader::finishedParsing(), restoreScrollPositionAndViewState() is called (in checkCompleted()) before processFragment(), and thus processFragment() doesn't cause scroll because |shouldScrollToFragment| is false because |didRestoreFromHistory| is set to true by restoreScrollPositionAndViewState(). However, after [1], restoreScrollPositionAndViewState() is NOT called in checkCompleted() because [1] causes the document onload to be called after finishedParsing(), and thus processFragment() causes scrolling unexpectedly, not reflecting history.scrollRestoration = 'manual'. This CL makes processFragment() to check scrollRestorationType explicitly, not depending on previous restoreScrollPositionAndViewState() call. [1] https://codereview.chromium.org/2269043002/. BUG=624697, 417782 TEST=virtual/rootlayerscrolls/fast/history/scroll-restoration/scroll-restoration-fragment-navigation-crossdoc.html ========== to ========== Check scrollRestorationType explicitly in FrameLoader::processFragment() This is preparation for [1], fixing test failure of virtual/rootlayerscrolls/fast/history/scroll-restoration/scroll-restoration-fragment-navigation-crossdoc.html with [1]. Before [1], the test is passing because, in FrameLoader::finishedParsing(), restoreScrollPositionAndViewState() is called (in checkCompleted()) before processFragment(), and thus processFragment() doesn't cause scroll because |shouldScrollToFragment| is false because |didRestoreFromHistory| is set to true by restoreScrollPositionAndViewState(). However, after [1], restoreScrollPositionAndViewState() is NOT called in checkCompleted() because [1] causes the document onload to be called after finishedParsing(), and thus processFragment() causes scrolling unexpectedly, not reflecting history.scrollRestoration = 'manual'. This CL makes processFragment() to check scrollRestorationType explicitly, not depending on previous restoreScrollPositionAndViewState() call. [1] https://codereview.chromium.org/2269043002/. BUG=624697, 417782 TEST=virtual/rootlayerscrolls/fast/history/scroll-restoration/scroll-restoration-fragment-navigation-crossdoc.html ==========
Message was sent while issue was closed.
Committed patchset #4 (id:60001)
Message was sent while issue was closed.
Description was changed from ========== Check scrollRestorationType explicitly in FrameLoader::processFragment() This is preparation for [1], fixing test failure of virtual/rootlayerscrolls/fast/history/scroll-restoration/scroll-restoration-fragment-navigation-crossdoc.html with [1]. Before [1], the test is passing because, in FrameLoader::finishedParsing(), restoreScrollPositionAndViewState() is called (in checkCompleted()) before processFragment(), and thus processFragment() doesn't cause scroll because |shouldScrollToFragment| is false because |didRestoreFromHistory| is set to true by restoreScrollPositionAndViewState(). However, after [1], restoreScrollPositionAndViewState() is NOT called in checkCompleted() because [1] causes the document onload to be called after finishedParsing(), and thus processFragment() causes scrolling unexpectedly, not reflecting history.scrollRestoration = 'manual'. This CL makes processFragment() to check scrollRestorationType explicitly, not depending on previous restoreScrollPositionAndViewState() call. [1] https://codereview.chromium.org/2269043002/. BUG=624697, 417782 TEST=virtual/rootlayerscrolls/fast/history/scroll-restoration/scroll-restoration-fragment-navigation-crossdoc.html ========== to ========== Check scrollRestorationType explicitly in FrameLoader::processFragment() This is preparation for [1], fixing test failure of virtual/rootlayerscrolls/fast/history/scroll-restoration/scroll-restoration-fragment-navigation-crossdoc.html with [1]. Before [1], the test is passing because, in FrameLoader::finishedParsing(), restoreScrollPositionAndViewState() is called (in checkCompleted()) before processFragment(), and thus processFragment() doesn't cause scroll because |shouldScrollToFragment| is false because |didRestoreFromHistory| is set to true by restoreScrollPositionAndViewState(). However, after [1], restoreScrollPositionAndViewState() is NOT called in checkCompleted() because [1] causes the document onload to be called after finishedParsing(), and thus processFragment() causes scrolling unexpectedly, not reflecting history.scrollRestoration = 'manual'. This CL makes processFragment() to check scrollRestorationType explicitly, not depending on previous restoreScrollPositionAndViewState() call. [1] https://codereview.chromium.org/2269043002/. BUG=624697, 417782 TEST=virtual/rootlayerscrolls/fast/history/scroll-restoration/scroll-restoration-fragment-navigation-crossdoc.html Committed: https://crrev.com/41ca771082edfcdbe304abbce42fce6de58c0657 Cr-Commit-Position: refs/heads/master@{#430237} ==========
Message was sent while issue was closed.
Patchset 4 (id:??) landed as https://crrev.com/41ca771082edfcdbe304abbce42fce6de58c0657 Cr-Commit-Position: refs/heads/master@{#430237} |