[Settings] Remove all custom code from Settings.h/cpp
[WebKit.git] / Source / WebKit / ChangeLog
1 2017-10-16  Sam Weinig  <sam@webkit.org>
2
3         [Settings] Remove all custom code from Settings.h/cpp
4         https://bugs.webkit.org/show_bug.cgi?id=178330
5
6         Reviewed by Simon Fraser.
7
8         * Shared/WebPreferencesDefinitions.h:
9         * UIProcess/API/C/WKPreferences.cpp:
10         (WKPreferencesSetFrameFlatteningEnabled):
11         (WKPreferencesGetFrameFlatteningEnabled):
12         * UIProcess/API/glib/WebKitSettings.cpp:
13         (webkit_settings_get_enable_frame_flattening):
14         (webkit_settings_set_enable_frame_flattening):
15         * WebProcess/InjectedBundle/InjectedBundle.cpp:
16         (WebKit::InjectedBundle::setFrameFlatteningEnabled):
17         
18             Update for naming changes of FrameFlattening now that it is an enum class.
19
20         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
21         (WebKit::WebChromeClient::contentsSizeChanged const):
22
23             Ge the effectiveFrameFlattening from the FrameView, rather than the Settings.
24
25 2017-10-16  Chris Dumez  <cdumez@apple.com>
26
27         [WK2][NetworkSession] Add support for resuming downloads
28         https://bugs.webkit.org/show_bug.cgi?id=177625
29         <rdar://problem/34345975>
30
31         Reviewed by Alex Christensen.
32
33         Add support for resuming downloads for the WK2 NETWORK_SESSION code path.
34
35         This was tested manually. I was unable to write an API test because our tests
36         do not run an HTTP server and CFNetwork does not seem to generate resume data
37         when cancelling a download over non-HTTP.
38
39         * NetworkProcess/Downloads/Download.cpp:
40         (WebKit::Download::didReceiveChallenge):
41         (WebKit::Download::continueCanAuthenticateAgainstProtectionSpace):
42         * NetworkProcess/Downloads/Download.h:
43         * NetworkProcess/Downloads/DownloadManager.cpp:
44         (WebKit::DownloadManager::continueCanAuthenticateAgainstProtectionSpace):
45         (WebKit::DownloadManager::resumeDownload):
46         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
47         (WebKit::Download::resume):
48         This currently includes a workaround for <rdar://problem/34745171>. We update the
49         resume data to include the NSURLSessionResumeInfoLocalPath key with the final
50         destination path so that CFNetwork looks for the temporary data at the right
51         location.
52
53         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
54         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
55         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
56         (WebKit::NetworkSessionCocoa::downloadTaskWithResumeData):
57         * Shared/Authentication/AuthenticationManager.cpp:
58         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
59         * Shared/Authentication/AuthenticationManager.h:
60
61 2017-10-16  Adrian Perez de Castro  <aperez@igalia.com>
62
63         [WPE] Build failure due to invalid cast of EGLNativeWindowType when targetting 64-bit ARM
64         https://bugs.webkit.org/show_bug.cgi?id=178090
65
66         Reviewed by Michael Catanzaro.
67
68         EGLNativeWindowType can be aliased to a different type depending (at least) on the EGL
69         implementation, its build options, and the libepoxy build options.  Using "static_cast"
70         works when it is a numeric value and the width of the value needs to be optionally
71         extended to 64 bits (e.g. the EGL type is "int" in a 32-bit CPU) but not for pointers,
72         and using "reinterpret_cast" works when the size of a pointer is 64 bits but not in other
73         cases. Therefore it seems reasonable to use a plain C cast expression to solve this
74         particular situation.
75
76         * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp:
77         (WebKit::AcceleratedSurfaceWPE::window const): Use a good old plain C cast expression.
78
79 2017-10-16  Chris Dumez  <cdumez@apple.com>
80
81         Clicks on Link with download attribute causes all (other) links to trigger download when clicked
82         https://bugs.webkit.org/show_bug.cgi?id=178267
83         <rdar://problem/34985016>
84
85         Reviewed by Darin Adler.
86
87         When clicking on an anchor with the download attribute, the m_syncNavigationActionHasDownloadAttribute
88         flag on WebPageProxy would get set. This flag would not get reset right away and instead, it would get
89         updated during the next call to WebPageProxy::decidePolicyForNavigationAction(). The issue is that if
90         you later click on a link with target="_blank", WebPageProxy::decidePolicyForNewWindowAction() gets
91         called instead of WebPageProxy::decidePolicyForNavigationAction() and we do not reset the
92         m_syncNavigationActionHasDownloadAttribute flag and we force a download.
93
94         To address the problem, I got rid of this flag on WebPageProxy and it is error-prone and should really
95         not be at page-level. Instead, I added a shouldForceDownload flag on the navigation object. It makes
96         more sense to associate the flag with the navigation and makes it less error-prone.
97
98         * UIProcess/API/APINavigation.h:
99         (API::Navigation::setShouldForceDownload):
100         (API::Navigation::shouldForceDownload const):
101         * UIProcess/WebPageProxy.cpp:
102         (WebKit::WebPageProxy::receivedPolicyDecision):
103         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
104         * UIProcess/WebPageProxy.h:
105
106 2017-10-16  Ryan Haddad  <ryanhaddad@apple.com>
107
108         Unreviewed, rolling out r223271.
109
110         This change introduced LayoutTest failures on WK1.
111
112         Reverted changeset:
113
114         "Use asynchronous ResourceHandleClient calls for WebKit1"
115         https://bugs.webkit.org/show_bug.cgi?id=160677
116         https://trac.webkit.org/changeset/223271
117
118 2017-10-13  Youenn Fablet  <youenn@apple.com>
119
120         Implement listing origins for which CacheStorage is storing data
121         https://bugs.webkit.org/show_bug.cgi?id=178236
122
123         Reviewed by Chris Dumez.
124
125         Cache storage is split on per-origin folders which name is obfuscated through salting.
126         To retrieve the origin for each folder, an origin file is now stored within each folder.
127         This file contains the actual origin.
128
129         Adding support to get the list of origin by iterating through each folder and
130         getting the actual origin by reading the content of the 'origin' file.
131
132         Adding C API for WebKitTestRunner.
133
134         * NetworkProcess/cache/CacheStorageEngine.cpp:
135         (WebKit::CacheStorage::Engine::fetchEntries):
136         (WebKit::CacheStorage::ReadOriginsTaskCounter::create):
137         (WebKit::CacheStorage::ReadOriginsTaskCounter::~ReadOriginsTaskCounter):
138         (WebKit::CacheStorage::ReadOriginsTaskCounter::addOrigin):
139         (WebKit::CacheStorage::ReadOriginsTaskCounter::ReadOriginsTaskCounter):
140         * NetworkProcess/cache/CacheStorageEngine.h:
141         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
142         (WebKit::CacheStorage::cachesOriginFilename):
143         (WebKit::CacheStorage::Caches::retrieveOriginFromDirectory):
144         (WebKit::CacheStorage::Caches::Caches):
145         (WebKit::CacheStorage::Caches::storeOrigin):
146         (WebKit::CacheStorage::Caches::readOrigin):
147         (WebKit::CacheStorage::Caches::initialize):
148         * NetworkProcess/cache/CacheStorageEngineCaches.h:
149         (WebKit::CacheStorage::Caches::origin const):
150         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
151         (WKWebsiteDataStoreGetFetchCacheOrigins):
152         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
153
154 2017-10-13  Alex Christensen  <achristensen@webkit.org>
155
156         Fix API tests after r223269.
157         https://bugs.webkit.org/show_bug.cgi?id=178246
158
159         * UIProcess/API/APIContentRuleListStore.cpp:
160         (API::ContentRuleListStore::getContentRuleListSource):
161         Version 10 also has the ability to recover content rule list source.
162
163 2017-10-11  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
164
165         [GLib] WebKitNavigationAction should tell whether it is a redirect
166         https://bugs.webkit.org/show_bug.cgi?id=178178
167
168         There is no good way to know whether a given navigation action has been caused
169         by a redirect through the glib API. This is necessary to implement some app mode
170         heuristics for Epiphany.
171
172         Reviewed by Carlos Garcia Campos.
173
174         * UIProcess/API/glib/WebKitNavigationAction.cpp:
175         (webkit_navigation_action_is_redirect): returns whether the navigation action is a redirect.
176         * UIProcess/API/glib/WebKitNavigationActionPrivate.h: add isRedirect to the wrapper object.
177         (_WebKitNavigationAction::_WebKitNavigationAction):
178         * UIProcess/API/gtk/WebKitNavigationAction.h: add the new API.
179         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: ditto.
180         * UIProcess/API/wpe/WebKitNavigationAction.h: ditto.
181
182 2017-10-12  Brady Eidson  <beidson@apple.com>
183
184         SW "Hello world".
185         https://bugs.webkit.org/show_bug.cgi?id=178187
186
187         Reviewed by Andy Estes.
188
189         * WebProcess/WebProcess.cpp:
190         (WebKit::WebProcess::startServiceWorkerContext):
191
192 2017-10-12  Alex Christensen  <achristensen@webkit.org>
193
194         Remove unnecessary includes in WebKit
195         https://bugs.webkit.org/show_bug.cgi?id=178235
196
197         Reviewed by Tim Horton.
198
199         * Platform/IPC/ArgumentCoders.h:
200         * WebProcess/WebProcess.cpp:
201         * WebProcess/WebStorage/StorageAreaImpl.h:
202
203 2017-10-12  Alex Christensen  <achristensen@webkit.org>
204
205         Increment ContentRuleListStore::CurrentContentRuleListFileVersion
206         https://bugs.webkit.org/show_bug.cgi?id=178246
207         <rdar://problem/34890057>
208
209         Reviewed by Tim Horton.
210
211         * UIProcess/API/APIContentRuleListStore.h:
212         Things are crashing.  Something isn't binary reverse compatible.
213         Probably something related to r222602.
214         This is why we have a version number to update.
215
216 2017-10-12  Alex Christensen  <achristensen@webkit.org>
217
218         Expose some of WKView's WebViewImpl accessors through WKWebViewPrivate
219         https://bugs.webkit.org/show_bug.cgi?id=178240
220         <rdar://problem/34962720>
221
222         Reviewed by Tim Horton.
223         
224         Also renamed createFullScreenWindow to fullScreenWindow to reflect the fact that it returns
225         an autoreleased NSWindow so we don't make the same naming mistake in the WKWebView SPI.
226
227         * UIProcess/API/Cocoa/WKWebView.mm:
228         (-[WKWebView _dismissContentRelativeChildWindows]):
229         (-[WKWebView _setFrame:andScrollBy:]):
230         (-[WKWebView _setTotalHeightOfBanners:]):
231         (-[WKWebView _totalHeightOfBanners]):
232         (-[WKWebView _beginDeferringViewInWindowChanges]):
233         (-[WKWebView _endDeferringViewInWindowChanges]):
234         (-[WKWebView _endDeferringViewInWindowChangesSync]):
235         (-[WKWebView _gestureEventWasNotHandledByWebCore:]):
236         (-[WKWebView _setIgnoresNonWheelEvents:]):
237         (-[WKWebView _ignoresNonWheelEvents]):
238         (-[WKWebView _setCustomSwipeViews:]):
239         (-[WKWebView _setCustomSwipeViewsTopContentInset:]):
240         (-[WKWebView _tryToSwipeWithEvent:ignoringPinnedState:]):
241         (-[WKWebView _setDidMoveSwipeSnapshotCallback:]):
242         (-[WKWebView _fullScreenPlaceholderView]):
243         (-[WKWebView _fullScreenWindow]):
244         (-[WKWebView _disableFrameSizeUpdates]):
245         (-[WKWebView _enableFrameSizeUpdates]):
246         (-[WKWebView _canChangeFrameLayout:]):
247         (-[WKWebView _underlayColor]):
248         (-[WKWebView _setUnderlayColor:]):
249         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
250         * UIProcess/API/mac/WKView.mm:
251         (-[WKView createFullScreenWindow]):
252         * UIProcess/Cocoa/WebViewImpl.h:
253         * UIProcess/Cocoa/WebViewImpl.mm:
254         (WebKit::WebViewImpl::fullScreenWindowController):
255         (WebKit::WebViewImpl::fullScreenWindow):
256         (WebKit::WebViewImpl::createFullScreenWindow): Deleted.
257
258 2017-10-12  Youenn Fablet  <youenn@apple.com>
259
260         Layout Test http/tests/cache-storage/cache-clearing.https.html is failing
261         https://bugs.webkit.org/show_bug.cgi?id=178200
262
263         Reviewed by Chris Dumez.
264
265         Deleting only the per-origin folders inside the CacheStorage engine root folder.
266
267         * NetworkProcess/cache/CacheStorageEngine.cpp:
268         (WebKit::CacheStorage::Engine::clearAllCaches):
269         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
270         (WKWebsiteDataStoreRemoveAllFetchCaches):
271         (WKWebsiteDataStoreRemoveFetchCacheForOrigin):
272         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
273
274 2017-10-12  Chris Dumez  <cdumez@apple.com>
275
276         [Mac] Add support for MouseEvent.buttons
277         https://bugs.webkit.org/show_bug.cgi?id=178214
278
279         Reviewed by Ryosuke Niwa.
280
281         * Shared/WebEvent.h:
282         (WebKit::WebMouseEvent::buttons const):
283         * Shared/WebEventConversion.cpp:
284         (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
285         * Shared/WebMouseEvent.cpp:
286         (WebKit::WebMouseEvent::WebMouseEvent):
287         (WebKit::WebMouseEvent::encode const):
288         (WebKit::WebMouseEvent::decode):
289         * Shared/mac/WebEventFactory.mm:
290         (WebKit::currentlyPressedMouseButtons):
291         (WebKit::WebEventFactory::createWebMouseEvent):
292         * WebProcess/Plugins/PDF/PDFPlugin.mm:
293         (WebKit::PDFPlugin::showContextMenuAtPoint):
294         * WebProcess/Plugins/PluginView.cpp:
295         (WebKit::PluginView::createWebEvent const):
296         * WebProcess/WebPage/WebPage.cpp:
297         (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick):
298         (WebKit::WebPage::simulateMouseDown):
299         (WebKit::WebPage::simulateMouseUp):
300         (WebKit::WebPage::simulateMouseMotion):
301
302 2017-10-12  Youenn Fablet  <youenn@apple.com>
303
304         Add API to clean CacheStorage data
305         https://bugs.webkit.org/show_bug.cgi?id=178034
306
307         Unreviewed.
308
309         * Shared/WebsiteData/WebsiteDataType.h: fixing the DOMCache value. 
310
311 2017-10-12  Stephan Szabo  <stephan.szabo@sony.com>
312
313         [WinCairo] add WebProcess files for wincairo webkit
314         https://bugs.webkit.org/show_bug.cgi?id=178024
315
316         Reviewed by Alex Christensen.
317
318         * PlatformWin.cmake:
319         * WebProcess/Cookies/curl/WebCookieManagerCurl.cpp: Added.
320         (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
321         (WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy):
322         * WebProcess/InjectedBundle/win/InjectedBundleWin.cpp: Added.
323         (WebKit::InjectedBundle::initialize):
324         (WebKit::InjectedBundle::setBundleParameter):
325         (WebKit::InjectedBundle::setBundleParameters):
326         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
327         * WebProcess/Plugins/Netscape/win/PluginProxyWin.cpp: Added.
328         (WebKit::PluginProxy::needsBackingStore const):
329         * WebProcess/WebCoreSupport/win/WebContextMenuClientWin.cpp: Added.
330         (WebKit::WebContextMenuClient::lookUpInDictionary):
331         (WebKit::WebContextMenuClient::isSpeaking):
332         (WebKit::WebContextMenuClient::speak):
333         (WebKit::WebContextMenuClient::stopSpeaking):
334         * WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.cpp: Added.
335         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession):
336         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
337         (WebKit::WebFrameNetworkingContext::WebFrameNetworkingContext):
338         (WebKit::WebFrameNetworkingContext::storageSession const):
339         (WebKit::WebFrameNetworkingContext::webFrameLoaderClient const):
340         (WebKit::WebFrameNetworkingContext::blockedError const):
341         * WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.h: Added.
342         (WebKit::WebFrameNetworkingContext::create):
343         * WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp: Added.
344         (WebKit::WebPopupMenu::setUpPlatformData):
345         * WebProcess/WebPage/win/WebInspectorUIWin.cpp: Added.
346         (WebKit::WebInspectorUI::canSave):
347         (WebKit::WebInspectorUI::localizedStringsURL):
348         (WebKit::RemoteWebInspectorUI::localizedStringsURL):
349         * WebProcess/WebPage/win/WebPageWin.cpp: Added.
350         (WebKit::WebPage::platformInitialize):
351         (WebKit::WebPage::platformDetach):
352         (WebKit::WebPage::platformEditorState const):
353         (WebKit::WebPage::platformPreferencesDidChange):
354         (WebKit::WebPage::performDefaultBehaviorForKeyEvent):
355         (WebKit::WebPage::platformHasLocalDataForURL):
356         (WebKit::WebPage::cachedResponseMIMETypeForURL):
357         (WebKit::WebPage::platformCanHandleRequest):
358         (WebKit::WebPage::cachedSuggestedFilenameForURL):
359         (WebKit::WebPage::cachedResponseDataForURL):
360         (WebKit::WebPage::platformUserAgent const):
361         (WebKit::WebPage::interpretKeyEvent):
362         * WebProcess/WebProcess.cpp:
363         (WebKit::WebProcess::ensureWebToStorageProcessConnection):
364         * WebProcess/win/WebProcessWin.cpp: Added.
365         (loadResourceIntoBuffer):
366         (WebKit::WebProcess::platformInitializeWebProcess):
367         (WebKit::WebProcess::platformTerminate):
368         (WebKit::WebProcess::platformSetCacheModel):
369
370 2017-10-12  David Kilzer  <ddkilzer@apple.com>
371
372         [iOS] Fix -Wunused-lambda-capture warnings in WebCore/WebKit with new clang compiler
373         <https://webkit.org/b/178226>
374
375         Reviewed by Chris Fleizach.
376
377         * UIProcess/ios/WKContentViewInteraction.mm:
378         (-[WKContentView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:withFlags:]):
379         - Remove unused lambda variable 'touch' which was also passed as
380           an argument.
381         (-[WKContentView changeSelectionWithTouchesFrom:to:withGesture:withState:]):
382         - Remove unused lambda variable 'gestureState' which was also
383           passed as an argument.
384         (-[WKContentView _simulateLongPressActionAtLocation:]):
385         - Remove unused lambda variable 'location'.
386
387 2017-10-12  John Wilander  <wilander@apple.com>
388
389         ResourceLoadObserver::logFrameNavigation() should use redirectResponse.url()
390         https://bugs.webkit.org/show_bug.cgi?id=175257
391         <rdar://problem/33359866>
392
393         Reviewed by Brent Fulgham.
394
395         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
396         (-[WKWebsiteDataStore _resourceLoadStatisticsIsRegisteredAsSubFrameUnder:topFrameHost:completionHandler:]):
397         (-[WKWebsiteDataStore _resourceLoadStatisticsIsRegisteredAsRedirectingTo:hostRedirectedTo:completionHandler:]):
398             Test infrastructure.
399         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
400         * UIProcess/WebResourceLoadStatisticsStore.cpp:
401         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder):
402         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo):
403             Test infrastructure.
404         * UIProcess/WebResourceLoadStatisticsStore.h:
405
406 2017-10-12  Andy Estes  <aestes@apple.com>
407
408         [iOS] Conditionally rename DatabaseProcess to StorageProcess when building for iOS devices
409         https://bugs.webkit.org/show_bug.cgi?id=178181
410         <rdar://problem/33660282>
411
412         Reviewed by Dan Bernstein.
413
414         * Configurations/BaseTarget.xcconfig:
415         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
416         (WebKit::serviceName):
417         * WebKit.xcodeproj/project.pbxproj:
418
419 2017-10-12  Youenn Fablet  <youenn@apple.com>
420
421         CacheStorage persistent folder should be in /Library/Cache
422         https://bugs.webkit.org/show_bug.cgi?id=178193
423
424         Reviewed by Brady Eidson.
425
426         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
427         (API::WebsiteDataStore::defaultCacheStorageDirectory): Making CacheStorage
428         directory a subfolder of Caches folder.
429         (API::WebsiteDataStore::defaultDataStoreConfiguration):
430         * UIProcess/WebProcessPool.cpp:
431         (WebKit::legacyWebsiteDataStoreConfiguration):
432         (WebKit::WebProcessPool::ensureNetworkProcess): Make sure the web site data store
433         has the right cache directory path. Also make sure that the quota is set even if there is no folder specified.
434         Quota may still be useful in case of non persistent sessions.
435         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
436         (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
437         * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
438         (API::WebsiteDataStore::defaultCacheStorageDirectory):
439
440 2017-10-11  Sam Weinig  <sam@webkit.org>
441
442         Remove out-parameter variants of copyToVector
443         https://bugs.webkit.org/show_bug.cgi?id=178155
444
445         Reviewed by Tim Horton.
446
447         * Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
448         (-[_WKRemoteObjectInterface debugDescription]):
449         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
450         (WebKit::dump):
451         * UIProcess/WebPageProxy.cpp:
452         (WebKit::WebPageProxy::resetState):
453         * UIProcess/WebProcessPool.cpp:
454         (WebKit::WebProcessPool::createNewWebProcess):
455         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
456         (WebKit::WebsiteDataStore::parameters):
457         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
458         (WebKit::WebsiteDataStore::pendingCookies const):
459         * UIProcess/ios/ProcessAssertionIOS.mm:
460         (-[WKProcessAssertionBackgroundTaskManager _notifyClientsOfImminentSuspension]):
461         * WebProcess/Cookies/WebCookieManager.cpp:
462         (WebKit::WebCookieManager::getHostnamesWithCookies):
463         * WebProcess/Geolocation/WebGeolocationManager.cpp:
464         (WebKit::WebGeolocationManager::didChangePosition):
465         (WebKit::WebGeolocationManager::didFailToDeterminePosition):
466         * WebProcess/Network/WebLoaderStrategy.cpp:
467         (WebKit::WebLoaderStrategy::internallyFailedLoadTimerFired):
468
469             Replace out-parameter based copyToVector, with one that returns a Vector.
470
471 2017-10-11  Jaehun Lim  <ljaehun.lim@samsung.com>
472
473         Fix debug build
474
475         Unreviewed.
476
477         Add ENABLE(SERVICE_WORKER) guard.
478
479         * UIProcess/WebProcessPool.cpp:
480         (WebKit::WebProcessPool::createWebPage):
481
482 2017-10-11  Youenn Fablet  <youenn@apple.com>
483
484         Add API to clean CacheStorage data
485         https://bugs.webkit.org/show_bug.cgi?id=178034
486
487         Unreviewed.
488
489         * NetworkProcess/NetworkProcess.cpp:
490         (WebKit::NetworkProcess::fetchWebsiteData): Fixing lifetime of aggregator.
491
492 2017-10-11  Youenn Fablet  <youenn@apple.com>
493
494         Add API to clean CacheStorage data
495         https://bugs.webkit.org/show_bug.cgi?id=178034
496
497         Reviewed by Chris Dumez.
498
499         Introducing a new website data type for DOMCache.
500         Adding API to delete DOMCache for a given origin or for all origins.
501         This is added to WKWebsiteDataStore.
502
503         Cleaning a CacheStorage will remove all data in the Cache object but the object will stay live
504         for the duration of the NetworkProcess.
505         This allows ensuring that once a cache is cleaned, WebProcess will update to this new state.
506
507         Fetching of WebsiteData for DOMCache is not implemented yet since we do not keep a list of all origins for which we have data.
508
509         * NetworkProcess/NetworkProcess.cpp:
510         (WebKit::fetchDOMCacheEntries):
511         (WebKit::NetworkProcess::fetchWebsiteData):
512         (WebKit::NetworkProcess::deleteWebsiteData):
513         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
514         * NetworkProcess/cache/CacheStorageEngine.cpp:
515         (WebKit::CacheStorage::Engine::cachesRootPath):
516         (WebKit::CacheStorage::Engine::fetchEntries):
517         (WebKit::CacheStorage::ClearTasksHandler::ClearTasksHandler):
518         (WebKit::CacheStorage::ClearTasksHandler::~ClearTasksHandler):
519         (WebKit::CacheStorage::Engine::clearEngines):
520         (WebKit::CacheStorage::Engine::clearCachesForOrigins):
521         (WebKit::CacheStorage::Engine::readCachesFromDisk):
522         (WebKit::CacheStorage::deleteFolder):
523         (WebKit::CacheStorage::Engine::clearCaches):
524         (WebKit::CacheStorage::Engine::unlock): Removing the assertion as Cache objects are removed when clearing data.
525         * NetworkProcess/cache/CacheStorageEngine.h:
526         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
527         (WebKit::CacheStorage::Caches::Caches):
528         (WebKit::CacheStorage::Caches::clear):
529         * NetworkProcess/cache/CacheStorageEngineCaches.h:
530         (WebKit::CacheStorage::Caches::create):
531         * Shared/WebsiteData/WebsiteDataType.h:
532         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
533         (WKWebsiteDataStoreRemoveAllDOMCaches):
534         (WKWebsiteDataStoreRemoveDOMCacheForOrigin):
535         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
536         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
537         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
538         (dataTypesToString):
539         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
540         (WebKit::toWebsiteDataType):
541         (WebKit::toWKWebsiteDataTypes):
542         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
543         (+[WKWebsiteDataStore allWebsiteDataTypes]):
544         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
545         (WebKit::computeNetworkProcessAccessTypeForDataFetch):
546         (WebKit::computeNetworkProcessAccessTypeForDataRemoval):
547
548 2017-10-11  Chris Dumez  <cdumez@apple.com>
549
550         [Geolocation] Expose Coordinates.floorLevel
551         https://bugs.webkit.org/show_bug.cgi?id=178173
552         <rdar://problem/34918936>
553
554         Reviewed by Ryosuke Niwa.
555
556         * UIProcess/API/C/WKGeolocationPosition.cpp:
557         (WKGeolocationPositionCreate):
558         (WKGeolocationPositionCreate_b):
559         (WKGeolocationPositionCreate_c):
560         * UIProcess/API/C/WKGeolocationPosition.h:
561
562 2017-10-11  Youenn Fablet  <youenn@apple.com>
563
564         Bump default cache storage quota to 20MB
565         https://bugs.webkit.org/show_bug.cgi?id=178132
566
567         Reviewed by Alex Christensen.
568
569         Adding the ability to set the quota per origin through WebsiteDataStore.
570         Moving cache storage directory setting also in WebsiteDataStore.
571
572         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
573         (WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession):
574         * NetworkProcess/NetworkProcess.cpp:
575         (WebKit::NetworkProcess::initializeNetworkProcess):
576         * NetworkProcess/mac/RemoteNetworkingContext.mm:
577         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
578         * Shared/WebsiteDataStoreParameters.cpp:
579         (WebKit::WebsiteDataStoreParameters::encode const):
580         (WebKit::WebsiteDataStoreParameters::decode):
581         * Shared/WebsiteDataStoreParameters.h:
582         * UIProcess/API/APIProcessPoolConfiguration.cpp:
583         (API::ProcessPoolConfiguration::createWithLegacyOptions):
584         (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
585         (API::ProcessPoolConfiguration::ProcessPoolConfiguration):
586         (API::ProcessPoolConfiguration::copy):
587         * UIProcess/API/APIProcessPoolConfiguration.h:
588         * UIProcess/API/C/WKContextConfigurationRef.cpp:
589         * UIProcess/API/C/WKContextConfigurationRef.h:
590         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
591         (-[WKWebsiteDataStore _cacheStoragePerOriginQuota]):
592         (-[WKWebsiteDataStore _setCacheStoragePerOriginQuota:]):
593         (-[WKWebsiteDataStore _cacheStorageDirectory]):
594         (-[WKWebsiteDataStore _setCacheStorageDirectory:]):
595         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
596         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
597         * UIProcess/WebProcessPool.cpp:
598         (WebKit::legacyWebsiteDataStoreConfiguration):
599         (WebKit::WebProcessPool::ensureNetworkProcess):
600         (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
601         * UIProcess/WebProcessPool.h:
602         * UIProcess/WebsiteData/WebsiteDataStore.h:
603         (WebKit::WebsiteDataStore::cacheStoragePerOriginQuota const):
604         (WebKit::WebsiteDataStore::setCacheStoragePerOriginQuota):
605         (WebKit::WebsiteDataStore::cacheStorageDirectory const):
606         (WebKit::WebsiteDataStore::setCacheStorageDirectory):
607
608 2017-10-11  Myles C. Maxfield  <mmaxfield@apple.com>
609
610         Allow PAL to log messages
611         https://bugs.webkit.org/show_bug.cgi?id=171523
612
613         Reviewed by Alex Christensen.
614
615         * Platform/Logging.h:
616         * Scripts/generate-forwarding-headers.pl:
617
618 2017-10-11  Ryosuke Niwa  <rniwa@webkit.org>
619
620         Sanitize URL in pasteboard for other applications and cross origin content
621         https://bugs.webkit.org/show_bug.cgi?id=178060
622         <rdar://problem/34874518>
623
624         Reviewed by Wenson Hsieh.
625
626         Plubmed the origin identifier through IPC from Pasteboard in WebContent process to PlatformPasteboard in UIProcess.
627
628         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
629         (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
630         * UIProcess/WebPasteboardProxy.cpp:
631         (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
632         * UIProcess/WebPasteboardProxy.h:
633         * UIProcess/WebPasteboardProxy.messages.in:
634         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
635         (WebKit::WebPlatformStrategies::typesSafeForDOMToReadAndWrite):
636         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
637
638 2017-10-11  Chris Dumez  <cdumez@apple.com>
639
640         Modernize Geolocation code
641         https://bugs.webkit.org/show_bug.cgi?id=178148
642
643         Reviewed by Ryosuke Niwa.
644
645         * Shared/WebGeolocationPosition.cpp:
646         (WebKit::WebGeolocationPosition::create):
647         (WebKit::WebGeolocationPosition::~WebGeolocationPosition):
648         * Shared/WebGeolocationPosition.h:
649         (WebKit::WebGeolocationPosition::timestamp const):
650         (WebKit::WebGeolocationPosition::latitude const):
651         (WebKit::WebGeolocationPosition::longitude const):
652         (WebKit::WebGeolocationPosition::accuracy const):
653         (WebKit::WebGeolocationPosition::altitude const):
654         (WebKit::WebGeolocationPosition::altitudeAccuracy const):
655         (WebKit::WebGeolocationPosition::heading const):
656         (WebKit::WebGeolocationPosition::speed const):
657         (WebKit::WebGeolocationPosition::corePosition const):
658         (WebKit::WebGeolocationPosition::WebGeolocationPosition):
659         * UIProcess/API/C/WKGeolocationPosition.cpp:
660         (WKGeolocationPositionCreate_b):
661         * UIProcess/API/Cocoa/_WKGeolocationPosition.mm:
662         (WebKit::wrapper):
663         * UIProcess/API/glib/WebKitGeolocationProvider.cpp:
664         (WebKit::WebKitGeolocationProvider::notifyPositionChanged):
665         * UIProcess/WebGeolocationManagerProxy.cpp:
666         (WebKit::WebGeolocationManagerProxy::providerDidChangePosition):
667         * UIProcess/ios/WKGeolocationProviderIOS.mm:
668         (-[WKLegacyCoreLocationProvider positionChanged:]):
669         * WebProcess/Geolocation/WebGeolocationManager.cpp:
670         (WebKit::WebGeolocationManager::didChangePosition):
671         * WebProcess/Geolocation/WebGeolocationManager.h:
672         * WebProcess/Geolocation/WebGeolocationManager.messages.in:
673         * WebProcess/WebCoreSupport/WebGeolocationClient.cpp:
674         (WebKit::WebGeolocationClient::lastPosition):
675         * WebProcess/WebCoreSupport/WebGeolocationClient.h:
676
677 2017-10-11  Brady Eidson  <beidson@apple.com>
678
679         Add a SW context process (where SW scripts will actually execute).
680         https://bugs.webkit.org/show_bug.cgi?id=178156
681
682         Reviewed by Andy Estes.
683
684         This patch adds an auxiliary "ServiceWorker context" WebProcess to a WebProcessPool.
685
686         This process is where ServiceWorker scripts will execute, separate from the client WebProcess
687         hosting the page(s) they are serving.
688
689         This patch also adds all of the plumbing to pass along a fetched service worker script to this
690         context WebProcess, as well as message back failure to actually start the script so we can test.
691
692         Touches lots of code sites but is basically just a lot of plumbing.
693
694         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
695         (WebKit::WebSWServerConnection::WebSWServerConnection):
696         (WebKit::WebSWServerConnection::startServiceWorkerContext):
697         (WebKit::WebSWServerConnection::sendToContextProcess):
698         (WebKit::WebSWServerConnection::setContextConnection):
699         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
700
701         * StorageProcess/StorageProcess.cpp:
702         (WebKit::StorageProcess::workerContextProcessConnection):
703         (WebKit::StorageProcess::createWorkerContextProcessConnection):
704         (WebKit::StorageProcess::didGetWorkerContextProcessConnection):
705         (WebKit::StorageProcess::serviceWorkerContextFailedToStart):
706         (WebKit::StorageProcess::registerSWServerConnection):
707         (WebKit::StorageProcess::unregisterSWServerConnection):
708         * StorageProcess/StorageProcess.h:
709         * StorageProcess/StorageProcess.messages.in:
710
711         * StorageProcess/StorageToWebProcessConnection.cpp:
712         (WebKit::StorageToWebProcessConnection::~StorageToWebProcessConnection):
713         (WebKit::StorageToWebProcessConnection::establishSWServerConnection):
714         (WebKit::StorageToWebProcessConnection::removeSWServerConnection):
715         (WebKit::StorageToWebProcessConnection::workerContextProcessConnectionCreated):
716         * StorageProcess/StorageToWebProcessConnection.h:
717
718         * UIProcess/Storage/StorageProcessProxy.cpp:
719         (WebKit::StorageProcessProxy::create):
720         (WebKit::StorageProcessProxy::StorageProcessProxy):
721         (WebKit::StorageProcessProxy::didClose):
722         (WebKit::StorageProcessProxy::getWorkerContextProcessConnection):
723         (WebKit::StorageProcessProxy::didGetWorkerContextProcessConnection):
724         * UIProcess/Storage/StorageProcessProxy.h:
725         * UIProcess/Storage/StorageProcessProxy.messages.in:
726
727         * UIProcess/WebProcessPool.cpp:
728         (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
729         (WebKit::WebProcessPool::getWorkerContextProcessConnection):
730         (WebKit::WebProcessPool::didGetWorkerContextProcessConnection):
731         (WebKit::WebProcessPool::disconnectProcess):
732         (WebKit::WebProcessPool::createWebPage):
733         * UIProcess/WebProcessPool.h:
734
735         * UIProcess/WebProcessProxy.cpp:
736         (WebKit::WebProcessProxy::didGetWorkerContextConnection):
737         * UIProcess/WebProcessProxy.h:
738         * UIProcess/WebProcessProxy.messages.in:
739
740         * WebProcess/WebProcess.cpp:
741         (WebKit::WebProcess::getWorkerContextConnection):
742         (WebKit::WebProcess::startServiceWorkerContext):
743         * WebProcess/WebProcess.h:
744         * WebProcess/WebProcess.messages.in:
745
746 2017-10-11  Don Olmstead  <don.olmstead@sony.com>
747
748         Remove ENABLE_NETWORK_CACHE
749         https://bugs.webkit.org/show_bug.cgi?id=177424
750
751         Reviewed by Antti Koivisto.
752
753         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
754         (WebKit::NetworkConnectionToWebProcess::storeDerivedDataToCache):
755         * NetworkProcess/NetworkConnectionToWebProcess.h:
756         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
757         * NetworkProcess/NetworkProcess.cpp:
758         (WebKit::fetchDiskCacheEntries):
759         (WebKit::clearDiskCacheEntries):
760         (WebKit::NetworkProcess::setCacheModel):
761         * NetworkProcess/NetworkProcess.h:
762         (WebKit::NetworkProcess::cache):
763         * NetworkProcess/NetworkProcessCreationParameters.cpp:
764         (WebKit::NetworkProcessCreationParameters::encode const):
765         (WebKit::NetworkProcessCreationParameters::decode):
766         * NetworkProcess/NetworkProcessCreationParameters.h:
767         * NetworkProcess/NetworkResourceLoader.cpp:
768         (WebKit::NetworkResourceLoader::NetworkResourceLoader):
769         (WebKit::NetworkResourceLoader::canUseCachedRedirect const):
770         (WebKit::NetworkResourceLoader::start):
771         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
772         (WebKit::NetworkResourceLoader::startNetworkLoad):
773         (WebKit::NetworkResourceLoader::abort):
774         (WebKit::NetworkResourceLoader::didReceiveResponse):
775         (WebKit::NetworkResourceLoader::didReceiveBuffer):
776         (WebKit::NetworkResourceLoader::didFinishLoading):
777         (WebKit::NetworkResourceLoader::didFailLoading):
778         (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
779         (WebKit::NetworkResourceLoader::continueWillSendRequest):
780         (WebKit::NetworkResourceLoader::dispatchWillSendRequestForCacheEntry):
781         * NetworkProcess/NetworkResourceLoader.h:
782         * NetworkProcess/cache/NetworkCache.cpp:
783         * NetworkProcess/cache/NetworkCache.h:
784         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
785         * NetworkProcess/cache/NetworkCacheBlobStorage.h:
786         * NetworkProcess/cache/NetworkCacheCoders.cpp:
787         * NetworkProcess/cache/NetworkCacheCoders.h:
788         * NetworkProcess/cache/NetworkCacheCodersCocoa.cpp:
789         * NetworkProcess/cache/NetworkCacheCodersSoup.cpp:
790         * NetworkProcess/cache/NetworkCacheData.cpp:
791         * NetworkProcess/cache/NetworkCacheData.h:
792         * NetworkProcess/cache/NetworkCacheDataCocoa.mm:
793         * NetworkProcess/cache/NetworkCacheDataSoup.cpp:
794         * NetworkProcess/cache/NetworkCacheEntry.cpp:
795         * NetworkProcess/cache/NetworkCacheEntry.h:
796         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
797         * NetworkProcess/cache/NetworkCacheFileSystem.h:
798         * NetworkProcess/cache/NetworkCacheIOChannel.h:
799         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
800         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
801         * NetworkProcess/cache/NetworkCacheKey.cpp:
802         * NetworkProcess/cache/NetworkCacheKey.h:
803         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
804         * NetworkProcess/cache/NetworkCacheStatistics.h:
805         * NetworkProcess/cache/NetworkCacheStorage.cpp:
806         * NetworkProcess/cache/NetworkCacheStorage.h:
807         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
808         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
809         (WebKit::NetworkProcess::clearDiskCache):
810         * NetworkProcess/ios/NetworkProcessIOS.mm:
811         (WebKit::NetworkProcess::clearCacheForAllOrigins):
812         * NetworkProcess/soup/NetworkProcessSoup.cpp:
813         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
814         (WebKit::NetworkProcess::clearDiskCache):
815         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
816         (WebKit::registerUserDefaultsIfNeeded):
817         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
818         (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
819         (WebKit::WebProcessPool::isNetworkCacheEnabled):
820         * UIProcess/soup/WebProcessPoolSoup.cpp:
821         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
822         * WebProcess/Network/WebLoaderStrategy.cpp:
823         (WebKit::WebLoaderStrategy::storeDerivedDataToCache):
824         * config.h:
825
826 2017-10-11  Michael Catanzaro  <mcatanzaro@igalia.com>
827
828         Unreviewed, rolling out r223146.
829
830         Better to not expose cairo in the WPE API
831
832         Reverted changeset:
833
834         "[WPE] Header cairo.h is used in GLib API headers but cannot
835         be found"
836         https://bugs.webkit.org/show_bug.cgi?id=178100
837         http://trac.webkit.org/changeset/223146
838
839 2017-09-27  Frederic Wang  <fwang@igalia.com>
840
841         [iOS] Do not flatten frames when async frame scrolling is enabled
842         https://bugs.webkit.org/show_bug.cgi?id=173704
843
844         Reviewed by Simon Fraser.
845
846         This patch disables frame flattening when async frame scrolling is enabled on iOS, as
847         otherwise you can not scroll them. Once iframe scrolling is implemented in iOS (bug 149264),
848         developers and beta testers will be able to check it by enabling "Async Frame Scrolling"
849         in the "Experimental WebKit Features" menu of Safari iOS.
850
851         Test: platform/ios/fast/frames/flattening/iframe-flattening-with-async-frame-scrolling.html
852
853         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
854         (WebKit::WebChromeClient::contentsSizeChanged): Use effectiveFrameFlattening() introduced in
855         Source/WebCore.
856
857 2017-10-10  Ryosuke Niwa  <rniwa@webkit.org>
858
859         Enable custom pasteboard data in DumpRenderTree and WebKitTestRunner
860         https://bugs.webkit.org/show_bug.cgi?id=178154
861
862         Reviewed by Wenson Hsieh.
863
864         Plumbed customPasteboardDataEnabled flag to be used in WebKitTestRunner.
865
866         * Shared/WebPreferencesDefinitions.h:
867         * UIProcess/API/C/WKPreferences.cpp:
868         (WKPreferencesSetCustomPasteboardDataEnabled):
869         (WKPreferencesGetCustomPasteboardDataEnabled):
870         * UIProcess/API/C/WKPreferencesRefPrivate.h:
871         * WebProcess/WebPage/WebPage.cpp:
872         (WebKit::WebPage::updatePreferences):
873
874 2017-10-10  Adrian Perez de Castro  <aperez@igalia.com>
875
876         [WPE] Remove the possibility of installing the old WebKit2 C API
877         https://bugs.webkit.org/show_bug.cgi?id=178125
878
879         Reviewed by Michael Catanzaro.
880
881         * PlatformWPE.cmake: Remove support for installing the deprecated C API.
882
883 2017-10-10  Chris Dumez  <cdumez@apple.com>
884
885         [WK2] Add API to clear service worker registrations
886         https://bugs.webkit.org/show_bug.cgi?id=178085
887         <rdar://problem/34866025>
888
889         Reviewed by Ryosuke Niwa.
890
891         Add API to clear service worker registrations. Although the request to
892         clear the registration is passed on to the StorageProcess, it is currently
893         a no-op on StorageProcess side until we actually persist service worker
894         registrations on disk.
895
896         * Shared/WebsiteData/WebsiteDataType.h:
897         * StorageProcess/StorageProcess.cpp:
898         (WebKit::StorageProcess::fetchWebsiteData):
899         (WebKit::StorageProcess::deleteWebsiteData):
900         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
901         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
902         (WKWebsiteDataStoreRemoveAllServiceWorkerRegistrations):
903         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
904         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
905         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
906         (dataTypesToString):
907         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
908         (WebKit::toWebsiteDataType):
909         (WebKit::toWKWebsiteDataTypes):
910         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
911         (+[WKWebsiteDataStore allWebsiteDataTypes]):
912         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
913         (WebKit::WebsiteDataStore::fetchDataAndApply):
914         (WebKit::WebsiteDataStore::removeData):
915
916 2017-10-10  Commit Queue  <commit-queue@webkit.org>
917
918         Unreviewed, rolling out r223130.
919         https://bugs.webkit.org/show_bug.cgi?id=178147
920
921         Breaks the build when EGLNativeWindowType is a pointer
922         (Requested by aperezdc on #webkit).
923
924         Reverted changeset:
925
926         "[WPE] Build failure due to invalid cast of
927         EGLNativeWindowType when targetting 64-bit ARM"
928         https://bugs.webkit.org/show_bug.cgi?id=178090
929         http://trac.webkit.org/changeset/223130
930
931 2017-10-10  Sam Weinig  <sam@webkit.org>
932
933         Replace copyKeysToVector/copyValuesToVector with copyToVector(map.keys())/copyToVector(map.values())
934         https://bugs.webkit.org/show_bug.cgi?id=178102
935
936         Reviewed by Tim Horton.
937
938         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
939         (WebKit::NetworkConnectionToWebProcess::didClose):
940         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
941         (WebKit::dumpChangedLayers):
942         * UIProcess/API/glib/WebKitWebContext.cpp:
943         (webkitWebContextInvalidateCustomProtocolRequests):
944         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
945         (webkitWebViewBaseContainerForall):
946         * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
947         (-[WKWebViewContentProviderRegistry _mimeTypesWithCustomContentProviders]):
948         * UIProcess/GenericCallback.h:
949         (WebKit::invalidateCallbackMap):
950         * UIProcess/WebProcessProxy.cpp:
951         (WebKit::WebProcessProxy::shutDown):
952         (WebKit::WebProcessProxy::didClose):
953         (WebKit::WebProcessProxy::didBecomeUnresponsive):
954         (WebKit::WebProcessProxy::didBecomeResponsive):
955         (WebKit::WebProcessProxy::willChangeIsResponsive):
956         (WebKit::WebProcessProxy::didChangeIsResponsive):
957         (WebKit::WebProcessProxy::disconnectFramesFromPage):
958         (WebKit::WebProcessProxy::frameCountInPage const):
959         (WebKit::WebProcessProxy::requestTermination):
960         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
961         (WebKit::NPRuntimeObjectMap::invalidate):
962         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
963         (WebKit::NetscapePlugin::stopAllStreams):
964         * WebProcess/Plugins/PluginView.cpp:
965         (WebKit::PluginView::cancelAllStreams):
966         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
967         (WebKit::RemoteLayerTreeContext::buildTransaction):
968         * WebProcess/WebProcess.cpp:
969         (WebKit::WebProcess::didClose):
970
971 2017-10-10  Adrian Perez de Castro  <aperez@igalia.com>
972
973         [WPE] Header cairo.h is used in GLib API headers but cannot be found
974         https://bugs.webkit.org/show_bug.cgi?id=178100
975
976         Reviewed by Michael Catanzaro.
977
978         * wpe/wpe-webkit.pc.in: Add Cairo to the "Requires" field, so its flags get pulled
979         in and the "cairo.h", used in the WPE WebKit GLib API headers, can be found.
980
981 2017-10-10  Michael Catanzaro  <mcatanzaro@igalia.com>
982
983         CSS constant properties should not be enabled by default
984         https://bugs.webkit.org/show_bug.cgi?id=177416
985
986         Reviewed by Darin Adler.
987
988         * Shared/WebPreferencesDefinitions.h:
989
990 2017-10-10  Brady Eidson  <beidson@apple.com>
991
992         Random StorageProcess and SWServer cleanup.
993         https://bugs.webkit.org/show_bug.cgi?id=178141
994
995         Reviewed by Andy Estes.
996
997         -StorageProcess should own the set of SWServers
998         -Some renaming and cleanup
999
1000         * StorageProcess/StorageProcess.cpp:
1001         (WebKit::StorageProcess::createStorageToWebProcessConnection):
1002         (WebKit::StorageProcess::swServerForSession):
1003         * StorageProcess/StorageProcess.h:
1004         (WebKit::StorageProcess::queue):
1005
1006         * StorageProcess/StorageToWebProcessConnection.cpp:
1007         (WebKit::StorageToWebProcessConnection::establishSWServerConnection):
1008         * StorageProcess/StorageToWebProcessConnection.h:
1009
1010 2017-10-10  Michael Catanzaro  <mcatanzaro@igalia.com>
1011
1012         Unreviewed, rolling out r223136.
1013
1014         Forgot to update GTK API header
1015
1016         Reverted changeset:
1017
1018         "[WPE] Header cairo.h is used in GLib API headers but cannot
1019         be found"
1020         https://bugs.webkit.org/show_bug.cgi?id=178100
1021         http://trac.webkit.org/changeset/223136
1022
1023 2017-10-10  Adrian Perez de Castro  <aperez@igalia.com>
1024
1025         [WPE] Header cairo.h is used in GLib API headers but cannot be found
1026         https://bugs.webkit.org/show_bug.cgi?id=178100
1027
1028         Reviewed by Žan Doberšek.
1029
1030         Instead of including <cairo.h>, it is better to forward-declare cairo_surface_t,
1031         which is the one and only Cairo declaration needed by the WPE API header.
1032
1033         * UIProcess/API/glib/WebKitFaviconDatabase.cpp: Add inclusion of <cairo.h>.
1034         * UIProcess/API/glib/WebKitWebView.cpp: Add inclusion of <cairo.h>.
1035         * UIProcess/API/wpe/WebKitFaviconDatabase.h: Add forward declaration of cairo_surface_t.
1036
1037 2017-10-10  Adrian Perez de Castro  <aperez@igalia.com>
1038
1039         [WPE] Cannot link against libWPEWebkit due to wrong contents of wpe-webkit.pc
1040         https://bugs.webkit.org/show_bug.cgi?id=178133
1041
1042         Reviewed by Žan Doberšek.
1043
1044         * wpe/wpe-webkit.pc.in: Remove "-lWPE" and replace "Requires.private" with a plain "Requires".
1045
1046 2017-10-10  Adrian Perez de Castro  <aperez@igalia.com>
1047
1048         [WPE] Build failure due to invalid cast of EGLNativeWindowType when targetting 64-bit ARM
1049         https://bugs.webkit.org/show_bug.cgi?id=178090
1050
1051         Reviewed by Žan Doberšek.
1052
1053         * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp:
1054         (WebKit::AcceleratedSurfaceWPE::window const): Use static_cast instead of reinterpret_cast,
1055         this way extending values of EGLNativeWindowType to 64 bits is allowed.
1056
1057 2017-10-10  Adrian Perez de Castro  <aperez@igalia.com>
1058
1059         [WPE] GLib API headers WebKitScriptDialog.h and WebKitFileChooserRequest.h are not installed
1060         https://bugs.webkit.org/show_bug.cgi?id=178104
1061
1062         Reviewed by Žan Doberšek.
1063
1064         * PlatformWPE.cmake: Add missing header paths to the WPE_API_INSTALLED_HEADERS variable.
1065
1066 2017-10-10  Adrian Perez de Castro  <aperez@igalia.com>
1067
1068         [WPE][CMake] The “install” target should install all public API headers
1069         https://bugs.webkit.org/show_bug.cgi?id=176475
1070
1071         Reviewed by Žan Doberšek.
1072
1073         Install the WPE port GLib-based API headers. The deprecated C API is still available,
1074         but disabled by default behind the "EXPORT_DEPRECATED_WEBKIT2_C_API" CMake option.
1075
1076         * PlatformWPE.cmake: Always install "wpe-webkit.pc" and the GLib C API for WPE.
1077
1078 2017-10-09  Jeremy Jones  <jeremyj@apple.com>
1079
1080         Fix typo of virtual keyword in PageClientImplIOS.h
1081         https://bugs.webkit.org/show_bug.cgi?id=178088
1082
1083         Reviewed by Simon Fraser.
1084
1085         This compile error happens when FULLSCREEN_API is enabled for iOS.
1086         Remove the redundant virtual keyword since function is marked override.
1087
1088         * UIProcess/ios/PageClientImplIOS.h:
1089
1090 2017-10-09  Chris Dumez  <cdumez@apple.com>
1091
1092         [iOS][WK2] Tiles outsides the viewport are sometimes missing after relaunching a crashes WebProcess
1093         https://bugs.webkit.org/show_bug.cgi?id=178095
1094         <rdar://problem/34415016>
1095
1096         Reviewed by Simon Fraser.
1097
1098         Make sure we reset WKWebView._hasScheduledVisibleRectUpdate to NO in WKWebView._processDidExit.
1099         _scheduleVisibleContentRectUpdateAfterScrollInView would otherwise return early because
1100         WKWebView._hasScheduledVisibleRectUpdate is always YES. Normally,
1101         _addUpdateVisibleContentRectPreCommitHandler sets a CATransaction commit handler that
1102         resets _hasScheduledVisibleRectUpdate to NO, but it does not do so when ![webView _isValid]
1103         (which is true when the WebProcess has crashed.
1104
1105         Also reset WKWebView._commitDidRestoreScrollPosition to NO in WKWebView._processDidExit even
1106         though it does not seem to be the cause of this bug. It seems to make sense to reset this member
1107         when the process crashes.
1108
1109         * UIProcess/API/Cocoa/WKWebView.mm:
1110         (-[WKWebView _processDidExit]):
1111
1112 2017-10-09  Youenn Fablet  <youenn@apple.com>
1113
1114         Add quota to cache API
1115         https://bugs.webkit.org/show_bug.cgi?id=177552
1116
1117         Reviewed by Alex Christensen.
1118
1119         Adding support for quota checking in CacheStorage::Caches.
1120         It is passed to NetworkProcess at creation time.
1121         Default quota size is configured to 400Ko by origin per default.
1122         This value is suitable for testing.
1123         Future patch should raise this default value and allows configuring it.
1124
1125         Quota is computed based on the response body size.
1126         This size is padded at WebCore for opaque responses.
1127         Size is stored persistently as opaque response padded size should remain stable.
1128         See https://github.com/whatwg/storage/issues/31 for the rationale about this padding.
1129
1130         In case of putting several records at the same time, the size of all records
1131         is computed so that all records will be written or rejected together.
1132
1133         Sending QuotaExceeded error when quota is exceeded.
1134         Future effort should allow asking UIProcess for quota extension.
1135
1136         * NetworkProcess/NetworkProcess.cpp:
1137         (WebKit::NetworkProcess::cacheStoragePerOriginQuota const):
1138         * NetworkProcess/NetworkProcess.h:
1139         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1140         (WebKit::NetworkProcessCreationParameters::encode const):
1141         (WebKit::NetworkProcessCreationParameters::decode):
1142         * NetworkProcess/NetworkProcessCreationParameters.h:
1143         * NetworkProcess/cache/CacheStorageEngine.cpp:
1144         (WebKit::CacheStorage::Engine::readCachesFromDisk):
1145         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
1146         (WebKit::CacheStorage::Cache::toRecordInformation):
1147         (WebKit::CacheStorage::isolatedCopy):
1148         (WebKit::CacheStorage::Cache::open):
1149         (WebKit::CacheStorage::Cache::storeRecords):
1150         (WebKit::CacheStorage::Cache::put):
1151         (WebKit::CacheStorage::Cache::writeRecordToDisk):
1152         (WebKit::CacheStorage::Cache::updateRecordToDisk):
1153         (WebKit::CacheStorage::Cache::removeRecordFromDisk):
1154         (WebKit::CacheStorage::Cache::encode):
1155         (WebKit::CacheStorage::Cache::decodeRecordHeader):
1156         (WebKit::CacheStorage::Cache::decode):
1157         * NetworkProcess/cache/CacheStorageEngineCache.h:
1158         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
1159         (WebKit::CacheStorage::Caches::Caches):
1160         (WebKit::CacheStorage::Caches::initialize):
1161         (WebKit::CacheStorage::Caches::initializeSize):
1162         (WebKit::CacheStorage::Caches::requestSpace):
1163         (WebKit::CacheStorage::Caches::writeRecord):
1164         (WebKit::CacheStorage::Caches::removeRecord):
1165         (WebKit::CacheStorage::Caches::removeCacheEntry):
1166         * NetworkProcess/cache/CacheStorageEngineCaches.h:
1167         (WebKit::CacheStorage::Caches::create):
1168         (WebKit::CacheStorage::Caches::hasEnoughSpace const):
1169         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1170         (WebKit::NetworkCache::Storage::traverse):
1171         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1172         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
1173         * Shared/WebCoreArgumentCoders.cpp:
1174         (IPC::ArgumentCoder<DOMCacheEngine::Record>::encode):
1175         (IPC::ArgumentCoder<DOMCacheEngine::Record>::decode):
1176         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1177         (API::ProcessPoolConfiguration::copy):
1178         * UIProcess/API/APIProcessPoolConfiguration.h:
1179         * UIProcess/WebProcessPool.cpp:
1180         (WebKit::WebProcessPool::ensureNetworkProcess):
1181
1182 2017-10-09  Sam Weinig  <sam@webkit.org>
1183
1184         Make HashMap::keys() and HashMap::values() work with WTF::map/WTF::copyToVector
1185         https://bugs.webkit.org/show_bug.cgi?id=178072
1186
1187         Reviewed by Darin Adler.
1188
1189         * Shared/AsyncRequest.h:
1190         (WebKit::AsyncRequestMap::values):
1191         * UIProcess/WebProcessProxy.h:
1192         (WebKit::WebProcessProxy::pages const):
1193
1194             Update for type change for HashMap::values().
1195
1196 2017-10-09  Jeremy Jones  <jeremyj@apple.com>
1197
1198         Incorrect fullscreen animation when element has a transform.
1199         https://bugs.webkit.org/show_bug.cgi?id=177558
1200         rdar://problem/29603741
1201
1202         Reviewed by Jer Noble.
1203
1204         Use a bit of code from element fullscreen to do this correctly for video fullscreen.
1205         The key is to get the absolute quad from the renderer. This will work for scaling,
1206         But since we still take the bounding box, it won't work for rotations.
1207
1208         * WebProcess/cocoa/VideoFullscreenManager.mm:
1209         (WebKit::inlineVideoFrame):
1210
1211 2017-10-09  Robin Morisset  <rmorisset@apple.com>
1212
1213         Make the names of the options consistent
1214         https://bugs.webkit.org/show_bug.cgi?id=177933
1215
1216         Reviewed by Saam Barati.
1217
1218         * NetworkProcess/capture/json.hpp:
1219         * Platform/IPC/Connection.cpp:
1220         (IPC::Connection::connectionDidClose):
1221         * UIProcess/API/Cocoa/WKWebView.mm:
1222         (-[WKWebView _keyboardWillHide:]):
1223         * UIProcess/WebPageProxy.cpp:
1224         (WebKit::WebPageProxy::runModal):
1225         * UIProcess/mac/WebInspectorProxyMac.mm:
1226         (WebKit::WebInspectorProxy::inspectedViewFrameDidChange):
1227         * WebProcess/WebPage/ios/WebPageIOS.mm:
1228         (WebKit::WebPage::selectWithGesture):
1229
1230 2017-10-09  Adrian Perez de Castro  <aperez@igalia.com>
1231
1232         [WPE][GTK] Propagate libepoxy compiler flags obtained from pkg-config
1233         https://bugs.webkit.org/show_bug.cgi?id=178081
1234
1235         Reviewed by Carlos Alberto Lopez Perez.
1236
1237         * CMakeLists.txt: Use ${LIBEPOXY_DEFINITIONS} for building WebKit.
1238
1239 2017-10-08  Tim Horton  <timothy_horton@apple.com>
1240
1241         mediaPlaybackRequiresUserAction API replacement annotation is wrong
1242         https://bugs.webkit.org/show_bug.cgi?id=178063
1243
1244         Reviewed by Dan Bernstein.
1245
1246         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
1247         mediaPlaybackRequiresUserAction suggests that you should use 
1248         requiresUserActionForMediaPlayback instead, but that is also deprecated.
1249         Instead, follow the chain and suggest mediaTypesRequiringUserActionForPlayback.
1250
1251 2017-10-06  Wenson Hsieh  <wenson_hsieh@apple.com>
1252
1253         [iOS WK2] API tests added in r222991 are failing in iOS 11 test runners
1254         https://bugs.webkit.org/show_bug.cgi?id=178037
1255
1256         Reviewed by Tim Horton.
1257
1258         This patch carries out some minor cleanup around UIKitSPI.h in WebKit2, so that the internal SDK isn't required
1259         to implement -[WKContentView insertTextSuggestion:].
1260
1261         * Platform/spi/ios/UIKitSPI.h:
1262         * UIProcess/ios/WKContentViewInteraction.mm:
1263         (-[WKContentView insertTextSuggestion:]):
1264
1265 2017-10-06  Chris Dumez  <cdumez@apple.com>
1266
1267         [Beacon][Cocoa] Beacon requests with BufferSource payload should not have a Content-Type HTTP header
1268         https://bugs.webkit.org/show_bug.cgi?id=178027
1269         <rdar://problem/34748470>
1270
1271         Reviewed by Youenn Fablet.
1272
1273         Use new NSURLSessionConfiguration._suppressedAutoAddedHTTPHeaders CFNetwork SPI to
1274         make sure that CFNetwork never adds a Content-Type HTTP headers to our requests
1275         when we did not add one.
1276
1277         This is covered by the following tests on newer OSes:
1278         - imported/w3c/web-platform-tests/beacon/headers/header-content-type.html
1279         - http/tests/blink/sendbeacon/beacon-same-origin.html
1280
1281         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1282         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
1283
1284 2017-10-06  Aishwarya Nirmal  <anirmal@apple.com>
1285
1286         [iOS] Respect the "caret-color" CSS property when editing 
1287         https://bugs.webkit.org/show_bug.cgi?id=177489
1288         <rdar://problem/34600419>
1289
1290         Reviewed by Tim Horton.
1291
1292         This change adds support for the caret-color property on iOS.
1293
1294         * Shared/EditorState.cpp:
1295         (WebKit::EditorState::PostLayoutData::encode const):
1296         (WebKit::EditorState::PostLayoutData::decode):
1297         * Shared/EditorState.h:
1298         * UIProcess/ios/WKContentViewInteraction.mm:
1299         (-[WKContentView insertionPointColor]):
1300         * WebProcess/WebPage/ios/WebPageIOS.mm:
1301         (WebKit::WebPage::platformEditorState const):
1302
1303 2017-10-06  Brian Burg  <bburg@apple.com>
1304
1305         Web Inspector: clicking in Inspector webview clears the selection in the inspected page
1306         https://bugs.webkit.org/show_bug.cgi?id=178014
1307         <rdar://problem/12706857>
1308
1309         Reviewed by Timothy Hatcher.
1310
1311         If the Inspector is docked to the inspected view, clicking on the Inspector
1312         webview will cause selection in the inspected view to be lost. This is because
1313         the selection is lost when the web view resigns first responder.
1314
1315         Add a check in maintainsInactiveSelection to always retain selection if
1316         Web Inspector is open. This approach seems simpler than trying to sync a client's
1317         usage of WKPageSetMaintainsInactiveSelection with overrides that need to be applied
1318         and unapplied when an inspector web view is shown or hidden.
1319
1320         * UIProcess/WebPageProxy.cpp:
1321         (WebKit::WebPageProxy::maintainsInactiveSelection const):
1322         (WebKit::WebPageProxy::inspector const): Drive by, use nullptr.
1323
1324         * UIProcess/WebPageProxy.h:
1325         (WebKit::WebPageProxy::maintainsInactiveSelection const): Deleted.
1326
1327 2017-10-06  Alex Christensen  <achristensen@webkit.org>
1328
1329         Add more infrastructure to apply custom headers to same-origin requests
1330         https://bugs.webkit.org/show_bug.cgi?id=177629
1331
1332         Reviewed by Ryosuke Niwa.
1333
1334         * UIProcess/API/C/WKWebsitePolicies.cpp:
1335         (WKWebsitePoliciesCopyCustomHeaderFields):
1336         (WKWebsitePoliciesSetCustomHeaderFields):
1337         * UIProcess/API/C/WKWebsitePolicies.h:
1338         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
1339         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
1340         (-[_WKWebsitePolicies customHeaderFields]):
1341         (-[_WKWebsitePolicies setCustomHeaderFields:]):
1342
1343         Make the SPI for setting custom header fields take a dictionary<String, String>
1344         instead of an array of Strings with colons. This matches NSURLRequest and other
1345         APIs that deal with header fields.
1346
1347 2017-10-06  Wenson Hsieh  <wenson_hsieh@apple.com>
1348
1349         [iOS] Tweak support for classifying form controls (followup to r222487)
1350         https://bugs.webkit.org/show_bug.cgi?id=177917
1351         <rdar://problem/34820122>
1352
1353         Reviewed by Dean Jackson.
1354
1355         This patch follows up with <http://trac.webkit.org/r222487>. It combines the functionality of two SPI hooks
1356         implemented on WKContentView into a single method that vends a context dictionary, and additionally addresses an
1357         issue with the original implementation, wherein some cached state on WebPageProxy is set upon starting node
1358         assistance, but is never unset when stopping node assistance, nor set anywhere else. See per-method comments for
1359         more detail.
1360
1361         * UIProcess/WebPageProxy.h:
1362
1363         Remove members m_acceptsAutofilledLoginCredentials and m_representingPageURL from WebPageProxy. This state is
1364         retrieved from the AssistedNodeInformation struct when starting node assistance, but is never reset anywhere
1365         else. Instead of introducing new members to remember this state, we can just use the WKContentView's current
1366         assisted node information.
1367
1368         This also means that programmatically focusing forms (without user gesture) will no longer cause WKContentView
1369         to accept autofilled login credentials, since we bail out of node assistance and don't begin an input session.
1370
1371         * UIProcess/ios/WKContentView.mm:
1372         (-[WKContentView acceptsAutofilledLoginCredentials]): Deleted.
1373         (-[WKContentView representingPageURL]): Deleted.
1374         * UIProcess/ios/WKContentViewInteraction.mm:
1375         (-[WKContentView _autofillContext]):
1376
1377         Merge functionality of the previous two SPI hooks, such that -_autofillContext will return a non-null dictionary
1378         containing the URL of the focused element's document if and only if WKContentView accepts autofilled login
1379         credentials, and there exists a representing page URL.
1380
1381         When the page stops assisting the focused node, we set the AssistedNodeInformation's element type to None, so we
1382         additionally bail and return nil if the element type is None. As an aside, it seems a more reasonable approach to
1383         resetting state upon stopping node assistance is to just completely reset _assistedNodeInformation to its initial
1384         value, i.e. via _assistedNodeInformation = { }. It's not clear whether there are behaviors relying on the fact
1385         that all members but the element type in the content view's assisted node information could be stale, so this
1386         seems worthy of some investigation.
1387
1388         * UIProcess/ios/WebPageProxyIOS.mm:
1389         (WebKit::WebPageProxy::startAssistingNode):
1390         (WebKit::WebPageProxy::acceptsAutofilledLoginCredentials): Deleted.
1391         (WebKit::WebPageProxy::representingPageURL): Deleted.
1392
1393 2017-10-06  Yousuke Kimoto  <yousuke.kimoto@sony.com>
1394
1395         [WinCairo] Add shared curl files
1396         https://bugs.webkit.org/show_bug.cgi?id=177999
1397
1398         Reviewed by Alex Christensen.
1399
1400         * PlatformWin.cmake:
1401         * Shared/Authentication/curl/AuthenticationManagerCurl.cpp: Added.
1402         (WebKit::AuthenticationManager::receivedCredential):
1403         (WebKit::AuthenticationManager::receivedRequestToContinueWithoutCredential):
1404         (WebKit::AuthenticationManager::receivedCancellation):
1405         (WebKit::AuthenticationManager::receivedRequestToPerformDefaultHandling):
1406         (WebKit::AuthenticationManager::receivedChallengeRejection):
1407         * Shared/curl/WebCoreArgumentCodersCurl.cpp: Added.
1408         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
1409         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
1410         (IPC::ArgumentCoder<CertificateInfo>::encode):
1411         (IPC::ArgumentCoder<CertificateInfo>::decode):
1412         (IPC::ArgumentCoder<ResourceError>::encodePlatformData):
1413         (IPC::ArgumentCoder<ResourceError>::decodePlatformData):
1414         (IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData):
1415         (IPC::ArgumentCoder<ProtectionSpace>::decodePlatformData):
1416         (IPC::ArgumentCoder<Credential>::encodePlatformData):
1417         (IPC::ArgumentCoder<Credential>::decodePlatformData):
1418
1419 2017-10-06  Brent Fulgham  <bfulgham@apple.com>
1420
1421         Sandbox rules block PluginProcess using "File Open/Save" dialogs
1422         https://bugs.webkit.org/show_bug.cgi?id=177965
1423         <rdar://problem/33976846>
1424
1425         Reviewed by Alexey Proskuryakov.
1426
1427         Update the PluginProcess sandboxes to allow the same XPC services as
1428         the WebContent process. Also allow access to the openAndSavePanelServices.
1429
1430         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: 
1431
1432 2017-10-06  Brady Eidson  <beidson@apple.com>
1433
1434         Add (entirely incorrect) fetching of ServiceWorker scripts.
1435         https://bugs.webkit.org/show_bug.cgi?id=176179
1436
1437         Reviewed by Andy Estes.
1438
1439         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1440         (WebKit::WebSWServerConnection::startScriptFetchInClient):
1441         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1442         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
1443
1444         * WebProcess/Storage/WebSWClientConnection.cpp:
1445         (WebKit::WebSWClientConnection::finishFetchingScriptInServer):
1446         * WebProcess/Storage/WebSWClientConnection.h:
1447         * WebProcess/Storage/WebSWClientConnection.messages.in:
1448
1449 2017-10-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1450
1451         [GTK][WPE] Add API to configure and enable resource load statistics
1452         https://bugs.webkit.org/show_bug.cgi?id=177943
1453
1454         Reviewed by Michael Catanzaro.
1455
1456         Add new WebKitWebsiteDataManager construct only property to set the directory where the persistent stats are
1457         stored, and methods to enable resource load statistics and query whether it's currently enabled. Also add a new
1458         Website data type to be able to remove the persistent stats using WebKitWebsiteDataManager existing API.
1459
1460         * UIProcess/API/glib/WebKitWebContext.cpp:
1461         (websiteDataStoreConfigurationForWebProcessPoolConfiguration):
1462         (webkitWebContextConstructed):
1463         * UIProcess/API/glib/WebKitWebsiteData.cpp:
1464         (recordContainsSupportedDataTypes):
1465         (toWebKitWebsiteDataTypes):
1466         * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
1467         (webkitWebsiteDataManagerGetProperty):
1468         (webkitWebsiteDataManagerSetProperty):
1469         (webkitWebsiteDataManagerConstructed):
1470         (webkit_website_data_manager_class_init):
1471         (webkitWebsiteDataManagerGetDataStore):
1472         (webkit_website_data_manager_get_resource_load_stats_directory):
1473         (webkit_website_data_manager_set_resource_load_stats_enabled):
1474         (webkit_website_data_manager_get_resource_load_stats_enabled):
1475         (toWebsiteDataTypes):
1476         * UIProcess/API/gtk/WebKitWebsiteData.h:
1477         * UIProcess/API/gtk/WebKitWebsiteDataManager.h:
1478         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
1479         * UIProcess/API/wpe/WebKitWebsiteData.h:
1480         * UIProcess/API/wpe/WebKitWebsiteDataManager.h:
1481
1482 2017-10-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1483
1484         [GTK][WPE] All resource load statistics tests added in r212183 crash in GTK bots, timeout in GTK and WPE bots since r219049
1485         https://bugs.webkit.org/show_bug.cgi?id=168171
1486
1487         Reviewed by Chris Dumez.
1488
1489         Add C API to handle all resource load statistics requests made by the layout tests.
1490
1491         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1492         (WKWebsiteDataStoreSetStatisticsLastSeen):
1493         (WKWebsiteDataStoreSetStatisticsPrevalentResource):
1494         (WKWebsiteDataStoreIsStatisticsPrevalentResource):
1495         (WKWebsiteDataStoreSetStatisticsHasHadUserInteraction):
1496         (WKWebsiteDataStoreIsStatisticsHasHadUserInteraction):
1497         (WKWebsiteDataStoreSetStatisticsGrandfathered):
1498         (WKWebsiteDataStoreIsStatisticsGrandfathered):
1499         (WKWebsiteDataStoreSetStatisticsSubframeUnderTopFrameOrigin):
1500         (WKWebsiteDataStoreSetStatisticsSubresourceUnderTopFrameOrigin):
1501         (WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectTo):
1502         (WKWebsiteDataStoreSetStatisticsTimeToLiveUserInteraction):
1503         (WKWebsiteDataStoreSetStatisticsTimeToLiveCookiePartitionFree):
1504         (WKWebsiteDataStoreStatisticsProcessStatisticsAndDataRecords):
1505         (WKWebsiteDataStoreStatisticsUpdateCookiePartitioning):
1506         (WKWebsiteDataStoreSetStatisticsShouldPartitionCookiesForHost):
1507         (WKWebsiteDataStoreStatisticsSubmitTelemetry):
1508         (WKWebsiteDataStoreSetStatisticsNotifyPagesWhenDataRecordsWereScanned):
1509         (WKWebsiteDataStoreSetStatisticsShouldClassifyResourcesBeforeDataRecordsRemoval):
1510         (WKWebsiteDataStoreSetStatisticsNotifyPagesWhenTelemetryWasCaptured):
1511         (WKWebsiteDataStoreSetStatisticsMinimumTimeBetweenDataRecordsRemoval):
1512         (WKWebsiteDataStoreSetStatisticsGrandfatheringTime):
1513         (WKWebsiteDataStoreSetStatisticsMaxStatisticsEntries):
1514         (WKWebsiteDataStoreSetStatisticsPruneEntriesDownTo):
1515         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
1516         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
1517         (WKWebsiteDataStoreStatisticsClearThroughWebsiteDataRemoval):
1518         (WKWebsiteDataStoreStatisticsResetToConsistentState):
1519         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
1520
1521 2017-10-05  Tim Horton  <timothy_horton@apple.com>
1522
1523         Fix the Mac CMake build
1524         https://bugs.webkit.org/show_bug.cgi?id=177985
1525
1526         Unreviewed build fix.
1527
1528         * CMakeLists.txt:
1529         * PlatformMac.cmake:
1530         After r222917, there's one more piece of WebKitSystemInterface left.
1531         And some missing bits of PaymentRequest.
1532
1533 2017-10-05  Keith Miller  <keith_miller@apple.com>
1534
1535         Unreviewed, tapi builds without optimization so we should have TAPI passes -DRELEASE_WITHOUT_OPTIMIZATIONS.
1536
1537         * Configurations/Base.xcconfig:
1538
1539 2017-10-05  Jer Noble  <jer.noble@apple.com>
1540
1541         [Cocoa] Enable ENABLE_ENCRYPTED_MEDIA build-time setting
1542         https://bugs.webkit.org/show_bug.cgi?id=177261
1543
1544         Reviewed by Eric Carlson.
1545
1546         * Configurations/FeatureDefines.xcconfig:
1547
1548 2017-10-05  Alex Christensen  <achristensen@webkit.org>
1549
1550         Add ObjC equivalent of WKPageNavigationClient.didChangeBackForwardList
1551         https://bugs.webkit.org/show_bug.cgi?id=177966
1552         <rdar://problem/22387135>
1553
1554         Reviewed by Tim Horton.
1555
1556         * UIProcess/API/APINavigationClient.h:
1557         (API::NavigationClient::didChangeBackForwardList):
1558         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
1559         * UIProcess/Cocoa/NavigationState.h:
1560         * UIProcess/Cocoa/NavigationState.mm:
1561         (WebKit::NavigationState::setNavigationDelegate):
1562         (WebKit::NavigationState::NavigationClient::didFailToInitializePlugIn):
1563         (WebKit::NavigationState::NavigationClient::didChangeBackForwardList):
1564         (WebKit::NavigationState::NavigationClient::willPerformClientRedirect):
1565         (WebKit::NavigationState::NavigationClient::didCancelClientRedirect):
1566         (WebKit::NavigationState::NavigationClient::renderingProgressDidChange):
1567         (WebKit::NavigationState::NavigationClient::canAuthenticateAgainstProtectionSpace):
1568         (WebKit::NavigationState::NavigationClient::processDidTerminate):
1569         (WebKit::NavigationState::NavigationClient::processDidBecomeResponsive):
1570         (WebKit::NavigationState::NavigationClient::processDidBecomeUnresponsive):
1571         (WebKit::NavigationState::NavigationClient::webCryptoMasterKey):
1572         (WebKit::NavigationState::NavigationClient::didFinishLoadForQuickLookDocumentInMainFrame):
1573         (WebKit::NavigationState::HistoryClient::didNavigateWithNavigationData):
1574         (WebKit::NavigationState::HistoryClient::didPerformClientRedirect):
1575         (WebKit::NavigationState::HistoryClient::didPerformServerRedirect):
1576         (WebKit::NavigationState::HistoryClient::didUpdateHistoryTitle):
1577         * UIProcess/WebPageProxy.cpp:
1578         (WebKit::WebPageProxy::didChangeBackForwardList):
1579
1580 2017-10-05  Alex Christensen  <achristensen@webkit.org>
1581
1582         Add ObjC SPI with userInfo corresponding to WKPageNavigationClient's decidePolicyForNavigationAction, didStartProvisionalNavigation, and didFailNavigation
1583         https://bugs.webkit.org/show_bug.cgi?id=177974
1584         <rdar://problem/22888802>
1585
1586         Reviewed by Tim Horton.
1587
1588         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
1589         * UIProcess/Cocoa/NavigationState.h:
1590         * UIProcess/Cocoa/NavigationState.mm:
1591         (WebKit::NavigationState::setNavigationDelegate):
1592         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
1593         (WebKit::NavigationState::NavigationClient::didStartProvisionalNavigation):
1594         (WebKit::NavigationState::NavigationClient::didFailNavigationWithError):
1595         * UIProcess/Cocoa/UIDelegate.mm:
1596         (WebKit::UIDelegate::ContextMenuClient::menuFromProposedMenu):
1597
1598 2017-10-05  John Wilander  <wilander@apple.com>
1599
1600         Storage Access API: Web process should ask UI process for grant/deny
1601         https://bugs.webkit.org/show_bug.cgi?id=176941
1602         <rdar://problem/34440036>
1603
1604         Reviewed by Chris Dumez and Sam Weinig.
1605
1606         This patch adds infrastructure to let WebCore::Document call
1607         WebKit::WebResourceLoadStatisticsStore and ask for storage
1608         access on behalf of an iframe. The communication goes through
1609         the ChromeClient since we might want to add a native prompt.
1610         From the ChromeClient it continues to the WebPage which
1611         messages the WebPageProxy. The WebPageProxy calls the
1612         WebsiteDataStore which owns the WebResourceLoadStatisticsStore.
1613         A uint64_t is used to match the right callback with the boolean
1614         result.
1615
1616         * UIProcess/WebPageProxy.cpp:
1617         (WebKit::WebPageProxy::requestStorageAccess):
1618         * UIProcess/WebPageProxy.h:
1619         * UIProcess/WebPageProxy.messages.in:
1620         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1621         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
1622         * UIProcess/WebResourceLoadStatisticsStore.h:
1623         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1624         (WebKit::WebsiteDataStore::requestStorageAccess):
1625         * UIProcess/WebsiteData/WebsiteDataStore.h:
1626         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1627         (WebKit::WebChromeClient::requestStorageAccess):
1628         * WebProcess/WebCoreSupport/WebChromeClient.h:
1629         * WebProcess/WebPage/WebPage.cpp:
1630         (WebKit::nextRequestStorageAccessContextId):
1631         (WebKit::WebPage::requestStorageAccess):
1632         (WebKit::WebPage::storageAccessResponse):
1633         * WebProcess/WebPage/WebPage.h:
1634         * WebProcess/WebPage/WebPage.messages.in:
1635
1636 2017-10-05  Chris Dumez  <cdumez@apple.com>
1637
1638         Drop unused parameters for CookiesStrategy::cookiesEnabled()
1639         https://bugs.webkit.org/show_bug.cgi?id=177957
1640
1641         Reviewed by Alex Christensen.
1642
1643         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1644         (WebKit::NetworkConnectionToWebProcess::cookiesEnabled):
1645         * NetworkProcess/NetworkConnectionToWebProcess.h:
1646         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1647         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1648         (WebKit::WebPlatformStrategies::cookiesEnabled):
1649         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
1650
1651 2017-10-05  Tim Horton  <timothy_horton@apple.com>
1652
1653         Make progress toward properly-formed XPC services in the Mac CMake build
1654         https://bugs.webkit.org/show_bug.cgi?id=177918
1655
1656         Reviewed by Alex Christensen.
1657
1658         * CMakeLists.txt:
1659         * PlatformMac.cmake:
1660         Turn on the storage process on Mac, and fix its build.
1661         Move XPC services to Versions/A/XPCServices and add the toplevel
1662         XPCServices as a symlink of that.
1663         Run the XPC services' Info.plists through configure_file, and substitute
1664         the important variables (most critically the bundle identifier).
1665         Factor out the service setup so we don't keep duplicating it as it
1666         gets more complicated.
1667
1668 2017-10-05  Andy Estes  <aestes@apple.com>
1669
1670         [Payment Request] Add a payment method that supports Apple Pay
1671         https://bugs.webkit.org/show_bug.cgi?id=177850
1672
1673         Reviewed by Youenn Fablet.
1674
1675         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1676         (toShippingMethod): Converted the NSDecimalNumber amount to a string rather than an integer.
1677         (WebKit::toDecimalNumber): used -decimalNumberWithString:locale: rather than
1678         -initWithMantissa:exponent:isNegative: to create an NSDecimalNumber.
1679         (WebKit::toPKPaymentSummaryItem):
1680         (WebKit::toPKShippingMethod):
1681
1682 2017-10-05  Youenn Fablet  <youenn@apple.com>
1683
1684         Make LibWebRTCProvider port agnostic
1685         https://bugs.webkit.org/show_bug.cgi?id=177747
1686
1687         Reviewed by Alex Christensen & Alex Garcia.
1688
1689         * WebProcess/Network/webrtc/LibWebRTCProvider.h: Making sure Mac/iOS provider creates the codec factories.
1690
1691 2017-10-04  Alex Christensen  <achristensen@webkit.org>
1692
1693         Stop linking with WebKitSystemInterface
1694         https://bugs.webkit.org/show_bug.cgi?id=177915
1695
1696         Reviewed by Antti Koivisto.
1697
1698         * Configurations/DebugRelease.xcconfig:
1699         * WebKit.xcodeproj/project.pbxproj:
1700
1701 2017-10-04  Alex Christensen  <achristensen@webkit.org>
1702
1703         Remove unnecessary includes of WebKitSystemInterface on Cocoa platforms
1704         https://bugs.webkit.org/show_bug.cgi?id=177912
1705
1706         Reviewed by Saam Barati.
1707
1708         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1709         * NetworkProcess/mac/NetworkProcessMac.mm:
1710         * NetworkProcess/mac/RemoteNetworkingContext.mm:
1711         * Platform/IPC/mac/ConnectionMac.mm:
1712         * Platform/mac/LayerHostingContext.mm:
1713         * PluginProcess/mac/PluginProcessMac.mm:
1714         * PluginProcess/mac/PluginProcessShim.mm:
1715         * Shared/ios/ChildProcessIOS.mm:
1716         * Shared/mac/ChildProcessMac.mm:
1717         * Shared/mac/SandboxExtensionMac.mm:
1718         * Shared/mac/WebCoreArgumentCodersMac.mm:
1719         * Shared/mac/WebEventFactory.mm:
1720         * StorageProcess/ios/StorageProcessIOS.mm:
1721         * StorageProcess/mac/StorageProcessMac.mm:
1722         * UIProcess/API/Cocoa/WKWebView.mm:
1723         * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
1724         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
1725         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1726         * UIProcess/Cocoa/WebViewImpl.mm:
1727         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
1728         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
1729         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
1730         * UIProcess/mac/PageClientImplMac.mm:
1731         * UIProcess/mac/WKTextInputWindowController.mm:
1732         * UIProcess/mac/WebContextMenuProxyMac.mm:
1733         * UIProcess/mac/WebPopupMenuProxyMac.mm:
1734         * UIProcess/mac/WindowServerConnection.mm:
1735         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
1736         * WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm:
1737         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1738         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
1739         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
1740         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
1741         * WebProcess/WebPage/ios/WebPageIOS.mm:
1742         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
1743         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
1744         * WebProcess/WebPage/mac/WebPageMac.mm:
1745         * WebProcess/cocoa/WebProcessCocoa.mm:
1746
1747 2017-10-04  Youenn Fablet  <youenn@apple.com>
1748
1749         rtc::PacketOptions should have its own IPC encoding/decoding routines
1750         https://bugs.webkit.org/show_bug.cgi?id=177812
1751
1752         Reviewed by Alex Christensen.
1753
1754         Replacing rtc::PacketOptions IPC encoding/decoding from passing the structure as individual parameters to the structure as a parameter.
1755         Introducing WebKit::RTCPacketOptions as a wrapper around it for which encode/decode routines are added.
1756         Updating code using rtc::PacketOptions accordingly.
1757
1758         * NetworkProcess/webrtc/NetworkRTCSocket.cpp:
1759         (WebKit::NetworkRTCSocket::sendTo):
1760         * NetworkProcess/webrtc/NetworkRTCSocket.h:
1761         * NetworkProcess/webrtc/NetworkRTCSocket.messages.in:
1762         * Platform/IPC/Decoder.cpp:
1763         (IPC::Decoder::operator>>):
1764         (IPC::Decoder::decode):
1765         * Platform/IPC/Decoder.h:
1766         * Platform/IPC/Encoder.cpp:
1767         (IPC::Encoder::encode):
1768         * Platform/IPC/Encoder.h:
1769         * Shared/RTCPacketOptions.cpp: Added.
1770         (WebKit::RTCPacketOptions::encode const):
1771         (WebKit::RTCPacketOptions::decode):
1772         * Shared/RTCPacketOptions.h: Added.
1773         * WebKit.xcodeproj/project.pbxproj:
1774         * WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
1775         (WebKit::LibWebRTCSocket::SendTo):
1776
1777 2017-10-04  Don Olmstead  <don.olmstead@sony.com>
1778
1779         Include Pasteboard.h for all in WebCoreArgumentCoders
1780         https://bugs.webkit.org/show_bug.cgi?id=177902
1781
1782         Reviewed by Alex Christensen.
1783
1784         * Shared/WebCoreArgumentCoders.cpp:
1785
1786 2017-10-04  David Kilzer  <ddkilzer@apple.com>
1787
1788         Remove unused variables in lambdas for network process cache
1789         <https://webkit.org/b/177878>
1790         <rdar://problem/34038482>
1791
1792         Reviewed by Tim Horton.
1793
1794         * NetworkProcess/cache/CacheStorageEngine.cpp:
1795         (WebKit::CacheStorage::Engine::open):
1796         (WebKit::CacheStorage::Engine::putRecords):
1797         (WebKit::CacheStorage::Engine::deleteMatchingRecords):
1798         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
1799         (WebKit::CacheStorageEngineConnection::reference):
1800         - Remove unused |this| from lambda captures.
1801
1802 2017-10-04  Stephan Szabo  <stephan.szabo@sony.com>
1803
1804         [WinCairo] add PLATFORM(WIN) configurations to config.h
1805         https://bugs.webkit.org/show_bug.cgi?id=177846
1806
1807         Reviewed by Alex Christensen.
1808
1809         * config.h:
1810
1811 2017-10-04  Adrian Perez de Castro  <aperez@igalia.com>
1812
1813         [GTK] WebKit2GTK+ does not handle touchmove and touchend events correctly
1814         https://bugs.webkit.org/show_bug.cgi?id=158531
1815
1816         Reviewed by Carlos Alberto Lopez Perez.
1817
1818         Do not bypass WebCore event handling when receiving touch events.
1819
1820         Based on a patch by Andre Moreira Magalhaes <andre.magalhaes@collabora.co.uk>.
1821         Thanks to Carlos Garnacho <carlosg@gnome.org> for helping out reviewing the code.
1822
1823         * UIProcess/API/gtk/PageClientImpl.cpp:
1824         (WebKit::PageClientImpl::doneWithTouchEvent): Make sure touchend reaches gesture controller if touchbegin evet got to it.
1825         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1826         (webkitWebViewBaseTouchEvent): Do not invoke gesture controller directly by bypassing WebCore event handling.
1827         * UIProcess/gtk/GestureController.cpp:
1828         (WebKit::GestureController::reset): Added.
1829         (WebKit::GestureController::handleEvent): Reset gesture controller when touchpadupdate/end is received without touchbegin.
1830         (WebKit::GestureController::Gesture::reset): Added.
1831         * UIProcess/gtk/GestureController.h:
1832
1833 2017-10-04  Michael Catanzaro  <mcatanzaro@igalia.com>
1834
1835         Unreviewed WPE build fix after r222837
1836         https://bugs.webkit.org/show_bug.cgi?id=177449
1837
1838         * Shared/wpe/WebEventFactory.cpp:
1839         (WebKit::wallTimeForEventTime):
1840
1841 2017-10-04  Ryosuke Niwa  <rniwa@webkit.org>
1842
1843         Use blob URL when pasting RTFD instead of overriding DocumentLoader
1844         https://bugs.webkit.org/show_bug.cgi?id=177801
1845         <rdar://problem/34542270>
1846
1847         Reviewed by Wenson Hsieh.
1848
1849         Fixed the assertion failure when RTFD content is empty.
1850
1851         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
1852         (WebKit::WebPasteboardProxy::getPasteboardBufferForType):
1853
1854 2017-10-04  Michael Catanzaro  <mcatanzaro@igalia.com>
1855
1856         REGRESSION(r222392): [WPE][GTK] Many forms tests are failing due to broken event timestamps
1857         https://bugs.webkit.org/show_bug.cgi?id=177449
1858
1859         Reviewed by Chris Dumez.
1860
1861         * Shared/wpe/WebEventFactory.cpp:
1862         (WebKit::wallTimeForEventTime):
1863
1864 2017-10-03  Brent Fulgham  <bfulgham@apple.com>
1865
1866         Correct nullptr dereference during shutdown
1867         https://bugs.webkit.org/show_bug.cgi?id=177845
1868         <rdar://problem/33651405>
1869
1870         Reviewed by Chris Dumez.
1871
1872         It looks like the ResourceLoadStatisticsPersistentStorage destructor is calling code that attempts
1873         to use member variables in its owning class (WebResourceLoadStatisticsStore). Since these may have
1874         already been destroyed, they are in an invalid state when accessed.
1875
1876         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
1877         (WebKit::ResourceLoadStatisticsPersistentStorage::~ResourceLoadStatisticsPersistentStorage): Do not call
1878         finishAllPendingWorkSynchronously() in the destructor, since it relies on the m_memoryStore to be
1879         a reference to completely valid object.
1880         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1881         (WebKit::WebResourceLoadStatisticsStore::~WebResourceLoadStatisticsStore): Instead, call
1882         'finishAllPendingWorkSynchronously' here, when the object is still in a known valid state.
1883
1884 2017-10-03  Alex Christensen  <achristensen@webkit.org>
1885
1886         Moderize WebKit's back forward list code
1887         https://bugs.webkit.org/show_bug.cgi?id=177843
1888
1889         Reviewed by Tim Horton.
1890
1891         Use Ref instead of RefPtr when possible.
1892         Use references instead of pointers when possible.
1893         Remove unnecessary null checks.
1894         Reduce unnecessary Vector copying.
1895
1896         * Shared/SessionState.h:
1897         * Shared/WebBackForwardListItem.h:
1898         * UIProcess/API/APILoaderClient.h:
1899         (API::LoaderClient::didChangeBackForwardList):
1900         (API::LoaderClient::shouldKeepCurrentBackForwardListItemInList):
1901         * UIProcess/API/C/WKPage.cpp:
1902         (WKPageSetPageLoaderClient):
1903         * UIProcess/WebBackForwardList.cpp:
1904         (WebKit::WebBackForwardList::pageClosed):
1905         (WebKit::WebBackForwardList::addItem):
1906         (WebKit::WebBackForwardList::goToItem):
1907         (WebKit::WebBackForwardList::currentItem const):
1908         (WebKit::WebBackForwardList::backItem const):
1909         (WebKit::WebBackForwardList::forwardItem const):
1910         (WebKit::WebBackForwardList::itemAtIndex const):
1911         (WebKit::WebBackForwardList::backListAsAPIArrayWithLimit const):
1912         (WebKit::WebBackForwardList::forwardListAsAPIArrayWithLimit const):
1913         (WebKit::WebBackForwardList::removeAllItems):
1914         (WebKit::WebBackForwardList::clear):
1915         (WebKit::WebBackForwardList::backForwardListState const):
1916         (WebKit::WebBackForwardList::restoreFromState):
1917         * UIProcess/WebBackForwardList.h:
1918         * UIProcess/WebPageProxy.cpp:
1919         (WebKit::WebPageProxy::reattachToWebProcessWithItem):
1920         (WebKit::WebPageProxy::initializeWebPage):
1921         (WebKit::WebPageProxy::didChangeBackForwardList):
1922         (WebKit::WebPageProxy::shouldKeepCurrentBackForwardListItemInList):
1923         (WebKit::WebPageProxy::backForwardGoToItem):
1924         * UIProcess/WebPageProxy.h:
1925         * UIProcess/WebProcessProxy.cpp:
1926         (WebKit::WebProcessProxy::registerNewWebBackForwardListItem):
1927         * UIProcess/WebProcessProxy.h:
1928         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
1929         (WebKit::WebBackForwardListProxy::itemAtIndex):
1930
1931 2017-10-03  Chris Dumez  <cdumez@apple.com>
1932
1933         SharedStringHashStore should support removing hashes
1934         https://bugs.webkit.org/show_bug.cgi?id=177770
1935
1936         Reviewed by Alex Christensen.
1937
1938         SharedStringHashStore should support removing hashes. It currently only supports adding hashes or
1939         clearing all of them, which is sufficient for the VisitedLinkStore but will not be for Service
1940         Worker purposes.
1941
1942         * Shared/SharedStringHashStore.cpp:
1943         (WebKit::SharedStringHashStore::SharedStringHashStore):
1944         (WebKit::SharedStringHashStore::add):
1945         (WebKit::SharedStringHashStore::remove):
1946         (WebKit::SharedStringHashStore::contains):
1947         (WebKit::SharedStringHashStore::clear):
1948         (WebKit::SharedStringHashStore::resizeTable):
1949         (WebKit::SharedStringHashStore::pendingOperationsTimerFired):
1950         * Shared/SharedStringHashStore.h:
1951         * Shared/SharedStringHashTable.cpp:
1952         (WebKit::SharedStringHashTable::remove):
1953         * Shared/SharedStringHashTable.h:
1954         * UIProcess/API/Cocoa/_WKVisitedLinkStore.h:
1955         * UIProcess/API/Cocoa/_WKVisitedLinkStore.mm:
1956         (-[_WKVisitedLinkStore containsVisitedLinkWithURL:]):
1957         (-[_WKVisitedLinkStore removeVisitedLinkWithURL:]):
1958         * UIProcess/VisitedLinkStore.cpp:
1959         (WebKit::VisitedLinkStore::containsVisitedLinkHash):
1960         (WebKit::VisitedLinkStore::removeVisitedLinkHash):
1961         (WebKit::VisitedLinkStore::didUpdateSharedStringHashes):
1962         * UIProcess/VisitedLinkStore.h:
1963
1964 2017-10-03  Alex Christensen  <achristensen@webkit.org>
1965
1966         Fix API tests after r222794.
1967         https://bugs.webkit.org/show_bug.cgi?id=177825
1968
1969         * UIProcess/WebPageProxy.cpp:
1970         (WebKit::WebPageProxy::willGoToBackForwardListItem):
1971         Sometimes there's no navigation client.
1972
1973 2017-10-03  Alex Christensen  <achristensen@webkit.org>
1974
1975         Add ObjC equivalent of WKPageLoaderClient.pluginDidFail
1976         https://bugs.webkit.org/show_bug.cgi?id=177787
1977         <rdar://problem/22387633>
1978
1979         Reviewed by Tim Horton.
1980
1981         * UIProcess/API/APILoaderClient.h:
1982         (API::LoaderClient::didFailToInitializePlugin):
1983         * UIProcess/API/APINavigationClient.h:
1984         (API::NavigationClient::canHandleDidFailToInitializePlugIn const):
1985         (API::NavigationClient::didFailToInitializePlugIn):
1986         * UIProcess/API/C/WKPage.cpp:
1987         (WKPageSetPageLoaderClient):
1988         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
1989         * UIProcess/Cocoa/NavigationState.h:
1990         * UIProcess/Cocoa/NavigationState.mm:
1991         (WebKit::NavigationState::setNavigationDelegate):
1992         (WebKit::NavigationState::NavigationClient::canHandleDidFailToInitializePlugIn const):
1993         (WebKit::NavigationState::NavigationClient::didFailToInitializePlugIn):
1994         * UIProcess/WebPageProxy.cpp:
1995         (WebKit::WebPageProxy::didFailToInitializePlugin):
1996
1997 2017-10-03  Adrian Perez de Castro  <aperez@igalia.com>
1998
1999         [GTK] Prefer -webkit-system-font
2000         https://bugs.webkit.org/show_bug.cgi?id=177814
2001
2002         Reviewed by Carlos Garcia Campos.
2003
2004         Use "font-family: -webkit-system-font" instead of "font: menu".
2005
2006         * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
2007         (WebKit::RemoteInspectorProtocolHandler::handleRequest): Edited HTML snippet.
2008
2009 2017-10-03  Alex Christensen  <achristensen@webkit.org>
2010
2011         Add ObjC SPI equivalent to WKPageLoaderClient.willGoToBackForwardListItem
2012         https://bugs.webkit.org/show_bug.cgi?id=177825
2013         <rdar://problem/22387505>
2014
2015         Reviewed by Tim Horton.
2016
2017         * UIProcess/API/APILoaderClient.h:
2018         (API::LoaderClient::willGoToBackForwardListItem):
2019         * UIProcess/API/APINavigationClient.h:
2020         (API::NavigationClient::canHandleWillGoToBackForwardListItem const):
2021         (API::NavigationClient::willGoToBackForwardListItem):
2022         * UIProcess/API/C/WKPage.cpp:
2023         (WKPageSetPageLoaderClient):
2024         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
2025         * UIProcess/Cocoa/NavigationState.h:
2026         * UIProcess/Cocoa/NavigationState.mm:
2027         (WebKit::NavigationState::setNavigationDelegate):
2028         (WebKit::NavigationState::NavigationClient::canHandleWillGoToBackForwardListItem const):
2029         (WebKit::NavigationState::NavigationClient::willGoToBackForwardListItem):
2030         * UIProcess/WebPageProxy.cpp:
2031         (WebKit::WebPageProxy::willGoToBackForwardListItem):
2032         * UIProcess/WebPageProxy.h:
2033         * UIProcess/WebPageProxy.messages.in:
2034         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2035         (WebKit::WebFrameLoaderClient::shouldGoToHistoryItem const):
2036
2037 2017-10-03  Michael Catanzaro  <mcatanzaro@igalia.com>
2038
2039         REGRESSION(r222392): [WPE][GTK] Many forms tests are failing due to broken event timestamps
2040         https://bugs.webkit.org/show_bug.cgi?id=177449
2041
2042         Reviewed by Chris Dumez.
2043
2044         * Shared/gtk/WebEventFactory.cpp:
2045         (WebKit::WebEventFactory::createWebMouseEvent):
2046         (WebKit::WebEventFactory::createWebWheelEvent):
2047         (WebKit::WebEventFactory::createWebKeyboardEvent):
2048         (WebKit::WebEventFactory::createWebTouchEvent):
2049         * Shared/wpe/WebEventFactory.cpp:
2050         (WebKit::wallTimeForEventTime):
2051         (WebKit::WebEventFactory::createWebKeyboardEvent):
2052         (WebKit::WebEventFactory::createWebMouseEvent):
2053         (WebKit::WebEventFactory::createWebWheelEvent):
2054         (WebKit::WebEventFactory::createWebTouchEvent):
2055
2056 2017-10-03  Carlos Garcia Campos  <cgarcia@igalia.com>
2057
2058         [GTK][WPE] WebProcess should run cleanup on quit to release resources
2059         https://bugs.webkit.org/show_bug.cgi?id=168126
2060
2061         Reviewed by Michael Catanzaro.
2062
2063         Do not call exit on sync message send failure for GTK and WPE ports.
2064
2065         * WebProcess/WebProcess.cpp:
2066         (WebKit::WebProcess::initializeConnection):
2067
2068 2017-10-02  Ryosuke Niwa  <rniwa@webkit.org>
2069
2070         Move more code into PasteboardCustomData
2071         https://bugs.webkit.org/show_bug.cgi?id=177795
2072
2073         Reviewed by Wenson Hsieh.
2074
2075         Added the support for encoding and decoding the origin string in PasteboardCustomData.
2076
2077         * Shared/WebCoreArgumentCoders.cpp:
2078         (IPC::ArgumentCoder<PasteboardCustomData>::encode):
2079         (IPC::ArgumentCoder<PasteboardCustomData>::decode):
2080
2081 2017-10-02  Adrian Perez de Castro  <aperez@igalia.com>
2082
2083         [GTK] Do not hardcode font family in served remote inspector HTML snippets
2084         https://bugs.webkit.org/show_bug.cgi?id=177742
2085
2086         Reviewed by Carlos Garcia Campos.
2087
2088         Instead of hardcoding Cantarell as the font used for the HTML snippets served
2089         by the remote inspector handler, use "font: menu" to obtain the system UI
2090         font, plus a "font-size" rule for adjusting the size.
2091
2092         * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
2093         (WebKit::RemoteInspectorProtocolHandler::handleRequest): Change the
2094         CSS rules in the served snippet.
2095
2096 2017-10-02  Joseph Pecoraro  <pecoraro@apple.com>
2097
2098         Web Inspector: Include Beacon and Ping requests in Network tab
2099         https://bugs.webkit.org/show_bug.cgi?id=177641
2100         <rdar://problem/33086839>
2101
2102         Reviewed by Chris Dumez.
2103
2104         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2105         (WebKit::NetworkConnectionToWebProcess::loadPing):
2106         (WebKit::NetworkConnectionToWebProcess::didFinishPingLoad):
2107         * NetworkProcess/NetworkConnectionToWebProcess.h:
2108         * NetworkProcess/PingLoad.cpp:
2109         (WebKit::PingLoad::PingLoad):
2110         (WebKit::PingLoad::didFinish):
2111         (WebKit::PingLoad::didReceiveResponseNetworkSession):
2112         * NetworkProcess/PingLoad.h:
2113         * WebProcess/Network/NetworkProcessConnection.cpp:
2114         (WebKit::NetworkProcessConnection::didFinishPingLoad):
2115         * WebProcess/Network/NetworkProcessConnection.h:
2116         * WebProcess/Network/NetworkProcessConnection.messages.in:
2117         * WebProcess/Network/WebLoaderStrategy.cpp:
2118         (WebKit::WebLoaderStrategy::networkProcessCrashed):
2119         (WebKit::WebLoaderStrategy::startPingLoad):
2120         (WebKit::WebLoaderStrategy::didFinishPingLoad):
2121         * WebProcess/Network/WebLoaderStrategy.h:
2122         Pass an optional ResourceResponse back to the ping completion handler.
2123
2124 2017-10-02  Alex Christensen  <achristensen@webkit.org>
2125
2126         REGRESSION: API tests WebKit.ProcessDidTerminateRequestedByClient and WebKit.ProcessDidTerminateWithReasonCrash are timing out
2127         https://bugs.webkit.org/show_bug.cgi?id=177764
2128
2129         Reviewed by Chris Dumez.
2130
2131         * UIProcess/API/C/WKPage.cpp:
2132         (WKPageSetPageNavigationClient):
2133         I shouldn't have reverted the A API telling the listener to continue if there's no client function.
2134
2135 2017-10-02  Carlos Garcia Campos  <cgarcia@igalia.com>
2136
2137         [WPE][GTK] Crash in webkit_web_resource_get_data_finish()
2138         https://bugs.webkit.org/show_bug.cgi?id=177107
2139
2140         Reviewed by Michael Catanzaro.
2141
2142         Handle errors in webkit_web_resource_get_data() callback.
2143
2144         * UIProcess/API/glib/WebKitWebResource.cpp:
2145         (resourceDataCallback):
2146         (webkit_web_resource_get_data):
2147
2148 2017-10-02  Olivier Blin  <olivier.blin@softathome.com>
2149
2150         [WPE] Fix UIProcess build with GStreamer and without VIDEO
2151         https://bugs.webkit.org/show_bug.cgi?id=177753
2152
2153         Reviewed by Michael Catanzaro.
2154
2155         GStreamer builds fail when WebAudio is enabled but VIDEO disabled.
2156         This is the WPE counterpart of bug 153135.
2157
2158         * UIProcess/API/wpe/PageClientImpl.h:
2159
2160 2017-10-02  Alex Christensen  <achristensen@webkit.org>
2161
2162         Expose more WKPreferences SPI to match C SPI
2163         https://bugs.webkit.org/show_bug.cgi?id=177697
2164
2165         * UIProcess/API/Cocoa/WKPreferences.mm:
2166         (-[WKPreferences _javaEnabledForLocalFiles]):
2167         (-[WKPreferences _setPlugInsEnabled:]): Deleted.
2168         (-[WKPreferences _plugInsEnabled]): Deleted.
2169         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2170         _javaEnabledForLocalFiles should return the correct value.
2171         _plugInsEnabled has public API.  This SPI is not needed.
2172
2173 2017-10-02  Alex Christensen  <achristensen@webkit.org>
2174
2175         REGRESSION(r214201): WebProcess hangs during policy decisions
2176         https://bugs.webkit.org/show_bug.cgi?id=177590
2177         <rdar://problem/33362929>
2178
2179         Reviewed by Andy Estes.
2180
2181         This is like r222431 but for trunk instead of a branch.
2182         It includes the same regression API test so I don't make the same mistake again.
2183
2184         * UIProcess/API/C/WKPage.cpp:
2185         (WKPageSetPageNavigationClient):
2186         * UIProcess/WebPageProxy.cpp:
2187         (WebKit::WebPageProxy::receivedPolicyDecision):
2188         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2189         (WebKit::WebPageProxy::decidePolicyForResponseSync):
2190         * UIProcess/WebPageProxy.h:
2191         * UIProcess/WebPageProxy.messages.in:
2192         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2193         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
2194         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
2195         (WebKit::WebFrameLoaderClient::applyToDocumentLoader):
2196         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2197         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2198         * WebProcess/WebPage/WebDocumentLoader.cpp:
2199         (WebKit::WebDocumentLoader::setNavigationID):
2200         * WebProcess/WebPage/WebFrame.cpp:
2201         (WebKit::WebFrame::setUpPolicyListener):
2202         (WebKit::WebFrame::invalidatePolicyListener):
2203         (WebKit::WebFrame::didReceivePolicyDecision):
2204         * WebProcess/WebPage/WebFrame.h:
2205         * WebProcess/WebPage/WebPage.cpp:
2206         (WebKit::WebPage::didReceivePolicyDecision):
2207         * WebProcess/WebPage/WebPage.h:
2208         * WebProcess/WebPage/WebPage.messages.in:
2209
2210 2017-10-02  Alex Christensen  <achristensen@webkit.org>
2211
2212         Remove unnecessary copy of SessionID in WebPageProxy
2213         https://bugs.webkit.org/show_bug.cgi?id=177702
2214
2215         Reviewed by Darin Adler.
2216
2217         * UIProcess/WebPageProxy.cpp:
2218         (WebKit::WebPageProxy::sessionID const):
2219         (WebKit::WebPageProxy::creationParameters):
2220         * UIProcess/WebPageProxy.h:
2221         (WebKit::WebPageProxy::sessionID const): Deleted.
2222
2223 2017-10-02  Alex Christensen  <achristensen@webkit.org>
2224
2225         Expose more WKPreferences SPI to match C SPI
2226         https://bugs.webkit.org/show_bug.cgi?id=177697
2227         <rdar://problem/24110556>
2228
2229         Reviewed by Darin Adler.
2230
2231         * UIProcess/API/Cocoa/WKPreferences.mm:
2232         (-[WKPreferences _setJavaEnabledForLocalFiles:]):
2233         (-[WKPreferences _javaEnabledForLocalFiles]):
2234         (-[WKPreferences _setCanvasUsesAcceleratedDrawing:]):
2235         (-[WKPreferences _canvasUsesAcceleratedDrawing]):
2236         (-[WKPreferences _setAcceleratedCompositingEnabled:]):
2237         (-[WKPreferences _acceleratedCompositingEnabled]):
2238         (-[WKPreferences _setDefaultTextEncodingName:]):
2239         (-[WKPreferences _defaultTextEncodingName]):
2240         (-[WKPreferences _setNeedsSiteSpecificQuirks:]):
2241         (-[WKPreferences _needsSiteSpecificQuirks]):
2242         (-[WKPreferences _setAuthorAndUserStylesEnabled:]):
2243         (-[WKPreferences _authorAndUserStylesEnabled]):
2244         (-[WKPreferences _setDOMTimersThrottlingEnabled:]):
2245         (-[WKPreferences _domTimersThrottlingEnabled]):
2246         (-[WKPreferences _setWebArchiveDebugModeEnabled:]):
2247         (-[WKPreferences _webArchiveDebugModeEnabled]):
2248         (-[WKPreferences _setLocalFileContentSniffingEnabled:]):
2249         (-[WKPreferences _localFileContentSniffingEnabled]):
2250         (-[WKPreferences _setUsesPageCache:]):
2251         (-[WKPreferences _usesPageCache]):
2252         (-[WKPreferences _setPageCacheSupportsPlugins:]):
2253         (-[WKPreferences _pageCacheSupportsPlugins]):
2254         (-[WKPreferences _setShouldPrintBackgrounds:]):
2255         (-[WKPreferences _shouldPrintBackgrounds]):
2256         (-[WKPreferences _setWebSecurityEnabled:]):
2257         (-[WKPreferences _webSecurityEnabled]):
2258         (-[WKPreferences _setUniversalAccessFromFileURLsAllowed:]):
2259         (-[WKPreferences _universalAccessFromFileURLsAllowed]):
2260         (-[WKPreferences _setAVFoundationEnabled:]):
2261         (-[WKPreferences _avFoundationEnabled]):
2262         (-[WKPreferences _setSuppressesIncrementalRendering:]):
2263         (-[WKPreferences _suppressesIncrementalRendering]):
2264         (-[WKPreferences _setAsynchronousPluginInitializationEnabled:]):
2265         (-[WKPreferences _asynchronousPluginInitializationEnabled]):
2266         (-[WKPreferences _setArtificialPluginInitializationDelayEnabled:]):
2267         (-[WKPreferences _artificialPluginInitializationDelayEnabled]):
2268         (-[WKPreferences _setCookieEnabled:]):
2269         (-[WKPreferences _cookieEnabled]):
2270         (-[WKPreferences _setPlugInSnapshottingEnabled:]):
2271         (-[WKPreferences _plugInSnapshottingEnabled]):
2272         (-[WKPreferences _setQTKitEnabled:]):
2273         (-[WKPreferences _qtKitEnabled]):
2274         (-[WKPreferences _setSubpixelCSSOMElementMetricsEnabled:]):
2275         (-[WKPreferences _subpixelCSSOMElementMetricsEnabled]):
2276         (-[WKPreferences _setMediaSourceEnabled:]):
2277         (-[WKPreferences _mediaSourceEnabled]):
2278         (-[WKPreferences _setViewGestureDebuggingEnabled:]):
2279         (-[WKPreferences _viewGestureDebuggingEnabled]):
2280         (-[WKPreferences _setCSSAnimationTriggersEnabled:]):
2281         (-[WKPreferences _cssAnimationTriggersEnabled]):
2282         (-[WKPreferences _setStandardFontFamily:]):
2283         (-[WKPreferences _standardFontFamily]):
2284         (-[WKPreferences _setNotificationsEnabled:]):
2285         (-[WKPreferences _notificationsEnabled]):
2286         (-[WKPreferences _setBackspaceKeyNavigationEnabled:]):
2287         (-[WKPreferences _backspaceKeyNavigationEnabled]):
2288         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2289
2290 2017-10-02  Carlos Garcia Campos  <cgarcia@igalia.com>
2291
2292         [GTK][WPE] Enable interactive forms validation by default
2293         https://bugs.webkit.org/show_bug.cgi?id=177737
2294
2295         Reviewed by Michael Catanzaro.
2296
2297         It's currently disabled for no reason.
2298
2299         * Shared/WebPreferencesDefinitions.h:
2300
2301 2017-10-02  Michael Catanzaro  <mcatanzaro@igalia.com>
2302
2303         Remove ENABLE_CSS_REGIONS
2304         https://bugs.webkit.org/show_bug.cgi?id=177689
2305
2306         Reviewed by Darin Adler.
2307
2308         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp:
2309         (webkit_dom_element_get_webkit_region_overset):
2310         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.h:
2311         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
2312         (webkit_dom_element_get_webkit_region_overset): Deleted.
2313         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.h:
2314
2315 2017-09-30  Darin Adler  <darin@apple.com>
2316
2317         Have IPC::Connection::Client objects consistently invalidate the connection when destroyed
2318         https://bugs.webkit.org/show_bug.cgi?id=177708
2319
2320         Reviewed by Anders Carlsson.
2321
2322         I ran into an intermittent crash when running regression tests. It looked like a connection
2323         client was being called after it was destroyed. I did an audit of the all the connection
2324         clients to make sure they all invalidate their connection before they are destroyed.
2325
2326         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2327         (WebKit::NetworkConnectionToWebProcess::~NetworkConnectionToWebProcess): Invalidate the
2328         connection since this object opened the connection. There is no obvious
2329         guarantee that the connection will already be invalid when this is destroyed.
2330         * StorageProcess/StorageToWebProcessConnection.cpp:
2331         (WebKit::StorageToWebProcessConnection::~StorageToWebProcessConnection): Ditto.
2332         * UIProcess/Plugins/PluginProcessProxy.cpp:
2333         (WebKit::PluginProcessProxy::~PluginProcessProxy): Ditto.
2334         * WebProcess/Network/NetworkProcessConnection.cpp:
2335         (WebKit::NetworkProcessConnection::~NetworkProcessConnection): Ditto.
2336         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
2337         (WebKit::WebToStorageProcessConnection::~WebToStorageProcessConnection): Ditto.
2338
2339         * StorageProcess/StorageToWebProcessConnection.h: Derive privately rather than publicly
2340         from IPC::Connection::Client because we can, and this means we don't have to study quite
2341         as much code to understand how this is used as a connection client.
2342         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h: Ditto.
2343         * WebProcess/Storage/WebToStorageProcessConnection.h: Ditto.
2344         * WebProcess/WebPage/WebInspector.h: Ditto.
2345         * WebProcess/WebPage/WebInspectorUI.h: Ditto.
2346
2347         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
2348         (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer): Added a comment about a
2349         reference cycle cycle leading to a leak that I believe exists here.
2350
2351 2017-09-29  Alex Christensen  <achristensen@webkit.org>
2352
2353         REGRESSION: ASSERTION FAILED: m_provisionalURL.isEmpty() in WebKit::FrameLoadState::didStartProvisionalLoad
2354         https://bugs.webkit.org/show_bug.cgi?id=177491
2355
2356         Reviewed by Andy Estes.
2357
2358         * WebProcess/WebPage/WebFrame.cpp:
2359         (WebKit::WebFrame::setUpWillSubmitFormListener):
2360         (WebKit::WebFrame::continueWillSubmitForm):
2361         (WebKit::WebFrame::invalidatePolicyListener):
2362         Speculative fix for a flaky assertion.
2363         Restore the clearing of the policy listeners we used to have when form submission was treated as a policy.
2364
2365 2017-09-29  Chris Dumez  <cdumez@apple.com>
2366
2367         http/tests/preconnect/link-rel-preconnect-https.html is flaky
2368         https://bugs.webkit.org/show_bug.cgi?id=177673
2369
2370         Reviewed by Alex Christensen.
2371
2372         Update PreconnectTask to query the client when a certificate needs to be
2373         validated. This allows WebKitTestRunner to ignore invalid certificates
2374         and this causes http/tests/preconnect/link-rel-preconnect-https.html
2375         to pass consistently.
2376
2377         To avoid duplicating code, PreconnectTask now uses NetworkLoad internally
2378         instead of using a NetworkDataTask directly.
2379
2380         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2381         (WebKit::NetworkConnectionToWebProcess::preconnectTo):
2382         * NetworkProcess/NetworkConnectionToWebProcess.h:
2383         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2384         * NetworkProcess/NetworkLoad.h:
2385         * NetworkProcess/NetworkProcess.cpp:
2386         (WebKit::generateCanAuthenticateIdentifier):
2387         (WebKit::NetworkProcess::canAuthenticateAgainstProtectionSpace):
2388         (WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpace):
2389         (WebKit::NetworkProcess::preconnectTo):
2390         * NetworkProcess/NetworkProcess.h:
2391         * NetworkProcess/NetworkResourceLoadParameters.cpp:
2392         (WebKit::NetworkResourceLoadParameters::encode const):
2393         (WebKit::NetworkResourceLoadParameters::decode):
2394         * NetworkProcess/PreconnectTask.cpp:
2395         (WebKit::PreconnectTask::PreconnectTask):
2396         (WebKit::PreconnectTask::~PreconnectTask):
2397         (WebKit::PreconnectTask::willSendRedirectedRequest):
2398         (WebKit::PreconnectTask::didReceiveResponse):
2399         (WebKit::PreconnectTask::didReceiveBuffer):
2400         (WebKit::PreconnectTask::didFinishLoading):
2401         (WebKit::PreconnectTask::didFailLoading):
2402         (WebKit::PreconnectTask::didSendData):
2403         (WebKit::PreconnectTask::canAuthenticateAgainstProtectionSpaceAsync):
2404         (WebKit::PreconnectTask::continueCanAuthenticateAgainstProtectionSpace):
2405         (WebKit::PreconnectTask::frameID const):
2406         (WebKit::PreconnectTask::pageID const):
2407         * NetworkProcess/PreconnectTask.h:
2408         * WebProcess/Network/WebLoaderStrategy.cpp:
2409         (WebKit::WebLoaderStrategy::preconnectTo):
2410         * WebProcess/Network/WebLoaderStrategy.h:
2411
2412 2017-09-29  Alex Christensen  <achristensen@webkit.org>
2413
2414         Expose WebPreferences::webGLEnabled through WKPreferences
2415         https://bugs.webkit.org/show_bug.cgi?id=177692
2416         <rdar://problem/24110556>
2417
2418         Reviewed by Andy Estes.
2419
2420         * UIProcess/API/Cocoa/WKPreferences.mm:
2421         (-[WKPreferences _setWebGLEnabled:]):
2422         (-[WKPreferences _webGLEnabled]):
2423         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2424
2425 2017-09-29  Chris Dumez  <cdumez@apple.com>
2426
2427         [WK2][NETWORK_SESSION] Move some authentication-related code to avoid duplication
2428         https://bugs.webkit.org/show_bug.cgi?id=177667
2429
2430         Reviewed by Alex Christensen.
2431
2432         Move some authentication-related code to avoid duplication.
2433         This is a preparation code supporting Download authentication
2434         as Download uses a NSURLSessionDownloadTask and not a
2435         NetworkDataTask.
2436
2437         * NetworkProcess/NetworkDataTask.h:
2438         (WebKit::NetworkDataTask::setSuggestedFilename):
2439         * NetworkProcess/NetworkLoad.cpp:
2440         (WebKit::NetworkLoad::didReceiveChallenge):
2441         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
2442         * NetworkProcess/NetworkSession.cpp:
2443         (WebKit::NetworkSession::allowsSpecificHTTPSCertificateForHost):
2444         * NetworkProcess/NetworkSession.h:
2445         * NetworkProcess/PreconnectTask.cpp:
2446         (WebKit::PreconnectTask::didReceiveChallenge):
2447         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
2448         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2449         (WebKit::NetworkDataTaskCocoa::didReceiveChallenge):
2450         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
2451         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2452         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
2453         (WebKit::certificatesMatch):
2454         (WebKit::NetworkSessionCocoa::allowsSpecificHTTPSCertificateForHost):
2455
2456 2017-09-29  Alex Christensen  <achristensen@webkit.org>
2457
2458         Fix WKWebViewConfigurationPrivate after r222663
2459         https://bugs.webkit.org/show_bug.cgi?id=177644
2460
2461         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2462         (-[WKWebViewConfiguration init]):
2463         (-[WKWebViewConfiguration copyWithZone:]):
2464         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2465
2466 2017-09-29  Chris Dumez  <cdumez@apple.com>
2467
2468         Split some logic out of VisitedLinkStore and make it reusable
2469         https://bugs.webkit.org/show_bug.cgi?id=177575
2470
2471         Reviewed by Alex Christensen.
2472
2473         Split some logic out of VisitedLinkStore and make it reusable for other purposes than
2474         visited links and from other processes than the UIProcess.
2475
2476         The plan is to reuse the new SharedStringHashStore for Service Worker registration
2477         on StorageProcess side and querying on WebContent process side.
2478
2479         * CMakeLists.txt:
2480         * Shared/SharedStringHashStore.cpp: Added.
2481         (WebKit::nextPowerOf2):
2482         (WebKit::tableSizeForKeyCount):
2483         (WebKit::SharedStringHashStore::SharedStringHashStore):
2484         (WebKit::SharedStringHashStore::createSharedMemoryHandle):
2485         (WebKit::SharedStringHashStore::add):
2486         (WebKit::SharedStringHashStore::clear):
2487         (WebKit::SharedStringHashStore::resizeTable):
2488         (WebKit::SharedStringHashStore::pendingSharedStringHashesTimerFired):
2489         * Shared/SharedStringHashStore.h: Copied from Source/WebKit/WebProcess/WebPage/VisitedLinkTableController.h.
2490         (WebKit::SharedStringHashStore::Client::~Client):
2491         (WebKit::SharedStringHashStore::isEmpty const):
2492         * Shared/SharedStringHashTable.cpp: Renamed from Source/WebKit/Shared/VisitedLinkTable.cpp.
2493         (WebKit::SharedStringHashTable::SharedStringHashTable):
2494         (WebKit::SharedStringHashTable::~SharedStringHashTable):
2495         (WebKit::SharedStringHashTable::setSharedMemory):
2496         (WebKit::SharedStringHashTable::add):
2497         (WebKit::SharedStringHashTable::contains const):
2498         (WebKit::SharedStringHashTable::clear):
2499         * Shared/SharedStringHashTable.h: Renamed from Source/WebKit/Shared/VisitedLinkTable.h.
2500         * UIProcess/API/C/WKContext.cpp:
2501         (WKContextAddVisitedLink):
2502         * UIProcess/API/Cocoa/_WKVisitedLinkStore.mm:
2503         (-[_WKVisitedLinkStore addVisitedLinkWithURL:]):
2504         * UIProcess/VisitedLinkStore.cpp:
2505         (WebKit::VisitedLinkStore::VisitedLinkStore):
2506         (WebKit::VisitedLinkStore::addProcess):
2507         (WebKit::VisitedLinkStore::addVisitedLinkHash):
2508         (WebKit::VisitedLinkStore::removeAll):
2509         (WebKit::VisitedLinkStore::addVisitedLinkHashFromPage):
2510         (WebKit::VisitedLinkStore::sendStoreHandleToProcess):
2511         (WebKit::VisitedLinkStore::didInvalidateSharedMemory):
2512         (WebKit::VisitedLinkStore::didAddSharedStringHashes):
2513         * UIProcess/VisitedLinkStore.h:
2514         * UIProcess/WebProcessPool.cpp:
2515         * UIProcess/WebProcessPool.h:
2516         * UIProcess/WebProcessProxy.h:
2517         * WebKit.xcodeproj/project.pbxproj:
2518         * WebProcess/WebPage/VisitedLinkTableController.cpp:
2519         (WebKit::VisitedLinkTableController::isLinkVisited):
2520         (WebKit::VisitedLinkTableController::addVisitedLink):
2521         (WebKit::VisitedLinkTableController::visitedLinkStateChanged):
2522         * WebProcess/WebPage/VisitedLinkTableController.h:
2523         * WebProcess/WebPage/VisitedLinkTableController.messages.in:
2524
2525 2017-09-28  Alex Christensen  <achristensen@webkit.org>
2526
2527         Add WKWebViewConfiguration SPI equivalent to WKPageConfigurationSetBackgroundCPULimit
2528         https://bugs.webkit.org/show_bug.cgi?id=177644
2529         <rdar://problem/34338698>
2530
2531         Reviewed by Geoffrey Garen.
2532
2533         WKPageConfigurationSetBackgroundCPULimit is a setter of a std::optional<double> with no accessor.
2534         It's never set to 0 in practice, so I guess the ObjC equivalent is a double that is zero or nonzero.
2535
2536         * UIProcess/API/Cocoa/WKWebView.mm:
2537         (-[WKWebView _initializeWithConfiguration:]):
2538         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2539         (-[WKWebViewConfiguration _setCPULimit:]):
2540         (-[WKWebViewConfiguration _cpuLimit]):
2541         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2542
2543 2017-09-28  Ryosuke Niwa  <rniwa@webkit.org>
2544
2545         Image pasting is not working on tineye.com / gmail.com / GitHub.com due to lack of support for DataTransfer.items
2546         https://bugs.webkit.org/show_bug.cgi?id=170449
2547         <rdar://problem/31432525>
2548
2549         Reviewed by Wenson Hsieh.
2550
2551         Add sandbox extensions for files in the pasteboard to make copying & pasting image files work.
2552         This is what we do for drag & drop but we should consider adding a mechanism to rekoke the extension in the future.
2553
2554         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
2555         (WebKit::WebPasteboardProxy::getPasteboardPathnamesForType): Add sandbox extensions to the pasted files.
2556         * UIProcess/WebPasteboardProxy.h:
2557         * UIProcess/WebPasteboardProxy.messages.in:
2558         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2559         (WebKit::WebPlatformStrategies::getPathnamesForType): Consume the sandbox tokens sent by the UI process permanently
2560         since WebCore will now create File objects for these pasted files.
2561
2562 2017-09-29  Wenson Hsieh  <wenson_hsieh@apple.com>
2563
2564         [iOS WK2] Implement -[WKContentView hasText] for compatibility with the UITextInput protocol
2565         https://bugs.webkit.org/show_bug.cgi?id=177662
2566         <rdar://problem/33410373>
2567
2568         Reviewed by Tim Horton.
2569
2570         Implements -[WKContentView hasText] by propagating a flag through post-layout editor state.
2571
2572         * Shared/EditorState.cpp:
2573         (WebKit::EditorState::PostLayoutData::encode const):
2574         (WebKit::EditorState::PostLayoutData::decode):
2575         * Shared/EditorState.h:
2576
2577         Add a new flag to EditorState indicating whether or not the current editable root containing the selection has
2578         any plain text. Add IPC support for this new flag.
2579
2580         * UIProcess/ios/WKContentViewInteraction.mm:
2581         (-[WKContentView hasText]):
2582         * WebProcess/WebPage/ios/WebPageIOS.mm:
2583         (WebKit::computeEditableRootHasContentAndPlainText):
2584
2585         Add a new helper to compute whether or not the editable root has any content, and any plain text. This
2586         is used as the last cached value for -hasText on WKContentView that we will deliver to UIKit. Some important
2587         things to note here:
2588         - If post layout data already indicates that we have selected some plain text, or that there is a plain text
2589           character near the selection, just set the flags to true and bail, since the editable root necessarily has
2590           content that is plain text.
2591         - If hasContent is false, don't even bother computing hasPlainText, because it must also be false.
2592         - Otherwise, use hasAnyPlainText to compute the value of hasPlainText, which is a faster variant of plainText.
2593         These optimizations help us avoid doing extra work at all when running Speedometer, apart from checking the
2594         values of a few PostLayoutData flags. This also fixes the value of hasContent, which was previously always false
2595         if we had a range selection rather than a caret selection even when the editable root has content, because the
2596         logic to compute the value of hasContent only existed in the branch where we have a caret selection.
2597
2598         (WebKit::WebPage::platformEditorState const):
2599
2600 2017-09-28  Timothy Horton  <timothy_horton@apple.com>
2601
2602         Fix the macOS CMake build
2603
2604         * CMakeLists.txt:
2605
2606 2017-09-28  Timothy Horton  <timothy_horton@apple.com>
2607
2608         Revise deployment target macros from r222620
2609
2610         Rubber-stamped by Wenson Hsieh.
2611
2612         * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h:
2613         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2614         (WebKit::PDFPlugin::pdfDocumentDidLoad):
2615
2616 2017-09-28  Aishwarya Nirmal  <anirmal@apple.com>
2617
2618         Request for PDF URL targets for specific pages, sections, etc.
2619         https://bugs.webkit.org/show_bug.cgi?id=177582
2620         <rdar://problem/5692679>
2621
2622         Reviewed by Tim Horton.
2623         
2624         This change sets the URL fragment for scroll anchoring in PDFs.
2625
2626         * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h:
2627         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2628         (WebKit::PDFPlugin::pdfDocumentDidLoad):
2629
2630 2017-09-28  Ross Kirsling  <ross.kirsling@sony.com>
2631
2632         [PAL] Move HysteresisActivity into PAL
2633         https://bugs.webkit.org/show_bug.cgi?id=177516
2634
2635         Reviewed by Alex Christensen.
2636
2637         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
2638         (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::PendingFrameLoad):
2639         * Shared/WebSQLiteDatabaseTracker.cpp:
2640         (WebKit::WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker):
2641         (WebKit::WebSQLiteDatabaseTracker::hysteresisUpdated):
2642         * Shared/WebSQLiteDatabaseTracker.h:
2643         * WebProcess/WebPage/WebPage.cpp:
2644         (WebKit::m_pageScrolledHysteresis):
2645         (WebKit::m_userActivityHysteresis):
2646         (WebKit::WebPage::updateUserActivity):
2647         * WebProcess/WebPage/WebPage.h:
2648         * WebProcess/WebProcess.cpp:
2649         (WebKit::WebProcess::WebProcess):
2650         * WebProcess/WebProcess.h:
2651
2652 2017-09-28  Chris Dumez  <cdumez@apple.com>
2653
2654         Add support for <link rel=preconnect>
2655         https://bugs.webkit.org/show_bug.cgi?id=177474
2656         <rdar://problem/33141380>
2657
2658         Reviewed by Alex Christensen.
2659
2660         Add support for <link rel=preconnect>:
2661         - https://w3c.github.io/resource-hints/#preconnect
2662
2663         Also add corresponding native private API.
2664
2665         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2666         (WebKit::NetworkConnectionToWebProcess::preconnectTo):
2667         (WebKit::NetworkConnectionToWebProcess::didFinishPreconnection):
2668         * NetworkProcess/NetworkConnectionToWebProcess.h:
2669         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2670         * NetworkProcess/NetworkDataTask.cpp:
2671         (WebKit::NetworkDataTask::create):
2672         * NetworkProcess/NetworkLoadParameters.h:
2673         * NetworkProcess/NetworkProcess.cpp:
2674         (WebKit::NetworkProcess::preconnectTo):
2675         * NetworkProcess/NetworkProcess.h:
2676         * NetworkProcess/NetworkProcess.messages.in:
2677         * NetworkProcess/PreconnectTask.cpp: Added.
2678         (WebKit::PreconnectTask::PreconnectTask):
2679         (WebKit::PreconnectTask::~PreconnectTask):
2680         (WebKit::PreconnectTask::willPerformHTTPRedirection):
2681         (WebKit::PreconnectTask::didReceiveChallenge):
2682         (WebKit::PreconnectTask::didReceiveResponseNetworkSession):
2683         (WebKit::PreconnectTask::didReceiveData):
2684         (WebKit::PreconnectTask::didCompleteWithError):
2685         (WebKit::PreconnectTask::didSendData):
2686         (WebKit::PreconnectTask::wasBlocked):
2687         (WebKit::PreconnectTask::cannotShowURL):
2688         (WebKit::PreconnectTask::didFinish):
2689         * NetworkProcess/PreconnectTask.h: Copied from Source/WebKit/NetworkProcess/NetworkLoadParameters.h.
2690         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
2691         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2692         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
2693         * Shared/WebCoreArgumentCoders.h:
2694         * Shared/WebPreferencesDefinitions.h:
2695         * UIProcess/API/C/WKContext.cpp:
2696         (WKContextPreconnectToServer):
2697         * UIProcess/API/C/WKContextPrivate.h:
2698         * UIProcess/API/Cocoa/WKProcessPool.mm:
2699         (-[WKProcessPool _preconnectToServer:]):
2700         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2701         * UIProcess/WebProcessPool.cpp:
2702         (WebKit::WebProcessPool::preconnectToServer):
2703         * UIProcess/WebProcessPool.h:
2704         * WebKit.xcodeproj/project.pbxproj:
2705         * WebProcess/Network/NetworkProcessConnection.cpp:
2706         (WebKit::NetworkProcessConnection::didFinishPreconnection):
2707         * WebProcess/Network/NetworkProcessConnection.h:
2708         * WebProcess/Network/NetworkProcessConnection.messages.in:
2709         * WebProcess/Network/WebLoaderStrategy.cpp:
2710         (WebKit::WebLoaderStrategy::networkProcessCrashed):
2711         (WebKit::generateLoadIdentifier):
2712         (WebKit::WebLoaderStrategy::startPingLoad):
2713         (WebKit::WebLoaderStrategy::preconnectTo):
2714         (WebKit::WebLoaderStrategy::didFinishPreconnection):
2715         * WebProcess/Network/WebLoaderStrategy.h:
2716         * WebProcess/WebPage/WebPage.cpp:
2717         (WebKit::WebPage::updatePreferences):
2718         * config.h:
2719
2720 2017-09-28  Zan Dobersek  <zdobersek@igalia.com>
2721
2722         [Cairo] Remove the cairo_glyph_t complexity from GlyphBuffer
2723         https://bugs.webkit.org/show_bug.cgi?id=177598
2724
2725         Reviewed by Carlos Garcia Campos.
2726
2727         * Shared/API/c/cairo/WKImageCairo.cpp: Explicitly include the <cairo.h>
2728         header here now that it's not included in GlyphBuffer.h.
2729         * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp: Ditto.
2730
2731 2017-09-27  Alex Christensen  <achristensen@webkit.org>
2732
2733         Add WKContentRuleList notify action type
2734         https://bugs.webkit.org/show_bug.cgi?id=177013
2735         <rdar://problem/31073936>
2736
2737         Reviewed by Darin Adler.
2738
2739         * NetworkProcess/PingLoad.cpp:
2740         (WebKit::PingLoad::processContentExtensionRulesForLoad):
2741         * UIProcess/API/APINavigationClient.h:
2742         (API::NavigationClient::contentRuleListNotification):
2743         * UIProcess/API/C/WKPage.cpp:
2744         (WKPageSetPageNavigationClient):
2745         * UIProcess/API/C/WKPageNavigationClient.h:
2746         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
2747         * UIProcess/Cocoa/NavigationState.h:
2748         * UIProcess/Cocoa/NavigationState.mm:
2749         (WebKit::NavigationState::setNavigationDelegate):
2750         (WebKit::NavigationState::NavigationClient::contentRuleListNotification):
2751         * UIProcess/WebPageProxy.cpp:
2752         (WebKit::WebPageProxy::contentRuleListNotification):
2753         * UIProcess/WebPageProxy.h:
2754         * UIProcess/WebPageProxy.messages.in:
2755         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2756         (WebKit::WebChromeClient::contentRuleListNotification):
2757         * WebProcess/WebCoreSupport/WebChromeClient.h:
2758
2759 2017-09-27  Wenson Hsieh  <wenson_hsieh@apple.com>
2760
2761         Drag event DataTransfer has unexpected types "dyn.ah62d4..."
2762         https://bugs.webkit.org/show_bug.cgi?id=172526
2763         <rdar://problem/32396081>
2764
2765         Reviewed by Ryosuke Niwa.
2766
2767         Add boilerplate plumbing and encoder/decoder support for new pasteboard codepaths. See WebCore ChangeLog for
2768         more details.
2769
2770         * Scripts/webkit/messages.py:
2771         (headers_for_type):
2772         * Shared/WebCoreArgumentCoders.cpp:
2773         (IPC::ArgumentCoder<PasteboardCustomData>::encode):
2774         (IPC::ArgumentCoder<PasteboardCustomData>::decode):
2775
2776         Add encoder/decoder support for PasteboardCustomData.
2777
2778         (IPC::ArgumentCoder<PasteboardWebContent>::encode):
2779         (IPC::ArgumentCoder<PasteboardWebContent>::decode):
2780
2781         Encode and decode dataInHTMLFormat.
2782
2783         * Shared/WebCoreArgumentCoders.h:
2784         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
2785         (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
2786         (WebKit::WebPasteboardProxy::writeCustomData):
2787         * UIProcess/WebPasteboardProxy.cpp:
2788         (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
2789         (WebKit::WebPasteboardProxy::writeCustomData):
2790         * UIProcess/WebPasteboardProxy.h:
2791         * UIProcess/WebPasteboardProxy.messages.in:
2792         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2793         (WebKit::WebPlatformStrategies::typesSafeForDOMToReadAndWrite):
2794         (WebKit::WebPlatformStrategies::writeCustomData):
2795         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
2796
2797 2017-09-27  Alex Christensen  <achristensen@webkit.org>
2798
2799         Allow modern decoding of std::optional<T>
2800         https://bugs.webkit.org/show_bug.cgi?id=177519
2801
2802         Reviewed by Tim Horton.
2803
2804         * Platform/IPC/ArgumentCoders.h:
2805         (IPC::ArgumentCoder<std::optional<T>>::decode):
2806         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
2807         (IPC::ArgumentCoder<WebCore::PaymentAuthorizationResult>::decode):
2808         (IPC::ArgumentCoder<WebCore::PaymentError>::decode):
2809         (IPC::ArgumentCoder<WebCore::PaymentMethodUpdate>::decode):
2810         (IPC::ArgumentCoder<WebCore::ShippingContactUpdate>::decode):
2811         (IPC::ArgumentCoder<WebCore::ShippingMethodUpdate>::decode):
2812         * Shared/WebCoreArgumentCoders.cpp:
2813         (IPC::ArgumentCoder<IntPoint>::decode):
2814         (IPC::ArgumentCoder<IntSize>::decode):
2815         * Shared/WebCoreArgumentCoders.h:
2816         * Shared/WebPageCreationParameters.cpp:
2817         (WebKit::WebPageCreationParameters::decode):
2818
2819 2017-09-27  Commit Queue  <commit-queue@webkit.org>
2820
2821         Unreviewed, rolling out r222541.
2822         https://bugs.webkit.org/show_bug.cgi?id=177580
2823
2824         WebCore isn't ready for the asynchronousness this was going to
2825         enable (Requested by alexchristensen on #webkit).
2826
2827         Reverted changeset:
2828
2829         "Pass a completion handler instead of a
2830         WebFramePolicyListenerProxy during policy decisions"
2831         https://bugs.webkit.org/show_bug.cgi?id=177509
2832         http://trac.webkit.org/changeset/222541
2833
2834 2017-09-27  Tina Liu  <iting_liu@apple.com>
2835
2836         Expose setShouldSuppressFirstResponderChanges() as WKView SPI
2837         https://bugs.webkit.org/show_bug.cgi?id=177513
2838         <rdar://problem/34669220>
2839
2840         Reviewed by Wenson Hsieh.
2841
2842         We already have setShouldSuppressFirstResponderChanges() SPI on WKWebView; Expose it on
2843         WKView as well for clients using legacy WebKit.
2844
2845         * UIProcess/API/Cocoa/WKViewPrivate.h:
2846         * UIProcess/API/mac/WKView.mm:
2847         (-[WKView _setShouldSuppressFirstResponderChanges:]):
2848
2849 2017-09-27  Chris Dumez  <cdumez@apple.com>
2850
2851         Have PingLoad take a CompletionHandler
2852         https://bugs.webkit.org/show_bug.cgi?id=177549
2853
2854         Reviewed by Youenn Fablet.
2855
2856         Have PingLoad take a CompletionHandler instead of relying on it calling on method on the
2857         NetworkConnectionToWebProcess when it is done.
2858
2859         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2860         (WebKit::NetworkConnectionToWebProcess::loadPing):
2861         * NetworkProcess/PingLoad.cpp:
2862         (WebKit::PingLoad::PingLoad):
2863         (WebKit::PingLoad::didFinish):
2864         * NetworkProcess/PingLoad.h:
2865
2866 2017-09-26  Alex Christensen  <achristensen@webkit.org>
2867
2868         Pass a completion handler instead of a WebFramePolicyListenerProxy during policy decisions
2869         https://bugs.webkit.org/show_bug.cgi?id=177509
2870
2871         Reviewed by Tim Horton.
2872
2873         This makes WebFramePolicyListenerProxy just a wrapper around a WTF::Function which is only needed for the C and glib APIs.
2874         This is a step towards making WebPageProxy::DecidePolicyForResponseSync and WebPageProxy::DecidePolicyForNavigationAction asynchronous.
2875
2876         This patch has no change in behavior.
2877
2878         * CMakeLists.txt:
2879         * UIProcess/API/APINavigationClient.h:
2880         (API::NavigationClient::decidePolicyForNavigationAction):
2881         (API::NavigationClient::decidePolicyForNavigationResponse):
2882         * UIProcess/API/APIPolicyClient.h:
2883         (API::PolicyClient::decidePolicyForNavigationAction):
2884         (API::PolicyClient::decidePolicyForNewWindowAction):
2885         (API::PolicyClient::decidePolicyForResponse):
2886         * UIProcess/API/C/WKFramePolicyListener.cpp:
2887         (WKFramePolicyListenerUseWithPolicies):
2888         * UIProcess/API/C/WKPage.cpp:
2889         (WKPageSetPagePolicyClient):
2890         (WKPageSetPageNavigationClient):
2891         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
2892         * UIProcess/API/glib/WebKitPolicyClient.cpp:
2893         * UIProcess/Automation/WebAutomationSession.cpp:
2894         * UIProcess/Cocoa/NavigationState.h:
2895         * UIProcess/Cocoa/NavigationState.mm:
2896         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
2897         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse):
2898         * UIProcess/Cocoa/WebViewImpl.mm:
2899         * UIProcess/RemoteWebInspectorProxy.cpp:
2900         * UIProcess/WebFormSubmissionListenerProxy.h:
2901         * UIProcess/WebFrameListenerProxy.cpp: Removed.
2902         * UIProcess/WebFrameListenerProxy.h: Removed.
2903         * UIProcess/WebFramePolicyListenerProxy.cpp:
2904         (WebKit::WebFramePolicyListenerProxy::WebFramePolicyListenerProxy):
2905         (WebKit::WebFramePolicyListenerProxy::~WebFramePolicyListenerProxy):
2906         (WebKit::WebFramePolicyListenerProxy::create):
2907         (WebKit::WebFramePolicyListenerProxy::use):
2908         (WebKit::WebFramePolicyListenerProxy::download):
2909         (WebKit::WebFramePolicyListenerProxy::ignore):
2910         * UIProcess/WebFramePolicyListenerProxy.h:
2911         (WebKit::WebFramePolicyListenerProxy::create): Deleted.
2912         (): Deleted.
2913         (WebKit::WebFramePolicyListenerProxy::operator new): Deleted.
2914         * UIProcess/WebFrameProxy.cpp:
2915         (WebKit::WebFrameProxy::webProcessWillShutDown):
2916         (WebKit::WebFrameProxy::receivedPolicyDecision): Deleted.
2917         (WebKit::WebFrameProxy::setUpPolicyListenerProxy): Deleted.
2918         * UIProcess/WebFrameProxy.h:
2919         * UIProcess/WebInspectorProxy.cpp:
2920         * UIProcess/WebPageProxy.cpp:
2921         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2922         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
2923         (WebKit::WebPageProxy::decidePolicyForResponseSync):
2924         (WebKit::WebPageProxy::receivedPolicyDecision): Deleted.
2925         (WebKit::WebPageProxy::decidePolicyForResponse): Deleted.
2926         * UIProcess/WebPageProxy.h:
2927         * UIProcess/mac/ViewGestureControllerMac.mm:
2928         * WebKit.xcodeproj/project.pbxproj:
2929
2930 2017-09-26  Brian Burg  <bburg@apple.com>
2931
2932         Web Automation: overflow:hidden elements with no children are mistakenly reported as not visible
2933         https://bugs.webkit.org/show_bug.cgi?id=177514
2934         <rdar://problem/31936291>
2935
2936         Reviewed by Joseph Pecoraro.
2937
2938         * UIProcess/Automation/atoms/ElementDisplayed.js:
2939         (isShown.isElementSubtreeHiddenByOverflow):
2940         Array.prototype.every returns true when passed an empty list, so we need
2941         to check for the case where the element has no children and return 'false'.
2942
2943 2017-09-26  Youenn Fablet  <youenn@apple.com>
2944
2945         [Cocoa] Add a modern WKPreferences switch to disable WebRTC
2946         https://bugs.webkit.org/show_bug.cgi?id=176638
2947         <rdar://problem/34335158>
2948
2949         Reviewed by Alex Christensen.
2950
2951         * UIProcess/API/Cocoa/WKPreferences.mm:
2952         (-[WKPreferences _peerConnectionEnabled]):
2953         (-[WKPreferences _setPeerConnectionEnabled:]):
2954         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2955
2956 2017-09-26  Brent Fulgham  <bfulgham@apple.com>
2957
2958         Harden our access to the vector of URL schemes.
2959         https://bugs.webkit.org/show_bug.cgi?id=177470
2960         <rdar://problem/33881522>
2961
2962         Reviewed by Chris Dumez.
2963
2964         Instead of asserting, use MESSAGE_CHECK so that we actually refuse to access an invalid iterator.
2965
2966         * UIProcess/WebPageProxy.cpp:
2967         (WebKit::WebPageProxy::startURLSchemeTask):
2968         (WebKit::WebPageProxy::stopURLSchemeTask):
2969
2970 2017-09-26  Jer Noble  <jer.noble@apple.com>
2971
2972         Thrown ObjC exception when right clicking on <img> containing mp4 link
2973         https://bugs.webkit.org/show_bug.cgi?id=177370
2974
2975         Reviewed by Darin Adler.
2976
2977         Creating a NSImage from mp4 data will fail and return nil; do a nil-check before attempting
2978         to put the results into a NSMutableArray.
2979
2980         * UIProcess/mac/WebContextMenuProxyMac.mm:
2981         (WebKit::WebContextMenuProxyMac::createShareMenuItem):
2982
2983 2017-09-26  Brian Burg  <bburg@apple.com>
2984
2985         Web Automation: add commands to get and set user permissions for pages in an automation session
2986         https://bugs.webkit.org/show_bug.cgi?id=177405
2987         <rdar://problem/34493846>
2988
2989         Reviewed by Joseph Pecoraro.
2990
2991         To test some Web APIs via WebDriver, it needs to be possible to simulate a user accepting or
2992         denying requests for elevated permissions, such as getUserMedia() or geolocation.
2993
2994         This patch adds a generic way for a test to configure the automation session's
2995         simulated user action that will happen every time a specific permission is requested.
2996         A test can set a "session permission", trigger the permission request via Web API,
2997         and then verify that the page behaves correctly when the user accepted or denied the request.
2998
2999         A proposal will follow shortly to expose this functionality via a new REST API endpoint.
3000
3001         * UIProcess/Automation/Automation.json: Add get/set commands.
3002
3003         * UIProcess/Automation/WebAutomationSession.cpp:
3004         (WebKit::WebAutomationSession::getSessionPermissions):
3005         (WebKit::WebAutomationSession::setSessionPermissions):
3006         For now, store the permission value in a member of the session. The getUserMedia
3007         permission only needs a bool, but there is no reason we couldn't use more complicated
3008         values for permissions (i.e., strings, numbers, arrays, objects) someday.
3009
3010         (WebKit::WebAutomationSession::shouldAllowGetUserMediaForPage const):
3011         Expose the specific decision to be taken based on whether the request is allowed or denied.
3012
3013         * UIProcess/Automation/WebAutomationSession.h:
3014         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
3015         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
3016         If the page is under automation, then simulate the user action according to the
3017         current values of permissions set for the session.
3018
3019 2017-09-25  Alex Christensen  <achristensen@webkit.org>
3020
3021         Make PolicyAction an encodable enum class
3022         https://bugs.webkit.org/show_bug.cgi?id=177480
3023
3024         Reviewed by Antti Koivisto.
3025
3026         * NetworkProcess/Downloads/DownloadManager.cpp:
3027         (WebKit::DownloadManager::continueDecidePendingDownloadDestination):
3028         (WebKit::DownloadManager::cancelDownload):
3029         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
3030         (WebKit::NetworkCORSPreflightChecker::didReceiveResponseNetworkSession):
3031         * NetworkProcess/NetworkDataTask.cpp:
3032         (WebKit::NetworkDataTask::didReceiveResponse):
3033         * NetworkProcess/NetworkDataTaskBlob.cpp:
3034         (WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse):
3035         * NetworkProcess/NetworkLoad.cpp:
3036         (WebKit::NetworkLoad::~NetworkLoad):
3037         (WebKit::NetworkLoad::continueDidReceiveResponse):
3038         (WebKit::NetworkLoad::notifyDidReceiveResponse):
3039         * NetworkProcess/PingLoad.cpp:
3040         (WebKit::PingLoad::didReceiveResponseNetworkSession):
3041         * NetworkProcess/capture/NetworkDataTaskReplay.cpp:
3042         (WebKit::NetworkCapture::NetworkDataTaskReplay::didReceiveResponse):
3043         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3044         (toNSURLSessionResponseDisposition):
3045         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
3046         (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse):
3047         * Scripts/webkit/messages.py:
3048         (headers_for_type):
3049         * UIProcess/WebFormSubmissionListenerProxy.h:
3050         * UIProcess/WebFrameListenerProxy.h:
3051         (WebKit::WebFrameListenerProxy::navigation): Deleted.
3052         * UIProcess/WebFramePolicyListenerProxy.cpp:
3053         (WebKit::WebFramePolicyListenerProxy::use):
3054         (WebKit::WebFramePolicyListenerProxy::download):
3055         (WebKit::WebFramePolicyListenerProxy::ignore):
3056         * UIProcess/WebPageProxy.cpp:
3057         (WebKit::WebPageProxy::receivedPolicyDecision):
3058         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
3059         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3060         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
3061         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
3062         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
3063         * WebProcess/WebPage/WebFrame.cpp:
3064         (WebKit::WebFrame::invalidatePolicyListener):
3065         * WebProcess/WebPage/WebPage.cpp:
3066         (WebKit::WebPage::didReceivePolicyDecision):
3067         * WebProcess/WebPage/WebPage.h:
3068         * WebProcess/WebPage/WebPage.messages.in:
3069
3070 2017-09-25  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
3071
3072         [WinCairo] Share default value of font family preferences among non-cocoa builds
3073         https://bugs.webkit.org/show_bug.cgi?id=177479
3074
3075         Reviewed by Yusuke Suzuki.
3076
3077         * Shared/WebPreferencesDefinitions.h:
3078
3079 2017-09-25  Frederik Riedel  <riedel@apple.com>
3080
3081         Expose way to set values of classified form controls as {Legacy WebKit, WebKit} SPI
3082         https://bugs.webkit.org/show_bug.cgi?id=174394
3083         <rdar://problem/33183504>
3084
3085         Reviewed by Ryosuke Niwa.
3086
3087         * Platform/spi/ios/UIKitSPI.h:
3088         * Shared/AssistedNodeInformation.cpp:
3089         (WebKit::AssistedNodeInformation::encode const):
3090         Encodes additional node information, including if the node is part of a login screen.
3091         (WebKit::AssistedNodeInformation::decode):
3092         Decodes the additional assisted node information.
3093         * Shared/AssistedNodeInformation.h:
3094         * UIProcess/WebPageProxy.h:
3095         * UIProcess/ios/WKContentView.mm:
3096         (-[WKContentView acceptsAutofilledLoginCredentials]):
3097         Determines if the WKContentView shows a login screen.
3098         (-[WKContentView representingPageUrl]):
3099         Returns the URL of the currently displayed web page.
3100         * UIProcess/ios/WKContentViewInteraction.mm:
3101         (-[WKContentView insertTextSuggestion:]):
3102         Inserts the login credentials into the Web View.
3103         * UIProcess/ios/WebPageProxyIOS.mm:
3104         (WebKit::WebPageProxy::startAssistingNode):
3105         Transfer the additional assistednode information (acceptsAutofilledLoginCredentials and representingPageUrl).
3106         (WebKit::WebPageProxy::acceptsAutofilledLoginCredentials):
3107         Returns if the Web View shows a login screen.
3108         (WebKit::WebPageProxy::representingPageUrl):
3109         Returns the Web View's URL.
3110         (WebKit::WebPageProxy::autofillLoginCredentials):
3111         Insert the credentials into the Web View.
3112         * WebProcess/WebPage/WebPage.h:
3113         * WebProcess/WebPage/WebPage.messages.in:
3114         * WebProcess/WebPage/ios/WebPageIOS.mm:
3115         (WebKit::WebPage::getAssistedNodeInformation): Transports the information if the currently
3116         highlighted node accepts autofilled login credentials.
3117         (WebKit::WebPage::autofillLoginCredentials): Fills the login credentials into the
3118         WebPage.
3119
3120 2017-09-25  Youenn Fablet  <youenn@apple.com>
3121
3122         WebRTC video does not resume receiving when switching back to Safari 11 on iOS
3123         https://bugs.webkit.org/show_bug.cgi?id=175472
3124         <rdar://problem/33860863>
3125
3126         Reviewed by Darin Adler.
3127
3128         Notifying LibWebRTC of backgrounding/foregrouding.
3129
3130         * WebProcess/WebPage/ios/WebPageIOS.mm:
3131         (WebKit::WebPage::applicationDidEnterBackground):
3132         (WebKit::WebPage::applicationWillEnterForeground):
3133
3134 2017-09-25  Sam Weinig  <sam@webkit.org>
3135
3136         Remove unused EditorClient functions
3137         https://bugs.webkit.org/show_bug.cgi?id=177463
3138
3139         Reviewed by Alex Christensen.
3140
3141         Remove unused EditorClient functions.
3142
3143         * WebProcess/WebCoreSupport/WebEditorClient.h:
3144         * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
3145         (WebKit::WebEditorClient::canonicalizeURL): Deleted.
3146         (WebKit::WebEditorClient::canonicalizeURLString): Deleted.
3147         (WebKit::WebEditorClient::writeDataToPasteboard): Deleted.
3148         (WebKit::WebEditorClient::supportedPasteboardTypesForCurrentSelection): Deleted.
3149         (WebKit::WebEditorClient::readDataFromPasteboard): Deleted.
3150         (WebKit::WebEditorClient::pasteboardChangeCount): Deleted.
3151         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
3152         (WebKit::WebEditorClient::canonicalizeURL): Deleted.
3153         (WebKit::WebEditorClient::canonicalizeURLString): Deleted.
3154
3155 2017-09-25  Alex Christensen  <achristensen@webkit.org>
3156
3157         Make Attribute an enum class
3158         https://bugs.webkit.org/show_bug.cgi?id=177414
3159
3160         Reviewed by Yusuke Suzuki.
3161
3162         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
3163         (WebKit::JSNPObject::getOwnPropertySlot):
3164
3165 2017-09-25  Alex Christensen  <achristensen@webkit.org>
3166
3167         Stop using PolicyCallback
3168         https://bugs.webkit.org/show_bug.cgi?id=176088
3169
3170         Reviewed by Andy Estes.
3171
3172         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3173         * WebProcess/WebPage/WebFrame.cpp:
3174         (WebKit::WebFrame::invalidatePolicyListener):
3175         * WebProcess/WebPage/WebFrame.h:
3176         * WebProcess/WebPage/WebInspector.cpp:
3177
3178 2017-09-25  Chris Dumez  <cdumez@apple.com>
3179
3180         [WK2] Add API to query if a download was user-initiated
3181         https://bugs.webkit.org/show_bug.cgi?id=177435
3182         <rdar://problem/34498422>
3183
3184         Reviewed by Alex Christensen.
3185
3186         Add C and Cocoa private API to query if a download was user-initiated.
3187
3188         For clarity, we now construct navigation object for subframe loads
3189         as well (we used to do so only for main frame loads). This allows us
3190         to store the user-intiated flag and the redirect chain on the navigation
3191         object instead of the WebFrameProxy.
3192
3193         * UIProcess/API/APINavigation.cpp:
3194         (API::Navigation::Navigation):
3195         (API::Navigation::appendRedirectionURL):
3196         * UIProcess/API/APINavigation.h:
3197         (API::Navigation::takeRedirectChain):
3198         (API::Navigation::setWasUserInitiated):
3199         (API::Navigation::wasUserInitiated const):
3200         * UIProcess/API/C/WKDownload.cpp:
3201         (WKDownloadGetWasUserInitiated):
3202         * UIProcess/API/C/WKDownload.h:
3203         * UIProcess/API/Cocoa/_WKDownload.h:
3204         * UIProcess/API/Cocoa/_WKDownload.mm:
3205         (-[_WKDownload wasUserInitiated]):
3206         * UIProcess/Downloads/DownloadProxy.h:
3207         (WebKit::DownloadProxy::setWasUserInitiated):
3208         (WebKit::DownloadProxy::wasUserInitiated const):
3209         * UIProcess/WebFrameProxy.cpp:
3210         (WebKit::WebFrameProxy::didStartProvisionalLoad):
3211         (WebKit::WebFrameProxy::didReceiveServerRedirectForProvisionalLoad):
3212         (WebKit::WebFrameProxy::didFailProvisionalLoad):
3213         (WebKit::WebFrameProxy::didFinishLoad):
3214         (WebKit::WebFrameProxy::didFailLoad):
3215         * UIProcess/WebFrameProxy.h:
3216         (WebKit::WebFrameProxy::title const):
3217         * UIProcess/WebPageProxy.cpp:
3218         (WebKit::WebPageProxy::receivedPolicyDecision):
3219         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
3220         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
3221         (WebKit::WebPageProxy::decidePolicyForResponse):
3222         (WebKit::WebPageProxy::decidePolicyForResponseSync):
3223         * UIProcess/WebPageProxy.h:
3224         * UIProcess/WebPageProxy.messages.in:
3225         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3226         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
3227
3228 2017-09-25  Chris Dumez  <cdumez@apple.com>
3229
3230         Make StoredCredentials an enum class and rename its header
3231         https://bugs.webkit.org/show_bug.cgi?id=177455
3232
3233         Reviewed by Youenn Fablet.
3234
3235         Make StoredCredentials an enum class and rename its header for clarity. This was error-prone because 0 meant
3236         "allow" and and 1 meant "do not allow". It was trivial to convert it to a boolean by mistake and get the
3237         opposite behavior.
3238
3239         * NetworkProcess/Downloads/DownloadManager.cpp:
3240         (WebKit::DownloadManager::startDownload):
3241         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
3242         (WebKit::NetworkCORSPreflightChecker::didCompleteWithError):
3243         * NetworkProcess/NetworkCORSPreflightChecker.h:
3244         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3245         (WebKit::NetworkConnectionToWebProcess::loadPing):
3246         * NetworkProcess/NetworkDataTask.cpp:
3247         (WebKit::NetworkDataTask::create):
3248         (WebKit::NetworkDataTask::NetworkDataTask):
3249         * NetworkProcess/NetworkDataTask.h:
3250         * NetworkProcess/NetworkDataTaskBlob.cpp:
3251         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
3252         * NetworkProcess/NetworkLoad.cpp:
3253         (WebKit::NetworkLoad::shouldUseCredentialStorage):
3254         * NetworkProcess/NetworkLoadParameters.h:
3255         * NetworkProcess/NetworkResourceLoadParameters.cpp:
3256         (WebKit::NetworkResourceLoadParameters::encode const):
3257         (WebKit::NetworkResourceLoadParameters::decode):
3258         * NetworkProcess/PingLoad.cpp:
3259         (WebKit::PingLoad::willPerformHTTPRedirection):
3260         (WebKit::PingLoad::makeCrossOriginAccessRequest):
3261         (WebKit::PingLoad::makeSimpleCrossOriginAccessRequest):
3262         (WebKit::PingLoad::makeCrossOriginAccessRequestWithPreflight):
3263         (WebKit::PingLoad::preflightSuccess):
3264         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
3265         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
3266         * NetworkProcess/capture/NetworkDataTaskReplay.cpp:
3267         (WebKit::NetworkCapture::NetworkDataTaskReplay::NetworkDataTaskReplay):
3268         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
3269         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3270         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
3271         (WebKit::NetworkDataTaskCocoa::~NetworkDataTaskCocoa):
3272         (WebKit::NetworkDataTaskCocoa::tryPasswordBasedAuthentication):
3273         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
3274         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3275         (-[WKNetworkSessionDelegate existingTask:]):
3276         (WebKit::NetworkSessionCocoa::dataTaskForIdentifier):
3277         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
3278         (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
3279         (WebKit::NetworkDataTaskSoup::createRequest):
3280         (WebKit::NetworkDataTaskSoup::authenticate):
3281         (WebKit::NetworkDataTaskSoup::continueAuthenticate):
3282         (WebKit::NetworkDataTaskSoup::continueHTTPRedirection):
3283         * NetworkProcess/soup/NetworkDataTaskSoup.h:
3284         * WebProcess/Network/WebLoaderStrategy.cpp:
3285         (WebKit::WebLoaderStrategy::scheduleLoad):
3286         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
3287         (WebKit::WebLoaderStrategy::startPingLoad):
3288         * WebProcess/Network/WebLoaderStrategy.h:
3289
3290 2017-09-25  Sam Weinig  <sam@webkit.org>
3291
3292         Remove unnecessary userVisibleString EditorClient function
3293         https://bugs.webkit.org/show_bug.cgi?id=177456
3294
3295         Reviewed by Dan Bernstein.
3296
3297         * WebProcess/WebCoreSupport/WebEditorClient.h:
3298         * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
3299         (WebKit::WebEditorClient::userVisibleString): Deleted.
3300         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
3301         (WebKit::WebEditorClient::userVisibleString): Deleted.
3302
3303             Remove userVisibleString client function.
3304
3305 2017-09-25  Commit Queue  <commit-queue@webkit.org>
3306
3307         Unreviewed, rolling out r222455.
3308         https://bugs.webkit.org/show_bug.cgi?id=177460
3309
3310         broke iOS build (Requested by alexchristensen on #webkit).
3311
3312         Reverted changeset:
3313
3314         "Add WKContentRuleList notify action type"
3315         https://bugs.webkit.org/show_bug.cgi?id=177013
3316         http://trac.webkit.org/changeset/222455
3317
3318 2017-09-25  Alex Christensen  <achristensen@webkit.org>
3319
3320         Separate form submission from PolicyChecker infrastructure
3321         https://bugs.webkit.org/show_bug.cgi?id=177396
3322
3323         Reviewed by Geoffrey Garen.
3324
3325         * UIProcess/API/APIFormClient.h:
3326         (API::FormClient::willSubmitForm):
3327         * UIProcess/API/Cocoa/WKWebView.mm:
3328         (-[WKWebView _setInputDelegate:]):
3329         * UIProcess/WebFormClient.cpp:
3330         (WebKit::WebFormClient::willSubmitForm):
3331         * UIProcess/WebFormClient.h:
3332         * UIProcess/WebFormSubmissionListenerProxy.cpp:
3333         (WebKit::WebFormSubmissionListenerProxy::continueSubmission):
3334         (WebKit::WebFormSubmissionListenerProxy::WebFormSubmissionListenerProxy): Deleted.
3335         * UIProcess/WebFormSubmissionListenerProxy.h:
3336         (WebKit::WebFormSubmissionListenerProxy::create):
3337         (WebKit::WebFormSubmissionListenerProxy::WebFormSubmissionListenerProxy):
3338         (): Deleted.
3339         (WebKit::WebFormSubmissionListenerProxy::operator new): Deleted.
3340         * UIProcess/WebFrameProxy.cpp:
3341         (WebKit::WebFrameProxy::setUpFormSubmissionListenerProxy): Deleted.
3342         * UIProcess/WebFrameProxy.h:
3343         * UIProcess/WebPageProxy.cpp:
3344         (WebKit::WebPageProxy::willSubmitForm):
3345         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3346         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
3347         (WebKit::WebFrameLoaderClient::dispatchWillSubmitForm):
3348         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
3349         * WebProcess/WebPage/WebFrame.cpp:
3350         (WebKit::WebFrame::setUpWillSubmitFormListener):
3351         (WebKit::WebFrame::continueWillSubmitForm):
3352         * WebProcess/WebPage/WebFrame.h:
3353         * WebProcess/WebPage/WebPage.cpp:
3354         (WebKit::WebPage::continueWillSubmitForm):
3355         * WebProcess/WebPage/WebPage.h:
3356         * WebProcess/WebPage/WebPage.messages.in:
3357
3358 2017-09-25  Alex Christensen  <achristensen@webkit.org>
3359
3360         Add WKContentRuleList notify action type
3361         https://bugs.webkit.org/show_bug.cgi?id=177013
3362         <rdar://problem/31073936>
3363
3364         Reviewed by Darin Adler.
3365
3366         * NetworkProcess/PingLoad.cpp:
3367         (WebKit::PingLoad::processContentExtensionRulesForLoad):
3368         * UIProcess/API/APINavigationClient.h:
3369         (API::NavigationClient::contentRuleListNotification):
3370         * UIProcess/API/C/WKPage.cpp:
3371         (WKPageSetPageNavigationClient):
3372         * UIProcess/API/C/WKPageNavigationClient.h:
3373         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
3374         * UIProcess/Cocoa/NavigationState.h:
3375         * UIProcess/Cocoa/NavigationState.mm:
3376         (WebKit::NavigationState::setNavigationDelegate):
3377         (WebKit::NavigationState::NavigationClient::contentRuleListNotification):
3378         * UIProcess/WebPageProxy.cpp:
3379         (WebKit::WebPageProxy::contentRuleListNotification):
3380         * UIProcess/WebPageProxy.h:
3381         * UIProcess/WebPageProxy.messages.in:
3382         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3383         (WebKit::WebChromeClient::contentRuleListNotification):
3384         * WebProcess/WebCoreSupport/WebChromeClient.h:
3385
3386 2017-09-25  Timothy Horton  <timothy_horton@apple.com>
3387
3388         Make progress on getting Mac CMake building again
3389         https://bugs.webkit.org/show_bug.cgi?id=177443
3390
3391         Unreviewed, just "fixing" the build.
3392
3393         * PlatformMac.cmake:
3394         Add some missing files and include paths.
3395
3396 2017-09-24  Michael Catanzaro  <mcatanzaro@igalia.com>
3397
3398         Viewport fit is no longer experimental
3399         https://bugs.webkit.org/show_bug.cgi?id=177417
3400
3401         Reviewed by Darin Adler.
3402
3403         * Shared/WebPreferencesDefinitions.h:
3404
3405 2017-09-24  Michael Catanzaro  <mcatanzaro@igalia.com>
3406
3407         [GTK] Unreviewed, move webkit_hit_test_result_context_is_scrollbar in documentation
3408
3409         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
3410
3411 2017-09-24  Michael Catanzaro  <mcatanzaro@igalia.com>
3412
3413         Alphabetize experimental features list
3414         https://bugs.webkit.org/show_bug.cgi?id=177374
3415
3416         Reviewed by Darin Adler.
3417
3418         * Shared/WebPreferencesDefinitions.h:
3419
3420 2017-09-24  Zan Dobersek  <zdobersek@igalia.com>
3421
3422         [WebKit] Changing EME setting through InjectedBundle should update WebPreferencesStore
3423         https://bugs.webkit.org/show_bug.cgi?id=177312
3424
3425         Reviewed by Carlos Garcia Campos.
3426
3427         When enabling EME through the InjectedBundle for testing purposes, it's
3428         only enabled in RuntimeEnabledFeatures, but not in WebPreferencesStore.
3429         This causes failures on imported W3C tests that cover EME persistent
3430         state licenses and perform parts of that test in a new window, where
3431         the original RuntimeEnabledFeatures state doesn't have any effect.
3432
3433         To avoid those failures, when enabling EME feature for testing purposes
3434         through InjectedBundle, the feature should also be enabled in the
3435         WebPreferencesStore.
3436
3437         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3438         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
3439
3440 2017-09-22  Zalan Bujtas  <zalan@apple.com>
3441
3442         WeakPtrFactory should populate m_ref lazily.
3443         https://bugs.webkit.org/show_bug.cgi?id=177375
3444
3445         Reviewed by Geoffrey Garen.
3446
3447         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
3448         (WebKit::WebPaymentCoordinatorProxy::WebPaymentCoordinatorProxy):
3449         (WebKit::WebPaymentCoordinatorProxy::canMakePaymentsWithActiveCard):
3450         (WebKit::WebPaymentCoordinatorProxy::openPaymentSetup):
3451         * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
3452         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
3453         * UIProcess/ApplicationStateTracker.mm:
3454         (WebKit::ApplicationStateTracker::ApplicationStateTracker):
3455         * UIProcess/Cocoa/WebViewImpl.h:
3456         (WebKit::WebViewImpl::createWeakPtr):
3457         * UIProcess/Cocoa/WebViewImpl.mm:
3458         (WebKit::WebViewImpl::WebViewImpl):
3459         * UIProcess/Launcher/ProcessLauncher.cpp:
3460         (WebKit::ProcessLauncher::ProcessLauncher):
3461         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
3462         (WebKit::ProcessLauncher::launchProcess):
3463         * UIProcess/ProcessAssertion.h:
3464         (WebKit::ProcessAssertion::createWeakPtr):
3465         * UIProcess/WebPageProxy.cpp:
3466         (WebKit::m_configurationPreferenceValues):
3467         (WebKit::m_weakPtrFactory): Deleted.
3468         * UIProcess/WebPageProxy.h:
3469         (WebKit::WebPageProxy::createWeakPtr const):
3470         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
3471         (WebKit::RemoteLayerTreeDrawingArea::createWeakPtr):
3472         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
3473         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
3474
3475 2017-09-22  John Wilander  <wilander@apple.com>
3476
3477         Re-enable configuration.HTTPCookieStorage on session without credentials
3478         https://bugs.webkit.org/show_bug.cgi?id=177393
3479
3480         This patch rolls back the crucial change to the network session
3481         without credentials that landed in r221632:
3482         <http://trac.webkit.org/changeset/221632>
3483
3484         Reviewed by Brent Fulgham.
3485
3486         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3487         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
3488             Commented out the disabled cookie jar and added a FIXME
3489             referring to https://bugs.webkit.org/show_bug.cgi?id=177394.
3490
3491 2017-09-22  Chris Dumez  <cdumez@apple.com>
3492
3493         Enable File and Directory Entries API at runtime
3494         https://bugs.webkit.org/show_bug.cgi?id=176616
3495         <rdar://problem/34330942>
3496
3497         Reviewed by Geoffrey Garen.
3498
3499         Enable File and Directory Entries API at runtime on Mac/WebKit2,
3500         now that DataTransfer.items is enabled there.
3501
3502         * Shared/WebPreferencesDefinitions.h:
3503
3504 2017-09-22  Matt Lewis  <jlewis3@apple.com>
3505
3506         Unreviewed, rolling out r222394.
3507
3508         This broke the Windows Debug Build.
3509
3510         Reverted changeset:
3511
3512         "Remove build-webkit's notion of feature flags having a
3513         default value"
3514         https://bugs.webkit.org/show_bug.cgi?id=177338
3515         http://trac.webkit.org/changeset/222394
3516
3517 2017-09-22  John Wilander  <wilander@apple.com>
3518
3519         Non-prevalent resources should be allowed access to existing cookies in a third-party context
3520         https://bugs.webkit.org/show_bug.cgi?id=177336
3521         <rdar://problem/34578257>
3522
3523         Reviewed by Brent Fulgham.
3524
3525         This patch restructures what is communicated to the network process,
3526         from two vectors - with user interaction and without user interaction -
3527         to three vectors - to partition, to block, to neither partition nor block.
3528         The previous two vectors did not allow proper categorization into which
3529         domains should be partitioned, blocked, or left alone. That was the cause
3530         of the regression where non-prevalent third-party domains erroneously had
3531         their cookies blocked when they should fall back to the old behavior of
3532         access but no new cookies allowed to be set.
3533
3534         * NetworkProcess/NetworkProcess.cpp:
3535         (WebKit::NetworkProcess::updatePrevalentDomainsToPartitionOrBlockCookies):
3536         (WebKit::NetworkProcess::updatePrevalentDomainsWithAndWithoutInteraction): Deleted.
3537         * NetworkProcess/NetworkProcess.h:
3538         * NetworkProcess/NetworkProcess.messages.in:
3539         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3540         (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:]):
3541         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3542         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
3543         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
3544         (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains):
3545         (WebKit::WebResourceLoadStatisticsStore::clearInMemory):
3546         (WebKit::WebResourceLoadStatisticsStore::shouldPartitionCookies const):
3547         (WebKit::WebResourceLoadStatisticsStore::shouldBlockCookies const):
3548         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
3549         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains):
3550         (WebKit::WebResourceLoadStatisticsStore::clearPartitioningStateForDomains):
3551         (WebKit::WebResourceLoadStatisticsStore::resetCookiePartitioningState):