[iOS DnD] Elements in the DOM with the `draggable` attribute should be draggable
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2017-09-11  Wenson Hsieh  <wenson_hsieh@apple.com>
2
3         [iOS DnD] Elements in the DOM with the `draggable` attribute should be draggable
4         https://bugs.webkit.org/show_bug.cgi?id=176664
5         <rdar://problem/32596156>
6
7         Reviewed by Tim Horton.
8
9         Makes a simple adjustment in DragDropInteractionState::previewForDragItem to respect the drag image supplied to
10         the UI process during a "DHTML"-defined drag (i.e. DragSourceActionDHTML).
11
12         Test: DataInteractionTests.CanStartDragOnDivWithDraggableAttribute
13
14         * UIProcess/API/Cocoa/WKWebView.mm:
15         (-[WKWebView _simulateDataInteractionEntered:]): Deleted.
16         (-[WKWebView _simulateDataInteractionUpdated:]): Deleted.
17         (-[WKWebView _simulateDataInteractionPerformOperation:]): Deleted.
18         (-[WKWebView _simulateDataInteractionEnded:]): Deleted.
19         (-[WKWebView _simulateDataInteractionSessionDidEnd:]): Deleted.
20         (-[WKWebView _simulateWillBeginDataInteractionWithSession:]): Deleted.
21         (-[WKWebView _simulatedItemsForSession:]): Deleted.
22         (-[WKWebView _simulateItemsForAddingToSession:atLocation:completion:]): Deleted.
23         (-[WKWebView _simulatePrepareForDataInteractionSession:completion:]): Deleted.
24
25         Remove all -_simulate*: testing helpers on WKWebView.
26
27         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
28         * UIProcess/ios/DragDropInteractionState.mm:
29         (WebKit::shouldUseDragImageToCreatePreviewForDragSource):
30         (WebKit::shouldUseTextIndicatorToCreatePreviewForDragSource):
31
32         Add shouldUseDragImageToCreatePreviewForDragSource, which returns YES when dragging an image or DHTML-defined
33         draggable element and the drag image exists. This is called from previewForDragItem when constructing the drag
34         preview for a given UIDragItem.
35
36         (WebKit::DragDropInteractionState::previewForDragItem const):
37         (WebKit::shouldUseTextIndicatorToCreatePreviewForDragAction): Deleted.
38         * UIProcess/ios/WKContentViewInteraction.h:
39         * UIProcess/ios/WKContentViewInteraction.mm:
40         (-[WKContentView _simulateDataInteractionEntered:]): Deleted.
41         (-[WKContentView _simulateDataInteractionUpdated:]): Deleted.
42         (-[WKContentView _simulateDataInteractionEnded:]): Deleted.
43         (-[WKContentView _simulateDataInteractionPerformOperation:]): Deleted.
44         (-[WKContentView _simulateDataInteractionSessionDidEnd:]): Deleted.
45         (-[WKContentView _simulateWillBeginDataInteractionWithSession:]): Deleted.
46         (-[WKContentView _simulatedItemsForSession:]): Deleted.
47         (-[WKContentView _simulatePrepareForDataInteractionSession:completion:]): Deleted.
48         (-[WKContentView _simulateItemsForAddingToSession:atLocation:completion:]): Deleted.
49
50         Remove all -_simulate*: testing helpers on WKContentView.
51
52 2017-09-11  Alex Christensen  <achristensen@webkit.org>
53
54         Modernize BoxExtent into RectEdges
55         https://bugs.webkit.org/show_bug.cgi?id=176437
56
57         Reviewed by Simon Fraser.
58
59         * Scripts/webkit/messages.py:
60         (class_template_headers):
61         * Shared/WebCoreArgumentCoders.h:
62         * UIProcess/WebPageProxy.h:
63         * UIProcess/WebPageProxy.messages.in:
64         * WebProcess/WebPage/WebPage.messages.in:
65
66 2017-09-11  Andy Estes  <aestes@apple.com>
67
68         [Mac] Upstream QTKit-related WebKitSystemInterface functions
69         https://bugs.webkit.org/show_bug.cgi?id=176472
70
71         Reviewed by Eric Carlson.
72
73         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
74         (InitWebCoreSystemInterface):
75
76 2017-09-11  JF Bastien  <jfbastien@apple.com>
77
78         cmake build fix
79
80         Unreviewed
81
82         * PlatformMac.cmake: one file was deleted, another renamed.
83
84 2017-09-10  Carlos Garcia Campos  <cgarcia@igalia.com>
85
86         REGRESSION: [GTK] Generated HTML API documentation is missing descriptions
87         https://bugs.webkit.org/show_bug.cgi?id=176667
88
89         Reviewed by Michael Catanzaro.
90
91         Fix several typos in API documentation.
92
93         * UIProcess/API/glib/WebKitSettings.cpp:
94         (webkit_settings_class_init):
95         * UIProcess/API/glib/WebKitWebView.cpp:
96         (webkit_web_view_class_init):
97         * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
98         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
99
100 2017-09-10  Brady Eidson  <beidson@apple.com>
101
102         Try to avoid creating the default WKWebsiteDataStore until its actually needed.
103         <rdar://problem/33164453> and https://bugs.webkit.org/show_bug.cgi?id=176551
104
105         Reviewed by Tim Horton.
106
107         * UIProcess/API/APIHTTPCookieStore.cpp:
108         (API::HTTPCookieStore::cookies):
109         (API::HTTPCookieStore::setCookie):
110         (API::HTTPCookieStore::deleteCookie):
111
112         * UIProcess/API/APIWebsiteDataStore.cpp:
113         (API::WebsiteDataStore::defaultDataStore):
114         (API::WebsiteDataStore::defaultDataStoreExists):
115         * UIProcess/API/APIWebsiteDataStore.h:
116
117         * UIProcess/API/C/WKContext.cpp:
118         (WKContextGetWebsiteDataStore):
119
120         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
121         (+[WKWebsiteDataStore _defaultDataStoreExists]):
122         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
123
124         * UIProcess/WebProcessPool.cpp:
125         (WebKit::WebProcessPool::WebProcessPool):
126         (WebKit::m_hiddenPageThrottlingTimer):
127         (WebKit::WebProcessPool::ensureNetworkProcess):
128         (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
129         (WebKit::WebProcessPool::warmInitialProcess):
130         (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):
131         (WebKit::WebProcessPool::createWebPage):
132         (WebKit::WebProcessPool::pageAddedToProcess):
133         * UIProcess/WebProcessPool.h:
134
135         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
136         (WebKit::WebsiteDataStore::isAssociatedProcessPool const):
137
138 2017-09-09  Mark Lam  <mark.lam@apple.com>
139
140         Avoid duplicate computations of ExecState::vm().
141         https://bugs.webkit.org/show_bug.cgi?id=176647
142
143         Reviewed by Saam Barati.
144
145         * WebProcess/Plugins/Netscape/JSNPMethod.h:
146         (WebKit::JSNPMethod::create):
147         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
148         (WebKit::NPJSObject::setProperty):
149         (WebKit::NPJSObject::removeProperty):
150         (WebKit::NPJSObject::enumerate):
151
152 2017-09-08  Joseph Pecoraro  <pecoraro@apple.com>
153
154         Fetch's Response.statusText is unexpectedly the full http status line for HTTP/2 responses
155         https://bugs.webkit.org/show_bug.cgi?id=176479
156
157         Reviewed by Alex Christensen.
158
159         * NetworkProcess/NetworkProcess.cpp:
160         (WebKit::NetworkProcess::initializeNetworkProcess):
161         Initialize AtomicString statics like emptyAtom().
162
163 2017-09-08  Commit Queue  <commit-queue@webkit.org>
164
165         Unreviewed, rolling out r221773.
166         https://bugs.webkit.org/show_bug.cgi?id=176614
167
168         This caused build failures. (Requested by mlewis13 on
169         #webkit).
170
171         Reverted changeset:
172
173         "[Mac] Upstream QTKit-related WebKitSystemInterface functions"
174         https://bugs.webkit.org/show_bug.cgi?id=176472
175         http://trac.webkit.org/changeset/221773
176
177 2017-09-08  Stephan Szabo  <stephan.szabo@am.sony.com>
178
179         [WinCairo] Add Storage Process files for wincairo webkit
180         https://bugs.webkit.org/show_bug.cgi?id=176567
181
182         Reviewed by Alex Christensen.
183
184         * PlatformWin.cmake:
185         * StorageProcess/EntryPoint/win/StorageProcessMain.cpp: Added.
186         (main):
187         * StorageProcess/win/StorageProcessMainWin.cpp: Added.
188         (WebKit::StorageProcessMainWin):
189         * StorageProcess/win/StorageProcessMainWin.h: Added.
190
191 2017-09-08  Ryan Haddad  <ryanhaddad@apple.com>
192
193         Unreviewed, rolling out r221771.
194
195         This change caused two API tests to crash.
196
197         Reverted changeset:
198
199         "Clean up API::UIClient"
200         https://bugs.webkit.org/show_bug.cgi?id=176568
201         http://trac.webkit.org/changeset/221771
202
203 2017-09-07  Carlos Garcia Campos  <cgarcia@igalia.com>
204
205         [GTK][WPE] UI process crash in WebBackForwardList::restoreFromState
206         https://bugs.webkit.org/show_bug.cgi?id=176303
207
208         Reviewed by Michael Catanzaro.
209
210         Ensure the current index provided by the session state is not out of actual item list bounds. This is a bug in
211         the session state decoder, but WebBackForwardList::backForwardListState() is already doing the check and using
212         the last item index instead, so it's not easy to know where the actual problem is. In any case we should
213         still protect the decoder.
214
215         * UIProcess/API/glib/WebKitWebViewSessionState.cpp:
216         (decodeSessionState):
217
218 2017-09-07  Andy Estes  <aestes@apple.com>
219
220         [Mac] Upstream QTKit-related WebKitSystemInterface functions
221         https://bugs.webkit.org/show_bug.cgi?id=176472
222
223         Reviewed by Eric Carlson.
224
225         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
226         (InitWebCoreSystemInterface):
227
228 2017-09-07  Alex Christensen  <achristensen@webkit.org>
229
230         Clean up API::UIClient
231         https://bugs.webkit.org/show_bug.cgi?id=176568
232
233         Reviewed by Brady Eidson.
234
235         We don't need createNewPage and createNewPageAsync.
236         An async version can support synchronous delegate calls by just calling the completion handler synchronously.
237
238         * UIProcess/API/APIUIClient.h:
239         (API::UIClient::createNewPage):
240         (API::UIClient::createNewPageAsync): Deleted.
241         (API::UIClient::canCreateNewPageAsync): Deleted.
242         * UIProcess/API/C/WKPage.cpp:
243         (WKPageSetPageUIClient):
244         * UIProcess/API/glib/WebKitUIClient.cpp:
245         * UIProcess/API/glib/WebKitUIClient.h:
246         * UIProcess/Cocoa/UIDelegate.h:
247         * UIProcess/Cocoa/UIDelegate.mm:
248         (WebKit::UIDelegate::UIClient::createNewPage):
249         (WebKit::UIDelegate::UIClient::createNewPageCommon): Deleted.
250         (WebKit::UIDelegate::UIClient::canCreateNewPageAsync): Deleted.
251         (WebKit::UIDelegate::UIClient::createNewPageAsync): Deleted.
252         * UIProcess/WebPageProxy.cpp:
253         (WebKit::WebPageProxy::createNewPage):
254         * UIProcess/WebPageProxy.h:
255
256 2017-09-07  Alex Christensen  <achristensen@webkit.org>
257
258         Make DragControllerAction an enum class
259         https://bugs.webkit.org/show_bug.cgi?id=176565
260
261         Reviewed by Andy Estes.
262
263         * Shared/DragControllerAction.h:
264         (): Deleted.
265         * UIProcess/WebPageProxy.cpp:
266         (WebKit::WebPageProxy::dragEntered):
267         (WebKit::WebPageProxy::dragUpdated):
268         (WebKit::WebPageProxy::dragExited):
269         (WebKit::WebPageProxy::performDragOperation):
270         * WebProcess/WebPage/WebPage.cpp:
271         (WebKit::WebPage::performDragControllerAction):
272         * WebProcess/WebPage/WebPage.h:
273         * WebProcess/WebPage/WebPage.messages.in:
274
275 2017-09-07  Myles C. Maxfield  <mmaxfield@apple.com>
276
277         [PAL] Unify PlatformUserPreferredLanguages.h with Language.h
278         https://bugs.webkit.org/show_bug.cgi?id=176561
279
280         Reviewed by Brent Fulgham.
281
282         * UIProcess/WebProcessPool.cpp:
283         * WebProcess/WebProcess.cpp:
284         (WebKit::WebProcess::userPreferredLanguagesChanged const):
285
286 2017-09-07  Youenn Fablet  <youenn@apple.com>
287
288         Remove entry from CacheStorageEngineConnection lock map when unlocking a Cache
289         https://bugs.webkit.org/show_bug.cgi?id=176548
290
291         Reviewed by Alex Christensen.
292
293         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
294         (WebKit::CacheStorageEngineConnection::dereference):
295
296 2017-09-07  Chris Dumez  <cdumez@apple.com>
297
298         [WK2] Add C API to retrieve the originating page of a WKDownload
299         https://bugs.webkit.org/show_bug.cgi?id=176557
300         <rdar://problem/34314776>
301
302         Reviewed by Alex Christensen.
303
304         Add C API to retrieve the original page of a WKDownload. This is the C API equivalent to
305         _WKDownload.originatingWebView which already exists in ObjC. The pointer is weak so as
306         to not keep alive the page for the duration of the download.
307
308         * UIProcess/API/C/WKDownload.cpp:
309         (WKDownloadGetOriginatingPage):
310         * UIProcess/API/C/WKDownload.h:
311         * UIProcess/API/Cocoa/_WKDownload.mm:
312         (-[_WKDownload originatingWebView]):
313         * UIProcess/API/Cocoa/_WKDownloadInternal.h:
314         * UIProcess/Downloads/DownloadProxy.cpp:
315         (WebKit::DownloadProxy::originatingPage const):
316         (WebKit::DownloadProxy::setOriginatingPage):
317         * UIProcess/Downloads/DownloadProxy.h:
318         * UIProcess/WebPageProxy.cpp:
319         (WebKit::WebPageProxy::receivedPolicyDecision):
320         * UIProcess/WebProcessPool.cpp:
321         (WebKit::WebProcessPool::download):
322         (WebKit::WebProcessPool::resumeDownload):
323         (WebKit::WebProcessPool::createDownloadProxy):
324         * UIProcess/WebProcessPool.h:
325         * UIProcess/ios/PageClientImplIOS.mm:
326         (WebKit::PageClientImpl::handleDownloadRequest):
327         * UIProcess/mac/PageClientImplMac.mm:
328         (WebKit::PageClientImpl::handleDownloadRequest):
329
330 2017-09-07  Alex Christensen  <achristensen@webkit.org>
331
332         Clean up Geolocation request handling
333         https://bugs.webkit.org/show_bug.cgi?id=176562
334
335         Reviewed by Tim Horton.
336
337         Instead of passing a GeolocationPermissionRequestProxy& to each client and returning a bool if the request will be handled,
338         pass a Function<void(bool)>&& completionHandler and return the function if it won't be handled.
339         This allows to temporarily support our UIClient/PageClient hybrid design while moving towards a sane design.
340
341         * UIProcess/API/APIUIClient.h:
342         (API::UIClient::Function<void):
343         (API::UIClient::decidePolicyForGeolocationPermissionRequest): Deleted.
344         * UIProcess/API/C/WKAPICast.h:
345         * UIProcess/API/C/WKGeolocationPermissionRequest.cpp:
346         (WKGeolocationPermissionRequestGetTypeID):
347         * UIProcess/API/C/WKPage.cpp:
348         (WKPageSetPageUIClient):
349         * UIProcess/GeolocationPermissionRequestProxy.cpp:
350         (WebKit::GeolocationPermissionRequestProxy::allow):
351         (WebKit::GeolocationPermissionRequestProxy::deny):
352         (WebKit::GeolocationPermissionRequestProxy::invalidate):
353         * UIProcess/GeolocationPermissionRequestProxy.h:
354         (WebKit::GeolocationPermissionRequest::create):
355         (WebKit::GeolocationPermissionRequest::allow):
356         (WebKit::GeolocationPermissionRequest::deny):
357         (WebKit::GeolocationPermissionRequest::GeolocationPermissionRequest):
358         * UIProcess/PageClient.h:
359         (WebKit::PageClient::decidePolicyForGeolocationPermissionRequest): Deleted.
360         * UIProcess/WebPageProxy.cpp:
361         (WebKit::WebPageProxy::requestGeolocationPermissionForFrame):
362         * UIProcess/ios/PageClientImplIOS.h:
363         * UIProcess/ios/PageClientImplIOS.mm:
364         (WebKit::Function<void):
365         (WebKit::PageClientImpl::decidePolicyForGeolocationPermissionRequest): Deleted.
366         * UIProcess/ios/WKContentView.h:
367         * UIProcess/ios/WKGeolocationProviderIOS.h:
368         * UIProcess/ios/WKGeolocationProviderIOS.mm:
369         (-[WKGeolocationProviderIOS decidePolicyForGeolocationRequestFromOrigin:frame:completionHandler:view:]):
370         (-[WKGeolocationProviderIOS geolocationAuthorizationGranted]):
371         (-[WKGeolocationProviderIOS geolocationAuthorizationDenied]):
372         (-[WKWebAllowDenyPolicyListener initWithCompletionHandler:]):
373         (-[WKWebAllowDenyPolicyListener allow]):
374         (-[WKWebAllowDenyPolicyListener deny]):
375         (-[WKGeolocationProviderIOS decidePolicyForGeolocationRequestFromOrigin:frame:request:view:]): Deleted.
376         (-[WKWebAllowDenyPolicyListener initWithPermissionRequestProxy:]): Deleted.
377
378 2017-09-07  Alex Christensen  <achristensen@webkit.org>
379
380         Allow modern decoding of enums and OptionSets
381         https://bugs.webkit.org/show_bug.cgi?id=176480
382
383         Reviewed by Andy Estes.
384
385         * Platform/IPC/ArgumentCoders.h:
386         (IPC::ArgumentCoder<OptionSet<T>>::decode):
387         * Platform/IPC/Decoder.h:
388         (IPC::Decoder::operator>>):
389         * Platform/IPC/Encoder.h:
390         * Shared/WebsitePolicies.h:
391         (WebKit::WebsitePolicies::encode const):
392         (WebKit::WebsitePolicies::decode):
393
394 2017-09-07  Frederic Wang  <fwang@igalia.com>
395
396          Move more code from ScrollingTreeScrollingNodeDelegateIOS to ScrollingTreeScrollingNodeDelegate
397          https://bugs.webkit.org/show_bug.cgi?id=174130
398
399          Reviewed by Simon Fraser.
400
401          * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h: Remove some members,
402          headers and pre-declaration that are moved into the delegate.
403          (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollLayer): Deleted.
404          * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: Remove some headers and
405          WKOverflowScrollViewDelegate since they are moved into the delegate file. Also fix the
406          comment to closing the WebKit namespace.
407          (WebKit::ScrollingTreeOverflowScrollingNodeIOS::~ScrollingTreeOverflowScrollingNodeIOS):
408          Remove some code moved into the delegate and call the corresponding helper function to
409          preserve the current behavior.
410          (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateBeforeChildren): Ditto.
411          Note that it is only necessary to cast the parameter to a ScrollingStateTreeNode.
412          (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateAfterChildren): Ditto.
413          (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterAncestorChange): Ditto.
414          (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollPosition): Ditto.
415          (WebKit::ScrollingTreeOverflowScrollingNodeIOS::setScrollLayerPosition): Ditto.
416          (-[WKOverflowScrollViewDelegate initWithScrollingTreeNodeDelegate:]): Deleted.
417          (-[WKOverflowScrollViewDelegate scrollViewDidScroll:]): Deleted.
418          (-[WKOverflowScrollViewDelegate scrollViewWillBeginDragging:]): Deleted.
419          (-[WKOverflowScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]): Deleted.
420          (-[WKOverflowScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]): Deleted.
421          (-[WKOverflowScrollViewDelegate scrollViewDidEndDecelerating:]): Deleted.
422          * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h: Import headers and members
423          from ScrollingTreeOverflowScrollingNodeIOS. Define new helper functions for the code imported
424          from ScrollingTreeOverflowScrollingNodeIOS. Remove the friendship with
425          ScrollingTreeOverflowScrollingNodeIOS and only makes public the function used by that class.
426          (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollLayer): This function is moved from
427          ScrollingTreeOverflowScrollingNodeIOS.
428          * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm: Add headers,
429          WKOverflowScrollViewDelegate (renamed WKScrollingNodeScrollViewDelegate) and some helper code
430          imported from ScrollingTreeOverflowScrollingNodeIOS.
431          (-[WKScrollingNodeScrollViewDelegate scrollViewDidScroll:]): Moved from
432          ScrollingTreeOverflowScrollingNodeIOS.
433          (-[WKScrollingNodeScrollViewDelegate scrollViewWillBeginDragging:]): Ditto.
434          (-[WKScrollingNodeScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]): Ditto.
435          (-[WKScrollingNodeScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]): Ditto.
436          (-[WKScrollingNodeScrollViewDelegate scrollViewDidEndDecelerating:]): Ditto.
437          (WebKit::ScrollingTreeScrollingNodeDelegateIOS::~ScrollingTreeScrollingNodeDelegateIOS):
438          Import code from ScrollingTreeOverflowScrollingNodeIOS.
439          (WebKit::ScrollingTreeScrollingNodeDelegateIOS::resetScrollViewDelegate): New helper function
440          importing code from ScrollingTreeOverflowScrollingNodeIOS.
441          (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateBeforeChildren): Ditto.
442          (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren): Ditto.
443          (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateLayersAfterAncestorChange): Ditto.
444          (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollPosition): Ditto.
445          (WebKit::ScrollingTreeScrollingNodeDelegateIOS::setScrollLayerPosition): Ditto.
446
447 2017-09-07  Chris Dumez  <cdumez@apple.com>
448
449         [WK2] Notify client when downloads are redirected
450         https://bugs.webkit.org/show_bug.cgi?id=176481
451         <rdar://problem/34309065>
452
453         Reviewed by Geoffrey Garen.
454
455         Notify client when downloads are redirected via both ObjC and C
456         API.
457
458         * NetworkProcess/Downloads/Download.cpp:
459         (WebKit::Download::willSendRedirectedRequest):
460         * NetworkProcess/Downloads/Download.h:
461         * NetworkProcess/Downloads/mac/DownloadMac.mm:
462         (-[WKDownloadAsDelegate download:willSendRequest:redirectResponse:]):
463         * UIProcess/API/APIDownloadClient.h:
464         (API::DownloadClient::willSendRequest):
465         * UIProcess/API/C/WKContext.cpp:
466         (WKContextSetDownloadClient):
467         * UIProcess/API/C/WKContextDownloadClient.h:
468         * UIProcess/API/Cocoa/_WKDownloadDelegate.h:
469         * UIProcess/Cocoa/DownloadClient.h:
470         * UIProcess/Cocoa/DownloadClient.mm:
471         (WebKit::DownloadClient::DownloadClient):
472         (WebKit::DownloadClient::willSendRequest):
473         * UIProcess/Downloads/DownloadProxy.cpp:
474         (WebKit::DownloadProxy::willSendRequest):
475         * UIProcess/Downloads/DownloadProxy.h:
476         * UIProcess/Downloads/DownloadProxy.messages.in:
477
478         * UIProcess/mac/WebContextMenuProxyMac.mm:
479         (WebKit::WebContextMenuProxyMac::showContextMenuWithItems):
480         Set menu proxy before calling menuFromProposedMenu() client delegate.
481         This allows me to perform one of the menu item's action from the
482         menuFromProposedMenu() client delegate in my API test.
483
484 2017-09-07  Alex Christensen  <achristensen@webkit.org>
485
486         Modernize Geolocation code
487         https://bugs.webkit.org/show_bug.cgi?id=176496
488
489         Reviewed by Andy Estes.
490
491         Making the GeolocationPermissionRequestManager take a reference instead of a pointer
492         spilled into making the other supplement constructors do the same.
493
494         * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.cpp:
495         (WebKit::LegacyCustomProtocolManager::LegacyCustomProtocolManager):
496         (WebKit::LegacyCustomProtocolManager::startLoading):
497         (WebKit::LegacyCustomProtocolManager::stopLoading):
498         * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.h:
499         * NetworkProcess/NetworkProcess.h:
500         (WebKit::NetworkProcess::addSupplement):
501         * Shared/Authentication/AuthenticationManager.cpp:
502         (WebKit::AuthenticationManager::AuthenticationManager):
503         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
504         * Shared/Authentication/AuthenticationManager.h:
505         * UIProcess/API/APIUIClient.h:
506         (API::UIClient::decidePolicyForGeolocationPermissionRequest):
507         * UIProcess/API/C/WKPage.cpp:
508         (WKPageSetPageUIClient):
509         * UIProcess/WebPageProxy.cpp:
510         (WebKit::WebPageProxy::requestGeolocationPermissionForFrame):
511         * WebProcess/Cookies/WebCookieManager.cpp:
512         (WebKit::WebCookieManager::WebCookieManager):
513         (WebKit::WebCookieManager::getHostnamesWithCookies):
514         (WebKit::WebCookieManager::deleteCookie):
515         (WebKit::WebCookieManager::deleteAllCookiesModifiedSince):
516         (WebKit::WebCookieManager::getAllCookies):
517         (WebKit::WebCookieManager::getCookies):
518         (WebKit::WebCookieManager::setCookie):
519         (WebKit::WebCookieManager::setCookies):
520         (WebKit::WebCookieManager::notifyCookiesDidChange):
521         (WebKit::WebCookieManager::setHTTPCookieAcceptPolicy):
522         (WebKit::WebCookieManager::getHTTPCookieAcceptPolicy):
523         * WebProcess/Cookies/WebCookieManager.h:
524         * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
525         (WebKit::GeolocationPermissionRequestManager::GeolocationPermissionRequestManager):
526         (WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation):
527         (WebKit::GeolocationPermissionRequestManager::cancelRequestForGeolocation):
528         * WebProcess/Geolocation/GeolocationPermissionRequestManager.h:
529         * WebProcess/Geolocation/WebGeolocationManager.cpp:
530         (WebKit::WebGeolocationManager::WebGeolocationManager):
531         (WebKit::WebGeolocationManager::registerWebPage):
532         (WebKit::WebGeolocationManager::unregisterWebPage):
533         (WebKit::WebGeolocationManager::setEnableHighAccuracyForPage):
534         (WebKit::WebGeolocationManager::didChangePosition):
535         (WebKit::WebGeolocationManager::didFailToDeterminePosition):
536         (WebKit::WebGeolocationManager::resetPermissions):
537         * WebProcess/Geolocation/WebGeolocationManager.h:
538         * WebProcess/MediaCache/WebMediaKeyStorageManager.h:
539         (WebKit::WebMediaKeyStorageManager::WebMediaKeyStorageManager):
540         * WebProcess/Notifications/WebNotificationManager.cpp:
541         (WebKit::WebNotificationManager::WebNotificationManager):
542         (WebKit::WebNotificationManager::show):
543         (WebKit::WebNotificationManager::cancel):
544         (WebKit::WebNotificationManager::clearNotifications):
545         (WebKit::WebNotificationManager::didDestroyNotification):
546         * WebProcess/Notifications/WebNotificationManager.h:
547         * WebProcess/WebCoreSupport/WebGeolocationClient.cpp:
548         (WebKit::WebGeolocationClient::requestPermission):
549         (WebKit::WebGeolocationClient::cancelPermissionRequest):
550         * WebProcess/WebCoreSupport/WebGeolocationClient.h:
551         (WebKit::WebGeolocationClient::WebGeolocationClient):
552         * WebProcess/WebPage/WebPage.cpp:
553         (WebKit::m_cpuLimit):
554         * WebProcess/WebProcess.h:
555         (WebKit::WebProcess::addSupplement):
556         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
557         (WebKit::UserMediaCaptureManager::UserMediaCaptureManager):
558         * WebProcess/cocoa/UserMediaCaptureManager.h:
559
560 2017-09-06  Alex Christensen  <achristensen@webkit.org>
561
562         Add WKUIDelegatePrivate equivalent of WKPageUIClient's pageDidScroll
563         https://bugs.webkit.org/show_bug.cgi?id=176482
564         <rdar://problem/29270035>
565
566         Reviewed by Tim Horton.
567         
568         Covered by a new API test!
569
570         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
571         * UIProcess/Cocoa/UIDelegate.h:
572         * UIProcess/Cocoa/UIDelegate.mm:
573         (WebKit::UIDelegate::setDelegate):
574         (WebKit::UIDelegate::UIClient::pageDidScroll):
575
576 2017-09-06  Youenn Fablet  <youenn@apple.com>
577
578         NetworkProcess Cache and Caches should be cleared when the last related WebProcess Cache or CacheStorage is destroyed
579         https://bugs.webkit.org/show_bug.cgi?id=176249
580
581         Reviewed by Alex Christensen.
582
583         CacheStorageEngineConnection will store the number of Caches references for its related WebProcess.
584         For a new reference, CacheStorageEngineConnection will notify its engine to lock the related Cache.
585         When the last reference is gone, CacheStorageEngineConnection will ask the engine to release the lock.
586
587         CacheStorageEngine will keep locks as a counter for each Cache object.
588         When the counter goes to zero, the engine asks the Cache to dispose itself.
589         Disposal is done by its parent Caches as only Caches knows whether the Cache is persistent or has been removed.
590
591         The Caches will remove the Cache from memory.
592         For removed caches, all information will be lost.
593         For caches that are not removed, they will keep their identifiers but all in-memory record information will be discarded.
594         If there is a need to reopen the Cache, it will need to read its information from the filesystem.
595         If the Caches has no longer any active Cache object, it will ask the engine to release itself.
596
597         WebProcess crashing is handled correctly as the CacheStorageEngineConnection will release its locks at destruction
598         time of the connection to the web process.
599
600         Adding the possiblity to grab an engine representation for test purposes.
601
602         * NetworkProcess/cache/CacheStorageEngine.cpp:
603         (WebKit::CacheStorage::Engine::readCachesFromDisk):
604         (WebKit::CacheStorage::Engine::removeCaches):
605         (WebKit::CacheStorage::Engine::lock):
606         (WebKit::CacheStorage::Engine::unlock):
607         * NetworkProcess/cache/CacheStorageEngine.h:
608         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
609         (WebKit::CacheStorage::Cache::Cache):
610         (WebKit::CacheStorage::Cache::dispose):
611         (WebKit::CacheStorage::Cache::clearMemoryRepresentation):
612         * NetworkProcess/cache/CacheStorageEngineCache.h:
613         (WebKit::CacheStorage::Cache::isActive const):
614         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
615         (WebKit::CacheStorage::Caches::Caches):
616         (WebKit::CacheStorage::Caches::open):
617         (WebKit::CacheStorage::Caches::dispose):
618         (WebKit::CacheStorage::Caches::readCachesFromDisk):
619         (WebKit::CacheStorage::Caches::clearMemoryRepresentation):
620         * NetworkProcess/cache/CacheStorageEngineCaches.h:
621         (WebKit::CacheStorage::Caches::create):
622         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
623         (WebKit::CacheStorageEngineConnection::~CacheStorageEngineConnection):
624         (WebKit::CacheStorageEngineConnection::reference):
625         (WebKit::CacheStorageEngineConnection::dereference):
626         * NetworkProcess/cache/CacheStorageEngineConnection.h:
627         * NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
628         * WebProcess/Cache/WebCacheStorageConnection.cpp:
629         (WebKit::WebCacheStorageConnection::reference):
630         (WebKit::WebCacheStorageConnection::dereference):
631         * WebProcess/Cache/WebCacheStorageConnection.h:
632
633 2017-09-06  Alex Christensen  <achristensen@webkit.org>
634
635         Add WKUIDelegatePrivate equivalent of WKPageUIClient's pinnedStateDidChange
636         https://bugs.webkit.org/show_bug.cgi?id=176474
637         <rdar://problem/29270035>
638
639         Reviewed by Tim Horton.
640
641         Rather than telling the UIClient that the pinned state changed and having the application check 4 bools
642         like we do with WKPage, I made a KVO property on the WKWebView.  I introduce _WKRectEdge for this purpose,
643         which is like UIRectEdge but unfortunately NSRectEdge and CGRectEdge cannot be used as NS_OPTIONS/flags.
644         This same structure is used for rubber band state.
645         
646         Covered by a new API test.
647
648         * UIProcess/API/Cocoa/WKWebView.mm:
649         (-[WKWebView _pinnedState]):
650         (-[WKWebView _rubberBandState]):
651         (-[WKWebView _setRubberBandState:]):
652         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
653         * UIProcess/Cocoa/WebViewImpl.h:
654         * UIProcess/Cocoa/WebViewImpl.mm:
655         (WebKit::WebViewImpl::pinnedState):
656         (WebKit::WebViewImpl::rubberBandState):
657         (WebKit::WebViewImpl::setRubberBandState):
658         * UIProcess/PageClient.h:
659         (WebKit::PageClient::pinnedStateWillChange):
660         (WebKit::PageClient::pinnedStateDidChange):
661         * UIProcess/WebPageProxy.cpp:
662         (WebKit::WebPageProxy::didChangeScrollOffsetPinningForMainFrame):
663         * UIProcess/mac/PageClientImplMac.h:
664         * UIProcess/mac/PageClientImplMac.mm:
665         (WebKit::PageClientImpl::pinnedStateWillChange):
666         (WebKit::PageClientImpl::pinnedStateDidChange):
667
668 2017-09-06  Youenn Fablet  <youenn@apple.com>
669
670         Introduce asynchronous opening of CacheStorageEngine cache
671         https://bugs.webkit.org/show_bug.cgi?id=176425
672
673         Reviewed by Alex Christensen.
674
675         Introducing Cache::open to allow reading from the filesystem to fill the Cache.
676         This is called by Caches when engine requests to open an existing Cache.
677
678         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
679         (WebKit::CacheStorage::Cache::Cache):
680         (WebKit::CacheStorage::Cache::open):
681         (WebKit::CacheStorage::Cache::finishOpening):
682         (WebKit::CacheStorage::Cache::readRecordsList):
683         * NetworkProcess/cache/CacheStorageEngineCache.h:
684         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
685         (WebKit::CacheStorage::Caches::find):
686         (WebKit::CacheStorage::Caches::open):
687         (WebKit::CacheStorage::Caches::remove):
688         (WebKit::CacheStorage::Caches::readCachesFromDisk):
689         (WebKit::CacheStorage::Caches::find const): Deleted.
690         * NetworkProcess/cache/CacheStorageEngineCaches.h:
691
692 2017-09-06  Alex Christensen  <achristensen@webkit.org>
693
694         Unreviewed, rolling out r221694.
695
696         broke build
697
698         Reverted changeset:
699
700         "Add WKUIDelegatePrivate equivalent of WKPageUIClient's
701         pinnedStateDidChange"
702         https://bugs.webkit.org/show_bug.cgi?id=176474
703         http://trac.webkit.org/changeset/221694
704
705 2017-09-06  Ryan Haddad  <ryanhaddad@apple.com>
706
707         Unreviewed, rolling out r221461.
708
709         The LayoutTest added with this change crashes under
710         GuardMalloc.
711
712         Reverted changeset:
713
714         "Add (entirely incorrect) fetching of ServiceWorker scripts."
715         https://bugs.webkit.org/show_bug.cgi?id=176179
716         http://trac.webkit.org/changeset/221461
717
718 2017-09-06  Alex Christensen  <achristensen@webkit.org>
719
720         Add modern decoders for POD types
721         https://bugs.webkit.org/show_bug.cgi?id=176456
722
723         Reviewed by Geoffrey Garen.
724
725         * Platform/IPC/Decoder.cpp:
726         (IPC::Decoder::getOptional):
727         (IPC::Decoder::operator>>):
728         * Platform/IPC/Decoder.h:
729         * Shared/NavigationActionData.cpp:
730         (WebKit::NavigationActionData::decode):
731         * Shared/NavigationActionData.h:
732
733 2017-09-06  Alex Christensen  <achristensen@webkit.org>
734
735         Add WKUIDelegatePrivate equivalent of WKPageUIClient's pinnedStateDidChange
736         https://bugs.webkit.org/show_bug.cgi?id=176474
737         <rdar://problem/29270035>
738
739         Reviewed by Tim Horton.
740
741         Rather than telling the UIClient that the pinned state changed and having the application check 4 bools
742         like we do with WKPage, I made a KVO property on the WKWebView.  I introduce _WKRectEdge for this purpose,
743         which is like UIRectEdge but unfortunately NSRectEdge and CGRectEdge cannot be used as NS_OPTIONS/flags.
744         This same structure is used for rubber band state.
745         
746         Covered by a new API test.
747
748         * UIProcess/API/Cocoa/WKWebView.mm:
749         (-[WKWebView _pinnedState]):
750         (-[WKWebView _rubberBandState]):
751         (-[WKWebView _setRubberBandState:]):
752         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
753         * UIProcess/Cocoa/WebViewImpl.h:
754         * UIProcess/Cocoa/WebViewImpl.mm:
755         (WebKit::WebViewImpl::pinnedState):
756         (WebKit::WebViewImpl::rubberBandState):
757         (WebKit::WebViewImpl::setRubberBandState):
758         * UIProcess/PageClient.h:
759         (WebKit::PageClient::pinnedStateWillChange):
760         (WebKit::PageClient::pinnedStateDidChange):
761         * UIProcess/WebPageProxy.cpp:
762         (WebKit::WebPageProxy::didChangeScrollOffsetPinningForMainFrame):
763         * UIProcess/mac/PageClientImplMac.h:
764         * UIProcess/mac/PageClientImplMac.mm:
765         (WebKit::PageClientImpl::pinnedStateWillChange):
766         (WebKit::PageClientImpl::pinnedStateDidChange):
767
768 2017-09-06  Brent Fulgham  <bfulgham@apple.com>
769
770         Deny third-party cookie creation for prevalent resources without interaction
771         https://bugs.webkit.org/show_bug.cgi?id=175232
772         <rdar://problem/33709386>
773
774         Reviewed by Alex Christensen.
775
776         Prior to Intelligent Tracking Prevention, WebKit would deny the ability to create a third party cookie if the user's
777         settings prohibited it. Due to the internal mechanics of cookie partitioning, we now accept the third party cookie,
778         but destroy it at some arbitrary moment which is difficult for websites to work with.
779         
780         This patch revises WebKit so that attempts to set third party cookies without user interaction fails immediately,
781         which is what sites are expecting from Safari.
782
783         * NetworkProcess/NetworkProcess.cpp:
784         (WebKit::NetworkProcess::updatePrevalentDomainsWithAndWithoutInteraction):
785         (WebKit::NetworkProcess::updateCookiePartitioningForTopPrivatelyOwnedDomains): Renamed to updatePrevalentDomainsWithAndWithoutInteraction.
786         * NetworkProcess/NetworkProcess.h:
787         * NetworkProcess/NetworkProcess.messages.in: Renamed the UpdateCookiePartitioningForTopPrivatelyOwnedDomains message
788         to UpdatePrevalentDomainsWithAndWithoutInteraction.
789         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
790         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): Recognize cases where a network session should block cookies, and
791         use the stateless session so we fail immediately when attempting an invalid cookie set operation.
792         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
793         (WebKit::WKWebsiteDataStore::_resourceLoadStatisticsSetShouldPartitionCookies): Use new helper function to clear partitioning state.
794         * UIProcess/WebResourceLoadStatisticsStore.cpp:
795         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): Update for revised naming.
796         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning): Track domains with and without interaction so that we can recognize
797         domains that should be immediately blocked from setting cookies.
798         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains): Update for revised naming.
799         (WebKit::WebResourceLoadStatisticsStore::scheduleClearPartitioningStateForDomains): Added helper function for testing.
800         * UIProcess/WebResourceLoadStatisticsStore.h:
801         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
802         (WebKit::WebsiteDataStore::updatePrevalentDomainsWithAndWithoutInteraction): Update for revised naming.
803         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback): Ditto.
804         (WebKit::WebsiteDataStore::updateCookiePartitioningForTopPrivatelyOwnedDomains): Renamed to updatePrevalentDomainsWithAndWithoutInteraction.
805         * UIProcess/WebsiteData/WebsiteDataStore.h:
806
807 2017-09-06  Adrian Perez de Castro  <aperez@igalia.com>
808
809         [WPE][CMake] Fix path to the WebKitApplicationInfo.h header.
810
811         Unreviewed build fix.
812
813         This doesn't really make a difference for the build bots, but it makes
814         it possible to craft working release tarballs of WPE.
815
816         * PlatformWPE.cmake: Use the WPE version of WebKitApplicationInfo.h
817
818 2017-09-06  Frédéric Wang  <fwang@igalia.com>
819
820         Introduce ScrollingTreeScrollingNodeDelegateIOS to share code between overflow and frame scrolling
821         https://bugs.webkit.org/show_bug.cgi?id=174097
822
823         Reviewed by Darin Adler.
824
825         This patch introduces a new ScrollingTreeScrollingNodeDelegateIOS that can be used by
826         WKOverflowScrollViewDelegate to communicate to the scrolling tree and nodes. It can also be
827         used as a helper class by ScrollingTreeOverflowScrollingNodeIOS. For now, only the non-
828         overriden member functions of ScrollingTreeOverflowScrollingNodeIOS are moved to that new
829         class. In follow-up commits, WKOverflowScrollViewDelegate can become a generic
830         ScrollViewDelegate and more code can be moved into the ScrollingTreeScrollingNodeDelegateIOS
831         file. Frame scrolling nodes will then be able to share the same UI code as overflow:auto when
832         iOS frame scrolling is implemented (bug 149264).
833
834         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h: Move non-overriden member
835         functions and m_updatingFromStateNode into the delegate class. Also define a member to store
836         that delegate.
837         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: Use the node delegate to
838         communicate to the scrolling tree and node.
839         (-[WKOverflowScrollViewDelegate initWithScrollingTreeNodeDelegate:]): Init with a delegate.
840         (-[WKOverflowScrollViewDelegate scrollViewDidScroll:]): Call the delegate function.
841         (-[WKOverflowScrollViewDelegate scrollViewWillBeginDragging:]): Ditto.
842         (-[WKOverflowScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]):
843         Use the delegate functions or pass by ScrollingTreeScrollingNodeDelegateIOS::scrollingNode().
844         (-[WKOverflowScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]): Use the delegate
845         functions.
846         (-[WKOverflowScrollViewDelegate scrollViewDidEndDecelerating:]): Ditto.
847         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::ScrollingTreeOverflowScrollingNodeIOS):
848         Init the delegate for this class.
849         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateAfterChildren): Use the delegate.
850         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::setScrollLayerPosition): Use the delegate
851         function.
852         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterDelegatedScroll): Ditto.
853         (-[WKOverflowScrollViewDelegate initWithScrollingTreeNode:]): Deleted. This is renamed
854         initWithScrollingTreeNodeDelegate and accepts a delegate.
855         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateChildNodesAfterScroll): Deleted. Moved
856         to ScrollingTreeScrollingNodeDelegateIOS.
857         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::overflowScrollWillStart): Ditto.
858         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::overflowScrollDidEnd): Ditto.
859         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::overflowScrollViewWillStartPanGesture): Ditto.
860         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollViewDidScroll): Ditto.
861         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::currentSnapPointIndicesDidChange): Ditto.
862         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h: Added. New delegate class
863         for ScrollingTreeOverflowScrollingNodeIOS. The members used by WKOverflowScrollViewDelegate
864         are public and the others are private. ScrollingTreeOverflowScrollingNodeIOS is a friend of
865         ScrollingTreeScrollingNodeDelegateIOS so that it can access private members e.g.
866         updateChildNodesAfterScroll() or  m_updatingFromStateNode.
867         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm: Added.
868         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::ScrollingTreeScrollingNodeDelegateIOS):
869         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::~ScrollingTreeScrollingNodeDelegateIOS):
870         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateChildNodesAfterScroll): Code extracted
871         from ScrollingTreeOverflowScrollingNodeIOS.
872         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollWillStart): Ditto.
873         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollDidEnd): Ditto.
874         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollViewWillStartPanGesture): Ditto.
875         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollViewDidScroll): Ditto.
876         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::currentSnapPointIndicesDidChange): Ditto.
877         * WebKit.xcodeproj/project.pbxproj: Add ScrollingTreeScrollingNodeDelegateIOS files to the
878         build system.
879
880 2017-09-05  Wenson Hsieh  <wenson_hsieh@apple.com>
881
882         [iOS WK2] Add plumbing for WKContentView to ask the web process for additional drag items
883         https://bugs.webkit.org/show_bug.cgi?id=176348
884         Work towards <rdar://problem/31144674>
885
886         Reviewed by Tim Horton.
887
888         Adds boilerplate plumbing to request additional items to an existing session. This implements some UI-side logic
889         in WKContentView to send an additional drag items request and handle a response from the web process. 
890         To start, WebPageProxy::requestAdditionalItemsForDragSession is invoked by -_dragInteraction:
891         itemsForAddingToSession:withTouchAtPoint:completion: in WKContentView, and the response from the web process is
892         handled in -[WKContentView _didHandleAdditionalDragItemsRequest:].
893
894         * UIProcess/API/Cocoa/WKWebView.mm:
895         (-[WKWebView _simulateItemsForAddingToSession:atLocation:completion:]):
896         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
897
898         Add SPI to simulate a request for additional drag items. See Tools/ChangeLog for more detail.
899
900         * UIProcess/PageClient.h:
901         * UIProcess/WebPageProxy.h:
902         * UIProcess/WebPageProxy.messages.in:
903
904         Add an IPC message handler for the additional drag items response from the web process.
905
906         * UIProcess/ios/DragDropInteractionState.h:
907         (WebKit::DragDropInteractionState::BlockPtr<void):
908         * UIProcess/ios/DragDropInteractionState.mm:
909         (WebKit::DragDropInteractionState::shouldRequestAdditionalItemForDragSession const):
910         (WebKit::DragDropInteractionState::dragSessionWillRequestAdditionalItem):
911
912         Invoke the new additional items completion handler when tearing down to avoid getting UIKit into a bad state.
913
914         (WebKit::DragDropInteractionState::dragAndDropSessionsDidEnd):
915         * UIProcess/ios/PageClientImplIOS.h:
916         * UIProcess/ios/PageClientImplIOS.mm:
917         (WebKit::PageClientImpl::didHandleAdditionalDragItemsRequest):
918         * UIProcess/ios/WKContentViewInteraction.h:
919         * UIProcess/ios/WKContentViewInteraction.mm:
920         (-[WKContentView _didHandleAdditionalDragItemsRequest:]):
921         (-[WKContentView _itemsForBeginningOrAddingToSessionWithRegistrationList:stagedDragSource:]):
922
923         Factors common logic to convert a staged WebItemProviderRegistrationInfoList and DragSourceState into a list of
924         drag items, invoking the private UI delegate in the process. This is called both when starting a drag session,
925         and adding items to an existing drag session.
926
927         (-[WKContentView _dragInteraction:itemsForAddingToSession:withTouchAtPoint:completion:]):
928
929         Implements a (proposed) additional drag item delegate that serves as an asynchronous alternative to the API
930         variant, -_dragInteraction:itemsForAddingToSession:withTouchAtPoint:. See <rdar://problem/33146803> for more
931         information.
932
933         (-[WKContentView dragInteraction:itemsForBeginningSession:]):
934
935         Refactored to use -_itemsForBeginningOrAddingToSessionWithRegistrationList:stagedDragSource:.
936
937         (-[WKContentView _simulateItemsForAddingToSession:atLocation:completion:]):
938         * UIProcess/ios/WebPageProxyIOS.mm:
939         (WebKit::WebPageProxy::didHandleAdditionalDragItemsRequest):
940         (WebKit::WebPageProxy::requestAdditionalItemsForDragSession):
941         * WebProcess/WebPage/WebPage.h:
942         * WebProcess/WebPage/WebPage.messages.in:
943
944         Add an IPC message handler for the additional drag items request from the UI process.
945
946         * WebProcess/WebPage/ios/WebPageIOS.mm:
947         (WebKit::WebPage::requestAdditionalItemsForDragSession):
948
949 2017-09-05  Alex Christensen  <achristensen@webkit.org>
950
951         Add WKUIDelegatePrivate equivalent of WKPageUIClient's mouseDidMoveOverElement
952         https://bugs.webkit.org/show_bug.cgi?id=176428
953         <rdar://problem/29270035>
954
955         Reviewed by Tim Horton.
956
957         Covered by a new API test.
958
959         * UIProcess/API/APIUIClient.h:
960         (API::UIClient::mouseDidMoveOverElement):
961         * UIProcess/API/C/WKPage.cpp:
962         (WKPageSetPageUIClient):
963         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
964         * UIProcess/Cocoa/UIDelegate.h:
965         * UIProcess/Cocoa/UIDelegate.mm:
966         (WebKit::UIDelegate::setDelegate):
967         (WebKit::UIDelegate::ContextMenuClient::menuFromProposedMenu):
968         (WebKit::UIDelegate::UIClient::createNewPageCommon):
969         (WebKit::UIDelegate::UIClient::runJavaScriptAlert):
970         (WebKit::UIDelegate::UIClient::runJavaScriptConfirm):
971         (WebKit::UIDelegate::UIClient::runJavaScriptPrompt):
972         (WebKit::UIDelegate::UIClient::runBeforeUnloadConfirmPanel):
973         (WebKit::UIDelegate::UIClient::takeFocus):
974         (WebKit::UIDelegate::UIClient::focus):
975         (WebKit::UIDelegate::UIClient::unfocus):
976         (WebKit::UIDelegate::UIClient::didExceedBackgroundResourceLimitWhileInForeground):
977         (WebKit::UIDelegate::UIClient::didNotHandleWheelEvent):
978         (WebKit::toNSEventModifierFlags):
979         (WebKit::UIDelegate::UIClient::mouseDidMoveOverElement):
980         (WebKit::UIDelegate::UIClient::toolbarsAreVisible):
981         (WebKit::UIDelegate::UIClient::didClickAutoFillButton):
982         (WebKit::UIDelegate::UIClient::handleAutoplayEvent):
983         (WebKit::requestUserMediaAuthorizationForDevices):
984         (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
985         (WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin):
986         (WebKit::UIDelegate::UIClient::printFrame):
987         (WebKit::UIDelegate::UIClient::close):
988         (WebKit::UIDelegate::UIClient::fullscreenMayReturnToInline):
989         (WebKit::UIDelegate::UIClient::didEnterFullscreen):
990         (WebKit::UIDelegate::UIClient::didExitFullscreen):
991         (WebKit::UIDelegate::UIClient::requestPointerLock):
992         (WebKit::UIDelegate::UIClient::didLosePointerLock):
993         (WebKit::UIDelegate::UIClient::hasVideoInPictureInPictureDidChange):
994         * UIProcess/WebPageProxy.cpp:
995         (WebKit::WebPageProxy::mouseDidMoveOverElement):
996         * UIProcess/WebPageProxy.h:
997
998 2017-09-05  Brent Fulgham  <bfulgham@apple.com>
999
1000         Relax keychain access to permit users to permanently allow client certificates
1001         https://bugs.webkit.org/show_bug.cgi?id=175857
1002         <rdar://problem/32293867>
1003
1004         Reviewed by Alex Christensen.
1005
1006         Further relax the write permissions on the user's Keychain directory to support local certificates.
1007
1008         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
1009         * WebProcess/com.apple.WebProcess.sb.in:
1010
1011 2017-09-05  Youenn Fablet  <youenn@apple.com>
1012
1013         Cache Storage Engine should not mix different origin caches
1014         https://bugs.webkit.org/show_bug.cgi?id=176394
1015
1016         Reviewed by Alex Christensen.
1017
1018         * NetworkProcess/cache/CacheStorageEngine.cpp:
1019         (WebKit::CacheStorage::Engine::readCachesFromDisk): Initializing the salt before creating the Caches object
1020         so that its persistency path is correctly computed.
1021         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
1022         (WebKit::CacheStorage::cachesRootPath): Setting origin as partition string.
1023
1024 2017-09-05  Brent Fulgham  <bfulgham@apple.com>
1025
1026         Use a single network storage session for stateless connections
1027         https://bugs.webkit.org/show_bug.cgi?id=176386
1028         <rdar://problem/34262148>
1029
1030         Reviewed by Alex Christensen.
1031
1032         Change the name of 'm_dataTaskMapWithoutCredentials' to 'm_dataTaskMapWithoutState'
1033         to reflect that the data tasks do not involve credential or cookie storage. Ditto for
1034         the change from 'm_sessionWIthoutCredentialStorage' to 'm_statelessSession'.
1035
1036         This update should not change behavior, unless some stateless sessions were depending
1037         on cookies to be persistent (which would be a bug!)
1038
1039         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1040         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): Update for new variable names.
1041         (WebKit::NetworkDataTaskCocoa::~NetworkDataTaskCocoa): Ditto.
1042         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
1043         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1044         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): Update the configuration to block
1045         cookies as well.
1046         (WebKit::NetworkSessionCocoa::invalidateAndCancel): Update for new names.
1047         (WebKit::NetworkSessionCocoa::clearCredentials): Ditto.
1048         (WebKit::NetworkSessionCocoa::dataTaskForIdentifier): Ditto.
1049
1050 2017-09-05  Yousuke Kimoto  <yousuke.kimoto@sony.com>
1051
1052         [WinCairo] Add Network Process files for wincairo webkit
1053         https://bugs.webkit.org/show_bug.cgi?id=176069
1054
1055         Reviewed by Alex Christensen.
1056
1057         * NetworkProcess/Downloads/curl/DownloadCurl.cpp: Added.
1058         (WebKit::Download::resume):
1059         (WebKit::Download::platformDidFinish):
1060         (WebKit::Download::startNetworkLoadWithHandle):
1061         (WebKit::Download::startNetworkLoad):
1062         (WebKit::Download::platformInvalidate):
1063         * NetworkProcess/EntryPoint/win/NetworkProcessMain.cpp: Added.
1064         (main):
1065         * NetworkProcess/curl/NetworkProcessCurl.cpp: Added.
1066         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
1067         (WebKit::NetworkProcess::platformSetURLCacheSize):
1068         (WebKit::NetworkProcess::allowSpecificHTTPSCertificateForHost):
1069         (WebKit::NetworkProcess::clearCacheForAllOrigins):
1070         (WebKit::NetworkProcess::clearDiskCache):
1071         (WebKit::NetworkProcess::platformTerminate):
1072         * NetworkProcess/curl/RemoteNetworkingContextCurl.cpp: Added.
1073         (WebKit::RemoteNetworkingContext::~RemoteNetworkingContext):
1074         (WebKit::RemoteNetworkingContext::isValid const):
1075         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
1076         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
1077         (WebKit::RemoteNetworkingContext::storageSession const):
1078         (WebKit::RemoteNetworkingContext::blockedError const):
1079         * NetworkProcess/win/NetworkProcessMainWin.cpp: Added.
1080         (WebKit::NetworkProcessMainWin):
1081         * NetworkProcess/win/NetworkProcessMainWin.h: Added.
1082         * NetworkProcess/win/SystemProxyWin.cpp: Added.
1083         (WindowsSystemProxy::getSystemHttpProxy):
1084         (WindowsSystemProxy::setCurlHttpProxy):
1085         (WindowsSystemProxy::parseProxyString):
1086         * NetworkProcess/win/SystemProxyWin.h: Added.
1087         * PlatformWin.cmake:
1088
1089 2017-09-05  Youenn Fablet  <youenn@apple.com>
1090
1091         Allow retrieving Cache Storage records for a given URL only
1092         https://bugs.webkit.org/show_bug.cgi?id=176202
1093
1094         Reviewed by Alex Christensen.
1095
1096         Update CacheStorageEngineCache to store records as a map URL -> Vector of Records.
1097         This allows regular record retrieval to be faster.
1098         Retrieval of all records is less efficient but this should happen less often.
1099
1100         * NetworkProcess/cache/CacheStorageEngine.cpp:
1101         (WebKit::CacheStorage::Engine::retrieveRecords):
1102         * NetworkProcess/cache/CacheStorageEngine.h:
1103         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
1104         (WebKit::CacheStorage::queryCache):
1105         (WebKit::CacheStorage::Cache::retrieveRecords const):
1106         (WebKit::CacheStorage::computeKeyURL):
1107         (WebKit::CacheStorage::Cache::addNewURLRecord):
1108         (WebKit::CacheStorage::Cache::recordsFromURL):
1109         (WebKit::CacheStorage::Cache::recordsFromURL const):
1110         (WebKit::CacheStorage::Cache::put):
1111         (WebKit::CacheStorage::Cache::remove):
1112         * NetworkProcess/cache/CacheStorageEngineCache.h:
1113         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
1114         (WebKit::CacheStorageEngineConnection::retrieveRecords):
1115         * NetworkProcess/cache/CacheStorageEngineConnection.h:
1116         * NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
1117         * WebProcess/Cache/WebCacheStorageConnection.cpp:
1118         (WebKit::WebCacheStorageConnection::doRetrieveRecords):
1119         * WebProcess/Cache/WebCacheStorageConnection.h:
1120
1121 2017-09-05  Youenn Fablet  <youenn@apple.com>
1122
1123         WebKitTestRunner should set the cache storage directory path
1124         https://bugs.webkit.org/show_bug.cgi?id=176373
1125
1126         Reviewed by Chris Dumez.
1127
1128         * UIProcess/API/C/WKContextConfigurationRef.cpp:
1129         (WKContextConfigurationCopyCacheStorageDirectory):
1130         (WKContextConfigurationSetCacheStorageDirectory):
1131         * UIProcess/API/C/WKContextConfigurationRef.h:
1132
1133 2017-09-05  Alex Christensen  <achristensen@webkit.org>
1134
1135         Add WKUIDelegatePrivate equivalent of WKPageUIClient's unavailablePluginButtonClicked
1136         https://bugs.webkit.org/show_bug.cgi?id=176274
1137         <rdar://problem/29270035>
1138
1139         Reviewed by Darin Adler.
1140
1141         * UIProcess/API/APIUIClient.h:
1142         (API::UIClient::unavailablePluginButtonClicked):
1143         * UIProcess/API/C/WKPage.cpp:
1144         (WKPageSetPageUIClient):
1145         * UIProcess/API/Cocoa/WKPreferences.mm:
1146         (-[WKPreferences _setPluginsEnabled:]):
1147         (-[WKPreferences _pluginsEnabled]):
1148         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1149         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1150         * UIProcess/Cocoa/UIDelegate.h:
1151         * UIProcess/Cocoa/UIDelegate.mm:
1152         (WebKit::UIDelegate::setDelegate):
1153         (WebKit::toWKPluginUnavailabilityReason):
1154         (WebKit::UIDelegate::UIClient::unavailablePluginButtonClicked):
1155         * UIProcess/WebPageProxy.cpp:
1156         (WebKit::WebPageProxy::unavailablePluginButtonClicked):
1157
1158 2017-09-04  Alex Christensen  <achristensen@webkit.org>
1159
1160         Allow classes to have modern and legacy decoders to aid transition
1161         https://bugs.webkit.org/show_bug.cgi?id=176186
1162
1163         Reviewed by Zan Dobersek.
1164
1165         To illustrate this, I made legacy and modern decoders to WTF::String and transitioned one String decoder.
1166
1167         * Platform/IPC/ArgumentCoder.h:
1168         * Platform/IPC/ArgumentCoders.cpp:
1169         (IPC::ArgumentCoder<String>::decode):
1170         * Platform/IPC/ArgumentCoders.h:
1171         * Platform/IPC/Decoder.h:
1172         * Shared/WebPageCreationParameters.cpp:
1173         (WebKit::WebPageCreationParameters::decode):
1174
1175 2017-09-05  Frederic Wang  <fwang@igalia.com>
1176
1177         Use TilesBacking for iframes when async frame scrolling is enabled
1178         https://bugs.webkit.org/show_bug.cgi?id=173644
1179
1180         Reviewed by Simon Fraser.
1181
1182         This patch adds creation of TilesBacking for non-main frames when async frame scrolling is
1183         enabled. RenderLayerBacking::m_isMainFrameLayerWithTiledBacking is also renamed to reflect
1184         that tiled backing is not exclusive to the main frame. More adjustments might be needed for
1185         non-main frames and will be handled in follow-up commits.
1186
1187         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
1188         (WebKit::RemoteLayerTreeDrawingArea::shouldUseTiledBackingForFrameView): Also use tiled
1189         backing when asyncFrameScrollingEnabled is true.
1190         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1191         (WebKit::TiledCoreAnimationDrawingArea::shouldUseTiledBackingForFrameView): Ditto.
1192
1193 2017-09-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1194
1195         [GTK] Rename PLUGIN_ARCHITECTURE(X11) as PLUGIN_ARCHITECTURE(UNIX)
1196         https://bugs.webkit.org/show_bug.cgi?id=176330
1197
1198         Reviewed by Michael Catanzaro.
1199
1200         It's no longer X11 specific since it's also used in Wayland when the X11 target is enabled. It should be renamed
1201         as UNIX and make it available when building the wayland target even if the X11 on is disabled.
1202
1203         * PlatformGTK.cmake:
1204         * PlatformWPE.cmake:
1205         * PluginProcess/unix/PluginProcessMainUnix.cpp:
1206         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
1207         (WebKit::NetscapePluginModule::tryLoad):
1208         * Shared/Plugins/Netscape/NetscapePluginModule.h:
1209         * Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp: Renamed from Source/WebKit/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp.
1210         * UIProcess/Plugins/PluginProcessProxy.h:
1211         * UIProcess/Plugins/gtk/PluginInfoCache.cpp:
1212         (WebKit::PluginInfoCache::getPluginInfo):
1213         (WebKit::PluginInfoCache::updatePluginInfo):
1214         * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
1215         (WebKit::PluginProcessProxy::scanPlugin):
1216         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
1217         (WebKit::NPN_InvalidateRect):
1218         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
1219         (WebKit::NetscapePlugin::initialize):
1220         (WebKit::NetscapePlugin::destroy):
1221         (WebKit::NetscapePlugin::geometryDidChange):
1222         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
1223         * WebProcess/Plugins/Netscape/unix/NetscapePluginUnix.cpp:
1224         * WebProcess/Plugins/Netscape/unix/NetscapePluginUnix.h:
1225         * config.h:
1226
1227 2017-09-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1228
1229         [GTK] Wrong use of PLUGIN_ARCHITECTURE(X11) in several places
1230         https://bugs.webkit.org/show_bug.cgi?id=176329
1231
1232         Reviewed by Michael Catanzaro.
1233
1234         We are using PLUGIN_ARCHITECTURE(X11) in several places where we should actually be using PLATFORM(X11). This is
1235         confusing because PLUGIN_ARCHITECTURE(X11) is no longer specific to X11, it will be renamed as UNIX in a follow
1236         up patch. Because of this we only support plugins in Wayland when building with both X11 and Wayland targets
1237         enabled.
1238
1239         * PluginProcess/PluginControllerProxy.cpp:
1240         * PluginProcess/PluginControllerProxy.h:
1241         * PluginProcess/unix/PluginProcessMainUnix.cpp:
1242         * Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp:
1243         (WebKit::NetscapePluginModule::determineQuirks):
1244         * Shared/Plugins/PluginQuirks.h:
1245         * UIProcess/WebPageProxy.h:
1246         * UIProcess/WebPageProxy.messages.in:
1247         * UIProcess/gtk/WebPageProxyGtk.cpp:
1248         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
1249         (WebKit::NPN_GetValue):
1250         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
1251         (WebKit::NetscapePlugin::shouldLoadSrcURL):
1252         (WebKit::NetscapePlugin::initialize):
1253         * WebProcess/Plugins/Netscape/unix/NetscapePluginUnix.cpp:
1254         (WebKit::NetscapePlugin::platformHandleMouseEvent):
1255         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
1256         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.h:
1257         * WebProcess/Plugins/PluginController.h:
1258         * WebProcess/Plugins/PluginProxy.cpp:
1259         * WebProcess/Plugins/PluginProxy.h:
1260         * WebProcess/Plugins/PluginProxy.messages.in:
1261         * WebProcess/Plugins/PluginView.cpp:
1262         * WebProcess/Plugins/PluginView.h:
1263
1264 2017-09-04  Wenson Hsieh  <wenson_hsieh@apple.com>
1265
1266         [iOS DnD] Refactor drag and drop logic in WKContentView in preparation for supporting multiple drag items in a drag session
1267         https://bugs.webkit.org/show_bug.cgi?id=176264
1268         <rdar://problem/31144674>
1269
1270         Reviewed by Darin Adler.
1271
1272         Move DataInteractionState from WKContentViewInteraction.h to DragDropInteractionState.h, and also rename it to
1273         DragDropInteractionState. Additionally, refactor drag and drop state in the UI process to capture metadata about
1274         the dragged element in a separate DragSourceState struct. This patch also moves drag and drop state transition
1275         logic that doesn't involve WKContentView internals out of WKContentView, and into the implementation of
1276         DragDropInteractionState.
1277
1278         To support multiple drag items per session, we also introduce a simple mechanism to trace a UIDragItem back to
1279         the DragSourceState used to generate it. When generating a DragSourceState, we assign it a unique identifier,
1280         which we also set as the privateLocalContext of all UIDragItems generated when beginning the drag (this
1281         includes drag items returned by an internal client that uses one of the SPI hooks to augment drag items when
1282         starting a drag). This is subsequently used in the implementation of lift and cancellation preview delegate
1283         methods to supply the appropriate drag preview for each UIDragItem.
1284
1285         Lastly, fix a bug wherein the pageX and pageY of mouse drag events are inconsistent with other synthetic mouse
1286         events, such as synthetic clicks. For synthetic clicks, the PlatformMouseEvent is initialized with the same
1287         position and globalPosition. Whether this is really intended is unclear (see http://webkit.org/b/173855), but
1288         it's a trivial change for now to keep mouse events on iOS consistent by tweaking the behavior during drag and
1289         drop. See Tools/ChangeLog for some more information.
1290
1291         * Platform/spi/ios/UIKitSPI.h:
1292
1293         Add -[UIDragItem privateLocalContext].
1294
1295         * UIProcess/ios/DragDropInteractionState.h: Added.
1296         (WebKit::DragDropInteractionState::stagedDragSource const):
1297         (WebKit::DragDropInteractionState::dropSessionDidExit):
1298         (WebKit::DragDropInteractionState::dropSessionWillPerformDrop):
1299         (WebKit::DragDropInteractionState::adjustedPositionForDragEnd const):
1300         (WebKit::DragDropInteractionState::didBeginDragging const):
1301         (WebKit::DragDropInteractionState::isPerformingDrop const):
1302         (WebKit::DragDropInteractionState::dragSession const):
1303         (WebKit::DragDropInteractionState::dropSession const):
1304
1305         Wrap private drag/drop state member variables behind const getters, and move drag and drop logic that involves
1306         only the DragDropInteractionState into helper methods on DragDropInteractionState.
1307
1308         (WebKit::DragDropInteractionState::BlockPtr<void):
1309         * UIProcess/ios/DragDropInteractionState.mm: Added.
1310         (WebKit::dragItemMatchingIdentifier):
1311         (WebKit::createTargetedDragPreview):
1312         (WebKit::uiImageForImage):
1313
1314         Move drag preview creation logic here, from WKContentViewInteraction.mm.
1315
1316         (WebKit::shouldUseTextIndicatorToCreatePreviewForDragAction):
1317         (WebKit::DragDropInteractionState::activeDragSourceForItem const):
1318         (WebKit::DragDropInteractionState::anyActiveDragSourceIs const):
1319         (WebKit::DragDropInteractionState::prepareForDragSession):
1320         (WebKit::DragDropInteractionState::dragSessionWillBegin):
1321         (WebKit::DragDropInteractionState::previewForDragItem const):
1322         (WebKit::DragDropInteractionState::dragSessionWillDelaySetDownAnimation):
1323         (WebKit::DragDropInteractionState::dropSessionDidEnterOrUpdate):
1324         (WebKit::DragDropInteractionState::stageDragItem):
1325         (WebKit::DragDropInteractionState::hasStagedDragSource const):
1326         (WebKit::DragDropInteractionState::clearStagedDragSource):
1327         (WebKit::DragDropInteractionState::dragAndDropSessionsDidEnd):
1328         (WebKit::DragDropInteractionState::updatePreviewsForActiveDragSources):
1329         * UIProcess/ios/WKContentViewInteraction.h:
1330
1331         Move drag-and-drop-related state tied to the WKContentView here, from DataInteractionState (for instance, the
1332         UIView for the drop caret, the WKContentView snapshot when dropping, and a flag use to keep track of hiding the
1333         callout bar when dragging a text selection).
1334
1335         (): Deleted.
1336         * UIProcess/ios/WKContentViewInteraction.mm:
1337         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]):
1338         (-[WKContentView actionSheetAssistant:showCustomSheetForElement:]):
1339         (-[WKContentView _didChangeDragInteractionPolicy]):
1340         (-[WKContentView setupDataInteractionDelegates]):
1341         (-[WKContentView teardownDataInteractionDelegates]):
1342         (-[WKContentView _startDrag:item:]):
1343         (-[WKContentView _didHandleStartDataInteractionRequest:]):
1344         (-[WKContentView computeClientAndGlobalPointsForDropSession:outClientPoint:outGlobalPoint:]):
1345         (-[WKContentView cleanUpDragSourceSessionState]):
1346         (-[WKContentView _didConcludeEditDataInteraction:]):
1347         (-[WKContentView _didPerformDataInteractionControllerOperation:]):
1348         (-[WKContentView _didChangeDataInteractionCaretRect:currentRect:]):
1349         (-[WKContentView currentDragOrDropSession]):
1350         (-[WKContentView _restoreCalloutBarIfNeeded]):
1351         (-[WKContentView _dragInteraction:prepareForSession:completion:]):
1352         (-[WKContentView dragInteraction:itemsForBeginningSession:]):
1353         (-[WKContentView dragInteraction:previewForLiftingItem:session:]):
1354         (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
1355         (-[WKContentView dragInteraction:sessionWillBegin:]):
1356         (-[WKContentView dragInteraction:session:didEndWithOperation:]):
1357         (-[WKContentView dragInteraction:previewForCancellingItem:withDefault:]):
1358         (-[WKContentView _dragInteraction:item:shouldDelaySetDownAnimationWithCompletion:]):
1359         (-[WKContentView dragInteraction:item:willAnimateCancelWithAnimator:]):
1360         (-[WKContentView dropInteraction:sessionDidEnter:]):
1361         (-[WKContentView dropInteraction:sessionDidUpdate:]):
1362         (-[WKContentView dropInteraction:sessionDidExit:]):
1363         (-[WKContentView dropInteraction:performDrop:]):
1364         (-[WKContentView dropInteraction:sessionDidEnd:]):
1365
1366         Pull out logic that mutates drag and drop state into DragDropInteractionState. Adjust places that previously
1367         accessed DataInteractionState's members directly with corresponding getters in DragDropInteractionState.
1368
1369         (-[WKContentView _simulateDataInteractionEntered:]):
1370         (-[WKContentView _simulateDataInteractionUpdated:]):
1371         (-[WKContentView _simulateDataInteractionEnded:]):
1372         (-[WKContentView _simulateDataInteractionPerformOperation:]):
1373         (-[WKContentView _simulateDataInteractionSessionDidEnd:]):
1374         (-[WKContentView _simulateWillBeginDataInteractionWithSession:]):
1375         (-[WKContentView _simulatedItemsForSession:]):
1376         (-[WKContentView _simulatePrepareForDataInteractionSession:completion:]):
1377
1378         Rename _dataInteraction => _dragInteraction and _dataOperation => _dropInteraction.
1379
1380         (uiImageForImage): Deleted.
1381         (shouldUseTextIndicatorToCreatePreviewForDragAction): Deleted.
1382         (-[WKContentView dragPreviewForImage:frameInRootViewCoordinates:clippingRectsInFrameCoordinates:backgroundColor:]): Deleted.
1383         (-[WKContentView dragPreviewForCurrentDataInteractionState]): Deleted.
1384         (-[WKContentView _transitionDragPreviewToImageIfNecessary:]): Deleted.
1385         * WebKit.xcodeproj/project.pbxproj:
1386
1387 2017-09-03  Carlos Garcia Campos  <cgarcia@igalia.com>
1388
1389         [Threaded Compositor] Deadlock in ThreadedDisplayRefreshMonitor
1390         https://bugs.webkit.org/show_bug.cgi?id=176296
1391
1392         Reviewed by Žan Doberšek.
1393
1394         The main thread tries to schedule a display refresh monitor from RAF, requestDisplayRefreshMonitorUpdate() tries
1395         to take the attributes lock to update coordinateUpdateCompletionWithClient. The compositing thread has finished
1396         a frame and sceneUpdateFinished() takes the attributes lock to update clientRendersNextFrame and then asks the
1397         display refresh monitor if it requires a new callback. ThreadedDisplayRefreshMonitor::requiresDisplayRefreshCallback()
1398         takes its lock to check the state, and requestDisplayRefreshMonitorUpdate() was called by
1399         ThreadedDisplayRefreshMonitor::requestRefreshCallback() with the display refresh monitor lock taken. So,
1400         the compositing thread has the attributes lock and wants the display refresh monitor one, and main thread has the
1401         display refresh monitor lock and wants the attributes one.
1402
1403         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp:
1404         (WebKit::ThreadedDisplayRefreshMonitor::requestRefreshCallback): Release the mutex before calling
1405         ThreadedCompositor::requestDisplayRefreshMonitorUpdate().
1406
1407 2017-09-03  Zan Dobersek  <zdobersek@igalia.com>
1408
1409         [GTK] Libgcrypt warning: missing initialization - please fix the application
1410         https://bugs.webkit.org/show_bug.cgi?id=171230
1411
1412         Reviewed by Michael Catanzaro.
1413
1414         Replicate the libgcrypt initialization in the NetworkProcess entrypoint.
1415         This is required due to libgcrypt being used through digest operations
1416         originating from the certificate hash computation in SoupNetworkSession.
1417
1418         The initialization is moved to the PAL library, and the initialize()
1419         function is now leveraged in both NetworkProcess and WebProcess entrypoints.
1420
1421         * NetworkProcess/EntryPoint/unix/NetworkProcessMain.cpp:
1422         (main):
1423         * WebProcess/EntryPoint/unix/WebProcessMain.cpp:
1424         (main):
1425
1426 2017-09-03  Zan Dobersek  <zdobersek@igalia.com>
1427
1428         [WPE] Use the device scale factor value in WebPageCreationParameters
1429         https://bugs.webkit.org/show_bug.cgi?id=175377
1430
1431         Reviewed by Michael Catanzaro.
1432
1433         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
1434         (WebKit::AcceleratedDrawingArea::AcceleratedDrawingArea):
1435         WebPageCreationParameters::deviceScaleFactor value should be used
1436         to set the device scale factor on the given WebPage object. This
1437         enables correctly leveraging the scale factor for the WPE port
1438         which enters accelerated mode unconditionally and as such doesn't
1439         wait for the backing store update that would provide that value
1440         otherwise.
1441
1442 2017-09-03  Brent Fulgham  <bfulgham@apple.com>
1443
1444         [WK2][iOS] Remove unnecessary IOHIDEventServiceFastPathUserClient access
1445         https://bugs.webkit.org/show_bug.cgi?id=175947
1446         <rdar://problem/33353627>
1447
1448         Reviewed by Darin Adler.
1449
1450         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1451
1452 2017-09-03  Dan Bernstein  <mitz@apple.com>
1453
1454         WKContentViewInteraction.mm includes redundant declaration of UIPreviewItemController's presentationSecondaryGestureRecognizer
1455         https://bugs.webkit.org/show_bug.cgi?id=176322
1456
1457         Reviewed by Darin Adler.
1458
1459         * UIProcess/ios/WKContentViewInteraction.mm: Removed the declaration, which is already made in the
1460           SDK or in UIKitSPI.h.
1461
1462 2017-09-03  Timothy Horton  <timothy_horton@apple.com>
1463
1464         Try to fix the iOS build
1465
1466         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
1467         (-[WKRemoteView initWithFrame:contextID:]):
1468
1469 2017-09-03  Tim Horton  <timothy_horton@apple.com>
1470
1471         Fix some style issues in the Remote Layer Tree code
1472         https://bugs.webkit.org/show_bug.cgi?id=176298
1473
1474         Reviewed by Dan Bernstein.
1475
1476         In bugs 176273 and 176297, the style bot noticed some existing style
1477         issues in the UI-side compositing code. Fix them, because there aren't
1478         many and they're straightforward.
1479
1480         * Shared/RemoteLayerTree/RemoteLayerBackingStore.h:
1481         * Shared/RemoteLayerTree/RemoteLayerBackingStoreCollection.h:
1482         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
1483         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.h:
1484         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
1485         * UIProcess/RemoteLayerTree/RemoteLayerTreeScrollingPerformanceData.h:
1486         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
1487         * UIProcess/RemoteLayerTree/RemoteScrollingTree.h:
1488         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
1489         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
1490
1491 2017-09-03  Yusuke Suzuki  <utatane.tea@gmail.com>
1492
1493         String#utf8() allocates new CString
1494         https://bugs.webkit.org/show_bug.cgi?id=176302
1495
1496         Reviewed by Sam Weinig.
1497
1498         * NetworkProcess/webrtc/NetworkRTCSocket.cpp:
1499         (WebKit::NetworkRTCSocket::sendTo):
1500
1501 2017-09-03  Tim Horton  <timothy_horton@apple.com>
1502
1503         Move shared part of the Remote Layer Tree code out of a Mac-specific directory
1504         https://bugs.webkit.org/show_bug.cgi?id=176297
1505
1506         Reviewed by Dan Bernstein.
1507
1508         UI-side compositing works on all Cocoa platforms, so the code should
1509         not live inside Mac/. Also merge the Scrolling directory in here,
1510         since those files are very related.
1511
1512         * PlatformMac.cmake:
1513         * Shared/RemoteLayerTree/RemoteLayerBackingStore.h: Renamed from Shared/mac/RemoteLayerBackingStore.h.
1514         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm: Renamed from Shared/mac/RemoteLayerBackingStore.mm.
1515         * Shared/RemoteLayerTree/RemoteLayerBackingStoreCollection.h: Renamed from Shared/mac/RemoteLayerBackingStoreCollection.h.
1516         * Shared/RemoteLayerTree/RemoteLayerBackingStoreCollection.mm: Renamed from Shared/mac/RemoteLayerBackingStoreCollection.mm.
1517         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.h: Renamed from Shared/mac/RemoteLayerTreePropertyApplier.h.
1518         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm: Renamed from Shared/mac/RemoteLayerTreePropertyApplier.mm.
1519         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h: Renamed from Shared/mac/RemoteLayerTreeTransaction.h.
1520         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm: Renamed from Shared/mac/RemoteLayerTreeTransaction.mm.
1521         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp: Renamed from Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp.
1522         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.h: Renamed from Shared/Scrolling/RemoteScrollingCoordinatorTransaction.h.
1523         * WebKit.xcodeproj/project.pbxproj:
1524
1525 2017-09-03  Sam Weinig  <sam@webkit.org>
1526
1527         Remove CanvasProxy
1528         https://bugs.webkit.org/show_bug.cgi?id=176288
1529
1530         Reviewed by Yusuke Suzuki.
1531
1532         CanvasProxy does not appear to be in any current HTML spec
1533         and was disabled and unimplemented in our tree. Time to 
1534         get rid of it.
1535
1536         * Configurations/FeatureDefines.xcconfig:
1537
1538 2017-09-02  Andy Estes  <aestes@apple.com>
1539
1540         [CA] Upstream QuartzCore-related WebKitSystemInterface functions
1541         https://bugs.webkit.org/show_bug.cgi?id=176270
1542
1543         Reviewed by Tim Horton.
1544
1545         * Platform/mac/LayerHostingContext.mm:
1546         (WebKit::LayerHostingContext::createForPort):
1547         (WebKit::LayerHostingContext::createForExternalHostingProcess):
1548         * UIProcess/mac/PageClientImpl.mm:
1549         (WebKit::PageClientImpl::enterAcceleratedCompositingMode):
1550         (WebKit::PageClientImpl::updateAcceleratedCompositingMode):
1551         * UIProcess/mac/RemoteLayerTreeHost.mm:
1552         (WebKit::RemoteLayerTreeHost::createLayer):
1553         * WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm:
1554         (WebKit::makeRenderLayer):
1555         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
1556         (InitWebCoreSystemInterface):
1557
1558 2017-09-02  Tim Horton  <timothy_horton@apple.com>
1559
1560         Move UI Process part of the Remote Layer Tree code out of a Mac-specific directory
1561         https://bugs.webkit.org/show_bug.cgi?id=176273
1562
1563         Reviewed by Dan Bernstein.
1564
1565         UI-side compositing works on all Cocoa platforms, so the code should
1566         not live inside Mac/. Also merge the Scrolling directory in here,
1567         since those files are very related.
1568
1569         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h: Renamed from SourceebKit/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h.
1570         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.messages.in: Renamed from UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.messages.in.
1571         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm: Renamed from UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm.
1572         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h: Renamed from UIProcess/mac/RemoteLayerTreeHost.h.
1573         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm: Renamed from UIProcess/mac/RemoteLayerTreeHost.mm.
1574         * UIProcess/RemoteLayerTree/RemoteLayerTreeScrollingPerformanceData.h: Renamed from UIProcess/Cocoa/RemoteLayerTreeScrollingPerformanceData.h.
1575         * UIProcess/RemoteLayerTree/RemoteLayerTreeScrollingPerformanceData.mm: Renamed from UIProcess/Cocoa/RemoteLayerTreeScrollingPerformanceData.mm.
1576         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp: Renamed from UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp.
1577         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h: Renamed from UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h.
1578         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp: Renamed from UIProcess/Scrolling/RemoteScrollingTree.cpp.
1579         * UIProcess/RemoteLayerTree/RemoteScrollingTree.h: Renamed from UIProcess/Scrolling/RemoteScrollingTree.h.
1580         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm: Renamed from UIProcess/ios/RemoteLayerTreeHostIOS.mm.
1581         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm: Renamed from UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm.
1582         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h: Renamed from UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h.
1583         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: Renamed from UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm.
1584         * WebKit.xcodeproj/project.pbxproj:
1585
1586 2017-09-02  Joseph Pecoraro  <pecoraro@apple.com>
1587
1588         Web Automation: -[_WKAutomationSession init] leaks
1589         https://bugs.webkit.org/show_bug.cgi?id=176268
1590
1591         Reviewed by Darin Adler.
1592
1593         * UIProcess/API/Cocoa/_WKAutomationSession.mm:
1594         (-[_WKAutomationSession init]):
1595
1596 2017-09-02  Tim Horton  <timothy_horton@apple.com>
1597
1598         Fix some style issues in the Web Process part of the Remote Layer Tree code
1599         https://bugs.webkit.org/show_bug.cgi?id=176272
1600
1601         Reviewed by Dan Bernstein.
1602
1603         In bug 176271, the style bot noticed some existing style issues in the UI-side
1604         compositing code. Fix them, because there aren't many and they're straightforward.
1605
1606         * WebProcess/WebPage/Cocoa/RemoteLayerTree/GraphicsLayerCARemote.cpp:
1607         * WebProcess/WebPage/Cocoa/RemoteLayerTree/PlatformCAAnimationRemote.h:
1608         * WebProcess/WebPage/Cocoa/RemoteLayerTree/PlatformCAAnimationRemote.mm:
1609         (WebKit::PlatformCAAnimationRemote::setValues):
1610         * WebProcess/WebPage/Cocoa/RemoteLayerTree/PlatformCALayerRemote.cpp:
1611         (WebKit::PlatformCALayerRemote::appendSublayer):
1612         (WebKit::PlatformCALayerRemote::insertSublayer):
1613         (WebKit::PlatformCALayerRemote::replaceSublayer):
1614         * WebProcess/WebPage/Cocoa/RemoteLayerTree/PlatformCALayerRemote.h:
1615         * WebProcess/WebPage/Cocoa/RemoteLayerTree/PlatformCALayerRemoteCustom.mm:
1616         (WebKit::PlatformCALayerRemoteCustom::clone const):
1617         * WebProcess/WebPage/Cocoa/RemoteLayerTree/PlatformCALayerRemoteTiledBacking.h:
1618         * WebProcess/WebPage/Cocoa/RemoteLayerTree/RemoteLayerTreeContext.h:
1619         * WebProcess/WebPage/Cocoa/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
1620         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
1621         * WebProcess/WebPage/Cocoa/RemoteLayerTree/RemoteScrollingCoordinator.h:
1622         * WebProcess/WebPage/Cocoa/RemoteLayerTree/RemoteScrollingCoordinator.mm:
1623
1624 2017-09-02  Tim Horton  <timothy_horton@apple.com>
1625
1626         Move Web Process part of the Remote Layer Tree code out of a Mac-specific directory
1627         https://bugs.webkit.org/show_bug.cgi?id=176271
1628
1629         Rubber-stamped by Dan Bernstein.
1630
1631         UI-side compositing works on all Cocoa platforms, so the code should
1632         not live inside Mac/. Also merge the Scrolling directory in here,
1633         since those files are very related.
1634
1635         * WebKit.xcodeproj/project.pbxproj:
1636         * DerivedSources.make:
1637         * PlatformMac.cmake:
1638         * WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.cpp: Renamed from WebProcess/WebPage/mac/GraphicsLayerCARemote.cpp.
1639         * WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.h: Renamed from WebProcess/WebPage/mac/GraphicsLayerCARemote.h.
1640         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.h: Renamed from WebProcess/WebPage/mac/PlatformCAAnimationRemote.h.
1641         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm: Renamed from WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm.
1642         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp: Renamed from WebProcess/WebPage/mac/PlatformCALayerRemote.cpp.
1643         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h: Renamed from WebProcess/WebPage/mac/PlatformCALayerRemote.h.
1644         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.h: Renamed from WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h.
1645         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm: Renamed from WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm.
1646         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteTiledBacking.cpp: Renamed from WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp.
1647         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteTiledBacking.h: Renamed from WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h.
1648         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h: Renamed from WebProcess/WebPage/mac/RemoteLayerTreeContext.h.
1649         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm: Renamed from WebProcess/WebPage/mac/RemoteLayerTreeContext.mm.
1650         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.h: Renamed from WebProcess/WebPage/Cocoa/RemoteLayerTreeDisplayRefreshMonitor.h.
1651         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm: Renamed from WebProcess/WebPage/Cocoa/RemoteLayerTreeDisplayRefreshMonitor.mm.
1652         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h: Renamed from WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h.
1653         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm: Renamed from WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm.
1654         * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.h: Renamed from WebProcess/Scrolling/RemoteScrollingCoordinator.h.
1655         * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.messages.in: Renamed from WebProcess/Scrolling/RemoteScrollingCoordinator.messages.in.
1656         * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm: Renamed from WebProcess/Scrolling/RemoteScrollingCoordinator.mm.
1657
1658 2017-09-02  Carlos Garcia Campos  <cgarcia@igalia.com>
1659
1660         [GTK][Wayland] Use fast malloc to allocate backing store cairo surfaces data
1661         https://bugs.webkit.org/show_bug.cgi?id=176226
1662
1663         Reviewed by Michael Catanzaro.
1664
1665         Do not create the cairo surface for BackingStoreBackendCairoImpl. When not using X11 we are going to use an
1666         image surface anyway, so we don't really need to use the create similar. This way we only need to pass the size
1667         and device scale factor to BackingStoreBackendCairoImpl that will create the image surface using fast malloc to
1668         allocate the data.
1669
1670         * UIProcess/cairo/BackingStoreCairo.cpp:
1671         (WebKit::BackingStore::createBackend):
1672
1673 2017-09-02  Carlos Garcia Campos  <cgarcia@igalia.com>
1674
1675         [GTK][Wayland] Opening FedoraProject's pastebin chews CPU
1676         https://bugs.webkit.org/show_bug.cgi?id=175942
1677
1678         Reviewed by Žan Doberšek.
1679
1680         This regressed when we introduced the display refresh monitor. The monitor schedules updates immediately,
1681         because we removed the option to not do frame sync in X11 to let swapBuffers do the throttling, but that's
1682         not happening in Wayland because the nested compositor is dispatching frame callbacks on surface commit.
1683         We need to ensure that frame callbacks are dispatched on every monitor refresh, because swapBuffers waits for
1684         frame callbacks to be queued on display.
1685
1686         * UIProcess/gtk/WaylandCompositor.cpp:
1687         (WebKit::WaylandCompositor::Surface::~Surface): Destroy pending frame callbacks too.
1688         (WebKit::WaylandCompositor::Surface::setWebPage): Add a tick callback to the web view widget to flush all
1689         committed frame callbacks on every frame update.
1690         (WebKit::WaylandCompositor::Surface::requestFrame): Add the callbacks to m_pendingFrameCallbackList.
1691         (WebKit::WaylandCompositor::Surface::flushFrameCallbacks): Dispatch all committed frame callabcks.
1692         (WebKit::WaylandCompositor::Surface::flushPendingFrameCallbacks): Dispatch all pending frame callbacks.
1693         (WebKit::WaylandCompositor::Surface::commit): Do not dispatch frame callbacks here, move them to the list of
1694         committed frame callbacks that will be dispatched on the next frame clock update.
1695         * UIProcess/gtk/WaylandCompositor.h:
1696         (WebKit::WaylandCompositor::Surface::setWebPage): Moved to the cpp.
1697         * WebProcess/WebPage/gtk/AcceleratedSurfaceWayland.cpp:
1698         (WebKit::AcceleratedSurfaceWayland::AcceleratedSurfaceWayland): Move surface initialization and destruction to
1699         the compositing thread.
1700         (WebKit::AcceleratedSurfaceWayland::initialize):
1701         (WebKit::AcceleratedSurfaceWayland::finalize):
1702         (WebKit::AcceleratedSurfaceWayland::~AcceleratedSurfaceWayland): Deleted.
1703         * WebProcess/WebPage/gtk/AcceleratedSurfaceWayland.h:
1704
1705 2017-09-01  Youenn Fablet  <youenn@apple.com>
1706
1707         Do not Reject CacheStorage promises when updating the persistent filesystem data fails
1708         https://bugs.webkit.org/show_bug.cgi?id=176241
1709
1710         Reviewed by Alex Christensen.
1711
1712         Open/Remove caches may succeed in the memory representation but the write-to-disk operation may fail.
1713         In that case, the callback does not return an error but a value containing the cache identifier.
1714         The value will also contain a boolean flag set to true to notify the client that persistent storage failed this time.
1715
1716         * NetworkProcess/cache/CacheStorageEngine.cpp:
1717         (WebKit::CacheStorage::Engine::open):
1718         (WebKit::CacheStorage::Engine::remove):
1719         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
1720         (WebKit::CacheStorage::Caches::open):
1721         (WebKit::CacheStorage::Caches::remove):
1722         * NetworkProcess/cache/CacheStorageEngineCaches.h:
1723
1724 2017-09-01  Alex Christensen  <achristensen@webkit.org>
1725
1726         Add WKUIDelegatePrivate equivalent of WKPageUIClient's toolbarsAreVisible
1727         https://bugs.webkit.org/show_bug.cgi?id=176246
1728         <rdar://problem/29270035>
1729
1730         Reviewed by Tim Horton.
1731
1732         * UIProcess/API/APIUIClient.h:
1733         (API::UIClient::toolbarsAreVisible):
1734         * UIProcess/API/C/WKPage.cpp:
1735         (WKPageSetPageUIClient):
1736         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1737         * UIProcess/Cocoa/UIDelegate.h:
1738         * UIProcess/Cocoa/UIDelegate.mm:
1739         (WebKit::UIDelegate::setDelegate):
1740         (WebKit::UIDelegate::UIClient::toolbarsAreVisible):
1741         * UIProcess/WebPageProxy.cpp:
1742         (WebKit::WebPageProxy::getToolbarsAreVisible):
1743         * UIProcess/WebPageProxy.h:
1744         * UIProcess/WebPageProxy.messages.in:
1745
1746 2017-09-01  Alex Christensen  <achristensen@webkit.org>
1747
1748         Make PageClientImplCocoa a proper superclass of PageClientImpls for Mac and iOS
1749         https://bugs.webkit.org/show_bug.cgi?id=176239
1750
1751         Reviewed by Tim Horton.
1752
1753         * UIProcess/Cocoa/PageClientImplCocoa.h: Added.
1754         (WebKit::PageClientImplCocoa::PageClientImplCocoa):
1755         * UIProcess/Cocoa/PageClientImplCocoa.mm:
1756         (WebKit::PageClientImplCocoa::isPlayingAudioWillChange):
1757         (WebKit::PageClientImplCocoa::isPlayingAudioDidChange):
1758         (WebKit::PageClientImpl::isPlayingAudioWillChange): Deleted.
1759         (WebKit::PageClientImpl::isPlayingAudioDidChange): Deleted.
1760         * UIProcess/Cocoa/WebViewImpl.mm:
1761         * UIProcess/ios/PageClientImplIOS.h:
1762         * UIProcess/ios/PageClientImplIOS.mm:
1763         (WebKit::PageClientImpl::PageClientImpl):
1764         * UIProcess/mac/PageClientImpl.h: Removed.
1765         * UIProcess/mac/PageClientImpl.mm: Removed.
1766         * UIProcess/mac/PageClientImplMac.h: Copied from Source/WebKit/UIProcess/mac/PageClientImpl.h.
1767         * UIProcess/mac/PageClientImplMac.mm: Copied from Source/WebKit/UIProcess/mac/PageClientImpl.mm.
1768         (WebKit::PageClientImpl::PageClientImpl):
1769         * UIProcess/mac/WebContextMenuProxyMac.mm:
1770         * UIProcess/mac/WebPageProxyMac.mm:
1771         * UIProcess/mac/WebPopupMenuProxyMac.mm:
1772         * WebKit.xcodeproj/project.pbxproj:
1773
1774 2017-09-01  Alex Christensen  <achristensen@webkit.org>
1775
1776         Replace WKUIDelegatePrivate's isPlayingMediaDidChange with KVO _isPlayingAudio on WKWebView
1777         https://bugs.webkit.org/show_bug.cgi?id=176212
1778
1779         Reviewed by Tim Horton.
1780
1781         Dan suggested this in bug 176203, I think it's a good idea,
1782         and I'll need to add more KVO properties soon anyways so I'd better learn how.
1783         Determining if audio playing changed is important for Safari, so WKPageUIClient's
1784         isPlayingAudioDidChange was correctly named but incorrectly fired if either audio
1785         or video playing changed and had you check if audio was playing, possibly too often.
1786
1787         * UIProcess/API/APIUIClient.h:
1788         (API::UIClient::isPlayingMediaDidChange):
1789         * UIProcess/API/C/WKPage.cpp:
1790         (WKPageSetPageUIClient):
1791         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1792         * UIProcess/API/Cocoa/WKWebView.mm:
1793         (-[WKWebView _isPlayingAudio]):
1794         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1795         * UIProcess/API/glib/WebKitUIClient.cpp:
1796         * UIProcess/Cocoa/UIDelegate.h:
1797         * UIProcess/Cocoa/UIDelegate.mm:
1798         (WebKit::UIDelegate::setDelegate):
1799         (WebKit::UIDelegate::UIClient::isPlayingMediaDidChange): Deleted.
1800         * UIProcess/Cocoa/WebViewImpl.h:
1801         * UIProcess/Cocoa/WebViewImpl.mm:
1802         (WebKit::WebViewImpl::isPlayingAudioWillChange):
1803         (WebKit::WebViewImpl::isPlayingAudioDidChange):
1804         * UIProcess/PageClient.h:
1805         * UIProcess/WebPageProxy.cpp:
1806         (WebKit::WebPageProxy::isPlayingMediaDidChange):
1807         * UIProcess/mac/PageClientImpl.h:
1808         * UIProcess/mac/PageClientImpl.mm:
1809         (WebKit::PageClientImpl::isPlayingAudioDidChange):
1810         (WebKit::PageClientImpl::isPlayingAudioWillChange):
1811
1812 2017-09-01  Alex Christensen  <achristensen@webkit.org>
1813
1814         Disable ObjC WebGL policy SPI on iOS
1815         https://bugs.webkit.org/show_bug.cgi?id=176233
1816
1817         Reviewed by Tim Horton.
1818         
1819         In r221465 I uploaded new SPI that is only needed on Mac with a beautiful test that only works on Mac.
1820         Since it fails on iOS and is not needed on iOS, let's just disable it on iOS.
1821
1822         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
1823         * UIProcess/Cocoa/NavigationState.h:
1824         * UIProcess/Cocoa/NavigationState.mm:
1825         (WebKit::NavigationState::setNavigationDelegate):
1826
1827 2017-09-01  Andy Estes  <aestes@apple.com>
1828
1829         [CG] Upstream CoreGraphics-related WebKitSystemInterface functions
1830         https://bugs.webkit.org/show_bug.cgi?id=176200
1831
1832         Reviewed by Tim Horton.
1833
1834         * PluginProcess/mac/PluginProcessMac.mm:
1835         (WebKit::PluginProcess::platformInitializeProcess):
1836         * UIProcess/mac/WindowServerConnection.h:
1837         * UIProcess/mac/WindowServerConnection.mm:
1838         (WebKit::registerOcclusionNotificationHandler):
1839         (WebKit::WindowServerConnection::WindowServerConnection):
1840         (WebKit::WindowServerConnection::applicationWindowModificationsStarted): Deleted.
1841         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
1842         (InitWebCoreSystemInterface):
1843
1844 2017-09-01  Per Arne Vollan  <pvollan@apple.com>
1845
1846         [Win] Compile error, 'Cache' is not declared.
1847         https://bugs.webkit.org/show_bug.cgi?id=176062
1848
1849         Reviewed by Youenn Fablet.
1850
1851         Rename DOMCache to DOMCacheEngine.
1852
1853         * NetworkProcess/cache/CacheStorageEngine.cpp:
1854         (WebKit::CacheStorage::Engine::queryCache):
1855         (WebKit::CacheStorage::Engine::writeFile):
1856         * NetworkProcess/cache/CacheStorageEngine.h:
1857         * NetworkProcess/cache/CacheStorageEngineCache.h:
1858         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
1859         (WebKit::CacheStorage::Caches::initialize):
1860         * NetworkProcess/cache/CacheStorageEngineCaches.h:
1861         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
1862         * NetworkProcess/cache/CacheStorageEngineConnection.h:
1863         * NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
1864         * Shared/WebCoreArgumentCoders.cpp:
1865         (IPC::ArgumentCoder<DOMCacheEngine::CacheInfo>::encode):
1866         (IPC::ArgumentCoder<DOMCacheEngine::CacheInfo>::decode):
1867         (IPC::ArgumentCoder<DOMCacheEngine::Record>::encode):
1868         (IPC::ArgumentCoder<DOMCacheEngine::Record>::decode):
1869         (IPC::ArgumentCoder<DOMCache::CacheInfo>::encode): Deleted.
1870         (IPC::ArgumentCoder<DOMCache::CacheInfo>::decode): Deleted.
1871         (IPC::ArgumentCoder<DOMCache::Record>::encode): Deleted.
1872         (IPC::ArgumentCoder<DOMCache::Record>::decode): Deleted.
1873         * Shared/WebCoreArgumentCoders.h:
1874         * WebProcess/Cache/WebCacheStorageConnection.cpp:
1875         * WebProcess/Cache/WebCacheStorageConnection.h:
1876         * WebProcess/Cache/WebCacheStorageConnection.messages.in:
1877
1878 2017-08-31  Andy Estes  <aestes@apple.com>
1879
1880         [Mac] Upstream AppKit-related WebKitSystemInterface functions
1881         https://bugs.webkit.org/show_bug.cgi?id=176175
1882
1883         Reviewed by Brady Eidson.
1884
1885         * PluginProcess/mac/PluginProcessMac.mm:
1886         (WebKit::initializeCocoaOverrides):
1887         * Shared/mac/WebEventFactory.mm:
1888         (WebKit::WebEventFactory::createWebWheelEvent):
1889         (WebKit::WebEventFactory::createWebKeyboardEvent):
1890         * UIProcess/mac/WKTextInputWindowController.mm:
1891         (-[WKTextInputPanel init]):
1892         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
1893         (InitWebCoreSystemInterface):
1894
1895 2017-08-31  Alex Christensen  <achristensen@webkit.org>
1896
1897         Add WKUIDelegatePrivate equivalent of WKPageUIClient's isPlayingAudioDidChange
1898         https://bugs.webkit.org/show_bug.cgi?id=176203
1899         <rdar://problem/29270035>
1900
1901         Reviewed by Tim Horton.
1902
1903         * UIProcess/API/APIUIClient.h:
1904         (API::UIClient::isPlayingMediaDidChange):
1905         (API::UIClient::isPlayingAudioDidChange): Deleted.
1906         * UIProcess/API/C/WKPage.cpp:
1907         (WKPageSetPageUIClient):
1908         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1909         * UIProcess/Cocoa/UIDelegate.h:
1910         * UIProcess/Cocoa/UIDelegate.mm:
1911         (WebKit::UIDelegate::setDelegate):
1912         (WebKit::UIDelegate::UIClient::isPlayingMediaDidChange):
1913         * UIProcess/WebPageProxy.cpp:
1914         (WebKit::WebPageProxy::isPlayingMediaDidChange):
1915
1916 2017-08-31  Alex Christensen  <achristensen@webkit.org>
1917
1918         Add ObjC SPI corresponding to WKPageLoaderClient's webGLLoadPolicy and resolveWebGLLoadPolicy
1919         https://bugs.webkit.org/show_bug.cgi?id=175779
1920         <rdar://problem/22367975>
1921
1922         Reviewed by Tim Horton.
1923
1924         * UIProcess/API/APINavigationClient.h:
1925         (API::NavigationClient::webGLLoadPolicy const):
1926         (API::NavigationClient::resolveWebGLLoadPolicy const):
1927         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
1928         * UIProcess/Cocoa/NavigationState.h:
1929         * UIProcess/Cocoa/NavigationState.mm:
1930         (WebKit::NavigationState::setNavigationDelegate):
1931         (WebKit::toWebCoreWebGLLoadPolicy):
1932         (WebKit::NavigationState::NavigationClient::webGLLoadPolicy const):
1933         (WebKit::NavigationState::NavigationClient::resolveWebGLLoadPolicy const):
1934         * UIProcess/WebPageProxy.cpp:
1935         (WebKit::WebPageProxy::webGLPolicyForURL):
1936         (WebKit::WebPageProxy::resolveWebGLPolicyForURL):
1937         * UIProcess/WebPageProxy.h:
1938         * UIProcess/WebPageProxy.messages.in:
1939         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1940         (WebKit::WebFrameLoaderClient::webGLPolicyForURL const):
1941         (WebKit::WebFrameLoaderClient::resolveWebGLPolicyForURL const):
1942         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1943         * WebProcess/WebPage/WebPage.cpp:
1944         (WebKit::WebPage::webGLPolicyForURL):
1945         (WebKit::WebPage::resolveWebGLPolicyForURL):
1946         * WebProcess/WebPage/WebPage.h:
1947         * WebProcess/WebPage/ios/WebPageIOS.mm:
1948         (WebKit::WebPage::webGLPolicyForURL):
1949         (WebKit::WebPage::resolveWebGLPolicyForURL):
1950         * WebProcess/WebPage/mac/WebPageMac.mm:
1951         (WebKit::WebPage::webGLPolicyForURL):
1952         (WebKit::WebPage::resolveWebGLPolicyForURL):
1953
1954 2017-08-31  Brady Eidson  <beidson@apple.com>
1955
1956         Add (entirely incorrect) fetching of ServiceWorker scripts.
1957         https://bugs.webkit.org/show_bug.cgi?id=176179
1958
1959         Reviewed by Andy Estes.
1960
1961         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1962         (WebKit::WebSWServerConnection::startScriptFetchInClient):
1963         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1964         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
1965
1966         * WebProcess/Storage/WebSWClientConnection.cpp:
1967         (WebKit::WebSWClientConnection::finishFetchingScriptInServer):
1968         * WebProcess/Storage/WebSWClientConnection.h:
1969         * WebProcess/Storage/WebSWClientConnection.messages.in:
1970
1971 2017-08-31  Megan Gardner  <megan_gardner@apple.com>
1972
1973         Fix error in protocol revving
1974         https://bugs.webkit.org/show_bug.cgi?id=176191
1975
1976         Protocol definition was mastered out of later iOS submissions, causing them to not build.
1977
1978         Reviewed by Tim Horton.
1979
1980         * UIProcess/ios/WKContentViewInteraction.mm:
1981         (-[WKContentView changeSelectionWithGestureAt:withGesture:withState:]):
1982
1983 2017-08-31  Youenn Fablet  <youenn@apple.com>
1984
1985         Update CacheStorage caches only if it is updated
1986         https://bugs.webkit.org/show_bug.cgi?id=176135
1987
1988         Reviewed by Alex Christensen.
1989
1990         For each change to CacheStorageEngineCaches list of cache, CacheStorageEngineCaches increments a counter.
1991         When sending the list of caches, CacheStorageEngineCaches will compare its counter with the one provided.
1992         If they sare the same, CacheStorageEngineCaches will return nothing.
1993         Otherwise it returns the whole list of caches.
1994
1995         * NetworkProcess/cache/CacheStorageEngine.cpp:
1996         (WebKit::CacheStorage::Engine::retrieveCaches):
1997         * NetworkProcess/cache/CacheStorageEngine.h:
1998         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
1999         (WebKit::CacheStorage::Caches::initialize):
2000         (WebKit::CacheStorage::Caches::open):
2001         (WebKit::CacheStorage::Caches::remove):
2002         (WebKit::CacheStorage::Caches::clearMemoryRepresentation):
2003         (WebKit::CacheStorage::Caches::cacheInfos const):
2004         * NetworkProcess/cache/CacheStorageEngineCaches.h:
2005         (WebKit::CacheStorage::Caches::updateCounter const):
2006         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
2007         (WebKit::CacheStorageEngineConnection::caches):
2008         * NetworkProcess/cache/CacheStorageEngineConnection.h:
2009         * NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
2010         * WebProcess/Cache/WebCacheStorageConnection.cpp:
2011         (WebKit::WebCacheStorageConnection::doRetrieveCaches):
2012         * WebProcess/Cache/WebCacheStorageConnection.h:
2013
2014 2017-08-31  Youenn Fablet  <youenn@apple.com>
2015
2016         Introduce CacheStorageEngineCache to handle cache records
2017         https://bugs.webkit.org/show_bug.cgi?id=176137
2018
2019         Reviewed by Alex Christensen.
2020
2021         CacheStorageEngineCache is the equivalent of WebCore Cache.
2022         It contains a list of records that it needs to manage (add, update, remove).
2023         Moving the logic of this management from CacheStorageEngine to this new class so as to ease future development.
2024
2025         * CMakeLists.txt:
2026         * NetworkProcess/cache/CacheStorageEngine.cpp:
2027         (WebKit::CacheStorage::Engine::open):
2028         (WebKit::CacheStorage::Engine::remove):
2029         (WebKit::CacheStorage::Engine::retrieveRecords):
2030         (WebKit::CacheStorage::Engine::putRecords):
2031         (WebKit::CacheStorage::Engine::deleteMatchingRecords):
2032         (WebKit::CacheStorage::Engine::cache):
2033         (WebKit::CacheStorage::Engine::writeCacheRecords): Deleted.
2034         (WebKit::CacheStorage::Engine::removeCacheRecords): Deleted.
2035         (WebKit::CacheStorage::Engine::queryCache): Deleted.
2036         * NetworkProcess/cache/CacheStorageEngine.h:
2037         * NetworkProcess/cache/CacheStorageEngineCache.cpp: Added.
2038         * NetworkProcess/cache/CacheStorageEngineCache.h:
2039         (WebKit::CacheStorage::Cache::identifier const):
2040         (WebKit::CacheStorage::Cache::name const):
2041         (WebKit::CacheStorage::Cache::info const):
2042         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2043         (WebKit::CacheStorage::Caches::find):
2044         (WebKit::CacheStorage::Caches::open):
2045         (WebKit::CacheStorage::Caches::remove):
2046         (WebKit::CacheStorage::encodeCacheNames):
2047         (WebKit::CacheStorage::Caches::readCachesFromDisk):
2048         (WebKit::CacheStorage::Caches::cacheInfos const):
2049         * WebKit.xcodeproj/project.pbxproj:
2050
2051 2017-08-31  David Quesada  <david_quesada@apple.com>
2052
2053         WKNavigationDelegatePrivate client redirect SPI needs to be able to detect redirects scheduled before the document finishes loading
2054         https://bugs.webkit.org/show_bug.cgi?id=176128
2055         rdar://problem/34068476
2056
2057         Reviewed by Brady Eidson.
2058
2059         _webView:didPerformClientRedirect: isn't useful for delegates that want to know about client redirects
2060         started before the document is finished loading. This is because the method would be called after the
2061         navigation scheduler's timer fires and the navigation for the redirect has begun. Since this happens in
2062         a later iteration of the run loop, the document has already finished loading. Address this by replacing
2063         the method with two that give the navigation delegate more information about when client redirects are
2064         scheduled and canceled.
2065
2066         * UIProcess/API/APINavigationClient.h:
2067         (API::NavigationClient::willPerformClientRedirect):
2068         (API::NavigationClient::didCancelClientRedirect):
2069         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
2070         * UIProcess/Cocoa/NavigationState.h:
2071         * UIProcess/Cocoa/NavigationState.mm:
2072         (WebKit::NavigationState::setNavigationDelegate):
2073         (WebKit::NavigationState::NavigationClient::willPerformClientRedirect):
2074         (WebKit::NavigationState::NavigationClient::didCancelClientRedirect):
2075         * UIProcess/WebPageProxy.cpp:
2076         (WebKit::WebPageProxy::willPerformClientRedirectForFrame):
2077         (WebKit::WebPageProxy::didCancelClientRedirectForFrame):
2078         * UIProcess/WebPageProxy.h:
2079         * UIProcess/WebPageProxy.messages.in:
2080         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2081         (WebKit::WebFrameLoaderClient::dispatchDidCancelClientRedirect):
2082         (WebKit::WebFrameLoaderClient::dispatchWillPerformClientRedirect):
2083         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2084
2085 2017-08-30  Megan Gardner  <megan_gardner@apple.com>
2086
2087         Remove IsBlockSelection flag
2088         https://bugs.webkit.org/show_bug.cgi?id=176141
2089
2090         Reviewed by Dean Jackson.
2091
2092         Block selection is disabled. Removed code associated with this flag to allow removal of the
2093         flag in UIKit.
2094         
2095         No tests for a removed feature.
2096
2097         * Platform/spi/ios/UIKitSPI.h:
2098         * Shared/ios/GestureTypes.h:
2099         * UIProcess/ios/WKContentViewInteraction.mm:
2100         (toUIWKSelectionFlags):
2101         * WebProcess/WebPage/ios/WebPageIOS.mm:
2102         (WebKit::WebPage::rangeForWebSelectionAtPosition):
2103         (WebKit::WebPage::selectWithGesture):
2104         (WebKit::WebPage::contractedRangeFromHandle):
2105         (WebKit::WebPage::computeExpandAndShrinkThresholdsForHandle):
2106         (WebKit::WebPage::updateBlockSelectionWithTouch):
2107         (WebKit::WebPage::updateSelectionWithTouches):
2108
2109 2017-08-30  Alex Christensen  <achristensen@webkit.org>
2110
2111         Add WKUIDelegatePrivate equivalent of WKPageUIClient's didClickAutoFillButton
2112         https://bugs.webkit.org/show_bug.cgi?id=176139
2113         <rdar://problem/29270035>
2114
2115         Reviewed by Tim Horton.
2116
2117         Covered by a cool new API test!
2118
2119         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2120         * UIProcess/Cocoa/UIDelegate.h:
2121         * UIProcess/Cocoa/UIDelegate.mm:
2122         (WebKit::UIDelegate::setDelegate):
2123         (WebKit::UIDelegate::UIClient::didClickAutoFillButton):
2124
2125 2017-08-31  Chris Dumez  <cdumez@apple.com>
2126
2127         Use WTF::crossThreadCopy() in more places
2128         https://bugs.webkit.org/show_bug.cgi?id=176169
2129
2130         Reviewed by Andreas Kling.
2131
2132         Use WTF::crossThreadCopy() in more places to make code more concise.
2133
2134         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2135         (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
2136         (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
2137         (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains):
2138         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
2139         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains):
2140         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2141         (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains):
2142
2143 2017-08-31  Youenn Fablet  <youenn@apple.com>
2144
2145         Take into account removed caches in Caches::remove assertion
2146         https://bugs.webkit.org/show_bug.cgi?id=176164
2147
2148         Reviewed by Alex Christensen.
2149
2150         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2151         (WebKit::CacheStorage::Caches::remove):
2152
2153 2017-08-31  Youenn Fablet  <youenn@apple.com>
2154
2155         Do not create a salt if the CacheStorage engine should not persist
2156         https://bugs.webkit.org/show_bug.cgi?id=176138
2157
2158         Reviewed by Alex Christensen.
2159
2160         * NetworkProcess/cache/CacheStorageEngine.cpp:
2161         (WebKit::CacheStorage::Engine::~Engine): Ensuring that Caches will not try using the engine if it goes away.
2162         (WebKit::CacheStorage::Engine::initialize): Removing making a salt if engine data is not persistent.
2163         * NetworkProcess/cache/CacheStorageEngine.h: Check persistency according the root path. If it is null, caches should not try to do persistency.
2164         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2165         (WebKit::CacheStorage::cachesRootPath):
2166         (WebKit::CacheStorage::Caches::initialize):
2167         (WebKit::CacheStorage::Caches::detach):
2168         (WebKit::CacheStorage::Caches::readCachesFromDisk):
2169         (WebKit::CacheStorage::Caches::writeCachesToDisk):
2170         * NetworkProcess/cache/CacheStorageEngineCaches.h:
2171         (WebKit::CacheStorage::Caches::shouldPersist const):
2172         * NetworkProcess/cache/NetworkCacheData.cpp: Making makeSalt private again.
2173         (WebKit::NetworkCache::makeSalt):
2174         * NetworkProcess/cache/NetworkCacheData.h:
2175
2176
2177 2017-08-31  Carlos Garcia Campos  <cgarcia@igalia.com>
2178
2179         [GTK] Several InputMethodFilter tests are failing and crashing
2180         https://bugs.webkit.org/show_bug.cgi?id=176158
2181
2182         Reviewed by Carlos Alberto Lopez Perez.
2183
2184         * UIProcess/gtk/InputMethodFilter.cpp:
2185         (WebKit::InputMethodFilter::confirmCurrentComposition): Return early in testing mode because the page is not available.
2186         (WebKit::InputMethodFilter::logHandleKeyboardEventWithCompositionResultsForTesting): Use hexadecimal numbers for
2187         logging key codes.
2188
2189 2017-08-31  Carlos Garcia Campos  <cgarcia@igalia.com>
2190
2191         [GTK][Wayland] Crash when gdk_keymap_get_entries_for_keyval returns TRUE but n_keys=0
2192         https://bugs.webkit.org/show_bug.cgi?id=176154
2193
2194         Reviewed by Carlos Alberto Lopez Perez.
2195
2196         In Wayland gdk_keymap_get_entries_for_keyval() can return TRUE with n_keys=0. We have several places in WebKit
2197         where we just check the return value of gdk_keymap_get_entries_for_keyval() and then use the returned array to
2198         get the first position assuming it has at least one item. This has always worked in X11 because the GDK X11
2199         backend does the right thing, but it's crashing in Wayland now. It should be fixed in GTK+ but in the meantime
2200         it's easy to workaround by also checking n_keys > 0.
2201
2202         * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
2203         (WebKit::doKeyStrokeEvent):
2204
2205 2017-08-30  Dan Bernstein  <mitz@apple.com>
2206
2207         [iOS] REGRESSION (r218144) -[WKContentView targetForAction:withSender:] returns the content view for actions implemented only by the WKWebView, causing a crash
2208         https://bugs.webkit.org/show_bug.cgi?id=176077
2209         <rdar://problem/34145200>
2210
2211         Reviewed by Sam Weinig.
2212
2213         Test: TestWebKitAPI/Tests/WebKitCocoa/WKContentViewTargetForAction.mm
2214
2215         * UIProcess/API/Cocoa/WKWebView.mm:
2216         (-[WKWebView targetForAction:withSender:]): Override and forward WKContentView actions to
2217           -[WKContentView targetForActionForWebView:withSender:].
2218         * UIProcess/ios/WKContentViewInteraction.h: Declare -targetForActionForWebView:withSender:.
2219         * UIProcess/ios/WKContentViewInteraction.mm:
2220         (-[WKContentView targetForAction:withSender:]): Forward to the WKWebView.
2221         (-[WKContentView targetForActionForWebView:withSender:]): Call super’s
2222           -targetForAction:withSender:.
2223
2224 2017-08-30  Brent Fulgham  <bfulgham@apple.com>
2225
2226         Fix whitespace and formatting
2227         https://bugs.webkit.org/show_bug.cgi?id=176134
2228
2229         Reviewed by Sam Weinig.
2230
2231         Bring the file formatting into compliance with WebKit Coding Style.
2232
2233         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
2234         (-[_WKWebsiteDataStoreConfiguration _webStorageDirectory]):
2235         (-[_WKWebsiteDataStoreConfiguration _setWebStorageDirectory:]):
2236         (-[_WKWebsiteDataStoreConfiguration _indexedDBDatabaseDirectory]):
2237         (-[_WKWebsiteDataStoreConfiguration _setIndexedDBDatabaseDirectory:]):
2238         (-[_WKWebsiteDataStoreConfiguration _webSQLDatabaseDirectory]):
2239         (-[_WKWebsiteDataStoreConfiguration _setWebSQLDatabaseDirectory:]):
2240         (-[_WKWebsiteDataStoreConfiguration _cookieStorageFile]):
2241         (-[_WKWebsiteDataStoreConfiguration _setCookieStorageFile:]):
2242         (-[_WKWebsiteDataStoreConfiguration _resourceLoadStatisticsDirectory]):
2243         (-[_WKWebsiteDataStoreConfiguration _setResourceLoadStatisticsDirectory:]):
2244
2245 2017-08-30  Youenn Fablet  <youenn@apple.com>
2246
2247         Remove the list of removed caches from CacheStorageEngine
2248         https://bugs.webkit.org/show_bug.cgi?id=176136
2249
2250         Reviewed by Alex Christensen.
2251
2252
2253         This list is no longer useful as CacheStorageEngineCaches handles its own removed caches.
2254
2255         * NetworkProcess/cache/CacheStorageEngine.cpp:
2256         (WebKit::CacheStorage::Engine::remove):
2257         (WebKit::CacheStorage::Engine::cache):
2258         * NetworkProcess/cache/CacheStorageEngine.h:
2259
2260 2017-08-30  Tim Horton  <timothy_horton@apple.com>
2261
2262         REGRESSION (r221068): Graphics corruption when dragging images on iOS
2263         https://bugs.webkit.org/show_bug.cgi?id=176132
2264         <rdar://problem/34142983>
2265
2266         Reviewed by Dean Jackson.
2267
2268         * Shared/mac/ColorSpaceData.mm:
2269         (WebKit::ColorSpaceData::encode):
2270         Color space encoding was entirely disabled on iOS, so after r221068,
2271         ShareableBitmap would make different decisions about image format
2272         on both sides of the wire.
2273
2274         Enable color space encoding on iOS (decoding is already implemented)
2275         by moving some ifdefs around.
2276
2277 2017-08-30  Youenn Fablet  <youenn@apple.com>
2278
2279         [Cache API] Support cache names persistency
2280         https://bugs.webkit.org/show_bug.cgi?id=175995
2281
2282         Reviewed by Alex Christensen.
2283
2284         Adding disk read/write capacities to CacheStorage engine.
2285         This is used to store per-origin cache names in a file.
2286         Making Engine a thread safe refcounted object so that it does read/write in a background thread.
2287
2288         Introducing CacheStorage::Caches as the object managing the list of Cache objects for a given origin.
2289         Caches will be responsible to do all the read/write operations for all of its caches.
2290         It will be responsible for quota limitation as well.
2291
2292         Moving part of the logic from CacheStorage::Engine into CacheStorage::Caches.
2293
2294         CacheStorage::Engine is initialized asynchronously as it first creates a salt which is used
2295         to obfuscate the names of the various files stored on disk.
2296
2297         In the same spirit, CacheStorage::Caches is initialized asynchronously as it needs to read from the disk the list of cache names.
2298         Once read, the names will be stored in memory.
2299         Added the possibility to clear this in-memory representation. This will be useful for testing.
2300         This might also be useful to save memory when there is no more use of CacheStorage by web pages.
2301
2302         Introducing a new cacheStorageSubdirectoryName parameter for WebsiteDataStore so as to segment the different per session CacheStorageEngine
2303         in direct sub folders of the main cacheStorageDirectory folder.
2304
2305         * CMakeLists.txt:
2306         * NetworkProcess/cache/CacheStorageEngine.cpp:
2307         (WebKit::CacheStorage::Engine::open):
2308         (WebKit::CacheStorage::Engine::remove):
2309         (WebKit::CacheStorage::Engine::retrieveCaches):
2310         (WebKit::CacheStorage::Engine::retrieveRecords):
2311         (WebKit::CacheStorage::Engine::initialize):
2312         (WebKit::CacheStorage::Engine::readCachesFromDisk):
2313         (WebKit::CacheStorage::Engine::cache):
2314         (WebKit::CacheStorage::Engine::writeFile): Making use of default parameter to directly return to the main loop.
2315         (WebKit::CacheStorage::Engine::readFile): Ditto.
2316         (WebKit::CacheStorage::Engine::clearMemoryRepresentation):
2317         * NetworkProcess/cache/CacheStorageEngine.h:
2318         (WebKit::CacheStorage::Engine::rootPath const):
2319         (WebKit::CacheStorage::Engine::salt const):
2320         (WebKit::CacheStorage::Engine::nextCacheIdentifier):
2321         * NetworkProcess/cache/CacheStorageEngineCaches.cpp: Added.
2322         (WebKit::CacheStorage::cachesRootPath):
2323         (WebKit::CacheStorage::cachesListFilename):
2324         (WebKit::CacheStorage::Caches::Caches):
2325         (WebKit::CacheStorage::Caches::initialize):
2326         (WebKit::CacheStorage::Caches::find):
2327         (WebKit::CacheStorage::Caches::open):
2328         (WebKit::CacheStorage::Caches::remove):
2329         (WebKit::CacheStorage::encodeCacheNames):
2330         (WebKit::CacheStorage::decodeCachesNames):
2331         (WebKit::CacheStorage::Caches::readCachesFromDisk):
2332         (WebKit::CacheStorage::Caches::writeCachesToDisk):
2333         (WebKit::CacheStorage::Caches::clearMemoryRepresentation):
2334         (WebKit::CacheStorage::Caches::cacheInfos const):
2335         * NetworkProcess/cache/CacheStorageEngineCaches.h: Added.
2336         (WebKit::CacheStorage::Caches::create):
2337         (WebKit::CacheStorage::Caches::isInitialized const):
2338         (WebKit::CacheStorage::Caches::detach):
2339         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
2340         (WebKit::CacheStorageEngineConnection::clearMemoryRepresentation):
2341         * NetworkProcess/cache/CacheStorageEngineConnection.h:
2342         * NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
2343         * NetworkProcess/cache/NetworkCacheData.cpp:
2344         (WebKit::NetworkCache::makeSalt):
2345         * NetworkProcess/cache/NetworkCacheData.h:
2346         * UIProcess/WebsiteData/WebsiteDataStore.h:
2347         * WebKit.xcodeproj/project.pbxproj:
2348         * WebProcess/Cache/WebCacheStorageConnection.cpp:
2349         (WebKit::WebCacheStorageConnection::clearMemoryRepresentation):
2350         * WebProcess/Cache/WebCacheStorageConnection.h:
2351
2352 2017-08-30  Brady Eidson  <beidson@apple.com>
2353
2354         Add "Identified" base class to replace a whole bunch of custom identifier generators.
2355         https://bugs.webkit.org/show_bug.cgi?id=176120
2356
2357         Reviewed by Alex Christensen.
2358
2359         * UIProcess/API/APIUserScript.cpp:
2360         (API::UserScript::UserScript):
2361         (API::generateIdentifier): Deleted.
2362         * UIProcess/API/APIUserScript.h:
2363
2364         * UIProcess/API/APIUserStyleSheet.cpp:
2365         (API::UserStyleSheet::UserStyleSheet):
2366         (API::generateIdentifier): Deleted.
2367         * UIProcess/API/APIUserStyleSheet.h:
2368
2369         * UIProcess/UserContent/WebScriptMessageHandler.cpp:
2370         (WebKit::WebScriptMessageHandler::WebScriptMessageHandler):
2371         (WebKit::generateIdentifier): Deleted.
2372         * UIProcess/UserContent/WebScriptMessageHandler.h:
2373         (WebKit::WebScriptMessageHandler::identifier const): Deleted.
2374
2375         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
2376         (WebKit::WebUserContentControllerProxy::WebUserContentControllerProxy):
2377         (WebKit::WebUserContentControllerProxy::~WebUserContentControllerProxy):
2378         (WebKit::WebUserContentControllerProxy::addProcess):
2379         (WebKit::WebUserContentControllerProxy::removeProcess):
2380         (WebKit::WebUserContentControllerProxy::addUserContentWorldUse):
2381         (WebKit::WebUserContentControllerProxy::removeUserContentWorldUses):
2382         (WebKit::WebUserContentControllerProxy::addUserScript):
2383         (WebKit::WebUserContentControllerProxy::removeUserScript):
2384         (WebKit::WebUserContentControllerProxy::removeAllUserScripts):
2385         (WebKit::WebUserContentControllerProxy::addUserStyleSheet):
2386         (WebKit::WebUserContentControllerProxy::removeUserStyleSheet):
2387         (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets):
2388         (WebKit::WebUserContentControllerProxy::addUserScriptMessageHandler):
2389         (WebKit::WebUserContentControllerProxy::removeUserMessageHandlerForName):
2390         (WebKit::WebUserContentControllerProxy::removeAllUserMessageHandlers):
2391         (WebKit::WebUserContentControllerProxy::addContentRuleList):
2392         (WebKit::WebUserContentControllerProxy::removeContentRuleList):
2393         (WebKit::WebUserContentControllerProxy::removeAllContentRuleLists):
2394         (WebKit::generateIdentifier): Deleted.
2395         * UIProcess/UserContent/WebUserContentControllerProxy.h:
2396         (WebKit::WebUserContentControllerProxy::identifier const): Deleted.
2397
2398         * UIProcess/VisitedLinkStore.cpp:
2399         (WebKit::VisitedLinkStore::~VisitedLinkStore):
2400         (WebKit::VisitedLinkStore::VisitedLinkStore):
2401         (WebKit::VisitedLinkStore::addProcess):
2402         (WebKit::VisitedLinkStore::removeProcess):
2403         (WebKit::VisitedLinkStore::removeAll):
2404         (WebKit::VisitedLinkStore::pendingVisitedLinksTimerFired):
2405         (WebKit::VisitedLinkStore::sendTable):
2406         (WebKit::generateIdentifier): Deleted.
2407         * UIProcess/VisitedLinkStore.h:
2408
2409         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2410         (WebKit::WebsiteDataStore::WebsiteDataStore):
2411         (WebKit::generateIdentifier): Deleted.
2412         * UIProcess/WebsiteData/WebsiteDataStore.h:
2413         (WebKit::WebsiteDataStore::identifier const): Deleted.
2414
2415         * WebProcess/Network/WebSocketStream.cpp:
2416         (WebKit::WebSocketStream::WebSocketStream):
2417         (WebKit::WebSocketStream::~WebSocketStream):
2418         (WebKit::WebSocketStream::messageSenderDestinationID):
2419         * WebProcess/Network/WebSocketStream.h:
2420
2421 2017-08-30  Brady Eidson  <beidson@apple.com>
2422
2423         Implement all of "Register" right up until where the script is fetched.
2424         https://bugs.webkit.org/show_bug.cgi?id=176082
2425
2426         Reviewed by Andy Estes.
2427
2428         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2429         (WebKit::WebSWServerConnection::resolveJobInClient):
2430         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2431         * WebProcess/Storage/WebSWClientConnection.messages.in:
2432
2433 2017-08-30  Andy Estes  <aestes@apple.com>
2434
2435         [Mac] Upstream Accessibility-related WebKitSystemInterface functions
2436         https://bugs.webkit.org/show_bug.cgi?id=176093
2437
2438         Reviewed by Eric Carlson.
2439
2440         * UIProcess/Cocoa/WebViewImpl.h:
2441         * UIProcess/Cocoa/WebViewImpl.mm:
2442         (WebKit::WebViewImpl::setAccessibilityWebProcessToken):
2443         (WebKit::WebViewImpl::updateRemoteAccessibilityRegistration):
2444         (WebKit::WebViewImpl::accessibilityRegisterUIProcessTokens):
2445         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2446         (InitWebCoreSystemInterface):
2447         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
2448         * WebProcess/WebPage/mac/WebPageMac.mm:
2449         (WebKit::WebPage::platformInitialize):
2450         (WebKit::WebPage::registerUIProcessAccessibilityTokens):
2451
2452 2017-08-30  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2453
2454         [WPE] Enable MEMORY_SAMPLER
2455         https://bugs.webkit.org/show_bug.cgi?id=176099
2456
2457         Reviewed by Michael Catanzaro.
2458
2459         Enable it at runtime if the environment variable WEBKIT_SAMPLE_MEMORY is set.
2460
2461         * UIProcess/API/wpe/WPEView.cpp:
2462         (WKWPE::m_compositingManagerProxy):
2463
2464 2017-08-30  Andy Estes  <aestes@apple.com>
2465
2466         [Mac] Upstream Carbon-related WebKitSystemInterface functions
2467         https://bugs.webkit.org/show_bug.cgi?id=176087
2468
2469         Reviewed by Alex Christensen.
2470
2471         * PluginProcess/mac/PluginProcessMac.mm:
2472         (WebKit::cgWindowID):
2473         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
2474         (WebKit::scriptCodeFromCurrentKeyboardInputSource):
2475         (WebKit::NetscapePlugin::sendComplexTextInput):
2476
2477 2017-08-30  Carlos Garcia Campos  <cgarcia@igalia.com>
2478
2479         Unreviewed. Try to fix layout test timing out after r221344.
2480
2481         There seems to be an infinite loop in the web process when WebPage::platformEditorState is called with non
2482         content editable result.
2483
2484         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
2485         (WebKit::WebPage::platformEditorState const):
2486
2487 2017-08-29  Carlos Garcia Campos  <cgarcia@igalia.com>
2488
2489         REGRESSION(r221064): [GTK] Editor not correctly working after r221064
2490         https://bugs.webkit.org/show_bug.cgi?id=176052
2491
2492         Reviewed by Michael Catanzaro.
2493
2494         Since r221064 we are not always notified about typing attributes when editor state changes. didChangeSelection
2495         no longer includes the typing attributes in EditorStateChange message, it's scheduled to be sent after the
2496         compositing layer have been flushed, but that part is not implemented for GTK+ port.
2497
2498         Fixes test /webkit2/WebKitWebView/editor-state/typing-attributes.
2499
2500         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
2501         (WebKit::AcceleratedDrawingArea::updateBackingStoreState): Call WebPage::flushPendingEditorStateUpdate() after
2502         the layout.
2503         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
2504         (WebKit::CoordinatedLayerTreeHost::layerFlushTimerFired): Call WebPage::flushPendingEditorStateUpdate() after
2505         the display sync.
2506         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2507         (WebKit::DrawingAreaImpl::display): Call WebPage::flushPendingEditorStateUpdate() after the layout.
2508         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
2509         (WebKit::WebPage::platformEditorState const): Also return early, setting isMissingPostLayoutData to true, when
2510         there's no frame view, the view needs a layout or the result is not for editable content.
2511
2512 2017-08-29  Brent Fulgham  <bfulgham@apple.com>
2513
2514         ResourceLoadStatistics logic does not understand custom WebsiteData stores
2515         https://bugs.webkit.org/show_bug.cgi?id=176037
2516         <rdar://problem/33338238>
2517
2518         Reviewed by Alex Christensen.
2519
2520         The NetworkProcess::updateCookiePartitioningForTopPrivatelyOwnedDomains always notifies the default website
2521         data store about observations it has made. This should be revised so that WebKit clients that register
2522         custom data stores through the WKWebsiteDataStores API can be assured that observations made in one session
2523         do not manipulate data from another session.
2524
2525         * NetworkProcess/NetworkProcess.cpp:
2526         (WebKit::NetworkProcess::updateCookiePartitioningForTopPrivatelyOwnedDomains): Use the passed sessionID to locate
2527         the correct NetworkStorageSession to notify about the new partitioning data.
2528         * NetworkProcess/NetworkProcess.h:
2529         * NetworkProcess/NetworkProcess.messages.in: Accept new argument.
2530         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2531         (WebKit::WebsiteDataStore::updateCookiePartitioningForTopPrivatelyOwnedDomains): Include the WebsiteDataStore's
2532         session ID in the message to update cookie partition data.
2533
2534 2017-08-29  Alex Christensen  <achristensen@webkit.org>
2535
2536         Automatically determine if a class has a modern decoder
2537         https://bugs.webkit.org/show_bug.cgi?id=176084
2538
2539         Reviewed by Sam Weinig.
2540
2541         Instead of determining if ModernDecoder is defined in the class,
2542         just check the signature of the decode member function.
2543
2544         * Platform/IPC/ArgumentCoder.h:
2545         (): Deleted.
2546         * Shared/WebPageCreationParameters.h:
2547         * Shared/WebPageGroupData.h:
2548         * Shared/WebsitePolicies.h:
2549
2550 2017-08-29  Alex Christensen  <achristensen@webkit.org>
2551
2552         Begin transition to modern IPC decoding
2553         https://bugs.webkit.org/show_bug.cgi?id=176043
2554
2555         Reviewed by JF Bastien.
2556
2557         Right now, if a class is decoded from IPC we must have a default constructor.
2558         This prevents us from having Ref or C++ references in such types, which is cluttering up our code.
2559         This is because IPC::decode makes a default-constructed object, fills it, and returns a bool indicating success.
2560         Making IPC::decode instead return a std::optional makes it so we do not need to call an empty constructor.
2561         This could also enable us to add IPC::Decoder::operator>> and other fun things!
2562         I also modernized two arbitrary classes, WebsitePolicies and WebPageGroupData with more to come.
2563         There's no good way to update the actual generated IPC code until each class has been transitioned.
2564
2565         * Platform/IPC/ArgumentCoder.h:
2566         (IPC::ArgumentCoder::decode):
2567         * Platform/IPC/Decoder.h:
2568         (IPC::Decoder::decode):
2569         * Shared/WebPageCreationParameters.cpp:
2570         (WebKit::WebPageCreationParameters::decode):
2571         * Shared/WebPageCreationParameters.h:
2572         * Shared/WebPageGroupData.cpp:
2573         (WebKit::WebPageGroupData::decode):
2574         * Shared/WebPageGroupData.h:
2575         * Shared/WebsitePolicies.h:
2576         (WebKit::WebsitePolicies::decode):
2577
2578 2017-08-29  Youenn Fablet  <youenn@apple.com>
2579
2580         Setting the cache storage engine root path according the session WebsiteDataStore
2581         https://bugs.webkit.org/show_bug.cgi?id=176055
2582
2583         Reviewed by Alex Christensen.
2584
2585         Adding disk read/write capacities to CacheStorage engine.
2586         This is used to store per-origin cache names in a file.
2587         Making Engine a thread safe refcounted object so that it does read/write in a background thread.
2588
2589         Setting the root path of the engine to the directory set for the session in use according the WebsiteDataStore.
2590         For each WebsiteDataStore, a path and a sandbox extension is passed to the network process if persistency of the cache storage is wanted.
2591         Ephemeral sessions will set the path of the engine to null so that no read/write access is performed.
2592
2593         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2594         (WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession):
2595         * NetworkProcess/NetworkProcess.cpp:
2596         (WebKit::NetworkProcess::initializeNetworkProcess):
2597         (WebKit::NetworkProcess::cacheStorageDirectory const):
2598         * NetworkProcess/NetworkProcess.h:
2599         * NetworkProcess/cache/CacheStorageEngine.cpp:
2600         (WebKit::CacheStorage::Engine::from):
2601         (WebKit::CacheStorage::Engine::defaultEngine):
2602         (WebKit::CacheStorage::Engine::Engine):
2603         (WebKit::CacheStorage::Engine::writeFile):
2604         * NetworkProcess/cache/CacheStorageEngine.h:
2605         (WebKit::CacheStorage::Engine::create):
2606         (WebKit::CacheStorage::Engine::shouldPersist const):
2607         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2608         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
2609         * NetworkProcess/mac/RemoteNetworkingContext.mm:
2610         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
2611         * Shared/WebsiteDataStoreParameters.cpp:
2612         (WebKit::WebsiteDataStoreParameters::encode const):
2613         (WebKit::WebsiteDataStoreParameters::decode):
2614         * Shared/WebsiteDataStoreParameters.h:
2615         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
2616         (WebKit::WebsiteDataStore::parameters):
2617
2618 2017-08-29  Chris Dumez  <cdumez@apple.com>
2619
2620         Add initial support for dataTransferItem.webkitGetAsEntry()
2621         https://bugs.webkit.org/show_bug.cgi?id=176038
2622         <rdar://problem/34121095>
2623
2624         Reviewed by Wenson Hsieh.
2625
2626         Make dataTransfer.items an experimental feature so that it can be easily
2627         turned on from the Develop menu, for testing convenience.
2628
2629         * Shared/WebPreferencesDefinitions.h:
2630
2631 2017-08-29  Andy Estes  <aestes@apple.com>
2632
2633         [Mac] Upstream WKSetMetadataURL() from WebKitSystemInterface
2634         https://bugs.webkit.org/show_bug.cgi?id=176046
2635
2636         Reviewed by Alex Christensen.
2637
2638         * UIProcess/mac/WebPageProxyMac.mm:
2639         (WebKit::WebPageProxy::savePDFToTemporaryFolderAndOpenWithNativeApplicationRaw):
2640         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2641         (InitWebCoreSystemInterface):
2642
2643 2017-08-28  Andy Estes  <aestes@apple.com>
2644
2645         [Cocoa] Upstream WKGetWebDefaultCFStringEncoding()
2646         https://bugs.webkit.org/show_bug.cgi?id=176039
2647
2648         Reviewed by Alex Christensen.
2649
2650         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2651         (InitWebCoreSystemInterface):
2652
2653 2017-08-28  Megan Gardner  <megan_gardner@apple.com>
2654
2655         Fix incorrect enum in atBoundaryOfGranularity call
2656         https://bugs.webkit.org/show_bug.cgi?id=176004
2657
2658         Reviewed by Wenson Hsieh and Enrica Casucci
2659
2660         Enum that was being used was incorrect, as that case in not covered in called function.
2661         Resulted in a no-op. Should now have correct behavior around line boundaries.
2662         
2663         Not possible to add tests for selections with velocity. Will attempt to add this behavior later.
2664
2665         * WebProcess/WebPage/ios/WebPageIOS.mm:
2666         (WebKit::rangeAtWordBoundaryForPosition):
2667
2668 2017-08-28  Stephan Szabo  <stephan.szabo@sony.com>
2669
2670         [WinCairo] Add PlatformWin cmake for Webkit
2671         https://bugs.webkit.org/show_bug.cgi?id=176027
2672
2673         Reviewed by Brent Fulgham.
2674
2675         * PlatformWin.cmake: Added.
2676
2677 2017-08-28  Andy Estes  <aestes@apple.com>
2678
2679         [Cocoa] Upstream CFNetwork-related WebKitSystemInterface functions
2680         https://bugs.webkit.org/show_bug.cgi?id=176032
2681
2682         Reviewed by Alex Christensen.
2683
2684         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2685         (WebKit::privateBrowsingSession):
2686         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2687         (InitWebCoreSystemInterface):
2688         * WebProcess/WebPage/mac/WebPageMac.mm:
2689         (WebKit::WebPage::platformHasLocalDataForURL):
2690         (WebKit::cachedResponseForURL):
2691
2692 2017-08-28  Brent Fulgham  <bfulgham@apple.com>
2693
2694         Disable access to secure cookies if an HTTPS site loads mixed content (Part 2: Header Requests)
2695         https://bugs.webkit.org/show_bug.cgi?id=175992
2696         <rdar://problem/34086613>
2697
2698         Reviewed by Daniel Bates.
2699
2700         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2701         (WebKit::NetworkConnectionToWebProcess::cookiesForDOM): Use a better label than 'result'.
2702         (WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue): Modify to accept a flag
2703         indicating if secure cookies should be included, and return a pair containing the resulting
2704         cookie string and a boolean indicating if secure cookies were accessed.
2705         * NetworkProcess/NetworkConnectionToWebProcess.h:
2706         * NetworkProcess/NetworkConnectionToWebProcess.messages.in: Ditto.
2707         * Shared/mac/CookieStorageShim.mm:
2708         (WebKit::webKitCookieStorageCopyRequestHeaderFieldsForURL): Ditto.
2709         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2710         (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue): Ditto.
2711         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
2712
2713 2017-08-28  Alex Christensen  <achristensen@webkit.org>
2714
2715         Add WKUIDelegatePrivate equivalent of WKPageUIClient's didExceedBackgroundResourceLimitWhileInForeground
2716         https://bugs.webkit.org/show_bug.cgi?id=176028
2717         <rdar://problem/29270035>
2718
2719         Reviewed by Andy Estes.
2720
2721         An API test for this did not succeed with either the memory or CPU limit calls,
2722         possibly because the app must be in the foreground for this call to be made.
2723
2724         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2725         * UIProcess/Cocoa/UIDelegate.h:
2726         * UIProcess/Cocoa/UIDelegate.mm:
2727         (WebKit::UIDelegate::setDelegate):
2728         (WebKit::toWKResourceLimit):
2729         (WebKit::UIDelegate::UIClient::didExceedBackgroundResourceLimitWhileInForeground):
2730
2731 2017-08-28  Carlos Garcia Campos  <cgarcia@igalia.com>
2732
2733         WebDriver: implement screen capture commands
2734         https://bugs.webkit.org/show_bug.cgi?id=174615
2735
2736         Reviewed by Brian Burg.
2737
2738         Extend takeScreenshot command to optionally take a screenshot of an element. When no element is provided, the
2739         screenshot is taken from the page visible area.
2740
2741         * PlatformGTK.cmake: Add WebAutomationSessionCairo.cpp to compilation.
2742         * PlatformWPE.cmake: Ditto.
2743         * UIProcess/Automation/Automation.json: Add ScreenshotError and several optional parameters to takeScreenshot.
2744         * UIProcess/Automation/WebAutomationSession.cpp:
2745         (WebKit::WebAutomationSession::takeScreenshot): Receive optional frame, node and scrollIntoView that are
2746         checked and passed to the web process.
2747         * UIProcess/Automation/WebAutomationSession.h:
2748         * UIProcess/Automation/cairo/WebAutomationSessionCairo.cpp: Added.
2749         (WebKit::WebAutomationSession::platformGetBase64EncodedPNGData): Cairo implementation.
2750         * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
2751         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
2752         (WebKit::snapshotRectForScreenshot): Helper to get the rectangle to be used for a screenshot.
2753         (WebKit::WebAutomationSessionProxy::takeScreenshot): If a node handle is provided take the snapshot using the
2754         element rectangle, otherwise use the page visible content rectangle.
2755         * WebProcess/Automation/WebAutomationSessionProxy.h:
2756         * WebProcess/Automation/WebAutomationSessionProxy.messages.in: Update TakeSnapshot message.
2757
2758 2017-08-28  Carlos Garcia Campos  <cgarcia@igalia.com>
2759
2760         Automation: takeScreenshot should use the visible content rect not the document rect
2761         https://bugs.webkit.org/show_bug.cgi?id=175665
2762
2763         Reviewed by Brian Burg.
2764
2765         According to the spec, we should get the toplevel browsing context document rectangle and take a screenshot of
2766         it using the current viewport width and height. We are currently using the document size.
2767
2768         19. Screen Capture.
2769         https://w3c.github.io/webdriver/webdriver-spec.html#dfn-draw-a-bounding-box-from-the-framebuffer
2770
2771         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
2772         (WebKit::WebAutomationSessionProxy::takeScreenshot): Use FrameView::visibleContentRect().
2773
2774 2017-08-28  Carlos Garcia Campos  <cgarcia@igalia.com>
2775
2776         [GTK][WPE] ASSERTION FAILED: !isOpen() in WebKit::IconDatabase::~IconDatabase()
2777         https://bugs.webkit.org/show_bug.cgi?id=175719
2778
2779         Reviewed by Michael Catanzaro.
2780
2781         This is happening always when running /webkit2/WebKitFaviconDatabase/favicon-database-test in debug builds. The
2782         last step we do is removing all icons, then the test finishes, which destroys the WebKitFaviconDatabase object
2783         that closes the icon database on dispose. The problem is that removing all icons schedules a main thread
2784         notification and IconDatabase is not considered closed until all main thread callbacks have been dispatched. This
2785         is never going to happen in the test, because the main loop is no longer running at that point. I don't think
2786         it's worth it to consider the database open while main thread callbacks are pending, they are just notifications
2787         and the client is no longer insterested on them afer closing the database. I think it's bettter and simpler to
2788         simply cancel the pending callbacks on database close. That ensures that isOpen() after close() is always
2789         false. This patch adds a helper private class to schedule notifications to the main thread that can be cancelled
2790         on database close. It also removes the didClose() notification because it was unused and because it's pointless
2791         now that we know the database is closed after close().
2792
2793         * UIProcess/API/glib/IconDatabase.cpp:
2794         (WebKit::IconDatabase::open): Mark the main thread notifier as active.
2795         (WebKit::IconDatabase::close): Mark the main thread notifier as not active.
2796         (WebKit::IconDatabase::IconDatabase): Remove m_mainThreadCallbackCount initialization.
2797         (WebKit::IconDatabase::isOpen const): Do what isOpenBesidesMainThreadCallbacks() used to do.
2798         (WebKit::IconDatabase::removeAllIconsOnThread): Remove the notification because it's currently unused.
2799         (WebKit::IconDatabase::dispatchDidImportIconURLForPageURLOnMainThread): Use MainThreadNotifier.
2800         (WebKit::IconDatabase::dispatchDidImportIconDataForPageURLOnMainThread): Ditto.
2801         (WebKit::IconDatabase::dispatchDidFinishURLImportOnMainThread): Ditto.
2802         (WebKit::IconDatabase::isOpenBesidesMainThreadCallbacks const): Deleted.
2803         (WebKit::IconDatabase::checkClosedAfterMainThreadCallback): Deleted.
2804         (WebKit::IconDatabase::dispatchDidRemoveAllIconsOnMainThread): Deleted.
2805         * UIProcess/API/glib/IconDatabase.h:
2806         (WebKit::IconDatabaseClient::didChangeIconForPageURL):
2807         (WebKit::IconDatabaseClient::didFinishURLImport):
2808         (WebKit::IconDatabase::MainThreadNotifier::MainThreadNotifier):
2809         (WebKit::IconDatabase::MainThreadNotifier::setActive):
2810         (WebKit::IconDatabase::MainThreadNotifier::notify):
2811         (WebKit::IconDatabase::MainThreadNotifier::stop):
2812         (WebKit::IconDatabase::MainThreadNotifier::timerFired):
2813         (WebKit::IconDatabaseClient::didRemoveAllIcons): Deleted.
2814         (WebKit::IconDatabaseClient::didClose): Deleted.
2815
2816 2017-08-27  Wenson Hsieh  <wenson_hsieh@apple.com>
2817
2818         Picking an emoji via the emoji dialog (Ctrl+Cmd+Space) fires inconsistent beforeinput events.
2819         https://bugs.webkit.org/show_bug.cgi?id=170955
2820         <rdar://problem/31697653>
2821
2822         Reviewed by Ryosuke Niwa.
2823
2824         Currently, we insert text with TextEventInputAutocompletion as the text event input type if any text range to
2825         replace was specified by the platform. Instead, limit this only to when the text replacement range is not empty.
2826         This more closely matches the intention of the spec, which states that the "insertReplacementText" inputType
2827         should be used when "[replacing] existing text by means of a spell checker, auto-correct or similar".
2828
2829         * WebProcess/WebPage/WebPage.cpp:
2830         (WebKit::WebPage::insertTextAsync):
2831
2832 2017-08-27  Wenson Hsieh  <wenson_hsieh@apple.com>
2833
2834         [iOS WK2] Web process crashes after changing selection to the end of the document when speaking a selection
2835         https://bugs.webkit.org/show_bug.cgi?id=176011
2836         <rdar://problem/32614095>
2837
2838         Reviewed by Ryosuke Niwa.
2839
2840         Adds an SPI hook to test accessibility codepaths when speaking selected content. This patch does some minor
2841         refactoring by introducing _accessibilityRetrieveRectsAtSelectionOffset:withText:completionHandler:, which takes
2842         and invokes a completion handler block. The existing _accessibilityRetrieveRectsAtSelectionOffset:withText:
2843         method simply turns around and calls the former variant with `nil` as a completion handler.
2844
2845         * UIProcess/API/Cocoa/WKWebView.mm:
2846         (-[WKWebView _accessibilityRetrieveRectsAtSelectionOffset:withText:completionHandler:]):
2847         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2848         * UIProcess/ios/WKContentViewInteraction.h:
2849         * UIProcess/ios/WKContentViewInteraction.mm:
2850         (-[WKContentView _accessibilityRetrieveRectsAtSelectionOffset:withText:]):
2851         (-[WKContentView _accessibilityRetrieveRectsAtSelectionOffset:withText:completionHandler:]):
2852         * WebProcess/WebPage/ios/WebPageIOS.mm:
2853         (WebKit::visiblePositionForPositionWithOffset): Deleted.
2854
2855 2017-08-25  Alex Christensen  <achristensen@webkit.org>
2856
2857         Add WKUIDelegatePrivate equivalent of WKPageUIClient's saveDataToFileInDownloadsFolder
2858         https://bugs.webkit.org/show_bug.cgi?id=176000
2859         <rdar://problem/29270035>
2860
2861         Reviewed by Andy Estes.
2862         
2863         Covered by a new API test.
2864
2865         * Shared/Cocoa/WKNSData.h:
2866         (wrapper): Deleted.
2867         * UIProcess/API/APIUIClient.h:
2868         (API::UIClient::saveDataToFileInDownloadsFolder):
2869         * UIProcess/API/C/WKPage.cpp:
2870         (WKPageSetPageUIClient):
2871         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2872         * UIProcess/Cocoa/UIDelegate.h:
2873         * UIProcess/Cocoa/UIDelegate.mm:
2874         (WebKit::UIDelegate::setDelegate):
2875         (WebKit::UIDelegate::UIClient::saveDataToFileInDownloadsFolder):
2876         * UIProcess/WebPageProxy.cpp:
2877         (WebKit::WebPageProxy::saveDataToFileInDownloadsFolder):
2878         (WebKit::WebPageProxy::savePDFToFileInDownloadsFolder):
2879         * UIProcess/WebPageProxy.h:
2880         * UIProcess/WebPageProxy.messages.in:
2881         * WebProcess/WebPage/WebFrame.cpp:
2882         (WebKit::WebFrame::url const):
2883         * WebProcess/WebPage/WebFrame.h:
2884         * WebProcess/WebPage/WebPage.cpp:
2885         (WebKit::WebPage::savePDFToFileInDownloadsFolder):
2886         * WebProcess/WebPage/WebPage.h:
2887
2888 2017-08-25  David Kilzer  <ddkilzer@apple.com>
2889
2890         Fix -Wunused-lambda-capture warnings in WebKit with new clang compiler
2891         <https://webkit.org/b/175911>
2892         <rdar://problem/33667497>
2893
2894         Reviewed by Alex Christensen.
2895
2896         * NetworkProcess/cache/CacheStorageEngine.cpp:
2897         (WebKit::CacheStorage::Engine::retrieveCaches): Remove unused
2898         lambda capture for 'this'.
2899         (WebKit::CacheStorage::Engine::putRecords): Remove unused
2900         lambda capture for 'cacheIdentifier'.
2901         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
2902         (WebKit::CacheStorageEngineConnection::records): Ditto.
2903
2904 2017-08-25  Brian Burg  <bburg@apple.com>
2905
2906         Web Automation: add capabilities to control ICE candidate filtering and insecure media capture
2907         https://bugs.webkit.org/show_bug.cgi?id=175563
2908         <rdar://problem/33734492>
2909
2910         Reviewed by Joseph Pecoraro.
2911
2912         * UIProcess/Cocoa/AutomationClient.mm:
2913         (WebKit::AutomationClient::requestAutomationSessionWithCapabilities):
2914         Translate new capabilities to _WKAutomationSessionConfiguration properties.
2915
2916 2017-08-24  Brian Burg  <bburg@apple.com>
2917
2918         Web Automation: use automation session configurations to propagate per-session settings
2919         https://bugs.webkit.org/show_bug.cgi?id=175562
2920         <rdar://problem/30853362>
2921
2922         Reviewed by Joseph Pecoraro.
2923
2924         Some WebDriver capabilities need WebKit support in order to be implemented correctly.
2925         There is currently no easy way to forward WebDriver capability keys and values to WebKit
2926         at session creation time. This is unfortunate, as it would be best to implement many of
2927         them via existing mechanisms (i.e., WKPreferences properties) that need to be set up
2928         before any windows are opened in the session.
2929
2930         This patch adds WebKit-side plumbing to forward named capabilities from a remote
2931         WebDriver client to the _WKAutomationSession and its delegate in WebKit2 UIProcess.
2932         These capabilities are exposed via API in ways that abstract away details of how the
2933         capabilities are represented in RWI wire protocol messages.
2934
2935         In the Cocoa API, these capabilities are exposed via a session configuration object
2936         that's similar to WKWebView's WKWebViewConfiguration. A session's configuration is copied
2937         and used at initialization and cannot be modified after the session is created.
2938         Code in the Cocoa subclass of API::AutomationClient translates between RWI protocol
2939         capability names and property values on the _WKAutomationSessionConfiguration it
2940         uses to request a new session.
2941
2942         Later patches will hook up the two properties present in the configuration in this patch.
2943         Most of this patch is just generic plumbing without doing any capability-specific work.
2944
2945         * UIProcess/API/Cocoa/_WKAutomationDelegate.h:
2946         * UIProcess/API/Cocoa/_WKAutomationSession.h:
2947         * UIProcess/API/Cocoa/_WKAutomationSession.mm:
2948         (-[_WKAutomationSession init]):
2949         (-[_WKAutomationSession initWithConfiguration:]):
2950         (-[_WKAutomationSession configuration]):
2951         * UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.h: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKAutomationDelegate.h.
2952         * UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.mm: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKAutomationSession.h.
2953         (-[_WKAutomationSessionConfiguration init]):
2954         (-[_WKAutomationSessionConfiguration description]):
2955         * UIProcess/Cocoa/AutomationClient.h:
2956         * UIProcess/Cocoa/AutomationClient.mm:
2957         (WebKit::AutomationClient::AutomationClient):
2958         (WebKit::AutomationClient::requestAutomationSession):
2959         (WebKit::AutomationClient::requestAutomationSessionWithCapabilities):
2960         * WebKit.xcodeproj/project.pbxproj:
2961
2962 2017-08-25  Brady Eidson  <beidson@apple.com>
2963
2964         Introduce ServerWorkerRegistration task queues.
2965         https://bugs.webkit.org/show_bug.cgi?id=175851
2966
2967         Reviewed by Andy Estes.
2968
2969         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2970         (WebKit::WebSWServerConnection::WebSWServerConnection):
2971         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2972         (WebKit::WebSWServerConnection::identifier const): Deleted.
2973
2974         * WebProcess/Storage/WebSWClientConnection.h:
2975         (WebKit::WebSWClientConnection::identifier const): Deleted.
2976
2977 2017-08-25  Youenn Fablet  <youenn@apple.com>
2978
2979         [Cache API] UIProcess should provide the directory path where to store Cache Storage data
2980         https://bugs.webkit.org/show_bug.cgi?id=175884
2981         <rdar://problem/34072441>
2982
2983         Unreviewed.
2984
2985         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2986         (API::ProcessPoolConfiguration::ProcessPoolConfiguration): Fixing typo.
2987
2988 2017-08-25  Jonathan Bedard  <jbedard@apple.com>
2989
2990         Fix build breakage with Public iOS 11 SDK
2991         https://bugs.webkit.org/show_bug.cgi?id=175960
2992         <rdar://problem/34069264>
2993
2994         Reviewed by Wenson Hsieh.
2995
2996         * Platform/spi/ios/UIKitSPI.h: Add UIURLDragPreviewView declaration.
2997
2998 2017-08-24  Chris Dumez  <cdumez@apple.com>
2999
3000         [Directory Upload] Add basic support for input.webkitdirectory
3001         https://bugs.webkit.org/show_bug.cgi?id=175950
3002         <rdar://problem/33951915>
3003
3004         Reviewed by Geoffrey Garen.
3005
3006         Add private API to toggle Directory Upload support.
3007
3008         Add new member to WKOpenPanelParameters to communicate to the
3009         client that the file picker should allow selecting directories.
3010
3011         * Shared/WebCoreArgumentCoders.cpp:
3012         (IPC::ArgumentCoder<FileChooserSettings>::encode):
3013         (IPC::ArgumentCoder<FileChooserSettings>::decode):
3014         * Shared/WebPreferencesDefinitions.h:
3015         * UIProcess/API/APIOpenPanelParameters.h:
3016         (API::OpenPanelParameters::allowDirectories const):
3017         * UIProcess/API/C/WKOpenPanelParametersRef.cpp:
3018         (WKOpenPanelParametersGetAllowsDirectories):
3019         * UIProcess/API/C/WKOpenPanelParametersRef.h:
3020         * UIProcess/API/C/WKPreferences.cpp:
3021         (WKPreferencesSetDirectoryUploadEnabled):
3022         (WKPreferencesGetDirectoryUploadEnabled):
3023         * UIProcess/API/C/WKPreferencesRefPrivate.h:
3024         * UIProcess/API/Cocoa/WKOpenPanelParameters.h:
3025         * UIProcess/API/Cocoa/WKOpenPanelParameters.mm:
3026         (-[WKOpenPanelParameters allowsDirectories]):
3027         * WebProcess/WebPage/WebPage.cpp:
3028         (WebKit::WebPage::updatePreferences):
3029
3030 2017-08-24  Youenn Fablet  <youenn@apple.com>
3031
3032         [Cache API] UIProcess should provide the directory path where to store Cache Storage data
3033         https://bugs.webkit.org/show_bug.cgi?id=175884
3034
3035         Reviewed by Brady Eidson.
3036
3037         Adding API to set the cache storage directory path.
3038         Updating IPC to pass this parameter with its sandbox extension to NetworkProcess at creation time.
3039
3040         * NetworkProcess/NetworkProcess.h:
3041         (WebKit::NetworkProcess::cacheStorageDirectory const):
3042         * NetworkProcess/NetworkProcessCreationParameters.cpp:
3043         (WebKit::NetworkProcessCreationParameters::encode const):
3044         (WebKit::NetworkProcessCreationParameters::decode):
3045         * NetworkProcess/NetworkProcessCreationParameters.h:
3046         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3047         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
3048         * UIProcess/API/APIProcessPoolConfiguration.cpp:
3049         (API::ProcessPoolConfiguration::createWithLegacyOptions):
3050         (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
3051         (API::ProcessPoolConfiguration::ProcessPoolConfiguration):
3052         (API::ProcessPoolConfiguration::copy):
3053         * UIProcess/API/APIProcessPoolConfiguration.h:
3054         * UIProcess/API/APIWebsiteDataStore.h:
3055         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
3056         (API::WebsiteDataStore::defaultCacheStorageDirectory):
3057         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3058         (WebKit::WebProcessPool::legacyPlatformDefaultCacheStorageDirectory):
3059         * UIProcess/WebProcessPool.cpp:
3060         (WebKit::legacyWebsiteDataStoreConfiguration):
3061         (WebKit::WebProcessPool::ensureNetworkProcess):
3062         * UIProcess/WebProcessPool.h:
3063         * UIProcess/WebsiteData/WebsiteDataStore.h:
3064
3065 2017-08-24  Alex Christensen  <achristensen@webkit.org>
3066
3067         Add WKUIDelegatePrivate equivalent of WKPageUIClient's handleAutoplayEvent
3068         https://bugs.webkit.org/show_bug.cgi?id=175965
3069         <rdar://problem/29270035>
3070
3071         Reviewed by Tim Horton.
3072
3073         Covered by updating API tests to use UIDelegate instead of _pageForTesting and WKPageUIClient.
3074
3075         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
3076         * UIProcess/Cocoa/UIDelegate.h:
3077         * UIProcess/Cocoa/UIDelegate.mm:
3078         (WebKit::UIDelegate::setDelegate):
3079         (WebKit::toWKFocusDirection):
3080         (WebKit::toWKAutoplayEventFlags):
3081         (WebKit::toWKAutoplayEvent):
3082         (WebKit::UIDelegate::UIClient::handleAutoplayEvent):
3083
3084 2017-08-24  Brady Eidson  <beidson@apple.com>
3085
3086         Remove duplicate WebCore::URL encoder/decoder
3087         https://bugs.webkit.org/show_bug.cgi?id=175952
3088
3089         Reviewed by Chris Dumez.
3090
3091         Don't need the WebCoreArgumentCoder in WebKit since the URL class defines its own coders.
3092
3093         * Shared/WebCoreArgumentCoders.cpp:
3094         (IPC::ArgumentCoder<URL>::encode): Deleted.
3095         (IPC::ArgumentCoder<URL>::decode): Deleted.
3096         * Shared/WebCoreArgumentCoders.h:
3097
3098 2017-08-24  Alex Christensen  <achristensen@webkit.org>
3099
3100         Add WKUIDelegatePrivate callback corresponding to PageUIClient's didNotHandleWheelEvent
3101         https://bugs.webkit.org/show_bug.cgi?id=175957
3102         <rdar://problem/29270035>
3103
3104         Reviewed by Geoffrey Garen.
3105
3106         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
3107         * UIProcess/Cocoa/UIDelegate.h:
3108         * UIProcess/Cocoa/UIDelegate.mm:
3109         (WebKit::UIDelegate::setDelegate):
3110         (WebKit::UIDelegate::UIClient::didNotHandleWheelEvent):
3111
3112 2017-08-24  Tim Horton  <timothy_horton@apple.com>
3113
3114         Overflow scroll views are inset to avoid safe areas even if the parent view is not
3115         https://bugs.webkit.org/show_bug.cgi?id=175949
3116         <rdar://problem/34063057>
3117
3118         Reviewed by Beth Dakin.
3119
3120         * UIProcess/ios/RemoteLayerTreeHostIOS.mm:
3121         (WebKit::RemoteLayerTreeHost::createLayer):
3122         Disable automatic content inset adjustment to avoid safe areas on
3123         all of WKWebView's child UIScrollViews.
3124
3125 2017-08-24  Tim Horton  <timothy_horton@apple.com>
3126
3127         Layout size override changes during in-flight animated resize are dropped on the floor forever
3128         https://bugs.webkit.org/show_bug.cgi?id=175916
3129         <rdar://problem/33887295>
3130
3131         Reviewed by Beth Dakin.
3132
3133         Layout size override changes that come in during an animated resize
3134         are currently stored, but not sent in a separate message, because
3135         they're sent as part of the resize. However, if a layout size override
3136         change happens after the animated resize message was already sent, but
3137         before the animated resize is ended, that change will be stored, but
3138         not sent in the animated resize message (because it's too late), and
3139         then subsequent calls with the same size will early-return, because
3140         we're testing against the stored size, not the size we last actually
3141         sent to the Web Content process.
3142
3143         Instead, store the last-sent size, so that subsequent layout size override
3144         changes with the same size won't bail, and if it differs from the active
3145         state after the animated resize completes, send an out-of-band update.
3146
3147         All of the above also applies to device orientation, which follows
3148         exactly the same pattern.
3149
3150         * UIProcess/API/Cocoa/WKWebView.mm:
3151         (-[WKWebView _initializeWithConfiguration:]):
3152         (-[WKWebView _dispatchSetMinimumLayoutSize:]):
3153         (-[WKWebView _dispatchSetMaximumUnobscuredSize:]):
3154         (-[WKWebView _dispatchSetDeviceOrientation:]):
3155         (-[WKWebView _frameOrBoundsChanged]):
3156         (-[WKWebView _windowDidRotate:]):
3157         (-[WKWebView _didRelaunchProcess]):
3158         (-[WKWebView _setMinimumLayoutSizeOverride:]):
3159         (-[WKWebView _setInterfaceOrientationOverride:]):
3160         (-[WKWebView _setMaximumUnobscuredSizeOverride:]):
3161         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
3162
3163 2017-08-24  Tim Horton  <timothy_horton@apple.com>
3164
3165         _WKThumbnailView snapshots have to be copied by CA on first commit due to bad row alignment
3166         https://bugs.webkit.org/show_bug.cgi?id=175898
3167         <rdar://problem/34029673>
3168
3169         Reviewed by Sam Weinig.
3170
3171         In order to avoid copying, CGImages used as layer contents need to have certain
3172         alignment requirements fulfilled. Align the row stride to the desired value.
3173
3174         * Shared/ShareableBitmap.cpp:
3175         (WebKit::ShareableBitmap::create):
3176         (WebKit::ShareableBitmap::createShareable):
3177         (WebKit::ShareableBitmap::numBytesForSize):
3178         (WebKit::ShareableBitmap::calculateBytesPerPixel): Deleted.
3179         * Shared/ShareableBitmap.h:
3180         (WebKit::ShareableBitmap::sizeInBytes const):
3181         (WebKit::ShareableBitmap::numBytesForSize): Deleted.
3182         Merge the interfaces of numBytesPerSize and sizeInBytes between the platforms.
3183         numBytesForSize now makes use of the new calculateBytesPerRow, which is
3184         implemented by each platform ShareableBitmap implementation to do the
3185         requisite alignment for that platform.
3186
3187         * Shared/cairo/ShareableBitmapCairo.cpp:
3188         (WebKit::ShareableBitmap::calculateBytesPerRow):
3189         (WebKit::ShareableBitmap::calculateBytesPerPixel):
3190         (WebKit::createSurfaceFromData):
3191         (WebKit::ShareableBitmap::numBytesForSize): Deleted.
3192         Implement calculateBytesPerRow (which used to be hidden inside of numBytesForSize)
3193         and get rid of the now-duplicative numBytesForSize.
3194
3195         * Shared/cg/ShareableBitmapCG.cpp:
3196         (WebKit::ShareableBitmap::calculateBytesPerRow):
3197         (WebKit::ShareableBitmap::createGraphicsContext):
3198         (WebKit::ShareableBitmap::createCGImage const):
3199         Implement calculateBytesPerRow and make use of it when providing a row stride
3200         to CoreGraphics.
3201
3202 2017-08-24  Chris Dumez  <cdumez@apple.com>
3203
3204         [iOS] ViewServices started by StoreKitUIService may get suspended unexpectedly
3205         https://bugs.webkit.org/show_bug.cgi?id=175922
3206         <rdar://problem/34028921>
3207
3208         Reviewed by Tim Horton.
3209
3210         ViewServices started by StoreKitUIService may get suspended unexpectedly. This is
3211         because StoreKitUIService is itself a ViewService and is therefore in the background.
3212         To address the issue, treat StoreKitUIService as initially foreground in
3213         ApplicationStateTracker so that its ViewServices do not get suspended. We don't
3214         have good way to deal with ViewServices started by other ViewServices unfortunately.
3215
3216         * Platform/spi/ios/UIKitSPI.h:
3217         * UIProcess/ApplicationStateTracker.mm:
3218         (WebKit::ApplicationStateTracker::ApplicationStateTracker):
3219
3220 2017-08-23  Youenn Fablet  <youenn@apple.com>
3221
3222         [Cache API] Unify WebCore and WebKit error handling
3223         https://bugs.webkit.org/show_bug.cgi?id=175902
3224
3225         Reviewed by Alex Christensen.
3226
3227         Removing all callbacks and error definitions from WebKit
3228         and reusing DOMCache ones instead.
3229
3230         * NetworkProcess/cache/CacheStorage.h: Removed.
3231         * NetworkProcess/cache/CacheStorageEngine.cpp:
3232         (WebKit::CacheStorage::Engine::caches const):
3233         (WebKit::CacheStorage::Engine::queryCache):
3234         * NetworkProcess/cache/CacheStorageEngine.h:
3235         * NetworkProcess/cache/CacheStorageEngineCache.h:
3236         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
3237         (WebKit::CacheStorageEngineConnection::open):
3238         (WebKit::CacheStorageEngineConnection::remove):
3239         (WebKit::CacheStorageEngineConnection::putRecords):
3240         * NetworkProcess/cache/CacheStorageEngineConnection.h:
3241         * NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
3242         * Shared/WebCoreArgumentCoders.cpp:
3243         (IPC::ArgumentCoder<DOMCache::CacheInfo>::encode):
3244         (IPC::ArgumentCoder<DOMCache::CacheInfo>::decode):
3245         (IPC::ArgumentCoder<DOMCache::Record>::encode):
3246         (IPC::ArgumentCoder<DOMCache::Record>::decode):
3247         * Shared/WebCoreArgumentCoders.h:
3248         * WebProcess/Cache/WebCacheStorageConnection.cpp:
3249         (WebKit::WebCacheStorageConnection::doBatchPutOperation):
3250         (WebKit::WebCacheStorageConnection::openCompleted):
3251         (WebKit::WebCacheStorageConnection::removeCompleted):
3252         (WebKit::WebCacheStorageConnection::updateCaches):
3253         (WebKit::WebCacheStorageConnection::updateRecords):
3254         (WebKit::WebCacheStorageConnection::deleteRecordsCompleted):
3255         (WebKit::WebCacheStorageConnection::putRecordsCompleted):
3256         * WebProcess/Cache/WebCacheStorageConnection.h:
3257         * WebProcess/Cache/WebCacheStorageConnection.messages.in:
3258
3259 2017-08-23  Alex Christensen  <achristensen@webkit.org>
3260
3261         Clean up UIClients
3262         https://bugs.webkit.org/show_bug.cgi?id=175906
3263
3264         Reviewed by Tim Horton.
3265
3266         There were some unnecessary checks to see if the client implements something,
3267         when the default behavior is to do nothing if the client doesn't implement the callback.
3268         Also, make some overrides finals and fix some spacing.
3269
3270         * UIProcess/API/APIUIClient.h:
3271         (API::UIClient::didNotHandleKeyEvent):
3272         (API::UIClient::implementsDidNotHandleKeyEvent const): Deleted.
3273         (API::UIClient::implementsDidNotHandleWheelEvent const): Deleted.
3274         * UIProcess/API/C/WKPage.cpp:
3275         (WKPageSetPageUIClient):
3276         * UIProcess/Cocoa/UIDelegate.h:
3277         * UIProcess/WebPageProxy.cpp:
3278         (WebKit::WebPageProxy::didReceiveEvent):
3279
3280 2017-08-23  Alex Christensen  <achristensen@webkit.org>
3281
3282         Add WKUIDelegatePrivate callbacks corresponding to WKPageUIClient's takeFocus, focus, and unfocus
3283         https://bugs.webkit.org/show_bug.cgi?id=175896
3284
3285         Reviewed by Tim Horton.
3286         
3287         I also renamed _webViewShow to _showWebView based on feedback from https://bugs.webkit.org/show_bug.cgi?id=175797
3288
3289         Added an API test.
3290
3291         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
3292         * UIProcess/Cocoa/UIDelegate.h:
3293         * UIProcess/Cocoa/UIDelegate.mm:
3294         (WebKit::UIDelegate::setDelegate):
3295         (WebKit::toWKFocusDirection):
3296         (WebKit::UIDelegate::UIClient::takeFocus):
3297         (WebKit::UIDelegate::UIClient::focus):
3298         (WebKit::UIDelegate::UIClient::unfocus):
3299         (WebKit::UIDelegate::UIClient::showPage):
3300
3301 2017-08-23  Youenn Fablet  <youenn@apple.com>
3302
3303         [CacheAPI] Introduce a WebKit::CacheStorage namespace
3304         https://bugs.webkit.org/show_bug.cgi?id=175885
3305
3306         Reviewed by Alex Christensen.
3307
3308         Introducing WebKit::CacheStorage namespace.
3309         Splitting CacheStorageEngine.h in three files.
3310         Updating client code accordingly.
3311
3312         * NetworkProcess/cache/CacheStorage.h: Added.
3313         * NetworkProcess/cache/CacheStorageEngine.cpp:
3314         (WebKit::CacheStorage::globalEngineMap):
3315         (WebKit::CacheStorage::Engine::from):
3316         (WebKit::CacheStorage::Engine::destroyEngine):
3317         (WebKit::CacheStorage::Engine::defaultEngine):
3318         (WebKit::CacheStorage::Engine::open):
3319         (WebKit::CacheStorage::Engine::remove):
3320         (WebKit::CacheStorage::Engine::retrieveCaches):
3321         (WebKit::CacheStorage::Engine::retrieveRecords):
3322         (WebKit::CacheStorage::Engine::putRecords):
3323         (WebKit::CacheStorage::Engine::deleteMatchingRecords):
3324         (WebKit::CacheStorage::Engine::writeCachesToDisk):
3325         (WebKit::CacheStorage::Engine::readCachesFromDisk):
3326         (WebKit::CacheStorage::Engine::readCache):
3327         (WebKit::CacheStorage::Engine::writeCacheRecords):
3328         (WebKit::CacheStorage::Engine::removeCacheRecords):
3329         (WebKit::CacheStorage::Engine::cache):
3330         (WebKit::CacheStorage::Engine::caches const):
3331         (WebKit::CacheStorage::Engine::queryCache):
3332         * NetworkProcess/cache/CacheStorageEngineCache.h: Added.
3333         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
3334         (WebKit::CacheStorageEngineConnection::open):
3335         (WebKit::CacheStorageEngineConnection::remove):
3336         (WebKit::CacheStorageEngineConnection::caches):
3337         (WebKit::CacheStorageEngineConnection::records):
3338         (WebKit::CacheStorageEngineConnection::deleteMatchingRecords):
3339         (WebKit::CacheStorageEngineConnection::putRecords):
3340         * WebKit.xcodeproj/project.pbxproj:
3341         * WebProcess/Cache/WebCacheStorageConnection.cpp:
3342         (WebKit::WebCacheStorageConnection::openCompleted):
3343         (WebKit::WebCacheStorageConnection::removeCompleted):
3344         (WebKit::WebCacheStorageConnection::updateCaches):
3345         (WebKit::WebCacheStorageConnection::updateRecords):
3346         (WebKit::WebCacheStorageConnection::deleteRecordsCompleted):
3347         (WebKit::WebCacheStorageConnection::putRecordsCompleted):
3348         * WebProcess/Cache/WebCacheStorageConnection.h:
3349
3350 2017-08-23  Youenn Fablet  <youenn@apple.com>
3351
3352         [Cache API] Enable persistent coder to encode FetchOptions
3353         https://bugs.webkit.org/show_bug.cgi?id=175883
3354
3355         Reviewed by Alex Christensen.
3356
3357         Removing FetchOptions related ArgumentCoders specific code.
3358
3359         * Shared/WebCoreArgumentCoders.cpp:
3360         * Shared/WebCoreArgumentCoders.h:
3361
3362 2017-08-23  Youenn Fablet  <youenn@apple.com>
3363
3364         CacheStorageEngine readCachesFromDisk callback should return the read Caches
3365         https://bugs.webkit.org/show_bug.cgi?id=175882
3366
3367         Reviewed by Alex Christensen.
3368
3369         Callback of readCachesFromDisk takes now a Caches or error parameter.
3370
3371         * NetworkProcess/cache/CacheStorageEngine.cpp:
3372         (WebKit::CacheStorageEngine::open):
3373         (WebKit::CacheStorageEngine::retrieveCaches):
3374         (WebKit::CacheStorageEngine::readCachesFromDisk):
3375         * NetworkProcess/cache/CacheStorageEngine.h:
3376
3377 2017-08-23  Chris Dumez  <cdumez@apple.com>
3378
3379         Regression(r221059): NetworkDataTask::didReceiveResponse() should not use PolicyUse for HTTP/0.9
3380         https://bugs.webkit.org/show_bug.cgi?id=175872
3381
3382         Reviewed by Daniel Bates.
3383
3384         r221059 was calling the ResponseCompletionHandler with {} which ended up being
3385         PolicyUse. Since this is an error case and do not want to receive the data, it
3386         makes more sense to use PolicyIgnore instead. There should not be a behavior
3387         change on WebKit side though since we are cancelling the load right after
3388         calling the completion handler anyway.
3389
3390         Tests under http/tests/security/http-0.9/ are still passing.
3391
3392         * NetworkProcess/NetworkDataTask.cpp:
3393         (WebKit::NetworkDataTask::didReceiveResponse):
3394
3395 2017-08-22  Tim Horton  <timothy_horton@apple.com>
3396
3397         _WKThumbnailView should use the screen color space instead of sRGB
3398         https://bugs.webkit.org/show_bug.cgi?id=175858
3399         <rdar://problem/33925559>
3400
3401         Reviewed by Dean Jackson.
3402
3403         Currently, _WKThumbnailView uses software snapshotting via
3404         WebPage's takeSnapshot and friends, which always use sRGB.
3405         However, it is immediately presented in display space, which
3406         causes an expensive color conversion, which could have been avoided