New issue
Advanced search Search tips

Issue 776392 link

Starred by 2 users

Issue metadata

Status: Duplicate
Merged: issue 776373
Owner: ----
Closed: Oct 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: iOS
Pri: 3
Type: Task

Blocking:
issue 734150



Sign in to add a comment

NavigationCallbacksTest.StateNavigation fails with WKBasedNavigationManager

Project Member Reported by ajuma@chromium.org, Oct 19 2017

Issue description

This fails because for both pushState and replaceState, neither DidStartNavigation nor DidFinishNavigation gets called on the WebStateObserver.

When using LegacyNavigationManager, navigation.js (injected into the WKWebView) intercepts pushState calls, and sends a didPushState message. This is handled by [CRWWebController handleWindowHistoryDidPushStateMessage] which calls pushStateWithPageURL, which in turn calls WebStateImpl::OnNavigationStarted (leading to DidStartNavigation) and WebStateImpl::OnNavigationFinished (leading to DidFinishNavigation). didReplaceState is handled similarly.

But navigation.js isn't injected when using WKBasedNavigationManager. Are there other ways to detect pushState and replaceState? Do we still need this functionality (does anything depend on the WebStateObserver observing pushState and replaceState navigation)?
 

Comment 1 by danyao@chromium.org, Oct 19 2017

I'm not sure if the current behavior is intentional or an artifact. Currently pushState and replaceState are implemented as navigations, which is also a source of non-compat behavior in this area.

According to the spec (https://html.spec.whatwg.org/multipage/history.html#the-history-interface), pushState and replaceState are not considered history navigation. So I wonder if we should update the assumption that WebStateObserver::OnNavigationFinished() will be triggered. We should figure out which existing feature this breaks.

I wonder what Blink or WebKit does internally.

Comment 2 by danyao@chromium.org, Oct 26 2017

Mergedinto: 776373
Status: Duplicate (was: Available)

Sign in to add a comment