New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 673751 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Jan 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 576261



Sign in to add a comment

PlzNavigate: clicking on an href link with a javascript on click navigation event should follow the href link

Project Member Reported by clamy@chromium.org, Dec 13 2016

Issue description

We shoul dnot execute the javascrpt navigation in that case. This is making several imported/wpt/html/browsers/browsing-the-web/ tests fail when PlzNavigate is enabled.
 

Comment 1 by yzshen@chromium.org, Dec 22 2016

Owner: yzshen@chromium.org

Comment 2 by yzshen@chromium.org, Dec 22 2016

Cc: clamy@chromium.org jam@chromium.org
Assume that the user clicks on the following anchor element:
<a target="test" onclick="document.getElementById('test').contentWindow.location='click.html'" href="href.html">Test</a>

Non-PlzNavigate:
1) handle the onclick event, which schedules a navigation to click.html (done by blink::NavigationScheduler)
2) handle the href, it calls RenderFrameImpl::decidePolicyForNavigation() and decides to go ahead and load href.html
3) loading href.html cancels any scheduled navigations
4) outcome: navigate to href.html

PlzNavigate:
1) same as (1) in the Non-PlzNavigate case: handle the onclick event, which schedules a navigation to click.html (done by blink::NavigationScheduler)
2) handle the href, it calls RenderFrameImpl::decidePolicyForNavigation() and decides to sends the request to the browser process
3) before the browser replies, the pending task of navigating to click.html is run, it causes the browser to cancel the previous navigation to href.html
4) outcome: navigate to click.html

It seems PlzNavigate's behavior is not wrong. Navigation decisions are made asynchronously so the execution order is changed.

If we really want to match the behavior of non-PlzNavigation, one thing I can think up is to pause the navigation scheduler while waiting for results from the browser. But I am not sure that is desirable.

Does the outcome of non-PlzNavigate mandate by some standard? Otherwise maybe we should change the expected outcome? :)



Comment 3 by yzshen@chromium.org, Dec 23 2016

> If we really want to match the behavior of non-PlzNavigation, one thing I 
> can think up is to pause the navigation scheduler while waiting for results 
> from the browser.

Given a second thought, instead of pausing, maybe I should just cancel any pending navigation in the scheduler.

Comment 4 by clamy@chromium.org, Dec 23 2016

I think canceling any navigation in the scheduler when we get a WebNavigationPolicyHandledByClient seems reasonable.
Project Member

Comment 5 by bugdroid1@chromium.org, Dec 29 2016

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

commit d026a0c087e5bd358b9827dd77395fca829e44c7
Author: yzshen <yzshen@chromium.org>
Date: Thu Dec 29 01:53:00 2016

PlzNavigate: cancel any scheduled navigations when deciding to let the embedder handle a navigation.

This fixes the following layout tests in PlzNavigate mode:
imported/wpt/html/browsers/browsing-the-web/navigating-across-documents/005.html
imported/wpt/html/browsers/browsing-the-web/navigating-across-documents/006.html
imported/wpt/html/browsers/browsing-the-web/navigating-across-documents/007.html

BUG= 673751 

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

[modify] https://crrev.com/d026a0c087e5bd358b9827dd77395fca829e44c7/third_party/WebKit/LayoutTests/FlagExpectations/enable-browser-side-navigation
[modify] https://crrev.com/d026a0c087e5bd358b9827dd77395fca829e44c7/third_party/WebKit/Source/core/loader/FrameLoader.cpp

Status: Fixed (was: Untriaged)

Sign in to add a comment