PlzNavigate: clicking on an href link with a javascript on click navigation event should follow the href link |
|||
Issue descriptionWe 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.
,
Dec 22 2016
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? :)
,
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.
,
Dec 23 2016
I think canceling any navigation in the scheduler when we get a WebNavigationPolicyHandledByClient seems reasonable.
,
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
,
Jan 3 2017
|
|||
►
Sign in to add a comment |
|||
Comment 1 by yzshen@chromium.org
, Dec 22 2016