88d4475bbfd551f76719b075a67f48d7cdec39fa
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2018-05-09  Brent Fulgham  <bfulgham@apple.com>
2
3         Restrict unarchiving of bundle parameters to a set of known classes
4         https://bugs.webkit.org/show_bug.cgi?id=185489
5         <rdar://problem/21912401>
6
7         Reviewed by Ryosuke Niwa.
8
9         Stop accepting anything derived from NSObject, and instead only agree to unarchive objects
10         from a set of things we actually pass as InjectedBundle parameters.
11
12         * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
13         (WebKit::InjectedBundle::setBundleParameter):
14
15 2018-05-09  Richard Houle  <rhoule@apple.com>
16
17         [Cocoa] Some fields are not identified as [WKWebProcessPlugInNodeHandle isTextField]
18         https://bugs.webkit.org/show_bug.cgi?id=185260
19         <rdar://problem/39290394>
20
21         INPUT element are not considered to be text fields when
22         calling -[WKWebProcessPlugInNodeHandle isTextField]
23         when they are of type number.
24
25         Reviewed by Tim Horton.
26
27         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
28         (WebKit::InjectedBundleNodeHandle::isTextField const):
29
30 2018-05-09  Youenn Fablet  <youenn@apple.com>
31
32         Allow WebResourceLoader to cancel a load served from a service worker
33         https://bugs.webkit.org/show_bug.cgi?id=185274
34
35         Reviewed by Chris Dumez.
36
37         Use FetchIdentifier instead of uint64_t.
38         Add IPC support for cancelling a fetch from WebProcess to service worker process.
39         Ask service worker process to cancel the fetch when its corresponding WebResourceLoader is cancelled.
40         No change of behavior as once a WebResourceLoader is cancelled, any related IPC is not processed.
41         A follow-up patch should try to cancel the FetchResponse load, meaning to either cancel the network load
42         or to abort reading the readable stream.
43
44         * Scripts/webkit/messages.py:
45         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
46         (WebKit::WebSWServerConnection::cancelFetch):
47         (WebKit::WebSWServerConnection::startFetch):
48         (WebKit::WebSWServerConnection::didReceiveFetchResponse):
49         (WebKit::WebSWServerConnection::didReceiveFetchData):
50         (WebKit::WebSWServerConnection::didReceiveFetchFormData):
51         (WebKit::WebSWServerConnection::didFinishFetch):
52         (WebKit::WebSWServerConnection::didFailFetch):
53         (WebKit::WebSWServerConnection::didNotHandleFetch):
54         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
55         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
56         * StorageProcess/StorageProcess.cpp:
57         (WebKit::StorageProcess::didFailFetch):
58         (WebKit::StorageProcess::didNotHandleFetch):
59         (WebKit::StorageProcess::didReceiveFetchResponse):
60         (WebKit::StorageProcess::didReceiveFetchData):
61         (WebKit::StorageProcess::didReceiveFetchFormData):
62         (WebKit::StorageProcess::didFinishFetch):
63         * StorageProcess/StorageProcess.h:
64         * StorageProcess/StorageProcess.messages.in:
65         * WebProcess/Network/WebLoaderStrategy.cpp:
66         (WebKit::WebLoaderStrategy::remove):
67         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
68         (WebKit::ServiceWorkerClientFetch::create):
69         (WebKit::ServiceWorkerClientFetch::ServiceWorkerClientFetch):
70         (WebKit::ServiceWorkerClientFetch::start):
71         (WebKit::ServiceWorkerClientFetch::cancel):
72         * WebProcess/Storage/ServiceWorkerClientFetch.h:
73         * WebProcess/Storage/WebSWClientConnection.cpp:
74         (WebKit::WebSWClientConnection::startFetch):
75         (WebKit::WebSWClientConnection::cancelFetch):
76         * WebProcess/Storage/WebSWClientConnection.h:
77         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
78         (WebKit::WebSWContextManagerConnection::cancelFetch):
79         (WebKit::WebSWContextManagerConnection::startFetch):
80         * WebProcess/Storage/WebSWContextManagerConnection.h:
81         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
82         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
83         (WebKit::WebServiceWorkerFetchTaskClient::WebServiceWorkerFetchTaskClient):
84         (WebKit::WebServiceWorkerFetchTaskClient::cancel):
85         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:
86         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
87         (WebKit::WebServiceWorkerProvider::handleFetch):
88         (WebKit::WebServiceWorkerProvider::cancelFetch):
89         (WebKit::WebServiceWorkerProvider::fetchFinished):
90         * WebProcess/Storage/WebServiceWorkerProvider.h:
91
92 2018-05-09  Andy Estes  <aestes@apple.com>
93
94         [iOS] Consider the annotation bounds when positioning action sheets near long-pressed PDF links
95         https://bugs.webkit.org/show_bug.cgi?id=185472
96         <rdar://problem/39967092>
97
98         Reviewed by Daniel Bates.
99
100         Adopted new PDFHostViewControllerDelegate methods that include annotation rects
101         when URLs and page indices are long-pressed. This allows us to avoid obscuring
102         annotations when positioning action sheet popovers.
103
104         We also no longer need to convert the press location into host view coordinate
105         space, as PDFKit now does that for us.
106
107         * UIProcess/ios/WKPDFView.mm:
108         (-[WKPDFView _showActionSheetForURL:atLocation:withAnnotationRect:]):
109         (-[WKPDFView pdfHostViewController:didLongPressURL:atLocation:withAnnotationRect:]):
110         (-[WKPDFView pdfHostViewController:didLongPressPageIndex:atLocation:withAnnotationRect:]):
111         (-[WKPDFView _showActionSheetForURL:atLocation:]): Deleted.
112         (-[WKPDFView pdfHostViewController:didLongPressURL:atLocation:]): Deleted.
113         (-[WKPDFView pdfHostViewController:didLongPressPageIndex:atLocation:]): Deleted.
114
115 2018-05-09  Andy Estes  <aestes@apple.com>
116
117         [iOS] Tell PDFHostViewController when animated resizes begin and end
118         https://bugs.webkit.org/show_bug.cgi?id=185477
119         <rdar://problem/39875372>
120
121         Reviewed by Anders Carlsson.
122
123         * UIProcess/API/Cocoa/WKWebView.mm:
124         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
125         (-[WKWebView _endAnimatedResize]):
126         * UIProcess/Cocoa/WKWebViewContentProvider.h:
127         * UIProcess/ios/WKPDFView.mm:
128         (-[WKPDFView web_beginAnimatedResize]):
129         (-[WKPDFView web_endAnimatedResize]):
130
131 2018-05-09  Michael Catanzaro  <mcatanzaro@igalia.com>
132
133         Unreviewed. Update OptionsWPE.cmake and NEWS for 2.21.1 release.
134
135         * wpe/NEWS: Added. Add release notes for 2.21.1.
136
137 2018-05-09  Michael Catanzaro  <mcatanzaro@igalia.com>
138
139         [WPE] Build cleanly with GCC 8 and ICU 60
140         https://bugs.webkit.org/show_bug.cgi?id=185462
141
142         Reviewed by Carlos Alberto Lopez Perez.
143
144         * Platform/IPC/glib/GSocketMonitor.cpp:
145         (IPC::GSocketMonitor::start): Silence -Wcast-function-type warning.
146         * Shared/API/glib/WebKitContextMenu.cpp:
147         (webkit_context_menu_new_with_items): Ditto.
148
149 2018-05-08  Sihui Liu  <sihui_liu@apple.com>
150
151         Adopt new async _savecookies SPI for keeping networking process active during flushing cookies
152         https://bugs.webkit.org/show_bug.cgi?id=185261
153         <rdar://problem/37214391>
154
155         Reviewed by Chris Dumez.
156
157         By adopting new async SPI _savecookies, we can keep networking process active(not suspended)
158         until cookies are fully synced to disk with process assertion.
159
160         * NetworkProcess/NetworkProcess.cpp:
161         (WebKit::NetworkProcess::didSyncAllCookies):
162         * NetworkProcess/NetworkProcess.h:
163         * NetworkProcess/NetworkProcess.messages.in:
164         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
165         (WebKit::NetworkProcess::syncAllCookies):
166         * UIProcess/Network/NetworkProcessProxy.cpp:
167         (WebKit::NetworkProcessProxy::didClose):
168         (WebKit::NetworkProcessProxy::syncAllCookies):
169         (WebKit::NetworkProcessProxy::didSyncAllCookies):
170         * UIProcess/Network/NetworkProcessProxy.h:
171         * UIProcess/Network/NetworkProcessProxy.messages.in:
172         * UIProcess/WebProcessPool.cpp:
173         (WebKit::WebProcessPool::syncNetworkProcessCookies):
174
175 2018-05-08  Per Arne Vollan  <pvollan@apple.com>
176
177         Set colorspace in the PDF plugin.
178         https://bugs.webkit.org/show_bug.cgi?id=185445
179         <rdar://problem/40030981>
180
181         Reviewed by Simon Fraser.
182
183         * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h:
184         * WebProcess/Plugins/PDF/PDFPlugin.mm:
185         (WebKit::PDFPlugin::PDFPlugin):
186
187 2018-05-08  Megan Gardner  <megan_gardner@apple.com>
188
189         Don't clear selection until we are actually interacting with a Node.
190         https://bugs.webkit.org/show_bug.cgi?id=185455
191
192         Reviewed by Wenson Hsieh.
193         
194         The presence of TextInteractionAssistant should not be used as a proxy for it we are actually editing content.
195         We need to check to see if we have an active node, and then we should clear the selection.
196
197         * UIProcess/ios/WKContentViewInteraction.mm:
198         (-[WKContentView setSelectedTextRange:]):
199
200 2018-05-08  Ryan Haddad  <ryanhaddad@apple.com>
201
202         Unreviewed, rolling out r231486.
203
204         Caused service worker LayoutTest failures on macOS Debug WK2.
205
206         Reverted changeset:
207
208         "Allow WebResourceLoader to cancel a load served from a
209         service worker"
210         https://bugs.webkit.org/show_bug.cgi?id=185274
211         https://trac.webkit.org/changeset/231486
212
213 2018-05-08  Andy Estes  <aestes@apple.com>
214
215         [iOS] _WKWebViewPrintFormatter should return a page count of 0 for PDF documents that do not allow printing
216         https://bugs.webkit.org/show_bug.cgi?id=185133
217
218         Reviewed by Andreas Kling.
219
220         * UIProcess/ios/WKPDFView.mm:
221         (-[WKPDFView _ensureDocumentForPrinting]):
222         (-[WKPDFView _wk_pageCountForPrintFormatter:]):
223         (-[WKPDFView _wk_printedDocument]):
224
225 2018-05-08  Andy Estes  <aestes@apple.com>
226
227         [iOS] WKPDFView remains in the view hierarchy after navigating away
228         https://bugs.webkit.org/show_bug.cgi?id=185449
229         <rdar://problem/39693469>
230
231         Reviewed by Tim Horton.
232
233         WKPDFView removes the PDF host view from the view hierarchy in its -dealloc
234         method, and relies on WKWebView releasing its last reference in
235         -_setHasCustomContentView:loadedMIMEType: when the user navigates.
236
237         However, WKWPDFView was capturing a strong reference to self in the block passed
238         to +[PDFHostViewController createHostView:forExtensionIdentifier:], and PDFKit
239         (actually UIKit) is retaining this block beyond its being called. This results in
240         the PDF host view remaining as a child of the WKScrollView even after the user
241         navigates to another page.
242
243         Changed the aforementioned block to a lambda that captures a weak reference to
244         self to prevent WKPDFView from outliving the current navigation.
245
246         * UIProcess/ios/WKPDFView.mm:
247         (-[WKPDFView retain]):
248         (-[WKPDFView web_setContentProviderData:suggestedFilename:]):
249
250 2018-05-08  John Wilander  <wilander@apple.com>
251
252         Storage Access API: Make user opt-in sticky
253         https://bugs.webkit.org/show_bug.cgi?id=185454
254         <rdar://problem/40003946>
255
256         Reviewed by Alex Christensen.
257
258         This patch persists the user's choice to opt-in to access under specific domains.
259         Such storage access should age out with the accessing domain's cookies and website
260         data. The opt-in prompt is still an experimental feature.
261
262         * UIProcess/WebResourceLoadStatisticsStore.cpp:
263         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
264         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
265         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
266         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
267         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccessInternal):
268         (WebKit::WebResourceLoadStatisticsStore::hasUserGrantedStorageAccessThroughPrompt const):
269         (WebKit::WebResourceLoadStatisticsStore::hasHadUnexpiredRecentUserInteraction const):
270         * UIProcess/WebResourceLoadStatisticsStore.h:
271
272 2018-05-08  Daniel Bates  <dabates@apple.com>
273
274         Do not apply X-Frame-Options and CSP frame-ancestors to Quick Look-applicable responses in NetworkProcess
275         https://bugs.webkit.org/show_bug.cgi?id=185442
276         <rdar://problem/40067209>
277
278         Reviewed by Andy Estes.
279
280         Just as we exempt responses in WebContent process that will be handled by Quick Look from the Content
281         Security Policy frame-ancestors directive and X-Frame-Options checking we need to do the same when
282         such checks are performed in NetworkProcess following r231479.
283
284         HTTP responses that will be previewed using Quick Look are not considered web pages and are subject
285         to the security model for Quick Look documents. That is, they are exempt from Content Security Policy
286         and X-Frame-Options processing.
287
288         * NetworkProcess/NetworkResourceLoader.cpp:
289         (WebKit::NetworkResourceLoader::shouldInterruptLoadForCSPFrameAncestorsOrXFrameOptions):
290
291 2018-05-08  Brian Burg  <bburg@apple.com>
292
293         REGRESSION(r230743): Mousemove events are not coalesced properly, mousemove/drag is very laggy
294         https://bugs.webkit.org/show_bug.cgi?id=185425
295         <rdar://problem/39323336>
296
297         Reviewed by Simon Fraser.
298
299         When mousemove events come in faster than they can be processed, we should coalesce
300         pending mousemoves that have not yet been sent to WebProcess. This has the effect of
301         processing the most recent mousemove location, which is the old behavior that regressed.
302
303         * UIProcess/WebPageProxy.cpp:
304         (WebKit::WebPageProxy::handleMouseEvent):
305         If there is >1 event in the mouse queue, then the first one is being processed by WebProcess
306         and the second one is eligible for coalescing. Replace it if the last event and new event
307         are both mousemoves.
308
309 2018-05-08  Per Arne Vollan  <pvollan@apple.com>
310
311         The PDF context menu should not be created in the WebContent process.
312         https://bugs.webkit.org/show_bug.cgi?id=185401
313
314         Reviewed by Tim Horton.
315
316         Send a sync IPC message from the WebContent process to the UI process with the necessary context
317         menu information when the menu is requested. The NSMenu will then be created and shown in the
318         UI process. The reply will contain the selected menu item index.
319
320         * Shared/mac/PDFContextMenu.h: Added.
321         (WebKit::PDFContextMenuItem::encode const):
322         (WebKit::PDFContextMenuItem::decode):
323         (WebKit::PDFContextMenu::encode const):
324         (WebKit::PDFContextMenu::decode):
325         * UIProcess/WebPageProxy.h:
326         * UIProcess/WebPageProxy.messages.in:
327         * UIProcess/mac/WebPageProxyMac.mm:
328         (-[WKPDFMenuTarget menuItem]):
329         (-[WKPDFMenuTarget contextMenuAction:]):
330         (WebKit::WebPageProxy::showPDFContextMenu):
331         * WebKit.xcodeproj/project.pbxproj:
332         * WebProcess/Plugins/PDF/PDFPlugin.mm:
333         (WebKit::PDFPlugin::handleContextMenuEvent):
334
335 2018-05-08  Dean Jackson  <dino@apple.com>
336
337         System Preview links should trigger a download
338         https://bugs.webkit.org/show_bug.cgi?id=185439
339         <rdar://problem/40065545>
340
341         Reviewed by Jon Lee.
342
343         Encode the new field identifying a system preview. And
344         if you encounter such a resource request, trigger
345         a download.
346
347         * Shared/WebCoreArgumentCoders.cpp:
348         (IPC::ArgumentCoder<ResourceRequest>::encode):
349         (IPC::ArgumentCoder<ResourceRequest>::decode):
350         * UIProcess/WebPageProxy.cpp:
351         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
352
353 2018-05-08  John Wilander  <wilander@apple.com>
354
355         Storage Access API: Add a request roundtrip to check whether prompting is needed
356         https://bugs.webkit.org/show_bug.cgi?id=185368
357         <rdar://problem/40011556>
358
359         Reviewed by Alex Christensen and Youenn Fablet.
360
361         This patch adds an enum WebKit::StorageAccessStatus to handle our three access
362         states:
363         - WebKit::StorageAccessStatus::CannotRequestAccess.
364             This means the domain is blocked from cookie access.
365         - WebKit::StorageAccessStatus::RequiresUserPrompt.
366             This means that access has not been granted yet and a prompt is required.
367         - WebKit::StorageAccessStatus::HasAccess.
368             This either means that this domain does not need to ask for access,
369             access was already granted, or access was granted now.
370
371         If the call to WebResourceLoadStatisticsStore::requestStorageAccess() comes
372         back as WebKit::StorageAccessStatus::RequiresUserPrompt, the WebPageProxy
373         prompts the user and if the user said yes, calls a direct
374         WebResourceLoadStatisticsStore::grantStorageAccess().
375
376         Existing test cases pass because requestStorageAccessConfirm in WKPage.cpp
377         does not have m_client.requestStorageAccessConfirm and thus returns true.
378
379         * UIProcess/Network/NetworkProcessProxy.messages.in:
380             Added a missing #endif.
381         * UIProcess/WebPageProxy.cpp:
382         (WebKit::WebPageProxy::requestStorageAccess):
383             Here we now handle the various cases encoded in WebKit::StorageAccessStatus.
384         * UIProcess/WebResourceLoadStatisticsStore.cpp:
385         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
386             Now covers the optional prompt case.
387         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
388         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
389         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccessInternal):
390             Granting access is broken out to allow WebKit::WebPageProxy to call it
391             directly.
392         * UIProcess/WebResourceLoadStatisticsStore.h:
393         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
394         (WebKit::WebsiteDataStore::requestStorageAccess):
395         (WebKit::WebsiteDataStore::grantStorageAccess):
396             Piping through calls from from WebKit::WebResourceLoadStatisticsStore
397             to WebKit::WebPageProxy.
398         * UIProcess/WebsiteData/WebsiteDataStore.h:
399
400 2018-05-08  Chris Dumez  <cdumez@apple.com>
401
402         Unreviewed, rolling out r231376 and r231458.
403
404         Caused some API tests failures on iOS
405
406         Reverted changesets:
407
408         "[iOS] Apps that are not visible may not get suspended if they
409         trigger page loads while in the background"
410         https://bugs.webkit.org/show_bug.cgi?id=185318
411         https://trac.webkit.org/changeset/231376
412
413         "[iOS] Release page load process assertion if the screen is
414         locked"
415         https://bugs.webkit.org/show_bug.cgi?id=185333
416         https://trac.webkit.org/changeset/231458
417
418 2018-05-08  Dean Jackson  <dino@apple.com>
419
420         Use thumbnails in System Previews
421         https://bugs.webkit.org/show_bug.cgi?id=185397
422         <rdar://problem/40039376>
423
424         Reviewed by Jon Lee.
425
426         A system preview that goes through the WKWebViewContentProvider will
427         show a static thumbnail/snapshot of the item, rather than jumping
428         directly to QuickLook.
429
430         This means we have to link to the AssetViewer framework. That provides
431         a ASVThumbnailView that will trigger QuickLook for us.
432
433         * Configurations/WebKit.xcconfig: Link to AssetViewer.
434
435         * UIProcess/ios/WKSystemPreviewView.h: Better macro use. Remove some unneeded protocols.
436         * UIProcess/ios/WKSystemPreviewView.mm:
437         (-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]): Update this
438         to use an ASVThumbnailView, when on the internal SDK (because it is private).
439         (-[WKSystemPreviewView _layoutThumbnailView]): Use the content insets to put
440         the thumbnail in the right place.
441         (-[WKSystemPreviewView thumbnailView:wantsToPresentPreviewController:forItem:]):
442         Delegate method.
443         (-[WKSystemPreviewView web_contentView]):
444         (-[WKSystemPreviewView web_computedContentInsetDidChange]):
445         (-[WKSystemPreviewView numberOfPreviewItemsInPreviewController:]): Deleted.
446         (-[WKSystemPreviewView previewController:previewItemAtIndex:]): Deleted.
447         (-[WKSystemPreviewView previewControllerWillDismiss:]): Deleted.
448
449 2018-05-08  Youenn Fablet  <youenn@apple.com>
450
451         Allow WebResourceLoader to cancel a load served from a service worker
452         https://bugs.webkit.org/show_bug.cgi?id=185274
453
454         Reviewed by Chris Dumez.
455
456         Use FetchIdentifier instead of uint64_t.
457         Add IPC support for cancelling a fetch from WebProcess to service worker process.
458         Ask service worker process to cancel the fetch when its corresponding WebResourceLoader is cancelled.
459         No change of behavior as once a WebResourceLoader is cancelled, any related IPC is not processed.
460         A follow-up patch should try to cancel the FetchResponse load, meaning to either cancel the network load
461         or to abort reading the readable stream.
462
463         * Scripts/webkit/messages.py:
464         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
465         (WebKit::WebSWServerConnection::cancelFetch):
466         (WebKit::WebSWServerConnection::startFetch):
467         (WebKit::WebSWServerConnection::didReceiveFetchResponse):
468         (WebKit::WebSWServerConnection::didReceiveFetchData):
469         (WebKit::WebSWServerConnection::didReceiveFetchFormData):
470         (WebKit::WebSWServerConnection::didFinishFetch):
471         (WebKit::WebSWServerConnection::didFailFetch):
472         (WebKit::WebSWServerConnection::didNotHandleFetch):
473         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
474         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
475         * StorageProcess/StorageProcess.cpp:
476         (WebKit::StorageProcess::didFailFetch):
477         (WebKit::StorageProcess::didNotHandleFetch):
478         (WebKit::StorageProcess::didReceiveFetchResponse):
479         (WebKit::StorageProcess::didReceiveFetchData):
480         (WebKit::StorageProcess::didReceiveFetchFormData):
481         (WebKit::StorageProcess::didFinishFetch):
482         * StorageProcess/StorageProcess.h:
483         * StorageProcess/StorageProcess.messages.in:
484         * WebProcess/Network/WebLoaderStrategy.cpp:
485         (WebKit::WebLoaderStrategy::remove):
486         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
487         (WebKit::ServiceWorkerClientFetch::create):
488         (WebKit::ServiceWorkerClientFetch::ServiceWorkerClientFetch):
489         (WebKit::ServiceWorkerClientFetch::start):
490         (WebKit::ServiceWorkerClientFetch::cancel):
491         * WebProcess/Storage/ServiceWorkerClientFetch.h:
492         * WebProcess/Storage/WebSWClientConnection.cpp:
493         (WebKit::WebSWClientConnection::startFetch):
494         (WebKit::WebSWClientConnection::cancelFetch):
495         * WebProcess/Storage/WebSWClientConnection.h:
496         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
497         (WebKit::WebSWContextManagerConnection::cancelFetch):
498         (WebKit::WebSWContextManagerConnection::startFetch):
499         * WebProcess/Storage/WebSWContextManagerConnection.h:
500         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
501         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
502         (WebKit::WebServiceWorkerFetchTaskClient::WebServiceWorkerFetchTaskClient):
503         (WebKit::WebServiceWorkerFetchTaskClient::cancel):
504         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:
505         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
506         (WebKit::WebServiceWorkerProvider::handleFetch):
507         (WebKit::WebServiceWorkerProvider::cancelFetch):
508         (WebKit::WebServiceWorkerProvider::fetchFinished):
509         * WebProcess/Storage/WebServiceWorkerProvider.h:
510
511 2018-05-08  Antti Koivisto  <antti@apple.com>
512
513         Don't use mapped cache files in case of Class A/B protected app
514         https://bugs.webkit.org/show_bug.cgi?id=185422
515         <rdar://problem/34001688>
516
517         Reviewed by Chris Dumez.
518
519         Currently we don't use shared memory maps in these cases. This still leaves us open for crashes
520         in the network process when the device is locked.
521
522         This patch disables use of blob storage (mapped cache files) in apps that use class A/B protection.
523         Normally we use blobs for resources > 16KB. Since use of shared memory is already disabled,
524         the only optimization lost for these apps is body data deduplication.
525
526         Any existing cache entries with blobs are ignored and deleted. New entries are created with
527         body data inlined with the metadata.
528
529         * NetworkProcess/cache/NetworkCache.cpp:
530         (WebKit::NetworkCache::Cache::store):
531         * NetworkProcess/cache/NetworkCache.h:
532         (WebKit::NetworkCache::Cache::canUseSharedMemoryForBodyData const): Deleted.
533         * NetworkProcess/cache/NetworkCacheEntry.cpp:
534         (WebKit::NetworkCache::Entry::initializeShareableResourceHandleFromStorageRecord const):
535
536             Remove the code the prevented use of shared memory in these cases. Non-mapped Data objects
537             are never shareable.
538
539         (WebKit::NetworkCache::Entry::setNeedsValidation):
540         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
541         (WebKit::NetworkCache::isSafeToUseMemoryMapForPath):
542         (WebKit::NetworkCache::canUseSharedMemoryForPath): Deleted.
543         * NetworkProcess/cache/NetworkCacheFileSystem.h:
544         * NetworkProcess/cache/NetworkCacheStorage.cpp:
545         (WebKit::NetworkCache::Storage::Storage):
546         (WebKit::NetworkCache::Storage::mayContainBlob const):
547         (WebKit::NetworkCache::Storage::shouldStoreBodyAsBlob):
548         (WebKit::NetworkCache::shouldStoreBodyAsBlob): Deleted.
549         * NetworkProcess/cache/NetworkCacheStorage.h:
550         (WebKit::NetworkCache::Storage::canUseSharedMemoryForBodyData const): Deleted.
551
552 2018-05-07  Carlos Garcia Campos  <cgarcia@igalia.com>
553
554         Unreviewed. Add missing exit not included in r231298.
555
556         * WebProcess/WebProcess.cpp:
557         (WebKit::WebProcess::ensureWebToStorageProcessConnection):
558
559 2018-05-07  Daniel Bates  <dabates@apple.com>
560
561         Check X-Frame-Options and CSP frame-ancestors in network process
562         https://bugs.webkit.org/show_bug.cgi?id=185410
563         <rdar://problem/37733934>
564
565         Reviewed by Ryosuke Niwa.
566
567         * NetworkProcess/NetworkResourceLoadParameters.cpp:
568         (WebKit::NetworkResourceLoadParameters::encode const): Always encode the frame ancestor origins.
569         (WebKit::NetworkResourceLoadParameters::decode): Always decode the frame ancestor origins.
570         * NetworkProcess/NetworkResourceLoader.cpp:
571         (WebKit::NetworkResourceLoader::shouldInterruptLoadForXFrameOptions): Added.
572         (WebKit::NetworkResourceLoader::shouldInterruptLoadForCSPFrameAncestorsOrXFrameOptions): Added.
573         (WebKit::NetworkResourceLoader::didReceiveResponse): Check if the load needs to be interrupted due
574         to a violation of the CSP frame-ancestors directive or X-Frame-Options. If there is a violation
575         then stop the load.
576         (WebKit::NetworkResourceLoader::didRetrieveCacheEntry): Ditto.
577         (NetworkResourceLoader::addConsoleMessage): Added.
578         (NetworkResourceLoader::sendCSPViolationReport): Added.
579         * NetworkProcess/NetworkResourceLoader.h:
580         * Scripts/webkit/messages.py: Teach the generator about data types MessageLevel and MessageSource
581         as they are both defined in file JavaScriptCore/ConsoleTypes.h as opposed to independent headers.
582         Also tell the generator that these types should not be forward declared so that we can use these
583         types without their JSC:: prefix in WebPage.messages.in.
584         * WebProcess/Network/NetworkProcessConnection.cpp:
585         (WebKit::NetworkProcessConnection::didReceiveMessage): Route WebPage messages to the appropriate
586         web page.
587         * WebProcess/Network/WebLoaderStrategy.cpp:
588         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): Added message StopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied.
589         * WebProcess/Network/WebResourceLoader.cpp:
590         (WebKit::WebResourceLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied): Added.
591         * WebProcess/Network/WebResourceLoader.h:
592         * WebProcess/Network/WebResourceLoader.messages.in:
593         * WebProcess/WebPage/WebFrame.cpp:
594         (WebKit::WebFrame::addConsoleMessage):
595         * WebProcess/WebPage/WebFrame.h:
596         * WebProcess/WebPage/WebPage.cpp:
597         (WebKit::WebPage::addConsoleMessage): Added.
598         (WebKit::WebPage::sendCSPViolationReport): Added.
599         * WebProcess/WebPage/WebPage.h:
600         * WebProcess/WebPage/WebPage.messages.in: Add messages AddConsoleMessage and SendCSPViolationReport
601         for adding a console message to Web Inspector and sending a CSP report, respectively.
602
603 2018-05-07  Daniel Bates  <dabates@apple.com>
604
605         Abstract logic to log console messages and send CSP violation reports into a client
606         https://bugs.webkit.org/show_bug.cgi?id=185393
607         <rdar://problem/40036053>
608
609         Reviewed by Brent Fulgham.
610
611         For now, build a URL from the source origin associated with the NetworkResourceLoader
612         and pass this to the ContentSecurityPolicy constructor.
613
614         Additionally, make NetworkLoadChecker::contentSecurityPolicy() non-const since it returns
615         a non-const pointer to a ContentSecurityPolicy object; => callers can mutate this object
616         right from under NetworkLoadChecker. Making this non-const makes this clear to a reader.
617         Also remove the mutable keyword from the definition of NetworkLoadChecker::m_contentSecurityPolicy.
618
619         * NetworkProcess/NetworkLoadChecker.cpp:
620         (WebKit::NetworkLoadChecker::contentSecurityPolicy):
621         (WebKit::NetworkLoadChecker::contentSecurityPolicy const): Deleted.
622         * NetworkProcess/NetworkLoadChecker.h:
623
624 2018-05-07  Alex Christensen  <achristensen@webkit.org>
625
626         WebResourceLoadStatisticsStore::requestStorageAccess should call its completion handler on the main thread
627         https://bugs.webkit.org/show_bug.cgi?id=185403
628
629         Reviewed by Brent Fulgham.
630
631         * UIProcess/WebResourceLoadStatisticsStore.cpp:
632         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
633
634 2018-05-07  Chris Dumez  <cdumez@apple.com>
635
636         [iOS] Release page load process assertion if the screen is locked
637         https://bugs.webkit.org/show_bug.cgi?id=185333
638
639         Reviewed by Geoffrey Garen.
640
641         We normally take a background process assertion during page loads to allow them to complete
642         even if the tab / app is backgrounded. We should however avoid doing so when the backgrounding
643         is caused by the screen locking. Keeping the process assertion in this case would prevent the
644         whole device from sleeping longer than it should, thus negatively impacting power.
645
646         * UIProcess/Cocoa/NavigationState.h:
647         * UIProcess/Cocoa/NavigationState.mm:
648         (WebKit::NavigationState::NavigationState):
649         (WebKit::NavigationState::releaseNetworkActivityToken):
650         (WebKit::NavigationState::didChangeIsLoading):
651         * UIProcess/ios/WebPageProxyIOS.mm:
652         (WebKit::WebPageProxy::applicationDidEnterBackground):
653
654 2018-05-07  Brent Fulgham  <bfulgham@apple.com>
655
656         Add experimental feature to prompt for Storage Access API use
657         https://bugs.webkit.org/show_bug.cgi?id=185335
658         <rdar://problem/39994649>
659
660         Reviewed by Alex Christensen and Youenn Fablet.
661
662         Create a new experimental feature that gates the ability of WebKit clients to prompt the user when
663         Storage Access API is invoked.
664
665         Currently this feature doesn't have any user-visible impact.
666
667         * Shared/API/APIObject.h:
668         * Shared/API/c/WKBase.h:
669         * Shared/WebPreferences.yaml:
670         * UIProcess/API/APIUIClient.h:
671         (API::UIClient::requestStorageAccessConfirm):
672         * UIProcess/API/C/WKPage.cpp:
673         (WebKit::RequestStorageAccessConfirmResultListener::create):
674         (WebKit::RequestStorageAccessConfirmResultListener::~RequestStorageAccessConfirmResultListener):
675         (WebKit::RequestStorageAccessConfirmResultListener::call):
676         (WebKit::RequestStorageAccessConfirmResultListener::RequestStorageAccessConfirmResultListener):
677         (WKPageRequestStorageAccessConfirmResultListenerGetTypeID):
678         (WKPageRequestStorageAccessConfirmResultListenerCall):
679         (WKPageSetPageUIClient):
680         * UIProcess/API/C/WKPageUIClient.h:
681         * UIProcess/API/Cocoa/WKPreferences.mm:
682         (-[WKPreferences _storageAccessPromptsEnabled]):
683         (-[WKPreferences _setStorageAccessPromptsEnabled:]):
684         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
685         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
686         * UIProcess/Cocoa/UIDelegate.h:
687         * UIProcess/Cocoa/UIDelegate.mm:
688         (WebKit::UIDelegate::setDelegate):
689         (WebKit::UIDelegate::UIClient::requestStorageAccessConfirm):
690         * UIProcess/WebPageProxy.cpp:
691         (WebKit::WebPageProxy::requestStorageAccessConfirm):
692         * UIProcess/WebPageProxy.h:
693         * UIProcess/WebPageProxy.messages.in:
694         * UIProcess/WebPreferences.cpp:
695         (WebKit::WebPreferences::update):
696         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
697         (WebKit::WebChromeClient::requestStorageAccess):
698
699 2018-05-07  Dean Jackson  <dino@apple.com>
700
701         Use a dark gray for system preview bbackground
702         https://bugs.webkit.org/show_bug.cgi?id=185391
703         <rdar://problem/40035120>
704
705         Reviewed by Eric Carlson.
706
707         Throw some darker shade at this view.
708
709         * UIProcess/ios/WKSystemPreviewView.mm:
710         (-[WKSystemPreviewView web_initWithFrame:webView:]):
711
712 2018-05-07  Don Olmstead  <don.olmstead@sony.com>
713
714         [Win] Add missing methods to WebChromeClient
715         https://bugs.webkit.org/show_bug.cgi?id=185325
716
717         Reviewed by Brent Fulgham.
718
719         * WebProcess/WebCoreSupport/WebChromeClient.h:
720
721 2018-05-07  Megan Gardner  <megan_gardner@apple.com>
722
723         Allow Web Touch events to timeout
724         https://bugs.webkit.org/show_bug.cgi?id=185282
725
726         Reviewed by Tim Horton.
727         
728         This is backwards, fixing.
729
730         * UIProcess/WebPageProxy.cpp:
731         (WebKit::WebPageProxy::handleTouchEventSynchronously):
732
733 2018-05-07  Don Olmstead  <don.olmstead@sony.com>
734
735         [Win] LoggingWin is missing includes
736         https://bugs.webkit.org/show_bug.cgi?id=185326
737
738         Reviewed by Per Arne Vollan.
739
740         * Platform/win/LoggingWin.cpp:
741
742 2018-05-07  Daniel Bates  <dabates@apple.com>
743
744         CSP should be passed the referrer
745         https://bugs.webkit.org/show_bug.cgi?id=185367
746
747         Reviewed by Per Arne Vollan.
748
749         Pass the referrer through NetworkLoadChecker so that it can pass it to the ContentSecurityPolicy
750         object it instantiates.
751
752         * NetworkProcess/NetworkLoadChecker.cpp:
753         (WebKit::NetworkLoadChecker::NetworkLoadChecker):
754         (WebKit::NetworkLoadChecker::contentSecurityPolicy const):
755         * NetworkProcess/NetworkLoadChecker.h:
756         (WebKit::NetworkLoadChecker::create):
757         * NetworkProcess/NetworkResourceLoader.cpp:
758         * NetworkProcess/PingLoad.cpp:
759         (WebKit::PingLoad::PingLoad):
760
761 2018-05-07  Daniel Bates  <dabates@apple.com>
762
763         Substitute CrossOriginPreflightResultCache::clear() for CrossOriginPreflightResultCache::empty()
764         https://bugs.webkit.org/show_bug.cgi?id=185170
765
766         Reviewed by Per Arne Vollan.
767
768         * WebProcess/WebProcess.cpp:
769         (WebKit::WebProcess::clearResourceCaches):
770         (WebKit::WebProcess::deleteWebsiteData):
771
772 2018-05-07  Brian Burg  <bburg@apple.com>
773
774         Web Inspector: opt out of process swap on navigation if a Web Inspector frontend is connected
775         https://bugs.webkit.org/show_bug.cgi?id=184861
776         <rdar://problem/39153768>
777
778         Reviewed by Timothy Hatcher.
779
780         We need to track how many frontends are attached to the web page (both local and remote).
781         InspectorController propagates this out to WebKit via InspectorClient. This is then
782         kept in UIProcess as a member of WebPageProxy. When making a decision whether to use a
783         new process for a navigation, return early with "no" if any frontends are open for the
784         page being navigated.
785
786         * UIProcess/WebPageProxy.h:
787         (WebKit::WebPageProxy::didChangeInspectorFrontendCount):
788         (WebKit::WebPageProxy::inspectorFrontendCount const):
789         * UIProcess/WebPageProxy.messages.in:
790         * UIProcess/WebProcessPool.cpp:
791         (WebKit::WebProcessPool::processForNavigation):
792         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
793         (WebKit::WebInspectorClient::frontendCountChanged):
794         * WebProcess/WebCoreSupport/WebInspectorClient.h:
795         * WebProcess/WebPage/WebPage.cpp:
796         (WebKit::WebPage::inspectorFrontendCountChanged):
797         * WebProcess/WebPage/WebPage.h:
798
799 2018-05-04  Tim Horton  <timothy_horton@apple.com>
800
801         Shift to a lower-level framework for simplifying URLs
802         https://bugs.webkit.org/show_bug.cgi?id=185334
803
804         Reviewed by Dan Bernstein.
805
806         * Configurations/WebKit.xcconfig:
807         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
808         (-[WKFullScreenWindowController _updateLocationInfo]):
809
810 2018-05-04  Per Arne Vollan  <pvollan@apple.com>
811
812         Shutdown WindowServer connections after checking in with launch services
813         https://bugs.webkit.org/show_bug.cgi?id=185082
814         <rdar://problem/39613173>
815
816         Reviewed by Brent Fulgham.
817
818         When WindowServer access is blocked in the WebContent process, we should shutdown all connections
819         after checking in with launch services.
820
821         * WebProcess/cocoa/WebProcessCocoa.mm:
822         (WebKit::WebProcess::platformInitializeProcess):
823
824 2018-05-04  Don Olmstead  <don.olmstead@sony.com>
825
826         [Win][WebKit] Fix forwarding headers for Windows build
827         https://bugs.webkit.org/show_bug.cgi?id=184412
828
829         Reviewed by Alex Christensen.
830
831         * PlatformWin.cmake:
832         * UIProcess/API/APIAttachment.h:
833         * UIProcess/API/APIContextMenuClient.h:
834         * UIProcess/API/C/WKProcessTerminationReason.h:
835         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
836
837 2018-05-04  Chris Dumez  <cdumez@apple.com>
838
839         [iOS] Apps that are not visible may not get suspended if they trigger page loads while in the background
840         https://bugs.webkit.org/show_bug.cgi?id=185318
841
842         Reviewed by Geoffrey Garen.
843
844         Whenever there is a page load going on, we take a background process assertion to delay process
845         suspension until this load completes. However, there is also a 3 seconds grace period after
846         a load is complete to allow the app to trigger a new load shortly after. This grace period was
847         introduced to support use cases where a visible app does loads in an offscreen view. However,
848         it can be abused by apps running in the background as they could trigger new page loads while
849         in the background to delay process suspension. This patch tightens the policy so that only
850         apps that are currently visible get to use this grace period. Apps that are in the background
851         get to finish their current load and will then get suspended.
852
853         * UIProcess/Cocoa/NavigationState.mm:
854         (WebKit::NavigationState::didChangeIsLoading):
855
856 2018-05-04  Per Arne Vollan  <pvollan@apple.com>
857
858         Adjust sandbox profile for simulator.
859         https://bugs.webkit.org/show_bug.cgi?id=185319
860
861         Reviewed by Brent Fulgham.
862
863         Disable Kerberos rules, as well as rules related to NSApplication initialization.
864
865         * WebProcess/com.apple.WebProcess.sb.in:
866
867 2018-05-04  Tim Horton  <timothy_horton@apple.com>
868
869         Wasted time dlopening Lookup when tearing down a WKWebView
870         https://bugs.webkit.org/show_bug.cgi?id=185310
871         <rdar://problem/39934085>
872
873         Reviewed by Wenson Hsieh.
874
875         * UIProcess/Cocoa/WebViewImpl.h:
876         * UIProcess/Cocoa/WebViewImpl.mm:
877         (-[WKWindowVisibilityObserver dealloc]):
878         (-[WKWindowVisibilityObserver startObservingLookupDismissalIfNeeded]):
879         (WebKit::WebViewImpl::prepareForDictionaryLookup):
880         (-[WKWindowVisibilityObserver startObservingLookupDismissal]): Deleted.
881         Avoid un-registering as a Lookup dismissal observer if we never
882         registered in the first place, because that involves dlopening Lookup.
883
884 2018-05-04  Megan Gardner  <megan_gardner@apple.com>
885
886         Allow Web Touch events to timeout
887         https://bugs.webkit.org/show_bug.cgi?id=185282
888         <rdar://problem/38728319>
889
890         Reviewed by Tim Horton.
891         
892         Web Touch events currently never time out, which blocks the user from interacting with the UI Process at all.
893         We should allow these events to time out so that the user can interact with the rest of the UI.
894
895         * UIProcess/WebPageProxy.cpp:
896         (WebKit::WebPageProxy::handleTouchEventSynchronously):
897
898 2018-05-04  Wenson Hsieh  <whsieh@berkeley.edu>
899
900         REGRESSION: [ios-simulator] 3 WKWebViewAutofillTests API test failures seen with 11.3 SDK
901         https://bugs.webkit.org/show_bug.cgi?id=184196
902         <rdar://problem/39054481>
903
904         Reviewed by Tim Horton.
905
906         Remove an unnecessary call to NSClassFromString, now that trunk WebKit only supports iOS 11.3+.
907
908         * UIProcess/ios/WKContentViewInteraction.mm:
909         (-[WKContentView insertTextSuggestion:]):
910
911 2018-05-04  Youenn Fablet  <youenn@apple.com>
912
913         NetworkProcessProxy::didReceiveAuthenticationChallenge should take an AuthenticationChallenge r-value
914         https://bugs.webkit.org/show_bug.cgi?id=185302
915
916         Reviewed by Geoffrey Garen.
917
918         Pass AuthenticationChallenge as an r-value since it comes from IPC.
919         No change of behavior.
920
921         * UIProcess/Authentication/AuthenticationChallengeProxy.cpp:
922         (WebKit::AuthenticationChallengeProxy::AuthenticationChallengeProxy):
923         * UIProcess/Authentication/AuthenticationChallengeProxy.h:
924         (WebKit::AuthenticationChallengeProxy::create):
925         * UIProcess/Downloads/DownloadProxy.cpp:
926         (WebKit::DownloadProxy::didReceiveAuthenticationChallenge):
927         * UIProcess/Downloads/DownloadProxy.h:
928         * UIProcess/Network/NetworkProcessProxy.cpp:
929         (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
930         * UIProcess/Network/NetworkProcessProxy.h:
931
932 2018-05-04  Sihui Liu  <sihui_liu@apple.com>
933
934         Assertion failure in NetworkStorageSession::setCookie: privilege of UI process is not set
935         https://bugs.webkit.org/show_bug.cgi?id=185262
936
937         Reviewed by Chris Dumez.
938
939         Fix an assertion failure by setting UI process privileges in constructor of WebsiteDataStore
940         because UI process may use the cookie API before creating a WebView.
941
942         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
943         (WebKit::WebsiteDataStore::WebsiteDataStore):
944
945 2018-05-04  Per Arne Vollan  <pvollan@apple.com>
946
947         Adjust sandbox rules for simulator.
948         https://bugs.webkit.org/show_bug.cgi?id=185275
949
950         Reviewed by Brent Fulgham.
951
952         Enable rules related to CoreMedia for minimal simulator.
953
954         * WebProcess/com.apple.WebProcess.sb.in:
955
956 2018-05-04  Carlos Garcia Campos  <cgarcia@igalia.com>
957
958         [GTK] Epiphany (GNOME Web) says "Error downloading: Service Unavailable." when trying to download an image from discogs.com
959         https://bugs.webkit.org/show_bug.cgi?id=174730
960
961         Reviewed by Michael Catanzaro.
962
963         The problem is that we don't send any User-Agent HTTP header for downloads started by WebProcessPool::download().
964
965         * UIProcess/API/glib/WebKitDownload.cpp:
966         (webkitDownloadUpdateRequest): Helper to update the cached request.
967         (webkitDownloadStarted): Updated the cached request if we have one.
968         (webkit_download_get_request): Use webkitDownloadUpdateRequest().
969         * UIProcess/API/glib/WebKitDownloadClient.cpp:
970         * UIProcess/API/glib/WebKitDownloadPrivate.h:
971         * UIProcess/WebProcessPool.cpp:
972         (WebKit::WebProcessPool::download): Set the User-Agent HTTP header if there isn't any.
973
974 2018-05-04  Carlos Garcia Campos  <cgarcia@igalia.com>
975
976         [GTK] Some event tests failing after r230817
977         https://bugs.webkit.org/show_bug.cgi?id=185072
978
979         Reviewed by Michael Catanzaro.
980
981         Do not send mouse move events to the WebProcess for crossing events during testing. WTR never generates crossing
982         events and they can confuse tests.
983
984         Fixes: editing/pasteboard/drag-link-with-data-transfer-adds-trusted-link-to-pasteboard.html
985                fast/css/user-drag-none.html
986                fast/events/context-activated-by-key-event.html
987                fast/events/drag-selects-image.html
988                fast/events/dropzone-005.html
989                fast/events/mouse-click-events.html
990                fast/events/mouse-cursor-change.html
991
992         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
993         (webkitWebViewBaseCrossingNotifyEvent):
994
995 2018-05-03  Chris Dumez  <cdumez@apple.com>
996
997         More aggressively terminate child processes when the connection to their parent process is severed
998         https://bugs.webkit.org/show_bug.cgi?id=177972
999         <rdar://problem/33317607>
1000
1001         Reviewed by Geoff Garen.
1002
1003         More aggressively terminate child processes when the connection to their parent process is severed.
1004         Previously, we would dispatch to the main thread and then exit the process. This would sometimes
1005         cause the process to say alive for 10 seconds until our watchdog would forcefully terminate the
1006         process. This could happen in particular when the main thread is blocked on a synchronous IPC.
1007
1008         * NetworkProcess/NetworkProcess.cpp:
1009         (WebKit::NetworkProcess::didClose): Deleted.
1010         * NetworkProcess/NetworkProcess.h:
1011         * PluginProcess/PluginProcess.cpp:
1012         (WebKit::PluginProcess::didClose): Deleted.
1013         * PluginProcess/PluginProcess.h:
1014         * Shared/ChildProcess.cpp:
1015         (WebKit::ChildProcess::didClose):
1016         (WebKit::didCloseOnConnectionWorkQueue):
1017         (WebKit::ChildProcess::terminationTimerFired):
1018         * Shared/ChildProcess.h:
1019         * StorageProcess/StorageProcess.cpp:
1020         (WebKit::StorageProcess::didClose): Deleted.
1021         * StorageProcess/StorageProcess.h:
1022         * WebProcess/WebProcess.cpp:
1023         (WebKit::WebProcess::didClose): Deleted.
1024         * WebProcess/WebProcess.h:
1025
1026 2018-05-03  Yusuke Suzuki  <utatane.tea@gmail.com>
1027
1028         Use default std::optional if it is provided
1029         https://bugs.webkit.org/show_bug.cgi?id=185159
1030
1031         Reviewed by Michael Catanzaro.
1032
1033         * Shared/SandboxExtension.h:
1034         (WebKit::SandboxExtension::Handle::decode):
1035         * Shared/TouchBarMenuItemData.cpp:
1036         (WebKit::TouchBarMenuItemData::decode):
1037
1038 2018-05-03  Justin Fan  <justin_fan@apple.com>
1039
1040         [WebGL] Add runtime flag for enabling ASTC support in WebGL
1041         https://bugs.webkit.org/show_bug.cgi?id=184840
1042
1043         Reviewed by Myles C. Maxfield.
1044
1045         Added runtime flag for ASTC support in WebGL, to turn on/off when extension is implemented.
1046
1047         * Shared/WebPreferences.yaml:
1048
1049 2018-05-03  Keith Rollin  <krollin@apple.com>
1050
1051         Unreviewed build fix after <https://trac.webkit.org/changeset/231282>.
1052
1053         * NetworkProcess/NetworkActivityTracker.h:
1054
1055 2018-05-03  Wenson Hsieh  <wenson_hsieh@apple.com>
1056
1057         Ads in NYTimes app are shifted downwards by the scroll view's top content inset
1058         https://bugs.webkit.org/show_bug.cgi?id=185251
1059         <rdar://problem/39062357>
1060
1061         Reviewed by Tim Horton.
1062
1063         The NYTimes app embeds advertisements in each article's WKWebView by adding views in the WKScrollView's view
1064         hierarchy. These views are positioned using the bounding client rects of elements in the DOM (via Element
1065         ::getBoundingClientRect). Prior to r229641, WebKit would report bounding client rects inset by the content
1066         insets of WKScrollView, which means that if a top content inset X is specified on the scroll view, an element
1067         that is flush against the top of the viewport will have a bounding client rect top of -X (when it should really
1068         be 0).
1069
1070         To account for this, NYTimes adds the scroll view content insets back to the bounding client rect when
1071         determining the position of each advertisement which, after r229641, causes these views to be shifted downwards
1072         by an amount equal to the scroll view content inset top.
1073
1074         This new behavior does not affect Safari, since Safari uses SPI to explicitly set obscured insets. As such, we
1075         address this by gating the scroll view content inset fix with a linked-on-or-after check.
1076
1077         * UIProcess/API/Cocoa/WKWebView.mm:
1078         (-[WKWebView _computedObscuredInset]):
1079         * UIProcess/Cocoa/VersionChecks.h:
1080
1081 2018-05-03  Chris Dumez  <cdumez@apple.com>
1082
1083         Load hangs if the WebProcess fails to launch
1084         https://bugs.webkit.org/show_bug.cgi?id=185225
1085         <rdar://problem/38249058>
1086
1087         Reviewed by Geoff Garen.
1088
1089         When a process fails to launch, ChildProcessProxy::didFinishLaunching() gets called with an
1090         invalid connection identifier. While NetworkProcessProxy::didFinishLaunching() properly deals with
1091         this situation, WebProcessProxy::didFinishLaunching() does not. As a result, we do not attempt to
1092         relaunch the process, we do not notify the client and WebPageProxy::m_isValid stays true.
1093
1094         This patch thus updates WebProcessProxy::didFinishLaunching() to check if the connection identifier
1095         is valid and treats it as a crash. As a result, the WebPageProxies properly reset their state and
1096         the client gets notified of the crash so that it can attempt to reload.
1097
1098         * UIProcess/API/Cocoa/WKProcessPool.mm:
1099         (-[WKProcessPool _makeNextWebProcessLaunchFailForTesting]):
1100         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1101         * UIProcess/Launcher/ProcessLauncher.h:
1102         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1103         (WebKit::ProcessLauncher::launchProcess):
1104         Add SPI to make the next WebProcess launch fail, for the purpose of API testing.
1105
1106         * UIProcess/WebProcessPool.h:
1107         * UIProcess/WebProcessProxy.cpp:
1108         (WebKit::WebProcessProxy::getLaunchOptions):
1109         (WebKit::WebProcessProxy::didClose):
1110         (WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
1111         (WebKit::WebProcessProxy::didFinishLaunching):
1112         * UIProcess/WebProcessProxy.h:
1113
1114 2018-05-03  Commit Queue  <commit-queue@webkit.org>
1115
1116         Unreviewed, rolling out r231223 and r231288.
1117         https://bugs.webkit.org/show_bug.cgi?id=185256
1118
1119         The change in r231223 breaks internal builds, and r231288 is a
1120         dependent change. (Requested by ryanhaddad on #webkit).
1121
1122         Reverted changesets:
1123
1124         "Use default std::optional if it is provided"
1125         https://bugs.webkit.org/show_bug.cgi?id=185159
1126         https://trac.webkit.org/changeset/231223
1127
1128         "Use pointer instead of
1129         std::optional<std::reference_wrapper<>>"
1130         https://bugs.webkit.org/show_bug.cgi?id=185186
1131         https://trac.webkit.org/changeset/231288
1132
1133 2018-05-03  Per Arne Vollan  <pvollan@apple.com>
1134
1135         An error message is written to stderr when the WebContent process is blocking WindowServer access.
1136         https://bugs.webkit.org/show_bug.cgi?id=184701
1137
1138         Reviewed by Brent Fulgham.
1139
1140         Calling 'setApplicationIsDaemon(true)' instead of 'CGSSetDenyWindowServerConnections(true)' to disable
1141         access to the WindowServer in the WebContent process, will remove this error message. After this change,
1142         the url of the WebContent process is still showing up in Activity Monitor, which previously was a
1143         problem when calling 'setApplicationIsDaemon(true)'.
1144
1145         * WebProcess/WebProcess.cpp:
1146         (WebKit::WebProcess::initializeProcess):
1147         * WebProcess/cocoa/WebProcessCocoa.mm:
1148         (WebKit::WebProcess::platformInitializeProcess):
1149
1150 2018-05-03  Ryan Haddad  <ryanhaddad@apple.com>
1151
1152         Unreviewed, rolling out r231253.
1153
1154         The API test added with this change is crashing on the bots.
1155
1156         Reverted changeset:
1157
1158         "Web Inspector: opt out of process swap on navigation if a Web
1159         Inspector frontend is connected"
1160         https://bugs.webkit.org/show_bug.cgi?id=184861
1161         https://trac.webkit.org/changeset/231253
1162
1163 2018-05-03  Brent Fulgham  <bfulgham@apple.com>
1164
1165         Re-eneable Network Extension support in the WebContent process
1166         https://bugs.webkit.org/show_bug.cgi?id=185236
1167         <rdar://problem/39883004>
1168
1169         Reviewed by Eric Carlson.
1170
1171         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1172         * WebProcess/com.apple.WebProcess.sb.in:
1173
1174 2018-05-03  Tim Horton  <timothy_horton@apple.com>
1175
1176         REGRESSION (r231014): Entitlements are not applied to XPC services on macOS
1177         https://bugs.webkit.org/show_bug.cgi?id=185241
1178
1179         Reviewed by Dan Bernstein.
1180
1181         * Configurations/BaseXPCService.xcconfig:
1182         * Configurations/WebContentService.Development.xcconfig:
1183         * Configurations/WebContentService.xcconfig:
1184
1185 2018-05-03  Carlos Garcia Campos  <cgarcia@igalia.com>
1186
1187         REGRESSION(r222772): [GTK][WPE] WebProcess from WebKitGtk+ 2.19.9x SIGSEVs in WebKit::WebProcess::ensureNetworkProcessConnection() at Source/WebKit/WebProcess/WebProcess.cpp:1127
1188         https://bugs.webkit.org/show_bug.cgi?id=183348
1189
1190         Reviewed by Michael Catanzaro.
1191
1192         When connection doesn't exit in case of sync message failure, always exit in case of failing to send
1193         GetNetworkProcessConnection or GetStorageProcessConnection messages. This can happen when the WebView is created
1194         and destroyed quickly.
1195
1196         * WebProcess/WebProcess.cpp:
1197         (WebKit::WebProcess::ensureNetworkProcessConnection):
1198         (WebKit::WebProcess::ensureWebToStorageProcessConnection):
1199
1200 2018-05-02  Nan Wang  <n_wang@apple.com>
1201
1202         AX: Missing kAXSWebAccessibilityEventsEnabledNotification causes a crash
1203         https://bugs.webkit.org/show_bug.cgi?id=185237
1204
1205         Reviewed by Dan Bernstein.
1206
1207         When libAccessibility.dylib is missing, the compiler would optimize out the global
1208         notification and lead to a crash. Fixed it by using the isNullFunction check instead,
1209         since we are sure the global notification would be there when the corresponding function 
1210         is available.
1211
1212         * UIProcess/API/Cocoa/WKWebView.mm:
1213         (-[WKWebView _initializeWithConfiguration:]):
1214
1215 2018-05-02  Keith Rollin  <krollin@apple.com>
1216
1217         Add facility for tracking times and results of page and resource loading
1218         https://bugs.webkit.org/show_bug.cgi?id=184838
1219         <rdar://problem/36548974>
1220
1221         Reviewed by Brent Fulgham.
1222
1223         Add NetworkActivityTracker. The idea behind this facility is to create
1224         and destroy them around networking activity that we want to track for
1225         the purpose of measuring overall network health. They can be created
1226         around the loading of pages or individual resources, and can be
1227         arranged in a parent/child hierarchy to indicate what pages the
1228         resources are part of. The NetworkActivity tracker tracks load times
1229         and results. On Cocoa, it can be integrated with CFNetwork in order to
1230         associate WebKit activity with low-level networking activity.
1231
1232         * CMakeLists.txt:
1233         * Configurations/WebKit.xcconfig:
1234         * NetworkProcess/NetworkActivityTracker.cpp: Copied from Source/WebKit/NetworkProcess/NetworkLoadParameters.h.
1235         (WebKit::NetworkActivityTracker::NetworkActivityTracker):
1236         (WebKit::NetworkActivityTracker::~NetworkActivityTracker):
1237         (WebKit::NetworkActivityTracker::setParent):
1238         (WebKit::NetworkActivityTracker::start):
1239         (WebKit::NetworkActivityTracker::complete):
1240         * NetworkProcess/NetworkActivityTracker.h: Added.
1241         (WebKit::NetworkActivityTracker::getPlatformObject):
1242         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1243         (WebKit::NetworkConnectionToWebProcess::didClose):
1244         (WebKit::NetworkConnectionToWebProcess::pageLoadCompleted):
1245         (WebKit::networkActivityTrackingEnabled):
1246         (WebKit::NetworkConnectionToWebProcess::startTrackingResourceLoad):
1247         (WebKit::NetworkConnectionToWebProcess::stopTrackingResourceLoad):
1248         (WebKit::NetworkConnectionToWebProcess::stopAllNetworkActivityTracking):
1249         (WebKit::NetworkConnectionToWebProcess::stopAllNetworkActivityTrackingForPage):
1250         (WebKit::NetworkConnectionToWebProcess::findRootNetworkActivity):
1251         (WebKit::NetworkConnectionToWebProcess::findNetworkActivityTracker):
1252         * NetworkProcess/NetworkConnectionToWebProcess.h:
1253         (WebKit::NetworkConnectionToWebProcess::ResourceNetworkActivityTracker::ResourceNetworkActivityTracker):
1254         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1255         * NetworkProcess/NetworkDataTask.cpp:
1256         (WebKit::NetworkDataTask::create):
1257         * NetworkProcess/NetworkLoadParameters.h:
1258         * NetworkProcess/NetworkProcess.cpp:
1259         (WebKit::NetworkProcess::initializeNetworkProcess):
1260         * NetworkProcess/NetworkProcess.h:
1261         (WebKit::NetworkProcess::trackNetworkActivity const):
1262         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1263         (WebKit::NetworkProcessCreationParameters::encode const):
1264         (WebKit::NetworkProcessCreationParameters::decode):
1265         * NetworkProcess/NetworkProcessCreationParameters.h:
1266         * NetworkProcess/NetworkResourceLoader.cpp:
1267         (WebKit::NetworkResourceLoader::start):
1268         (WebKit::NetworkResourceLoader::cleanup):
1269         (WebKit::NetworkResourceLoader::abort):
1270         (WebKit::NetworkResourceLoader::didFinishLoading):
1271         (WebKit::NetworkResourceLoader::didFailLoading):
1272         (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
1273         (WebKit::NetworkResourceLoader::continueProcessingCachedEntryAfterDidReceiveResponse):
1274         * NetworkProcess/NetworkResourceLoader.h:
1275         * NetworkProcess/cocoa/NetworkActivityTrackerCocoa.mm: Added.
1276         (WebKit::NetworkActivityTracker::NetworkActivityTracker):
1277         (WebKit::NetworkActivityTracker::~NetworkActivityTracker):
1278         (WebKit::NetworkActivityTracker::setParent):
1279         (WebKit::NetworkActivityTracker::start):
1280         (WebKit::NetworkActivityTracker::complete):
1281         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
1282         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1283         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
1284         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1285         (API::ProcessPoolConfiguration::copy):
1286         * UIProcess/API/APIProcessPoolConfiguration.h:
1287         * UIProcess/API/C/WKContextConfigurationRef.cpp:
1288         (WKContextConfigurationTrackNetworkActivity):
1289         (WKContextConfigurationSetTrackNetworkActivity):
1290         * UIProcess/API/C/WKContextConfigurationRef.h:
1291         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
1292         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
1293         (-[_WKProcessPoolConfiguration trackNetworkActivity]):
1294         (-[_WKProcessPoolConfiguration setTrackNetworkActivity:]):
1295         * UIProcess/WebProcessPool.cpp:
1296         (WebKit::WebProcessPool::ensureNetworkProcess):
1297         * WebKit.xcodeproj/project.pbxproj:
1298         * WebProcess/Network/WebLoaderStrategy.cpp:
1299         (WebKit::WebLoaderStrategy::pageLoadCompleted):
1300         * WebProcess/Network/WebLoaderStrategy.h:
1301
1302 2018-05-02  Jer Noble  <jer.noble@apple.com>
1303
1304         Open audio/video sandbox services for minimal simulator
1305         https://bugs.webkit.org/show_bug.cgi?id=185217
1306         <rdar://problem/39918909>
1307
1308         Reviewed by Per Arne Vollan.
1309
1310         * WebKit.xcodeproj/project.pbxproj:
1311         * WebProcess/com.apple.WebProcess.sb.in:
1312
1313 2018-05-02  Daniel Bates  <dabates@apple.com>
1314
1315         Cleanup NetworkResourceLoader::didReceiveResponse()
1316         https://bugs.webkit.org/show_bug.cgi?id=185209
1317
1318         Reviewed by Chris Dumez.
1319
1320         Use early returns to make the control flow easier to read and reason about. Disregarding a
1321         From-Origin violation, NetworkResourceLoader::didReceiveResponse() only returns NetworkLoadClient::ShouldContinueDidReceiveResponse::No
1322         when the load is for a main resource and hence it must wait for the embedding client to allow
1323         the load before continuing with it. With regards to a From-Origin violation, the network
1324         process schedules to fail the load in a subsequent turn of the event loop before returning
1325         NetworkLoadClient::ShouldContinueDidReceiveResponse::No. It return NetworkLoadClient::ShouldContinueDidReceiveResponse::No
1326         solely to tell the NetworkLoadClient to defer assuming the load is allowed (because we will
1327         fail it on the next turn of the event loop).
1328
1329         Additionally, remove all logging about the return value as we no longer have a need for
1330         such logging.
1331
1332         * NetworkProcess/NetworkResourceLoader.cpp:
1333         (WebKit::NetworkResourceLoader::didReceiveResponse):
1334
1335 2018-05-02  Alex Christensen  <achristensen@webkit.org>
1336
1337         Add WKWebsiteDataStorePrivate._proxyConfiguration SPI
1338         https://bugs.webkit.org/show_bug.cgi?id=185179
1339
1340         Reviewed by Andy Estes.
1341
1342         * NetworkProcess/NetworkSessionCreationParameters.h:
1343         (WebKit::NetworkSessionCreationParameters::encode const):
1344         (WebKit::NetworkSessionCreationParameters::decode):
1345         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1346         (WebKit::NetworkDataTaskCocoa::applySniffingPoliciesAndBindRequestToInferfaceIfNeeded):
1347         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
1348         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1349         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
1350         * Shared/WebsiteDataStoreParameters.cpp:
1351         (WebKit::WebsiteDataStoreParameters::privateSessionParameters):
1352         * Shared/cf/ArgumentCodersCF.cpp:
1353         (IPC::encode):
1354         (IPC::decode):
1355         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1356         (-[WKWebsiteDataStore _setProxyConfiguration:]):
1357         (-[WKWebsiteDataStore _proxyConfiguration]):
1358         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
1359         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
1360         (WebKit::WebsiteDataStore::parameters):
1361         * UIProcess/WebsiteData/WebsiteDataStore.h:
1362         (WebKit::WebsiteDataStore::setProxyConfiguration):
1363         (WebKit::WebsiteDataStore::proxyConfiguration):
1364
1365 2018-05-02  Youenn Fablet  <youenn@apple.com>
1366
1367         Use NetworkLoadChecker for navigation loads
1368         https://bugs.webkit.org/show_bug.cgi?id=184892
1369         <rdar://problem/39652686>
1370
1371         Reviewed by Chris Dumez.
1372
1373         Compute whether a response is same origin in no-cors case.
1374         This allows providing more precise filtering.
1375         In case of navigate loads, set the tainting to basic which will make filtering to the minimum.
1376
1377         Pass the sourceOrigin for navigation loads as well.
1378         Enable to restrict HTTP response access for navigation load.
1379
1380         Content Blockers are disabled for now in NetworkLoadChecker for navigation loads.
1381         They should be reenabled as a follow-up.
1382
1383         Add a specific case to allow any redirection to about:// URLs.
1384         While this does not conform with the spec, this keeps the existing WebKit behavior.
1385
1386         * NetworkProcess/NetworkLoadChecker.cpp:
1387         (WebKit::NetworkLoadChecker::NetworkLoadChecker):
1388         (WebKit::NetworkLoadChecker::validateResponse):
1389         (WebKit::NetworkLoadChecker::continueCheckingRequest):
1390         (WebKit::NetworkLoadChecker::doesNotNeedCORSCheck const):
1391         * NetworkProcess/NetworkResourceLoader.cpp:
1392         (WebKit::NetworkResourceLoader::sanitizeResponseIfPossible):
1393         * WebProcess/Network/WebLoaderStrategy.cpp:
1394         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
1395         (WebKit::WebLoaderStrategy::isDoingLoadingSecurityChecks const):
1396         We only do security checks if this runtime flag is on.
1397         * WebProcess/Network/WebLoaderStrategy.h:
1398
1399 2018-05-02  Jer Noble  <jer.noble@apple.com>
1400
1401         Make EncryptedMediaAPIEnabled an experimental feature
1402         https://bugs.webkit.org/show_bug.cgi?id=185212
1403
1404         Reviewed by Eric Carlson.
1405
1406         * Shared/WebPreferences.yaml:
1407
1408 2018-05-02  Per Arne Vollan  <pvollan@apple.com>
1409
1410         Adjust sandbox profile in simulator mode.
1411         https://bugs.webkit.org/show_bug.cgi?id=185172
1412         <rdar://problem/39876860>
1413
1414         Reviewed by Brent Fulgham.
1415
1416         Fix some sandbox violations.
1417
1418         * WebProcess/com.apple.WebProcess.sb.in:
1419
1420 2018-05-02  Brian Burg  <bburg@apple.com>
1421
1422         Web Inspector: opt out of process swap on navigation if a Web Inspector frontend is connected
1423         https://bugs.webkit.org/show_bug.cgi?id=184861
1424         <rdar://problem/39153768>
1425
1426         Reviewed by Ryosuke Niwa.
1427
1428         We need to track how many frontends are attached to the web page (both local and remote).
1429         InspectorController propagates this out to WebKit via InspectorClient. This is then
1430         kept in UIProcess as a member of WebPageProxy. When making a decision whether to use a
1431         new process for a navigation, return early with "no" if any frontends are open for the
1432         page being navigated.
1433
1434         * UIProcess/WebPageProxy.h:
1435         (WebKit::WebPageProxy::didChangeInspectorFrontendCount):
1436         (WebKit::WebPageProxy::inspectorFrontendCount const):
1437         * UIProcess/WebPageProxy.messages.in:
1438         * UIProcess/WebProcessPool.cpp:
1439         (WebKit::WebProcessPool::processForNavigation):
1440         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
1441         (WebKit::WebInspectorClient::frontendCountChanged):
1442         * WebProcess/WebCoreSupport/WebInspectorClient.h:
1443         * WebProcess/WebPage/WebPage.cpp:
1444         (WebKit::WebPage::inspectorFrontendCountChanged):
1445         * WebProcess/WebPage/WebPage.h:
1446
1447 2018-05-02  Jer Noble  <jer.noble@apple.com>
1448
1449         Adopt -destinationWindowToExitFullScreenForWindow:
1450         https://bugs.webkit.org/show_bug.cgi?id=185204
1451         <rdar://problem/22486621>
1452
1453         Reviewed by Eric Carlson.
1454
1455         * UIProcess/mac/WKFullScreenWindowController.mm:
1456         (-[WKFullScreenWindowController destinationWindowToExitFullScreenForWindow:]):
1457
1458 2018-05-02  Per Arne Vollan  <pvollan@apple.com>
1459
1460         Disable Media capture rules in sandbox for simulator.
1461         https://bugs.webkit.org/show_bug.cgi?id=185206
1462         <rdar://problem/39910015>
1463
1464         Reviewed by Eric Carlson.
1465
1466         These rules are not relevant in this case.
1467
1468         * WebProcess/com.apple.WebProcess.sb.in:
1469
1470 2018-05-02  Eric Carlson  <eric.carlson@apple.com>
1471
1472         [iOS] Provide audio route information when invoking AirPlay picker
1473         https://bugs.webkit.org/show_bug.cgi?id=185199
1474         <rdar://problem/39853103>
1475
1476         Reviewed by Jer Noble.
1477
1478         * Scripts/webkit/messages.py:
1479         * UIProcess/PageClient.h:
1480         * UIProcess/WebPageProxy.h:
1481         * UIProcess/WebPageProxy.messages.in:
1482         * UIProcess/ios/PageClientImplIOS.h:
1483         * UIProcess/ios/PageClientImplIOS.mm:
1484         (WebKit::PageClientImpl::showPlaybackTargetPicker):  Pass route sharing policy and routing context UID.
1485
1486         * UIProcess/ios/WKContentViewInteraction.h:
1487         * UIProcess/ios/WKContentViewInteraction.mm:
1488         (-[WKContentView _showPlaybackTargetPicker:fromRect:routeSharingPolicy:routingContextUID:]): Take same.
1489         (-[WKContentView _showPlaybackTargetPicker:fromRect:]): Deleted.
1490
1491         * UIProcess/ios/WebPageProxyIOS.mm:
1492         (WebKit::WebPageProxy::showPlaybackTargetPicker): Pass route sharing policy and routing context UID.
1493
1494         * UIProcess/ios/forms/WKAirPlayRoutePicker.h:
1495         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
1496         (-[WKAirPlayRoutePicker showFromView:routeSharingPolicy:routingContextUID:]): Take same.
1497         (-[WKAirPlayRoutePicker showFromView:]): Deleted.
1498
1499         * WebProcess/WebCoreSupport/WebChromeClient.h:
1500         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
1501         (WebKit::WebChromeClient::showPlaybackTargetPicker):
1502
1503 2018-05-02  Jer Noble  <jer.noble@apple.com>
1504
1505         Get the WebKit.framework bundle by asking for WKWebView
1506         https://bugs.webkit.org/show_bug.cgi?id=185175
1507
1508         Reviewed by Tim Horton.
1509
1510         * NetworkProcess/mac/NetworkProcessMac.mm:
1511         (WebKit::NetworkProcess::initializeSandbox):
1512         * Shared/mac/ChildProcessMac.mm:
1513         (WebKit::ChildProcess::initializeSandbox):
1514         * StorageProcess/mac/StorageProcessMac.mm:
1515         (WebKit::StorageProcess::initializeSandbox):
1516
1517 2018-05-02  Youenn Fablet  <youenn@apple.com>
1518
1519         Cannot gather srflx or relay ICE candidates on IPv6 network (ICE agent hangs?)
1520         https://bugs.webkit.org/show_bug.cgi?id=181009
1521         <rdar://problem/36144555>
1522
1523         Reviewed by Eric Carlson.
1524
1525         On iOS/IPv6 networks, STUN servers name resolution returns a zero IPv6 IP address.
1526         No error is raised which leads to sending STUN requests with that IP address.
1527         Once the request times out, the ICE candidate gathering finishes with host candidates only.
1528
1529         This patch makes WebRTC DNS resolver to send only IPv4 resolved addresses.
1530         STUN is used for NAT traversal which is for IPv4 addresses.
1531         Not sending IPv6 addresses allows terminating ICE candidate gathering sooner.
1532
1533         Manually tested on iOS with IPv4/IPv6 and IPv6 networks.
1534
1535         * NetworkProcess/webrtc/NetworkRTCResolverCocoa.cpp:
1536         (WebKit::resolvedName):
1537
1538 2018-05-02  Youenn Fablet  <youenn@apple.com>
1539
1540         CacheStorage::Engine should keep a list of initialization callback
1541         https://bugs.webkit.org/show_bug.cgi?id=185184
1542         <rdar://problem/38875651>
1543
1544         Reviewed by Antti Koivisto.
1545
1546         Keep each initialize callback in a Vector so as to compute the salt only once.
1547         Call all callbacks then in a loop.
1548
1549         * NetworkProcess/cache/CacheStorageEngine.cpp:
1550         (WebKit::CacheStorage::Engine::~Engine):
1551         (WebKit::CacheStorage::Engine::initialize):
1552         * NetworkProcess/cache/CacheStorageEngine.h:
1553
1554 2018-05-02  Jer Noble  <jer.noble@apple.com>
1555
1556         Pipe volume through PlaybackSessionManager/Proxy.
1557         https://bugs.webkit.org/show_bug.cgi?id=185182
1558
1559         Reviewed by Eric Carlson.
1560
1561         * UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
1562         * UIProcess/Cocoa/PlaybackSessionManagerProxy.messages.in:
1563         * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
1564         (WebKit::PlaybackSessionModelContext::setVolume):
1565         (WebKit::PlaybackSessionModelContext::volumeChanged):
1566         (WebKit::PlaybackSessionManagerProxy::volumeChanged):
1567         (WebKit::PlaybackSessionManagerProxy::setVolume):
1568         * WebProcess/cocoa/PlaybackSessionManager.h:
1569         * WebProcess/cocoa/PlaybackSessionManager.messages.in:
1570         * WebProcess/cocoa/PlaybackSessionManager.mm:
1571         (WebKit::PlaybackSessionInterfaceContext::volumeChanged):
1572         (WebKit::PlaybackSessionManager::volumeChanged):
1573         (WebKit::PlaybackSessionManager::setVolume):
1574
1575 2018-05-01  Yusuke Suzuki  <utatane.tea@gmail.com>
1576
1577         Use default std::optional if it is provided
1578         https://bugs.webkit.org/show_bug.cgi?id=185159
1579
1580         Reviewed by JF Bastien.
1581
1582         * Shared/SandboxExtension.h:
1583         (WebKit::SandboxExtension::Handle::decode):
1584         * Shared/TouchBarMenuItemData.cpp:
1585         (WebKit::TouchBarMenuItemData::decode):
1586
1587 2018-05-01  Jer Noble  <jer.noble@apple.com>
1588
1589         Production build error in Migrate Header phase when WK_ALTERNATE_FRAMEWORKS_DIR is set to non-empty value
1590         https://bugs.webkit.org/show_bug.cgi?id=185171
1591
1592         Reviewed by Timothy Hatcher.
1593
1594         * Configurations/BaseTarget.xcconfig:
1595
1596 2018-05-01  Per Arne Vollan  <pvollan@apple.com>
1597
1598         Use correct runloop type in the WebContent process.
1599         https://bugs.webkit.org/show_bug.cgi?id=185140
1600
1601         Reviewed by Brent Fulgham.
1602
1603         Use WK_MACOS_* machinery to determine runloop type for the WebContent process.
1604
1605         * Configurations/WebContentService.xcconfig:
1606
1607 2018-05-01  Oleksandr Skachkov  <gskachkov@gmail.com>
1608
1609         WebAssembly: add support for stream APIs - JavaScript API
1610         https://bugs.webkit.org/show_bug.cgi?id=183442
1611
1612         Reviewed by Yusuke Suzuki and JF Bastien.
1613
1614         Add WEBASSEMBLY_STREAMING_API feature flag
1615
1616         * Configurations/FeatureDefines.xcconfig:
1617
1618 2018-04-30  Per Arne Vollan  <pvollan@apple.com>
1619
1620         Use correct runloop type in the WebContent process.
1621         https://bugs.webkit.org/show_bug.cgi?id=185140
1622         <rdar://problem/39585037>
1623
1624         Reviewed by Brent Fulgham.
1625
1626         The macOS target version should be used to determine the runloop type.
1627
1628         * Configurations/WebContentService.xcconfig:
1629
1630 2018-04-30  Michael Saboff  <msaboff@apple.com>
1631
1632         Eliminate WebProcessShim.dylib
1633         https://bugs.webkit.org/show_bug.cgi?id=185147
1634
1635         Reviewed by Ryosuke Niwa.
1636
1637         * Configurations/WebContentService.xcconfig:
1638         * Configurations/WebProcessShim.xcconfig: Removed.
1639         * WebKit.xcodeproj/project.pbxproj:
1640
1641 2018-04-30  Michael Saboff  <msaboff@apple.com>
1642
1643         Remove unused mac/CookieStorageShimLibrary
1644         https://bugs.webkit.org/show_bug.cgi?id=185146
1645
1646         Reviewed by Alex Christensen.
1647
1648         * Shared/mac/CookieStorageShimLibrary.cpp: Removed.
1649         * Shared/mac/CookieStorageShimLibrary.h: Removed.
1650         * WebKit.xcodeproj/project.pbxproj:
1651
1652 2018-04-30  Alex Christensen  <achristensen@webkit.org>
1653
1654         Add WKUIDelegatePrivate equivalent of WKPageContextMenuClient getContextMenuFromProposedMenuAsync
1655         https://bugs.webkit.org/show_bug.cgi?id=180955
1656
1657         Reviewed by Andy Estes.
1658
1659         * UIProcess/API/APIContextMenuClient.h:
1660         (API::ContextMenuClient::menuFromProposedMenu):
1661         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1662         * UIProcess/Cocoa/UIDelegate.h:
1663         * UIProcess/Cocoa/UIDelegate.mm:
1664         (WebKit::UIDelegate::setDelegate):
1665         (WebKit::UIDelegate::ContextMenuClient::menuFromProposedMenu):
1666         * UIProcess/mac/WebContextMenuProxyMac.mm:
1667         (WebKit::WebContextMenuProxyMac::showContextMenuWithItems):
1668
1669 2018-04-30  JF Bastien  <jfbastien@apple.com>
1670
1671         Use some C++17 features
1672         https://bugs.webkit.org/show_bug.cgi?id=185135
1673
1674         Reviewed by Alex Christensen.
1675
1676         As discussed here [0] let's move WebKit to a subset of C++17. We
1677         now require GCC 6 [1] which means that, according to [2] we can
1678         use the following C++17 language features (I removed some
1679         uninteresting ones):
1680
1681          - New auto rules for direct-list-initialization
1682          - static_assert with no message
1683          - typename in a template template parameter
1684          - Nested namespace definition
1685          - Attributes for namespaces and enumerators
1686          - u8 character literals
1687          - Allow constant evaluation for all non-type template arguments
1688          - Fold Expressions
1689          - Unary fold expressions and empty parameter packs
1690          - __has_include in preprocessor conditional
1691          - Differing begin and end types in range-based for
1692          - Improving std::pair and std::tuple
1693
1694         Consult the Tony Tables [3] to see before / after examples.
1695
1696         Of course we can use any library feature if we're willing to
1697         import them to WTF (and they don't require language support).
1698
1699
1700           [0]: https://lists.webkit.org/pipermail/webkit-dev/2018-March/029922.html
1701           [1]: https://trac.webkit.org/changeset/231152/webkit
1702           [2]: https://en.cppreference.com/w/cpp/compiler_support
1703           [3]: https://github.com/tvaneerd/cpp17_in_TTs/blob/master/ALL_IN_ONE.md
1704
1705         * Configurations/Base.xcconfig:
1706         * DerivedSources.make:
1707         * PlatformMac.cmake:
1708
1709 2018-04-30  Wenson Hsieh  <wenson_hsieh@apple.com>
1710
1711         [Extra zoom mode] Respect the existing shrink-to-fit attribute instead of using min-device-width
1712         https://bugs.webkit.org/show_bug.cgi?id=185132
1713         <rdar://problem/39834562>
1714
1715         Reviewed by Tim Horton.
1716
1717         Remove the experimental feature for `min-device-width`.
1718
1719         * Shared/WebPreferences.yaml:
1720
1721 2018-04-30  Keith Rollin  <krollin@apple.com>
1722
1723         Include breadcrumb for tracking resource loading into CFNetwork
1724         https://bugs.webkit.org/show_bug.cgi?id=184837
1725         rdar://problem/39575411
1726
1727         Reviewed by Brent Fulgham.
1728
1729         When starting the network-based loading of a resource, log the
1730         description provided by NetworkDataTask. On Cocoa, this is implemented
1731         to return the description property in NSURLSessionTask. This
1732         information better allows us to track a resource load through the
1733         WebContent process, the Networking process, and the Cocoa networking
1734         layers.
1735
1736         * NetworkProcess/NetworkDataTask.cpp:
1737         (WebKit::NetworkDataTask::description const):
1738         * NetworkProcess/NetworkDataTask.h:
1739         * NetworkProcess/NetworkLoad.cpp:
1740         (WebKit::NetworkLoad::description const):
1741         * NetworkProcess/NetworkLoad.h:
1742         * NetworkProcess/NetworkResourceLoader.cpp:
1743         (WebKit::NetworkResourceLoader::startNetworkLoad):
1744         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
1745         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1746         (WebKit::NetworkDataTaskCocoa::description const):
1747
1748 2018-04-30  Andy Estes  <aestes@apple.com>
1749
1750         [iOS] Try to unlock PDF documents before printing them
1751         https://bugs.webkit.org/show_bug.cgi?id=185084
1752         <rdar://problem/39356622>
1753
1754         Reviewed by Dan Bernstein.
1755
1756         * UIProcess/ios/WKPDFView.mm:
1757         (-[WKPDFView pdfHostViewController:documentDidUnlockWithPassword:]):
1758
1759         Stored the password that successfully unlocked the current PDF document.
1760
1761         (-[WKPDFView _wk_printedDocument]):
1762
1763         Used the stored password to unlock the CGPDFDocument we create for printing.
1764
1765 2018-04-28  Andy Estes  <aestes@apple.com>
1766
1767         [iOS] Present an action sheet when long-pressing on PDF links
1768         https://bugs.webkit.org/show_bug.cgi?id=185093
1769         <rdar://problem/39356651>
1770
1771         Reviewed by Dan Bernstein.
1772
1773         * UIProcess/ios/WKPDFView.mm:
1774         (-[WKPDFView dealloc]):
1775
1776         Called -[WKActionSheetAssistant cleanupSheet].
1777
1778         (-[WKPDFView web_setContentProviderData:suggestedFilename:]):
1779
1780         Created a WKActionSheetAssistant with the host view as the assistant view and
1781         ourselves as the delegate.
1782
1783         (-[WKPDFView _URLWithPageIndex:]):
1784
1785         Added. Creates a URL to the current page with a page number fragment appended.
1786
1787         (-[WKPDFView _goToURL:atLocation:]):
1788
1789         Added. Navigates to a URL with a synthetic mouse click at a location in host view
1790         coordinates.
1791
1792         (-[WKPDFView pdfHostViewController:goToURL:]):
1793         (-[WKPDFView pdfHostViewController:goToPageIndex:withViewFrustum:]):
1794
1795         Called -_goToURL:atLocation:. Used -_URLWithPageIndex: to construct an NSURL from
1796         a page index.
1797
1798         (-[WKPDFView _showActionSheetForURL:atLocation:]):
1799
1800         Added. Populates _positionInformation with a URL and location and calls
1801         -[WKActionSheetAssistant showLinkSheet].
1802
1803         (-[WKPDFView pdfHostViewController:didLongPressURL:atLocation:]):
1804         (-[WKPDFView pdfHostViewController:didLongPressPageIndex:atLocation:]):
1805
1806         Called -_showActionSheetForURL:atLocation:. Used -_URLWithPageIndex: to construct
1807         an NSURL from a page index.
1808
1809         (-[WKPDFView positionInformationForActionSheetAssistant:]):
1810
1811         Returned _positionInformation.
1812
1813         (-[WKPDFView actionSheetAssistant:performAction:]):
1814
1815         Populated the pasteboard with plain text and URL representations of
1816         _positionInformation.url.
1817
1818         (-[WKPDFView actionSheetAssistant:openElementAtLocation:]):
1819
1820         Called -_goToURL:atLocation.
1821
1822         (-[WKPDFView actionSheetAssistant:shareElementWithURL:rect:]):
1823
1824         Created a UIWKSelectionAssistant and called -showShareSheetFor:fromRect:.
1825
1826         (-[WKPDFView actionSheetAssistant:shouldIncludeAppLinkActionsForElement:]):
1827
1828         Returned API::UIClient::shouldIncludeAppLinkActionsForElement().
1829
1830         (-[WKPDFView actionSheetAssistant:decideActionsForElement:defaultActions:]):
1831
1832         Returned API::UIClient::actionsForElement()l
1833
1834 2018-04-28  Andy Estes  <aestes@apple.com>
1835
1836         [iOS] Allow com.apple.WebKit.Networking to look up com.apple.wifi.manager
1837         https://bugs.webkit.org/show_bug.cgi?id=185114
1838         <rdar://problem/39808763>
1839
1840         Reviewed by Wenson Hsieh.
1841
1842         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
1843
1844 2018-04-28  Brent Fulgham  <bfulgham@apple.com>
1845
1846         Revise sandboxes to allow additional IOKit property access
1847         https://bugs.webkit.org/show_bug.cgi?id=185095
1848         <rdar://problem/39809455>
1849
1850         Reviewed by Eric Carlson.
1851
1852         Update the WebContent and Plugin processes to allow additional IOKit property access.
1853
1854         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
1855         * WebProcess/com.apple.WebProcess.sb.in:
1856
1857 2018-04-28  Carlos Garcia Campos  <cgarcia@igalia.com>
1858
1859         [GTK] WebProcess from WebKitGtk+ 2.19.92 SIGSEVs in WebCore::TextureMapperGL::~TextureMapperGL
1860         https://bugs.webkit.org/show_bug.cgi?id=184040
1861
1862         Reviewed by Michael Catanzaro.
1863
1864         This can happen when using single shared process model or when the process limit is reached in multiple process
1865         model. In this case, all pages in the same web process with accelerated compositing enabled share the same
1866         compositing thread. Every page sets its GL context as current when rendering a frame, but not when invalidating
1867         the threaded compositor when the page is closed. So, if a hidden tab is closed, the threaded compositor is
1868         invalidated and the GL resources of the current context (the visible page) are destroyed. This is also causing
1869         the blank pages issue when closing a tab related to another one, the current one stops rendering anything because
1870         its GL context has been released. We should make the threaded compositor context current when invalidating it.
1871
1872         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1873         (WebKit::ThreadedCompositor::invalidate):
1874
1875 2018-04-27  Timothy Hatcher  <timothy@apple.com>
1876
1877         REGRESSION: Touch events fail to dispatch to the page in all cases.
1878
1879         https://bugs.webkit.org/show_bug.cgi?id=185097
1880         rdar://problem/39731995
1881
1882         Reviewed by Tim Horton.
1883
1884         * UIProcess/ios/WKContentViewInteraction.mm:
1885         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
1886         Consult internal gesture recognizers, otherwise NO might get returned.
1887
1888 2018-04-26  Ryosuke Niwa  <rniwa@webkit.org>
1889
1890         PSON: Triggering a navigation to an invalid URL creates a new WebContent process
1891         https://bugs.webkit.org/show_bug.cgi?id=185066
1892
1893         Reviewed by Youenn Fablet.
1894
1895         Don't create a new WebContent process when the target URL is invalid as well as when the source URL is invalid.
1896
1897         * UIProcess/WebProcessPool.cpp:
1898         (WebKit::WebProcessPool::processForNavigationInternal):
1899
1900 2018-04-27  Youenn Fablet  <youenn@apple.com>
1901
1902         Use NetworkLoadChecker for XHR/fetch loads
1903         https://bugs.webkit.org/show_bug.cgi?id=184741
1904
1905         Reviewed by Chris Dumez.
1906
1907         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
1908         (WebKit::NetworkCORSPreflightChecker::didCompleteWithError):
1909         Pass the preflight error as completion error if any.
1910         * NetworkProcess/NetworkLoad.cpp:
1911         (WebKit::NetworkLoad::willPerformHTTPRedirection):
1912         Set response source to Network so that checks relying on that are correct.
1913         * NetworkProcess/NetworkLoadChecker.cpp:
1914         (WebKit::NetworkLoadChecker::validateResponse):
1915         Adding Oppaqueredirect tainting.
1916         (NetworkLoadChecker::doesNotNeedCORSCheck):
1917         Adding a check to only activate CORS checks for CORS enabled schemes.
1918         Non CORS enabled schemes loads should have failed in WebProcess already.
1919         (WebKit::NetworkLoadChecker::checkCORSRedirectedRequest):
1920         Remove Authorization header as done by SubresourceLoader.
1921         (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
1922         If error is cancellation, we still want to call the completion handler.
1923         * NetworkProcess/NetworkResourceLoader.cpp:
1924         Activate network load checker for all types of loads.
1925         (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
1926         Handle manual redirection by directly calling didReceiveResponse.
1927
1928 2018-04-27  Wenson Hsieh  <wenson_hsieh@apple.com>
1929
1930         Add an experimental feature flag for viewport "min-device-width"
1931         https://bugs.webkit.org/show_bug.cgi?id=185050
1932         <rdar://problem/39624038>
1933
1934         Reviewed by Tim Horton.
1935
1936         Add MinDeviceWidthEnabled as a new experimental feature, on by default in extra zoom mode and off elsewhere.
1937
1938         * Shared/WebPreferences.yaml:
1939         * Shared/WebPreferencesDefaultValues.h:
1940
1941 2018-04-27  Daniel Bates  <dabates@apple.com>
1942
1943         UIDelegate::UIClient::didResignInputElementStrongPasswordAppearance() is applicable to both Mac and iOS
1944         https://bugs.webkit.org/show_bug.cgi?id=185079
1945         <rdar://problem/39794960>
1946
1947         I inadvertently forgot to move the UIDelegate field webViewDidResignInputElementStrongPasswordAppearanceWithUserInfo
1948         outside the PLATFORM(MAC)-guard.
1949
1950         * UIProcess/Cocoa/UIDelegate.h:
1951
1952 2018-04-27  Daniel Bates  <dabates@apple.com>
1953
1954         UIDelegate::UIClient::didResignInputElementStrongPasswordAppearance() is applicable to both Mac and iOS
1955         https://bugs.webkit.org/show_bug.cgi?id=185079
1956         <rdar://problem/39794960>
1957
1958         Reviewed by Andy Estes.
1959
1960         * UIProcess/Cocoa/UIDelegate.h:
1961         * UIProcess/Cocoa/UIDelegate.mm:
1962         (WebKit::UIDelegate::setDelegate):
1963         (WebKit::UIDelegate::UIClient::didResignInputElementStrongPasswordAppearance):
1964
1965 2018-04-27  Wenson Hsieh  <wenson_hsieh@apple.com>
1966
1967         Rename minimumLayoutSize to viewLayoutSize
1968         https://bugs.webkit.org/show_bug.cgi?id=185050
1969         <rdar://problem/39624038>
1970
1971         Reviewed by Tim Horton.
1972
1973         Renames minimumLayoutSize to viewLayoutSize, since the minimum layout size in ViewportConfiguration is now
1974         different from the minimum layout size that is currently pushed down from the UI process (e.g. WKWebView SPI) in
1975         the case where `min-device-width` is used to override the minimum layout size.
1976
1977         * Shared/WebPageCreationParameters.cpp:
1978         (WebKit::WebPageCreationParameters::encode const):
1979         (WebKit::WebPageCreationParameters::decode):
1980         * Shared/WebPageCreationParameters.h:
1981         * UIProcess/API/Cocoa/WKWebView.mm:
1982         (-[WKWebView _processDidExit]):
1983         (-[WKWebView activeViewLayoutSize:]):
1984         (-[WKWebView _dispatchSetViewLayoutSize:]):
1985         (-[WKWebView _frameOrBoundsChanged]):
1986         (-[WKWebView _minimumLayoutSizeOverride]):
1987         (-[WKWebView _setViewLayoutSizeOverride:]):
1988         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
1989         (-[WKWebView _endAnimatedResize]):
1990         (-[WKWebView _overrideLayoutParametersWithMinimumLayoutSize:maximumUnobscuredSizeOverride:]):
1991         (-[WKWebView _clearOverrideLayoutParameters]):
1992         (-[WKWebView _minimumLayoutWidth]):
1993         (-[WKWebView _setMinimumLayoutWidth:]):
1994         (-[WKWebView activeMinimumLayoutSize:]): Deleted.
1995         (-[WKWebView _dispatchSetMinimumLayoutSize:]): Deleted.
1996         (-[WKWebView _setMinimumLayoutSizeOverride:]): Deleted.
1997         (-[WKWebView _overrideLayoutParametersWithMinimumLayoutSize:minimumLayoutSizeForMinimalUI:maximumUnobscuredSizeOverride:]): Deleted.
1998
1999         Remove unused SPI that has been deprecated since iOS 9, has a simple drop-in replacement, and no longer has any
2000         internal clients.
2001
2002         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2003         * UIProcess/Cocoa/WebViewImpl.mm:
2004         (WebKit::WebViewImpl::setMinimumSizeForAutoLayout):
2005         (WebKit::WebViewImpl::minimumSizeForAutoLayout const):
2006         (WebKit::WebViewImpl::setIntrinsicContentSize):
2007         * UIProcess/DrawingAreaProxy.h:
2008         (WebKit::DrawingAreaProxy::viewLayoutSizeDidChange):
2009         (WebKit::DrawingAreaProxy::minimumLayoutSizeDidChange): Deleted.
2010         * UIProcess/WebPageProxy.cpp:
2011         (WebKit::WebPageProxy::creationParameters):
2012         (WebKit::WebPageProxy::setViewLayoutSize):
2013         (WebKit::WebPageProxy::setMinimumLayoutSize): Deleted.
2014         * UIProcess/WebPageProxy.h:
2015         (WebKit::WebPageProxy::viewLayoutSize const):
2016         (WebKit::WebPageProxy::minimumLayoutSize const): Deleted.
2017         * UIProcess/ios/WebPageProxyIOS.mm:
2018         (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
2019         (WebKit::WebPageProxy::setViewportConfigurationViewLayoutSize):
2020         (WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSize): Deleted.
2021         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
2022         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
2023         (WebKit::TiledCoreAnimationDrawingAreaProxy::viewLayoutSizeDidChange):
2024         (WebKit::TiledCoreAnimationDrawingAreaProxy::didUpdateGeometry):
2025         (WebKit::TiledCoreAnimationDrawingAreaProxy::intrinsicContentSizeDidChange):
2026         (WebKit::TiledCoreAnimationDrawingAreaProxy::willSendUpdateGeometry):
2027         (WebKit::TiledCoreAnimationDrawingAreaProxy::minimumLayoutSizeDidChange): Deleted.
2028         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2029         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
2030         * WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
2031         (WebKit::ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture):
2032         * WebProcess/WebPage/WebPage.cpp:
2033         (WebKit::m_credentialsMessenger):
2034         (WebKit::WebPage::setViewLayoutSize):
2035         (WebKit::WebPage::setMinimumLayoutSize): Deleted.
2036         * WebProcess/WebPage/WebPage.h:
2037         (WebKit::WebPage::viewLayoutSize const):
2038         (WebKit::WebPage::minimumLayoutSize const): Deleted.
2039         * WebProcess/WebPage/WebPage.messages.in:
2040         * WebProcess/WebPage/ios/WebPageIOS.mm:
2041         (WebKit::WebPage::setViewportConfigurationViewLayoutSize):
2042         (WebKit::WebPage::dynamicViewportSizeUpdate):
2043         (WebKit::WebPage::setViewportConfigurationMinimumLayoutSize): Deleted.
2044         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2045         (WebKit::TiledCoreAnimationDrawingArea::updateIntrinsicContentSizeIfNeeded):
2046         (WebKit::TiledCoreAnimationDrawingArea::updateGeometry):
2047
2048 2018-04-27  Wenson Hsieh  <wenson_hsieh@apple.com>
2049
2050         [Extra zoom mode] Add a mechanism to override default viewport behaviors in extra zoom mode
2051         https://bugs.webkit.org/show_bug.cgi?id=185050
2052         <rdar://problem/39624038>
2053
2054         Reviewed by Tim Horton.
2055
2056         Remove the forceHorizontalViewportShrinkToFit and minimumAllowedLayoutWidth SPI hooks from WebKit, and
2057         additionally remove all logic for plumbing viewSize to WebCore. See WebCore/ChangeLog for more information.
2058
2059         * Shared/VisibleContentRectUpdateInfo.cpp:
2060         (WebKit::VisibleContentRectUpdateInfo::encode const):
2061         (WebKit::VisibleContentRectUpdateInfo::decode):
2062         (WebKit::operator<<):
2063         * Shared/VisibleContentRectUpdateInfo.h:
2064         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
2065         (WebKit::VisibleContentRectUpdateInfo::allowShrinkToFit const):
2066         (WebKit::operator==):
2067         (WebKit::VisibleContentRectUpdateInfo::forceHorizontalShrinkToFit const): Deleted.
2068         * UIProcess/API/Cocoa/WKWebView.mm:
2069         (-[WKWebView _initializeWithConfiguration:]):
2070         (-[WKWebView activeMinimumLayoutSize:]):
2071         (-[WKWebView _dispatchSetMinimumLayoutSize:]):
2072         (-[WKWebView _frameOrBoundsChanged]):
2073         (-[WKWebView _setMinimumLayoutSizeOverride:]):
2074         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
2075         (-[WKWebView _endAnimatedResize]):
2076         (-[WKWebView _minimumAllowedLayoutWidth]): Deleted.
2077         (-[WKWebView _setMinimumAllowedLayoutWidth:]): Deleted.
2078         (-[WKWebView activeMinimumLayoutSizes:]): Deleted.
2079         (-[WKWebView _dispatchSetMinimumLayoutSize:viewSize:]): Deleted.
2080         (-[WKWebView _setForceHorizontalViewportShrinkToFit:]): Deleted.
2081         (-[WKWebView _forceHorizontalViewportShrinkToFit]): Deleted.
2082         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2083         * UIProcess/WebPageProxy.cpp:
2084         (WebKit::WebPageProxy::creationParameters):
2085         * UIProcess/WebPageProxy.h:
2086         * UIProcess/ios/WKContentView.mm:
2087         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
2088         * UIProcess/ios/WebPageProxyIOS.mm:
2089         (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
2090         (WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSize):
2091         * WebProcess/WebPage/WebPage.cpp:
2092         (WebKit::m_credentialsMessenger):
2093         * WebProcess/WebPage/WebPage.h:
2094         * WebProcess/WebPage/WebPage.messages.in:
2095         * WebProcess/WebPage/ios/WebPageIOS.mm:
2096         (WebKit::WebPage::setViewportConfigurationMinimumLayoutSize):
2097         (WebKit::WebPage::dynamicViewportSizeUpdate):
2098         (WebKit::WebPage::updateVisibleContentRects):
2099
2100 2018-04-27  Carlos Garcia Campos  <cgarcia@igalia.com>
2101
2102         REGRESSION(r230812): [WPE][GTK] WebKitWebViewSessionState.cpp throws away encoded BackForwardList identifier
2103         https://bugs.webkit.org/show_bug.cgi?id=184823
2104
2105         Reviewed by Michael Catanzaro.
2106
2107         Bump session sate format version to 2 and stop encoding the backfoward list item identifier, since it's always
2108         regenerated.
2109
2110         * UIProcess/API/glib/WebKitWebViewSessionState.cpp:
2111         (encodeBackForwardListItemState): Always encode version 2.
2112         (encodeBackForwardListState): Ditto.
2113         (encodeSessionState): Ditto.
2114         (decodeBackForwardListItemStateV1): Decode list item state for version 1.
2115         (decodeBackForwardListItemState): Receive the version and call decodeBackForwardListItemStateV1() if it's 1 or
2116         use the version 2 otherwise.
2117         (decodeSessionState): Load data for known formats and use the one that worked to decode it.
2118
2119 2018-04-26  Megan Gardner  <megan_gardner@apple.com>
2120
2121         Add timeout for ensurePositionInformationIsUpToDate
2122         https://bugs.webkit.org/show_bug.cgi?id=184567
2123
2124         Reviewed by Wenson Hsieh.
2125         
2126         We are having long hang times for WebKit, and this is one of the culprits.
2127         If we do not get an answer for positionInformation in a reasonable amount of time, we should timeout,
2128         so as to not hang the UI.
2129
2130         * UIProcess/ios/WKContentViewInteraction.mm:
2131         (-[WKContentView ensurePositionInformationIsUpToDate:]):
2132
2133 2018-04-26  Andy Estes  <aestes@apple.com>
2134
2135         Try again to fix the iOS build after r231063.
2136
2137         * Configurations/Base.xcconfig:
2138
2139 2018-04-26  Jer Noble  <jer.noble@apple.com>
2140
2141         WK_COCOA_TOUCH the WK_ACCESSIBILITY_LDFLAGS
2142         https://bugs.webkit.org/show_bug.cgi?id=185007
2143         <rdar://problem/39735943>
2144
2145         Reviewed by Timothy Hatcher.
2146
2147         * Configurations/WebKit.xcconfig:
2148
2149 2018-04-26  Jer Noble  <jer.noble@apple.com>
2150
2151         Unreviewed build fix; fix iOS TAPI build step after r231063.
2152
2153         * Configurations/WebKit.xcconfig:
2154
2155 2018-04-26  Jer Noble  <jer.noble@apple.com>
2156
2157         WK_COCOA_TOUCH all the things.
2158         https://bugs.webkit.org/show_bug.cgi?id=185006
2159
2160         Reviewed by Tim Horton.
2161
2162         * Configurations/BaseTarget.xcconfig:
2163         * Configurations/WebKit.xcconfig:
2164
2165 2018-04-26  Daniel Bates  <dabates@apple.com>
2166
2167         Remove WebCore::-qualifier in NetworkLoadChecker.cpp
2168         https://bugs.webkit.org/show_bug.cgi?id=185037
2169
2170         Reviewed by Youenn Fablet.
2171
2172         It is unncesssary to qualify WebCore types in NetworkLoadChecker.cpp as it has a
2173         "using namespace WebCore" directive.
2174
2175         * NetworkProcess/NetworkLoadChecker.cpp:
2176         (WebKit::NetworkLoadChecker::NetworkLoadChecker):
2177         (WebKit::NetworkLoadChecker::checkRedirection):
2178         (WebKit::NetworkLoadChecker::validateResponse):
2179         (WebKit::NetworkLoadChecker::continueCheckingRequest): Removed extra space character and unnecessary
2180         parentheses from the right-hand side of the assignment to m_storedCredentialsPolicy.
2181         (WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad):
2182
2183 2018-04-26  Daniel Bates  <dabates@apple.com>
2184
2185         Rename NetworkLoadChecker::returnError() to NetworkLoadChecker::accessControlErrorForValidationHandler()
2186         https://bugs.webkit.org/show_bug.cgi?id=185035
2187
2188         Reviewed by Youenn Fablet.
2189
2190         Substitute NetworkLoadChecker::accessControlErrorForValidationHandler() for NetworkLoadChecker::returnError()
2191         to better describe that it is a convenience function that returns a wrapped ResourceError object,
2192         that represents an access control error, suitable to be passed directly to a validation handler.
2193
2194         * NetworkProcess/NetworkLoadChecker.cpp:
2195         (WebKit::NetworkLoadChecker::checkRedirection): Update as needed for renaming.
2196         (WebKit::NetworkLoadChecker::accessControlErrorForValidationHandler): Use auto -> syntax to avoid the need to
2197         class-qualify the return type. Also renamed parameter from error to message as it represents the message/description
2198         for the access control error.
2199         (WebKit::NetworkLoadChecker::checkRequest): Update as needed for renaming. Also substitute "message" for "error"
2200         to match the argument of accessControlErrorForValidationHandler() with the same name.
2201         (WebKit::NetworkLoadChecker::continueCheckingRequest): Update as needed for renaming.
2202         (WebKit::NetworkLoadChecker::returnError): Deleted; renamed to accessControlErrorForValidationHandler().
2203         * NetworkProcess/NetworkLoadChecker.h:
2204
2205 2018-04-26  Jiewen Tan  <jiewen_tan@apple.com>
2206
2207         Remove access to keychain from the WebContent process
2208         https://bugs.webkit.org/show_bug.cgi?id=184428
2209         <rdar://problem/13150903>
2210
2211         Part 3.
2212
2213         Tighten WebContent Process' sandbox profile to all Security.framework services.
2214
2215         Reviewed by Brent Fulgham.
2216
2217         * WebProcess/com.apple.WebProcess.sb.in:
2218
2219 2018-04-26  Youenn Fablet  <youenn@apple.com>
2220
2221         Make cross origin redirection error messages consistent between SubresourceLoader and NetworkLoadChecker
2222         https://bugs.webkit.org/show_bug.cgi?id=185023
2223
2224         Reviewed by Chris Dumez.
2225
2226         Align NetworkLoadChecker with what SubresourceLoader is doing so that we can keep WK1 and WK2 error messages as consistent as possible.
2227
2228         * NetworkProcess/NetworkLoadChecker.cpp:
2229         (WebKit::NetworkLoadChecker::checkRedirection):
2230         (WebKit::NetworkLoadChecker::validateResponse):
2231
2232 2018-04-25  Megan Gardner  <megan_gardner@apple.com>
2233
2234         Activate selection when interacting with editable content
2235         https://bugs.webkit.org/show_bug.cgi?id=185017
2236
2237         Reviewed by Tim Horton.
2238         
2239         Fixes a regression from r231016 where selection now does not work when interacting with
2240         editable content. When we go into editable content, we should turn on the assistant.
2241         This fulfills the requirement of user interaction as well, so any javascript selections
2242         after this point should be valid.
2243
2244         * UIProcess/ios/WKContentViewInteraction.mm:
2245         (-[WKContentView _startAssistingKeyboard]):
2246         (-[WKContentView _stopAssistingKeyboard]):
2247
2248 2018-04-26  Per Arne Vollan  <pvollan@apple.com>
2249
2250         Disable content filtering in minimal simulator mode
2251         https://bugs.webkit.org/show_bug.cgi?id=185027
2252         <rdar://problem/39736091>
2253
2254         Reviewed by Jer Noble.
2255
2256         * Configurations/FeatureDefines.xcconfig:
2257
2258 2018-04-26  Brady Eidson  <beidson@apple.com>
2259
2260         Add a setting for keeping around all processes and always reusing them per-origin.
2261         <rdar://problem/39695798> and https://bugs.webkit.org/show_bug.cgi?id=185020
2262
2263         Reviewed by Andy Estes.
2264
2265         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2266         (API::ProcessPoolConfiguration::copy):
2267         * UIProcess/API/APIProcessPoolConfiguration.h:
2268
2269         * UIProcess/API/C/WKContextConfigurationRef.cpp:
2270         (WKContextConfigurationAlwaysKeepAndReuseSwappedProcesses):
2271         (WKContextConfigurationSetAlwaysKeepAndReuseSwappedProcesses):
2272         * UIProcess/API/C/WKContextConfigurationRef.h:
2273
2274         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
2275         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
2276         (-[_WKProcessPoolConfiguration setAlwaysKeepAndReuseSwappedProcesses:]):
2277         (-[_WKProcessPoolConfiguration alwaysKeepAndReuseSwappedProcesses]):
2278
2279         * UIProcess/SuspendedPageProxy.cpp:
2280         (WebKit::SuspendedPageProxy::webProcessDidClose):
2281         (WebKit::SuspendedPageProxy::destroyWebPageInWebProcess):
2282         * UIProcess/SuspendedPageProxy.h:
2283
2284         * UIProcess/WebPageProxy.cpp:
2285         (WebKit::WebPageProxy::suspendedPageClosed):
2286         (WebKit::WebPageProxy::suspendedPageProcessClosed): Deleted.
2287         * UIProcess/WebPageProxy.h:
2288         (WebKit::WebPageProxy::suspendedPage const):
2289
2290         * UIProcess/WebProcessPool.cpp:
2291         (WebKit::WebProcessPool::shouldTerminate):
2292         (WebKit::WebProcessPool::disconnectProcess):
2293         (WebKit::WebProcessPool::addProcessToOriginCacheSet):
2294         (WebKit::WebProcessPool::removeProcessFromOriginCacheSet):
2295         (WebKit::WebProcessPool::processForNavigation): If a swap will occur, cache the old process.
2296         (WebKit::WebProcessPool::processForNavigationInternal): Consider re-using a previously cached process.
2297         * UIProcess/WebProcessPool.h:
2298
2299         * WebProcess/WebPage/WebPage.cpp:
2300         (WebKit::m_credentialsMessenger):
2301
2302 2018-04-26  Andy VanWagoner  <thetalecrafter@gmail.com>
2303
2304         [INTL] Implement Intl.PluralRules
2305         https://bugs.webkit.org/show_bug.cgi?id=184312
2306
2307         Reviewed by JF Bastien.
2308
2309         Added Intl.PluralRules feature flag.
2310
2311         * Configurations/FeatureDefines.xcconfig:
2312
2313 2018-04-26  Zan Dobersek  <zdobersek@igalia.com>
2314
2315         [GTK][WPE] Initial ASYNC_SCROLLING support
2316         https://bugs.webkit.org/show_bug.cgi?id=184961
2317
2318         Reviewed by Carlos Garcia Campos.
2319
2320         Guard RemoteScrollingCoordinator and RemoteScrollingCoordinatorProxy
2321         usage in WebChromeClient and WebPageProxy, respectively, with
2322         PLATFORM(COCOA) in addition to the ASYNC_SCROLLING guards.
2323
2324         Despite enabling the code at build-time, the feature (as intended) is
2325         not yet used because of the DrawingArea rejection in the WebPage
2326         constructor.
2327
2328         * UIProcess/WebPageProxy.cpp:
2329         (WebKit::WebPageProxy::initializeWebPage):
2330         (WebKit::WebPageProxy::handleWheelEvent):
2331         (WebKit::WebPageProxy::updateTouchEventTracking):
2332         * UIProcess/WebPageProxy.h:
2333         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2334         (WebKit::WebChromeClient::createScrollingCoordinator const):
2335
2336 2018-04-25  Michael Catanzaro  <mcatanzaro@igalia.com>
2337
2338         [WPE] Build and link against latest WPEBackend and WPEBackend-fdo
2339         https://bugs.webkit.org/show_bug.cgi?id=184643
2340
2341         Reviewed by Žan Doberšek.
2342
2343         Adapt to single-header WPE includes.
2344
2345         Null-initialize padding to silence -Wmissing-field-initializers. (Yuck.)
2346
2347         * Shared/NativeWebTouchEvent.h:
2348         * Shared/wpe/WebEventFactory.cpp:
2349         * UIProcess/API/glib/WebKitPrivate.cpp:
2350         * UIProcess/API/wpe/CompositingManagerProxy.cpp:
2351         * UIProcess/API/wpe/ScrollGestureController.h:
2352         * UIProcess/API/wpe/WPEView.cpp:
2353         (WKWPE::m_backend):
2354         * UIProcess/API/wpe/WebKitWebViewBackend.h:
2355         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
2356         * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp:
2357         (WebKit::AcceleratedSurfaceWPE::initialize):
2358
2359 2018-04-25  Saam Barati  <sbarati@apple.com>
2360
2361         dlopen the bundle's executable before calling -[NSBundle load] since that will also do a bunch of other things we don't need
2362         https://bugs.webkit.org/show_bug.cgi?id=184904
2363
2364         Reviewed by Geoffrey Garen.
2365
2366         Loading an NSBundle does a lot of work to find the principal class inside
2367         the bundle. This means it walks all the objective C class names loaded
2368         by the bundle. Doing this is *really* expensive.
2369         
2370         Some users of the injected bundle define a WKBundleInitialize function.
2371         In such a case, we don't need the principal class, so we can skip loading
2372         the NSBundle. Now, before we load the bundle, we dlopen and dlsym looking
2373         for the WKBundleInitialize function. If we find it, we skip loading
2374         the bundle. If we don't find the WKBundleInitialize function, we fall
2375         back to loading the bundle and finding the principal class.
2376         
2377         This speeds up initializeWebProcess by ~70ms on my MBP.
2378
2379         * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
2380         (WebKit::InjectedBundle::initialize):
2381
2382 2018-04-25  Youenn Fablet  <youenn@apple.com>
2383
2384         Use NetworkLoadChecker for all subresource loads except fetch/XHR
2385         https://bugs.webkit.org/show_bug.cgi?id=184870
2386         <rdar://problem/39370034>
2387
2388         Reviewed by Chris Dumez.
2389
2390         Relax rules to check for non HTTP(s) redirections to throw only when WebProcess says to load it after redirection.
2391         This allows WebProcess to load redirected non HTTP(s) URLs, such as data URLs.
2392         We keep these checks when WebProcess asks to continue the load and for all PingLoads.
2393
2394         Update error messages to be more consistent with WK1.
2395
2396         * NetworkProcess/NetworkLoadChecker.cpp:
2397         (WebKit::NetworkLoadChecker::checkRedirection):
2398         (WebKit::NetworkLoadChecker::continueCheckingRequest):
2399         (WebKit::NetworkLoadChecker::validateResourceResponse):
2400         (WebKit::NetworkLoadChecker::continueCheckingRequest):
2401         * NetworkProcess/NetworkLoadChecker.h:
2402         (WebKit::NetworkLoadChecker::validateResponse):
2403         * NetworkProcess/NetworkResourceLoader.cpp:
2404         (WebKit::shouldUseNetworkLoadChecker):
2405         (WebKit::NetworkResourceLoader::continueWillSendRequest):
2406
2407 2018-04-25  Ryosuke Niwa  <rniwa@webkit.org>
2408
2409         PSON: Don't create a new process when navigating to a blob URL, data URL, and about:blank
2410         https://bugs.webkit.org/show_bug.cgi?id=184962
2411
2412         Reviewed by Youenn Fablet.
2413         <rdar://problem/39715044>
2414
2415         Build fix. Revert the change in r231019 to remove the empty URL and about:blank check here.
2416         These checks are for the source / originating URL, not the target URL.
2417
2418         * UIProcess/WebProcessPool.cpp:
2419         (WebKit::WebProcessPool::processForNavigation):
2420
2421 2018-04-25  Youenn Fablet  <youenn@apple.com>
2422
2423         WebLoaderStrategy::networkMetricsFromResourceLoadIdentifier should use DoNotProcessIncomingMessagesWhenWaitingForSyncReply
2424         https://bugs.webkit.org/show_bug.cgi?id=184978
2425         <rdar://problem/39667094>
2426
2427         Reviewed by Simon Fraser.
2428
2429         Use DoNotProcessIncomingMessagesWhenWaitingForSyncReply to keep a consistent state after the sync IPC call.
2430
2431         * WebProcess/Network/WebLoaderStrategy.cpp:
2432         (WebKit::WebLoaderStrategy::responseFromResourceLoadIdentifier):
2433         (WebKit::WebLoaderStrategy::networkMetricsFromResourceLoadIdentifier):
2434
2435 2018-04-25  Jiewen Tan  <jiewen_tan@apple.com>
2436
2437         Remove access to keychain from the WebContent process
2438         https://bugs.webkit.org/show_bug.cgi?id=184428
2439         <rdar://problem/13150903>
2440
2441         Reviewed by Brent Fulgham.
2442
2443         This patch does the followings:
2444         1. Added necessary support to move HTMLKeygenElement's operation from WebContent Process to UI Process.
2445         2. Craft new SPI copySignedPublicKeyAndChallengeString to supply HTMLKeygenElement with dummy data such
2446         that WebKitTestRunner tests will not modify the underlying key store (e.g., the macOS Keychain).
2447
2448         * UIProcess/API/APINavigationClient.h:
2449         (API::NavigationClient::signedPublicKeyAndChallengeString):
2450         * UIProcess/API/C/WKPage.cpp:
2451         (WKPageSetPageNavigationClient):
2452         * UIProcess/API/C/WKPageNavigationClient.h:
2453         * UIProcess/Cocoa/NavigationState.h:
2454         * UIProcess/Cocoa/NavigationState.mm:
2455         (WebKit::NavigationState::NavigationClient::signedPublicKeyAndChallengeString):
2456         * UIProcess/WebPageProxy.cpp:
2457         (WebKit::WebPageProxy::signedPublicKeyAndChallengeString):
2458         * UIProcess/WebPageProxy.h:
2459         * UIProcess/WebPageProxy.messages.in:
2460         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2461         (WebKit::WebChromeClient::signedPublicKeyAndChallengeString const):
2462         * WebProcess/WebCoreSupport/WebChromeClient.h:
2463
2464 2018-04-25  Wenson Hsieh  <wenson_hsieh@apple.com>
2465
2466         [Extra zoom mode] The search field on www.bing.com is missing label text
2467         https://bugs.webkit.org/show_bug.cgi?id=184975
2468         <rdar://problem/39723081>
2469
2470         Reviewed by Tim Horton.
2471
2472         Adds support for displaying the "aria-label" attribute as the input view's label text in extra zoom mode. Also
2473         adds support for grabbing the input label's text for testing.
2474
2475         Test: fast/forms/extrazoom/form-control-label-text.html
2476
2477         * Shared/AssistedNodeInformation.cpp:
2478         (WebKit::AssistedNodeInformation::encode const):
2479         (WebKit::AssistedNodeInformation::decode):
2480         * Shared/AssistedNodeInformation.h:
2481         * UIProcess/API/Cocoa/WKWebView.mm:
2482         (-[WKWebView formInputLabel]):
2483         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2484         * UIProcess/ios/WKContentViewInteraction.h:
2485         * UIProcess/ios/WKContentViewInteraction.mm:
2486         (-[WKContentView formInputLabel]):
2487         * WebProcess/WebPage/ios/WebPageIOS.mm:
2488         (WebKit::WebPage::getAssistedNodeInformation):
2489
2490 2018-04-25  Ryosuke Niwa  <rniwa@webkit.org>
2491
2492         PSON: Don't create a new process when navigating to a blob URL, data URL, and about:blank
2493         https://bugs.webkit.org/show_bug.cgi?id=184962
2494
2495         Reviewed by Youenn Fablet.
2496
2497         Don't create a new WebContent process when navigating to a blob object URL since doing so
2498         can result in a race condition in which the blog URL is removed from the blob registry of
2499         the network process by the time the navigation gets commited. This causes a failure in
2500         fast/dom/HTMLAnchorElement/anchor-download-unset.html and oher layout tests.
2501
2502         In the future, the network process should verify that a given WebContent process has access
2503         to a given blob URL. For now, we rely on WebContent process to tell us whether it can
2504         navigate to a given blob URL or not.
2505
2506         * Shared/NavigationActionData.cpp:
2507         (WebKit::NavigationActionData::encode const): Encode newly added treatAsSameOriginNavigation.
2508         (WebKit::NavigationActionData::decode): Ditto for decoding.
2509         * Shared/NavigationActionData.h:
2510         (WebKit::NavigationActionData::treatAsSameOriginNavigation): Added.
2511         * UIProcess/API/APINavigation.h:
2512         (API::Navigation::setTreatAsSameOriginNavigation): Added.
2513         (API::Navigation::treatAsSameOriginNavigation const): Added.
2514         * UIProcess/API/APIProcessPoolConfiguration.h:
2515         * UIProcess/WebPageProxy.cpp:
2516         (WebKit::WebPageProxy::decidePolicyForNavigationAction): Use the current process when
2517         treatAsSameOriginNavigation is set to true; i.e. when navigating to a blob URL the current
2518         document has access.
2519         * UIProcess/WebProcessPool.cpp:
2520         (WebKit::WebProcessPool::processForNavigation):
2521         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2522         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2523
2524 2018-04-25  Megan Gardner  <megan_gardner@apple.com>
2525
2526         Don't activate Selection Assistant unless it is actually needed.
2527         https://bugs.webkit.org/show_bug.cgi?id=184944
2528         <rdar://problem/39469671>
2529
2530         Reviewed by Tim Horton.
2531         
2532         Don't activate the selection unless we need to. Activating on init is overeager and allowing Javascript to 
2533         activate selections without user input.
2534
2535         * UIProcess/ios/WKContentViewInteraction.mm:
2536         (-[WKContentView useSelectionAssistantWithGranularity:]):
2537
2538 2018-04-25  Wenson Hsieh  <wenson_hsieh@apple.com>
2539
2540         Fix entitlements and sandbox configurations in WebKit after r230778
2541         https://bugs.webkit.org/show_bug.cgi?id=184960
2542         <rdar://problem/39662827>
2543
2544         Reviewed by Tim Horton.
2545
2546         Build fixes for watchOS and tvOS after r230778.
2547
2548         * Configurations/BaseXPCService.xcconfig:
2549         * Configurations/NetworkService.xcconfig:
2550         * Configurations/WebContentService.xcconfig:
2551
2552 2018-04-25  Brent Fulgham  <bfulgham@apple.com>
2553
2554         Unreviewed build fix after r231008.
2555
2556         * NetworkProcess/NetworkDataTask.cpp:
2557         (WebKit::NetworkDataTask::create): Forgot to remove an unneeded constructor argument.
2558
2559 2018-04-25  Brent Fulgham  <bfulgham@apple.com>
2560
2561         Don't Block First Party Cookies on Redirects
2562         https://bugs.webkit.org/show_bug.cgi?id=184948
2563         <rdar://problem/39534099>
2564
2565         Reviewed by Youenn Fablet.
2566
2567         Top-level navigations should not be subject to cookie blocking behavior. When performing redirects for main frame
2568         navigation we are blocking cookies, leading to site breakage.
2569         
2570         We need to keep track of which NetworkDataTasks are due to a main frame navigation. When a redirect is performed
2571         on the main frame, we should treat the new origin as the 'first party for cookies' and avoid blocking cookies for
2572         that URL.
2573
2574         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2575         (WebKit::NetworkConnectionToWebProcess::preconnectTo): Use the correct parameter type. We actually serialize
2576         NetworkResourceLoadParameters over IPC, so we should get access to all the members of this child class.
2577         * NetworkProcess/NetworkConnectionToWebProcess.h:
2578         * NetworkProcess/NetworkDataTask.cpp:
2579         (WebKit::NetworkDataTask::create): Pass new 'loadIsForNavigation' flag to create methods. 
2580         (WebKit::NetworkDataTask::NetworkDataTask): Capture 'loadIsForNavigation' in constructor.
2581         * NetworkProcess/NetworkDataTask.h:
2582         (WebKit::NetworkDataTask::isTopLevelNavigation const): Added.
2583         * NetworkProcess/NetworkDataTaskBlob.cpp:
2584         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob): Accept new constructor argument.
2585         * NetworkProcess/NetworkDataTaskBlob.h:
2586         * NetworkProcess/NetworkLoad.cpp:
2587         (WebKit::NetworkLoad::willPerformHTTPRedirection): Retain requester value from old request during redirect.
2588         * NetworkProcess/NetworkResourceLoadParameters.cpp:
2589         (NetworkResourceLoadParameters::decode): Update to pass new flag.
2590         (NetworkResourceLoadParameters::encode): Ditto.
2591         * NetworkProcess/NetworkLoadParameters.h:
2592         * NetworkProcess/capture/NetworkDataTaskReplay.cpp:
2593         (WebKit::NetworkCapture::NetworkDataTaskReplay::NetworkDataTaskReplay): Accept new constructor argument.
2594         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
2595         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2596         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): Accept new constructor argument.
2597         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
2598         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
2599         (WebKit::NetworkDataTaskCurl::NetworkDataTaskCurl): Accept new constructor argument.
2600         * NetworkProcess/curl/NetworkDataTaskCurl.h:
2601         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
2602         (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup): Accept new constructor argument.
2603         * NetworkProcess/soup/NetworkDataTaskSoup.h:
2604
2605 2018-04-25  Youenn Fablet  <youenn@apple.com>
2606
2607         Ensure DNT is set for redirections handled in NetworkProcess
2608         https://bugs.webkit.org/show_bug.cgi?id=184890
2609
2610         Reviewed by Ryosuke Niwa.
2611
2612         Compute whether DNT header should be set on requests based on:
2613         - request has a DNT header
2614         - session is ephemeral (aka private browsing mode)
2615         In both cases, we ensure a DNT header is added for any request triggered by a redirection.
2616
2617         Covered by http/wpt/fetch/dnt-header-after-redirection.html.
2618
2619         * NetworkProcess/NetworkLoadChecker.cpp:
2620         (WebKit::NetworkLoadChecker::check):
2621         (WebKit::NetworkLoadChecker::prepareRedirectedRequest):
2622         * NetworkProcess/NetworkLoadChecker.h:
2623         * NetworkProcess/NetworkResourceLoader.cpp:
2624         (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
2625         (WebKit::NetworkResourceLoader::continueWillSendRequest):
2626         * NetworkProcess/PingLoad.cpp:
2627         (WebKit::PingLoad::willPerformHTTPRedirection):
2628         * WebProcess/Network/WebLoaderStrategy.cpp:
2629         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
2630
2631 2018-04-25  Michael Catanzaro  <mcatanzaro@igalia.com>
2632
2633         [WPE] Remove deprecated functions and properties from the API
2634         https://bugs.webkit.org/show_bug.cgi?id=179295
2635
2636         Reviewed by Žan Doberšek.
2637
2638         * UIProcess/API/glib/WebKitCookieManager.cpp:
2639         * UIProcess/API/glib/WebKitFormSubmissionRequest.cpp:
2640         * UIProcess/API/glib/WebKitNavigationPolicyDecision.cpp:
2641         (webkitNavigationPolicyDecisionGetProperty):
2642         (webkit_navigation_policy_decision_class_init):
2643         * UIProcess/API/glib/WebKitSettings.cpp:
2644         (webKitSettingsSetProperty):
2645         (webKitSettingsGetProperty):
2646         (webkit_settings_class_init):
2647         * UIProcess/API/glib/WebKitWebContext.cpp:
2648         (webkitWebContextGetProperty):
2649         (webkitWebContextSetProperty):
2650         (webkit_web_context_class_init):
2651         * UIProcess/API/glib/WebKitWebView.cpp:
2652         (webkit_web_view_class_init):
2653         (webkitWebViewHandleAuthenticationChallenge):
2654         (webkitWebViewWebProcessTerminated):
2655         * UIProcess/API/wpe/WebKitCookieManager.h:
2656         * UIProcess/API/wpe/WebKitFormSubmissionRequest.h:
2657         * UIProcess/API/wpe/WebKitNavigationPolicyDecision.h:
2658         * UIProcess/API/wpe/WebKitSettings.h:
2659         * UIProcess/API/wpe/WebKitWebContext.h:
2660
2661 2018-04-25  Michael Catanzaro  <mcatanzaro@igalia.com>
2662
2663         Unreviewed, silence -Wreturn-type warning
2664         https://bugs.webkit.org/show_bug.cgi?id=184560
2665
2666         * NetworkProcess/NetworkResourceLoader.cpp:
2667         (WebKit::shouldCancelCrossOriginLoad):
2668
2669 2018-04-25  Michael Catanzaro  <mcatanzaro@igalia.com>
2670
2671         [GTK] Miscellaneous build cleanups
2672         https://bugs.webkit.org/show_bug.cgi?id=184399
2673
2674         Reviewed by Žan Doberšek.
2675
2676         * PlatformGTK.cmake:
2677
2678 2018-04-25  Dean Jackson  <dino@apple.com>
2679
2680         Make a better flag for system preview, and disable it where necessary
2681         https://bugs.webkit.org/show_bug.cgi?id=184968
2682         <rdar://problem/39686506>
2683
2684         Reviewed by Eric Carlson.
2685
2686         Use USE(SYSTEM_PREVIEW).
2687
2688         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
2689         * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
2690         (-[WKWebViewContentProviderRegistry init]):
2691         * UIProcess/ios/WKSystemPreviewView.mm:
2692
2693 2018-04-25  Carlos Garcia Campos  <cgarcia@igalia.com>
2694
2695         [GTK] Implement MouseEvent.buttons
2696         https://bugs.webkit.org/show_bug.cgi?id=184913
2697
2698         Reviewed by Žan Doberšek.
2699
2700         It's currently returning always 0.
2701
2702         * Shared/gtk/WebEventFactory.cpp:
2703         (WebKit::pressedMouseButtons): Helper function to get the pressed mouse buttons.
2704         (WebKit::WebEventFactory::createWebMouseEvent): Pass presssed mouse buttons to constructor instead of 0.
2705         * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
2706         (WebKit::WebAutomationSession::platformSimulateMouseInteraction): Include the mouse buttons state in automation
2707         synthesized events and update m_currentModifiers with the mouse buttons state.
2708         (WebKit::keyCodeForVirtualKey): Do not set the state here.
2709         (WebKit::modifiersForKeyCode): Helper to get the modifiers for a key code.
2710         (WebKit::WebAutomationSession::platformSimulateKeyboardInteraction): Initialize the modifiers also when
2711         virtualKey is std::nullopt;
2712
2713 2018-04-24  Nan Wang  <n_wang@apple.com>
2714
2715         AX: soft link libAccessibility.dylb
2716         https://bugs.webkit.org/show_bug.cgi?id=184919
2717
2718         Reviewed by Dan Bernstein.
2719
2720         Weakly linked libAccessibility.dylib on macOS.
2721
2722         * Configurations/WebKit.xcconfig:
2723         * UIProcess/API/Cocoa/WKWebView.mm:
2724         (-[WKWebView _initializeWithConfiguration:]):
2725         (-[WKWebView _updateAccessibilityEventsEnabled]):
2726
2727 2018-04-24  Fujii Hironori  <Hironori.Fujii@sony.com>
2728
2729         [WinCairo] Add WKView and WKAPI
2730         https://bugs.webkit.org/show_bug.cgi?id=182869
2731
2732         Reviewed by Alex Christensen.
2733
2734         Resurrected source files for WebKit for Windows port which was
2735         removed in r139003.
2736
2737         * PlatformWin.cmake: Renamed the output name of WebKit to WebKit2
2738         not to conflict WebKitLegacy. Added source files and include paths.
2739         * UIProcess/API/C/WKAPICast.h:
2740         * UIProcess/API/C/win/WKAPICastWin.h: Added.
2741         * UIProcess/API/C/win/WKView.cpp: Added.
2742         (WKViewCreate):
2743         (WKViewGetWindow):
2744         (WKViewGetPage):
2745         (WKViewSetParentWindow):
2746         (WKViewWindowAncestryDidChange):
2747         (WKViewSetIsInWindow):
2748         (WKViewSetScrollOffsetOnNextResize):
2749         * UIProcess/API/C/win/WKView.h: Added.
2750         * UIProcess/API/win/APIWebsiteDataStoreWin.cpp: Added.
2751         (API::WebsiteDataStore::defaultApplicationCacheDirectory):
2752         (API::WebsiteDataStore::defaultCacheStorageDirectory):
2753         (API::WebsiteDataStore::defaultNetworkCacheDirectory):
2754         (API::WebsiteDataStore::defaultIndexedDBDatabaseDirectory):
2755         (API::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory):
2756         (API::WebsiteDataStore::defaultLocalStorageDirectory):
2757         (API::WebsiteDataStore::defaultMediaKeysStorageDirectory):
2758         (API::WebsiteDataStore::defaultWebSQLDatabaseDirectory):
2759         (API::WebsiteDataStore::defaultResourceLoadStatisticsDirectory):
2760         (API::WebsiteDataStore::cacheDirectoryFileSystemRepresentation):
2761         (API::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation):
2762         (API::WebsiteDataStore::defaultDataStoreConfiguration):
2763         * UIProcess/Launcher/ProcessLauncher.h:
2764         * UIProcess/Launcher/win/ProcessLauncherWin.cpp: Added.
2765         (WebKit::processName):
2766         (WebKit::ProcessLauncher::launchProcess):
2767         (WebKit::ProcessLauncher::terminateProcess):
2768         (WebKit::ProcessLauncher::platformInvalidate):
2769         * UIProcess/Network/NetworkProcessProxy.cpp:
2770         (WebKit::NetworkProcessProxy::networkProcessFailedToLaunch):
2771         (WebKit::NetworkProcessProxy::didCreateNetworkConnectionToWebProcess):
2772         * UIProcess/WebsiteData/win/WebsiteDataStoreWin.cpp: Added.
2773         (WebKit::WebsiteDataStore::platformInitialize):
2774         (WebKit::WebsiteDataStore::platformDestroy):
2775         (WebKit::WebsiteDataStore::platformRemoveRecentSearches):
2776         * UIProcess/win/PageClientImpl.cpp: Added.
2777         (WebKit::PageClientImpl::PageClientImpl):
2778         (WebKit::PageClientImpl::createDrawingAreaProxy):
2779         (WebKit::PageClientImpl::setViewNeedsDisplay):
2780         (WebKit::PageClientImpl::requestScroll):
2781         (WebKit::PageClientImpl::viewScrollPosition):
2782         (WebKit::PageClientImpl::viewSize):
2783         (WebKit::PageClientImpl::isViewWindowActive):
2784         (WebKit::PageClientImpl::isViewFocused):
2785         (WebKit::PageClientImpl::isViewVisible):
2786         (WebKit::PageClientImpl::isViewInWindow):
2787         (WebKit::PageClientImpl::PageClientImpl::processDidExit):
2788         (WebKit::PageClientImpl::didRelaunchProcess):
2789         (WebKit::PageClientImpl::toolTipChanged):
2790         (WebKit::PageClientImpl::setCursor):
2791         (WebKit::PageClientImpl::setCursorHiddenUntilMouseMoves):
2792         (WebKit::PageClientImpl::didChangeViewportProperties):
2793         (WebKit::PageClientImpl::registerEditCommand):
2794         (WebKit::PageClientImpl::clearAllEditCommands):
2795         (WebKit::PageClientImpl::canUndoRedo):
2796         (WebKit::PageClientImpl::executeUndoRedo):
2797         (WebKit::PageClientImpl::convertToDeviceSpace):
2798         (WebKit::PageClientImpl::convertToUserSpace):
2799         (WebKit::PageClientImpl::screenToRootView):
2800         (WebKit::PageClientImpl::rootViewToScreen):
2801         (WebKit::PageClientImpl::doneWithKeyEvent):
2802         (WebKit::PageClientImpl::createPopupMenuProxy):
2803         (WebKit::PageClientImpl::createContextMenuProxy):
2804         (WebKit::createColorPicker):
2805         (WebKit::PageClientImpl::enterAcceleratedCompositingMode):
2806         (WebKit::PageClientImpl::exitAcceleratedCompositingMode):
2807         (WebKit::PageClientImpl::updateAcceleratedCompositingMode):
2808         (WebKit::PageClientImpl::pageClosed):
2809         (WebKit::PageClientImpl::preferencesDidChange):
2810         (WebKit::PageClientImpl::didChangeContentSize):
2811         (WebKit::PageClientImpl::handleDownloadRequest):
2812         (WebKit::PageClientImpl::didCommitLoadForMainFrame):
2813         (WebKit::PageClientImpl::fullScreenManagerProxyClient):
2814         (WebKit::PageClientImpl::closeFullScreenManager):
2815         (WebKit::PageClientImpl::isFullScreen):
2816         (WebKit::PageClientImpl::enterFullScreen):
2817         (WebKit::PageClientImpl::exitFullScreen):
2818         (WebKit::PageClientImpl::beganEnterFullScreen):
2819         (WebKit::PageClientImpl::beganExitFullScreen):
2820         (WebKit::PageClientImpl::doneWithTouchEvent):
2821         (WebKit::PageClientImpl::wheelEventWasNotHandledByWebCore):
2822         (WebKit::PageClientImpl::didFinishLoadingDataForCustomContentProvider):
2823         (WebKit::PageClientImpl::navigationGestureDidBegin):
2824         (WebKit::PageClientImpl::navigationGestureWillEnd):
2825         (WebKit::PageClientImpl::navigationGestureDidEnd):
2826         (WebKit::PageClientImpl::willRecordNavigationSnapshot):
2827         (WebKit::PageClientImpl::didRemoveNavigationGestureSnapshot):
2828         (WebKit::PageClientImpl::didFirstVisuallyNonEmptyLayoutForMainFrame):
2829         (WebKit::PageClientImpl::didFinishLoadForMainFrame):
2830         (WebKit::PageClientImpl::didSameDocumentNavigationForMainFrame):
2831         (WebKit::PageClientImpl::didChangeBackgroundColor):
2832         (WebKit::PageClientImpl::isPlayingAudioWillChange):
2833         (WebKit::PageClientImpl::isPlayingAudioDidChange):
2834         (WebKit::PageClientImpl::refView):
2835         (WebKit::PageClientImpl::derefView):
2836         * UIProcess/win/PageClientImpl.h: Added.
2837         * UIProcess/win/TextCheckerWin.cpp: Added.
2838         (WebKit::checkerState):
2839         (WebKit::TextChecker::state):
2840         (WebKit::TextChecker::setTestingMode):
2841         (WebKit::TextChecker::isTestingMode):
2842         (WebKit::TextChecker::isContinuousSpellCheckingAllowed):
2843         (WebKit::TextChecker::setContinuousSpellCheckingEnabled):
2844         (WebKit::TextChecker::setGrammarCheckingEnabled):
2845         (WebKit::TextChecker::continuousSpellCheckingEnabledStateChanged):
2846         (WebKit::TextChecker::grammarCheckingEnabledStateChanged):
2847         (WebKit::TextChecker::uniqueSpellDocumentTag):
2848         (WebKit::TextChecker::closeSpellDocumentWithTag):
2849         (WebKit::TextChecker::checkSpellingOfString):
2850         (WebKit::TextChecker::checkGrammarOfString):
2851         (WebKit::TextChecker::spellingUIIsShowing):
2852         (WebKit::TextChecker::toggleSpellingUIIsShowing):
2853         (WebKit::TextChecker::updateSpellingUIWithMisspelledWord):
2854         (WebKit::TextChecker::updateSpellingUIWithGrammarString):
2855         (WebKit::TextChecker::getGuessesForWord):
2856         (WebKit::TextChecker::learnWord):
2857         (WebKit::TextChecker::ignoreWord):
2858         (WebKit::TextChecker::requestCheckingOfString):
2859         (WebKit::TextChecker::checkTextOfParagraph):
2860         * UIProcess/win/WebContextMenuProxyWin.cpp: Added.
2861         (WebKit::WebContextMenuProxyWin::show):
2862         (WebKit::WebContextMenuProxyWin::showContextMenuWithItems):
2863         (WebKit::WebContextMenuProxyWin::WebContextMenuProxyWin):
2864         (WebKit::WebContextMenuProxyWin::~WebContextMenuProxyWin):
2865         * UIProcess/win/WebContextMenuProxyWin.h: Added.
2866         (WebKit::WebContextMenuProxyWin::create):
2867         * UIProcess/win/WebInspectorProxyWin.cpp: Added.
2868         (WebKit::WebInspectorProxy::platformCreateFrontendPage):
2869         (WebKit::WebInspectorProxy::platformCreateFrontendWindow):
2870         (WebKit::WebInspectorProxy::platformCloseFrontendPageAndWindow):
2871         (WebKit::WebInspectorProxy::platformDidCloseForCrash):
2872         (WebKit::WebInspectorProxy::platformInvalidate):
2873         (WebKit::WebInspectorProxy::platformHide):
2874         (WebKit::WebInspectorProxy::platformBringToFront):
2875         (WebKit::WebInspectorProxy::platformBringInspectedPageToFront):
2876         (WebKit::WebInspectorProxy::platformIsFront):
2877         (WebKit::WebInspectorProxy::platformInspectedURLChanged):
2878         (WebKit::WebInspectorProxy::inspectorPageURL):
2879         (WebKit::WebInspectorProxy::inspectorTestPageURL):
2880         (WebKit::WebInspectorProxy::inspectorBaseURL):
2881         (WebKit::WebInspectorProxy::platformInspectedWindowHeight):
2882         (WebKit::WebInspectorProxy::platformInspectedWindowWidth):
2883         (WebKit::WebInspectorProxy::platformAttach):
2884         (WebKit::WebInspectorProxy::platformDetach):
2885         (WebKit::WebInspectorProxy::platformSetAttachedWindowHeight):
2886         (WebKit::WebInspectorProxy::platformSetAttachedWindowWidth):
2887         (WebKit::WebInspectorProxy::platformStartWindowDrag):
2888         (WebKit::WebInspectorProxy::platformSave):
2889         (WebKit::WebInspectorProxy::platformAppend):
2890         (WebKit::WebInspectorProxy::platformAttachAvailabilityChanged):
2891         * UIProcess/win/WebPageProxyWin.cpp: Added.
2892         (WebKit::WebPageProxy::platformInitialize):
2893         (WebKit::WebPageProxy::standardUserAgent):
2894         (WebKit::WebPageProxy::saveRecentSearches):
2895         (WebKit::WebPageProxy::loadRecentSearches):
2896         (WebKit::WebPageProxy::editorStateChanged):
2897         * UIProcess/win/WebPreferencesWin.cpp: Added.
2898         (WebKit::WebPreferences::platformInitializeStore):
2899         (WebKit::WebPreferences::platformUpdateStringValueForKey):
2900         (WebKit::WebPreferences::platformUpdateBoolValueForKey):
2901         (WebKit::WebPreferences::platformUpdateUInt32ValueForKey):
2902         (WebKit::WebPreferences::platformUpdateDoubleValueForKey):
2903         (WebKit::WebPreferences::platformUpdateFloatValueForKey):
2904         (WebKit::WebPreferences::platformGetStringUserValueForKey):
2905         (WebKit::WebPreferences::platformGetBoolUserValueForKey):
2906         (WebKit::WebPreferences::platformGetUInt32UserValueForKey):
2907         (WebKit::WebPreferences::platformGetDoubleUserValueForKey):
2908         * UIProcess/win/WebProcessPoolWin.cpp: Added.
2909         (WebKit::WebProcessPool::platformInitialize):
2910         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2911         (WebKit::WebProcessPool::platformInitializeWebProcess):
2912         (WebKit::WebProcessPool::platformInvalidateContext):
2913         (WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory):
2914         (WebKit::WebProcessPool::legacyPlatformDefaultMediaCacheDirectory):
2915         (WebKit::WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory):
2916         (WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory):
2917         (WebKit::WebProcessPool::legacyPlatformDefaultLocalStorageDirectory):
2918         (WebKit::WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory):
2919         (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
2920         (WebKit::WebProcessPool::legacyPlatformDefaultJavaScriptConfigurationDirectory):
2921         (WebKit::WebProcessPool::platformResolvePathsForSandboxExtensions):
2922         * UIProcess/win/WebView.cpp: Added.
2923         (WebKit::WebView::WebViewWndProc):
2924         (WebKit::WebView::wndProc):
2925         (WebKit::WebView::registerWebViewWindowClass):
2926         (WebKit::WebView::WebView):
2927         (WebKit::WebView::~WebView):
2928         (WebKit::WebView::initialize):
2929         (WebKit::WebView::setParentWindow):
2930         (WebKit::findTopLevelParentWindow):
2931         (WebKit::WebView::windowAncestryDidChange):
2932         (WebKit::WebView::onMouseEvent):
2933         (WebKit::WebView::onWheelEvent):
2934         (WebKit::WebView::onHorizontalScroll):
2935         (WebKit::WebView::onVerticalScroll):
2936         (WebKit::WebView::onKeyEvent):
2937         (WebKit::drawPageBackground):
2938         (WebKit::WebView::paint):
2939         (WebKit::WebView::onPaintEvent):
2940         (WebKit::WebView::onPrintClientEvent):
2941         (WebKit::WebView::onSizeEvent):
2942         (WebKit::WebView::onWindowPositionChangedEvent):
2943         (WebKit::WebView::onSetFocusEvent):
2944         (WebKit::WebView::onKillFocusEvent):
2945         (WebKit::WebView::onTimerEvent):
2946         (WebKit::WebView::onShowWindowEvent):
2947         (WebKit::WebView::onSetCursor):
2948         (WebKit::WebView::updateActiveState):
2949         (WebKit::WebView::updateActiveStateSoon):
2950         (WebKit::initCommonControls):
2951         (WebKit::WebView::initializeToolTipWindow):
2952         (WebKit::WebView::startTrackingMouseLeave):
2953         (WebKit::WebView::stopTrackingMouseLeave):
2954         (WebKit::WebView::shouldInitializeTrackPointHack):
2955         (WebKit::WebView::close):
2956         (WebKit::WebView::cursorToShow const):
2957         (WebKit::WebView::updateNativeCursor):
2958         (WebKit::WebView::setOverrideCursor):
2959         (WebKit::WebView::setIsInWindow):
2960         (WebKit::WebView::setIsVisible):
2961         (WebKit::WebView::isWindowActive):
2962         (WebKit::WebView::isFocused):
2963         (WebKit::WebView::isVisible):
2964         (WebKit::WebView::isInWindow):
2965         (WebKit::WebView::setScrollOffsetOnNextResize):
2966         (WebKit::WebView::setViewNeedsDisplay):
2967         (WebKit::WebView::createColorChooserProxy):
2968         (WebKit::WebView::didCommitLoadForMainFrame):
2969         (WebKit::WebView::customRepresentationZoomFactor):
2970         (WebKit::WebView::setCustomRepresentationZoomFactor):
2971         (WebKit::WebView::findStringInCustomRepresentation):
2972         (WebKit::WebView::countStringMatchesInCustomRepresentation):
2973         (WebKit::WebView::nativeWindow):
2974         (WebKit::WebView::windowReceivedMessage):
2975         * UIProcess/win/WebView.h: Added.
2976         (WebKit::WebView::create):
2977         (WebKit::WebView::window const):
2978         (WebKit::WebView::page const):
2979         (WebKit::WebView::drawingArea):
2980         (WebKit::WebView::setWasActivatedByMouseEvent):
2981
2982 2018-04-24  Fujii Hironori  <Hironori.Fujii@sony.com>
2983
2984         Implement Same-Site cookies
2985         https://bugs.webkit.org/show_bug.cgi?id=159464
2986         <rdar://problem/27196358>
2987
2988         Unreviewed build fix.
2989
2990         WinCairo WebKit2 can't compile since r230921.
2991
2992         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
2993         (WebKit::NetworkDataTaskCurl::appendCookieHeader):
2994         CookieJarCurlDatabase::cookieRequestHeaderFieldValue needs
2995         SameSiteInfo.
2996
2997 2018-04-24  Simon Fraser  <simon.fraser@apple.com>
2998
2999         Add a new "color-filter" CSS property as an experimental feature
3000         https://bugs.webkit.org/show_bug.cgi?id=184940
3001
3002         Reviewed by Jon Lee.
3003         
3004         Add the color-filter property as an experimental feature.
3005
3006         * Shared/WebPreferences.yaml:
3007
3008 2018-04-24  Saam Barati  <sbarati@apple.com>
3009
3010         Keep around a pre-warmed process when doing process swap on navigation
3011         https://bugs.webkit.org/show_bug.cgi?id=184765
3012         <rdar://problem/39685099>
3013
3014         Reviewed by Ryosuke Niwa and Brady Eidson.
3015
3016         This patch makes it so that WebProcessPool prewarms a process when process
3017         swap on navigation is turned on. When we do a process swap on navigation,
3018         we first try to grab a prewarmed process before creating a new one.
3019         
3020         We try to be smart about when to create these processes. The initial heuristic
3021         that this patch chooses is when we reach the DidFirstVisuallyNonEmptyLayout
3022         layout milestone. We're going to try to improve on this heuristic in:
3023         https://bugs.webkit.org/show_bug.cgi?id=184899
3024         
3025         This is a 40% progression on PLT with process swap on navigation turned on.
3026
3027         * UIProcess/API/Cocoa/WKProcessPool.mm:
3028         (-[WKProcessPool _prewarmedWebProcessCount]):
3029         (-[WKProcessPool _webProcessCountIgnoringPrewarmed]):
3030         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
3031         * UIProcess/ServiceWorkerProcessProxy.cpp:
3032         (WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
3033         * UIProcess/WebPageProxy.cpp:
3034         (WebKit::WebPageProxy::notifyProcessPoolToPrewarm):
3035         (WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame):
3036         * UIProcess/WebPageProxy.h:
3037         * UIProcess/WebProcessPool.cpp:
3038         (WebKit::WebProcessPool::createNewWebProcess):
3039         (WebKit::WebProcessPool::tryTakePrewarmedProcess):
3040         (WebKit::WebProcessPool::warmInitialProcess):
3041         (WebKit::WebProcessPool::disconnectProcess):
3042         (WebKit::WebProcessPool::createWebPage):
3043         (WebKit::WebProcessPool::didReachGoodTimeToPrewarm):
3044         (WebKit::WebProcessPool::processForNavigation):
3045         * UIProcess/WebProcessPool.h:
3046         * UIProcess/WebProcessProxy.cpp:
3047         (WebKit::WebProcessProxy::create):
3048         (WebKit::WebProcessProxy::WebProcessProxy):
3049         (WebKit::m_isInPrewarmedPool):
3050         (WebKit::m_userMediaCaptureManagerProxy): Deleted.
3051         * UIProcess/WebProcessProxy.h:
3052         (WebKit::WebProcessProxy::isInPrewarmedPool const):
3053         (WebKit::WebProcessProxy::setIsInPrewarmedPool):
3054
3055 2018-04-24  Commit Queue  <commit-queue@webkit.org>
3056
3057         Unreviewed, rolling out r230971.
3058         https://bugs.webkit.org/show_bug.cgi?id=184939
3059
3060         This fix was not appropriate (Requested by n_wang on #webkit).
3061
3062         Reverted changeset:
3063
3064         "AX: soft link libAccessibility.dylb"
3065         https://bugs.webkit.org/show_bug.cgi?id=184919
3066         https://trac.webkit.org/changeset/230971
3067
3068 2018-04-24  Nan Wang  <n_wang@apple.com>
3069
3070         AX: soft link libAccessibility.dylb
3071         https://bugs.webkit.org/show_bug.cgi?id=184919
3072
3073         Reviewed by Chris Fleizach.
3074
3075         Make sure we soft link the library so that it won't crash
3076         if it's missing in the system.
3077
3078         * Configurations/WebKit.xcconfig:
3079         * UIProcess/API/Cocoa/WKWebView.mm:
3080         (-[WKWebView _initializeWithConfiguration:]):
3081         (-[WKWebView _updateAccessibilityEventsEnabled]):
3082
3083 2018-04-24  John Wilander  <wilander@apple.com>
3084
3085         From-Origin: Support for 'same' and 'same-site' response header, nested frame origin check
3086         https://bugs.webkit.org/show_bug.cgi?id=184560
3087         <rdar://problem/38901344>
3088
3089         Reviewed by Youenn Fablet and Daniel Bates.
3090
3091         This patch implements significant parts of https://github.com/whatwg/fetch/issues/687.
3092         We consume the From-Origin response header and only load the resource if:
3093         - The header is non-existent, empty, or invalid.
3094         - The header specifies 'same' and the resource's origin matches the originating
3095           document's origin and the origins up the frame tree.
3096         - The header specifies 'same-site' and the resource's eTLD+1 matches the originating
3097           document's eTLD+1 and the eTLD+1 of the documents up the frame tree.
3098
3099         This feature is experimental and off by default.
3100
3101         * NetworkProcess/NetworkResourceLoadParameters.cpp:
3102         (WebKit::NetworkResourceLoadParameters::encode const):
3103         (WebKit::NetworkResourceLoadParameters::decode):
3104             Support for the two new load parameters:
3105             - shouldEnableFromOriginResponseHeader
3106             - frameAncestorOrigins
3107         * NetworkProcess/NetworkResourceLoadParameters.h:
3108         * NetworkProcess/NetworkResourceLoader.cpp:
3109         (WebKit::areFrameAncestorsSameSite):
3110         (WebKit::areFrameAncestorsSameOrigin):
3111         (WebKit::shouldCancelCrossOriginLoad):
3112             The three functions above implement the new blocking logic.
3113         (WebKit::fromOriginResourceError):
3114             Convenience function that returns an error with the From-Origin error message.
3115         (WebKit::NetworkResourceLoader::didReceiveResponse):
3116             Now checks for a From-Origin response header.
3117         (WebKit::NetworkResourceLoader::didFailLoading):
3118             Now checks for a From-Origin response header.
3119         (WebKit::NetworkResourceLoader::continueWillSendRedirectedRequest):
3120             Now checks for a From-Origin response header.
3121         (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
3122             Now checks for a From-Origin response header.
3123         (WebKit::NetworkResourceLoader::dispatchWillSendRequestForCacheEntry):
3124             Now checks for a From-Origin response header.
3125         * Shared/WebCoreArgumentCoders.cpp:
3126         (IPC::ArgumentCoder<Vector<RefPtr<SecurityOrigin>>>::encode):
3127         (IPC::ArgumentCoder<Vector<RefPtr<SecurityOrigin>>>::decode):
3128             Now encodes and decodes vectors of RefPtr<WebCore::SecurityOrigin>.
3129         * Shared/WebCoreArgumentCoders.h:
3130         * Shared/WebPreferences.yaml:
3131             Added From-Origin support as an experimental feature.
3132         * UIProcess/API/C/WKPreferences.cpp:
3133         (WKPreferencesSetFromOriginResponseHeaderEnabled):
3134         (WKPreferencesGetFromOriginResponseHeaderEnabled):
3135         * UIProcess/API/C/WKPreferencesRef.h:
3136         * WebProcess/Network/WebLoaderStrategy.cpp:
3137         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
3138             Sets the two new load parameters:
3139             - shouldEnableFromOriginResponseHeader
3140             - frameAncestorOrigins
3141
3142 2018-04-24  Jer Noble  <jer.noble@apple.com>
3143
3144         Don't add system framework paths to FRAMEWORK_SEARCH_PATHS
3145         https://bugs.webkit.org/show_bug.cgi?id=184786
3146
3147         Reviewed by Tim Horton.
3148
3149         * Configurations/BaseTarget.xcconfig:
3150         * DerivedSources.make:
3151
3152 2018-04-24  Ryan Haddad  <ryanhaddad@apple.com>
3153
3154         Unreviewed, rolling out r230938.
3155
3156         Introduced two ProcessSwap API test failures.
3157
3158         Reverted changeset:
3159
3160         "Keep around a pre-warmed process when doing process swap on
3161         navigation"
3162         https://bugs.webkit.org/show_bug.cgi?id=184765
3163         https://trac.webkit.org/changeset/230938
3164
3165 2018-04-24  Zan Dobersek  <zdobersek@igalia.com>
3166
3167         [CoordGraphics] Remove dead fixed layer code
3168         https://bugs.webkit.org/show_bug.cgi?id=184912
3169
3170         Reviewed by Michael Catanzaro.
3171
3172         Drop the unused fixed layer handling  code in CoordinatedGraphicsScene.
3173         The m_fixedLayers container can be removed, along with the
3174         adjustPositionForFixedLayers() method that operated on that container.
3175
3176         This was the only method that operated with the m_scrollPosition member
3177         variable and the contentsPosition argument that's passed to the
3178         CoordinatedGraphicsScene::paintToCurrentGLContext() method. Both of
3179         these are removed, along with the scrollPosition attribute on the
3180         CoordinatedGraphicsState struct.
3181
3182         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
3183         (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
3184         (WebKit::CoordinatedGraphicsScene::setLayerState):
3185         (WebKit::CoordinatedGraphicsScene::deleteLayer):
3186         (WebKit::CoordinatedGraphicsScene::commitSceneState):
3187         (WebKit::CoordinatedGraphicsScene::purgeGLResources):
3188         (WebKit::CoordinatedGraphicsScene::adjustPositionForFixedLayers): Deleted.
3189         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
3190         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
3191         (WebKit::ThreadedCompositor::renderLayerTree):
3192         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
3193         (WebKit::CompositingCoordinator::flushPendingLayerChanges):
3194
3195 2018-04-24  Zan Dobersek  <zdobersek@igalia.com>
3196
3197         REGRESSION(r230950): Faulty commit sequencing in CoordinatedGraphicsScene
3198         https://bugs.webkit.org/show_bug.cgi?id=184917
3199
3200         Reviewed by Michael Catanzaro.
3201
3202         After r230950, current animation state for a given layer is also taken
3203         into account when determining whether or not the layer requires a
3204         backing store. For that to work properly, all the animation state has
3205         to be updated before the backing store work. This patch changes the
3206         order of helper method invocations in
3207         CoordinatedGraphicsScene::setLayerState() to address that.
3208
3209         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
3210         (WebKit::CoordinatedGraphicsScene::setLayerState):
3211
3212 2018-04-24  Zan Dobersek  <zdobersek@igalia.com>
3213
3214         [CoordGraphics] Remove unused fixed layout functionality
3215         https://bugs.webkit.org/show_bug.cgi?id=184908
3216
3217         Reviewed by Carlos Garcia Campos.
3218
3219         Ports using the CoordinatedGraphics subsystem don't expose fixed layout
3220         support. As such, we're able to remove a lot of unused code and
3221         unnecessary USE(COORDINATED_GRAPHICS) special cases in generic sections
3222         in both WebCore and WebKit.
3223
3224         Remove USE(COORDINATED_GRAPHICS) special-casing from the
3225         WebPage::setUseFixedLayout() method. This is not possible to enable for
3226         the GTK+ and WPE ports that use the CoordinatedGraphics subsytem via
3227         API. Removing all this unlocks removing considerable amounts of dead
3228         code and complexities in CoordinatedGraphics.
3229
3230         WebChromeClient::delegatedScrollRequested() method is removed, along
3231         with the WebPage::pageDidRequestScroll() method that was only called
3232         from there.
3233
3234         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3235         (WebKit::WebChromeClient::delegatedScrollRequested): Deleted.
3236         * WebProcess/WebCoreSupport/WebChromeClient.h:
3237         * WebProcess/WebPage/WebPage.cpp:
3238         (WebKit::WebPage::setUseFixedLayout):
3239         (WebKit::WebPage::pageDidRequestScroll): Deleted.
3240         * WebProcess/WebPage/WebPage.h:
3241
3242 2018-04-24  Zan Dobersek  <zdobersek@igalia.com>
3243
3244         [CoordGraphics] Avoid painting backing stores for zero-opacity layers
3245         https://bugs.webkit.org/show_bug.cgi?id=184143
3246
3247         Reviewed by Carlos Garcia Campos.
3248
3249         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
3250         (WebKit::layerShouldHaveBackingStore):
3251         Mirror CoordinatedGraphicsLayer's backing store requirements.
3252
3253 2018-04-23  Daniel Bates  <dabates@apple.com>
3254
3255         Implement Same-Site cookies
3256         https://bugs.webkit.org/show_bug.cgi?id=159464
3257         <rdar://problem/27196358>
3258
3259         Reviewed by Brent Fulgham.
3260
3261         Pass the Same-Site info through the WebKit abstractions.
3262
3263         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3264         (WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
3265         (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
3266         (WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue):
3267         (WebKit::NetworkConnectionToWebProcess::getRawCookies):
3268         * NetworkProcess/NetworkConnectionToWebProcess.h:
3269         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
3270         * NetworkProcess/NetworkResourceLoader.cpp:
3271         (WebKit::NetworkResourceLoader::logCookieInformation const):
3272         (WebKit::logBlockedCookieInformation):
3273         (logCookieInformationInternal):
3274         (NetworkResourceLoader::logCookieInformation):
3275         * NetworkProcess/NetworkResourceLoader.h:
3276         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
3277         (WebKit::NetworkCache::constructRevalidationRequest):
3278         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
3279         (WebKit::NetworkCache::SubresourceInfo::encode const):
3280         (WebKit::NetworkCache::SubresourceInfo::decode):
3281         (WebKit::NetworkCache::SubresourceInfo::SubresourceInfo):
3282         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
3283         (WebKit::NetworkCache::SubresourceInfo::isSameSite const):
3284         (WebKit::NetworkCache::SubresourceInfo::isTopSite const): Returns false; subresources do not represent
3285         a top-level navigation.
3286         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3287         (WebKit::NetworkDataTaskCocoa::isThirdPartyRequest):
3288         (WebKit::updateTaskWithFirstPartyForSameSiteCookies):
3289         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
3290         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
3291         * UIProcess/WebProcessPool.cpp:
3292         (WebKit::WebProcessPool::download):
3293         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
3294         (WebKit::WebPlatformStrategies::cookiesForDOM):
3295         (WebKit::WebPlatformStrategies::setCookiesFromDOM):
3296         (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue):
3297         (WebKit::WebPlatformStrategies::getRawCookies):
3298         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
3299
3300 2018-04-23  Youenn Fablet  <youenn@apple.com>
3301
3302         Make WebLoaderStrategy send to NetworkResourceLoader necessary parameters to handle full loads in NetworkProcess
3303         https://bugs.webkit.org/show_bug.cgi?id=184763
3304
3305         Reviewed by Chris Dumez.
3306
3307         Set all required NetworkResourceLoadParameters for asynchronous loads.
3308         This includes preflight policy, CSP response headers, SecurityOrigin and content blockers identifier.
3309
3310         Update NetworkLoadChecker to handle preflight policy.
3311         This is not needed right now since sync XHR and ping loads are using the default ConsiderPreflight policy.
3312         But this will be needed for XHR/fetch/EventSource loads. 
3313
3314         * NetworkProcess/NetworkLoadChecker.cpp:
3315         (WebKit::NetworkLoadChecker::NetworkLoadChecker):
3316         (WebKit::NetworkLoadChecker::checkRedirection):
3317         (WebKit::NetworkLoadChecker::validateResponse):
3318         (WebKit::NetworkLoadChecker::checkCORSRequest):
3319         * NetworkProcess/NetworkLoadChecker.h:
3320         (WebKit::NetworkLoadChecker::create):
3321         * NetworkProcess/NetworkResourceLoadParameters.cpp:
3322         (WebKit::NetworkResourceLoadParameters::encode const):
3323         (WebKit::NetworkResourceLoadParameters::decode):
3324         * NetworkProcess/NetworkResourceLoadParameters.h:
3325         * NetworkProcess/NetworkResourceLoader.cpp:
3326         * NetworkProcess/PingLoad.cpp:
3327         (WebKit::PingLoad::PingLoad):
3328         * WebProcess/Network/WebLoaderStrategy.cpp:
3329         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
3330
3331 2018-04-23  Wenson Hsieh  <wenson_hsieh@apple.com>
3332
3333         [Extra zoom mode] REGRESSION(230860) Unable to change time input values using UI
3334         https://bugs.webkit.org/show_bug.cgi?id=184901
3335         <rdar://problem/39664797>
3336
3337         Reviewed by Tim Horton.
3338
3339         Fixes the bug by falling back to setting the value of the focused input element in the case where the selection
3340         is not editable. Also adds plumbing to make time pickers testable in extra zoom mode.
3341
3342         * UIProcess/API/Cocoa/WKWebView.mm:
3343         (-[WKWebView setTimePickerValueToHour:minute:]):
3344         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3345         * UIProcess/ios/WKContentViewInteraction.h:
3346         * UIProcess/ios/WKContentViewInteraction.mm:
3347         (-[WKContentView setTimePickerValueToHour:minute:]):
3348
3349         Add plumbing to make it possible for WebKitTestRunner to simulate picking a time from the given hours and
3350         minutes. This is currently only implemented for extra zoom mode, but may be implemented for UIKit's time picker
3351         as well in the future by adjusting -[WKContentView setTimePickerValueToHour:minute:].
3352
3353         * WebProcess/WebPage/WebPage.cpp:
3354         (WebKit::WebPage::setTextAsync):
3355
3356 2018-04-23  Saam Barati  <sbarati@apple.com>
3357
3358         Keep around a pre-warmed process when doing process swap on navigation
3359         https://bugs.webkit.org/show_bug.cgi?id=184765
3360
3361         Reviewed by Ryosuke Niwa.
3362
3363         This patch makes it so that WebProcessPool prewarms a process when process
3364         swap on navigation is turned on. When we do a process swap on navigation,
3365         we first try to grab a prewarmed process before creating a new one.
3366         
3367         We try to be smart about when to create these processes. The initial heuristic
3368         that this patch chooses is when we reach the DidFirstVisuallyNonEmptyLayout
3369         layout milestone. We're going to try to improve on this heuristic in:
3370         https://bugs.webkit.org/show_bug.cgi?id=184899
3371         
3372         This is a 40% progression on PLT with process swap on navigation turned on.
3373
3374         * UIProcess/ServiceWorkerProcessProxy.cpp:
3375         (WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
3376         * UIProcess/WebPageProxy.cpp:
3377         (WebKit::WebPageProxy::notifyProcessPoolToPrewarm):
3378         (WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame):
3379         * UIProcess/WebPageProxy.h:
3380         * UIProcess/WebProcessPool.cpp:
3381         (WebKit::WebProcessPool::createNewWebProcess):
3382         (WebKit::WebProcessPool::tryTakePrewarmedProcess):
3383         (WebKit::WebProcessPool::warmInitialProcess):
3384         (WebKit::WebProcessPool::disconnectProcess):
3385         (WebKit::WebProcessPool::createWebPage):
3386         (WebKit::WebProcessPool::didReachGoodTimeToPrewarm):
3387         (WebKit::WebProcessPool::processForNavigation):
3388         * UIProcess/WebProcessPool.h:
3389         * UIProcess/WebProcessProxy.cpp:
3390         (WebKit::WebProcessProxy::create):
3391         (WebKit::WebProcessProxy::WebProcessProxy):
3392         (WebKit::m_isInPrewarmedPool):
3393         (WebKit::m_userMediaCaptureManagerProxy): Deleted.
3394         * UIProcess/WebProcessProxy.h:
3395         (WebKit::WebProcessProxy::isInPrewarmedPool const):
3396         (WebKit::WebProcessProxy::setIsInPrewarmedPool):
3397
3398 2018-04-23  Michael Catanzaro  <mcatanzaro@igalia.com>
3399
3400         [WPE][GTK] Remove WlUniquePtr<wl_display> footgun
3401         https://bugs.webkit.org/show_bug.cgi?id=184405
3402
3403         Reviewed by Carlos Garcia Campos.
3404
3405         Switch to std::unique_ptr.
3406
3407         * UIProcess/gtk/WaylandCompositor.cpp:
3408         (WebKit::WaylandCompositor::WaylandCompositor):
3409         * UIProcess/gtk/WaylandCompositor.h:
3410         (WebKit::WaylandCompositor::DisplayDeleter::operator()):
3411
3412 2018-04-23  Daniel Bates  <dabates@apple.com>
3413
3414         Attempt to fix the Apple Internal build following r230921
3415         (https://bugs.webkit.org/show_bug.cgi?id=159464)
3416
3417         Forward declare some SPI. Add availability guard.
3418
3419         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3420
3421 2018-04-23  Zalan Bujtas  <zalan@apple.com>
3422
3423         [LayoutFormattingContext] Initial commit.
3424         https://bugs.webkit.org/show_bug.cgi?id=184896
3425
3426         Reviewed by Antti Koivisto.
3427
3428         * Configurations/FeatureDefines.xcconfig:
3429
3430 2018-04-23  Daniel Bates  <dabates@apple.com>
3431
3432         Implement Same-Site cookies
3433         https://bugs.webkit.org/show_bug.cgi?id=159464
3434         <rdar://problem/27196358>
3435
3436         Reviewed by Brent Fulgham.
3437
3438         Pass the Same-Site info through the WebKit abstractions.
3439
3440         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3441         (WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
3442         (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
3443         (WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue):
3444         (WebKit::NetworkConnectionToWebProcess::getRawCookies):
3445         * NetworkProcess/NetworkConnectionToWebProcess.h:
3446         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
3447         * NetworkProcess/NetworkResourceLoader.cpp:
3448         (WebKit::NetworkResourceLoader::logCookieInformation const):
3449         (WebKit::logBlockedCookieInformation):
3450         (logCookieInformationInternal):
3451         (NetworkResourceLoader::logCookieInformation):
3452         * NetworkProcess/NetworkResourceLoader.h:
3453         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
3454         (WebKit::NetworkCache::constructRevalidationRequest):
3455         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
3456         (WebKit::NetworkCache::SubresourceInfo::encode const):
3457         (WebKit::NetworkCache::SubresourceInfo::decode):
3458         (WebKit::NetworkCache::SubresourceInfo::SubresourceInfo):
3459         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
3460         (WebKit::NetworkCache::SubresourceInfo::isSameSite const):
3461         (WebKit::NetworkCache::SubresourceInfo::isTopSite const): Returns false; subresources do not represent
3462         a top-level navigation.
3463         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3464         (WebKit::NetworkDataTaskCocoa::isThirdPartyRequest):
3465         (WebKit::updateTaskWithFirstPartyForSameSiteCookies):
3466         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
3467         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
3468         * UIProcess/WebProcessPool.cpp:
3469         (WebKit::WebProcessPool::download):
3470         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
3471         (WebKit::WebPlatformStrategies::cookiesForDOM):
3472         (WebKit::WebPlatformStrategies::setCookiesFromDOM):
3473         (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue):
3474         (WebKit::WebPlatformStrategies::getRawCookies):
3475         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
3476
3477 2018-04-23  Chris Dumez  <cdumez@apple.com>
3478
3479         WebProcessProxy frequently re-takes a process assertion for the network process even though is already has one
3480         https://bugs.webkit.org/show_bug.cgi?id=184889
3481         <rdar://problem/38151530>
3482
3483         Reviewed by Brady Eidson.
3484
3485         In ProcessThrottler::updateAssertionNow(), if the new process assertion state is the same
3486         as the existing one, then return early. Otherwise, we would end up calling WebProcessProxy::didSetAssertionState()
3487         for the same assertion state, which would cause duplicate logging but also some unnecessary work.
3488
3489         * UIProcess/ProcessThrottler.cpp:
3490         (WebKit::ProcessThrottler::updateAssertionNow):
3491
3492 2018-04-23  Zan Dobersek  <zdobersek@igalia.com>
3493
3494         [CoordGraphics] Remove unused trajectory cruft in CoordinatedLayerTreeHost, CoordinatedGraphicsLayer
3495         https://bugs.webkit.org/show_bug.cgi?id=184881
3496
3497         Reviewed by Michael Catanzaro.
3498
3499         The CompositingCoordinator::setVisibleContentsRect() method is always
3500         called with a (0,0) FloatPoint value as the trajectory vector parameter,
3501         which is already the default value in TiledBackingStore where this ends
3502         up. Removing this call chain also enables removing some unnecessary and
3503         odd code in the CoordinatedGraphicsLayer class.
3504
3505         This doesn't yet touch the trajectory logic in the TiledBackingStore
3506         class since it's not yet a given this won't be used in the future. But
3507         if that will be necessary, hope is to not use it this way.
3508
3509         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
3510         (WebKit::CompositingCoordinator::setVisibleContentsRect):
3511         (WebKit::CompositingCoordinator::mainContentsLayer): Deleted.
3512         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
3513         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
3514         (WebKit::CoordinatedLayerTreeHost::setVisibleContentsRect):
3515         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
3516         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
3517         (WebKit::ThreadedCoordinatedLayerTreeHost::didChangeViewport):
3518
3519 2018-04-23  Fujii Hironori  <Hironori.Fujii@sony.com>
3520
3521         [Win][WK2] REGRESSION(r230834) 'getpid': identifier not found
3522         https://bugs.webkit.org/show_bug.cgi?id=184877
3523
3524         Reviewed by Yusuke Suzuki.
3525
3526         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
3527         (WebKit::WebBackForwardListProxy::addItem): Use WTF::getCurrentProcessID() instead of getpid().
3528         * WebProcess/WebPage/WebPage.cpp:
3529         (WebKit::WebPage::goToBackForwardItem): Ditto.
3530
3531 2018-04-23  Zan Dobersek  <zdobersek@igalia.com>
3532
3533         [TexMap] Drop RefCounted inheritance off of TextureMapperBackingStore
3534         https://bugs.webkit.org/show_bug.cgi?id=184810
3535
3536         Reviewed by Carlos Garcia Campos.
3537
3538         CoordinatedBackingStore should inherit directly from RefCounted<> now
3539         that TextureMapperBackingStore doesn't anymore.
3540
3541         * Shared/CoordinatedGraphics/CoordinatedBackingStore.h:
3542         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
3543         (WebKit::CoordinatedGraphicsScene::createBackingStoreIfNeeded):
3544
3545 2018-04-22  Zan Dobersek  <zdobersek@igalia.com>
3546
3547         [CoordinatedGraphics] Unused contentsSize, coveredRect attributes in CoordinatedGraphicsState
3548         https://bugs.webkit.org/show_bug.cgi?id=184811
3549
3550         Reviewed by Carlos Garcia Campos.
3551
3552         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
3553         (WebKit::CompositingCoordinator::flushPendingLayerChanges): Stop setting
3554         the removed contentsSize and coveredRect attributes. These were only
3555         ever set to the appropriate values, but were then never used anywhere.
3556
3557 2018-04-22  Matt Baker  <mattbaker@apple.com>
3558
3559         Web Inspector: WebInspectorProxy releases WKWebInspectorProxyObjCAdapter without removing corresponding observer
3560         https://bugs.webkit.org/show_bug.cgi?id=184865
3561         <rdar://problem/37764960>
3562
3563         Reviewed by Brian Burg.
3564
3565         Replace the early return removed in https://bugs.webkit.org/show_bug.cgi?id=177661,
3566         so that WKWebInspectorProxyObjCAdapter and the view controller can be reused
3567         when reopening the Inspector while the WebView is still alive.
3568
3569         * UIProcess/mac/WebInspectorProxyMac.mm:
3570         (WebKit::WebInspectorProxy::platformCreateFrontendPage):
3571
3572 2018-04-22  Paul Knight  <pknight@apple.com>
3573
3574         Add -[WKInputDelegate _webView:decidePolicyForFocusedElement:] so clients can request default focusing behavior
3575         https://bugs.webkit.org/show_bug.cgi?id=184844
3576
3577         Reviewed by Dan Bernstein.
3578
3579         If a client doesn't implement -[_WKInputDelegate _webView:focusShouldStartInputSession:] the default
3580         focus behavior only brings up the keyboard if it's already onscreen, the interaction is user driven,
3581         and other factors that even depend on what feature flags are enabled.
3582
3583         If a client implements _webView:focusShouldStartInputSession:, they don't have a good way to specifiy
3584         they'd like to fall back to the default behavior. This makes it difficult for a client to use the
3585         default in most cases, but sometimes allow programmatic focus from the page, for example.
3586
3587         Add a new delegate method -_webView:decidePolicyForFocusedElement: that returns a new enum type
3588         _WKFocusStartsInputSessionPolicy. Clients can return _WKFocusStartsInputSessionPolicyAuto to request
3589         the default behavior, or _WKFocusStartsInputSessionPolicyAllow / Disallow to directly control whether
3590         the keyboard appears to assist the focused node.
3591
3592         * UIProcess/API/Cocoa/_WKInputDelegate.h:
3593         * UIProcess/ios/WKContentViewInteraction.mm:
3594         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
3595
3596 2018-04-21  Jeremy Jones  <jeremyj@apple.com>
3597
3598         Disable backward and forward navigation swipes while in fullscreen.
3599         https://bugs.webkit.org/show_bug.cgi?id=184656
3600         rdar://problem/36057535
3601
3602         Reviewed by Tim Horton.
3603
3604         Disable navigation swipes while in fullscreen.
3605
3606         * UIProcess/Cocoa/ViewGestureController.cpp:
3607         (WebKit::ViewGestureController::canSwipeInDirection const):
3608
3609 2018-04-21  Youenn Fablet  <youenn@apple.com>
3610
3611         Activate NetworkLoadChecker for media loads
3612         https://bugs.webkit.org/show_bug.cgi?id=184841
3613
3614         Reviewed by Eric Carlson.
3615
3616         Instantiate a NetworkLoadChecker for NetworkResourceLoader for audio/video loads.
3617
3618         Move CORS checks for response after handling of 304 checks.
3619         For 304 checks, we need to do the CORS checks on the validated cached response, not the 304 received response.
3620
3621         Updated ResourceError argument coder to explicitly pass the error type
3622         as some errors created by NetworkLoadChecker would otherwise be received as General errors by WebProcess.
3623         Updated platform data encoding of ResourceError accordingly.
3624
3625         All changes are covered by regular media loading layout tests.
3626
3627         * NetworkProcess/NetworkResourceLoader.cpp:
3628         (WebKit::shouldUseNetworkLoadChecker):
3629         (WebKit::NetworkResourceLoader::didReceiveResponse):
3630         * Shared/WebCoreArgumentCoders.cpp:
3631         (IPC::ArgumentCoder<ResourceError>::encode):
3632         (IPC::ArgumentCoder<ResourceError>::decode):
3633         * Shared/mac/WebCoreArgumentCodersMac.mm:
3634         (IPC::ArgumentCoder<ResourceError>::encodePlatformData):
3635         (IPC::ArgumentCoder<ResourceError>::decodePlatformData):
3636         We need to set the type after decoding the NSError as ResourceError tries to guess the type from NSError data.
3637         * Shared/soup/WebCoreArgumentCodersSoup.cpp:
3638         (IPC::ArgumentCoder<ResourceError>::encodePlatformData):
3639         (IPC::ArgumentCoder<ResourceError>::decodePlatformData):
3640
3641 2018-04-20  Carlos Garcia Campos  <cgarcia@igalia.com>
3642
3643         [SOUP] Do TLS error checking on GTlsConnection::accept-certificate
3644         https://bugs.webkit.org/show_bug.cgi?id=184480
3645
3646         Reviewed by Michael Catanzaro.
3647
3648         Connect to GTlsConnection::accept-certificate signal instead of SoupMessage::notify::tls-errors to perform the
3649         TLS errors check.
3650
3651         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
3652         (WebKit::NetworkDataTaskSoup::createRequest): Do not connect to SoupMessage::notify::tls-errors.
3653         (WebKit::NetworkDataTaskSoup::tlsConnectionAcceptCertificateCallback): Call tlsConnectionAcceptCertificate() is
3654         the task is still ongoing.
3655         (WebKit::NetworkDataTaskSoup::tlsConnectionAcceptCertificate): Check TLS errors here.
3656         (WebKit::NetworkDataTaskSoup::networkEventCallback): Pass the stream to networkEvent.
3657         (WebKit::NetworkDataTaskSoup::networkEvent): Connect to GTlsConnection::accept-certificate.
3658         * NetworkProcess/soup/NetworkDataTaskSoup.h:
3659
3660 2018-04-20  Timothy Hatcher  <timothy@apple.com>
3661
3662         NULL dereference crash sometimes under [super initWithCoder:] in WebView
3663
3664         https://bugs.webkit.org/show_bug.cgi?id=184851
3665         rdar://problem/39611236
3666
3667         Reviewed by Tim Horton.
3668
3669         * UIProcess/API/Cocoa/WKWebView.mm:
3670         (-[WKWebView _initializeWithConfiguration:]):
3671         (-[WKWebView effectiveAppearanceDidChange]):
3672         Added a null check and call the code later in initialization.
3673
3674 2018-04-20  Tim Horton  <timothy_horton@apple.com>
3675
3676         Adjust geolocation feature flag
3677         https://bugs.webkit.org/show_bug.cgi?id=184856
3678
3679         Reviewed by Wenson Hsieh.
3680
3681         * Configurations/FeatureDefines.xcconfig:
3682
3683 2018-04-20  Chris Dumez  <cdumez@apple.com>
3684
3685         Unreviewed attempt to fix GTK build after r230867.
3686
3687         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp:
3688         (webkit_dom_dom_window_get_self):
3689         (webkit_dom_dom_window_get_window):
3690         (webkit_dom_dom_window_get_frames):
3691         (webkit_dom_dom_window_get_opener):
3692         (webkit_dom_dom_window_get_parent):
3693         (webkit_dom_dom_window_get_top):
3694
3695 2018-04-20  Commit Queue  <commit-queue@webkit.org>
3696
3697         Unreviewed, rolling out r230873.
3698         https://bugs.webkit.org/show_bug.cgi?id=184857
3699
3700         Broke the iOS build (Requested by cdumez on #webkit).
3701
3702         Reverted changeset:
3703
3704         "Disable backward and forward navigation swipes while in
3705         fullscreen."
3706         https://bugs.webkit.org/show_bug.cgi?id=184656
3707         https://trac.webkit.org/changeset/230873
3708
3709 2018-04-20  Chris Dumez  <cdumez@apple.com>
3710
3711         REGRESSION (r229828): web view doesn’t update or respond to resizing until client calls policy decision handler
3712         https://bugs.webkit.org/show_bug.cgi?id=184210
3713         <rdar://problem/39072354>
3714
3715         Reviewed by Wenson Hsieh.
3716
3717         r229828 tried to have some API tests happy on iOS by freezing the layer tree
3718         during the navigation policy decision. However, this is observable by the client
3719         application and a regression from when the policy delegate was synchronous.
3720
3721         To address the issue, this patch reverts r229828 and instead updates the iOS
3722         API tests to wait for the next presentation update after navigating
3723         before interacting with the view.
3724
3725         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3726         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
3727         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
3728         (WebKit::WebFrameLoaderClient::cancelPolicyCheck):
3729         (WebKit::WebFrameLoaderClient::provisionalLoadStarted):
3730         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
3731         * WebProcess/WebPage/WebPage.cpp:
3732         * WebProcess/WebPage/WebPage.h:
3733
3734 2018-04-20  Brent Fulgham  <bfulgham@apple.com>
3735
3736         Limit cookie header access to Network process
3737         https://bugs.webkit.org/show_bug.cgi?id=184764
3738         <rdar://problem/36785285>
3739
3740         Reviewed by Youenn Fablet.
3741
3742         Revise the handling of cookie request headers so that we don't interact with them in the
3743         WebContent process. They are only needed for interaction with the server and the network
3744         process, so we should limit their scope to just the Network process.
3745
3746         Instead, we should handle a token that represents the cookie headers in the WebContent
3747         process, which can be converted to the relevant cookie data in the network process when
3748         needed.
3749
3750         * NetworkProcess/NetworkSocketStream.cpp:
3751         (WebKit::NetworkSocketStream::sendHandshake):
3752         * NetworkProcess/NetworkSocketStream.h:
3753         * NetworkProcess/NetworkSocketStream.messages.in:
3754         * WebProcess/Network/WebSocketStream.cpp:
3755         (WebKit::WebSocketStream::networkProcessCrashed):
3756         (WebKit::WebSocketStream::platformSendHandshake):
3757         (WebKit::WebSocketStream::didSendHandshake):
3758         * WebProcess/Network/WebSocketStream.h:
3759         * WebProcess/Network/WebSocketStream.messages.in:
3760
3761 2018-04-20  Jeremy Jones  <jeremyj@apple.com>
3762
3763         Disable backward and forward navigation swipes while in fullscreen.
3764         https://bugs.webkit.org/show_bug.cgi?id=184656
3765         rdar://problem/36057535
3766
3767         Reviewed by Tim Horton.
3768
3769         Disable navigation swipes while in fullscreen.
3770
3771         * UIProcess/Cocoa/ViewGestureController.cpp:
3772         (WebKit::ViewGestureController::canSwipeInDirection const):
3773
3774 2018-04-20  Jeremy Jones  <jeremyj@apple.com>
3775
3776         Element fullscreen, expose WKWebView _fullScreenPlaceholderView as iOS SPI
3777         https://bugs.webkit.org/show_bug.cgi?id=184826
3778         rdar://problem/39600825
3779
3780         Reviewed by Tim Horton.
3781
3782         Add _fullScreenPlaceholderView for iOS similar to the one for Mac.
3783
3784         * UIProcess/API/Cocoa/WKWebView.mm:
3785         (-[WKWebView _fullScreenPlaceholderView]):
3786         (-[WKWebView closeFullScreenWindowController]):
3787         (-[WKWebView fullScreenPlaceholderView]): Deleted.
3788         * UIProcess/API/Cocoa/WKWebViewInternal.h:
3789         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3790         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.h:
3791         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
3792         (-[WKFullScreenWindowController webViewPlaceholder]):
3793
3794 2018-04-20  Wenson Hsieh  <wenson_hsieh@apple.com>
3795
3796         [Extra zoom mode] Injected bundle form client should be notified when editing text fields
3797         https://bugs.webkit.org/show_bug.cgi?id=184822
3798         <rdar://problem/38807319>
3799
3800         Reviewed by Tim Horton.
3801
3802         Fixes the bug by making a couple of tweaks: (1) don't use a separate codepath for inserting text in text inputs,
3803         and (2) force a user typing gesture when inserting text using this codepath (i.e. WKTextInputListViewController).
3804         Also adds plumbing to enable testing text entry with WKTextInputListViewController in extra zoom mode.
3805
3806         * UIProcess/API/Cocoa/WKWebView.mm:
3807         (-[WKWebView _simulateTextEntered:]):
3808         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3809
3810         Introduce testing SPI to simulate text entry. Additionally, add a missing availability annotation around testing
3811         SPI added in 2017 to help test drag and drop for iOS 11.
3812
3813         * UIProcess/ios/WKContentViewInteraction.h:
3814         * UIProcess/ios/WKContentViewInteraction.mm:
3815         (-[WKContentView _simulateTextEntered:]):
3816         * WebProcess/WebPage/WebPage.cpp:
3817         (WebKit::WebPage::setTextAsync):
3818
3819 2018-04-20  Jeremy Jones  <jeremyj@apple.com>
3820
3821         EnterFullscreen must update the minimum and maximum layout sizes.
3822         https://bugs.webkit.org/show_bug.cgi?id=184828
3823         rdar://problem/38435829
3824
3825         Reviewed by Jon Lee.
3826
3827         Without this, the WKWebView won't layout to the full size in fullscreen mode.
3828
3829         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
3830         (-[WKFullScreenWindowController enterFullScreen]):
3831
3832 2018-04-18  Jer Noble  <jer.noble@apple.com>
3833
3834         Don't put build products into WK_ALTERNATE_WEBKIT_SDK_PATH for engineering builds
3835         https://bugs.webkit.org/show_bug.cgi?id=184762
3836
3837         Reviewed by Dan Bernstein.
3838
3839         * Configurations/BaseTarget.xcconfig:
3840
3841 2018-04-20  Youenn Fablet  <youenn@apple.com>
3842
3843         Refactor NetworkResourceLoader to check for m_networkLoadChecker presence before using it
3844         https://bugs.webkit.org/show_bug.cgi?id=184755
3845
3846         Reviewed by Chris Dumez.
3847
3848         Make NetworkResourceLoader always use m_networkLoadChecker if there is one.
3849         This is only used now for synchronous loads but will be used in the future for asynchronous loads as well.
3850
3851         Since we call didFail asynchronously to make sync/async handling more consistent,
3852         We need to keep track of whether we will do clean-up twice.
3853         A boolean is added for that purpose in NetworkResourceLoader.
3854
3855         There is a small change of behavior in the way we return an error.
3856         Instead of returning a platformBadResponseError, we are now returning the error as computed by NetworkLoadChecker.
3857         This allows getting some more error logging in the JS console.
3858
3859         * NetworkProcess/NetworkResourceLoader.cpp:
3860         (WebKit::NetworkResourceLoader::didReceiveResponse):
3861         (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
3862         (WebKit::NetworkResourceLoader::continueWillSendRedirectedRequest):
3863         (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
3864         * NetworkProcess/NetworkResourceLoader.h:
3865
3866 2018-04-20  Timothy Hatcher  <timothy@apple.com>
3867
3868         Include missing files in WKContentViewInteraction.{mm,h}
3869
3870         https://bugs.webkit.org/show_bug.cgi?id=184832
3871         rdar://problem/35377120
3872
3873         Reviewed by Wenson Hsieh.
3874
3875         Some WebDriver files were missing and should be included.
3876
3877         * UIProcess/ios/WKContentViewInteraction.h:
3878         * UIProcess/ios/WKContentViewInteraction.mm:
3879         (-[WKContentView setupInteraction]):
3880         (-[WKContentView cleanupInteraction]):
3881         (-[WKContentView _removeDefaultGestureRecognizers]):
3882         (-[WKContentView _addDefaultGestureRecognizers]):
3883
3884 2018-04-20  Youenn Fablet  <youenn@apple.com>
3885
3886         WebPage sometimes incorrectly rules out PDF as a mime type that can be showed
3887         https://bugs.webkit.org/show_bug.cgi?id=184369
3888
3889         Reviewed by Chris Dumez.
3890
3891         Use API to check for plugin availability for response at navigation time.
3892
3893         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3894         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
3895         * WebProcess/WebPage/WebPage.cpp:
3896         (WebKit::WebPage::canShowResponse const):
3897         (WebKit::WebPage::canShowMIMEType const):
3898         * WebProcess/WebPage/WebPage.h:
3899
3900 2018-04-20  Daniel Bates  <dabates@apple.com>
3901
3902         Remove Strong Password decoration when text field type changes
3903         https://bugs.webkit.org/show_bug.cgi?id=184795
3904         <rdar://problem/38325108>
3905
3906         Reviewed by Antti Koivisto.
3907
3908         Add injected bundle API and WebKit UI delegate SPI to notify the embedding client when the
3909         Strong Password appearance of an HTML input element is resigned.
3910
3911         We add C SPI for Safari on Mac.
3912
3913         * UIProcess/API/APIUIClient.h:
3914         (API::UIClient::didResignInputElementStrongPasswordAppearance):
3915         * UIProcess/API/C/WKPage.cpp:
3916         (WKPageSetPageUIClient):
3917         * UIProcess/API/C/WKPageUIClient.h:
3918         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
3919         * UIProcess/Cocoa/UIDelegate.h:
3920         * UIProcess/Cocoa/UIDelegate.mm:
3921         (WebKit::UIDelegate::setDelegate):
3922         (WebKit::UIDelegate::UIClient::didResignInputElementStrongPasswordAppearance):
3923         * UIProcess/WebPageProxy.cpp:
3924         (WebKit::WebPageProxy::didResignInputElementStrongPasswordAppearance):
3925         * UIProcess/WebPageProxy.h:
3926         * UIProcess/WebPageProxy.messages.in:
3927         * WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h:
3928         (API::InjectedBundle::PageUIClient::didResignInputElementStrongPasswordAppearance):
3929         * WebProcess/InjectedBundle/API/c/WKBundlePageUIClient.h:
3930         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
3931         (WebKit::InjectedBundlePageUIClient::didResignInputElementStrongPasswordAppearance):
3932         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
3933         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3934         (WebKit::WebChromeClient::inputElementDidResignStrongPasswordAppearance):
3935         * WebProcess/WebCoreSupport/WebChromeClient.h:
3936
3937 2018-04-20  Megan Gardner  <megan_gardner@apple.com>
3938
3939         Fixes for failing tests associated with switching Text Selection Assistants
3940         https://bugs.webkit.org/show_bug.cgi?id=184806
3941         <rdar://problem/39367905>
3942
3943         Reviewed by Beth Dakin and Wenson Hsieh.
3944         
3945         The major fix is the disabling the double tap noneditable text selection gesture.
3946         The other fixes are small tweaks that shouldn't even be run into with the fix to 
3947         the double tap gesture, but they are incorrect, so I am taking the opportunity to 
3948         fix them now, in case we run into them again.
3949
3950         * UIProcess/ios/WKContentViewInteraction.mm:
3951         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
3952         We should not be allowing a double tap text gestures in non-editable web content.
3953         We didn't have one with the old assistant. Fortunately, this is easily disabled.
3954         (-[WKContentView canPerformActionForWebView:withSender:]):
3955         We should not allow the lookup action if we do not actually have a selection.
3956         It is meaningless without one.
3957         (-[WKContentView selectedTextRange]):
3958         We should not return a selection to UIKit if all we have is caret selection
3959         in non-editable content. We have this for selections on Mac, but UIKit does
3960         not know how to properly handle this, and will have incorrect behavior if we 
3961         return a valid selection.
3962
3963 2018-04-20  Timothy Hatcher  <timothy@apple.com>
3964
3965         WebEvent fails to convert synthetic WebMouseEvent for automation
3966
3967         https://bugs.webkit.org/show_bug.cgi?id=184824
3968         rdar://problem/35377120
3969
3970         Reviewed by Brian Burg.
3971
3972         Add WebEvent conversions that existed in PlatformEventFactoryIOS for legacy WebKit,
3973         but never got added in WebIOSEventFactory and NativeWebMouseEvent for modern WebKit.
3974         This affected WebDriver, and some events not being deliverd to the page.
3975
3976         * Shared/NativeWebMouseEvent.h:
3977         (WebKit::NativeWebMouseEvent::nativeEvent const):
3978         * Shared/ios/NativeWebMouseEventIOS.mm: Added.
3979         (WebKit::NativeWebMouseEvent::NativeWebMouseEvent):
3980         * Shared/ios/WebIOSEventFactory.h:
3981         * Shared/ios/WebIOSEventFactory.mm:
3982         (WebIOSEventFactory::createWebMouseEvent):
3983         * WebKit.xcodeproj/project.pbxproj:
3984
3985 2018-04-20  Michael Catanzaro  <mcatanzaro@igalia.com>
3986
3987         Unreviewed, fix -Wformat warning
3988
3989         * UIProcess/WebPageProxy.cpp:
3990         (WebKit::WebPageProxy::didFinishLoadForFrame):
3991
3992 2018-04-20  Youenn Fablet  <youenn@apple.com>
3993
3994         Make PluginData cache its web visible plugins
3995         https://bugs.webkit.org/show_bug.cgi?id=184421
3996
3997         Reviewed by Chris Dumez.
3998
3999         Rename methods.
4000         Pass an URL instead of relying on Page URL as the page URL
4001         might not always be the URL we want to check against plugins.
4002         In particular when navigation is on-going, we want to check the
4003         plugins against the being navigated URL.
4004
4005         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
4006         (WebKit::WebPluginInfoProvider::pluginInfo):
4007         (WebKit::WebPluginInfoProvider::webVisiblePluginInfo):
4008         * WebProcess/Plugins/WebPluginInfoProvider.h:
4009
4010 2018-04-19  Carlos Garcia Campos  <cgarcia@igalia.com>
4011
4012         Unreviewed. Fix GTK+ build after r230830.
4013
4014         Add SimulatedInputDispatcher.cpp to the build.
4015
4016         * CMakeLists.txt:
4017
4018 2018-04-19  Brady Eidson  <beidson@apple.com>
4019
4020         Make back forward cache work with process swapping.
4021         <rdar://problem/38676604> and https://bugs.webkit.org/show_bug.cgi?id=184793
4022
4023         Reviewed by Chris Dumez.
4024
4025         We previously saved old processes in "SuspendedPageProxy" objects.
4026         Now we reuse them when going back or forward.
4027
4028         * Platform/Logging.h:
4029
4030         * Shared/WebBackForwardListItem.cpp:
4031         (WebKit::WebBackForwardListItem::setSuspendedPage):
4032         (WebKit::WebBackForwardListItem::loggingString):
4033         * Shared/WebBackForwardListItem.h:
4034         (WebKit::WebBackForwardListItem::suspendedPage const):
4035
4036         Teach Navigation objects their source WebBackForwardListItems:
4037         * UIProcess/API/APINavigation.cpp:
4038         (API::Navigation::Navigation):
4039         (API::Navigation::loggingString const):
4040         * UIProcess/API/APINavigation.h:
4041         (API::Navigation::create):
4042         (API::Navigation::targetItem const):
4043         (API::Navigation::fromItem const):
4044         (API::Navigation::backForwardListItem): Deleted.
4045
4046         * UIProcess/Cocoa/NavigationState.mm:
4047         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
4048
4049         * UIProcess/SuspendedPageProxy.cpp:
4050         (WebKit::messageNamesToIgnoreWhileSuspended):
4051         (WebKit::SuspendedPageProxy::SuspendedPageProxy):
4052         (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
4053         (WebKit::SuspendedPageProxy::webProcessDidClose):
4054         (WebKit::SuspendedPageProxy::didReceiveMessage):
4055         (WebKit::SuspendedPageProxy::loggingString const):
4056         * UIProcess/SuspendedPageProxy.h:
4057         (WebKit::SuspendedPageProxy::origin const):
4058
4059         * UIProcess/WebBackForwardList.cpp:
4060         (WebKit::WebBackForwardList::WebBackForwardList):
4061         (WebKit::WebBackForwardList::~WebBackForwardList):
4062         (WebKit::WebBackForwardList::pageClosed):
4063         (WebKit::WebBackForwardList::addItem):
4064         (WebKit::WebBackForwardList::goToItem):