Inform clients when editable image attachment backing data changes
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Nov 2018 06:31:04 +0000 (06:31 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Nov 2018 06:31:04 +0000 (06:31 +0000)
commit2463f6cee9a88dd1c1b539e17fcb407ad579a530
tree7c850d15dfe9bd104f3a6852e650cb3200d94274
parent2b23d0173c9364c60503017913cd9be6c3303619
Inform clients when editable image attachment backing data changes
https://bugs.webkit.org/show_bug.cgi?id=192206
<rdar://problem/46350277>

Reviewed by Wenson Hsieh.

Source/WebKit:

* UIProcess/API/Cocoa/APIAttachmentCocoa.mm:
(API::Attachment::invalidateGeneratedFileWrapper):
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _didInvalidateDataForAttachment:]):
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/Cocoa/PageClientImplCocoa.h:
* UIProcess/Cocoa/PageClientImplCocoa.mm:
(WebKit::PageClientImplCocoa::didInvalidateDataForAttachment):
* UIProcess/PageClient.h:
(WebKit::PageClient::didInvalidateDataForAttachment):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didInvalidateDataForAttachment):
* UIProcess/WebPageProxy.h:
Plumb file-wrapper-invalidation through from APIAttachment to WKUIDelegate.

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm:
(-[AttachmentUpdateObserver init]):
(-[AttachmentUpdateObserver dataInvalidated]):
(-[AttachmentUpdateObserver _webView:didInvalidateDataForAttachment:]):
(TestWebKitAPI::ObserveAttachmentUpdatesForScope::expectAttachmentInvalidation):
(webViewForTestingAttachments):
(TestWebKitAPI::forEachViewInHierarchy):
(TestWebKitAPI::findEditableImageCanvas):
(TestWebKitAPI::drawSquareInEditableImage):
(TestWebKitAPI::TEST):
* TestWebKitAPI/ios/PencilKitTestSPI.h: Added.
Add a test ensuring that we get an invalidation callback when an editable image is changed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238726 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/Cocoa/APIAttachmentCocoa.mm
Source/WebKit/UIProcess/API/Cocoa/WKUIDelegatePrivate.h
Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h
Source/WebKit/UIProcess/Cocoa/PageClientImplCocoa.h
Source/WebKit/UIProcess/Cocoa/PageClientImplCocoa.mm
Source/WebKit/UIProcess/PageClient.h
Source/WebKit/UIProcess/WebPageProxy.cpp
Source/WebKit/UIProcess/WebPageProxy.h
Tools/ChangeLog
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
Tools/TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm
Tools/TestWebKitAPI/ios/PencilKitTestSPI.h [new file with mode: 0644]