Optimized path zoom animation needs a valid UIImage and CGRect
authordino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 May 2018 23:56:01 +0000 (23:56 +0000)
committerdino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 May 2018 23:56:01 +0000 (23:56 +0000)
commit2b61c08165fee42bfd69fe1eac0f724c5b866b58
treef088e0ede6e259e4edb62048ff9b01ad70f555dc
parentae946cb82920c1b85d036147cd92ec4d9eb22e0f
Optimized path zoom animation needs a valid UIImage and CGRect
https://bugs.webkit.org/show_bug.cgi?id=185883
<rdar://problem/40306056>

Reviewed by Jon Lee.

Source/WebCore:

Pass the bounding box of the element that was clicked onto
the UI process, so it can perform an animation from that spot.

This involved adding an IntRect to the ResourceRequest, and passing
that info into it from the HTMLAnchorElement, using a new struct
called SystemPreviewInfo.

* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::handleClick):
* loader/FrameLoadRequest.cpp:
(WebCore::FrameLoadRequest::FrameLoadRequest):
* loader/FrameLoadRequest.h:
(WebCore::FrameLoadRequest::FrameLoadRequest):
(WebCore::FrameLoadRequest::isSystemPreview const):
(WebCore::FrameLoadRequest::systemPreviewRect const):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::urlSelected):
(WebCore::FrameLoader::loadURL):
* loader/FrameLoader.h:
(WebCore::FrameLoader::urlSelected):
* loader/FrameLoaderTypes.h:
* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::systemPreviewRect const):
(WebCore::ResourceRequestBase::setSystemPreviewRect):
* platform/network/ResourceRequestBase.h:

Source/WebKit:

Take the rectangle that was passed into the ResourceRequest and
use it for the origin of an animation into QuickLook.

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<ResourceRequest>::encode):
(IPC::ArgumentCoder<ResourceRequest>::decode):
* UIProcess/Cocoa/DownloadClient.mm:
(WebKit::DownloadClient::didStart):
* UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
(-[_WKPreviewControllerDelegate initWithSystemPreviewController:fromRect:]):
(-[_WKPreviewControllerDelegate presentingViewController]):
(-[_WKPreviewControllerDelegate previewController:frameForPreviewItem:inSourceView:]):
(-[_WKPreviewControllerDelegate previewController:transitionImageForPreviewItem:contentRect:]):
(WebKit::SystemPreviewController::start):
(-[_WKPreviewControllerDelegate initWithSystemPreviewController:]): Deleted.
* UIProcess/Downloads/DownloadProxy.h:
(WebKit::DownloadProxy::systemPreviewDownloadRect const):
* UIProcess/SystemPreviewController.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::syncRootViewToScreen):
* UIProcess/WebPageProxy.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@232090 268f45cc-cd09-0410-ab3c-d52691b4dbfc
17 files changed:
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLAnchorElement.cpp
Source/WebCore/loader/FrameLoadRequest.cpp
Source/WebCore/loader/FrameLoadRequest.h
Source/WebCore/loader/FrameLoader.cpp
Source/WebCore/loader/FrameLoader.h
Source/WebCore/loader/FrameLoaderTypes.h
Source/WebCore/platform/network/ResourceRequestBase.cpp
Source/WebCore/platform/network/ResourceRequestBase.h
Source/WebKit/ChangeLog
Source/WebKit/Shared/WebCoreArgumentCoders.cpp
Source/WebKit/UIProcess/Cocoa/DownloadClient.mm
Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm
Source/WebKit/UIProcess/Downloads/DownloadProxy.h
Source/WebKit/UIProcess/SystemPreviewController.h
Source/WebKit/UIProcess/WebPageProxy.cpp
Source/WebKit/UIProcess/WebPageProxy.h