Bug 205087

Summary: [macOS] Issue load sooner on swipe back/forward navigation
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebKit2Assignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, commit-queue, ggaren, simon.fraser, thorton, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 205127    
Attachments:
Description Flags
Patch none

Description Chris Dumez 2019-12-10 14:59:58 PST
Issue load sooner on swipe back/forward navigation on macOS. We currently wait until the end of the swipe animation to issue the load but we should be able to start loading as soon as the user lifts the finger and thus commits to navigating. This will improve perceived performance on swipe back/forward navigation.
Comment 1 Chris Dumez 2019-12-10 15:12:45 PST
Created attachment 385310 [details]
Patch
Comment 2 Chris Dumez 2019-12-10 15:14:43 PST
<rdar://problem/57809587>
Comment 3 Tim Horton 2019-12-10 15:16:46 PST
Comment on attachment 385310 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=385310&action=review

> Source/WebKit/UIProcess/ProvisionalPageProxy.cpp:148
> +    if (m_page.isLayerTreeFrozenDueToSwipeAnimation())
> +        send(Messages::WebPage::FreezeLayerTreeDueToSwipeAnimation());

Should we just stuff this in the creation parameters? Then there's no race.
Comment 4 Chris Dumez 2019-12-10 15:44:47 PST
Comment on attachment 385310 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=385310&action=review

>> Source/WebKit/UIProcess/ProvisionalPageProxy.cpp:148
>> +        send(Messages::WebPage::FreezeLayerTreeDueToSwipeAnimation());
> 
> Should we just stuff this in the creation parameters? Then there's no race.

We need a separate IPC for the non-PSON case anyway. I do not think this is racy here because we're process-swapping here and the tree will already be be frozen with ProcessSwap reason until WebPage::didCompletePageTransition() is called. As long as I sent the FreezeLayerTreeDueToSwipeAnimation IPC before the IPC triggering the load, I do not think there is a race.
Comment 5 WebKit Commit Bot 2019-12-10 18:16:26 PST
Comment on attachment 385310 [details]
Patch

Clearing flags on attachment: 385310

Committed r253360: <https://trac.webkit.org/changeset/253360>
Comment 6 WebKit Commit Bot 2019-12-10 18:16:28 PST
All reviewed patches have been landed.  Closing bug.