REGRESSION: Some USDz from 3rd party websites don't go directly to AR QL
authordino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 26 Jan 2019 01:00:54 +0000 (01:00 +0000)
committerdino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 26 Jan 2019 01:00:54 +0000 (01:00 +0000)
commitd881c540ffff5b67cb27b711980b9d9f7c7d21b1
tree2121a2b83833b5d64e49dd3033d6f4f0cce62f64
parent5121cae0618f6f9eb82eb9ad632da68a600fdcb0
REGRESSION: Some USDz from 3rd party websites don't go directly to AR QL
https://bugs.webkit.org/show_bug.cgi?id=193831
<rdar://problem/47399263>

Reviewed by Chris Dumez.

Source/WebKit:

A System Preview (<a rel="ar">) displays in a modal and doesn't trigger
a navigation. If the link was cross origin, it was causing a process swap,
which meant that the response defaulted back to a navigation.

The fix is to not cause a PSON when the navigation is a system preview.

* UIProcess/API/APINavigation.h:
(API::Navigation::shouldForceDownload const): This is now just tracking
the "download" attribute, and not including System Preview.
(API::Navigation::isSystemPreview const): New method to check for a
navigation triggered as a System Preview.
* UIProcess/WebPageProxy.cpp: Move the code from receivedPolicyDecision to
receivedNavigationPolicyDecision, so that downloads and System Previews are
detected before we decide to change process.
(WebKit::WebPageProxy::receivedNavigationPolicyDecision):
(WebKit::WebPageProxy::receivedPolicyDecision):

Tools:

Two new tests that exercise cross-origin and same-origin System
Previews.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240533 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/APINavigation.h
Source/WebKit/UIProcess/WebPageProxy.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm