New issue
Advanced search Search tips

Issue 661820 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Nov 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: iOS
Pri: 2
Type: Bug



Sign in to add a comment

window.history.go does not handle out of bounds values

Project Member Reported by eugene...@chromium.org, Nov 2 2016

Issue description

window.history.go(-large_number) will always go back as long as there is non-redirect entry in navigation history.

In the same way window.history.go(large_number) will go forward.
According to the spec if the delta is out of range, window.history.go should do nothing:
https://www.w3.org/TR/html5/browsers.html#the-history-interface



 
Project Member

Comment 1 by bugdroid1@chromium.org, Nov 8 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/44dc0832429cf6754c254739d4939382e5ee3b71

commit 44dc0832429cf6754c254739d4939382e5ee3b71
Author: eugenebut <eugenebut@chromium.org>
Date: Tue Nov 08 00:12:42 2016

[ios] Refactored back-forward navigation in CRWSessionController.

Notable changes:
 - Added public -[CRWSessionController indexOfEntryForDelta:] which will
   be used in future BF navigation refactorings (crbug.com/661858). This
   API will allow to tell the future navigation index w/o making an
   actual navigation and pass that future entry to
   |isSameDocumentNavigationBetweenEntry:andEntry:| call.
 - Made goDelta: no-op if delta is out of bounds. This make
   CRWSessionController  implementation better conform to w3 spec:
   https://www.w3.org/TR/html5/browsers.html#the-history-interface
 - Added public canGoDelta: API and use it in canGoBack/canGoForward.
 - goBack and goForward now implemented by calling goDelta:-1 and
   goDelta:1. This way the implementation is more efficient (no extra
   calls of |discardNonCommittedEntries| and |discardTransientEntry|)
   and cleaner.
 - Do not change previousNavigationIndex if navigation did not happen.
 - Added more unit tests.

Further cleanups (like reusing indexOfEntryForDelta: and
isRedirectTransitionForEntryAtIndex:) will be done in separate CLs.

BUG= 661820 

Review-Url: https://codereview.chromium.org/2470913007
Cr-Commit-Position: refs/heads/master@{#430435}

[modify] https://crrev.com/44dc0832429cf6754c254739d4939382e5ee3b71/ios/web/navigation/crw_session_controller.h
[modify] https://crrev.com/44dc0832429cf6754c254739d4939382e5ee3b71/ios/web/navigation/crw_session_controller.mm
[modify] https://crrev.com/44dc0832429cf6754c254739d4939382e5ee3b71/ios/web/navigation/crw_session_controller_unittest.mm

Status: Fixed (was: Assigned)
Project Member

Comment 3 by bugdroid1@chromium.org, Nov 8 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/300b8d4cd1c946373960c9e0f903b704bed36d41

commit 300b8d4cd1c946373960c9e0f903b704bed36d41
Author: eugenebut <eugenebut@chromium.org>
Date: Tue Nov 08 03:41:20 2016

Revert of [ios] Refactored back-forward navigation in CRWSessionController. (patchset #5 id:80001 of https://codereview.chromium.org/2470913007/ )

Reason for revert:
GoDelta test fails on 32-bit platform

Original issue's description:
> [ios] Refactored back-forward navigation in CRWSessionController.
>
> Notable changes:
>  - Added public -[CRWSessionController indexOfEntryForDelta:] which will
>    be used in future BF navigation refactorings (crbug.com/661858). This
>    API will allow to tell the future navigation index w/o making an
>    actual navigation and pass that future entry to
>    |isSameDocumentNavigationBetweenEntry:andEntry:| call.
>  - Made goDelta: no-op if delta is out of bounds. This make
>    CRWSessionController  implementation better conform to w3 spec:
>    https://www.w3.org/TR/html5/browsers.html#the-history-interface
>  - Added public canGoDelta: API and use it in canGoBack/canGoForward.
>  - goBack and goForward now implemented by calling goDelta:-1 and
>    goDelta:1. This way the implementation is more efficient (no extra
>    calls of |discardNonCommittedEntries| and |discardTransientEntry|)
>    and cleaner.
>  - Do not change previousNavigationIndex if navigation did not happen.
>  - Added more unit tests.
>
> Further cleanups (like reusing indexOfEntryForDelta: and
> isRedirectTransitionForEntryAtIndex:) will be done in separate CLs.
>
> BUG= 661820 
>
> Committed: https://crrev.com/44dc0832429cf6754c254739d4939382e5ee3b71
> Cr-Commit-Position: refs/heads/master@{#430435}

TBR=kkhorimoto@chromium.org,rohitrao@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG= 661820 

Review-Url: https://codereview.chromium.org/2488553004
Cr-Commit-Position: refs/heads/master@{#430506}

[modify] https://crrev.com/300b8d4cd1c946373960c9e0f903b704bed36d41/ios/web/navigation/crw_session_controller.h
[modify] https://crrev.com/300b8d4cd1c946373960c9e0f903b704bed36d41/ios/web/navigation/crw_session_controller.mm
[modify] https://crrev.com/300b8d4cd1c946373960c9e0f903b704bed36d41/ios/web/navigation/crw_session_controller_unittest.mm

Project Member

Comment 4 by bugdroid1@chromium.org, Nov 8 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/56ef246026d69de2002f0068c64fb54000207bce

commit 56ef246026d69de2002f0068c64fb54000207bce
Author: eugenebut <eugenebut@chromium.org>
Date: Tue Nov 08 18:47:31 2016

Reland: [ios] Refactored back-forward navigation in CRWSessionController.

Notable changes:
 - Added public -[CRWSessionController indexOfEntryForDelta:] which will
   be used in future BF navigation refactorings (crbug.com/661858). This
   API will allow to tell the future navigation index w/o making an
   actual navigation and pass that future entry to
   |isSameDocumentNavigationBetweenEntry:andEntry:| call.
 - Made goDelta: no-op if delta is out of bounds. This make
   CRWSessionController  implementation better conform to w3 spec:
   https://www.w3.org/TR/html5/browsers.html#the-history-interface
 - Added public canGoDelta: API and use it in canGoBack/canGoForward.
 - goBack and goForward now implemented by calling goDelta:-1 and
   goDelta:1. This way the implementation is more efficient (no extra
   calls of |discardNonCommittedEntries| and |discardTransientEntry|)
   and cleaner.
 - Do not change previousNavigationIndex if navigation did not happen.
 - Added more unit tests.

Further cleanups (like reusing indexOfEntryForDelta: and
isRedirectTransitionForEntryAtIndex:) will be done in separate CLs.

BUG= 661820 

Review-Url: https://codereview.chromium.org/2470913007
Cr-Commit-Position: refs/heads/master@{#430435}
(cherry picked from commit 44dc0832429cf6754c254739d4939382e5ee3b71)

Review-Url: https://codereview.chromium.org/2482983003
Cr-Commit-Position: refs/heads/master@{#430672}

[modify] https://crrev.com/56ef246026d69de2002f0068c64fb54000207bce/ios/web/navigation/crw_session_controller.h
[modify] https://crrev.com/56ef246026d69de2002f0068c64fb54000207bce/ios/web/navigation/crw_session_controller.mm
[modify] https://crrev.com/56ef246026d69de2002f0068c64fb54000207bce/ios/web/navigation/crw_session_controller_unittest.mm

Sign in to add a comment