Source/WebKit:
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2017-10-06  Aishwarya Nirmal  <anirmal@apple.com>
2
3         [iOS] Respect the "caret-color" CSS property when editing 
4         https://bugs.webkit.org/show_bug.cgi?id=177489
5         <rdar://problem/34600419>
6
7         Reviewed by Tim Horton.
8
9         This change adds support for the caret-color property on iOS.
10
11         * Shared/EditorState.cpp:
12         (WebKit::EditorState::PostLayoutData::encode const):
13         (WebKit::EditorState::PostLayoutData::decode):
14         * Shared/EditorState.h:
15         * UIProcess/ios/WKContentViewInteraction.mm:
16         (-[WKContentView insertionPointColor]):
17         * WebProcess/WebPage/ios/WebPageIOS.mm:
18         (WebKit::WebPage::platformEditorState const):
19
20 2017-10-06  Brian Burg  <bburg@apple.com>
21
22         Web Inspector: clicking in Inspector webview clears the selection in the inspected page
23         https://bugs.webkit.org/show_bug.cgi?id=178014
24         <rdar://problem/12706857>
25
26         Reviewed by Timothy Hatcher.
27
28         If the Inspector is docked to the inspected view, clicking on the Inspector
29         webview will cause selection in the inspected view to be lost. This is because
30         the selection is lost when the web view resigns first responder.
31
32         Add a check in maintainsInactiveSelection to always retain selection if
33         Web Inspector is open. This approach seems simpler than trying to sync a client's
34         usage of WKPageSetMaintainsInactiveSelection with overrides that need to be applied
35         and unapplied when an inspector web view is shown or hidden.
36
37         * UIProcess/WebPageProxy.cpp:
38         (WebKit::WebPageProxy::maintainsInactiveSelection const):
39         (WebKit::WebPageProxy::inspector const): Drive by, use nullptr.
40
41         * UIProcess/WebPageProxy.h:
42         (WebKit::WebPageProxy::maintainsInactiveSelection const): Deleted.
43
44 2017-10-06  Alex Christensen  <achristensen@webkit.org>
45
46         Add more infrastructure to apply custom headers to same-origin requests
47         https://bugs.webkit.org/show_bug.cgi?id=177629
48
49         Reviewed by Ryosuke Niwa.
50
51         * UIProcess/API/C/WKWebsitePolicies.cpp:
52         (WKWebsitePoliciesCopyCustomHeaderFields):
53         (WKWebsitePoliciesSetCustomHeaderFields):
54         * UIProcess/API/C/WKWebsitePolicies.h:
55         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
56         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
57         (-[_WKWebsitePolicies customHeaderFields]):
58         (-[_WKWebsitePolicies setCustomHeaderFields:]):
59
60         Make the SPI for setting custom header fields take a dictionary<String, String>
61         instead of an array of Strings with colons. This matches NSURLRequest and other
62         APIs that deal with header fields.
63
64 2017-10-06  Wenson Hsieh  <wenson_hsieh@apple.com>
65
66         [iOS] Tweak support for classifying form controls (followup to r222487)
67         https://bugs.webkit.org/show_bug.cgi?id=177917
68         <rdar://problem/34820122>
69
70         Reviewed by Dean Jackson.
71
72         This patch follows up with <http://trac.webkit.org/r222487>. It combines the functionality of two SPI hooks
73         implemented on WKContentView into a single method that vends a context dictionary, and additionally addresses an
74         issue with the original implementation, wherein some cached state on WebPageProxy is set upon starting node
75         assistance, but is never unset when stopping node assistance, nor set anywhere else. See per-method comments for
76         more detail.
77
78         * UIProcess/WebPageProxy.h:
79
80         Remove members m_acceptsAutofilledLoginCredentials and m_representingPageURL from WebPageProxy. This state is
81         retrieved from the AssistedNodeInformation struct when starting node assistance, but is never reset anywhere
82         else. Instead of introducing new members to remember this state, we can just use the WKContentView's current
83         assisted node information.
84
85         This also means that programmatically focusing forms (without user gesture) will no longer cause WKContentView
86         to accept autofilled login credentials, since we bail out of node assistance and don't begin an input session.
87
88         * UIProcess/ios/WKContentView.mm:
89         (-[WKContentView acceptsAutofilledLoginCredentials]): Deleted.
90         (-[WKContentView representingPageURL]): Deleted.
91         * UIProcess/ios/WKContentViewInteraction.mm:
92         (-[WKContentView _autofillContext]):
93
94         Merge functionality of the previous two SPI hooks, such that -_autofillContext will return a non-null dictionary
95         containing the URL of the focused element's document if and only if WKContentView accepts autofilled login
96         credentials, and there exists a representing page URL.
97
98         When the page stops assisting the focused node, we set the AssistedNodeInformation's element type to None, so we
99         additionally bail and return nil if the element type is None. As an aside, it seems a more reasonable approach to
100         resetting state upon stopping node assistance is to just completely reset _assistedNodeInformation to its initial
101         value, i.e. via _assistedNodeInformation = { }. It's not clear whether there are behaviors relying on the fact
102         that all members but the element type in the content view's assisted node information could be stale, so this
103         seems worthy of some investigation.
104
105         * UIProcess/ios/WebPageProxyIOS.mm:
106         (WebKit::WebPageProxy::startAssistingNode):
107         (WebKit::WebPageProxy::acceptsAutofilledLoginCredentials): Deleted.
108         (WebKit::WebPageProxy::representingPageURL): Deleted.
109
110 2017-10-06  Yousuke Kimoto  <yousuke.kimoto@sony.com>
111
112         [WinCairo] Add shared curl files
113         https://bugs.webkit.org/show_bug.cgi?id=177999
114
115         Reviewed by Alex Christensen.
116
117         * PlatformWin.cmake:
118         * Shared/Authentication/curl/AuthenticationManagerCurl.cpp: Added.
119         (WebKit::AuthenticationManager::receivedCredential):
120         (WebKit::AuthenticationManager::receivedRequestToContinueWithoutCredential):
121         (WebKit::AuthenticationManager::receivedCancellation):
122         (WebKit::AuthenticationManager::receivedRequestToPerformDefaultHandling):
123         (WebKit::AuthenticationManager::receivedChallengeRejection):
124         * Shared/curl/WebCoreArgumentCodersCurl.cpp: Added.
125         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
126         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
127         (IPC::ArgumentCoder<CertificateInfo>::encode):
128         (IPC::ArgumentCoder<CertificateInfo>::decode):
129         (IPC::ArgumentCoder<ResourceError>::encodePlatformData):
130         (IPC::ArgumentCoder<ResourceError>::decodePlatformData):
131         (IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData):
132         (IPC::ArgumentCoder<ProtectionSpace>::decodePlatformData):
133         (IPC::ArgumentCoder<Credential>::encodePlatformData):
134         (IPC::ArgumentCoder<Credential>::decodePlatformData):
135
136 2017-10-06  Brent Fulgham  <bfulgham@apple.com>
137
138         Sandbox rules block PluginProcess using "File Open/Save" dialogs
139         https://bugs.webkit.org/show_bug.cgi?id=177965
140         <rdar://problem/33976846>
141
142         Reviewed by Alexey Proskuryakov.
143
144         Update the PluginProcess sandboxes to allow the same XPC services as
145         the WebContent process. Also allow access to the openAndSavePanelServices.
146
147         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: 
148
149 2017-10-06  Brady Eidson  <beidson@apple.com>
150
151         Add (entirely incorrect) fetching of ServiceWorker scripts.
152         https://bugs.webkit.org/show_bug.cgi?id=176179
153
154         Reviewed by Andy Estes.
155
156         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
157         (WebKit::WebSWServerConnection::startScriptFetchInClient):
158         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
159         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
160
161         * WebProcess/Storage/WebSWClientConnection.cpp:
162         (WebKit::WebSWClientConnection::finishFetchingScriptInServer):
163         * WebProcess/Storage/WebSWClientConnection.h:
164         * WebProcess/Storage/WebSWClientConnection.messages.in:
165
166 2017-10-05  Carlos Garcia Campos  <cgarcia@igalia.com>
167
168         [GTK][WPE] Add API to configure and enable resource load statistics
169         https://bugs.webkit.org/show_bug.cgi?id=177943
170
171         Reviewed by Michael Catanzaro.
172
173         Add new WebKitWebsiteDataManager construct only property to set the directory where the persistent stats are
174         stored, and methods to enable resource load statistics and query whether it's currently enabled. Also add a new
175         Website data type to be able to remove the persistent stats using WebKitWebsiteDataManager existing API.
176
177         * UIProcess/API/glib/WebKitWebContext.cpp:
178         (websiteDataStoreConfigurationForWebProcessPoolConfiguration):
179         (webkitWebContextConstructed):
180         * UIProcess/API/glib/WebKitWebsiteData.cpp:
181         (recordContainsSupportedDataTypes):
182         (toWebKitWebsiteDataTypes):
183         * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
184         (webkitWebsiteDataManagerGetProperty):
185         (webkitWebsiteDataManagerSetProperty):
186         (webkitWebsiteDataManagerConstructed):
187         (webkit_website_data_manager_class_init):
188         (webkitWebsiteDataManagerGetDataStore):
189         (webkit_website_data_manager_get_resource_load_stats_directory):
190         (webkit_website_data_manager_set_resource_load_stats_enabled):
191         (webkit_website_data_manager_get_resource_load_stats_enabled):
192         (toWebsiteDataTypes):
193         * UIProcess/API/gtk/WebKitWebsiteData.h:
194         * UIProcess/API/gtk/WebKitWebsiteDataManager.h:
195         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
196         * UIProcess/API/wpe/WebKitWebsiteData.h:
197         * UIProcess/API/wpe/WebKitWebsiteDataManager.h:
198
199 2017-10-05  Carlos Garcia Campos  <cgarcia@igalia.com>
200
201         [GTK][WPE] All resource load statistics tests added in r212183 crash in GTK bots, timeout in GTK and WPE bots since r219049
202         https://bugs.webkit.org/show_bug.cgi?id=168171
203
204         Reviewed by Chris Dumez.
205
206         Add C API to handle all resource load statistics requests made by the layout tests.
207
208         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
209         (WKWebsiteDataStoreSetStatisticsLastSeen):
210         (WKWebsiteDataStoreSetStatisticsPrevalentResource):
211         (WKWebsiteDataStoreIsStatisticsPrevalentResource):
212         (WKWebsiteDataStoreSetStatisticsHasHadUserInteraction):
213         (WKWebsiteDataStoreIsStatisticsHasHadUserInteraction):
214         (WKWebsiteDataStoreSetStatisticsGrandfathered):
215         (WKWebsiteDataStoreIsStatisticsGrandfathered):
216         (WKWebsiteDataStoreSetStatisticsSubframeUnderTopFrameOrigin):
217         (WKWebsiteDataStoreSetStatisticsSubresourceUnderTopFrameOrigin):
218         (WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectTo):
219         (WKWebsiteDataStoreSetStatisticsTimeToLiveUserInteraction):
220         (WKWebsiteDataStoreSetStatisticsTimeToLiveCookiePartitionFree):
221         (WKWebsiteDataStoreStatisticsProcessStatisticsAndDataRecords):
222         (WKWebsiteDataStoreStatisticsUpdateCookiePartitioning):
223         (WKWebsiteDataStoreSetStatisticsShouldPartitionCookiesForHost):
224         (WKWebsiteDataStoreStatisticsSubmitTelemetry):
225         (WKWebsiteDataStoreSetStatisticsNotifyPagesWhenDataRecordsWereScanned):
226         (WKWebsiteDataStoreSetStatisticsShouldClassifyResourcesBeforeDataRecordsRemoval):
227         (WKWebsiteDataStoreSetStatisticsNotifyPagesWhenTelemetryWasCaptured):
228         (WKWebsiteDataStoreSetStatisticsMinimumTimeBetweenDataRecordsRemoval):
229         (WKWebsiteDataStoreSetStatisticsGrandfatheringTime):
230         (WKWebsiteDataStoreSetStatisticsMaxStatisticsEntries):
231         (WKWebsiteDataStoreSetStatisticsPruneEntriesDownTo):
232         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
233         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
234         (WKWebsiteDataStoreStatisticsClearThroughWebsiteDataRemoval):
235         (WKWebsiteDataStoreStatisticsResetToConsistentState):
236         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
237
238 2017-10-05  Tim Horton  <timothy_horton@apple.com>
239
240         Fix the Mac CMake build
241         https://bugs.webkit.org/show_bug.cgi?id=177985
242
243         Unreviewed build fix.
244
245         * CMakeLists.txt:
246         * PlatformMac.cmake:
247         After r222917, there's one more piece of WebKitSystemInterface left.
248         And some missing bits of PaymentRequest.
249
250 2017-10-05  Keith Miller  <keith_miller@apple.com>
251
252         Unreviewed, tapi builds without optimization so we should have TAPI passes -DRELEASE_WITHOUT_OPTIMIZATIONS.
253
254         * Configurations/Base.xcconfig:
255
256 2017-10-05  Jer Noble  <jer.noble@apple.com>
257
258         [Cocoa] Enable ENABLE_ENCRYPTED_MEDIA build-time setting
259         https://bugs.webkit.org/show_bug.cgi?id=177261
260
261         Reviewed by Eric Carlson.
262
263         * Configurations/FeatureDefines.xcconfig:
264
265 2017-10-05  Alex Christensen  <achristensen@webkit.org>
266
267         Add ObjC equivalent of WKPageNavigationClient.didChangeBackForwardList
268         https://bugs.webkit.org/show_bug.cgi?id=177966
269         <rdar://problem/22387135>
270
271         Reviewed by Tim Horton.
272
273         * UIProcess/API/APINavigationClient.h:
274         (API::NavigationClient::didChangeBackForwardList):
275         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
276         * UIProcess/Cocoa/NavigationState.h:
277         * UIProcess/Cocoa/NavigationState.mm:
278         (WebKit::NavigationState::setNavigationDelegate):
279         (WebKit::NavigationState::NavigationClient::didFailToInitializePlugIn):
280         (WebKit::NavigationState::NavigationClient::didChangeBackForwardList):
281         (WebKit::NavigationState::NavigationClient::willPerformClientRedirect):
282         (WebKit::NavigationState::NavigationClient::didCancelClientRedirect):
283         (WebKit::NavigationState::NavigationClient::renderingProgressDidChange):
284         (WebKit::NavigationState::NavigationClient::canAuthenticateAgainstProtectionSpace):
285         (WebKit::NavigationState::NavigationClient::processDidTerminate):
286         (WebKit::NavigationState::NavigationClient::processDidBecomeResponsive):
287         (WebKit::NavigationState::NavigationClient::processDidBecomeUnresponsive):
288         (WebKit::NavigationState::NavigationClient::webCryptoMasterKey):
289         (WebKit::NavigationState::NavigationClient::didFinishLoadForQuickLookDocumentInMainFrame):
290         (WebKit::NavigationState::HistoryClient::didNavigateWithNavigationData):
291         (WebKit::NavigationState::HistoryClient::didPerformClientRedirect):
292         (WebKit::NavigationState::HistoryClient::didPerformServerRedirect):
293         (WebKit::NavigationState::HistoryClient::didUpdateHistoryTitle):
294         * UIProcess/WebPageProxy.cpp:
295         (WebKit::WebPageProxy::didChangeBackForwardList):
296
297 2017-10-05  Alex Christensen  <achristensen@webkit.org>
298
299         Add ObjC SPI with userInfo corresponding to WKPageNavigationClient's decidePolicyForNavigationAction, didStartProvisionalNavigation, and didFailNavigation
300         https://bugs.webkit.org/show_bug.cgi?id=177974
301         <rdar://problem/22888802>
302
303         Reviewed by Tim Horton.
304
305         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
306         * UIProcess/Cocoa/NavigationState.h:
307         * UIProcess/Cocoa/NavigationState.mm:
308         (WebKit::NavigationState::setNavigationDelegate):
309         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
310         (WebKit::NavigationState::NavigationClient::didStartProvisionalNavigation):
311         (WebKit::NavigationState::NavigationClient::didFailNavigationWithError):
312         * UIProcess/Cocoa/UIDelegate.mm:
313         (WebKit::UIDelegate::ContextMenuClient::menuFromProposedMenu):
314
315 2017-10-05  John Wilander  <wilander@apple.com>
316
317         Storage Access API: Web process should ask UI process for grant/deny
318         https://bugs.webkit.org/show_bug.cgi?id=176941
319         <rdar://problem/34440036>
320
321         Reviewed by Chris Dumez and Sam Weinig.
322
323         This patch adds infrastructure to let WebCore::Document call
324         WebKit::WebResourceLoadStatisticsStore and ask for storage
325         access on behalf of an iframe. The communication goes through
326         the ChromeClient since we might want to add a native prompt.
327         From the ChromeClient it continues to the WebPage which
328         messages the WebPageProxy. The WebPageProxy calls the
329         WebsiteDataStore which owns the WebResourceLoadStatisticsStore.
330         A uint64_t is used to match the right callback with the boolean
331         result.
332
333         * UIProcess/WebPageProxy.cpp:
334         (WebKit::WebPageProxy::requestStorageAccess):
335         * UIProcess/WebPageProxy.h:
336         * UIProcess/WebPageProxy.messages.in:
337         * UIProcess/WebResourceLoadStatisticsStore.cpp:
338         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
339         * UIProcess/WebResourceLoadStatisticsStore.h:
340         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
341         (WebKit::WebsiteDataStore::requestStorageAccess):
342         * UIProcess/WebsiteData/WebsiteDataStore.h:
343         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
344         (WebKit::WebChromeClient::requestStorageAccess):
345         * WebProcess/WebCoreSupport/WebChromeClient.h:
346         * WebProcess/WebPage/WebPage.cpp:
347         (WebKit::nextRequestStorageAccessContextId):
348         (WebKit::WebPage::requestStorageAccess):
349         (WebKit::WebPage::storageAccessResponse):
350         * WebProcess/WebPage/WebPage.h:
351         * WebProcess/WebPage/WebPage.messages.in:
352
353 2017-10-05  Chris Dumez  <cdumez@apple.com>
354
355         Drop unused parameters for CookiesStrategy::cookiesEnabled()
356         https://bugs.webkit.org/show_bug.cgi?id=177957
357
358         Reviewed by Alex Christensen.
359
360         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
361         (WebKit::NetworkConnectionToWebProcess::cookiesEnabled):
362         * NetworkProcess/NetworkConnectionToWebProcess.h:
363         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
364         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
365         (WebKit::WebPlatformStrategies::cookiesEnabled):
366         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
367
368 2017-10-05  Tim Horton  <timothy_horton@apple.com>
369
370         Make progress toward properly-formed XPC services in the Mac CMake build
371         https://bugs.webkit.org/show_bug.cgi?id=177918
372
373         Reviewed by Alex Christensen.
374
375         * CMakeLists.txt:
376         * PlatformMac.cmake:
377         Turn on the storage process on Mac, and fix its build.
378         Move XPC services to Versions/A/XPCServices and add the toplevel
379         XPCServices as a symlink of that.
380         Run the XPC services' Info.plists through configure_file, and substitute
381         the important variables (most critically the bundle identifier).
382         Factor out the service setup so we don't keep duplicating it as it
383         gets more complicated.
384
385 2017-10-05  Andy Estes  <aestes@apple.com>
386
387         [Payment Request] Add a payment method that supports Apple Pay
388         https://bugs.webkit.org/show_bug.cgi?id=177850
389
390         Reviewed by Youenn Fablet.
391
392         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
393         (toShippingMethod): Converted the NSDecimalNumber amount to a string rather than an integer.
394         (WebKit::toDecimalNumber): used -decimalNumberWithString:locale: rather than
395         -initWithMantissa:exponent:isNegative: to create an NSDecimalNumber.
396         (WebKit::toPKPaymentSummaryItem):
397         (WebKit::toPKShippingMethod):
398
399 2017-10-05  Youenn Fablet  <youenn@apple.com>
400
401         Make LibWebRTCProvider port agnostic
402         https://bugs.webkit.org/show_bug.cgi?id=177747
403
404         Reviewed by Alex Christensen & Alex Garcia.
405
406         * WebProcess/Network/webrtc/LibWebRTCProvider.h: Making sure Mac/iOS provider creates the codec factories.
407
408 2017-10-04  Alex Christensen  <achristensen@webkit.org>
409
410         Stop linking with WebKitSystemInterface
411         https://bugs.webkit.org/show_bug.cgi?id=177915
412
413         Reviewed by Antti Koivisto.
414
415         * Configurations/DebugRelease.xcconfig:
416         * WebKit.xcodeproj/project.pbxproj:
417
418 2017-10-04  Alex Christensen  <achristensen@webkit.org>
419
420         Remove unnecessary includes of WebKitSystemInterface on Cocoa platforms
421         https://bugs.webkit.org/show_bug.cgi?id=177912
422
423         Reviewed by Saam Barati.
424
425         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
426         * NetworkProcess/mac/NetworkProcessMac.mm:
427         * NetworkProcess/mac/RemoteNetworkingContext.mm:
428         * Platform/IPC/mac/ConnectionMac.mm:
429         * Platform/mac/LayerHostingContext.mm:
430         * PluginProcess/mac/PluginProcessMac.mm:
431         * PluginProcess/mac/PluginProcessShim.mm:
432         * Shared/ios/ChildProcessIOS.mm:
433         * Shared/mac/ChildProcessMac.mm:
434         * Shared/mac/SandboxExtensionMac.mm:
435         * Shared/mac/WebCoreArgumentCodersMac.mm:
436         * Shared/mac/WebEventFactory.mm:
437         * StorageProcess/ios/StorageProcessIOS.mm:
438         * StorageProcess/mac/StorageProcessMac.mm:
439         * UIProcess/API/Cocoa/WKWebView.mm:
440         * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
441         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
442         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
443         * UIProcess/Cocoa/WebViewImpl.mm:
444         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
445         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
446         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
447         * UIProcess/mac/PageClientImplMac.mm:
448         * UIProcess/mac/WKTextInputWindowController.mm:
449         * UIProcess/mac/WebContextMenuProxyMac.mm:
450         * UIProcess/mac/WebPopupMenuProxyMac.mm:
451         * UIProcess/mac/WindowServerConnection.mm:
452         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
453         * WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm:
454         * WebProcess/Plugins/PDF/PDFPlugin.mm:
455         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
456         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
457         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
458         * WebProcess/WebPage/ios/WebPageIOS.mm:
459         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
460         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
461         * WebProcess/WebPage/mac/WebPageMac.mm:
462         * WebProcess/cocoa/WebProcessCocoa.mm:
463
464 2017-10-04  Youenn Fablet  <youenn@apple.com>
465
466         rtc::PacketOptions should have its own IPC encoding/decoding routines
467         https://bugs.webkit.org/show_bug.cgi?id=177812
468
469         Reviewed by Alex Christensen.
470
471         Replacing rtc::PacketOptions IPC encoding/decoding from passing the structure as individual parameters to the structure as a parameter.
472         Introducing WebKit::RTCPacketOptions as a wrapper around it for which encode/decode routines are added.
473         Updating code using rtc::PacketOptions accordingly.
474
475         * NetworkProcess/webrtc/NetworkRTCSocket.cpp:
476         (WebKit::NetworkRTCSocket::sendTo):
477         * NetworkProcess/webrtc/NetworkRTCSocket.h:
478         * NetworkProcess/webrtc/NetworkRTCSocket.messages.in:
479         * Platform/IPC/Decoder.cpp:
480         (IPC::Decoder::operator>>):
481         (IPC::Decoder::decode):
482         * Platform/IPC/Decoder.h:
483         * Platform/IPC/Encoder.cpp:
484         (IPC::Encoder::encode):
485         * Platform/IPC/Encoder.h:
486         * Shared/RTCPacketOptions.cpp: Added.
487         (WebKit::RTCPacketOptions::encode const):
488         (WebKit::RTCPacketOptions::decode):
489         * Shared/RTCPacketOptions.h: Added.
490         * WebKit.xcodeproj/project.pbxproj:
491         * WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
492         (WebKit::LibWebRTCSocket::SendTo):
493
494 2017-10-04  Don Olmstead  <don.olmstead@sony.com>
495
496         Include Pasteboard.h for all in WebCoreArgumentCoders
497         https://bugs.webkit.org/show_bug.cgi?id=177902
498
499         Reviewed by Alex Christensen.
500
501         * Shared/WebCoreArgumentCoders.cpp:
502
503 2017-10-04  David Kilzer  <ddkilzer@apple.com>
504
505         Remove unused variables in lambdas for network process cache
506         <https://webkit.org/b/177878>
507         <rdar://problem/34038482>
508
509         Reviewed by Tim Horton.
510
511         * NetworkProcess/cache/CacheStorageEngine.cpp:
512         (WebKit::CacheStorage::Engine::open):
513         (WebKit::CacheStorage::Engine::putRecords):
514         (WebKit::CacheStorage::Engine::deleteMatchingRecords):
515         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
516         (WebKit::CacheStorageEngineConnection::reference):
517         - Remove unused |this| from lambda captures.
518
519 2017-10-04  Stephan Szabo  <stephan.szabo@sony.com>
520
521         [WinCairo] add PLATFORM(WIN) configurations to config.h
522         https://bugs.webkit.org/show_bug.cgi?id=177846
523
524         Reviewed by Alex Christensen.
525
526         * config.h:
527
528 2017-10-04  Adrian Perez de Castro  <aperez@igalia.com>
529
530         [GTK] WebKit2GTK+ does not handle touchmove and touchend events correctly
531         https://bugs.webkit.org/show_bug.cgi?id=158531
532
533         Reviewed by Carlos Alberto Lopez Perez.
534
535         Do not bypass WebCore event handling when receiving touch events.
536
537         Based on a patch by Andre Moreira Magalhaes <andre.magalhaes@collabora.co.uk>.
538         Thanks to Carlos Garnacho <carlosg@gnome.org> for helping out reviewing the code.
539
540         * UIProcess/API/gtk/PageClientImpl.cpp:
541         (WebKit::PageClientImpl::doneWithTouchEvent): Make sure touchend reaches gesture controller if touchbegin evet got to it.
542         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
543         (webkitWebViewBaseTouchEvent): Do not invoke gesture controller directly by bypassing WebCore event handling.
544         * UIProcess/gtk/GestureController.cpp:
545         (WebKit::GestureController::reset): Added.
546         (WebKit::GestureController::handleEvent): Reset gesture controller when touchpadupdate/end is received without touchbegin.
547         (WebKit::GestureController::Gesture::reset): Added.
548         * UIProcess/gtk/GestureController.h:
549
550 2017-10-04  Michael Catanzaro  <mcatanzaro@igalia.com>
551
552         Unreviewed WPE build fix after r222837
553         https://bugs.webkit.org/show_bug.cgi?id=177449
554
555         * Shared/wpe/WebEventFactory.cpp:
556         (WebKit::wallTimeForEventTime):
557
558 2017-10-04  Ryosuke Niwa  <rniwa@webkit.org>
559
560         Use blob URL when pasting RTFD instead of overriding DocumentLoader
561         https://bugs.webkit.org/show_bug.cgi?id=177801
562         <rdar://problem/34542270>
563
564         Reviewed by Wenson Hsieh.
565
566         Fixed the assertion failure when RTFD content is empty.
567
568         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
569         (WebKit::WebPasteboardProxy::getPasteboardBufferForType):
570
571 2017-10-04  Michael Catanzaro  <mcatanzaro@igalia.com>
572
573         REGRESSION(r222392): [WPE][GTK] Many forms tests are failing due to broken event timestamps
574         https://bugs.webkit.org/show_bug.cgi?id=177449
575
576         Reviewed by Chris Dumez.
577
578         * Shared/wpe/WebEventFactory.cpp:
579         (WebKit::wallTimeForEventTime):
580
581 2017-10-03  Brent Fulgham  <bfulgham@apple.com>
582
583         Correct nullptr dereference during shutdown
584         https://bugs.webkit.org/show_bug.cgi?id=177845
585         <rdar://problem/33651405>
586
587         Reviewed by Chris Dumez.
588
589         It looks like the ResourceLoadStatisticsPersistentStorage destructor is calling code that attempts
590         to use member variables in its owning class (WebResourceLoadStatisticsStore). Since these may have
591         already been destroyed, they are in an invalid state when accessed.
592
593         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
594         (WebKit::ResourceLoadStatisticsPersistentStorage::~ResourceLoadStatisticsPersistentStorage): Do not call
595         finishAllPendingWorkSynchronously() in the destructor, since it relies on the m_memoryStore to be
596         a reference to completely valid object.
597         * UIProcess/WebResourceLoadStatisticsStore.cpp:
598         (WebKit::WebResourceLoadStatisticsStore::~WebResourceLoadStatisticsStore): Instead, call
599         'finishAllPendingWorkSynchronously' here, when the object is still in a known valid state.
600
601 2017-10-03  Alex Christensen  <achristensen@webkit.org>
602
603         Moderize WebKit's back forward list code
604         https://bugs.webkit.org/show_bug.cgi?id=177843
605
606         Reviewed by Tim Horton.
607
608         Use Ref instead of RefPtr when possible.
609         Use references instead of pointers when possible.
610         Remove unnecessary null checks.
611         Reduce unnecessary Vector copying.
612
613         * Shared/SessionState.h:
614         * Shared/WebBackForwardListItem.h:
615         * UIProcess/API/APILoaderClient.h:
616         (API::LoaderClient::didChangeBackForwardList):
617         (API::LoaderClient::shouldKeepCurrentBackForwardListItemInList):
618         * UIProcess/API/C/WKPage.cpp:
619         (WKPageSetPageLoaderClient):
620         * UIProcess/WebBackForwardList.cpp:
621         (WebKit::WebBackForwardList::pageClosed):
622         (WebKit::WebBackForwardList::addItem):
623         (WebKit::WebBackForwardList::goToItem):
624         (WebKit::WebBackForwardList::currentItem const):
625         (WebKit::WebBackForwardList::backItem const):
626         (WebKit::WebBackForwardList::forwardItem const):
627         (WebKit::WebBackForwardList::itemAtIndex const):
628         (WebKit::WebBackForwardList::backListAsAPIArrayWithLimit const):
629         (WebKit::WebBackForwardList::forwardListAsAPIArrayWithLimit const):
630         (WebKit::WebBackForwardList::removeAllItems):
631         (WebKit::WebBackForwardList::clear):
632         (WebKit::WebBackForwardList::backForwardListState const):
633         (WebKit::WebBackForwardList::restoreFromState):
634         * UIProcess/WebBackForwardList.h:
635         * UIProcess/WebPageProxy.cpp:
636         (WebKit::WebPageProxy::reattachToWebProcessWithItem):
637         (WebKit::WebPageProxy::initializeWebPage):
638         (WebKit::WebPageProxy::didChangeBackForwardList):
639         (WebKit::WebPageProxy::shouldKeepCurrentBackForwardListItemInList):
640         (WebKit::WebPageProxy::backForwardGoToItem):
641         * UIProcess/WebPageProxy.h:
642         * UIProcess/WebProcessProxy.cpp:
643         (WebKit::WebProcessProxy::registerNewWebBackForwardListItem):
644         * UIProcess/WebProcessProxy.h:
645         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
646         (WebKit::WebBackForwardListProxy::itemAtIndex):
647
648 2017-10-03  Chris Dumez  <cdumez@apple.com>
649
650         SharedStringHashStore should support removing hashes
651         https://bugs.webkit.org/show_bug.cgi?id=177770
652
653         Reviewed by Alex Christensen.
654
655         SharedStringHashStore should support removing hashes. It currently only supports adding hashes or
656         clearing all of them, which is sufficient for the VisitedLinkStore but will not be for Service
657         Worker purposes.
658
659         * Shared/SharedStringHashStore.cpp:
660         (WebKit::SharedStringHashStore::SharedStringHashStore):
661         (WebKit::SharedStringHashStore::add):
662         (WebKit::SharedStringHashStore::remove):
663         (WebKit::SharedStringHashStore::contains):
664         (WebKit::SharedStringHashStore::clear):
665         (WebKit::SharedStringHashStore::resizeTable):
666         (WebKit::SharedStringHashStore::pendingOperationsTimerFired):
667         * Shared/SharedStringHashStore.h:
668         * Shared/SharedStringHashTable.cpp:
669         (WebKit::SharedStringHashTable::remove):
670         * Shared/SharedStringHashTable.h:
671         * UIProcess/API/Cocoa/_WKVisitedLinkStore.h:
672         * UIProcess/API/Cocoa/_WKVisitedLinkStore.mm:
673         (-[_WKVisitedLinkStore containsVisitedLinkWithURL:]):
674         (-[_WKVisitedLinkStore removeVisitedLinkWithURL:]):
675         * UIProcess/VisitedLinkStore.cpp:
676         (WebKit::VisitedLinkStore::containsVisitedLinkHash):
677         (WebKit::VisitedLinkStore::removeVisitedLinkHash):
678         (WebKit::VisitedLinkStore::didUpdateSharedStringHashes):
679         * UIProcess/VisitedLinkStore.h:
680
681 2017-10-03  Alex Christensen  <achristensen@webkit.org>
682
683         Fix API tests after r222794.
684         https://bugs.webkit.org/show_bug.cgi?id=177825
685
686         * UIProcess/WebPageProxy.cpp:
687         (WebKit::WebPageProxy::willGoToBackForwardListItem):
688         Sometimes there's no navigation client.
689
690 2017-10-03  Alex Christensen  <achristensen@webkit.org>
691
692         Add ObjC equivalent of WKPageLoaderClient.pluginDidFail
693         https://bugs.webkit.org/show_bug.cgi?id=177787
694         <rdar://problem/22387633>
695
696         Reviewed by Tim Horton.
697
698         * UIProcess/API/APILoaderClient.h:
699         (API::LoaderClient::didFailToInitializePlugin):
700         * UIProcess/API/APINavigationClient.h:
701         (API::NavigationClient::canHandleDidFailToInitializePlugIn const):
702         (API::NavigationClient::didFailToInitializePlugIn):
703         * UIProcess/API/C/WKPage.cpp:
704         (WKPageSetPageLoaderClient):
705         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
706         * UIProcess/Cocoa/NavigationState.h:
707         * UIProcess/Cocoa/NavigationState.mm:
708         (WebKit::NavigationState::setNavigationDelegate):
709         (WebKit::NavigationState::NavigationClient::canHandleDidFailToInitializePlugIn const):
710         (WebKit::NavigationState::NavigationClient::didFailToInitializePlugIn):
711         * UIProcess/WebPageProxy.cpp:
712         (WebKit::WebPageProxy::didFailToInitializePlugin):
713
714 2017-10-03  Adrian Perez de Castro  <aperez@igalia.com>
715
716         [GTK] Prefer -webkit-system-font
717         https://bugs.webkit.org/show_bug.cgi?id=177814
718
719         Reviewed by Carlos Garcia Campos.
720
721         Use "font-family: -webkit-system-font" instead of "font: menu".
722
723         * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
724         (WebKit::RemoteInspectorProtocolHandler::handleRequest): Edited HTML snippet.
725
726 2017-10-03  Alex Christensen  <achristensen@webkit.org>
727
728         Add ObjC SPI equivalent to WKPageLoaderClient.willGoToBackForwardListItem
729         https://bugs.webkit.org/show_bug.cgi?id=177825
730         <rdar://problem/22387505>
731
732         Reviewed by Tim Horton.
733
734         * UIProcess/API/APILoaderClient.h:
735         (API::LoaderClient::willGoToBackForwardListItem):
736         * UIProcess/API/APINavigationClient.h:
737         (API::NavigationClient::canHandleWillGoToBackForwardListItem const):
738         (API::NavigationClient::willGoToBackForwardListItem):
739         * UIProcess/API/C/WKPage.cpp:
740         (WKPageSetPageLoaderClient):
741         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
742         * UIProcess/Cocoa/NavigationState.h:
743         * UIProcess/Cocoa/NavigationState.mm:
744         (WebKit::NavigationState::setNavigationDelegate):
745         (WebKit::NavigationState::NavigationClient::canHandleWillGoToBackForwardListItem const):
746         (WebKit::NavigationState::NavigationClient::willGoToBackForwardListItem):
747         * UIProcess/WebPageProxy.cpp:
748         (WebKit::WebPageProxy::willGoToBackForwardListItem):
749         * UIProcess/WebPageProxy.h:
750         * UIProcess/WebPageProxy.messages.in:
751         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
752         (WebKit::WebFrameLoaderClient::shouldGoToHistoryItem const):
753
754 2017-10-03  Michael Catanzaro  <mcatanzaro@igalia.com>
755
756         REGRESSION(r222392): [WPE][GTK] Many forms tests are failing due to broken event timestamps
757         https://bugs.webkit.org/show_bug.cgi?id=177449
758
759         Reviewed by Chris Dumez.
760
761         * Shared/gtk/WebEventFactory.cpp:
762         (WebKit::WebEventFactory::createWebMouseEvent):
763         (WebKit::WebEventFactory::createWebWheelEvent):
764         (WebKit::WebEventFactory::createWebKeyboardEvent):
765         (WebKit::WebEventFactory::createWebTouchEvent):
766         * Shared/wpe/WebEventFactory.cpp:
767         (WebKit::wallTimeForEventTime):
768         (WebKit::WebEventFactory::createWebKeyboardEvent):
769         (WebKit::WebEventFactory::createWebMouseEvent):
770         (WebKit::WebEventFactory::createWebWheelEvent):
771         (WebKit::WebEventFactory::createWebTouchEvent):
772
773 2017-10-03  Carlos Garcia Campos  <cgarcia@igalia.com>
774
775         [GTK][WPE] WebProcess should run cleanup on quit to release resources
776         https://bugs.webkit.org/show_bug.cgi?id=168126
777
778         Reviewed by Michael Catanzaro.
779
780         Do not call exit on sync message send failure for GTK and WPE ports.
781
782         * WebProcess/WebProcess.cpp:
783         (WebKit::WebProcess::initializeConnection):
784
785 2017-10-02  Ryosuke Niwa  <rniwa@webkit.org>
786
787         Move more code into PasteboardCustomData
788         https://bugs.webkit.org/show_bug.cgi?id=177795
789
790         Reviewed by Wenson Hsieh.
791
792         Added the support for encoding and decoding the origin string in PasteboardCustomData.
793
794         * Shared/WebCoreArgumentCoders.cpp:
795         (IPC::ArgumentCoder<PasteboardCustomData>::encode):
796         (IPC::ArgumentCoder<PasteboardCustomData>::decode):
797
798 2017-10-02  Adrian Perez de Castro  <aperez@igalia.com>
799
800         [GTK] Do not hardcode font family in served remote inspector HTML snippets
801         https://bugs.webkit.org/show_bug.cgi?id=177742
802
803         Reviewed by Carlos Garcia Campos.
804
805         Instead of hardcoding Cantarell as the font used for the HTML snippets served
806         by the remote inspector handler, use "font: menu" to obtain the system UI
807         font, plus a "font-size" rule for adjusting the size.
808
809         * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
810         (WebKit::RemoteInspectorProtocolHandler::handleRequest): Change the
811         CSS rules in the served snippet.
812
813 2017-10-02  Joseph Pecoraro  <pecoraro@apple.com>
814
815         Web Inspector: Include Beacon and Ping requests in Network tab
816         https://bugs.webkit.org/show_bug.cgi?id=177641
817         <rdar://problem/33086839>
818
819         Reviewed by Chris Dumez.
820
821         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
822         (WebKit::NetworkConnectionToWebProcess::loadPing):
823         (WebKit::NetworkConnectionToWebProcess::didFinishPingLoad):
824         * NetworkProcess/NetworkConnectionToWebProcess.h:
825         * NetworkProcess/PingLoad.cpp:
826         (WebKit::PingLoad::PingLoad):
827         (WebKit::PingLoad::didFinish):
828         (WebKit::PingLoad::didReceiveResponseNetworkSession):
829         * NetworkProcess/PingLoad.h:
830         * WebProcess/Network/NetworkProcessConnection.cpp:
831         (WebKit::NetworkProcessConnection::didFinishPingLoad):
832         * WebProcess/Network/NetworkProcessConnection.h:
833         * WebProcess/Network/NetworkProcessConnection.messages.in:
834         * WebProcess/Network/WebLoaderStrategy.cpp:
835         (WebKit::WebLoaderStrategy::networkProcessCrashed):
836         (WebKit::WebLoaderStrategy::startPingLoad):
837         (WebKit::WebLoaderStrategy::didFinishPingLoad):
838         * WebProcess/Network/WebLoaderStrategy.h:
839         Pass an optional ResourceResponse back to the ping completion handler.
840
841 2017-10-02  Alex Christensen  <achristensen@webkit.org>
842
843         REGRESSION: API tests WebKit.ProcessDidTerminateRequestedByClient and WebKit.ProcessDidTerminateWithReasonCrash are timing out
844         https://bugs.webkit.org/show_bug.cgi?id=177764
845
846         Reviewed by Chris Dumez.
847
848         * UIProcess/API/C/WKPage.cpp:
849         (WKPageSetPageNavigationClient):
850         I shouldn't have reverted the A API telling the listener to continue if there's no client function.
851
852 2017-10-02  Carlos Garcia Campos  <cgarcia@igalia.com>
853
854         [WPE][GTK] Crash in webkit_web_resource_get_data_finish()
855         https://bugs.webkit.org/show_bug.cgi?id=177107
856
857         Reviewed by Michael Catanzaro.
858
859         Handle errors in webkit_web_resource_get_data() callback.
860
861         * UIProcess/API/glib/WebKitWebResource.cpp:
862         (resourceDataCallback):
863         (webkit_web_resource_get_data):
864
865 2017-10-02  Olivier Blin  <olivier.blin@softathome.com>
866
867         [WPE] Fix UIProcess build with GStreamer and without VIDEO
868         https://bugs.webkit.org/show_bug.cgi?id=177753
869
870         Reviewed by Michael Catanzaro.
871
872         GStreamer builds fail when WebAudio is enabled but VIDEO disabled.
873         This is the WPE counterpart of bug 153135.
874
875         * UIProcess/API/wpe/PageClientImpl.h:
876
877 2017-10-02  Alex Christensen  <achristensen@webkit.org>
878
879         Expose more WKPreferences SPI to match C SPI
880         https://bugs.webkit.org/show_bug.cgi?id=177697
881
882         * UIProcess/API/Cocoa/WKPreferences.mm:
883         (-[WKPreferences _javaEnabledForLocalFiles]):
884         (-[WKPreferences _setPlugInsEnabled:]): Deleted.
885         (-[WKPreferences _plugInsEnabled]): Deleted.
886         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
887         _javaEnabledForLocalFiles should return the correct value.
888         _plugInsEnabled has public API.  This SPI is not needed.
889
890 2017-10-02  Alex Christensen  <achristensen@webkit.org>
891
892         REGRESSION(r214201): WebProcess hangs during policy decisions
893         https://bugs.webkit.org/show_bug.cgi?id=177590
894         <rdar://problem/33362929>
895
896         Reviewed by Andy Estes.
897
898         This is like r222431 but for trunk instead of a branch.
899         It includes the same regression API test so I don't make the same mistake again.
900
901         * UIProcess/API/C/WKPage.cpp:
902         (WKPageSetPageNavigationClient):
903         * UIProcess/WebPageProxy.cpp:
904         (WebKit::WebPageProxy::receivedPolicyDecision):
905         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
906         (WebKit::WebPageProxy::decidePolicyForResponseSync):
907         * UIProcess/WebPageProxy.h:
908         * UIProcess/WebPageProxy.messages.in:
909         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
910         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
911         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
912         (WebKit::WebFrameLoaderClient::applyToDocumentLoader):
913         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
914         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
915         * WebProcess/WebPage/WebDocumentLoader.cpp:
916         (WebKit::WebDocumentLoader::setNavigationID):
917         * WebProcess/WebPage/WebFrame.cpp:
918         (WebKit::WebFrame::setUpPolicyListener):
919         (WebKit::WebFrame::invalidatePolicyListener):
920         (WebKit::WebFrame::didReceivePolicyDecision):
921         * WebProcess/WebPage/WebFrame.h:
922         * WebProcess/WebPage/WebPage.cpp:
923         (WebKit::WebPage::didReceivePolicyDecision):
924         * WebProcess/WebPage/WebPage.h:
925         * WebProcess/WebPage/WebPage.messages.in:
926
927 2017-10-02  Alex Christensen  <achristensen@webkit.org>
928
929         Remove unnecessary copy of SessionID in WebPageProxy
930         https://bugs.webkit.org/show_bug.cgi?id=177702
931
932         Reviewed by Darin Adler.
933
934         * UIProcess/WebPageProxy.cpp:
935         (WebKit::WebPageProxy::sessionID const):
936         (WebKit::WebPageProxy::creationParameters):
937         * UIProcess/WebPageProxy.h:
938         (WebKit::WebPageProxy::sessionID const): Deleted.
939
940 2017-10-02  Alex Christensen  <achristensen@webkit.org>
941
942         Expose more WKPreferences SPI to match C SPI
943         https://bugs.webkit.org/show_bug.cgi?id=177697
944         <rdar://problem/24110556>
945
946         Reviewed by Darin Adler.
947
948         * UIProcess/API/Cocoa/WKPreferences.mm:
949         (-[WKPreferences _setJavaEnabledForLocalFiles:]):
950         (-[WKPreferences _javaEnabledForLocalFiles]):
951         (-[WKPreferences _setCanvasUsesAcceleratedDrawing:]):
952         (-[WKPreferences _canvasUsesAcceleratedDrawing]):
953         (-[WKPreferences _setAcceleratedCompositingEnabled:]):
954         (-[WKPreferences _acceleratedCompositingEnabled]):
955         (-[WKPreferences _setDefaultTextEncodingName:]):
956         (-[WKPreferences _defaultTextEncodingName]):
957         (-[WKPreferences _setNeedsSiteSpecificQuirks:]):
958         (-[WKPreferences _needsSiteSpecificQuirks]):
959         (-[WKPreferences _setAuthorAndUserStylesEnabled:]):
960         (-[WKPreferences _authorAndUserStylesEnabled]):
961         (-[WKPreferences _setDOMTimersThrottlingEnabled:]):
962         (-[WKPreferences _domTimersThrottlingEnabled]):
963         (-[WKPreferences _setWebArchiveDebugModeEnabled:]):
964         (-[WKPreferences _webArchiveDebugModeEnabled]):
965         (-[WKPreferences _setLocalFileContentSniffingEnabled:]):
966         (-[WKPreferences _localFileContentSniffingEnabled]):
967         (-[WKPreferences _setUsesPageCache:]):
968         (-[WKPreferences _usesPageCache]):
969         (-[WKPreferences _setPageCacheSupportsPlugins:]):
970         (-[WKPreferences _pageCacheSupportsPlugins]):
971         (-[WKPreferences _setShouldPrintBackgrounds:]):
972         (-[WKPreferences _shouldPrintBackgrounds]):
973         (-[WKPreferences _setWebSecurityEnabled:]):
974         (-[WKPreferences _webSecurityEnabled]):
975         (-[WKPreferences _setUniversalAccessFromFileURLsAllowed:]):
976         (-[WKPreferences _universalAccessFromFileURLsAllowed]):
977         (-[WKPreferences _setAVFoundationEnabled:]):
978         (-[WKPreferences _avFoundationEnabled]):
979         (-[WKPreferences _setSuppressesIncrementalRendering:]):
980         (-[WKPreferences _suppressesIncrementalRendering]):
981         (-[WKPreferences _setAsynchronousPluginInitializationEnabled:]):
982         (-[WKPreferences _asynchronousPluginInitializationEnabled]):
983         (-[WKPreferences _setArtificialPluginInitializationDelayEnabled:]):
984         (-[WKPreferences _artificialPluginInitializationDelayEnabled]):
985         (-[WKPreferences _setCookieEnabled:]):
986         (-[WKPreferences _cookieEnabled]):
987         (-[WKPreferences _setPlugInSnapshottingEnabled:]):
988         (-[WKPreferences _plugInSnapshottingEnabled]):
989         (-[WKPreferences _setQTKitEnabled:]):
990         (-[WKPreferences _qtKitEnabled]):
991         (-[WKPreferences _setSubpixelCSSOMElementMetricsEnabled:]):
992         (-[WKPreferences _subpixelCSSOMElementMetricsEnabled]):
993         (-[WKPreferences _setMediaSourceEnabled:]):
994         (-[WKPreferences _mediaSourceEnabled]):
995         (-[WKPreferences _setViewGestureDebuggingEnabled:]):
996         (-[WKPreferences _viewGestureDebuggingEnabled]):
997         (-[WKPreferences _setCSSAnimationTriggersEnabled:]):
998         (-[WKPreferences _cssAnimationTriggersEnabled]):
999         (-[WKPreferences _setStandardFontFamily:]):
1000         (-[WKPreferences _standardFontFamily]):
1001         (-[WKPreferences _setNotificationsEnabled:]):
1002         (-[WKPreferences _notificationsEnabled]):
1003         (-[WKPreferences _setBackspaceKeyNavigationEnabled:]):
1004         (-[WKPreferences _backspaceKeyNavigationEnabled]):
1005         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1006
1007 2017-10-02  Carlos Garcia Campos  <cgarcia@igalia.com>
1008
1009         [GTK][WPE] Enable interactive forms validation by default
1010         https://bugs.webkit.org/show_bug.cgi?id=177737
1011
1012         Reviewed by Michael Catanzaro.
1013
1014         It's currently disabled for no reason.
1015
1016         * Shared/WebPreferencesDefinitions.h:
1017
1018 2017-10-02  Michael Catanzaro  <mcatanzaro@igalia.com>
1019
1020         Remove ENABLE_CSS_REGIONS
1021         https://bugs.webkit.org/show_bug.cgi?id=177689
1022
1023         Reviewed by Darin Adler.
1024
1025         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp:
1026         (webkit_dom_element_get_webkit_region_overset):
1027         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.h:
1028         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
1029         (webkit_dom_element_get_webkit_region_overset): Deleted.
1030         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.h:
1031
1032 2017-09-30  Darin Adler  <darin@apple.com>
1033
1034         Have IPC::Connection::Client objects consistently invalidate the connection when destroyed
1035         https://bugs.webkit.org/show_bug.cgi?id=177708
1036
1037         Reviewed by Anders Carlsson.
1038
1039         I ran into an intermittent crash when running regression tests. It looked like a connection
1040         client was being called after it was destroyed. I did an audit of the all the connection
1041         clients to make sure they all invalidate their connection before they are destroyed.
1042
1043         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1044         (WebKit::NetworkConnectionToWebProcess::~NetworkConnectionToWebProcess): Invalidate the
1045         connection since this object opened the connection. There is no obvious
1046         guarantee that the connection will already be invalid when this is destroyed.
1047         * StorageProcess/StorageToWebProcessConnection.cpp:
1048         (WebKit::StorageToWebProcessConnection::~StorageToWebProcessConnection): Ditto.
1049         * UIProcess/Plugins/PluginProcessProxy.cpp:
1050         (WebKit::PluginProcessProxy::~PluginProcessProxy): Ditto.
1051         * WebProcess/Network/NetworkProcessConnection.cpp:
1052         (WebKit::NetworkProcessConnection::~NetworkProcessConnection): Ditto.
1053         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
1054         (WebKit::WebToStorageProcessConnection::~WebToStorageProcessConnection): Ditto.
1055
1056         * StorageProcess/StorageToWebProcessConnection.h: Derive privately rather than publicly
1057         from IPC::Connection::Client because we can, and this means we don't have to study quite
1058         as much code to understand how this is used as a connection client.
1059         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h: Ditto.
1060         * WebProcess/Storage/WebToStorageProcessConnection.h: Ditto.
1061         * WebProcess/WebPage/WebInspector.h: Ditto.
1062         * WebProcess/WebPage/WebInspectorUI.h: Ditto.
1063
1064         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
1065         (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer): Added a comment about a
1066         reference cycle cycle leading to a leak that I believe exists here.
1067
1068 2017-09-29  Alex Christensen  <achristensen@webkit.org>
1069
1070         REGRESSION: ASSERTION FAILED: m_provisionalURL.isEmpty() in WebKit::FrameLoadState::didStartProvisionalLoad
1071         https://bugs.webkit.org/show_bug.cgi?id=177491
1072
1073         Reviewed by Andy Estes.
1074
1075         * WebProcess/WebPage/WebFrame.cpp:
1076         (WebKit::WebFrame::setUpWillSubmitFormListener):
1077         (WebKit::WebFrame::continueWillSubmitForm):
1078         (WebKit::WebFrame::invalidatePolicyListener):
1079         Speculative fix for a flaky assertion.
1080         Restore the clearing of the policy listeners we used to have when form submission was treated as a policy.
1081
1082 2017-09-29  Chris Dumez  <cdumez@apple.com>
1083
1084         http/tests/preconnect/link-rel-preconnect-https.html is flaky
1085         https://bugs.webkit.org/show_bug.cgi?id=177673
1086
1087         Reviewed by Alex Christensen.
1088
1089         Update PreconnectTask to query the client when a certificate needs to be
1090         validated. This allows WebKitTestRunner to ignore invalid certificates
1091         and this causes http/tests/preconnect/link-rel-preconnect-https.html
1092         to pass consistently.
1093
1094         To avoid duplicating code, PreconnectTask now uses NetworkLoad internally
1095         instead of using a NetworkDataTask directly.
1096
1097         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1098         (WebKit::NetworkConnectionToWebProcess::preconnectTo):
1099         * NetworkProcess/NetworkConnectionToWebProcess.h:
1100         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1101         * NetworkProcess/NetworkLoad.h:
1102         * NetworkProcess/NetworkProcess.cpp:
1103         (WebKit::generateCanAuthenticateIdentifier):
1104         (WebKit::NetworkProcess::canAuthenticateAgainstProtectionSpace):
1105         (WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpace):
1106         (WebKit::NetworkProcess::preconnectTo):
1107         * NetworkProcess/NetworkProcess.h:
1108         * NetworkProcess/NetworkResourceLoadParameters.cpp:
1109         (WebKit::NetworkResourceLoadParameters::encode const):
1110         (WebKit::NetworkResourceLoadParameters::decode):
1111         * NetworkProcess/PreconnectTask.cpp:
1112         (WebKit::PreconnectTask::PreconnectTask):
1113         (WebKit::PreconnectTask::~PreconnectTask):
1114         (WebKit::PreconnectTask::willSendRedirectedRequest):
1115         (WebKit::PreconnectTask::didReceiveResponse):
1116         (WebKit::PreconnectTask::didReceiveBuffer):
1117         (WebKit::PreconnectTask::didFinishLoading):
1118         (WebKit::PreconnectTask::didFailLoading):
1119         (WebKit::PreconnectTask::didSendData):
1120         (WebKit::PreconnectTask::canAuthenticateAgainstProtectionSpaceAsync):
1121         (WebKit::PreconnectTask::continueCanAuthenticateAgainstProtectionSpace):
1122         (WebKit::PreconnectTask::frameID const):
1123         (WebKit::PreconnectTask::pageID const):
1124         * NetworkProcess/PreconnectTask.h:
1125         * WebProcess/Network/WebLoaderStrategy.cpp:
1126         (WebKit::WebLoaderStrategy::preconnectTo):
1127         * WebProcess/Network/WebLoaderStrategy.h:
1128
1129 2017-09-29  Alex Christensen  <achristensen@webkit.org>
1130
1131         Expose WebPreferences::webGLEnabled through WKPreferences
1132         https://bugs.webkit.org/show_bug.cgi?id=177692
1133         <rdar://problem/24110556>
1134
1135         Reviewed by Andy Estes.
1136
1137         * UIProcess/API/Cocoa/WKPreferences.mm:
1138         (-[WKPreferences _setWebGLEnabled:]):
1139         (-[WKPreferences _webGLEnabled]):
1140         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1141
1142 2017-09-29  Chris Dumez  <cdumez@apple.com>
1143
1144         [WK2][NETWORK_SESSION] Move some authentication-related code to avoid duplication
1145         https://bugs.webkit.org/show_bug.cgi?id=177667
1146
1147         Reviewed by Alex Christensen.
1148
1149         Move some authentication-related code to avoid duplication.
1150         This is a preparation code supporting Download authentication
1151         as Download uses a NSURLSessionDownloadTask and not a
1152         NetworkDataTask.
1153
1154         * NetworkProcess/NetworkDataTask.h:
1155         (WebKit::NetworkDataTask::setSuggestedFilename):
1156         * NetworkProcess/NetworkLoad.cpp:
1157         (WebKit::NetworkLoad::didReceiveChallenge):
1158         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
1159         * NetworkProcess/NetworkSession.cpp:
1160         (WebKit::NetworkSession::allowsSpecificHTTPSCertificateForHost):
1161         * NetworkProcess/NetworkSession.h:
1162         * NetworkProcess/PreconnectTask.cpp:
1163         (WebKit::PreconnectTask::didReceiveChallenge):
1164         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
1165         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1166         (WebKit::NetworkDataTaskCocoa::didReceiveChallenge):
1167         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
1168         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1169         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
1170         (WebKit::certificatesMatch):
1171         (WebKit::NetworkSessionCocoa::allowsSpecificHTTPSCertificateForHost):
1172
1173 2017-09-29  Alex Christensen  <achristensen@webkit.org>
1174
1175         Fix WKWebViewConfigurationPrivate after r222663
1176         https://bugs.webkit.org/show_bug.cgi?id=177644
1177
1178         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1179         (-[WKWebViewConfiguration init]):
1180         (-[WKWebViewConfiguration copyWithZone:]):
1181         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
1182
1183 2017-09-29  Chris Dumez  <cdumez@apple.com>
1184
1185         Split some logic out of VisitedLinkStore and make it reusable
1186         https://bugs.webkit.org/show_bug.cgi?id=177575
1187
1188         Reviewed by Alex Christensen.
1189
1190         Split some logic out of VisitedLinkStore and make it reusable for other purposes than
1191         visited links and from other processes than the UIProcess.
1192
1193         The plan is to reuse the new SharedStringHashStore for Service Worker registration
1194         on StorageProcess side and querying on WebContent process side.
1195
1196         * CMakeLists.txt:
1197         * Shared/SharedStringHashStore.cpp: Added.
1198         (WebKit::nextPowerOf2):
1199         (WebKit::tableSizeForKeyCount):
1200         (WebKit::SharedStringHashStore::SharedStringHashStore):
1201         (WebKit::SharedStringHashStore::createSharedMemoryHandle):
1202         (WebKit::SharedStringHashStore::add):
1203         (WebKit::SharedStringHashStore::clear):
1204         (WebKit::SharedStringHashStore::resizeTable):
1205         (WebKit::SharedStringHashStore::pendingSharedStringHashesTimerFired):
1206         * Shared/SharedStringHashStore.h: Copied from Source/WebKit/WebProcess/WebPage/VisitedLinkTableController.h.
1207         (WebKit::SharedStringHashStore::Client::~Client):
1208         (WebKit::SharedStringHashStore::isEmpty const):
1209         * Shared/SharedStringHashTable.cpp: Renamed from Source/WebKit/Shared/VisitedLinkTable.cpp.
1210         (WebKit::SharedStringHashTable::SharedStringHashTable):
1211         (WebKit::SharedStringHashTable::~SharedStringHashTable):
1212         (WebKit::SharedStringHashTable::setSharedMemory):
1213         (WebKit::SharedStringHashTable::add):
1214         (WebKit::SharedStringHashTable::contains const):
1215         (WebKit::SharedStringHashTable::clear):
1216         * Shared/SharedStringHashTable.h: Renamed from Source/WebKit/Shared/VisitedLinkTable.h.
1217         * UIProcess/API/C/WKContext.cpp:
1218         (WKContextAddVisitedLink):
1219         * UIProcess/API/Cocoa/_WKVisitedLinkStore.mm:
1220         (-[_WKVisitedLinkStore addVisitedLinkWithURL:]):
1221         * UIProcess/VisitedLinkStore.cpp:
1222         (WebKit::VisitedLinkStore::VisitedLinkStore):
1223         (WebKit::VisitedLinkStore::addProcess):
1224         (WebKit::VisitedLinkStore::addVisitedLinkHash):
1225         (WebKit::VisitedLinkStore::removeAll):
1226         (WebKit::VisitedLinkStore::addVisitedLinkHashFromPage):
1227         (WebKit::VisitedLinkStore::sendStoreHandleToProcess):
1228         (WebKit::VisitedLinkStore::didInvalidateSharedMemory):
1229         (WebKit::VisitedLinkStore::didAddSharedStringHashes):
1230         * UIProcess/VisitedLinkStore.h:
1231         * UIProcess/WebProcessPool.cpp:
1232         * UIProcess/WebProcessPool.h:
1233         * UIProcess/WebProcessProxy.h:
1234         * WebKit.xcodeproj/project.pbxproj:
1235         * WebProcess/WebPage/VisitedLinkTableController.cpp:
1236         (WebKit::VisitedLinkTableController::isLinkVisited):
1237         (WebKit::VisitedLinkTableController::addVisitedLink):
1238         (WebKit::VisitedLinkTableController::visitedLinkStateChanged):
1239         * WebProcess/WebPage/VisitedLinkTableController.h:
1240         * WebProcess/WebPage/VisitedLinkTableController.messages.in:
1241
1242 2017-09-28  Alex Christensen  <achristensen@webkit.org>
1243
1244         Add WKWebViewConfiguration SPI equivalent to WKPageConfigurationSetBackgroundCPULimit
1245         https://bugs.webkit.org/show_bug.cgi?id=177644
1246         <rdar://problem/34338698>
1247
1248         Reviewed by Geoffrey Garen.
1249
1250         WKPageConfigurationSetBackgroundCPULimit is a setter of a std::optional<double> with no accessor.
1251         It's never set to 0 in practice, so I guess the ObjC equivalent is a double that is zero or nonzero.
1252
1253         * UIProcess/API/Cocoa/WKWebView.mm:
1254         (-[WKWebView _initializeWithConfiguration:]):
1255         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1256         (-[WKWebViewConfiguration _setCPULimit:]):
1257         (-[WKWebViewConfiguration _cpuLimit]):
1258         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
1259
1260 2017-09-28  Ryosuke Niwa  <rniwa@webkit.org>
1261
1262         Image pasting is not working on tineye.com / gmail.com / GitHub.com due to lack of support for DataTransfer.items
1263         https://bugs.webkit.org/show_bug.cgi?id=170449
1264         <rdar://problem/31432525>
1265
1266         Reviewed by Wenson Hsieh.
1267
1268         Add sandbox extensions for files in the pasteboard to make copying & pasting image files work.
1269         This is what we do for drag & drop but we should consider adding a mechanism to rekoke the extension in the future.
1270
1271         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
1272         (WebKit::WebPasteboardProxy::getPasteboardPathnamesForType): Add sandbox extensions to the pasted files.
1273         * UIProcess/WebPasteboardProxy.h:
1274         * UIProcess/WebPasteboardProxy.messages.in:
1275         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1276         (WebKit::WebPlatformStrategies::getPathnamesForType): Consume the sandbox tokens sent by the UI process permanently
1277         since WebCore will now create File objects for these pasted files.
1278
1279 2017-09-29  Wenson Hsieh  <wenson_hsieh@apple.com>
1280
1281         [iOS WK2] Implement -[WKContentView hasText] for compatibility with the UITextInput protocol
1282         https://bugs.webkit.org/show_bug.cgi?id=177662
1283         <rdar://problem/33410373>
1284
1285         Reviewed by Tim Horton.
1286
1287         Implements -[WKContentView hasText] by propagating a flag through post-layout editor state.
1288
1289         * Shared/EditorState.cpp:
1290         (WebKit::EditorState::PostLayoutData::encode const):
1291         (WebKit::EditorState::PostLayoutData::decode):
1292         * Shared/EditorState.h:
1293
1294         Add a new flag to EditorState indicating whether or not the current editable root containing the selection has
1295         any plain text. Add IPC support for this new flag.
1296
1297         * UIProcess/ios/WKContentViewInteraction.mm:
1298         (-[WKContentView hasText]):
1299         * WebProcess/WebPage/ios/WebPageIOS.mm:
1300         (WebKit::computeEditableRootHasContentAndPlainText):
1301
1302         Add a new helper to compute whether or not the editable root has any content, and any plain text. This
1303         is used as the last cached value for -hasText on WKContentView that we will deliver to UIKit. Some important
1304         things to note here:
1305         - If post layout data already indicates that we have selected some plain text, or that there is a plain text
1306           character near the selection, just set the flags to true and bail, since the editable root necessarily has
1307           content that is plain text.
1308         - If hasContent is false, don't even bother computing hasPlainText, because it must also be false.
1309         - Otherwise, use hasAnyPlainText to compute the value of hasPlainText, which is a faster variant of plainText.
1310         These optimizations help us avoid doing extra work at all when running Speedometer, apart from checking the
1311         values of a few PostLayoutData flags. This also fixes the value of hasContent, which was previously always false
1312         if we had a range selection rather than a caret selection even when the editable root has content, because the
1313         logic to compute the value of hasContent only existed in the branch where we have a caret selection.
1314
1315         (WebKit::WebPage::platformEditorState const):
1316
1317 2017-09-28  Timothy Horton  <timothy_horton@apple.com>
1318
1319         Fix the macOS CMake build
1320
1321         * CMakeLists.txt:
1322
1323 2017-09-28  Timothy Horton  <timothy_horton@apple.com>
1324
1325         Revise deployment target macros from r222620
1326
1327         Rubber-stamped by Wenson Hsieh.
1328
1329         * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h:
1330         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1331         (WebKit::PDFPlugin::pdfDocumentDidLoad):
1332
1333 2017-09-28  Aishwarya Nirmal  <anirmal@apple.com>
1334
1335         Request for PDF URL targets for specific pages, sections, etc.
1336         https://bugs.webkit.org/show_bug.cgi?id=177582
1337         <rdar://problem/5692679>
1338
1339         Reviewed by Tim Horton.
1340         
1341         This change sets the URL fragment for scroll anchoring in PDFs.
1342
1343         * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h:
1344         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1345         (WebKit::PDFPlugin::pdfDocumentDidLoad):
1346
1347 2017-09-28  Ross Kirsling  <ross.kirsling@sony.com>
1348
1349         [PAL] Move HysteresisActivity into PAL
1350         https://bugs.webkit.org/show_bug.cgi?id=177516
1351
1352         Reviewed by Alex Christensen.
1353
1354         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
1355         (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::PendingFrameLoad):
1356         * Shared/WebSQLiteDatabaseTracker.cpp:
1357         (WebKit::WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker):
1358         (WebKit::WebSQLiteDatabaseTracker::hysteresisUpdated):
1359         * Shared/WebSQLiteDatabaseTracker.h:
1360         * WebProcess/WebPage/WebPage.cpp:
1361         (WebKit::m_pageScrolledHysteresis):
1362         (WebKit::m_userActivityHysteresis):
1363         (WebKit::WebPage::updateUserActivity):
1364         * WebProcess/WebPage/WebPage.h:
1365         * WebProcess/WebProcess.cpp:
1366         (WebKit::WebProcess::WebProcess):
1367         * WebProcess/WebProcess.h:
1368
1369 2017-09-28  Chris Dumez  <cdumez@apple.com>
1370
1371         Add support for <link rel=preconnect>
1372         https://bugs.webkit.org/show_bug.cgi?id=177474
1373         <rdar://problem/33141380>
1374
1375         Reviewed by Alex Christensen.
1376
1377         Add support for <link rel=preconnect>:
1378         - https://w3c.github.io/resource-hints/#preconnect
1379
1380         Also add corresponding native private API.
1381
1382         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1383         (WebKit::NetworkConnectionToWebProcess::preconnectTo):
1384         (WebKit::NetworkConnectionToWebProcess::didFinishPreconnection):
1385         * NetworkProcess/NetworkConnectionToWebProcess.h:
1386         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1387         * NetworkProcess/NetworkDataTask.cpp:
1388         (WebKit::NetworkDataTask::create):
1389         * NetworkProcess/NetworkLoadParameters.h:
1390         * NetworkProcess/NetworkProcess.cpp:
1391         (WebKit::NetworkProcess::preconnectTo):
1392         * NetworkProcess/NetworkProcess.h:
1393         * NetworkProcess/NetworkProcess.messages.in:
1394         * NetworkProcess/PreconnectTask.cpp: Added.
1395         (WebKit::PreconnectTask::PreconnectTask):
1396         (WebKit::PreconnectTask::~PreconnectTask):
1397         (WebKit::PreconnectTask::willPerformHTTPRedirection):
1398         (WebKit::PreconnectTask::didReceiveChallenge):
1399         (WebKit::PreconnectTask::didReceiveResponseNetworkSession):
1400         (WebKit::PreconnectTask::didReceiveData):
1401         (WebKit::PreconnectTask::didCompleteWithError):
1402         (WebKit::PreconnectTask::didSendData):
1403         (WebKit::PreconnectTask::wasBlocked):
1404         (WebKit::PreconnectTask::cannotShowURL):
1405         (WebKit::PreconnectTask::didFinish):
1406         * NetworkProcess/PreconnectTask.h: Copied from Source/WebKit/NetworkProcess/NetworkLoadParameters.h.
1407         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
1408         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1409         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
1410         * Shared/WebCoreArgumentCoders.h:
1411         * Shared/WebPreferencesDefinitions.h:
1412         * UIProcess/API/C/WKContext.cpp:
1413         (WKContextPreconnectToServer):
1414         * UIProcess/API/C/WKContextPrivate.h:
1415         * UIProcess/API/Cocoa/WKProcessPool.mm:
1416         (-[WKProcessPool _preconnectToServer:]):
1417         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1418         * UIProcess/WebProcessPool.cpp:
1419         (WebKit::WebProcessPool::preconnectToServer):
1420         * UIProcess/WebProcessPool.h:
1421         * WebKit.xcodeproj/project.pbxproj:
1422         * WebProcess/Network/NetworkProcessConnection.cpp:
1423         (WebKit::NetworkProcessConnection::didFinishPreconnection):
1424         * WebProcess/Network/NetworkProcessConnection.h:
1425         * WebProcess/Network/NetworkProcessConnection.messages.in:
1426         * WebProcess/Network/WebLoaderStrategy.cpp:
1427         (WebKit::WebLoaderStrategy::networkProcessCrashed):
1428         (WebKit::generateLoadIdentifier):
1429         (WebKit::WebLoaderStrategy::startPingLoad):
1430         (WebKit::WebLoaderStrategy::preconnectTo):
1431         (WebKit::WebLoaderStrategy::didFinishPreconnection):
1432         * WebProcess/Network/WebLoaderStrategy.h:
1433         * WebProcess/WebPage/WebPage.cpp:
1434         (WebKit::WebPage::updatePreferences):
1435         * config.h:
1436
1437 2017-09-28  Zan Dobersek  <zdobersek@igalia.com>
1438
1439         [Cairo] Remove the cairo_glyph_t complexity from GlyphBuffer
1440         https://bugs.webkit.org/show_bug.cgi?id=177598
1441
1442         Reviewed by Carlos Garcia Campos.
1443
1444         * Shared/API/c/cairo/WKImageCairo.cpp: Explicitly include the <cairo.h>
1445         header here now that it's not included in GlyphBuffer.h.
1446         * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp: Ditto.
1447
1448 2017-09-27  Alex Christensen  <achristensen@webkit.org>
1449
1450         Add WKContentRuleList notify action type
1451         https://bugs.webkit.org/show_bug.cgi?id=177013
1452         <rdar://problem/31073936>
1453
1454         Reviewed by Darin Adler.
1455
1456         * NetworkProcess/PingLoad.cpp:
1457         (WebKit::PingLoad::processContentExtensionRulesForLoad):
1458         * UIProcess/API/APINavigationClient.h:
1459         (API::NavigationClient::contentRuleListNotification):
1460         * UIProcess/API/C/WKPage.cpp:
1461         (WKPageSetPageNavigationClient):
1462         * UIProcess/API/C/WKPageNavigationClient.h:
1463         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
1464         * UIProcess/Cocoa/NavigationState.h:
1465         * UIProcess/Cocoa/NavigationState.mm:
1466         (WebKit::NavigationState::setNavigationDelegate):
1467         (WebKit::NavigationState::NavigationClient::contentRuleListNotification):
1468         * UIProcess/WebPageProxy.cpp:
1469         (WebKit::WebPageProxy::contentRuleListNotification):
1470         * UIProcess/WebPageProxy.h:
1471         * UIProcess/WebPageProxy.messages.in:
1472         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1473         (WebKit::WebChromeClient::contentRuleListNotification):
1474         * WebProcess/WebCoreSupport/WebChromeClient.h:
1475
1476 2017-09-27  Wenson Hsieh  <wenson_hsieh@apple.com>
1477
1478         Drag event DataTransfer has unexpected types "dyn.ah62d4..."
1479         https://bugs.webkit.org/show_bug.cgi?id=172526
1480         <rdar://problem/32396081>
1481
1482         Reviewed by Ryosuke Niwa.
1483
1484         Add boilerplate plumbing and encoder/decoder support for new pasteboard codepaths. See WebCore ChangeLog for
1485         more details.
1486
1487         * Scripts/webkit/messages.py:
1488         (headers_for_type):
1489         * Shared/WebCoreArgumentCoders.cpp:
1490         (IPC::ArgumentCoder<PasteboardCustomData>::encode):
1491         (IPC::ArgumentCoder<PasteboardCustomData>::decode):
1492
1493         Add encoder/decoder support for PasteboardCustomData.
1494
1495         (IPC::ArgumentCoder<PasteboardWebContent>::encode):
1496         (IPC::ArgumentCoder<PasteboardWebContent>::decode):
1497
1498         Encode and decode dataInHTMLFormat.
1499
1500         * Shared/WebCoreArgumentCoders.h:
1501         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
1502         (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
1503         (WebKit::WebPasteboardProxy::writeCustomData):
1504         * UIProcess/WebPasteboardProxy.cpp:
1505         (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
1506         (WebKit::WebPasteboardProxy::writeCustomData):
1507         * UIProcess/WebPasteboardProxy.h:
1508         * UIProcess/WebPasteboardProxy.messages.in:
1509         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1510         (WebKit::WebPlatformStrategies::typesSafeForDOMToReadAndWrite):
1511         (WebKit::WebPlatformStrategies::writeCustomData):
1512         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
1513
1514 2017-09-27  Alex Christensen  <achristensen@webkit.org>
1515
1516         Allow modern decoding of std::optional<T>
1517         https://bugs.webkit.org/show_bug.cgi?id=177519
1518
1519         Reviewed by Tim Horton.
1520
1521         * Platform/IPC/ArgumentCoders.h:
1522         (IPC::ArgumentCoder<std::optional<T>>::decode):
1523         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
1524         (IPC::ArgumentCoder<WebCore::PaymentAuthorizationResult>::decode):
1525         (IPC::ArgumentCoder<WebCore::PaymentError>::decode):
1526         (IPC::ArgumentCoder<WebCore::PaymentMethodUpdate>::decode):
1527         (IPC::ArgumentCoder<WebCore::ShippingContactUpdate>::decode):
1528         (IPC::ArgumentCoder<WebCore::ShippingMethodUpdate>::decode):
1529         * Shared/WebCoreArgumentCoders.cpp:
1530         (IPC::ArgumentCoder<IntPoint>::decode):
1531         (IPC::ArgumentCoder<IntSize>::decode):
1532         * Shared/WebCoreArgumentCoders.h:
1533         * Shared/WebPageCreationParameters.cpp:
1534         (WebKit::WebPageCreationParameters::decode):
1535
1536 2017-09-27  Commit Queue  <commit-queue@webkit.org>
1537
1538         Unreviewed, rolling out r222541.
1539         https://bugs.webkit.org/show_bug.cgi?id=177580
1540
1541         WebCore isn't ready for the asynchronousness this was going to
1542         enable (Requested by alexchristensen on #webkit).
1543
1544         Reverted changeset:
1545
1546         "Pass a completion handler instead of a
1547         WebFramePolicyListenerProxy during policy decisions"
1548         https://bugs.webkit.org/show_bug.cgi?id=177509
1549         http://trac.webkit.org/changeset/222541
1550
1551 2017-09-27  Tina Liu  <iting_liu@apple.com>
1552
1553         Expose setShouldSuppressFirstResponderChanges() as WKView SPI
1554         https://bugs.webkit.org/show_bug.cgi?id=177513
1555         <rdar://problem/34669220>
1556
1557         Reviewed by Wenson Hsieh.
1558
1559         We already have setShouldSuppressFirstResponderChanges() SPI on WKWebView; Expose it on
1560         WKView as well for clients using legacy WebKit.
1561
1562         * UIProcess/API/Cocoa/WKViewPrivate.h:
1563         * UIProcess/API/mac/WKView.mm:
1564         (-[WKView _setShouldSuppressFirstResponderChanges:]):
1565
1566 2017-09-27  Chris Dumez  <cdumez@apple.com>
1567
1568         Have PingLoad take a CompletionHandler
1569         https://bugs.webkit.org/show_bug.cgi?id=177549
1570
1571         Reviewed by Youenn Fablet.
1572
1573         Have PingLoad take a CompletionHandler instead of relying on it calling on method on the
1574         NetworkConnectionToWebProcess when it is done.
1575
1576         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1577         (WebKit::NetworkConnectionToWebProcess::loadPing):
1578         * NetworkProcess/PingLoad.cpp:
1579         (WebKit::PingLoad::PingLoad):
1580         (WebKit::PingLoad::didFinish):
1581         * NetworkProcess/PingLoad.h:
1582
1583 2017-09-26  Alex Christensen  <achristensen@webkit.org>
1584
1585         Pass a completion handler instead of a WebFramePolicyListenerProxy during policy decisions
1586         https://bugs.webkit.org/show_bug.cgi?id=177509
1587
1588         Reviewed by Tim Horton.
1589
1590         This makes WebFramePolicyListenerProxy just a wrapper around a WTF::Function which is only needed for the C and glib APIs.
1591         This is a step towards making WebPageProxy::DecidePolicyForResponseSync and WebPageProxy::DecidePolicyForNavigationAction asynchronous.
1592
1593         This patch has no change in behavior.
1594
1595         * CMakeLists.txt:
1596         * UIProcess/API/APINavigationClient.h:
1597         (API::NavigationClient::decidePolicyForNavigationAction):
1598         (API::NavigationClient::decidePolicyForNavigationResponse):
1599         * UIProcess/API/APIPolicyClient.h:
1600         (API::PolicyClient::decidePolicyForNavigationAction):
1601         (API::PolicyClient::decidePolicyForNewWindowAction):
1602         (API::PolicyClient::decidePolicyForResponse):
1603         * UIProcess/API/C/WKFramePolicyListener.cpp:
1604         (WKFramePolicyListenerUseWithPolicies):
1605         * UIProcess/API/C/WKPage.cpp:
1606         (WKPageSetPagePolicyClient):
1607         (WKPageSetPageNavigationClient):
1608         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
1609         * UIProcess/API/glib/WebKitPolicyClient.cpp:
1610         * UIProcess/Automation/WebAutomationSession.cpp:
1611         * UIProcess/Cocoa/NavigationState.h:
1612         * UIProcess/Cocoa/NavigationState.mm:
1613         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
1614         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse):
1615         * UIProcess/Cocoa/WebViewImpl.mm:
1616         * UIProcess/RemoteWebInspectorProxy.cpp:
1617         * UIProcess/WebFormSubmissionListenerProxy.h:
1618         * UIProcess/WebFrameListenerProxy.cpp: Removed.
1619         * UIProcess/WebFrameListenerProxy.h: Removed.
1620         * UIProcess/WebFramePolicyListenerProxy.cpp:
1621         (WebKit::WebFramePolicyListenerProxy::WebFramePolicyListenerProxy):
1622         (WebKit::WebFramePolicyListenerProxy::~WebFramePolicyListenerProxy):
1623         (WebKit::WebFramePolicyListenerProxy::create):
1624         (WebKit::WebFramePolicyListenerProxy::use):
1625         (WebKit::WebFramePolicyListenerProxy::download):
1626         (WebKit::WebFramePolicyListenerProxy::ignore):
1627         * UIProcess/WebFramePolicyListenerProxy.h:
1628         (WebKit::WebFramePolicyListenerProxy::create): Deleted.
1629         (): Deleted.
1630         (WebKit::WebFramePolicyListenerProxy::operator new): Deleted.
1631         * UIProcess/WebFrameProxy.cpp:
1632         (WebKit::WebFrameProxy::webProcessWillShutDown):
1633         (WebKit::WebFrameProxy::receivedPolicyDecision): Deleted.
1634         (WebKit::WebFrameProxy::setUpPolicyListenerProxy): Deleted.
1635         * UIProcess/WebFrameProxy.h:
1636         * UIProcess/WebInspectorProxy.cpp:
1637         * UIProcess/WebPageProxy.cpp:
1638         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1639         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
1640         (WebKit::WebPageProxy::decidePolicyForResponseSync):
1641         (WebKit::WebPageProxy::receivedPolicyDecision): Deleted.
1642         (WebKit::WebPageProxy::decidePolicyForResponse): Deleted.
1643         * UIProcess/WebPageProxy.h:
1644         * UIProcess/mac/ViewGestureControllerMac.mm:
1645         * WebKit.xcodeproj/project.pbxproj:
1646
1647 2017-09-26  Brian Burg  <bburg@apple.com>
1648
1649         Web Automation: overflow:hidden elements with no children are mistakenly reported as not visible
1650         https://bugs.webkit.org/show_bug.cgi?id=177514
1651         <rdar://problem/31936291>
1652
1653         Reviewed by Joseph Pecoraro.
1654
1655         * UIProcess/Automation/atoms/ElementDisplayed.js:
1656         (isShown.isElementSubtreeHiddenByOverflow):
1657         Array.prototype.every returns true when passed an empty list, so we need
1658         to check for the case where the element has no children and return 'false'.
1659
1660 2017-09-26  Youenn Fablet  <youenn@apple.com>
1661
1662         [Cocoa] Add a modern WKPreferences switch to disable WebRTC
1663         https://bugs.webkit.org/show_bug.cgi?id=176638
1664         <rdar://problem/34335158>
1665
1666         Reviewed by Alex Christensen.
1667
1668         * UIProcess/API/Cocoa/WKPreferences.mm:
1669         (-[WKPreferences _peerConnectionEnabled]):
1670         (-[WKPreferences _setPeerConnectionEnabled:]):
1671         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1672
1673 2017-09-26  Brent Fulgham  <bfulgham@apple.com>
1674
1675         Harden our access to the vector of URL schemes.
1676         https://bugs.webkit.org/show_bug.cgi?id=177470
1677         <rdar://problem/33881522>
1678
1679         Reviewed by Chris Dumez.
1680
1681         Instead of asserting, use MESSAGE_CHECK so that we actually refuse to access an invalid iterator.
1682
1683         * UIProcess/WebPageProxy.cpp:
1684         (WebKit::WebPageProxy::startURLSchemeTask):
1685         (WebKit::WebPageProxy::stopURLSchemeTask):
1686
1687 2017-09-26  Jer Noble  <jer.noble@apple.com>
1688
1689         Thrown ObjC exception when right clicking on <img> containing mp4 link
1690         https://bugs.webkit.org/show_bug.cgi?id=177370
1691
1692         Reviewed by Darin Adler.
1693
1694         Creating a NSImage from mp4 data will fail and return nil; do a nil-check before attempting
1695         to put the results into a NSMutableArray.
1696
1697         * UIProcess/mac/WebContextMenuProxyMac.mm:
1698         (WebKit::WebContextMenuProxyMac::createShareMenuItem):
1699
1700 2017-09-26  Brian Burg  <bburg@apple.com>
1701
1702         Web Automation: add commands to get and set user permissions for pages in an automation session
1703         https://bugs.webkit.org/show_bug.cgi?id=177405
1704         <rdar://problem/34493846>
1705
1706         Reviewed by Joseph Pecoraro.
1707
1708         To test some Web APIs via WebDriver, it needs to be possible to simulate a user accepting or
1709         denying requests for elevated permissions, such as getUserMedia() or geolocation.
1710
1711         This patch adds a generic way for a test to configure the automation session's
1712         simulated user action that will happen every time a specific permission is requested.
1713         A test can set a "session permission", trigger the permission request via Web API,
1714         and then verify that the page behaves correctly when the user accepted or denied the request.
1715
1716         A proposal will follow shortly to expose this functionality via a new REST API endpoint.
1717
1718         * UIProcess/Automation/Automation.json: Add get/set commands.
1719
1720         * UIProcess/Automation/WebAutomationSession.cpp:
1721         (WebKit::WebAutomationSession::getSessionPermissions):
1722         (WebKit::WebAutomationSession::setSessionPermissions):
1723         For now, store the permission value in a member of the session. The getUserMedia
1724         permission only needs a bool, but there is no reason we couldn't use more complicated
1725         values for permissions (i.e., strings, numbers, arrays, objects) someday.
1726
1727         (WebKit::WebAutomationSession::shouldAllowGetUserMediaForPage const):
1728         Expose the specific decision to be taken based on whether the request is allowed or denied.
1729
1730         * UIProcess/Automation/WebAutomationSession.h:
1731         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1732         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
1733         If the page is under automation, then simulate the user action according to the
1734         current values of permissions set for the session.
1735
1736 2017-09-25  Alex Christensen  <achristensen@webkit.org>
1737
1738         Make PolicyAction an encodable enum class
1739         https://bugs.webkit.org/show_bug.cgi?id=177480
1740
1741         Reviewed by Antti Koivisto.
1742
1743         * NetworkProcess/Downloads/DownloadManager.cpp:
1744         (WebKit::DownloadManager::continueDecidePendingDownloadDestination):
1745         (WebKit::DownloadManager::cancelDownload):
1746         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
1747         (WebKit::NetworkCORSPreflightChecker::didReceiveResponseNetworkSession):
1748         * NetworkProcess/NetworkDataTask.cpp:
1749         (WebKit::NetworkDataTask::didReceiveResponse):
1750         * NetworkProcess/NetworkDataTaskBlob.cpp:
1751         (WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse):
1752         * NetworkProcess/NetworkLoad.cpp:
1753         (WebKit::NetworkLoad::~NetworkLoad):
1754         (WebKit::NetworkLoad::continueDidReceiveResponse):
1755         (WebKit::NetworkLoad::notifyDidReceiveResponse):
1756         * NetworkProcess/PingLoad.cpp:
1757         (WebKit::PingLoad::didReceiveResponseNetworkSession):
1758         * NetworkProcess/capture/NetworkDataTaskReplay.cpp:
1759         (WebKit::NetworkCapture::NetworkDataTaskReplay::didReceiveResponse):
1760         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1761         (toNSURLSessionResponseDisposition):
1762         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1763         (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse):
1764         * Scripts/webkit/messages.py:
1765         (headers_for_type):
1766         * UIProcess/WebFormSubmissionListenerProxy.h:
1767         * UIProcess/WebFrameListenerProxy.h:
1768         (WebKit::WebFrameListenerProxy::navigation): Deleted.
1769         * UIProcess/WebFramePolicyListenerProxy.cpp:
1770         (WebKit::WebFramePolicyListenerProxy::use):
1771         (WebKit::WebFramePolicyListenerProxy::download):
1772         (WebKit::WebFramePolicyListenerProxy::ignore):
1773         * UIProcess/WebPageProxy.cpp:
1774         (WebKit::WebPageProxy::receivedPolicyDecision):
1775         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1776         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1777         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
1778         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
1779         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1780         * WebProcess/WebPage/WebFrame.cpp:
1781         (WebKit::WebFrame::invalidatePolicyListener):
1782         * WebProcess/WebPage/WebPage.cpp:
1783         (WebKit::WebPage::didReceivePolicyDecision):
1784         * WebProcess/WebPage/WebPage.h:
1785         * WebProcess/WebPage/WebPage.messages.in:
1786
1787 2017-09-25  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
1788
1789         [WinCairo] Share default value of font family preferences among non-cocoa builds
1790         https://bugs.webkit.org/show_bug.cgi?id=177479
1791
1792         Reviewed by Yusuke Suzuki.
1793
1794         * Shared/WebPreferencesDefinitions.h:
1795
1796 2017-09-25  Frederik Riedel  <riedel@apple.com>
1797
1798         Expose way to set values of classified form controls as {Legacy WebKit, WebKit} SPI
1799         https://bugs.webkit.org/show_bug.cgi?id=174394
1800         <rdar://problem/33183504>
1801
1802         Reviewed by Ryosuke Niwa.
1803
1804         * Platform/spi/ios/UIKitSPI.h:
1805         * Shared/AssistedNodeInformation.cpp:
1806         (WebKit::AssistedNodeInformation::encode const):
1807         Encodes additional node information, including if the node is part of a login screen.
1808         (WebKit::AssistedNodeInformation::decode):
1809         Decodes the additional assisted node information.
1810         * Shared/AssistedNodeInformation.h:
1811         * UIProcess/WebPageProxy.h:
1812         * UIProcess/ios/WKContentView.mm:
1813         (-[WKContentView acceptsAutofilledLoginCredentials]):
1814         Determines if the WKContentView shows a login screen.
1815         (-[WKContentView representingPageUrl]):
1816         Returns the URL of the currently displayed web page.
1817         * UIProcess/ios/WKContentViewInteraction.mm:
1818         (-[WKContentView insertTextSuggestion:]):
1819         Inserts the login credentials into the Web View.
1820         * UIProcess/ios/WebPageProxyIOS.mm:
1821         (WebKit::WebPageProxy::startAssistingNode):
1822         Transfer the additional assistednode information (acceptsAutofilledLoginCredentials and representingPageUrl).
1823         (WebKit::WebPageProxy::acceptsAutofilledLoginCredentials):
1824         Returns if the Web View shows a login screen.
1825         (WebKit::WebPageProxy::representingPageUrl):
1826         Returns the Web View's URL.
1827         (WebKit::WebPageProxy::autofillLoginCredentials):
1828         Insert the credentials into the Web View.
1829         * WebProcess/WebPage/WebPage.h:
1830         * WebProcess/WebPage/WebPage.messages.in:
1831         * WebProcess/WebPage/ios/WebPageIOS.mm:
1832         (WebKit::WebPage::getAssistedNodeInformation): Transports the information if the currently
1833         highlighted node accepts autofilled login credentials.
1834         (WebKit::WebPage::autofillLoginCredentials): Fills the login credentials into the
1835         WebPage.
1836
1837 2017-09-25  Youenn Fablet  <youenn@apple.com>
1838
1839         WebRTC video does not resume receiving when switching back to Safari 11 on iOS
1840         https://bugs.webkit.org/show_bug.cgi?id=175472
1841         <rdar://problem/33860863>
1842
1843         Reviewed by Darin Adler.
1844
1845         Notifying LibWebRTC of backgrounding/foregrouding.
1846
1847         * WebProcess/WebPage/ios/WebPageIOS.mm:
1848         (WebKit::WebPage::applicationDidEnterBackground):
1849         (WebKit::WebPage::applicationWillEnterForeground):
1850
1851 2017-09-25  Sam Weinig  <sam@webkit.org>
1852
1853         Remove unused EditorClient functions
1854         https://bugs.webkit.org/show_bug.cgi?id=177463
1855
1856         Reviewed by Alex Christensen.
1857
1858         Remove unused EditorClient functions.
1859
1860         * WebProcess/WebCoreSupport/WebEditorClient.h:
1861         * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
1862         (WebKit::WebEditorClient::canonicalizeURL): Deleted.
1863         (WebKit::WebEditorClient::canonicalizeURLString): Deleted.
1864         (WebKit::WebEditorClient::writeDataToPasteboard): Deleted.
1865         (WebKit::WebEditorClient::supportedPasteboardTypesForCurrentSelection): Deleted.
1866         (WebKit::WebEditorClient::readDataFromPasteboard): Deleted.
1867         (WebKit::WebEditorClient::pasteboardChangeCount): Deleted.
1868         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
1869         (WebKit::WebEditorClient::canonicalizeURL): Deleted.
1870         (WebKit::WebEditorClient::canonicalizeURLString): Deleted.
1871
1872 2017-09-25  Alex Christensen  <achristensen@webkit.org>
1873
1874         Make Attribute an enum class
1875         https://bugs.webkit.org/show_bug.cgi?id=177414
1876
1877         Reviewed by Yusuke Suzuki.
1878
1879         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
1880         (WebKit::JSNPObject::getOwnPropertySlot):
1881
1882 2017-09-25  Alex Christensen  <achristensen@webkit.org>
1883
1884         Stop using PolicyCallback
1885         https://bugs.webkit.org/show_bug.cgi?id=176088
1886
1887         Reviewed by Andy Estes.
1888
1889         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1890         * WebProcess/WebPage/WebFrame.cpp:
1891         (WebKit::WebFrame::invalidatePolicyListener):
1892         * WebProcess/WebPage/WebFrame.h:
1893         * WebProcess/WebPage/WebInspector.cpp:
1894
1895 2017-09-25  Chris Dumez  <cdumez@apple.com>
1896
1897         [WK2] Add API to query if a download was user-initiated
1898         https://bugs.webkit.org/show_bug.cgi?id=177435
1899         <rdar://problem/34498422>
1900
1901         Reviewed by Alex Christensen.
1902
1903         Add C and Cocoa private API to query if a download was user-initiated.
1904
1905         For clarity, we now construct navigation object for subframe loads
1906         as well (we used to do so only for main frame loads). This allows us
1907         to store the user-intiated flag and the redirect chain on the navigation
1908         object instead of the WebFrameProxy.
1909
1910         * UIProcess/API/APINavigation.cpp:
1911         (API::Navigation::Navigation):
1912         (API::Navigation::appendRedirectionURL):
1913         * UIProcess/API/APINavigation.h:
1914         (API::Navigation::takeRedirectChain):
1915         (API::Navigation::setWasUserInitiated):
1916         (API::Navigation::wasUserInitiated const):
1917         * UIProcess/API/C/WKDownload.cpp:
1918         (WKDownloadGetWasUserInitiated):
1919         * UIProcess/API/C/WKDownload.h:
1920         * UIProcess/API/Cocoa/_WKDownload.h:
1921         * UIProcess/API/Cocoa/_WKDownload.mm:
1922         (-[_WKDownload wasUserInitiated]):
1923         * UIProcess/Downloads/DownloadProxy.h:
1924         (WebKit::DownloadProxy::setWasUserInitiated):
1925         (WebKit::DownloadProxy::wasUserInitiated const):
1926         * UIProcess/WebFrameProxy.cpp:
1927         (WebKit::WebFrameProxy::didStartProvisionalLoad):
1928         (WebKit::WebFrameProxy::didReceiveServerRedirectForProvisionalLoad):
1929         (WebKit::WebFrameProxy::didFailProvisionalLoad):
1930         (WebKit::WebFrameProxy::didFinishLoad):
1931         (WebKit::WebFrameProxy::didFailLoad):
1932         * UIProcess/WebFrameProxy.h:
1933         (WebKit::WebFrameProxy::title const):
1934         * UIProcess/WebPageProxy.cpp:
1935         (WebKit::WebPageProxy::receivedPolicyDecision):
1936         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
1937         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1938         (WebKit::WebPageProxy::decidePolicyForResponse):
1939         (WebKit::WebPageProxy::decidePolicyForResponseSync):
1940         * UIProcess/WebPageProxy.h:
1941         * UIProcess/WebPageProxy.messages.in:
1942         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1943         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
1944
1945 2017-09-25  Chris Dumez  <cdumez@apple.com>
1946
1947         Make StoredCredentials an enum class and rename its header
1948         https://bugs.webkit.org/show_bug.cgi?id=177455
1949
1950         Reviewed by Youenn Fablet.
1951
1952         Make StoredCredentials an enum class and rename its header for clarity. This was error-prone because 0 meant
1953         "allow" and and 1 meant "do not allow". It was trivial to convert it to a boolean by mistake and get the
1954         opposite behavior.
1955
1956         * NetworkProcess/Downloads/DownloadManager.cpp:
1957         (WebKit::DownloadManager::startDownload):
1958         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
1959         (WebKit::NetworkCORSPreflightChecker::didCompleteWithError):
1960         * NetworkProcess/NetworkCORSPreflightChecker.h:
1961         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1962         (WebKit::NetworkConnectionToWebProcess::loadPing):
1963         * NetworkProcess/NetworkDataTask.cpp:
1964         (WebKit::NetworkDataTask::create):
1965         (WebKit::NetworkDataTask::NetworkDataTask):
1966         * NetworkProcess/NetworkDataTask.h:
1967         * NetworkProcess/NetworkDataTaskBlob.cpp:
1968         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
1969         * NetworkProcess/NetworkLoad.cpp:
1970         (WebKit::NetworkLoad::shouldUseCredentialStorage):
1971         * NetworkProcess/NetworkLoadParameters.h:
1972         * NetworkProcess/NetworkResourceLoadParameters.cpp:
1973         (WebKit::NetworkResourceLoadParameters::encode const):
1974         (WebKit::NetworkResourceLoadParameters::decode):
1975         * NetworkProcess/PingLoad.cpp:
1976         (WebKit::PingLoad::willPerformHTTPRedirection):
1977         (WebKit::PingLoad::makeCrossOriginAccessRequest):
1978         (WebKit::PingLoad::makeSimpleCrossOriginAccessRequest):
1979         (WebKit::PingLoad::makeCrossOriginAccessRequestWithPreflight):
1980         (WebKit::PingLoad::preflightSuccess):
1981         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
1982         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
1983         * NetworkProcess/capture/NetworkDataTaskReplay.cpp:
1984         (WebKit::NetworkCapture::NetworkDataTaskReplay::NetworkDataTaskReplay):
1985         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
1986         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1987         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
1988         (WebKit::NetworkDataTaskCocoa::~NetworkDataTaskCocoa):
1989         (WebKit::NetworkDataTaskCocoa::tryPasswordBasedAuthentication):
1990         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
1991         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1992         (-[WKNetworkSessionDelegate existingTask:]):
1993         (WebKit::NetworkSessionCocoa::dataTaskForIdentifier):
1994         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1995         (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
1996         (WebKit::NetworkDataTaskSoup::createRequest):
1997         (WebKit::NetworkDataTaskSoup::authenticate):
1998         (WebKit::NetworkDataTaskSoup::continueAuthenticate):
1999         (WebKit::NetworkDataTaskSoup::continueHTTPRedirection):
2000         * NetworkProcess/soup/NetworkDataTaskSoup.h:
2001         * WebProcess/Network/WebLoaderStrategy.cpp:
2002         (WebKit::WebLoaderStrategy::scheduleLoad):
2003         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
2004         (WebKit::WebLoaderStrategy::startPingLoad):
2005         * WebProcess/Network/WebLoaderStrategy.h:
2006
2007 2017-09-25  Sam Weinig  <sam@webkit.org>
2008
2009         Remove unnecessary userVisibleString EditorClient function
2010         https://bugs.webkit.org/show_bug.cgi?id=177456
2011
2012         Reviewed by Dan Bernstein.
2013
2014         * WebProcess/WebCoreSupport/WebEditorClient.h:
2015         * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
2016         (WebKit::WebEditorClient::userVisibleString): Deleted.
2017         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
2018         (WebKit::WebEditorClient::userVisibleString): Deleted.
2019
2020             Remove userVisibleString client function.
2021
2022 2017-09-25  Commit Queue  <commit-queue@webkit.org>
2023
2024         Unreviewed, rolling out r222455.
2025         https://bugs.webkit.org/show_bug.cgi?id=177460
2026
2027         broke iOS build (Requested by alexchristensen on #webkit).
2028
2029         Reverted changeset:
2030
2031         "Add WKContentRuleList notify action type"
2032         https://bugs.webkit.org/show_bug.cgi?id=177013
2033         http://trac.webkit.org/changeset/222455
2034
2035 2017-09-25  Alex Christensen  <achristensen@webkit.org>
2036
2037         Separate form submission from PolicyChecker infrastructure
2038         https://bugs.webkit.org/show_bug.cgi?id=177396
2039
2040         Reviewed by Geoffrey Garen.
2041
2042         * UIProcess/API/APIFormClient.h:
2043         (API::FormClient::willSubmitForm):
2044         * UIProcess/API/Cocoa/WKWebView.mm:
2045         (-[WKWebView _setInputDelegate:]):
2046         * UIProcess/WebFormClient.cpp:
2047         (WebKit::WebFormClient::willSubmitForm):
2048         * UIProcess/WebFormClient.h:
2049         * UIProcess/WebFormSubmissionListenerProxy.cpp:
2050         (WebKit::WebFormSubmissionListenerProxy::continueSubmission):
2051         (WebKit::WebFormSubmissionListenerProxy::WebFormSubmissionListenerProxy): Deleted.
2052         * UIProcess/WebFormSubmissionListenerProxy.h:
2053         (WebKit::WebFormSubmissionListenerProxy::create):
2054         (WebKit::WebFormSubmissionListenerProxy::WebFormSubmissionListenerProxy):
2055         (): Deleted.
2056         (WebKit::WebFormSubmissionListenerProxy::operator new): Deleted.
2057         * UIProcess/WebFrameProxy.cpp:
2058         (WebKit::WebFrameProxy::setUpFormSubmissionListenerProxy): Deleted.
2059         * UIProcess/WebFrameProxy.h:
2060         * UIProcess/WebPageProxy.cpp:
2061         (WebKit::WebPageProxy::willSubmitForm):
2062         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2063         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
2064         (WebKit::WebFrameLoaderClient::dispatchWillSubmitForm):
2065         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2066         * WebProcess/WebPage/WebFrame.cpp:
2067         (WebKit::WebFrame::setUpWillSubmitFormListener):
2068         (WebKit::WebFrame::continueWillSubmitForm):
2069         * WebProcess/WebPage/WebFrame.h:
2070         * WebProcess/WebPage/WebPage.cpp:
2071         (WebKit::WebPage::continueWillSubmitForm):
2072         * WebProcess/WebPage/WebPage.h:
2073         * WebProcess/WebPage/WebPage.messages.in:
2074
2075 2017-09-25  Alex Christensen  <achristensen@webkit.org>
2076
2077         Add WKContentRuleList notify action type
2078         https://bugs.webkit.org/show_bug.cgi?id=177013
2079         <rdar://problem/31073936>
2080
2081         Reviewed by Darin Adler.
2082
2083         * NetworkProcess/PingLoad.cpp:
2084         (WebKit::PingLoad::processContentExtensionRulesForLoad):
2085         * UIProcess/API/APINavigationClient.h:
2086         (API::NavigationClient::contentRuleListNotification):
2087         * UIProcess/API/C/WKPage.cpp:
2088         (WKPageSetPageNavigationClient):
2089         * UIProcess/API/C/WKPageNavigationClient.h:
2090         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
2091         * UIProcess/Cocoa/NavigationState.h:
2092         * UIProcess/Cocoa/NavigationState.mm:
2093         (WebKit::NavigationState::setNavigationDelegate):
2094         (WebKit::NavigationState::NavigationClient::contentRuleListNotification):
2095         * UIProcess/WebPageProxy.cpp:
2096         (WebKit::WebPageProxy::contentRuleListNotification):
2097         * UIProcess/WebPageProxy.h:
2098         * UIProcess/WebPageProxy.messages.in:
2099         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2100         (WebKit::WebChromeClient::contentRuleListNotification):
2101         * WebProcess/WebCoreSupport/WebChromeClient.h:
2102
2103 2017-09-25  Timothy Horton  <timothy_horton@apple.com>
2104
2105         Make progress on getting Mac CMake building again
2106         https://bugs.webkit.org/show_bug.cgi?id=177443
2107
2108         Unreviewed, just "fixing" the build.
2109
2110         * PlatformMac.cmake:
2111         Add some missing files and include paths.
2112
2113 2017-09-24  Michael Catanzaro  <mcatanzaro@igalia.com>
2114
2115         Viewport fit is no longer experimental
2116         https://bugs.webkit.org/show_bug.cgi?id=177417
2117
2118         Reviewed by Darin Adler.
2119
2120         * Shared/WebPreferencesDefinitions.h:
2121
2122 2017-09-24  Michael Catanzaro  <mcatanzaro@igalia.com>
2123
2124         [GTK] Unreviewed, move webkit_hit_test_result_context_is_scrollbar in documentation
2125
2126         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
2127
2128 2017-09-24  Michael Catanzaro  <mcatanzaro@igalia.com>
2129
2130         Alphabetize experimental features list
2131         https://bugs.webkit.org/show_bug.cgi?id=177374
2132
2133         Reviewed by Darin Adler.
2134
2135         * Shared/WebPreferencesDefinitions.h:
2136
2137 2017-09-24  Zan Dobersek  <zdobersek@igalia.com>
2138
2139         [WebKit] Changing EME setting through InjectedBundle should update WebPreferencesStore
2140         https://bugs.webkit.org/show_bug.cgi?id=177312
2141
2142         Reviewed by Carlos Garcia Campos.
2143
2144         When enabling EME through the InjectedBundle for testing purposes, it's
2145         only enabled in RuntimeEnabledFeatures, but not in WebPreferencesStore.
2146         This causes failures on imported W3C tests that cover EME persistent
2147         state licenses and perform parts of that test in a new window, where
2148         the original RuntimeEnabledFeatures state doesn't have any effect.
2149
2150         To avoid those failures, when enabling EME feature for testing purposes
2151         through InjectedBundle, the feature should also be enabled in the
2152         WebPreferencesStore.
2153
2154         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2155         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2156
2157 2017-09-22  Zalan Bujtas  <zalan@apple.com>
2158
2159         WeakPtrFactory should populate m_ref lazily.
2160         https://bugs.webkit.org/show_bug.cgi?id=177375
2161
2162         Reviewed by Geoffrey Garen.
2163
2164         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
2165         (WebKit::WebPaymentCoordinatorProxy::WebPaymentCoordinatorProxy):
2166         (WebKit::WebPaymentCoordinatorProxy::canMakePaymentsWithActiveCard):
2167         (WebKit::WebPaymentCoordinatorProxy::openPaymentSetup):
2168         * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
2169         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
2170         * UIProcess/ApplicationStateTracker.mm:
2171         (WebKit::ApplicationStateTracker::ApplicationStateTracker):
2172         * UIProcess/Cocoa/WebViewImpl.h:
2173         (WebKit::WebViewImpl::createWeakPtr):
2174         * UIProcess/Cocoa/WebViewImpl.mm:
2175         (WebKit::WebViewImpl::WebViewImpl):
2176         * UIProcess/Launcher/ProcessLauncher.cpp:
2177         (WebKit::ProcessLauncher::ProcessLauncher):
2178         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2179         (WebKit::ProcessLauncher::launchProcess):
2180         * UIProcess/ProcessAssertion.h:
2181         (WebKit::ProcessAssertion::createWeakPtr):
2182         * UIProcess/WebPageProxy.cpp:
2183         (WebKit::m_configurationPreferenceValues):
2184         (WebKit::m_weakPtrFactory): Deleted.
2185         * UIProcess/WebPageProxy.h:
2186         (WebKit::WebPageProxy::createWeakPtr const):
2187         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
2188         (WebKit::RemoteLayerTreeDrawingArea::createWeakPtr):
2189         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
2190         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
2191
2192 2017-09-22  John Wilander  <wilander@apple.com>
2193
2194         Re-enable configuration.HTTPCookieStorage on session without credentials
2195         https://bugs.webkit.org/show_bug.cgi?id=177393
2196
2197         This patch rolls back the crucial change to the network session
2198         without credentials that landed in r221632:
2199         <http://trac.webkit.org/changeset/221632>
2200
2201         Reviewed by Brent Fulgham.
2202
2203         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2204         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
2205             Commented out the disabled cookie jar and added a FIXME
2206             referring to https://bugs.webkit.org/show_bug.cgi?id=177394.
2207
2208 2017-09-22  Chris Dumez  <cdumez@apple.com>
2209
2210         Enable File and Directory Entries API at runtime
2211         https://bugs.webkit.org/show_bug.cgi?id=176616
2212         <rdar://problem/34330942>
2213
2214         Reviewed by Geoffrey Garen.
2215
2216         Enable File and Directory Entries API at runtime on Mac/WebKit2,
2217         now that DataTransfer.items is enabled there.
2218
2219         * Shared/WebPreferencesDefinitions.h:
2220
2221 2017-09-22  Matt Lewis  <jlewis3@apple.com>
2222
2223         Unreviewed, rolling out r222394.
2224
2225         This broke the Windows Debug Build.
2226
2227         Reverted changeset:
2228
2229         "Remove build-webkit's notion of feature flags having a
2230         default value"
2231         https://bugs.webkit.org/show_bug.cgi?id=177338
2232         http://trac.webkit.org/changeset/222394
2233
2234 2017-09-22  John Wilander  <wilander@apple.com>
2235
2236         Non-prevalent resources should be allowed access to existing cookies in a third-party context
2237         https://bugs.webkit.org/show_bug.cgi?id=177336
2238         <rdar://problem/34578257>
2239
2240         Reviewed by Brent Fulgham.
2241
2242         This patch restructures what is communicated to the network process,
2243         from two vectors - with user interaction and without user interaction -
2244         to three vectors - to partition, to block, to neither partition nor block.
2245         The previous two vectors did not allow proper categorization into which
2246         domains should be partitioned, blocked, or left alone. That was the cause
2247         of the regression where non-prevalent third-party domains erroneously had
2248         their cookies blocked when they should fall back to the old behavior of
2249         access but no new cookies allowed to be set.
2250
2251         * NetworkProcess/NetworkProcess.cpp:
2252         (WebKit::NetworkProcess::updatePrevalentDomainsToPartitionOrBlockCookies):
2253         (WebKit::NetworkProcess::updatePrevalentDomainsWithAndWithoutInteraction): Deleted.
2254         * NetworkProcess/NetworkProcess.h:
2255         * NetworkProcess/NetworkProcess.messages.in:
2256         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2257         (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:]):
2258         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2259         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
2260         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
2261         (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains):
2262         (WebKit::WebResourceLoadStatisticsStore::clearInMemory):
2263         (WebKit::WebResourceLoadStatisticsStore::shouldPartitionCookies const):
2264         (WebKit::WebResourceLoadStatisticsStore::shouldBlockCookies const):
2265         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
2266         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains):
2267         (WebKit::WebResourceLoadStatisticsStore::clearPartitioningStateForDomains):
2268         (WebKit::WebResourceLoadStatisticsStore::resetCookiePartitioningState):
2269         * UIProcess/WebResourceLoadStatisticsStore.h:
2270         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2271         (WebKit::WebsiteDataStore::updatePrevalentDomainsToPartitionOrBlockCookies):
2272         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
2273         (WebKit::WebsiteDataStore::updatePrevalentDomainsWithAndWithoutInteraction): Deleted.
2274         * UIProcess/WebsiteData/WebsiteDataStore.h:
2275
2276 2017-09-22  Tim Horton <timothy_horton@apple.com> and Michael Catanzaro <mcatanzaro@igalia.com>
2277
2278         Remove build-webkit's notion of feature flags having a default value
2279         https://bugs.webkit.org/show_bug.cgi?id=177338
2280
2281         Reviewed by Alex Christensen.
2282
2283         Use ENABLE_EXPERIMENTAL_FEATURES instead of ENABLE_DEVELOPER_MODE to enable runtime
2284         experimental features.
2285
2286         * Shared/WebPreferencesDefinitions.h:
2287
2288 2017-09-22  Chris Dumez  <cdumez@apple.com>
2289
2290         Use high resolution timestamp for event time
2291         https://bugs.webkit.org/show_bug.cgi?id=154246
2292         <rdar://problem/34333304>
2293
2294         Reviewed by Ryosuke Niwa.
2295
2296         Use WallTime / MonotonicTime instead of double type for clarity.
2297
2298         * Shared/WebCoreArgumentCoders.cpp:
2299         (IPC::ArgumentCoder<WallTime>::encode):
2300         (IPC::ArgumentCoder<WallTime>::decode):
2301         * Shared/WebCoreArgumentCoders.h:
2302         * Shared/WebEvent.cpp:
2303         (WebKit::WebEvent::WebEvent):
2304         * Shared/WebEvent.h:
2305         (WebKit::WebEvent::timestamp const):
2306         (WebKit::WebTouchEvent::WebTouchEvent):
2307         * Shared/WebKeyboardEvent.cpp:
2308         (WebKit::WebKeyboardEvent::WebKeyboardEvent):
2309         * Shared/WebMouseEvent.cpp:
2310         (WebKit::WebMouseEvent::WebMouseEvent):
2311         * Shared/WebTouchEvent.cpp:
2312         (WebKit::WebTouchEvent::WebTouchEvent):
2313         * Shared/WebWheelEvent.cpp:
2314         (WebKit::WebWheelEvent::WebWheelEvent):
2315         * Shared/gtk/WebEventFactory.cpp:
2316         (WebKit::WebEventFactory::createWebMouseEvent):
2317         (WebKit::WebEventFactory::createWebWheelEvent):
2318         (WebKit::WebEventFactory::createWebKeyboardEvent):
2319         (WebKit::WebEventFactory::createWebTouchEvent):
2320         * Shared/ios/NativeWebTouchEventIOS.mm:
2321         (WebKit::NativeWebTouchEvent::NativeWebTouchEvent):
2322         * Shared/ios/WebIOSEventFactory.mm:
2323         (WebIOSEventFactory::createWebKeyboardEvent):
2324         * Shared/mac/NativeWebGestureEventMac.mm:
2325         (WebKit::NativeWebGestureEvent::NativeWebGestureEvent):
2326         * Shared/mac/WebEventFactory.mm:
2327         (WebKit::WebEventFactory::createWebMouseEvent):
2328         (WebKit::WebEventFactory::createWebWheelEvent):
2329         (WebKit::WebEventFactory::createWebKeyboardEvent):
2330         * Shared/mac/WebGestureEvent.h:
2331         (WebKit::WebGestureEvent::WebGestureEvent):
2332         * Shared/wpe/WebEventFactory.cpp:
2333         (WebKit::WebEventFactory::createWebKeyboardEvent):
2334         (WebKit::WebEventFactory::createWebMouseEvent):
2335         (WebKit::WebEventFactory::createWebWheelEvent):
2336         (WebKit::WebEventFactory::createWebTouchEvent):
2337         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2338         (WKBundlePageSimulateMouseDown):
2339         (WKBundlePageSimulateMouseUp):
2340         (WKBundlePageSimulateMouseMotion):
2341         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2342         (WebKit::PDFPlugin::showContextMenuAtPoint):
2343         * WebProcess/Plugins/PluginView.cpp:
2344         (WebKit::PluginView::createWebEvent const):
2345         * WebProcess/WebPage/WebPage.cpp:
2346         (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick):
2347         (WebKit::WebPage::contextMenuAtPointInWindow):
2348         (WebKit::WebPage::dragEnded):
2349         (WebKit::WebPage::simulateMouseDown):
2350         (WebKit::WebPage::simulateMouseUp):
2351         (WebKit::WebPage::simulateMouseMotion):
2352         * WebProcess/WebPage/WebPage.h:
2353         * WebProcess/WebPage/ios/WebPageIOS.mm:
2354         (WebKit::WebPage::handleSyntheticClick):
2355         (WebKit::WebPage::completeSyntheticClick):
2356         (WebKit::WebPage::requestAdditionalItemsForDragSession):
2357         (WebKit::WebPage::inspectorNodeSearchMovedToPosition):
2358
2359 2017-09-22  Fujii Hironori  <Hironori.Fujii@sony.com>
2360
2361         [GTK] Web Inspector: Can't load three.js
2362         https://bugs.webkit.org/show_bug.cgi?id=177340
2363
2364         Reviewed by Carlos Garcia Campos.
2365
2366         * PlatformGTK.cmake: Add JS files of three.js to InspectorFiles variable.
2367         * PlatformWPE.cmake: Ditto.
2368
2369 2017-09-21  Ryosuke Niwa  <rniwa@webkit.org>
2370
2371         Enable dataTransfer.items on macOS and iOS
2372         https://bugs.webkit.org/show_bug.cgi?id=177335
2373
2374         Reviewed by Sam Weinig.
2375
2376         * Shared/WebPreferencesDefinitions.h:
2377
2378 2017-09-21  Dan Bernstein  <mitz@apple.com>
2379
2380         Try to fix Apple internal builds with the iOS 11.0 SDK.
2381
2382         * Configurations/WebKit.xcconfig: Disable framework header postprocessing for iOS 11.0.
2383
2384 2017-09-21  Chris Dumez  <cdumez@apple.com>
2385
2386         Regression(r222308): new API tests are failing for !NETWORK_SESSION
2387         https://bugs.webkit.org/show_bug.cgi?id=177321
2388
2389         Reviewed by Alex Christensen.
2390
2391         When a load is redirected and then converted into a download, CFNetwork
2392         seems to call [NSURLDownloadDelegate willSendRequest:] on the download
2393         with a non-nil redirectResponse, which was unexpected.
2394
2395         To address the issue, we now ignore the willSendRequest call if the
2396         new request's URL is the same as the redirectResponse one.
2397
2398         * NetworkProcess/Downloads/mac/DownloadMac.mm:
2399         (-[WKDownloadAsDelegate download:willSendRequest:redirectResponse:]):
2400
2401 2017-09-21  Chris Dumez  <cdumez@apple.com>
2402
2403         Unreviewed, drop assertion added in r222308.
2404
2405         The assertion is hit by a couple of tests still but there is no bad effect
2406         to the vector not being empty at this point since we clear it right after.
2407
2408         * UIProcess/WebFrameProxy.cpp:
2409         (WebKit::WebFrameProxy::didStartProvisionalLoad):
2410
2411 2017-09-21  Chris Dumez  <cdumez@apple.com>
2412
2413         [WK2] Add API to get the redirect chain of a WKDownload
2414         https://bugs.webkit.org/show_bug.cgi?id=176628
2415         <rdar://problem/34338279>
2416
2417         Reviewed by Alex Christensen.
2418
2419         Re-enable assertion initially added in r222308 and later disabled in
2420         r222320. The assertion was hit because we failed to clear the redirect
2421         chain in WebFrameProxy::didFailProvisionalLoad().
2422
2423         * UIProcess/WebFrameProxy.cpp:
2424         (WebKit::WebFrameProxy::didStartProvisionalLoad):
2425         (WebKit::WebFrameProxy::didFailProvisionalLoad):
2426
2427 2017-09-21  Alex Christensen  <achristensen@webkit.org>
2428
2429         REGRESSION(r221465) WKWebViews without WebGL delegate callbacks crash when WebGL contexts are created
2430         https://bugs.webkit.org/show_bug.cgi?id=177306
2431         <rdar://problem/34351988>
2432
2433         Reviewed by Chris Dumez.
2434
2435         * UIProcess/Cocoa/NavigationState.mm:
2436         (WebKit::NavigationState::NavigationClient::webGLLoadPolicy const):
2437         (WebKit::NavigationState::NavigationClient::resolveWebGLLoadPolicy const):
2438         I forgot to early return after calling the default completion handler if there's no delegate selector.
2439
2440 2017-09-21  Chris Dumez  <cdumez@apple.com>
2441
2442         Unreviewed, temporarily disable assertion added in r222308 while I investigate.
2443
2444         * UIProcess/WebFrameProxy.cpp:
2445         (WebKit::WebFrameProxy::didStartProvisionalLoad):
2446
2447 2017-09-20  Stephan Szabo  <stephan.szabo@sony.com>
2448
2449         [Win] WTF: Add alias for process id to use in place of direct uses of pid_t
2450         https://bugs.webkit.org/show_bug.cgi?id=177017
2451
2452         Reviewed by Alex Christensen.
2453
2454         * NetworkProcess/NetworkProcessCreationParameters.h:
2455         * Shared/WebProcessCreationParameters.h:
2456         * UIProcess/API/APIProcessPoolConfiguration.h:
2457         * UIProcess/API/C/WKContext.cpp:
2458         (WKContextGetNetworkProcessIdentifier):
2459         (WKContextGetDatabaseProcessIdentifier):
2460         * UIProcess/API/C/WKContextPrivate.h:
2461         * UIProcess/API/C/WKPage.cpp:
2462         (WKPageGetProcessIdentifier):
2463         * UIProcess/API/C/WKPagePrivate.h:
2464         * UIProcess/ChildProcessProxy.h:
2465         (WebKit::ChildProcessProxy::processIdentifier const):
2466         * UIProcess/Launcher/ProcessLauncher.cpp:
2467         (WebKit::ProcessLauncher::didFinishLaunchingProcess):
2468         * UIProcess/Launcher/ProcessLauncher.h:
2469         (WebKit::ProcessLauncher::processIdentifier const):
2470         * UIProcess/ProcessAssertion.cpp:
2471         (WebKit::ProcessAssertion::ProcessAssertion):
2472         (WebKit::ProcessAndUIAssertion::ProcessAndUIAssertion):
2473         * UIProcess/ProcessAssertion.h:
2474         (WebKit::ProcessAssertion::ProcessAssertion):
2475         * UIProcess/ProcessThrottler.cpp:
2476         (WebKit::ProcessThrottler::didConnectToProcess):
2477         * UIProcess/ProcessThrottler.h:
2478         * UIProcess/WebPageProxy.cpp:
2479         (WebKit::WebPageProxy::processIdentifier const):
2480         * UIProcess/WebPageProxy.h:
2481         * UIProcess/WebProcessPool.cpp:
2482         (WebKit::WebProcessPool::networkProcessIdentifier):
2483         (WebKit::WebProcessPool::storageProcessIdentifier):
2484         * UIProcess/WebProcessPool.h:
2485
2486 2017-09-20  Chris Dumez  <cdumez@apple.com>
2487
2488         [WK2] Add API to get the redirect chain of a WKDownload
2489         https://bugs.webkit.org/show_bug.cgi?id=176628
2490         <rdar://problem/34338279>
2491
2492         Reviewed by Alex Christensen.
2493
2494         Add API to get the redirect chain of a WKDwnload. The redirect chain includes redirects
2495         that happened during initial load, before the load was converted into a download.
2496
2497         * UIProcess/API/C/WKDownload.cpp:
2498         (WKDownloadCopyRedirectChain):
2499         * UIProcess/API/C/WKDownload.h:
2500         * UIProcess/API/Cocoa/_WKDownload.h:
2501         * UIProcess/API/Cocoa/_WKDownload.mm:
2502         (-[_WKDownload originatingWebView]):
2503         (-[_WKDownload redirectChain]):
2504         * UIProcess/Downloads/DownloadProxy.cpp:
2505         (WebKit::DownloadProxy::willSendRequest):
2506         * UIProcess/Downloads/DownloadProxy.h:
2507         (WebKit::DownloadProxy::setRedirectChain):
2508         (WebKit::DownloadProxy::redirectChain const):
2509         * UIProcess/WebFrameProxy.cpp:
2510         (WebKit::WebFrameProxy::didStartProvisionalLoad):
2511         (WebKit::WebFrameProxy::didReceiveServerRedirectForProvisionalLoad):
2512         * UIProcess/WebFrameProxy.h:
2513         (WebKit::WebFrameProxy::redirectChain const):
2514         * UIProcess/WebPageProxy.cpp:
2515         (WebKit::WebPageProxy::receivedPolicyDecision):
2516
2517 2017-09-20  Alex Christensen  <achristensen@webkit.org>
2518
2519         Add infrastructure for adding custom headers to requests per website
2520         https://bugs.webkit.org/show_bug.cgi?id=177255
2521
2522         Reviewed by Geoffrey Garen.
2523
2524         * Shared/WebsitePolicies.cpp: Added.
2525         * Shared/WebsitePolicies.h:
2526         (WebKit::WebsitePolicies::encode const):
2527         (WebKit::WebsitePolicies::decode):
2528         * UIProcess/API/APIWebsitePolicies.h:
2529         * UIProcess/API/C/WKWebsitePolicies.cpp:
2530         (WKWebsitePoliciesCopyCustomHeaderFields):
2531         (WKWebsitePoliciesSetCustomHeaderFields):
2532         * UIProcess/API/C/WKWebsitePolicies.h:
2533         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
2534         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
2535         (-[_WKWebsitePolicies customHeaderFields]):
2536         (-[_WKWebsitePolicies setCustomHeaderFields:]):
2537         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2538         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2539
2540 2017-09-20  Michael Catanzaro  <mcatanzaro@igalia.com>
2541
2542         REGRESSION(r222194) [WPE] Library and executable output names broken
2543         https://bugs.webkit.org/show_bug.cgi?id=177273
2544
2545         Reviewed by Carlos Alberto Lopez Perez.
2546
2547         Move the WebKit2 output name variables to here from Source/cmake, since this is a better
2548         place and where they are set on all other ports. Update them for the changes in r222194.
2549
2550         * PlatformWPE.cmake:
2551
2552 2017-09-20  Jonathan Bedard  <jbedard@apple.com>
2553
2554         Removed nullable from UIDragItem property
2555         https://bugs.webkit.org/show_bug.cgi?id=176264
2556         <rdar://problem/31144674>
2557
2558         Unreviewed build fix
2559
2560         When a nullable annotation is used in a header file,
2561         the Objective-C compiler forces annotations on the entire
2562         file. Remove an unneeded annotation in UIKitSPI.h so that
2563         we can build in iOS 11.
2564
2565         * Platform/spi/ios/UIKitSPI.h:
2566
2567 2017-09-20  Antti Koivisto  <antti@apple.com>
2568
2569         Remove DOM and styling support for CSS Regions
2570         https://bugs.webkit.org/show_bug.cgi?id=177221
2571
2572         Reviewed by Andreas Kling.
2573
2574         * Configurations/FeatureDefines.xcconfig:
2575
2576 2017-09-19  Simon Fraser  <simon.fraser@apple.com>
2577
2578         Do more math in terms of FloatSizes and FloatPoints
2579         https://bugs.webkit.org/show_bug.cgi?id=177217
2580
2581         Reviewed by Zalan Bujtas.
2582
2583         Add operator/(const FloatSize&, const FloatSize&), GraphicsContext::translate(const FloatPoint&),
2584         FloatRect.scale(FloatSize) and AffineTransform::translate(const FloatSize&)
2585         and use them in lots of places to do math in terms of points and sizes.
2586
2587         * UIProcess/API/Cocoa/WKWebView.mm:
2588         (-[WKWebView _didCommitLayerTree:]):
2589         * UIProcess/ios/DragDropInteractionState.mm:
2590         (WebKit::createTargetedDragPreview):
2591         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
2592         (WebKit::imageForRect):
2593         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
2594         (WebKit::InjectedBundleRangeHandle::renderedImage):
2595         * WebProcess/WebPage/WebPage.cpp:
2596         (WebKit::paintSnapshotAtSize):
2597         (WebKit::WebPage::snapshotNode):
2598
2599 2017-09-19  Simon Fraser  <simon.fraser@apple.com>
2600
2601         tiled-drawing/tiled-backing-in-window.html fails on Retina displays
2602         https://bugs.webkit.org/show_bug.cgi?id=177113
2603
2604         Reviewed by Tim Horton.
2605
2606         Make m_customDeviceScaleFactor a std::optional<> instead of having the weird "0 is unset"
2607         behavior.
2608
2609         * UIProcess/WebPageProxy.cpp:
2610         (WebKit::WebPageProxy::deviceScaleFactor const):
2611         (WebKit::WebPageProxy::setCustomDeviceScaleFactor):
2612         * UIProcess/WebPageProxy.h:
2613
2614 2017-09-19  Alex Christensen  <achristensen@webkit.org>
2615
2616         Allow modern decoding of Vectors
2617         https://bugs.webkit.org/show_bug.cgi?id=177102
2618
2619         Reviewed by Andy Estes.
2620
2621         Rather than allow modern decoding of Vectors of types that only allow legacy decoding,
2622         I just made modern decoders for all types that we need to decode in Vectors.
2623
2624         * NetworkProcess/NetworkResourceLoadParameters.cpp:
2625         (WebKit::NetworkResourceLoadParameters::decode):
2626         * Platform/IPC/ArgumentCoders.cpp:
2627         (IPC::ArgumentCoder<std::chrono::system_clock::time_point>::decode):
2628         * Platform/IPC/ArgumentCoders.h:
2629         * Shared/AssistedNodeInformation.cpp:
2630         (WebKit::OptionItem::decode):
2631         * Shared/AssistedNodeInformation.h:
2632         * Shared/CallbackID.h:
2633         (WebKit::CallbackID::decode):
2634         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
2635         (IPC::ArgumentCoder<WebCore::PaymentError>::decode):
2636         (IPC::ArgumentCoder<WebCore::PaymentMethodUpdate>::decode):
2637         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest>::decode):
2638         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::LineItem>::decode):
2639         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::ShippingMethod>::decode):
2640         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::TotalAndLineItems>::decode):
2641         (IPC::ArgumentCoder<WebCore::ShippingContactUpdate>::decode):
2642         (IPC::ArgumentCoder<WebCore::ShippingMethodUpdate>::decode):
2643         * Shared/Databases/IndexedDB/WebIDBResult.cpp:
2644         (WebKit::WebIDBResult::decode):
2645         * Shared/FrameInfoData.cpp:
2646         (WebKit::FrameInfoData::decode):
2647         * Shared/Gamepad/GamepadData.cpp:
2648         (WebKit::GamepadData::decode):
2649         * Shared/Gamepad/GamepadData.h:
2650         * Shared/PlatformPopupMenuData.cpp:
2651         (WebKit::PlatformPopupMenuData::decode):
2652         * Shared/PlatformPopupMenuData.h:
2653         * Shared/Plugins/NPIdentifierData.cpp:
2654         (WebKit::NPIdentifierData::decode):
2655         * Shared/Plugins/NPIdentifierData.h:
2656         * Shared/Plugins/NPVariantData.cpp:
2657         (WebKit::NPVariantData::decode):
2658         * Shared/Plugins/NPVariantData.h:
2659         * Shared/RTCNetwork.cpp:
2660         (WebKit::RTCNetwork::IPAddress::decode):
2661         (WebKit::RTCNetwork::SocketAddress::decode):
2662         (WebKit::RTCNetwork::decode):
2663         * Shared/RTCNetwork.h:
2664         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
2665         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
2666         (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::decode):
2667         (WebKit::RemoteLayerTreeTransaction::decode):
2668         * Shared/SessionState.cpp:
2669         (WebKit::HTTPBody::Element::decode):
2670         (WebKit::FrameState::decode):
2671         (WebKit::PageState::decode):
2672         (WebKit::BackForwardListItemState::decode):
2673         (WebKit::BackForwardListState::decode):
2674         * Shared/SessionState.h:
2675         * Shared/WebCompiledContentRuleListData.cpp:
2676         (WebKit::WebCompiledContentRuleListData::decode):
2677         * Shared/WebCompiledContentRuleListData.h:
2678         * Shared/WebContextMenuItemData.cpp:
2679         (WebKit::WebContextMenuItemData::decode):
2680         * Shared/WebContextMenuItemData.h:
2681         * Shared/WebCoreArgumentCoders.cpp:
2682         (IPC::ArgumentCoder<DOMCacheEngine::CacheInfo>::decode):
2683         (IPC::ArgumentCoder<DOMCacheEngine::Record>::decode):
2684         (IPC::ArgumentCoder<FloatRect>::decode):
2685         (IPC::ArgumentCoder<FloatQuad>::decode):
2686         (IPC::ArgumentCoder<IntRect>::decode):
2687         (IPC::ArgumentCoder<RecentSearch>::decode):
2688         (IPC::ArgumentCoder<Region::Span>::decode):
2689         (IPC::ArgumentCoder<MimeClassInfo>::decode):
2690         (IPC::ArgumentCoder<PluginInfo>::decode):
2691         (IPC::ArgumentCoder<SelectionRect>::decode):
2692         (IPC::ArgumentCoder<CompositionUnderline>::decode):
2693         (IPC::ArgumentCoder<DictationAlternative>::decode):
2694         (IPC::ArgumentCoder<GrammarDetail>::decode):
2695         (IPC::ArgumentCoder<TextCheckingResult>::decode):
2696         (IPC::ArgumentCoder<BlobPart>::decode):
2697         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
2698         (IPC::ArgumentCoder<MediaConstraints>::decode):
2699         (IPC::ArgumentCoder<CaptureDevice>::decode):
2700         (IPC::ArgumentCoder<ScrollOffsetRange<float>>::decode):
2701         (IPC::ArgumentCoder<MediaSelectionOption>::decode):
2702         * Shared/WebCoreArgumentCoders.h:
2703         * Shared/WebEvent.h:
2704         * Shared/WebPageCreationParameters.cpp:
2705         (WebKit::WebPageCreationParameters::decode):
2706         * Shared/WebPlatformTouchPoint.cpp:
2707         (WebKit::WebPlatformTouchPoint::decode):
2708         * Shared/WebPopupItem.cpp:
2709         (WebKit::WebPopupItem::decode):
2710         * Shared/WebPopupItem.h:
2711         * Shared/WebUserContentControllerDataTypes.cpp:
2712         (WebKit::WebUserScriptData::decode):
2713         (WebKit::WebUserStyleSheetData::decode):
2714         (WebKit::WebScriptMessageHandlerData::decode):
2715         * Shared/WebUserContentControllerDataTypes.h:
2716         * Shared/WebsiteData/WebsiteData.cpp:
2717         (WebKit::WebsiteData::Entry::decode):
2718         * Shared/WebsiteData/WebsiteData.h:
2719         * Shared/WebsiteDataStoreParameters.cpp:
2720         (WebKit::WebsiteDataStoreParameters::decode):
2721         * Shared/ios/WebPlatformTouchPointIOS.cpp:
2722         (WebKit::WebPlatformTouchPoint::decode):
2723         * Shared/mac/WebCoreArgumentCodersMac.mm:
2724         (IPC::ArgumentCoder<KeypressCommand>::decode):
2725         * UIProcess/LegacySessionStateCodingNone.cpp:
2726         (WebKit::decodeLegacySessionState):
2727         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.h:
2728         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
2729         (WebKit::PlatformCAAnimationRemote::KeyframeValue::decode):
2730         (WebKit::PlatformCAAnimationRemote::Properties::decode):
2731
2732 2017-09-19  Ryosuke Niwa  <rniwa@webkit.org>
2733
2734         On iOS, getData can't get text set by setData during copy event
2735         https://bugs.webkit.org/show_bug.cgi?id=176980
2736         <rdar://problem/34453915>
2737
2738         Reviewed by Darin Adler.
2739
2740         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2741         (WebKit::WebPlatformStrategies::copy): Deleted.
2742         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
2743
2744 2017-09-19  Alex Christensen  <achristensen@webkit.org>
2745
2746         Expose WKPageRef as a private property on WKWebView on Mac
2747         https://bugs.webkit.org/show_bug.cgi?id=177022
2748         <rdar://problem/34342762>
2749
2750         Reviewed by Andy Estes.
2751
2752         * UIProcess/API/Cocoa/WKWebView.mm:
2753         (-[WKWebView _pageRefForTransitionToWKWebView]):
2754         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2755
2756 2017-09-19  Alex Christensen  <achristensen@webkit.org>
2757
2758         Make _WKProcessPoolConfiguration.allowsCellularAccess actually work on iOS
2759         https://bugs.webkit.org/show_bug.cgi?id=177124
2760
2761         Reviewed by Andy Estes.
2762
2763         The boolean added in r213747 was getting lost in two places:
2764         1. The API::ProcessPoolConfiguration gets copied before it's used, so we need to set the bool on the copy.
2765         2. The bool was not getting copied from that ProcessPoolConfiguration to the NetworkProcessCreationParameters
2766         to be sent to the NetworkProcess to be given to the NSURLSessionConfiguration in NetworkSessionCocoa.mm.
2767
2768         These two problems were fixed and verified manually with a customized iOS app on my phone.
2769         Unfortunately, this cannot be tested well with our current test infrastructure.
2770
2771         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2772         (API::ProcessPoolConfiguration::copy):
2773         * UIProcess/WebProcessPool.cpp:
2774         (WebKit::WebProcessPool::ensureNetworkProcess):
2775
2776 2017-09-18  Michael Catanzaro  <mcatanzaro@igalia.com>
2777
2778         [CMake] Rename WebKit target to WebKitLegacy and rename WebKit2 target to WebKit
2779         https://bugs.webkit.org/show_bug.cgi?id=174558
2780
2781         Reviewed by Alex Christensen.
2782
2783         * CMakeLists.txt:
2784         * PlatformGTK.cmake:
2785         * PlatformMac.cmake:
2786         * PlatformWPE.cmake:
2787         * PlatformWin.cmake:
2788         * Shared/gtk/WebKitWaylandProtocol.xml: Renamed from Source/WebKit/Shared/gtk/WebKit2WaylandProtocol.xml.
2789         * UIProcess/gtk/WaylandCompositor.cpp:
2790         * WebProcess/gtk/WaylandCompositorDisplay.cpp:
2791
2792 2017-09-18  Andy Estes  <aestes@apple.com>
2793
2794         [Cocoa] Upstream sandbox-related WebKitSystemInterface functions
2795         https://bugs.webkit.org/show_bug.cgi?id=177047
2796
2797         Reviewed by Daniel Bates.
2798
2799         * NetworkProcess/NetworkResourceLoadParameters.cpp:
2800         (WebKit::NetworkResourceLoadParameters::encode const):
2801         * Platform/spi/mac/QuarantineSPI.h: Added.
2802         * Shared/SandboxExtension.h:
2803         (): Deleted.
2804         * Shared/mac/ChildProcessMac.mm:
2805         (WebKit::enableSandboxStyleFileQuarantine):
2806         (WebKit::ChildProcess::initializeSandbox):
2807         * Shared/mac/SandboxExtensionMac.mm:
2808         (WebKit::SandboxExtensionImpl::create):
2809         (WebKit::SandboxExtensionImpl::SandboxExtensionImpl):
2810         (WebKit::SandboxExtensionImpl::~SandboxExtensionImpl):
2811         (WebKit::SandboxExtensionImpl::consume):
2812         (WebKit::SandboxExtensionImpl::invalidate):
2813         (WebKit::SandboxExtensionImpl::getSerializedFormat):
2814         (WebKit::SandboxExtension::Handle::Handle):
2815         (WebKit::SandboxExtension::Handle::~Handle):
2816         (WebKit::SandboxExtension::Handle::encode const):
2817         (WebKit::SandboxExtension::Handle::decode):
2818         (WebKit::SandboxExtension::createHandleWithoutResolvingPath):
2819         (WebKit::SandboxExtension::createHandleForReadWriteDirectory):
2820         (WebKit::SandboxExtension::createHandleForTemporaryFile):
2821         (WebKit::SandboxExtension::createHandleForGenericExtension):
2822         (WebKit::SandboxExtension::SandboxExtension):
2823         (WebKit::SandboxExtension::~SandboxExtension):
2824         (WebKit::SandboxExtension::revoke):
2825         (WebKit::SandboxExtension::consume):
2826         (WebKit::SandboxExtension::consumePermanently):
2827         (WebKit::wkSandboxExtensionType): Deleted.
2828         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
2829         (WebKit::WebPageProxy::createSandboxExtensionsIfNeeded):
2830         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2831         (WebKit::WebProcessPool::platformInitializeWebProcess):
2832         * UIProcess/Downloads/DownloadProxy.cpp:
2833         (WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync):
2834         * UIProcess/Network/NetworkProcessProxy.cpp:
2835         (WebKit::NetworkProcessProxy::grantSandboxExtensionsToStorageProcessForBlobs):
2836         * UIProcess/Storage/StorageProcessProxy.cpp:
2837         (WebKit::StorageProcessProxy::getSandboxExtensionsForBlobFiles):
2838         * UIProcess/WebPageProxy.cpp:
2839         (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
2840         (WebKit::WebPageProxy::loadFile):
2841         (WebKit::WebPageProxy::didChooseFilesForOpenPanel):
2842         * UIProcess/WebProcessPool.cpp:
2843         (WebKit::WebProcessPool::createNewWebProcess):
2844         (WebKit::WebProcessPool::processDidFinishLaunching):
2845         (WebKit::WebProcessPool::resumeDownload):
2846         (WebKit::WebProcessPool::startMemorySampler):
2847         * WebKit.xcodeproj/project.pbxproj:
2848         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
2849         (WebKit::BlobRegistryProxy::registerFileBlobURL):
2850
2851 2017-09-18  Andy Estes  <aestes@apple.com>
2852
2853         [Cocoa] Upstream WKSetCrashReportApplicationSpecificInformation() from WebKitSystemInterface
2854         https://bugs.webkit.org/show_bug.cgi?id=177048
2855
2856         Reviewed by Alex Christensen.
2857
2858         * Platform/IPC/mac/ConnectionMac.mm:
2859         (IPC::Connection::sendMessage):
2860         (IPC::readFromMachPort):
2861         * Platform/cocoa/CrashReporter.h: Copied from Source/WebKit/Shared/Cocoa/ChildProcessCocoa.mm.
2862         * Platform/cocoa/CrashReporter.mm: Copied from Source/WebKit/Shared/Cocoa/ChildProcessCocoa.mm.
2863         (WebKit::setCrashReportApplicationSpecificInformation):
2864         * Platform/spi/Cocoa/CrashReporterClientSPI.h: Copied from Source/WebKit/Shared/Cocoa/ChildProcessCocoa.mm.
2865         * Shared/Cocoa/ChildProcessCocoa.mm:
2866         (WebKit::ChildProcess::didReceiveInvalidMessage):
2867         * WebKit.xcodeproj/project.pbxproj:
2868         * WebProcess/cocoa/WebProcessCocoa.mm:
2869         (WebKit::_WKSetCrashReportApplicationSpecificInformation):
2870
2871 2017-09-18  Andy Estes  <aestes@apple.com>
2872
2873         [Mac] Upstream miscellaneous WebKitSystemInterface functions
2874         https://bugs.webkit.org/show_bug.cgi?id=177029
2875
2876         Reviewed by Alex Christensen.
2877
2878         * NetworkProcess/mac/NetworkProcessMac.mm:
2879         (WebKit::NetworkProcess::initializeProcessName):
2880         * PluginProcess/mac/PluginProcessMac.mm:
2881         (WebKit::PluginProcess::initializeProcessName):
2882         * StorageProcess/mac/StorageProcessMac.mm:
2883         (WebKit::StorageProcess::initializeProcessName):
2884         * UIProcess/Cocoa/WebViewImpl.mm:
2885         (WebKit::trackingAreaOptions):
2886         (WebKit::WebViewImpl::mightBeginScrollWhileInactive):
2887         * UIProcess/mac/WebPopupMenuProxyMac.mm:
2888         (WebKit::WebPopupMenuProxyMac::showPopupMenu):
2889         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
2890         (WebKit::NetscapePlugin::popUpContextMenu):
2891         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2892         (WebKit::PDFPlugin::handleContextMenuEvent):
2893         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2894         (InitWebCoreSystemInterface):
2895         * WebProcess/cocoa/WebProcessCocoa.mm:
2896         (WebKit::WebProcess::initializeProcessName):
2897         (WebKit::WebProcess::updateActivePages):
2898
2899 2017-09-17  Michael Catanzaro  <mcatanzaro@igalia.com>
2900
2901         [WPE][GTK] Merge ProcessLauncher[WPE,GTK]
2902         https://bugs.webkit.org/show_bug.cgi?id=177041
2903
2904         Unreviewed fixup, I broke the size of the argv buffer when experimenting with how to respond
2905         to review comments. Not sure why this didn't blow up everything during testing.
2906
2907         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
2908         (WebKit::ProcessLauncher::launchProcess):
2909
2910 2017-09-17  Michael Catanzaro  <mcatanzaro@igalia.com>
2911
2912         [WPE][GTK] Merge ProcessLauncher[WPE,GTK]
2913         https://bugs.webkit.org/show_bug.cgi?id=177041
2914
2915         Reviewed by Carlos Garcia Campos.
2916
2917         * PlatformGTK.cmake:
2918         * PlatformWPE.cmake:
2919         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp: Renamed from Source/WebKit/UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp.
2920         (WebKit::childSetupFunction):
2921         (WebKit::ProcessLauncher::launchProcess):
2922         (WebKit::ProcessLauncher::terminateProcess):
2923         (WebKit::ProcessLauncher::platformInvalidate):
2924         * UIProcess/Launcher/wpe/ProcessLauncherWPE.cpp: Removed.
2925
2926 2017-09-16  Tim Horton  <timothy_horton@apple.com>
2927
2928         Fix the Tools build with CMake on macOS
2929         https://bugs.webkit.org/show_bug.cgi?id=177030
2930
2931         Reviewed by Geoffrey Garen.
2932
2933         * PlatformMac.cmake:
2934         Add some WebKitLegacy headers to forward (for use by the tools).
2935
2936 2017-09-15  JF Bastien  <jfbastien@apple.com>
2937
2938         WTF: use Forward.h when appropriate instead of Vector.h
2939         https://bugs.webkit.org/show_bug.cgi?id=176984
2940
2941         Reviewed by Saam Barati.
2942
2943         There's no need to include Vector.h when Forward.h will suffice. All we need is to move the template default parameters from Vector, and then the forward declaration can be used in so many new places: if a header only takes Vector by reference, rvalue reference, pointer, returns any of these, or has them as members then the header doesn't need to see the definition because the declaration will suffice.
2944
2945         * Scripts/webkit/LegacyMessages-expected.h:
2946         * Scripts/webkit/Messages-expected.h:
2947         * Shared/API/APIData.h:
2948         * UIProcess/API/APIContextMenuClient.h:
2949         * UIProcess/API/APIFormClient.h:
2950         * UIProcess/API/APIHTTPCookieStore.h:
2951         * UIProcess/API/APINotificationProvider.h:
2952         * UIProcess/API/glib/WebKitNotificationProvider.h:
2953         * UIProcess/Notifications/WebNotificationProvider.h:
2954         * UIProcess/TextCheckerCompletion.h:
2955         * UIProcess/WebCookieManagerProxy.h:
2956         * UIProcess/WebOpenPanelResultListenerProxy.h:
2957         * UIProcess/WebPasteboardProxy.h:
2958         * UIProcess/WebPopupMenuProxy.h:
2959         * UIProcess/WebTextCheckerClient.h:
2960         * WebProcess/Cookies/WebCookieManager.h:
2961         * WebProcess/Gamepad/WebGamepadProvider.h:
2962         * WebProcess/InjectedBundle/API/APIInjectedBundleEditorClient.h:
2963         * WebProcess/InjectedBundle/API/APIInjectedBundlePageContextMenuClient.h:
2964         * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
2965         * WebProcess/InjectedBundle/APIInjectedBundleFormClient.h:
2966         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
2967         * WebProcess/Network/webrtc/WebRTCMonitor.h:
2968         * WebProcess/Network/webrtc/WebRTCResolver.h:
2969         * WebProcess/WebPage/DrawingArea.h:
2970         * WebProcess/WebPage/WebOpenPanelResultListener.h:
2971
2972 2017-09-15  Tim Horton  <timothy_horton@apple.com>
2973
2974         Fix the macOS CMake build
2975         https://bugs.webkit.org/show_bug.cgi?id=177015
2976
2977         Reviewed by Andy Estes.
2978
2979         * CMakeLists.txt:
2980         Add the new RemoteLayerTree directories to the header search path.
2981         Add CookieStorageUtilsCF.mm to Sources.
2982
2983         * PlatformMac.cmake:
2984         Add a few more files, and fix the generated forwarding headers include
2985         path to name "WebKit" instead of "WebKit2".
2986
2987 2017-09-15  Youenn Fablet  <youenn@apple.com>
2988
2989         Add an URL method to remove both query string and fragment identifier
2990         https://bugs.webkit.org/show_bug.cgi?id=176911
2991
2992         Reviewed by Alex Christensen.
2993
2994         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
2995         (WebKit::CacheStorage::computeKeyURL):
2996
2997 2017-09-15  Andy Estes  <aestes@apple.com>
2998
2999         [Cocoa] Upstream MediaRemote and VideoToolbox WebKitSystemInterface functions
3000         https://bugs.webkit.org/show_bug.cgi?id=176953
3001
3002         Reviewed by Eric Carlson.
3003
3004         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
3005         (InitWebCoreSystemInterface):
3006
3007 2017-09-15  Ryosuke Niwa  <rniwa@webkit.org>
3008
3009         iOS: WebKitTestRunner hits an assertion in editing/pasteboard/datatransfer-items-copy-plaintext.html
3010         https://bugs.webkit.org/show_bug.cgi?id=176968
3011
3012         Reviewed by Wenson Hsieh.
3013
3014         Don't allocate a SharedMemory of size zero (content was empty) as this would result in a crash inside
3015         a WebContent process in release builds and an assertion failure in debug builds.
3016
3017         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
3018         (WebKit::WebPasteboardProxy::readBufferFromPasteboard):
3019
3020 2017-09-14  Youenn Fablet  <youenn@apple.com>
3021
3022         Add Cache API support of records persistency
3023         https://bugs.webkit.org/show_bug.cgi?id=176845
3024
3025         Reviewed by Alex Christensen.
3026
3027         Introducing asynchronous opening of Cache objects.
3028         When opening, Cache objects will read the list of records from the disk.
3029         They keep in memory the necessary information to make any match or remove request without reading further information from the disk.
3030         Cache objects thus keep during the opening time a list of callbacks to call when being opened.
3031         Persistent storage is implemented through NetworkCache::Storage.
3032
3033         A Cache object is added a unique name so that records from a Cache cannot be mixed with records from another Cache.
3034         This unique name is stored persistenly in addition to the Cache name.
3035         This unique name is used as the key type given to the storage.
3036
3037         Request, response and responsebody data are no longer kept by the Cache object.
3038         For regular sessions, this information is kept on the disk through NetworkCache::Storage.
3039         Insertion time is also stored persistently so as to keep the ordering of the records consistent.
3040         For private browsing sessions, this information is kept in a map owned by the Caches object.
3041         RecordData is renamed to RecordInformation as it now only contains the information used to handle the different Cache actions.
3042
3043         For every record retrieval action, a ReadRecordTaskCounter is used.
3044         Its purpose is to allow retrieving the record data on the disk in parallel,
3045         and then send back the information when everything is read.
3046         In case some records cannot be correctly read, they are removed automatically at that point.
3047         The current implementation loads all information in memory including response bodies.
3048         Further improvements might consider streaming the response bodies progressively.
3049
3050         For every stored record, an AsynchronousPutTaskCounter is used.
3051         Its purpose is also to wait for all put actions to be completed before executing the completion callback.
3052         In some cases, a record needs to be overriden.
3053         In that case, as per the specification, only the data related to the response is to be modified.
3054         This requires reading the record request data on disk before actually writing the whole record again.
3055         This is implemented in updateRecordToDisk.
3056
3057         The Cache object is delegating all record writing/reading tasks to its Caches object.
3058         The Caches object is responsible to handle persistent/private sessions.
3059
3060         * NetworkProcess/cache/CacheStorageEngine.cpp:
3061         (WebKit::CacheStorage::Engine::retrieveRecords): Making sure Cache object is opened.
3062         (WebKit::CacheStorage::Engine::readCache): Ditto.
3063         (WebKit::CacheStorage::Engine::unlock): Disposing the cache without going through initializing it.
3064         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
3065         (WebKit::CacheStorage::computeKeyURL):
3066         (WebKit::CacheStorage::queryCache):
3067         (WebKit::CacheStorage::updateVaryInformation):
3068         (WebKit::CacheStorage::Cache::toRecordInformation):
3069         (WebKit::CacheStorage::Cache::Cache):
3070         (WebKit::CacheStorage::Cache::open):
3071         (WebKit::CacheStorage::Cache::finishOpening):
3072         (WebKit::CacheStorage::ReadRecordTaskCounter::create):
3073         (WebKit::CacheStorage::ReadRecordTaskCounter::~ReadRecordTaskCounter):
3074         (WebKit::CacheStorage::ReadRecordTaskCounter::appendRecord):
3075         (WebKit::CacheStorage::ReadRecordTaskCounter::ReadRecordTaskCounter):
3076         (WebKit::CacheStorage::Cache::retrieveRecord):
3077         (WebKit::CacheStorage::Cache::retrieveRecords):
3078         (WebKit::CacheStorage::Cache::addRecord):
3079         (WebKit::CacheStorage::Cache::recordsFromURL):
3080         (WebKit::CacheStorage::Cache::recordsFromURL const):
3081         (WebKit::CacheStorage::AsynchronousPutTaskCounter::create):
3082         (WebKit::CacheStorage::AsynchronousPutTaskCounter::~AsynchronousPutTaskCounter):
3083         (WebKit::CacheStorage::AsynchronousPutTaskCounter::onCompletion):
3084         (WebKit::CacheStorage::AsynchronousPutTaskCounter::setError):
3085         (WebKit::CacheStorage::Cache::put):
3086         (WebKit::CacheStorage::Cache::remove):
3087         (WebKit::CacheStorage::Cache::removeFromRecordList):
3088         (WebKit::CacheStorage::Cache::writeRecordToDisk):
3089         (WebKit::CacheStorage::Cache::updateRecordToDisk):
3090         (WebKit::CacheStorage::Cache::readRecordFromDisk):
3091         (WebKit::CacheStorage::Cache::removeRecordFromDisk):
3092         (WebKit::CacheStorage::Cache::encode):
3093         (WebKit::CacheStorage::decodeRecordHeader):
3094         (WebKit::CacheStorage::Cache::decode):
3095         (WebKit::CacheStorage::Cache::keys const):
3096         * NetworkProcess/cache/CacheStorageEngineCache.h:
3097         (WebKit::CacheStorage::Cache::isOpened const):
3098         (WebKit::CacheStorage::Cache::uniqueName const):
3099         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
3100         (WebKit::CacheStorage::Caches::initialize):
3101         (WebKit::CacheStorage::Caches::open):
3102         (WebKit::CacheStorage::Caches::remove):
3103         (WebKit::CacheStorage::Caches::dispose):
3104         (WebKit::CacheStorage::encodeCacheNames):
3105         (WebKit::CacheStorage::decodeCachesNames):
3106         (WebKit::CacheStorage::Caches::readCachesFromDisk):
3107         (WebKit::CacheStorage::Caches::readRecordsList):
3108         (WebKit::CacheStorage::Caches::writeRecord):
3109         (WebKit::CacheStorage::Caches::readRecord):
3110         (WebKit::CacheStorage::Caches::removeRecord):
3111         (WebKit::CacheStorage::Caches::clearMemoryRepresentation):
3112         (WebKit::CacheStorage::Caches::salt const):
3113         * NetworkProcess/cache/CacheStorageEngineCaches.h:
3114         (WebKit::CacheStorage::Caches::shouldPersist const):
3115         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3116         (WebKit::NetworkCache::Storage::store):
3117         * NetworkProcess/cache/NetworkCacheStorage.h:
3118         (WebKit::NetworkCache::Storage::writeWithoutWaiting):
3119
3120 2017-09-14  Alex Christensen  <achristensen@webkit.org>
3121
3122         Add WKUIDelegatePrivate equivalent of WKPageUIClient's drawHeader, drawFooter, headerHeight, and footerHeight
3123         https://bugs.webkit.org/show_bug.cgi?id=176889
3124         <rdar://problem/29270035>
3125
3126         Reviewed by Andy Estes.
3127
3128         * UIProcess/API/C/WKPage.cpp:
3129         (WKPageLoadAlternateHTMLString):
3130         (WKPageLoadAlternateHTMLStringWithUserData):
3131         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
3132         (-[WKBrowsingContextController loadAlternateHTMLString:baseURL:forUnreachableURL:]):
3133         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
3134         * UIProcess/API/Cocoa/WKWebView.mm:
3135         (-[WKWebView _loadAlternateHTMLString:baseURL:forUnreachableURL:]):
3136         * UIProcess/Cocoa/UIDelegate.h:
3137         * UIProcess/Cocoa/UIDelegate.mm:
3138         (WebKit::UIDelegate::setDelegate):
3139         (WebKit::UIDelegate::UIClient::headerHeight):
3140         (WebKit::UIDelegate::UIClient::footerHeight):
3141         (WebKit::UIDelegate::UIClient::drawHeader):
3142         (WebKit::UIDelegate::UIClient::drawFooter):
3143         * UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm:
3144         (-[WKReloadFrameErrorRecoveryAttempter attemptRecovery]):
3145         * UIProcess/Cocoa/WebViewImpl.mm:
3146         (WebKit::WebViewImpl::printOperationWithPrintInfo):
3147         * UIProcess/FrameLoadState.cpp:
3148         (WebKit::FrameLoadState::didStartProvisionalLoad):
3149         (WebKit::FrameLoadState::didReceiveServerRedirectForProvisionalLoad):
3150         (WebKit::FrameLoadState::didFailProvisionalLoad):
3151         (WebKit::FrameLoadState::didCommitLoad):
3152         (WebKit::FrameLoadState::didSameDocumentNotification):
3153         (WebKit::FrameLoadState::setUnreachableURL):
3154         (WebKit::FrameLoadState::FrameLoadState): Deleted.
3155         * UIProcess/FrameLoadState.h:
3156         (WebKit::FrameLoadState::url const):
3157         (WebKit::FrameLoadState::provisionalURL const):
3158         (WebKit::FrameLoadState::unreachableURL const):
3159         * UIProcess/WebFrameProxy.cpp:
3160         (WebKit::WebFrameProxy::loadURL):
3161         (WebKit::WebFrameProxy::didStartProvisionalLoad):
3162         (WebKit::WebFrameProxy::didReceiveServerRedirectForProvisionalLoad):
3163         (WebKit::WebFrameProxy::didSameDocumentNavigation):
3164         (WebKit::WebFrameProxy::setUnreachableURL):
3165         * UIProcess/WebFrameProxy.h:
3166         (WebKit::WebFrameProxy::url const):
3167         (WebKit::WebFrameProxy::provisionalURL const):
3168         (WebKit::WebFrameProxy::unreachableURL const):
3169         * UIProcess/WebPageProxy.cpp:
3170         (WebKit::WebPageProxy::loadAlternateHTMLString):
3171         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
3172         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
3173         (WebKit::WebPageProxy::didChangeProvisionalURLForFrame):
3174         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
3175         * UIProcess/WebPageProxy.h:
3176         * UIProcess/WebPageProxy.messages.in:
3177         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3178         (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad):
3179         (WebKit::WebFrameLoaderClient::dispatchDidChangeProvisionalURL):
3180         (WebKit::WebFrameLoaderClient::dispatchDidChangeLocationWithinPage):
3181         (WebKit::WebFrameLoaderClient::dispatchDidPushStateWithinPage):
3182         (WebKit::WebFrameLoaderClient::dispatchDidReplaceStateWithinPage):
3183         (WebKit::WebFrameLoaderClient::dispatchDidPopStateWithinPage):
3184         (WebKit::WebFrameLoaderClient::dispatchDidStartProvisionalLoad):
3185         * WebProcess/WebPage/WebPage.cpp:
3186         (WebKit::WebPage::loadURLInFrame):
3187         * WebProcess/WebPage/WebPage.h:
3188         * WebProcess/WebPage/WebPage.messages.in:
3189
3190 2017-09-14  Andy Estes  <aestes@apple.com>
3191
3192         [Mac] Upstream SpeechSynthesis-related WebKitSystemInterface functions
3193         https://bugs.webkit.org/show_bug.cgi?id=176931
3194
3195         Reviewed by Joseph Pecoraro.
3196
3197         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
3198         (InitWebCoreSystemInterface):
3199
3200 2017-09-14  Ryan Haddad  <ryanhaddad@apple.com>
3201
3202         Unreviewed, rolling out r222033.
3203
3204         This change caused API test WebKit.PrintFrame to time out.
3205
3206         Reverted changeset:
3207
3208         "Add WKUIDelegatePrivate equivalent of WKPageUIClient's
3209         drawHeader, drawFooter, headerHeight, and footerHeight"
3210         https://bugs.webkit.org/show_bug.cgi?id=176889
3211         http://trac.webkit.org/changeset/222033
3212
3213 2017-09-14  Alex Christensen  <achristensen@webkit.org>
3214
3215         Add WKUIDelegatePrivate equivalent of WKPageUIClient's drawHeader, drawFooter, headerHeight, and footerHeight
3216         https://bugs.webkit.org/show_bug.cgi?id=176889
3217         <rdar://problem/29270035>
3218
3219         Reviewed by Andy Estes.
3220
3221         * UIProcess/API/C/WKPage.cpp:
3222         (WKPageLoadAlternateHTMLString):
3223         (WKPageLoadAlternateHTMLStringWithUserData):
3224         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
3225         (-[WKBrowsingContextController loadAlternateHTMLString:baseURL:forUnreachableURL:]):
3226         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
3227         * UIProcess/API/Cocoa/WKWebView.mm:
3228         (-[WKWebView _loadAlternateHTMLString:baseURL:forUnreachableURL:]):
3229         * UIProcess/Cocoa/UIDelegate.h:
3230         * UIProcess/Cocoa/UIDelegate.mm:
3231         (WebKit::UIDelegate::setDelegate):
3232         (WebKit::UIDelegate::UIClient::headerHeight):
3233         (WebKit::UIDelegate::UIClient::footerHeight):
3234         (WebKit::UIDelegate::UIClient::drawHeader):
3235         (WebKit::UIDelegate::UIClient::drawFooter):
3236         * UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm:
3237         (-[WKReloadFrameErrorRecoveryAttempter attemptRecovery]):
3238         * UIProcess/Cocoa/WebViewImpl.mm:
3239         (WebKit::WebViewImpl::printOperationWithPrintInfo):
3240         * UIProcess/FrameLoadState.cpp:
3241         (WebKit::FrameLoadState::didStartProvisionalLoad):
3242         (WebKit::FrameLoadState::didReceiveServerRedirectForProvisionalLoad):
3243         (WebKit::FrameLoadState::didFailProvisionalLoad):
3244         (WebKit::FrameLoadState::didCommitLoad):
3245         (WebKit::FrameLoadState::didSameDocumentNotification):
3246         (WebKit::FrameLoadState::setUnreachableURL):
3247         (WebKit::FrameLoadState::FrameLoadState): Deleted.
3248         * UIProcess/FrameLoadState.h:
3249         (WebKit::FrameLoadState::url const):
3250         (WebKit::FrameLoadState::provisionalURL const):
3251         (WebKit::FrameLoadState::unreachableURL const):
3252         * UIProcess/WebFrameProxy.cpp:
3253         (WebKit::WebFrameProxy::loadURL):
3254         (WebKit::WebFrameProxy::didStartProvisionalLoad):
3255         (WebKit::WebFrameProxy::didReceiveServerRedirectForProvisionalLoad):
3256         (WebKit::WebFrameProxy::didSameDocumentNavigation):
3257         (WebKit::WebFrameProxy::setUnreachableURL):
3258         * UIProcess/WebFrameProxy.h:
3259         (WebKit::WebFrameProxy::url const):
3260         (WebKit::WebFrameProxy::provisionalURL const):
3261         (WebKit::WebFrameProxy::unreachableURL const):
3262         * UIProcess/WebPageProxy.cpp:
3263         (WebKit::WebPageProxy::loadAlternateHTMLString):
3264         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
3265         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
3266         (WebKit::WebPageProxy::didChangeProvisionalURLForFrame):
3267         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
3268         * UIProcess/WebPageProxy.h:
3269         * UIProcess/WebPageProxy.messages.in:
3270         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3271         (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad):
3272         (WebKit::WebFrameLoaderClient::dispatchDidChangeProvisionalURL):
3273         (WebKit::WebFrameLoaderClient::dispatchDidChangeLocationWithinPage):
3274         (WebKit::WebFrameLoaderClient::dispatchDidPushStateWithinPage):
3275         (WebKit::WebFrameLoaderClient::dispatchDidReplaceStateWithinPage):
3276         (WebKit::WebFrameLoaderClient::dispatchDidPopStateWithinPage):
3277         (WebKit::WebFrameLoaderClient::dispatchDidStartProvisionalLoad):
3278         * WebProcess/WebPage/WebPage.cpp:
3279         (WebKit::WebPage::loadURLInFrame):
3280         * WebProcess/WebPage/WebPage.h:
3281         * WebProcess/WebPage/WebPage.messages.in:
3282
3283 2017-09-14  Carlos Garcia Campos  <cgarcia@igalia.com>
3284
3285         [GTK][Wayland] Flickering when resizing the window
3286         https://bugs.webkit.org/show_bug.cgi?id=176774
3287
3288         Reviewed by Michael Catanzaro.
3289
3290         This regressed when we switched to always start the wayland compositor. In
3291         AcceleratedDrawingAreaProxy::waitForAndDispatchDidUpdateBackingStoreState() we check if the nested compositor is
3292         running, which is always true now (if EGL and the required extensions are available). We should check if we are
3293         in AC mode instead.
3294
3295         * UIProcess/AcceleratedDrawingAreaProxy.cpp:
3296         (WebKit::AcceleratedDrawingAreaProxy::waitForAndDispatchDidUpdateBackingStoreState):
3297
3298 2017-09-14  Yusuke Suzuki  <utatane.tea@gmail.com>
3299
3300         [JSC] Add PrivateSymbolMode::{Include,Exclude} for PropertyNameArray
3301         https://bugs.webkit.org/show_bug.cgi?id=176867
3302
3303         Reviewed by Sam Weinig.
3304
3305         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
3306         (WebKit::NPJSObject::enumerate):
3307
3308 2017-09-14  Maureen Daum  <mdaum@apple.com>
3309
3310         Introduce the option to mark an HTML element as having AutoFill available.
3311         https://bugs.webkit.org/show_bug.cgi?id=176710
3312
3313         Reviewed by Alex Christensen.
3314
3315         Introduce the option to mark an HTML element as having AutoFill available. Accessibility
3316         can use this property when deciding whether to announce that the focused field offers
3317         AutoFill.
3318
3319         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
3320         (WKBundleNodeHandleGetHTMLInputElementAutoFillAvailable):
3321         (WKBundleNodeHandleSetHTMLInputElementAutoFillAvailable):
3322         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h:
3323         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
3324         (WebKit::InjectedBundleNodeHandle::isAutoFillAvailable const):
3325         (WebKit::InjectedBundleNodeHandle::setAutoFillAvailable):
3326         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
3327
3328 2017-09-13  John Wilander  <wilander@apple.com>
3329
3330         Introduce Storage Access API (document parts) as an experimental feature
3331         https://bugs.webkit.org/show_bug.cgi?id=175759
3332         <rdar://problem/34414107>
3333
3334         Reviewed by Alex Christensen.
3335
3336         Storage Access API is an experimental feature which allows cross-origin,
3337         sandboxed iframes to request access to their first-party storage (as
3338         opposed to partitioned storage). This might be restricted to cookies or
3339         might cover all stateful mechanisms.
3340
3341         It introduces the following three developer-facing things:
3342         - A new readonly attribute, document.hasStorageAccess.
3343         - A new function, document.requestStorageAccess().
3344         - A new iframe sandbox token, allow-storage-access-by-user-activation.
3345
3346         * Shared/WebCoreArgumentCoders.cpp:
3347         (IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
3348         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
3349             Storage handling of the new type of data.
3350         * Shared/WebPreferencesDefinitions.h:
3351         * UIProcess/API/C/WKPreferences.cpp:
3352         (WKPreferencesSetStorageAccessAPIEnabled):
3353         (WKPreferencesGetStorageAccessAPIEnabled):
3354         * UIProcess/API/C/WKPreferencesRefPrivate.h:
3355         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3356             Bumped the model version from 9 to 10.
3357         * WebProcess/WebPage/WebPage.cpp:
3358         (WebKit::WebPage::updatePreferences):
3359
3360 2017-09-13  Andy Estes  <aestes@apple.com>
3361
3362         [Apple Pay] Consider phoneticName when encoding ContactFields
3363         https://bugs.webkit.org/show_bug.cgi?id=176885
3364         <rdar://problem/34176419>
3365
3366         Reviewed by Tim Horton.
3367
3368         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
3369         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::ContactFields>::encode):
3370         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::ContactFields>::decode):
3371
3372 2017-09-13  Matt Lewis  <jlewis3@apple.com>
3373
3374         Unreviewed, rolling out r221976.
3375
3376         The test introduced was flaky from point of addition.
3377
3378         Reverted changeset:
3379
3380         "Introduce Storage Access API (document parts) as an
3381         experimental feature"
3382         https://bugs.webkit.org/show_bug.cgi?id=175759
3383         http://trac.webkit.org/changeset/221976
3384
3385 2017-09-13  Youenn Fablet  <youenn@apple.com>
3386
3387         Internals clearCacheStorageMemoryRepresentation should return a Promise
3388         https://bugs.webkit.org/show_bug.cgi?id=176818
3389
3390         Reviewed by Alex Christensen.
3391
3392         Adding a completion handler to clearMemoryRepresentation.
3393
3394         * NetworkProcess/cache/CacheStorageEngine.cpp:
3395         (WebKit::CacheStorage::Engine::clearMemoryRepresentation):
3396         * NetworkProcess/cache/CacheStorageEngine.h:
3397         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
3398         (WebKit::CacheStorageEngineConnection::clearMemoryRepresentation):
3399         * NetworkProcess/cache/CacheStorageEngineConnection.h:
3400         * NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
3401         * WebProcess/Cache/WebCacheStorageConnection.cpp:
3402         (WebKit::WebCacheStorageConnection::clearMemoryRepresentation):
3403         (WebKit::WebCacheStorageConnection::clearMemoryRepresentationCompleted):
3404         * WebProcess/Cache/WebCacheStorageConnection.h:
3405         * WebProcess/Cache/WebCacheStorageConnection.messages.in:
3406
3407 2017-09-13  Andy Estes  <aestes@apple.com>
3408
3409         [CF] Upstream CFNetwork-related WebKitSystemInterface functions
3410         https://bugs.webkit.org/show_bug.cgi?id=176729
3411
3412         Reviewed by Alex Christensen.
3413
3414         * Shared/mac/WebCoreArgumentCodersMac.mm:
3415         (IPC::createSerializableRepresentation):
3416         (IPC::dictionaryValueOfType):
3417         (IPC::createArchiveList):
3418         (IPC::createCFURLRequestFromSerializableRepresentation):
3419         (IPC::createNSURLRequestFromSerializableRepresentation):
3420         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
3421         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
3422         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3423         (WebKit::WebProcessPool::legacyPlatformDefaultCacheStorageDirectory):
3424         (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
3425         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
3426         (InitWebCoreSystemInterface):
3427
3428 2017-09-13  Alex Christensen  <achristensen@webkit.org>
3429
3430         Add WKUIDelegatePrivate equivalent of WKPageUIClient's setIsResizable, getWindowFrame, and setWindowFrame
3431         https://bugs.webkit.org/show_bug.cgi?id=176857
3432         <rdar://problem/29270035>
3433
3434         Reviewed by Tim Horton.
3435
3436         isResizable is unreachable code because nothing sends Messages::WebPageProxy::GetIsResizable, so I removed it.
3437
3438         * UIProcess/API/APIUIClient.h:
3439         (API::UIClient::setStatusBarIsVisible):
3440         (API::UIClient::isResizable): Deleted.
3441         * UIProcess/API/C/WKPage.cpp:
3442         (WKPageSetPageUIClient):
3443         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
3444         * UIProcess/API/glib/WebKitUIClient.cpp:
3445         * UIProcess/Cocoa/UIDelegate.h:
3446         * UIProcess/Cocoa/UIDelegate.mm:
3447         (WebKit::UIDelegate::setDelegate):
3448         (WebKit::UIDelegate::UIClient::setIsResizable):
3449         (WebKit::UIDelegate::UIClient::setWindowFrame):
3450         (WebKit::UIDelegate::UIClient::windowFrame):
3451         * UIProcess/WebPageProxy.cpp:
3452         (WebKit::WebPageProxy::getIsResizable): Deleted.
3453         * UIProcess/WebPageProxy.h:
3454         * UIProcess/WebPageProxy.messages.in:
3455
3456 2017-09-13  Youenn Fablet  <youenn@apple.com>
3457
3458         Add a lambda-based map for Vectors
3459         https://bugs.webkit.org/show_bug.cgi?id=176487
3460
3461         Reviewed by Darin Adler.
3462
3463         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
3464         (WebKit::CacheStorage::Caches::readCachesFromDisk):
3465
3466 2017-09-13  John Wilander  <wilander@apple.com>
3467
3468         Introduce Storage Access API (document parts) as an experimental feature
3469         https://bugs.webkit.org/show_bug.cgi?id=175759
3470         <rdar://problem/33666847>
3471
3472         Reviewed by Alex Christensen.
3473
3474         Storage Access API is an experimental feature which allows cross-origin,
3475         sandboxed iframes to request access to their first-party storage (as
3476     &nbs