18b023c8e0cfc985adb0a2b3c12b65418943089b
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2018-04-05  Ryosuke Niwa  <rniwa@webkit.org>
2
3         WebContent process sometimes hangs in WebProcess::ensureNetworkProcessConnection
4         https://bugs.webkit.org/show_bug.cgi?id=184326
5
6         Reviewed by Chris Dumez.
7
8         The hang was caused by UI process never sending the reply back to GetNetworkProcessConnection
9         due to m_pendingOutgoingMachMessage being set and the event handler for DISPATCH_MACH_SEND_POSSIBLE
10         never getting called. This is because the event handler registration happens asynchronously,
11         and may not have completed by the time we send the first IPC to the web content process
12         in which case it can timeout and we may never get the callback.
13
14         Fixed the hang by waiting for the event handler registration to be completed using
15         dispatch_source_set_registration_handler. To do this, this patch adds a new boolean instance variable,
16         m_isInitializingSendSource, to Connection which is set to true between the time mach port is created
17         and until the event handler registration has been completed. platformCanSendOutgoingMessages returns
18         false while m_isInitializingSendSource is set to prevent the attempt to send messages like we do when
19         m_pendingOutgoingMachMessage is set to true.
20
21         * Platform/IPC/Connection.h:
22         (IPC::Connection::m_isInitializingSendSource): Added.
23         * Platform/IPC/mac/ConnectionMac.mm:
24         (IPC::Connection::platformInvalidate): Set m_isInitializingSendSource to false.
25         (IPC::Connection::sendMessage): Assert that m_isInitializingSendSource is false.
26         (IPC::Connection::platformCanSendOutgoingMessages const): Return false if m_isInitializingSendSource
27         is set to true.
28         (IPC::Connection::sendOutgoingMessage): Assert that m_isInitializingSendSource is false.
29         (IPC::Connection::initializeSendSource): Set m_isInitializingSendSource to true temporarily until
30         dispatch_source_set_registration_handler's callback is called. Resume and send any pending outgoing
31         messages.
32         (IPC::Connection::resumeSendSource): Extracted from initializeSendSource.
33
34 2018-04-05  Youenn Fablet  <youenn@apple.com>
35
36         WebRTC data channel only applications require capture permissions for direct connections
37         https://bugs.webkit.org/show_bug.cgi?id=174500
38         <rdar://problem/34134281>
39
40         Unreviewed.
41         Changed the code to suppress: "error: unused variable 'error' [-Werror,-Wunused-variable]"
42         Added some logging to this error case as a side bonus.
43
44         * NetworkProcess/webrtc/NetworkMDNSRegister.cpp:
45         (WebKit::NetworkMDNSRegister::registerMDNSName):
46
47 2018-04-05  Carlos Garcia Campos  <cgarcia@igalia.com>
48
49         REGRESSION(r229831): Test WebKit2.ProvisionalURLAfterWillSendRequestCallback times out since r229831
50         https://bugs.webkit.org/show_bug.cgi?id=184293
51
52         Reviewed by Alex Christensen.
53
54         The problem is that after willSendRequest callback changes the request, the load is cancelled while
55         transitioning to committed state. This happens because the load is not waiting for the response policy check, so
56         it continues and when transitioning to committed, FrameLoader::closeURL() invalidates the current policy check
57         that causes a load failure. The new request returned by the API doesn't have any requester, so it's no longer
58         considered a main resource load. In the network process the resource load task doesn't wait for the response
59         policy and continues the load, sending the data to the web process. Once the first data is received, the load
60         transitions to commit, but the response policy check is still ongoing. This can only happen when using the C API
61         (I don't know about the Cocoa API), but not with the GLib API because it doesn't allow to create a new request,
62         only to modify the passed in one. With the C API we loss other internal things of the request like the priority,
63         but I guess the most important one is the requester.
64
65         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
66         (WebKit::WebFrameLoaderClient::dispatchWillSendRequest):
67
68 2018-04-04  Ryan Haddad  <ryanhaddad@apple.com>
69
70         Unreviewed, rolling out r230283.
71
72         Caused webkitpy test failures.
73
74         Reverted changeset:
75
76         "Use CompletionHandlers for DelayedReplies"
77         https://bugs.webkit.org/show_bug.cgi?id=182269
78         https://trac.webkit.org/changeset/230283
79
80 2018-04-04  Youenn Fablet  <youenn@apple.com>
81
82         webrtc/video-update-often.html is flakily crashing on iOS simulator Debug
83         https://bugs.webkit.org/show_bug.cgi?id=184022
84
85         Reviewed by Jer Noble.
86
87         Remove client context once the new context identifier is set.
88         Covered by test no longer crashing locally.
89
90         * WebProcess/cocoa/PlaybackSessionManager.mm:
91         (WebKit::PlaybackSessionManager::setUpPlaybackControlsManager):
92
93 2018-04-04  Youenn Fablet  <youenn@apple.com>
94
95         WebRTC data channel only applications require capture permissions for direct connections
96         https://bugs.webkit.org/show_bug.cgi?id=174500
97         <rdar://problem/34134281>
98
99         Reviewed by Eric Carlson.
100
101         Add support for MDNS registration and resolution by NetworkProcess.
102         WebProcess gives instruction to do the actual registrations/resolutions.
103
104         * CMakeLists.txt:
105         * DerivedSources.make:
106         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
107         (WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):
108         (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
109         * NetworkProcess/NetworkConnectionToWebProcess.h:
110         (WebKit::NetworkConnectionToWebProcess::mdnsRegister):
111         * NetworkProcess/webrtc/NetworkMDNSRegister.cpp: Added.
112         (WebKit::NetworkMDNSRegister::NetworkMDNSRegister):
113         (WebKit::NetworkMDNSRegister::~NetworkMDNSRegister):
114         (WebKit::NetworkMDNSRegister::unregisterMDNSNames):
115         (WebKit::PendingRegistrationRequest::PendingRegistrationRequest):
116         (WebKit::registerMDNSNameCallback):
117         (WebKit::NetworkMDNSRegister::registerMDNSName):
118         (WebKit::PendingResolutionRequest::PendingResolutionRequest):
119         (WebKit::PendingResolutionRequest::~PendingResolutionRequest):
120         (WebKit::PendingResolutionRequest::timeout):
121         (WebKit::resolveMDNSNameCallback):
122         (WebKit::NetworkMDNSRegister::resolveMDNSName):
123         * NetworkProcess/webrtc/NetworkMDNSRegister.h: Added.
124         * NetworkProcess/webrtc/NetworkMDNSRegister.messages.in: Added.
125         * Shared/WebPreferences.yaml:
126         * UIProcess/API/C/WKPreferences.cpp:
127         (WKPreferencesSetWebRTCMDNSICECandidatesEnabled):
128         (WKPreferencesGetWebRTCMDNSICECandidatesEnabled):
129         * UIProcess/API/C/WKPreferencesRef.h:
130         * WebKit.xcodeproj/project.pbxproj:
131         * WebProcess/InjectedBundle/InjectedBundle.cpp:
132         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
133         * WebProcess/Network/NetworkProcessConnection.cpp:
134         (WebKit::NetworkProcessConnection::didReceiveMessage):
135         * WebProcess/Network/webrtc/LibWebRTCNetwork.h:
136         (WebKit::LibWebRTCNetwork::mdnsRegister):
137         * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
138         (WebKit::LibWebRTCProvider::unregisterMDNSNames):
139         (WebKit::LibWebRTCProvider::registerMDNSName):
140         (WebKit::LibWebRTCProvider::resolveMDNSName):
141         * WebProcess/Network/webrtc/LibWebRTCProvider.h:
142         * WebProcess/Network/webrtc/WebMDNSRegister.cpp: Added.
143         (WebKit::WebMDNSRegister::finishedRegisteringMDNSName):
144         (WebKit::WebMDNSRegister::finishedResolvingMDNSName):
145         (WebKit::WebMDNSRegister::unregisterMDNSNames):
146         (WebKit::WebMDNSRegister::registerMDNSName):
147         (WebKit::WebMDNSRegister::resolveMDNSName):
148         * WebProcess/Network/webrtc/WebMDNSRegister.h: Added.
149         * WebProcess/Network/webrtc/WebMDNSRegister.messages.in: Added.
150
151 2018-04-04  Alex Christensen  <achristensen@webkit.org>
152
153         Use CompletionHandlers for DelayedReplies
154         https://bugs.webkit.org/show_bug.cgi?id=182269
155
156         Reviewed by Youenn Fablet.
157
158         DelayedReplies should be a noncopyable, non-refcountable type.  They should be
159         called once and only once.  This is what CompletionHandlers are for.
160
161         No change in behavior.  Just cleaner code.
162
163         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
164         (WebKit::NetworkConnectionToWebProcess::performSynchronousLoad):
165         * NetworkProcess/NetworkConnectionToWebProcess.h:
166         * NetworkProcess/NetworkResourceLoader.cpp:
167         (WebKit::NetworkResourceLoader::SynchronousLoadData::SynchronousLoadData):
168         (WebKit::sendReplyToSynchronousRequest):
169         (WebKit::NetworkResourceLoader::NetworkResourceLoader):
170         * NetworkProcess/NetworkResourceLoader.h:
171         * Platform/IPC/Connection.h:
172         * Platform/IPC/HandleMessage.h:
173         (IPC::callMemberFunctionImpl):
174         (IPC::callMemberFunction):
175         (IPC::handleMessageDelayed):
176         * PluginProcess/PluginControllerProxy.cpp:
177         (WebKit::PluginControllerProxy::setInitializationReply):
178         (WebKit::PluginControllerProxy::takeInitializationReply):
179         * PluginProcess/PluginControllerProxy.h:
180         * PluginProcess/WebProcessConnection.cpp:
181         (WebKit::WebProcessConnection::destroyPlugin):
182         (WebKit::WebProcessConnection::createPlugin):
183         (WebKit::WebProcessConnection::createPluginAsynchronously):
184         * PluginProcess/WebProcessConnection.h:
185         * Scripts/webkit/messages.py:
186         (message_to_struct_declaration):
187         (generate_message_handler):
188         * UIProcess/Network/NetworkProcessProxy.cpp:
189         (WebKit::NetworkProcessProxy::getNetworkProcessConnection):
190         (WebKit::NetworkProcessProxy::networkProcessCrashed):
191         (WebKit::NetworkProcessProxy::networkProcessFailedToLaunch):
192         (WebKit::NetworkProcessProxy::didCreateNetworkConnectionToWebProcess):
193         * UIProcess/Network/NetworkProcessProxy.h:
194         * UIProcess/Plugins/PluginProcessManager.cpp:
195         (WebKit::PluginProcessManager::getPluginProcessConnection):
196         * UIProcess/Plugins/PluginProcessManager.h:
197         * UIProcess/Plugins/PluginProcessProxy.cpp:
198         (WebKit::PluginProcessProxy::getPluginProcessConnection):
199         (WebKit::PluginProcessProxy::pluginProcessCrashedOrFailedToLaunch):
200         (WebKit::PluginProcessProxy::didCreateWebProcessConnection):
201         * UIProcess/Plugins/PluginProcessProxy.h:
202         * UIProcess/Storage/StorageProcessProxy.cpp:
203         (WebKit::StorageProcessProxy::getStorageProcessConnection):
204         (WebKit::StorageProcessProxy::didClose):
205         (WebKit::StorageProcessProxy::didCreateStorageToWebProcessConnection):
206         * UIProcess/Storage/StorageProcessProxy.h:
207         * UIProcess/WebPageProxy.cpp:
208         (WebKit::ExceededDatabaseQuotaRecords::createRecord):
209         (WebKit::WebPageProxy::createNewPage):
210         (WebKit::WebPageProxy::runJavaScriptAlert):
211         (WebKit::WebPageProxy::runJavaScriptConfirm):
212         (WebKit::WebPageProxy::runJavaScriptPrompt):
213         (WebKit::WebPageProxy::webGLPolicyForURL):
214         (WebKit::WebPageProxy::resolveWebGLPolicyForURL):
215         (WebKit::WebPageProxy::getToolbarsAreVisible):
216         (WebKit::WebPageProxy::getMenuBarIsVisible):
217         (WebKit::WebPageProxy::getStatusBarIsVisible):
218         (WebKit::WebPageProxy::getWindowFrame):
219         (WebKit::WebPageProxy::screenToRootView):
220         (WebKit::WebPageProxy::rootViewToScreen):
221         (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel):
222         (WebKit::WebPageProxy::exceededDatabaseQuota):
223         (WebKit::WebPageProxy::reachedApplicationCacheOriginQuota):
224         * UIProcess/WebPageProxy.h:
225         * UIProcess/WebProcessPool.cpp:
226         (WebKit::WebProcessPool::networkProcessCrashed):
227         (WebKit::WebProcessPool::getNetworkProcessConnection):
228         (WebKit::WebProcessPool::getStorageProcessConnection):
229         * UIProcess/WebProcessPool.h:
230         * UIProcess/WebProcessProxy.cpp:
231         (WebKit::WebProcessProxy::getPluginProcessConnection):
232         (WebKit::WebProcessProxy::getNetworkProcessConnection):
233         (WebKit::WebProcessProxy::getStorageProcessConnection):
234         * UIProcess/WebProcessProxy.h:
235         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
236         (WebKit::WebSWContextManagerConnection::syncTerminateWorker):
237         * WebProcess/Storage/WebSWContextManagerConnection.h:
238         * WebProcess/WebPage/WebPage.h:
239         * WebProcess/WebPage/ios/WebPageIOS.mm:
240         (WebKit::WebPage::computePagesForPrintingAndDrawToPDF):
241
242 2018-04-04  Alex Christensen  <achristensen@webkit.org>
243
244         Remove legacyCustomProtocolManager from NetworkSessionCreationParameters
245         https://bugs.webkit.org/show_bug.cgi?id=182178
246
247         Reviewed by Youenn Fablet.
248
249         Now that we only make NetworkSessions in the NetworkProcess, we don't need to pass this parameter around.
250
251         * NetworkProcess/NetworkProcess.cpp:
252         (WebKit::NetworkProcess::initializeNetworkProcess):
253         * NetworkProcess/NetworkSessionCreationParameters.h:
254         (WebKit::NetworkSessionCreationParameters::decode):
255         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
256         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
257         * NetworkProcess/mac/RemoteNetworkingContext.mm:
258         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
259         * Shared/WebsiteDataStoreParameters.cpp:
260         (WebKit::WebsiteDataStoreParameters::privateSessionParameters):
261         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
262         (WebKit::WebsiteDataStore::parameters):
263
264 2018-04-04  Alex Christensen  <achristensen@webkit.org>
265
266         Move PingHandle to WebKitLegacy
267         https://bugs.webkit.org/show_bug.cgi?id=184145
268
269         Reviewed by Youenn Fablet.
270
271         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
272
273 2018-04-04  Brent Fulgham  <bfulgham@apple.com>
274
275         Failures from mach port reference handling should be fatal
276         https://bugs.webkit.org/show_bug.cgi?id=184202
277         <rdar://problem/37771114>
278
279         Reviewed by Anders Carlsson.
280
281         Update for new location of MachSendRight.h. Switch to
282         #pragma once in a few places.
283
284         * Platform/IPC/mac/ConnectionMac.mm:
285         (IPC::Connection::platformInvalidate): Adopt new 'safe mach_port_t deallocation' function.
286         (IPC::Connection::initializeSendSource): Ditto.
287         (IPC::Connection::receiveSourceEventHandler): Ditto.
288         * Platform/SharedMemory.h:
289         * Platform/cocoa/SharedMemoryCocoa.cpp:
290         (WebKit::SharedMemory::Handle::clear): Ditto.
291         (WebKit::makeMemoryEntry): Ditto.
292         (WebKit::SharedMemory::createSendRight const): Ditto.
293         * Platform/mac/LayerHostingContext.h:
294         * Platform/mac/LayerHostingContext.mm:
295         * PluginProcess/PluginControllerProxy.h:
296         * PluginProcess/PluginProcess.h:
297         (WebKit::PluginProcess::compositingRenderServerPort const):
298         * Scripts/messages.py:
299         (headers_for_type): Update for new location of MachSendRight.
300         * Shared/Plugins/PluginProcessCreationParameters.h:
301         * Shared/RemoteLayerTree/RemoteLayerBackingStore.h:
302         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
303         (WebKit::RemoteLayerBackingStore::encode const):
304         * Shared/WebCoreArgumentCoders.h:
305         * Shared/WebProcessCreationParameters.h:
306         * Shared/mac/WebCoreArgumentCodersMac.mm:
307         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
308         * UIProcess/DrawingAreaProxy.cpp:
309         * UIProcess/DrawingAreaProxy.h:
310         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
311         (WebKit::ProcessLauncher::launchProcess): Ditto. Remove uneeded mach_port_dealloc called after
312         xpc_dictionary_set_mach_send. While '..._set_mach_send' retains the send right, it gets automatically
313         released when the message is handled. We only want to manually deallocate the send right if
314         the message failed to send.
315         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
316         * UIProcess/WebPageProxy.cpp:
317         * UIProcess/WebPageProxy.h:
318         * UIProcess/WebPageProxy.messages.in:
319         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
320         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
321         * UIProcess/mac/WKViewLayoutStrategy.mm:
322         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
323         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
324         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
325         * WebProcess/Plugins/PluginController.h:
326         * WebProcess/Plugins/PluginView.h:
327         * WebProcess/WebPage/DrawingArea.h:
328         (WebKit::DrawingArea::addFence):
329         (WebKit::DrawingArea::updateGeometry):
330         * WebProcess/WebPage/DrawingArea.messages.in:
331         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
332         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
333         (WebKit::RemoteLayerTreeDrawingArea::updateGeometry):
334         * WebProcess/WebPage/WebPage.cpp:
335         (WebKit::WebPage::setTopContentInsetFenced):
336         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
337         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
338         (WebKit::TiledCoreAnimationDrawingArea::updateGeometry):
339         * WebProcess/WebProcess.h:
340         (WebKit::WebProcess::compositingRenderServerPort const):
341         * WebProcess/cocoa/VideoFullscreenManager.mm:
342         (WebKit::VideoFullscreenManager::setVideoLayerFrameFenced):
343
344 2018-04-04  Beth Dakin  <bdakin@apple.com>
345
346         Fix the print formatter build
347         https://bugs.webkit.org/show_bug.cgi?id=184289
348         -and corresponding-
349         rdar://problem/39164641
350
351         Reviewed by Dan Bernstein.
352
353         * UIProcess/API/Cocoa/WKWebView.mm:
354         (-[WKWebView _webViewPrintFormatter]):
355         * UIProcess/API/Cocoa/WKWebViewInternal.h:
356         * UIProcess/_WKWebViewPrintFormatter.h:
357         * UIProcess/_WKWebViewPrintFormatter.mm:
358         * UIProcess/_WKWebViewPrintFormatterInternal.h:
359         * UIProcess/ios/WKContentView.mm:
360         * UIProcess/ios/WKPDFView.mm:
361
362 2018-04-04  Andy Estes  <aestes@apple.com>
363
364         [iOS] Rename WKPDFView to WKLegacyPDFView
365         https://bugs.webkit.org/show_bug.cgi?id=184286
366
367         Rubber-stamped by Wenson Hsieh.
368
369         A series of upcoming patches will implement a new WKPDFView based on PDFKit.
370
371         * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
372         (-[WKWebViewContentProviderRegistry init]):
373         * UIProcess/ios/WKLegacyPDFView.h: Renamed from Source/WebKit/UIProcess/ios/WKPDFView.h.
374         * UIProcess/ios/WKLegacyPDFView.mm: Renamed from Source/WebKit/UIProcess/ios/WKPDFView.mm.
375         (-[WKLegacyPDFView _computeMatchesForString:options:maxCount:completionHandler:]):
376         * WebKit.xcodeproj/project.pbxproj:
377
378 2018-04-04  Yousuke Kimoto  <yousuke.kimoto@sony.com> and Fujii Hironori  <Hironori.Fujii@sony.com>
379
380         [WinCairo] Add WebKit Shared/win files for wincairo webkit
381         https://bugs.webkit.org/show_bug.cgi?id=183044
382
383         Reviewed by Alex Christensen.
384
385         * Shared/win/ChildProcessMainWin.cpp: Added.
386
387 2018-04-04  Wenson Hsieh  <wenson_hsieh@apple.com>
388
389         [Extra zoom mode] Remove effective font size constraints when determining focus zoom scale
390         https://bugs.webkit.org/show_bug.cgi?id=184287
391         <rdar://problem/39063886>
392
393         Reviewed by Timothy Hatcher.
394
395         As it turns out, form controls on some important websites can be very wide, with a small font size, which
396         renders the approach taken in <https://trac.webkit.org/r230171> moot, since we'll just end up zooming to a scale
397         that is too large anyways. To mitigate this for now, remove the minimum font scaling threshold while we think of
398         more clever ways to account for this scenario.
399
400         * UIProcess/API/Cocoa/WKWebView.mm:
401         (-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):
402
403 2018-04-04  Fujii Hironori  <Hironori.Fujii@sony.com>
404
405         [Win] WebFrameLoaderClient: 'getpid': identifier not found
406         https://bugs.webkit.org/show_bug.cgi?id=184291
407
408         Reviewed by Konstantin Tokarev.
409
410         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
411         (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad):
412         Use WTF::getCurrentProcessID() instead of getpid().
413         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Ditto.
414
415 2018-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
416
417         ASSERTION FAILED: !m_mainFrame->coreFrame()->loader().frameHasLoaded() || !m_pendingNavigationID when reloading page while a page is loading
418         https://bugs.webkit.org/show_bug.cgi?id=153210
419
420         Reviewed by Alex Christensen.
421
422         The assert happens when WebPage::reload() is called twice and the first time the reload is ignored by
423         FrameLoader because the document URL is empty. In that case the pending navigation is not reset, because
424         FrameLoader::reload() returns before creating the document loader.
425
426         * WebProcess/WebPage/WebPage.cpp:
427         (WebKit::WebPage::reload): Check if the pending navigation has been reset after calling FrameLoader::reload()
428         and reset it otherwise.
429
430 2018-04-03  Youenn Fablet  <youenn@apple.com>
431
432         Make NetworkProcess get ContentBlocker information from UIProcess
433         https://bugs.webkit.org/show_bug.cgi?id=184205
434         <rdar://problem/39146551>
435
436         Unreviewed.
437         Updated decode/encode methods to not hit null identifier assertion.
438
439         * Shared/WebPageCreationParameters.cpp:
440         (WebKit::WebPageCreationParameters::encode const):
441         (WebKit::WebPageCreationParameters::decode):
442         * Shared/WebPageGroupData.cpp:
443         (WebKit::WebPageGroupData::encode const):
444         (WebKit::WebPageGroupData::decode):
445
446 2018-04-03  Andy Estes  <aestes@apple.com>
447
448         [iOS] WKWebView shouldn't know about WKPDFView
449         https://bugs.webkit.org/show_bug.cgi?id=184283
450
451         Reviewed by Timothy Hatcher.
452
453         WKWebView shouldn't be checking if _customContentView is a particular kind of
454         class (e.g., WKPDFView). Instead, it should interact with the _customContentView
455         using the WKWebViewContentProvider protocol.
456
457         Reimplement -_isBackground, -_isDisplayingPDF, -_dataForDisplayedPDF, and
458         -_suggestedFilenameForDisplayedPDF using new WKWebViewContentProvider protocol
459         methods that WKPDFView implements.
460
461         * UIProcess/API/Cocoa/WKWebView.mm:
462         (-[WKWebView _isBackground]):
463         (-[WKWebView _isDisplayingPDF]):
464         (-[WKWebView _dataForDisplayedPDF]):
465         (-[WKWebView _suggestedFilenameForDisplayedPDF]):
466         * UIProcess/Cocoa/WKWebViewContentProvider.h:
467         * UIProcess/ios/WKPDFView.h:
468         * UIProcess/ios/WKPDFView.mm:
469         (-[WKPDFView web_dataRepresentation]):
470         (-[WKPDFView web_suggestedFilename]):
471         (-[WKPDFView web_isBackground]):
472         (-[WKPDFView suggestedFilename]): Deleted.
473         (-[WKPDFView pdfDocument]): Deleted.
474         (-[WKPDFView isBackground]): Deleted.
475
476 2018-04-03  Brent Fulgham  <bfulgham@apple.com>
477
478         Guard against keychain/certificate access outside the network process
479         https://bugs.webkit.org/show_bug.cgi?id=184214
480         <rdar://problem/38734795>
481
482         Reviewed by Youenn Fablet.
483
484         Use the ProcessPrivilege assertions to guard against accessing the Keychain from
485         a non-Networking process.
486
487         * Shared/cf/ArgumentCodersCF.cpp:
488         (IPC::encode): Assert if we access the keychain from a proces other than the Network or UI process.
489         (IPC::decode): Ditto.
490
491 2018-04-03  Youenn Fablet  <youenn@apple.com>
492
493         NetworkResourceLoader does not need to expose all redirect response headers
494         https://bugs.webkit.org/show_bug.cgi?id=184114
495         <rdar://problem/39010557>
496
497         Reviewed by Ryosuke Niwa.
498
499         WebProcess instructs NetworkProcess whether to sanitize response headers based on a runtime flag.
500         We sanitize redirection response headers in case this is not related to a navigation load.
501         Navigation loads may currently require the full response for content blockers.
502
503         * NetworkProcess/NetworkResourceLoadParameters.cpp:
504         (WebKit::NetworkResourceLoadParameters::encode const):
505         (WebKit::NetworkResourceLoadParameters::decode):
506         * NetworkProcess/NetworkResourceLoadParameters.h:
507         * NetworkProcess/NetworkResourceLoader.cpp:
508         (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
509         (WebKit::NetworkResourceLoader::sanitizeRedirectResponseIfPossible):
510         (WebKit::NetworkResourceLoader::dispatchWillSendRequestForCacheEntry):
511         * NetworkProcess/NetworkResourceLoader.h:
512         * Shared/WebPreferences.yaml:
513         * UIProcess/API/C/WKPreferences.cpp:
514         (WKPreferencesSetRestrictedHTTPResponseAccess):
515         (WKPreferencesGetRestrictedHTTPResponseAccess):
516         * UIProcess/API/C/WKPreferencesRef.h:
517         * WebProcess/Network/WebLoaderStrategy.cpp:
518         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
519         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
520         (WebKit::WebLoaderStrategy::startPingLoad):
521         (WebKit::WebLoaderStrategy::preconnectTo):
522
523 2018-04-03  Youenn Fablet  <youenn@apple.com>
524
525         Make NetworkProcess get ContentBlocker information from UIProcess
526         https://bugs.webkit.org/show_bug.cgi?id=184205
527
528         Reviewed by Alex Christensen.
529
530         Make NetworkProcess get content blockers from UIProcess directly.
531         Before that patch, WebProcess sent content blockers to NetworkProcess for each PingLoad.
532         Instead, WebProcess sends the content blocker identifier for each PingLoad and NetworkProcess fetches the content blocker once.
533
534         This is both more efficient than passing them for each PingLoad and safer in the sense
535         that a compromised WebProcess will not be able to bypass any of these.
536         In the future, NetworkProcess should get the content blocker identifier directly from the WebPageID attached to the request.
537
538         Covered by existing beacon+content blocker tests.
539
540         Did some refactoring to add a typed content blocker identifier.
541         Once NetworkProcess fetches a given content blocker, the content blocker will send any modification to NetworkProcess.
542         Introduced NetworkContentRuleListManager to handle the content blockers in NetworkProcess.
543
544         * CMakeLists.txt:
545         * DerivedSources.make:
546         * NetworkProcess/NetworkLoadChecker.cpp:
547         (WebKit::NetworkLoadChecker::checkRequest):
548         (WebKit::NetworkLoadChecker::continueCheckingRequest):
549         (WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad):
550         * NetworkProcess/NetworkLoadChecker.h:
551         (WebKit::NetworkLoadChecker::setContentExtensionController):
552         * NetworkProcess/NetworkProcess.cpp:
553         (WebKit::NetworkProcess::didReceiveMessage):
554         * NetworkProcess/NetworkProcess.h:
555         (WebKit::NetworkProcess::networkUserContentController):
556         * NetworkProcess/NetworkResourceLoadParameters.cpp:
557         (WebKit::NetworkResourceLoadParameters::encode const):
558         (WebKit::NetworkResourceLoadParameters::decode):
559         * NetworkProcess/NetworkResourceLoadParameters.h:
560         * NetworkProcess/NetworkContentRuleListManager.cpp: Added.
561         (WebKit::NetworkContentRuleListManager::contentExtensionsBackend):
562         (WebKit::NetworkContentRuleListManager::addContentRuleLists):
563         (WebKit::NetworkContentRuleListManager::removeContentRuleList):
564         (WebKit::NetworkContentRuleListManager::removeAllContentRuleLists):
565         (WebKit::NetworkContentRuleListManager::remove):
566         * NetworkProcess/NetworkContentRuleListManager.h: Added.
567         * NetworkProcess/NetworkContentRuleListManager.messages.in: Added.
568         * NetworkProcess/PingLoad.cpp:
569         * Scripts/webkit/messages.py:
570         * Shared/UserContentControllerIdentifier.h: Added.
571         * Shared/WebPageCreationParameters.cpp:
572         (WebKit::WebPageCreationParameters::decode):
573         * Shared/WebPageCreationParameters.h:
574         * Shared/WebPageGroupData.cpp:
575         (WebKit::WebPageGroupData::decode):
576         * Shared/WebPageGroupData.h:
577         * UIProcess/Network/NetworkProcessProxy.cpp:
578         (WebKit::NetworkProcessProxy::~NetworkProcessProxy):
579         (WebKit::NetworkProcessProxy::contentExtensionRules):
580         (WebKit::NetworkProcessProxy::didDestroyWebUserContentControllerProxy):
581         * UIProcess/Network/NetworkProcessProxy.h:
582         * UIProcess/Network/NetworkProcessProxy.messages.in:
583         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
584         (WebKit::WebUserContentControllerProxy::get):
585         (WebKit::WebUserContentControllerProxy::WebUserContentControllerProxy):
586         (WebKit::WebUserContentControllerProxy::~WebUserContentControllerProxy):
587         (WebKit::WebUserContentControllerProxy::addProcess):
588         (WebKit::WebUserContentControllerProxy::removeProcess):
589         (WebKit::WebUserContentControllerProxy::addUserContentWorldUse):
590         (WebKit::WebUserContentControllerProxy::removeUserContentWorldUses):
591         (WebKit::WebUserContentControllerProxy::addUserScript):
592         (WebKit::WebUserContentControllerProxy::removeUserScript):
593         (WebKit::WebUserContentControllerProxy::removeAllUserScripts):
594         (WebKit::WebUserContentControllerProxy::addUserStyleSheet):
595         (WebKit::WebUserContentControllerProxy::removeUserStyleSheet):
596         (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets):
597         (WebKit::WebUserContentControllerProxy::addUserScriptMessageHandler):
598         (WebKit::WebUserContentControllerProxy::removeUserMessageHandlerForName):
599         (WebKit::WebUserContentControllerProxy::removeAllUserMessageHandlers):
600         (WebKit::WebUserContentControllerProxy::addContentRuleList):
601         (WebKit::WebUserContentControllerProxy::removeContentRuleList):
602         (WebKit::WebUserContentControllerProxy::removeAllContentRuleLists):
603         * UIProcess/UserContent/WebUserContentControllerProxy.h:
604         (WebKit::WebUserContentControllerProxy::create):
605         (WebKit::WebUserContentControllerProxy::addNetworkProcess):
606         (WebKit::WebUserContentControllerProxy::removeNetworkProcess):
607         (WebKit::WebUserContentControllerProxy::contentExtensionRules):
608         (WebKit::WebUserContentControllerProxy::identifier const):
609         * WebKit.xcodeproj/project.pbxproj:
610         * WebProcess/Network/WebLoaderStrategy.cpp:
611         (WebKit::WebLoaderStrategy::startPingLoad):
612         * WebProcess/UserContent/WebUserContentController.cpp:
613         (WebKit::WebUserContentController::getOrCreate):
614         (WebKit::WebUserContentController::WebUserContentController):
615         (WebKit::WebUserContentController::~WebUserContentController):
616         * WebProcess/UserContent/WebUserContentController.h:
617         * WebProcess/WebPage/WebPage.h:
618         (WebKit::WebPage::userContentControllerIdentifier const):
619
620 2018-04-03  Andy Estes  <aestes@apple.com>
621
622         [Mac] Prioritize file promises over filenames during drag and drop
623         https://bugs.webkit.org/show_bug.cgi?id=184237
624         <rdar://problem/38278076>
625
626         Reviewed by Wenson Hsieh.
627
628         * UIProcess/Cocoa/WebViewImpl.mm:
629         (WebKit::WebViewImpl::performDragOperation):
630
631 2018-04-03  Brady Eidson  <beidson@apple.com>
632
633         Make SessionStorage work with process swapping.
634         https://bugs.webkit.org/show_bug.cgi?id=184270
635
636         Reviewed by Andy Estes.
637
638         Due to a minor process accounting error, WebPageProxys weren't always being reconnected with their
639         WebsiteDataStore's StorageManager when doing process swaps.
640
641         Fix that error, and SessionStorage "just works."
642
643         * UIProcess/WebPageProxy.cpp:
644         (WebKit::WebPageProxy::webProcessWillShutDown):
645         (WebKit::WebPageProxy::processDidTerminate): For NavigationSwap termination, make sure to tell the 
646           process lifetime tracker that this page was removed.
647
648         * UIProcess/WebProcessLifetimeObserver.h:
649         (WebKit::WebProcessLifetimeObserver::webPageWasInvalidated): Renamed from "webPageWasRemoved"
650         (WebKit::WebProcessLifetimeObserver::webPageWasRemoved): Deleted.
651
652         * UIProcess/WebProcessLifetimeTracker.cpp:
653         (WebKit::WebProcessLifetimeTracker::webPageLeavingWebProcess): Renamed from "webProcessWillShutDown"
654         (WebKit::WebProcessLifetimeTracker::pageWasInvalidated):
655         (WebKit::WebProcessLifetimeTracker::webProcessWillShutDown): Deleted.
656         * UIProcess/WebProcessLifetimeTracker.h:
657
658         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
659         (WebKit::WebsiteDataStore::webPageWasInvalidated):
660         (WebKit::WebsiteDataStore::webPageWasRemoved): Deleted.
661         * UIProcess/WebsiteData/WebsiteDataStore.h:
662
663 2018-04-03  Commit Queue  <commit-queue@webkit.org>
664
665         Unreviewed, rolling out r230210.
666         https://bugs.webkit.org/show_bug.cgi?id=184277
667
668         it is breaking internal bots (Requested by youenn on #webkit).
669
670         Reverted changeset:
671
672         "Make NetworkProcess get ContentBlocker information from
673         UIProcess"
674         https://bugs.webkit.org/show_bug.cgi?id=184205
675         https://trac.webkit.org/changeset/230210
676
677 2018-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>
678
679         [Extra zoom mode] Update time picker to use platform view controller
680         https://bugs.webkit.org/show_bug.cgi?id=184252
681         <rdar://problem/38804795>
682
683         Reviewed by Andy Estes.
684
685         Adjust for some small WKTimePickerViewController changes, and remove some files that we no longer need.
686
687         * UIProcess/ios/WKContentViewInteraction.mm:
688         (-[WKContentView presentViewControllerForCurrentAssistedNode]):
689         (-[WKContentView textInputController:didCommitText:]): Deleted.
690         (-[WKContentView textInputController:didCommitText:withSuggestion:]): Deleted.
691         (-[WKContentView textInputControllerDidRequestDismissal:]): Deleted.
692         * UIProcess/ios/forms/WKTextFormControlViewController.h: Removed.
693         * UIProcess/ios/forms/WKTextFormControlViewController.mm: Removed.
694         * UIProcess/ios/forms/WKTextSuggestionButton.h: Removed.
695         * UIProcess/ios/forms/WKTextSuggestionButton.mm: Removed.
696         * WebKit.xcodeproj/project.pbxproj:
697
698 2018-04-03  Ross Kirsling  <ross.kirsling@sony.com>
699
700         Xcode prepends line comments from WTF/Compiler.h to *.sb files
701         https://bugs.webkit.org/show_bug.cgi?id=184166
702
703         Reviewed by Brent Fulgham.
704
705         * DerivedSources.make:
706         Strip ;-comments from *.sb.in files before preprocessing so we can stop treating Platform.h/Compiler.h as C89.
707
708 2018-04-03  Chris Dumez  <cdumez@apple.com>
709
710         Drop MainFrame class
711         https://bugs.webkit.org/show_bug.cgi?id=184191
712
713         Reviewed by Darin Adler.
714
715         Drop MainFrame class and move contents into Page / Frame since there is a 1:1
716         relationship between the Page and the MainFrame.
717
718         This is ground work for introducing LocalFrame / RemoteFrame concepts.
719
720         * Shared/WebRenderLayer.cpp:
721         * Shared/WebRenderObject.cpp:
722         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
723         (WebKit::WebPaymentCoordinator::paymentCoordinator):
724         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
725         * WebProcess/FullScreen/WebFullScreenManager.cpp:
726         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
727         (WKBundlePageInstallPageOverlay):
728         (WKBundlePageUninstallPageOverlay):
729         (WKBundlePageInstallPageOverlayWithAnimation):
730         (WKBundlePageUninstallPageOverlayWithAnimation):
731         * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
732         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
733         * WebProcess/InjectedBundle/InjectedBundle.cpp:
734         * WebProcess/Plugins/PDF/PDFPlugin.mm:
735         * WebProcess/Plugins/PluginView.cpp:
736         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
737         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
738         * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
739         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
740         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
741         (WebKit::WebInspectorClient::~WebInspectorClient):
742         (WebKit::WebInspectorClient::highlight):
743         (WebKit::WebInspectorClient::hideHighlight):
744         (WebKit::WebInspectorClient::showPaintRect):
745         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
746         * WebProcess/WebCoreSupport/WebProgressTrackerClient.cpp:
747         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
748         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
749         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
750         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
751         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
752         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
753         * WebProcess/WebPage/FindController.cpp:
754         (WebKit::FindController::updateFindUIAfterPageScroll):
755         (WebKit::FindController::hideFindUI):
756         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
757         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
758         (WebKit::RemoteLayerTreeDrawingArea::updatePreferences):
759         * WebProcess/WebPage/WKAccessibilityWebPageObjectIOS.mm:
760         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
761         * WebProcess/WebPage/WebFrame.cpp:
762         * WebProcess/WebPage/WebInspector.cpp:
763         * WebProcess/WebPage/WebInspectorFrontendAPIDispatcher.cpp:
764         * WebProcess/WebPage/WebPage.cpp:
765         (WebKit::WebPage::mainFrame const):
766         (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
767         (WebKit::WebPage::plugInIntersectsSearchRect):
768         * WebProcess/WebPage/WebPage.h:
769         * WebProcess/WebPage/atk/WebPageAccessibilityObjectAtk.cpp:
770         * WebProcess/WebPage/ios/FindControllerIOS.mm:
771         * WebProcess/WebPage/ios/WebPageIOS.mm:
772         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
773         (WebKit::TiledCoreAnimationDrawingArea::updatePreferences):
774         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
775         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
776         (-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]):
777         (-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
778         * WebProcess/WebPage/mac/WebPageMac.mm:
779         (WebKit::WebPage::performImmediateActionHitTestAtLocation):
780         (WebKit::WebPage::dataDetectorsDidPresentUI):
781         (WebKit::WebPage::dataDetectorsDidChangeUI):
782         (WebKit::WebPage::dataDetectorsDidHideUI):
783         * WebProcess/WebProcess.cpp:
784         * WebProcess/WebStorage/StorageAreaMap.cpp:
785
786 2018-04-03  Youenn Fablet  <youenn@apple.com>
787
788         Make NetworkProcess get ContentBlocker information from UIProcess
789         https://bugs.webkit.org/show_bug.cgi?id=184205
790
791         Reviewed by Alex Christensen.
792
793         Make NetworkProcess get content blockers from UIProcess directly.
794         Before that patch, WebProcess sent content blockers to NetworkProcess for each PingLoad.
795         Instead, WebProcess sends the content blocker identifier for each PingLoad and NetworkProcess fetches the content blocker once.
796
797         This is both more efficient than passing them for each PingLoad and safer in the sense
798         that a compromised WebProcess will not be able to bypass any of these.
799         In the future, NetworkProcess should get the content blocker identifier directly from the WebPageID attached to the request.
800
801         Covered by existing beacon+content blocker tests.
802
803         Did some refactoring to add a typed content blocker identifier.
804         Once NetworkProcess fetches a given content blocker, the content blocker will send any modification to NetworkProcess.
805         Introduced NetworkContentRuleListManager to handle the content blockers in NetworkProcess.
806
807         * CMakeLists.txt:
808         * DerivedSources.make:
809         * NetworkProcess/NetworkLoadChecker.cpp:
810         (WebKit::NetworkLoadChecker::checkRequest):
811         (WebKit::NetworkLoadChecker::continueCheckingRequest):
812         (WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad):
813         * NetworkProcess/NetworkLoadChecker.h:
814         (WebKit::NetworkLoadChecker::setContentExtensionController):
815         * NetworkProcess/NetworkProcess.cpp:
816         (WebKit::NetworkProcess::didReceiveMessage):
817         * NetworkProcess/NetworkProcess.h:
818         (WebKit::NetworkProcess::networkUserContentController):
819         * NetworkProcess/NetworkResourceLoadParameters.cpp:
820         (WebKit::NetworkResourceLoadParameters::encode const):
821         (WebKit::NetworkResourceLoadParameters::decode):
822         * NetworkProcess/NetworkResourceLoadParameters.h:
823         * NetworkProcess/NetworkContentRuleListManager.cpp: Added.
824         (WebKit::NetworkContentRuleListManager::contentExtensionsBackend):
825         (WebKit::NetworkContentRuleListManager::addContentRuleLists):
826         (WebKit::NetworkContentRuleListManager::removeContentRuleList):
827         (WebKit::NetworkContentRuleListManager::removeAllContentRuleLists):
828         (WebKit::NetworkContentRuleListManager::remove):
829         * NetworkProcess/NetworkContentRuleListManager.h: Added.
830         * NetworkProcess/NetworkContentRuleListManager.messages.in: Added.
831         * NetworkProcess/PingLoad.cpp:
832         * Scripts/webkit/messages.py:
833         * Shared/UserContentControllerIdentifier.h: Added.
834         * Shared/WebPageCreationParameters.cpp:
835         (WebKit::WebPageCreationParameters::decode):
836         * Shared/WebPageCreationParameters.h:
837         * Shared/WebPageGroupData.cpp:
838         (WebKit::WebPageGroupData::decode):
839         * Shared/WebPageGroupData.h:
840         * UIProcess/Network/NetworkProcessProxy.cpp:
841         (WebKit::NetworkProcessProxy::~NetworkProcessProxy):
842         (WebKit::NetworkProcessProxy::contentExtensionRules):
843         (WebKit::NetworkProcessProxy::didDestroyWebUserContentControllerProxy):
844         * UIProcess/Network/NetworkProcessProxy.h:
845         * UIProcess/Network/NetworkProcessProxy.messages.in:
846         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
847         (WebKit::WebUserContentControllerProxy::get):
848         (WebKit::WebUserContentControllerProxy::WebUserContentControllerProxy):
849         (WebKit::WebUserContentControllerProxy::~WebUserContentControllerProxy):
850         (WebKit::WebUserContentControllerProxy::addProcess):
851         (WebKit::WebUserContentControllerProxy::removeProcess):
852         (WebKit::WebUserContentControllerProxy::addUserContentWorldUse):
853         (WebKit::WebUserContentControllerProxy::removeUserContentWorldUses):
854         (WebKit::WebUserContentControllerProxy::addUserScript):
855         (WebKit::WebUserContentControllerProxy::removeUserScript):
856         (WebKit::WebUserContentControllerProxy::removeAllUserScripts):
857         (WebKit::WebUserContentControllerProxy::addUserStyleSheet):
858         (WebKit::WebUserContentControllerProxy::removeUserStyleSheet):
859         (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets):
860         (WebKit::WebUserContentControllerProxy::addUserScriptMessageHandler):
861         (WebKit::WebUserContentControllerProxy::removeUserMessageHandlerForName):
862         (WebKit::WebUserContentControllerProxy::removeAllUserMessageHandlers):
863         (WebKit::WebUserContentControllerProxy::addContentRuleList):
864         (WebKit::WebUserContentControllerProxy::removeContentRuleList):
865         (WebKit::WebUserContentControllerProxy::removeAllContentRuleLists):
866         * UIProcess/UserContent/WebUserContentControllerProxy.h:
867         (WebKit::WebUserContentControllerProxy::create):
868         (WebKit::WebUserContentControllerProxy::addNetworkProcess):
869         (WebKit::WebUserContentControllerProxy::removeNetworkProcess):
870         (WebKit::WebUserContentControllerProxy::contentExtensionRules):
871         (WebKit::WebUserContentControllerProxy::identifier const):
872         * WebKit.xcodeproj/project.pbxproj:
873         * WebProcess/Network/WebLoaderStrategy.cpp:
874         (WebKit::WebLoaderStrategy::startPingLoad):
875         * WebProcess/UserContent/WebUserContentController.cpp:
876         (WebKit::WebUserContentController::getOrCreate):
877         (WebKit::WebUserContentController::WebUserContentController):
878         (WebKit::WebUserContentController::~WebUserContentController):
879         * WebProcess/UserContent/WebUserContentController.h:
880         * WebProcess/WebPage/WebPage.h:
881         (WebKit::WebPage::userContentControllerIdentifier const):
882
883 2018-04-02  Beth Dakin  <bdakin@apple.com>
884
885         Fix the managed configurations build
886         https://bugs.webkit.org/show_bug.cgi?id=184253
887         -and corresponding-
888         rdar://problem/39078586
889
890         Reviewed by Dan Bernstein.
891
892         * UIProcess/ios/WKContentViewInteraction.mm:
893         (-[WKContentView canPerformActionForWebView:withSender:]):
894         (-[WKContentView _defineForWebView:]):
895
896 2018-04-02  Carlos Garcia Campos  <cgarcia@igalia.com>
897
898         [Enchant] Clean up TextCheckerEnchant
899         https://bugs.webkit.org/show_bug.cgi?id=184233
900
901         Reviewed by Michael Catanzaro.
902
903         Use TextCheckerEnchant as a singleton now, instead of implementing the singleton here.
904
905         * UIProcess/gtk/TextCheckerGtk.cpp:
906         (WebKit::TextChecker::checkSpellingOfString):
907         (WebKit::TextChecker::getGuessesForWord):
908         (WebKit::TextChecker::learnWord):
909         (WebKit::TextChecker::ignoreWord):
910         (WebKit::TextChecker::setSpellCheckingLanguages):
911         (WebKit::TextChecker::loadedSpellCheckingLanguages):
912         (WebKit::enchantTextChecker): Deleted.
913
914 2018-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
915
916         [GTK] NetworkProcess from WebKitGtk+ 2.19.9x SIGSEVs in NetworkStorageSession (secret search callback)
917         https://bugs.webkit.org/show_bug.cgi?id=183346
918
919         Reviewed by Michael Catanzaro.
920
921         Pass the request cancellable to NetworkStorageSession::getCredentialFromPersistentStorage().
922
923         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
924         (WebKit::NetworkDataTaskSoup::authenticate):
925
926 2018-04-02  Brady Eidson  <beidson@apple.com>
927
928         Process swapping on navigation needs to handle server redirects.
929         <rdar://problem/38690465> and https://bugs.webkit.org/show_bug.cgi?id=184142
930
931         Reviewed by Alex Christensen.
932
933         The same rules we apply to process swapping for basic navigations need to apply
934         to server redirects as well.
935
936         There's three interesting cases we need to support that are covered by new API tests:
937         1 - The initial load in a WKWebView redirects cross-origin.
938         2 - A WKWebView is showing content from a.com, we start a load to b.com, and that redirects to c.com
939         3 - A WKWebView is showing content from a.com, we start a load to a.com, that that redirects to b.com.
940
941         Supporting all 3 of these brought their own little challenges.
942
943         By teaching Navigation objects more about redirects I was able to support all 3 cases.
944
945         * UIProcess/API/APINavigation.cpp:
946         (API::Navigation::Navigation):
947         (API::Navigation::setCurrentRequest):
948         (API::Navigation::appendRedirectionURL):
949         (API::Navigation::loggingString const):
950         (API::Navigation::loggingURL const): Deleted.
951         * UIProcess/API/APINavigation.h:
952         (API::Navigation::originalRequest const):
953         (API::Navigation::currentRequest const):
954         (API::Navigation::currentRequestProcessIdentifier const):
955         (API::Navigation::setCurrentRequestIsRedirect):
956         (API::Navigation::currentRequestIsRedirect const):
957         (API::Navigation::request const): Deleted.
958
959         * UIProcess/API/Cocoa/WKNavigation.mm:
960         (-[WKNavigation _request]):
961
962         * UIProcess/WebPageProxy.cpp:
963         (WebKit::WebPageProxy::receivedPolicyDecision):
964         (WebKit::WebPageProxy::continueNavigationInNewProcess): If this continued navigation is currently in a server
965           redirect, save off a lambda to synthesize a "did receive server redirect" callback once the new WebProcess is running.
966         (WebKit::WebPageProxy::didCreateMainFrame):
967         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame): Possibly ignore this notification if it is really a
968           cross-origin redirect that is just starting back up in a new WebProcess.
969         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
970         (WebKit::WebPageProxy::didCommitLoadForFrame):
971         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
972         (WebKit::WebPageProxy::resetStateAfterProcessExited): Do not clear pageLoadState if the process is exitting for
973           a navigation swap, as we will need to pick up where we left off when the load continues in a new WebProcess.
974         * UIProcess/WebPageProxy.h:
975         * UIProcess/WebPageProxy.messages.in:
976
977         * UIProcess/WebProcessPool.cpp:
978         (WebKit::WebProcessPool::processForNavigation): If a process has never committed any provisional load, it can always
979           be used to continue a navigation.
980         * UIProcess/WebProcessPool.h:
981
982         * UIProcess/WebProcessProxy.h:
983         (WebKit::WebProcessProxy::didCommitProvisionalLoad):
984         (WebKit::WebProcessProxy::hasCommittedAnyProvisionalLoads const):
985
986         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
987         (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad):
988         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
989
990 2018-04-02  Eric Carlson  <eric.carlson@apple.com>
991
992         [Extra zoom mode] Replace video with a placeholder image during fullscreen transition
993         https://bugs.webkit.org/show_bug.cgi?id=184188
994         <rdar://problem/38940307>
995
996         Reviewed by Youenn Fablet.
997
998         * UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
999         * UIProcess/Cocoa/VideoFullscreenManagerProxy.messages.in:
1000         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
1001         (WebKit::VideoFullscreenModelContext::willExitFullscreen):
1002         (WebKit::VideoFullscreenManagerProxy::preparedToExitFullscreen):
1003         (WebKit::VideoFullscreenManagerProxy::willExitFullscreen):
1004         * WebProcess/cocoa/VideoFullscreenManager.h:
1005         * WebProcess/cocoa/VideoFullscreenManager.messages.in:
1006         * WebProcess/cocoa/VideoFullscreenManager.mm:
1007         (WebKit::VideoFullscreenManager::willExitFullscreen):
1008
1009 2018-04-02  Brian Burg  <bburg@apple.com>
1010
1011         [Cocoa] Fix some internal builds that consume WebDriver atoms
1012         https://bugs.webkit.org/show_bug.cgi?id=184197
1013
1014         Reviewed by Dan Bernstein.
1015
1016         * WebKit.xcodeproj/project.pbxproj:
1017         Use a Run Script phase to copy WebDriver atoms to WebKit.framework
1018         private headers during the installhdrs phase.
1019
1020 2018-04-02  Ryan Haddad  <ryanhaddad@apple.com>
1021
1022         Unreviewed, rolling out r230174.
1023
1024         Caused LayoutTests to exit early with assertion failures.
1025
1026         Reverted changeset:
1027
1028         "Process swapping on navigation needs to handle server
1029         redirects."
1030         https://bugs.webkit.org/show_bug.cgi?id=184142
1031         https://trac.webkit.org/changeset/230174
1032
1033 2018-04-02  Wenson Hsieh  <wenson_hsieh@apple.com>
1034
1035         [Extra zoom mode] Update date picker UI to latest specifications
1036         https://bugs.webkit.org/show_bug.cgi?id=184234
1037         <rdar://problem/38804760>
1038
1039         Reviewed by Timothy Hatcher.
1040
1041         Rename WKTextFormControlListViewControllerDelegate to WKTextInputListViewControllerDelegate and adjust for the
1042         new initializer of WKDatePickerViewController.
1043
1044         * UIProcess/ios/WKContentViewInteraction.mm:
1045         (-[WKContentView presentViewControllerForCurrentAssistedNode]):
1046
1047 2018-04-02  Brady Eidson  <beidson@apple.com>
1048
1049         Process swapping on navigation needs to handle server redirects.
1050         <rdar://problem/38690465> and https://bugs.webkit.org/show_bug.cgi?id=184142
1051
1052         Reviewed by Alex Christensen.
1053
1054         The same rules we apply to process swapping for basic navigations need to apply
1055         to server redirects as well.
1056
1057         There's three interesting cases we need to support that are covered by new API tests:
1058         1 - The initial load in a WKWebView redirects cross-origin.
1059         2 - A WKWebView is showing content from a.com, we start a load to b.com, and that redirects to c.com
1060         3 - A WKWebView is showing content from a.com, we start a load to a.com, that that redirects to b.com.
1061
1062         Supporting all 3 of these brought their own little challenges.
1063
1064         By teaching Navigation objects more about redirects I was able to support all 3 cases.
1065
1066         * UIProcess/API/APINavigation.cpp:
1067         (API::Navigation::Navigation):
1068         (API::Navigation::setCurrentRequest):
1069         (API::Navigation::appendRedirectionURL):
1070         (API::Navigation::loggingString const):
1071         (API::Navigation::loggingURL const): Deleted.
1072         * UIProcess/API/APINavigation.h:
1073         (API::Navigation::originalRequest const):
1074         (API::Navigation::currentRequest const):
1075         (API::Navigation::currentRequestProcessIdentifier const):
1076         (API::Navigation::setCurrentRequestIsRedirect):
1077         (API::Navigation::currentRequestIsRedirect const):
1078         (API::Navigation::request const): Deleted.
1079
1080         * UIProcess/API/Cocoa/WKNavigation.mm:
1081         (-[WKNavigation _request]):
1082
1083         * UIProcess/WebPageProxy.cpp:
1084         (WebKit::WebPageProxy::receivedPolicyDecision):
1085         (WebKit::WebPageProxy::continueNavigationInNewProcess): If this continued navigation is currently in a server
1086           redirect, save off a lambda to synthesize a "did receive server redirect" callback once the new WebProcess is running.
1087         (WebKit::WebPageProxy::didCreateMainFrame):
1088         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame): Possibly ignore this notification if it is really a
1089           cross-origin redirect that is just starting back up in a new WebProcess.
1090         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
1091         (WebKit::WebPageProxy::didCommitLoadForFrame):
1092         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1093         (WebKit::WebPageProxy::resetStateAfterProcessExited): Do not clear pageLoadState if the process is exitting for
1094           a navigation swap, as we will need to pick up where we left off when the load continues in a new WebProcess.
1095         * UIProcess/WebPageProxy.h:
1096         * UIProcess/WebPageProxy.messages.in:
1097
1098         * UIProcess/WebProcessPool.cpp:
1099         (WebKit::WebProcessPool::processForNavigation): If a process has never committed any provisional load, it can always
1100           be used to continue a navigation.
1101         * UIProcess/WebProcessPool.h:
1102
1103         * UIProcess/WebProcessProxy.h:
1104         (WebKit::WebProcessProxy::didCommitProvisionalLoad):
1105         (WebKit::WebProcessProxy::hasCommittedAnyProvisionalLoads const):
1106
1107         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1108         (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad):
1109         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1110
1111 2018-04-02  Wenson Hsieh  <wenson_hsieh@apple.com>
1112
1113         [Extra zoom mode] Zoom level is sometimes excessive when zooming to focused form controls
1114         https://bugs.webkit.org/show_bug.cgi?id=184222
1115         <rdar://problem/39063886>
1116
1117         Reviewed by Timothy Hatcher.
1118
1119         Upon interactively focusing an element, we zoom and scroll to reveal that element. The heuristics introduced in
1120         <https://trac.webkit.org/r168744> work by computing a target scale, and then a point to zoom to given that
1121         scale. Currently, this scale is dependent on the computed font size of the form control, such that the form
1122         control would be scaled to have an effective font size of 16.
1123
1124         However, in extra zoom mode, applying these same heuristics (ironically) results in excessive zoom levels, since
1125         scaling the font up to 16 would cause most form controls to zoom so far in that we lose context of surrounding
1126         elements such as labels and other form controls; the fact that the element is highlighted by the focused form
1127         control overlay makes this even more confusing, since part of the focus overlay highlight rect often ends up
1128         outside the viewport.
1129
1130         To fix this, we make a couple of tweaks to focus rect zooming in extra zoom mode. (1) Instead of computing
1131         target zoom level based on font size, try to zoom such that the focused element rect fills up most of the
1132         viewport (similar to double-tap zooming). This ensures that the focused form control overlay's highlight rect
1133         makes sense in most cases, with few exceptions (e.g. the element frame is larger than the viewport). (2)
1134         Introduce a minimum legible font size of 11, and compute the minimium scale needed such that the form control
1135         font would appear to be at least this legible font size. Then, clamp the target scale chosen by (1) to this
1136         minimum scale.
1137
1138         One additional consideration for (1) is that naively scaling to fit the element rect to the viewport (with some
1139         fixed margins) would cause the viewport scale to always change when moving focus between form controls of
1140         different dimensions, even if the current scale is more or less appropriate for all the focusable elements. To
1141         address this, instead of computing a single target zoom scale for an element rect, compute a range of possible
1142         target zoom scales (where the minimum and maximum values depend on the margin we add around the element rect).
1143         If the current scale already falls within this target scale range, then we won't bother adjusting the scale at
1144         all (unless the font size is too small — see (2)). If the current scale falls outside the target scale range, we
1145         then make the minimal adjustment needed to ensure that the element rect fits well within the viewport without
1146         being too small.
1147
1148         * UIProcess/API/Cocoa/WKWebView.mm:
1149         (-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):
1150
1151         Move some logic around so that the target scale is computed after computing the visible size. Also renames some
1152         constants local to this function (WKWebViewStandardFontSize, kMinimumHeightToShowContentAboveKeyboard,
1153         UIWebFormAnimationDuration, CaretOffsetFromWindowEdge) such that they now share a consistent naming style.
1154
1155 2018-04-02  Jer Noble  <jer.noble@apple.com>
1156
1157         Enable Legacy EME for all WebKit & WebKitLegacy clients
1158         https://bugs.webkit.org/show_bug.cgi?id=184018
1159         <rdar://problem/34887387>
1160
1161         Reviewed by Eric Carlson.
1162
1163         * Shared/WebPreferences.yaml:
1164         * Shared/WebPreferencesDefaultValues.h:
1165
1166 2018-04-02  Jer Noble  <jer.noble@apple.com>
1167
1168         REGRESSION (229680): Fullscreen video does not work (youtube, netflix)
1169         https://bugs.webkit.org/show_bug.cgi?id=184235
1170
1171         Reviewed by Eric Carlson.
1172
1173         Enable the Fullscreen API by default.
1174
1175         * Shared/WebPreferences.yaml:
1176         * Shared/WebPreferencesDefaultValues.h:
1177
1178 2018-04-02  Fujii Hironori  <Hironori.Fujii@sony.com>
1179
1180         [Win] MSVC can't compile WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent
1181         https://bugs.webkit.org/show_bug.cgi?id=184120
1182
1183         Reviewed by Alex Christensen.
1184
1185         It seems that MSVC can't compile the code using `this` in a
1186         generalized lambda capture in another lambda.
1187
1188         In this case, there is no need to copy `protectedThis` for the
1189         inner lambda. Move `protectedThis` of the outer lambda to the
1190         inner as well as `callback`.
1191
1192         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1193         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
1194         Moved `protectedThis` from the outer lambda to the inner.
1195
1196 2018-04-02  Dan Bernstein  <mitz@apple.com>
1197
1198         Build fix after r230121
1199
1200         * Configurations/WebKit.xcconfig: Disabled framework header postprocessing when building for
1201           iOS 11.*
1202         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: Reverted r230159.
1203
1204 2018-04-02  Dan Bernstein  <mitz@apple.com>
1205
1206         Fixed the build when BOOL is not bool.
1207         <rdar://problem/39094484>
1208
1209         Reviewed by Jer Noble.
1210
1211         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
1212         (-[WKFullScreenViewController videoControlsManagerDidChange]): Removed the write-only ivar
1213           _hasControlsManager, the assignment to which was causing the compiler error.
1214
1215 2018-04-02  Ryan Haddad  <ryanhaddad@apple.com>
1216
1217         Unreviewed build fix.
1218
1219         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: Update availability annotation.
1220
1221 2018-04-02  Michael Catanzaro  <mcatanzaro@igalia.com>
1222
1223         [GTK] DragAndDropHandler.cpp should include GUniquePtrGtk.h
1224         https://bugs.webkit.org/show_bug.cgi?id=184119
1225
1226         Reviewed by Daniel Bates.
1227
1228         * UIProcess/gtk/DragAndDropHandler.cpp:
1229
1230 2018-04-02  Frederic Wang  <fwang@igalia.com>
1231
1232         Fix warnings for unused lambda captures in Source/WebKit
1233         https://bugs.webkit.org/show_bug.cgi?id=173555
1234
1235         Reviewed by Konstantin Tokarev.
1236
1237         When release logs are disabled, several lambda captures are unused, causing compilation
1238         failures with -Wunused-lambda-capture. This patch marks the corresponding variables as unused
1239         in order to fix these warnings.
1240
1241         Based on initial patch by: Konstantin Tokarev  <annulen@yandex.ru>
1242
1243         * NetworkProcess/NetworkResourceLoader.cpp:
1244         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
1245         * UIProcess/Network/NetworkProcessProxy.cpp:
1246         (WebKit::NetworkProcessProxy::fetchWebsiteData):
1247         (WebKit::NetworkProcessProxy::deleteWebsiteData):
1248         (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
1249         * UIProcess/WebProcessProxy.cpp:
1250         (WebKit::WebProcessProxy::fetchWebsiteData):
1251         (WebKit::WebProcessProxy::deleteWebsiteData):
1252         (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins):
1253         * UIProcess/ios/WKContentViewInteraction.mm:
1254         (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
1255
1256 2018-04-02  Alejandro G. Castro  <alex@igalia.com>
1257
1258         [GTK] Make libwebrtc backend buildable for GTK  port
1259         https://bugs.webkit.org/show_bug.cgi?id=178860
1260
1261         Reviewed by Youenn Fablet.
1262
1263         * CMakeLists.txt: Add RTC network classes to the compilation and
1264         the libwebrtc includes.
1265         * PlatformGTK.cmake: Add the libwebrtc directory.
1266         * SourcesGTK.txt: Add RTC files to the compilation.
1267
1268 2018-03-30  Chris Dumez  <cdumez@apple.com>
1269
1270         REGRESSION (r229828): Facebook login popup is blank
1271         https://bugs.webkit.org/show_bug.cgi?id=184206
1272         <rdar://problem/39057006>
1273
1274         Reviewed by Wenson Hsieh.
1275
1276         Add assertion to make sure we never try to do a policy check to
1277         a resource response while a policy check for a navigation is
1278         pending. This assertion was being hit by several of our redirection
1279         tests without my fix.
1280
1281         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1282         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
1283
1284 2018-03-30  Ryan Haddad  <ryanhaddad@apple.com>
1285
1286         Unreviewed, rolling out r230125.
1287
1288         Build fix broke more builds.
1289
1290         Reverted changeset:
1291
1292         "Unreviewed build fix, remove unused lambda capture."
1293         https://trac.webkit.org/changeset/230125
1294
1295 2018-03-30  Ryan Haddad  <ryanhaddad@apple.com>
1296
1297         Unreviewed build fix, remove unused lambda capture.
1298
1299         * NetworkProcess/NetworkResourceLoader.cpp:
1300         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
1301
1302 2018-03-30  Wenson Hsieh  <wenson_hsieh@apple.com>
1303
1304         [Extra zoom mode] Adopt list view controller UI for numeric input types
1305         https://bugs.webkit.org/show_bug.cgi?id=184184
1306         <rdar://problem/37238916>
1307
1308         Reviewed by Timothy Hatcher.
1309
1310         Remove existing logic for presenting a number pad view controller, since number pads will now be handled as a
1311         special case of general text form controls in extra zoom mode.
1312
1313         * UIProcess/ios/WKContentViewInteraction.h:
1314         * UIProcess/ios/WKContentViewInteraction.mm:
1315         (-[WKContentView presentViewControllerForCurrentAssistedNode]):
1316         (-[WKContentView dismissAllInputViewControllers]):
1317         (-[WKContentView _wheelChangedWithEvent:]):
1318
1319 2018-03-30  Dan Bernstein  <mitz@apple.com>
1320
1321         Update availability annotations to match the macOS 10.13.4 and iOS 11.3 GM SDKs
1322         https://bugs.webkit.org/show_bug.cgi?id=184173
1323
1324         Reviewed by Alex Christensen.
1325
1326         Changed WK_MAC_TBA and WK_IOS_TBA to 10.13.4 and 11.3, respectively, in all declarations that
1327         appear in the GM SDKs.
1328
1329         * Shared/API/Cocoa/_WKNSWindowExtras.h:
1330         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
1331         * UIProcess/API/Cocoa/WKOpenPanelParameters.h:
1332         * UIProcess/API/Cocoa/WKOpenPanelParametersPrivate.h:
1333         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1334         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1335         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1336         * UIProcess/API/Cocoa/WKViewPrivate.h:
1337         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
1338         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1339         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
1340         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
1341         * UIProcess/API/Cocoa/_WKApplicationManifest.h:
1342         * UIProcess/API/Cocoa/_WKAttachment.h:
1343         * UIProcess/API/Cocoa/_WKAutomationSession.h:
1344         * UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.h:
1345         * UIProcess/API/Cocoa/_WKDownload.h:
1346         * UIProcess/API/Cocoa/_WKDownloadDelegate.h:
1347         * UIProcess/API/Cocoa/_WKFocusedElementInfo.h:
1348         * UIProcess/API/Cocoa/_WKFullscreenDelegate.h:
1349         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
1350         * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.h:
1351         * UIProcess/API/Cocoa/_WKVisitedLinkStore.h:
1352         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
1353         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
1354         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandlePrivate.h:
1355         * WebProcess/InjectedBundle/API/mac/WKDOMDocument.h:
1356
1357 2018-03-30  Youenn Fablet  <youenn@apple.com>
1358
1359         NetworkLoadChecker should upgrade redirects if needed
1360         https://bugs.webkit.org/show_bug.cgi?id=184098
1361
1362         Reviewed by Chris Dumez.
1363
1364         In case of redirections, upgrade URL according CSP.
1365
1366         * NetworkProcess/NetworkLoadChecker.cpp:
1367         (WebKit::NetworkLoadChecker::checkRequest):
1368         (WebKit::NetworkLoadChecker::contentSecurityPolicy const):
1369
1370 2018-03-30  JF Bastien  <jfbastien@apple.com>
1371
1372         Update messages.py codegen for String, fix tests
1373         https://bugs.webkit.org/show_bug.cgi?id=184179
1374         <rdar://problem/39041352>
1375
1376         Reviewed by Mark Lam.
1377
1378         I updated some of the code in
1379         https://trac.webkit.org/changeset/230097 and auto-magically used a
1380         script to update copyright headers... and that broke the tests
1381         which checked for a particular date. Update all of the headers.
1382
1383         Part of this change updates the code generated by messages.py
1384
1385         * Scripts/webkit/LegacyMessageReceiver-expected.cpp:
1386         * Scripts/webkit/MessageReceiver-expected.cpp:
1387         * Scripts/webkit/MessageReceiverSuperclass-expected.cpp:
1388         * Scripts/webkit/MessagesSuperclass-expected.h:
1389         * Scripts/webkit/messages.py:
1390         * Scripts/webkit/messages_unittest.py:
1391         (GeneratedFileContentsTest.assertGeneratedFileContentsEqual):
1392         generate a better error message
1393
1394 2018-03-29  JF Bastien  <jfbastien@apple.com>
1395
1396         Use Forward.h instead of forward-declaring WTF::String
1397         https://bugs.webkit.org/show_bug.cgi?id=184172
1398         <rdar://problem/39026146>
1399
1400         Reviewed by Yusuke Suzuki.
1401
1402         As part of #184164 I'm changing WTF::String, and the forward
1403         declarations are just wrong because I'm making it templated. We
1404         should use Forward.h anyways, so do that instead.
1405
1406         * Scripts/webkit/LegacyMessages-expected.h:
1407         * Scripts/webkit/Messages-expected.h:
1408         * Scripts/webkit/MessagesSuperclass-expected.h:
1409         * UIProcess/WebOpenPanelResultListenerProxy.h:
1410
1411 2018-03-29  Brian Burg  <bburg@apple.com>
1412
1413         Web Automation: clipToViewport is ignored for element screenshots
1414         https://bugs.webkit.org/show_bug.cgi?id=184158
1415         <rdar://problem/39014307>
1416
1417         Reviewed by Timothy Hatcher.
1418
1419         In §19.2 Take Element Screenshot, step 5.2 says that we should clip
1420         the element screenshot rect with the visible viewport rect. We don't
1421         do that right now even though we pass over clipToViewport.
1422
1423         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
1424         (WebKit::snapshotRectForScreenshot):
1425         Clip the rect to viewport if needed.
1426
1427         (WebKit::WebAutomationSessionProxy::takeScreenshot):
1428         This scrollIntoView is misplaced; by this point we have already done
1429         the math to figure out the screenshot rect. Move it before computing the rect.
1430
1431 2018-03-29  Brent Fulgham  <bfulgham@apple.com>
1432
1433         REGRESSION(r230035): ASSERT(MACH_PORT_VALID(m_sendPort)) hit in IPC::Connection::initializeSendSource()
1434         https://bugs.webkit.org/show_bug.cgi?id=184122
1435         <rdar://problem/39003606>
1436
1437         Reviewed by Chris Dumez.
1438
1439         One of the new assertions added in r230035 begin firing while running tests locally. This was happening
1440         because the WebInspector was attempting to open a new connection to a web process that had already
1441         terminated its mach port connection (a dead port).
1442         
1443         We should avoid opening new connections when the port we were given is already dead.
1444
1445         * Platform/IPC/Connection.h:
1446         (IPC::Connection::identifierIsValid): Added.
1447         * Platform/IPC/mac/ConnectionMac.mm:
1448         (IPC::Connection::platformInitialize): Do not perform initialization on a dead (or null) port.
1449         (IPC::Connection::open): Add some assertions that ports are in a valid state.
1450         (IPC::Connection::sendOutgoingMessage): Assert that the send port is not dead.
1451         (IPC::Connection::receiveSourceEventHandler): Assert that the receive port is valid.
1452         * UIProcess/ChildProcessProxy.cpp:
1453         (WebKit::ChildProcessProxy::didFinishLaunching): Treat a dead port as a signal that the
1454         child process failed to launch.
1455         * UIProcess/Network/NetworkProcessProxy.cpp:
1456         (WebKit::NetworkProcessProxy::didFinishLaunching): Ditto.
1457         * UIProcess/Plugins/PluginProcessProxy.cpp:
1458         (WebKit::PluginProcessProxy::didFinishLaunching): Ditto.
1459         * UIProcess/Storage/StorageProcessProxy.cpp:
1460         (WebKit::StorageProcessProxy::didFinishLaunching): Ditto.
1461         * WebProcess/Plugins/PluginProcessConnectionManager.cpp:
1462         (WebKit::PluginProcessConnectionManager::getPluginProcessConnection): Ditto.
1463         * WebProcess/WebPage/WebInspectorUI.cpp:
1464         (WebKit::WebInspectorUI::establishConnection): Ditto.
1465         * WebProcess/WebProcess.cpp:
1466         (WebKit::WebProcess::ensureNetworkProcessConnection): Ditto.
1467         (WebKit::WebProcess::ensureWebToStorageProcessConnection): Ditto.
1468
1469 2018-03-29  Youenn Fablet  <youenn@apple.com>
1470
1471         Synchronize SecurityOrigin related scheme registries with NetworkProcess
1472         https://bugs.webkit.org/show_bug.cgi?id=184140
1473
1474         Reviewed by Chris Dumez.
1475
1476         Add syncing of scheme registries that are used by SecurityOrigin and ContentSecurityPolicy
1477         so that we can properly use them in NetworkProcess as we do in WebProcess.
1478         The registries that are not synced are:
1479         - URLSchemeAsEmptyDocument
1480         - URLSchemeDomainRelaxationForbidden
1481         - URLSchemeAsCachePartitioned
1482         - URLSchemeAsCanDisplayOnlyIfCanRequest
1483
1484         * NetworkProcess/NetworkProcess.cpp:
1485         (WebKit::NetworkProcess::initializeNetworkProcess):
1486         (WebKit::NetworkProcess::registerURLSchemeAsSecure const):
1487         (WebKit::NetworkProcess::registerURLSchemeAsBypassingContentSecurityPolicy const):
1488         (WebKit::NetworkProcess::registerURLSchemeAsLocal const):
1489         (WebKit::NetworkProcess::registerURLSchemeAsNoAccess const):
1490         (WebKit::NetworkProcess::registerURLSchemeAsDisplayIsolated const):
1491         (WebKit::NetworkProcess::registerURLSchemeAsCORSEnabled const):
1492         (WebKit::NetworkProcess::registerURLSchemeAsCanDisplayOnlyIfCanRequest const):
1493         * NetworkProcess/NetworkProcess.h:
1494         * NetworkProcess/NetworkProcess.messages.in:
1495         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1496         (WebKit::NetworkProcessCreationParameters::encode const):
1497         (WebKit::NetworkProcessCreationParameters::decode):
1498         * NetworkProcess/NetworkProcessCreationParameters.h:
1499         * UIProcess/WebProcessPool.cpp:
1500         (WebKit::WebProcessPool::ensureNetworkProcess):
1501         (WebKit::WebProcessPool::registerURLSchemeAsSecure):
1502         (WebKit::WebProcessPool::registerURLSchemeAsBypassingContentSecurityPolicy):
1503         (WebKit::WebProcessPool::registerURLSchemeAsLocal):
1504         (WebKit::WebProcessPool::registerURLSchemeAsNoAccess):
1505         (WebKit::WebProcessPool::registerURLSchemeAsDisplayIsolated):
1506         (WebKit::WebProcessPool::registerURLSchemeAsCORSEnabled):
1507         (WebKit::WebProcessPool::registerURLSchemeAsCanDisplayOnlyIfCanRequest):
1508
1509 2018-03-29  Brent Fulgham  <bfulgham@apple.com>
1510
1511         REGRESSION(r229480): ERROR: Unhandled web process message 'WebCookieManager:SetHTTPCookieAcceptPolicy'
1512         https://bugs.webkit.org/show_bug.cgi?id=184124
1513         <rdar://problem/38998971>
1514
1515         Reviewed by Chris Dumez.
1516
1517         Cookie accept policy messages were still being sent to the WebContent process after
1518         I removed cookie access in r229480. The WebContent process no longer recognizes these
1519         messages, and generates logging to that effect.
1520         
1521         This patch stops sending these unnecessary messages to the WebContent process. Only the
1522         Network process needs to receive this information.
1523
1524         * UIProcess/WebCookieManagerProxy.cpp:
1525         (WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy):
1526
1527 2018-03-29  Carlos Eduardo Ramalho  <cadubentzen@gmail.com>
1528
1529         [WPE] Floating point exception in WebEventFactory::createWebWheelEvent
1530         https://bugs.webkit.org/show_bug.cgi?id=184037
1531
1532         Reviewed by Žan Doberšek.
1533
1534         * Shared/wpe/WebEventFactory.cpp:
1535         (WebKit::WebEventFactory::createWebWheelEvent): Use std::copysign() to avoid division by 0.
1536
1537 2018-03-28  Zalan Bujtas  <zalan@apple.com>
1538
1539         Make it possible to override the screen size
1540         https://bugs.webkit.org/show_bug.cgi?id=184111
1541         <rdar://problem/38972181>
1542
1543         Reviewed by Tim Horton.
1544
1545         * Shared/WebPageCreationParameters.cpp:
1546         (WebKit::WebPageCreationParameters::encode const):
1547         (WebKit::WebPageCreationParameters::decode):
1548         * Shared/WebPageCreationParameters.h:
1549         * UIProcess/WebPageProxy.cpp:
1550         (WebKit::WebPageProxy::creationParameters):
1551         * UIProcess/WebPageProxy.h:
1552         * UIProcess/ios/WebPageProxyIOS.mm:
1553         (WebKit::WebPageProxy::overrideScreenSize):
1554         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1555         (WebKit::WebChromeClient::overrideScreenSize const):
1556         * WebProcess/WebCoreSupport/WebChromeClient.h:
1557         * WebProcess/WebPage/WebPage.cpp:
1558         * WebProcess/WebPage/WebPage.h:
1559         * WebProcess/WebPage/ios/WebPageIOS.mm:
1560         (WebKit::WebPage::overrideScreenSize const):
1561
1562 2018-03-28  Chris Dumez  <cdumez@apple.com>
1563
1564         Do process swap when opening a cross-origin URL via window.open(url, '_blank', 'noopener')
1565         https://bugs.webkit.org/show_bug.cgi?id=183962
1566         <rdar://problem/38817833>
1567
1568         Reviewed by Brady Eidson.
1569
1570         Swap WebProcess on for the initial navigation in a new Window that was opened
1571         via window.open(), when the new URL is cross-origin compared to the opener's
1572         origin. For now, we only swap process if 'noopener' property is set when calling
1573         window.open(). This is because we do not support the remote DOMWindows yet.
1574
1575         * Shared/NavigationActionData.cpp:
1576         (WebKit::NavigationActionData::encode const):
1577         (WebKit::NavigationActionData::decode):
1578         * Shared/NavigationActionData.h:
1579         * UIProcess/API/APINavigation.h:
1580         (API::Navigation::setIsCrossOriginWindowOpenNavigation):
1581         (API::Navigation::isCrossOriginWindowOpenNavigation const):
1582         (API::Navigation::setOpener):
1583         (API::Navigation::opener const):
1584         * UIProcess/WebPageProxy.cpp:
1585         (WebKit::WebPageProxy::receivedPolicyDecision):
1586         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1587         * UIProcess/WebProcessPool.cpp:
1588         (WebKit::WebProcessPool::processForNavigation):
1589         * UIProcess/WebProcessPool.h:
1590         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1591         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1592
1593 2018-03-28  Per Arne Vollan  <pvollan@apple.com>
1594
1595         Adopt WEBPROCESS_WINDOWSERVER_BLOCKING compiler guard in WebProcess.
1596         https://bugs.webkit.org/show_bug.cgi?id=183959
1597         <rdar://problem/38965719>
1598
1599         Reviewed by Brent Fulgham.
1600
1601         Use the compile guard to guard the call to CGSSetDenyWindowServerConnections.
1602
1603         * WebProcess/WebProcess.cpp:
1604         (WebKit::WebProcess::initializeProcess):
1605
1606 2018-03-28  Brent Fulgham  <bfulgham@apple.com>
1607
1608         Unreviewed build fix after r230045.
1609
1610         * UIProcess/Launcher/mac/ProcessLauncherMac.mm: Add missing include (breaks iOS).
1611
1612 2018-03-28  Brent Fulgham  <bfulgham@apple.com>
1613
1614         Protect against invalid mach ports returned by mach_port_request_notification
1615         https://bugs.webkit.org/show_bug.cgi?id=184106
1616         <rdar://problem/37865316>
1617
1618         Reviewed by Chris Dumez.
1619
1620         * Platform/IPC/Connection.h:
1621         (IPC::Connection::Identifier::Identifier): Use default initializer syntax.
1622         * Platform/IPC/mac/ConnectionMac.mm:
1623         (IPC::Connection::open): Drive-by-fix: Include formatted mach error message in logging.
1624         (IPC::Connection::receiveSourceEventHandler): Check return value from 'mach_port_request_notification'
1625         and clean up if it experienced an error.
1626         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1627         (WebKit::ProcessLauncher::launchProcess): Ditto.
1628
1629 2018-03-28  Dean Jackson  <dino@apple.com>
1630
1631         WKWebViewContentProvider shouldn't be a UIScrollViewDelegate
1632         https://bugs.webkit.org/show_bug.cgi?id=184107
1633         <rdar://problem/38967492>
1634
1635         Reviewed by Tim Horton.
1636
1637         There is no need for this class to be a UIScrollViewDelegate. Instead
1638         the protocol should have an optional method that is effectively
1639         scrollViewDidScroll.
1640
1641         * UIProcess/API/Cocoa/WKWebView.mm:
1642         (-[WKWebView scrollViewDidScroll:]): Call web_scrollViewDidScroll
1643         if it exists.
1644         * UIProcess/Cocoa/WKWebViewContentProvider.h: Remove UIScrollViewDelegate
1645         and add an optional web_scrollViewDidScroll.
1646         * UIProcess/ios/WKPDFView.mm:
1647         (-[WKPDFView web_scrollViewDidScroll:]): Renamed from scrollViewDidScroll.
1648         (-[WKPDFView scrollViewDidScroll:]): Deleted.
1649         * UIProcess/ios/WKSystemPreviewView.mm:
1650         (-[WKSystemPreviewView scrollViewDidScroll:]): Deleted.
1651
1652 2018-03-28  Wenson Hsieh  <wenson_hsieh@apple.com>
1653
1654         [Extra zoom mode] Make boosted text autosizing values switchable at runtime
1655         https://bugs.webkit.org/show_bug.cgi?id=184092
1656         <rdar://problem/38939917>
1657
1658         Reviewed by Tim Horton.
1659
1660         Add a private web view preference to switch between normal and boosted text autosizing mode. By default, we use
1661         normal text autosizing values.
1662
1663         * Shared/WebPreferences.yaml:
1664         * UIProcess/API/Cocoa/WKPreferences.mm:
1665         (-[WKPreferences _setShouldEnableTextAutosizingBoost:]):
1666         (-[WKPreferences _shouldEnableTextAutosizingBoost]):
1667         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1668
1669 2018-03-28  Brent Fulgham  <bfulgham@apple.com>
1670
1671         Avoid uninitialized mach ports
1672         https://bugs.webkit.org/show_bug.cgi?id=184090
1673         <rdar://problem/37261129>
1674
1675         Reviewed by Chris Dumez.
1676
1677         It is possible for mach_port_allocate to return an error, but we rarely check its return value. The value
1678         of the argument passed to mach_port_allocate is not guaranteed to be valid when it returns an error, so
1679         there is a potential for us to try to use invalid ports.
1680
1681         We should always check return values, and ensure that the mach port variables we seek to initialize are
1682         kept in a valid state.
1683
1684         Reviewed by Chris Dumez.
1685
1686         * NetworkProcess/NetworkProcess.cpp:
1687         (WebKit::NetworkProcess::createNetworkConnectionToWebProcess): Initialize new port to a safe default and
1688         check the return state of the allocation function.
1689         * Platform/IPC/Connection.h:
1690         * Platform/IPC/mac/ConnectionMac.mm:
1691         (IPC::Connection::open): Ditto.
1692         (IPC::Connection::initializeSendSource): Ditto.
1693         (IPC::readFromMachPort): Ditto.
1694         (IPC::Connection::receiveSourceEventHandler): Ditto.
1695         * Platform/SharedMemory.h:
1696         * Platform/cocoa/SharedMemoryCocoa.cpp:
1697         (WebKit::makeMemoryEntry): Ditto.
1698         * Platform/mac/MachUtilities.cpp:
1699         (setMachPortQueueLength): Ditto.
1700         (setMachExceptionPort): Ditto.
1701         * PluginProcess/PluginProcess.cpp:
1702         (WebKit::PluginProcess::createWebProcessConnection): Ditto.
1703         * StorageProcess/StorageProcess.cpp:
1704         (WebKit::StorageProcess::createStorageToWebProcessConnection): Ditto.
1705         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1706         (WebKit::ProcessLauncher::launchProcess): Ditto.
1707         * WebProcess/WebPage/WebInspector.cpp:
1708         (WebKit::WebInspector::openFrontendConnection): Ditto.
1709
1710 2018-03-28  Michael Catanzaro  <mcatanzaro@igalia.com>
1711
1712         Fails to build webkitgtk+ after git-svn-id: http://svn.webkit.org/repository/webkit/trunk@229877 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1713         https://bugs.webkit.org/show_bug.cgi?id=184081
1714
1715         Unreviewed, switch to use UNUSED_PARAM()
1716
1717         * UIProcess/WebPageProxy.cpp:
1718         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1719
1720 2018-03-28  Tim Horton  <timothy_horton@apple.com>
1721
1722         Make use of HAVE(CORE_ANIMATION_RENDER_SERVER) in more places
1723         https://bugs.webkit.org/show_bug.cgi?id=184072
1724         <rdar://problem/38946530>
1725
1726         Reviewed by Dan Bernstein.
1727
1728         * Platform/mac/LayerHostingContext.mm:
1729         (WebKit::LayerHostingContext::createForExternalHostingProcess):
1730         * UIProcess/mac/ViewSnapshotStore.h:
1731         * UIProcess/mac/ViewSnapshotStore.mm:
1732         (WebKit::ViewSnapshot::clearImage):
1733
1734 2018-03-28  Wenson Hsieh  <wenson_hsieh@apple.com>
1735
1736         Revert an unnecessary workaround when zooming focused form controls
1737         https://bugs.webkit.org/show_bug.cgi?id=184067
1738         <rdar://problem/38805254>
1739
1740         Reviewed by Tim Horton.
1741
1742         Reverts an unintended change introduced in r227984.
1743
1744         * UIProcess/ios/WKContentViewInteraction.mm:
1745         (-[WKContentView _displayFormNodeInputView]):
1746
1747 2018-03-28  Miguel Gomez  <magomez@igalia.com>
1748
1749         [GTK][WPE] Remove UpdateAtlas
1750         https://bugs.webkit.org/show_bug.cgi?id=184042
1751
1752         Reviewed by Žan Doberšek.
1753
1754         Remove all the code related to UpdateAtlas handling.
1755
1756         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1757         (WebKit::CoordinatedGraphicsScene::updateTilesIfNeeded):
1758         (WebKit::CoordinatedGraphicsScene::commitSceneState):
1759         (WebKit::CoordinatedGraphicsScene::purgeGLResources):
1760         (WebKit::CoordinatedGraphicsScene::syncUpdateAtlases): Deleted.
1761         (WebKit::CoordinatedGraphicsScene::createUpdateAtlas): Deleted.
1762         (WebKit::CoordinatedGraphicsScene::removeUpdateAtlas): Deleted.
1763         (WebKit::CoordinatedGraphicsScene::releaseUpdateAtlases): Deleted.
1764         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
1765         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1766         (WebKit::ThreadedCompositor::renderLayerTree):
1767         (WebKit::ThreadedCompositor::releaseUpdateAtlases): Deleted.
1768         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
1769         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1770         (WebKit::WebChromeClient::delegatedScrollRequested):
1771         (WebKit::WebChromeClient::resetUpdateAtlasForTesting): Deleted.
1772         * WebProcess/WebCoreSupport/WebChromeClient.h:
1773         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
1774         (WebKit::AcceleratedDrawingArea::resetUpdateAtlasForTesting): Deleted.
1775         * WebProcess/WebPage/AcceleratedDrawingArea.h:
1776         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
1777         (WebKit::CompositingCoordinator::CompositingCoordinator):
1778         (WebKit::CompositingCoordinator::flushPendingLayerChanges):
1779         (WebKit::CompositingCoordinator::clearPendingStateChanges):
1780         (WebKit::CompositingCoordinator::renderNextFrame):
1781         (WebKit::CompositingCoordinator::purgeBackingStores):
1782         (WebKit::CompositingCoordinator::createUpdateAtlas): Deleted.
1783         (WebKit::CompositingCoordinator::removeUpdateAtlas): Deleted.
1784         (WebKit::CompositingCoordinator::getCoordinatedBuffer): Deleted.
1785         (): Deleted.
1786         (WebKit::CompositingCoordinator::scheduleReleaseInactiveAtlases): Deleted.
1787         (WebKit::CompositingCoordinator::releaseInactiveAtlasesTimerFired): Deleted.
1788         (WebKit::CompositingCoordinator::releaseAtlases): Deleted.
1789         (WebKit::CompositingCoordinator::clearUpdateAtlases): Deleted.
1790         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
1791         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
1792         (WebKit::CoordinatedLayerTreeHost::clearUpdateAtlases): Deleted.
1793         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
1794         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
1795         (WebKit::ThreadedCoordinatedLayerTreeHost::releaseUpdateAtlases): Deleted.
1796         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
1797         * WebProcess/WebPage/DrawingArea.h:
1798         * WebProcess/WebPage/LayerTreeHost.h:
1799         (WebKit::LayerTreeHost::setIsDiscardable):
1800
1801 2018-03-28  Carlos Garcia Campos  <cgarcia@igalia.com>
1802
1803         REGRESSION(r229998): WebDriver: MiniBrowser is crashing in a lot of tests after r229998
1804         https://bugs.webkit.org/show_bug.cgi?id=184075
1805
1806         Reviewed by Žan Doberšek.
1807
1808         This is because we are using a value after it has been moved.
1809
1810         * UIProcess/Automation/WebAutomationSession.cpp:
1811         (WebKit::WebAutomationSession::setWindowFrameOfBrowsingContext): Save a reference to page in a local variable
1812         before using it when it's also going to be moved in the lambda capture.
1813
1814 2018-03-27  Michael Catanzaro  <mcatanzaro@igalia.com>
1815
1816         Unreviewed, fix typo in variable name
1817
1818         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1819         (webkitWebViewBaseCrossingNotifyEvent):
1820
1821 2018-03-27  Per Arne Vollan  <pvollan@apple.com>
1822
1823         The layout test fast/canvas/webgl/read-pixels-test.html is timing out.
1824         https://bugs.webkit.org/show_bug.cgi?id=183923
1825         <rdar://problem/38756869>
1826
1827         Reviewed by Brent Fulgham.
1828
1829         Send OpenGL display mask to the WebContent process when the display ID is changing.
1830
1831         * UIProcess/WebPageProxy.cpp:
1832         (WebKit::WebPageProxy::windowScreenDidChange):
1833         * WebProcess/WebPage/WebPage.h:
1834         * WebProcess/WebPage/WebPage.messages.in:
1835         * WebProcess/WebPage/mac/WebPageMac.mm:
1836         (WebKit::WebPage::openGLDisplayMaskChanged):
1837
1838 2018-03-27  Youenn Fablet  <youenn@apple.com>
1839
1840         Move request checking out of PingLoad for future reuse in NetworkLoad
1841         https://bugs.webkit.org/show_bug.cgi?id=183865
1842
1843         Reviewed by Chris Dumez.
1844
1845         Introduce NetworkLoadChecker as a way to validate requests before sending them in the network process.
1846         Validation encompasses: CORS checks, CSP and Content Extensions on both main request and redirected requests if any.
1847
1848         Make PingLoad use NetworkLoadChecker. Future patch should make NetworkLoad to use it as well whenever needed.
1849
1850         Make NetworkCORSPreflightChecker takes a CompletionHandler instead of a Function.
1851         Ensure this callback is called even if preflight is not completed by returning a Canceled error.
1852
1853         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
1854         (WebKit::NetworkCORSPreflightChecker::~NetworkCORSPreflightChecker):
1855         (WebKit::NetworkCORSPreflightChecker::returnResult):
1856         (WebKit::NetworkCORSPreflightChecker::willPerformHTTPRedirection):
1857         (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
1858         (WebKit::NetworkCORSPreflightChecker::didCompleteWithError):
1859         * NetworkProcess/NetworkCORSPreflightChecker.h:
1860         * NetworkProcess/NetworkLoadChecker.cpp: Added.
1861         (WebKit::NetworkLoadChecker::NetworkLoadChecker):
1862         (WebKit::NetworkLoadChecker::check):
1863         (WebKit::NetworkLoadChecker::checkRedirection):
1864         (WebKit::NetworkLoadChecker::returnError):
1865         (WebKit::NetworkLoadChecker::checkRequest):
1866         (WebKit::NetworkLoadChecker::checkCORSRequest):
1867         (WebKit::NetworkLoadChecker::checkCORSRedirectedRequest):
1868         (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
1869         (WebKit::NetworkLoadChecker::doesNotNeedCORSCheck const):
1870         (WebKit::NetworkLoadChecker::contentSecurityPolicy const):
1871         (WebKit::NetworkLoadChecker::contentExtensionsBackend):
1872         (WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad):
1873         * NetworkProcess/NetworkLoadChecker.h: Added.
1874         (WebKit::NetworkLoadChecker::setCSPResponseHeaders):
1875         (WebKit::NetworkLoadChecker::setContentExtensionRuleLists):
1876         (WebKit::NetworkLoadChecker::url const):
1877         (WebKit::NetworkLoadChecker::storedCredentialsPolicy const):
1878         (WebKit::NetworkLoadChecker::isChecking const):
1879         (WebKit::NetworkLoadChecker::isRedirected const):
1880         * NetworkProcess/PingLoad.cpp:
1881         (WebKit::PingLoad::PingLoad):
1882         (WebKit::PingLoad::~PingLoad):
1883         (WebKit::PingLoad::willPerformHTTPRedirection):
1884         (WebKit::PingLoad::didReceiveChallenge):
1885         (WebKit::PingLoad::wasBlocked):
1886         (WebKit::PingLoad::cannotShowURL):
1887         (WebKit::PingLoad::timeoutTimerFired):
1888         (WebKit::PingLoad::currentURL const):
1889         * NetworkProcess/PingLoad.h:
1890         * WebKit.xcodeproj/project.pbxproj:
1891
1892 2018-03-27  Jiewen Tan  <jiewen_tan@apple.com>
1893
1894         [WebAuthN] Implement authenticatorGetAssertion
1895         https://bugs.webkit.org/show_bug.cgi?id=183881
1896         <rdar://problem/37258628>
1897
1898         Reviewed by Brent Fulgham.
1899
1900         * Shared/WebPreferences.yaml:
1901         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.cpp:
1902         (WebKit::WebCredentialsMessengerProxy::makeCredential):
1903         (WebKit::WebCredentialsMessengerProxy::getAssertion):
1904         (WebKit::WebCredentialsMessengerProxy::getAssertionReply):
1905         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.h:
1906         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.messages.in:
1907         * WebProcess/CredentialManagement/WebCredentialsMessenger.cpp:
1908         (WebKit::WebCredentialsMessenger::getAssertion):
1909         (WebKit::WebCredentialsMessenger::getAssertionReply):
1910         * WebProcess/CredentialManagement/WebCredentialsMessenger.messages.in:
1911
1912 2018-03-27  Chris Dumez  <cdumez@apple.com>
1913
1914         Avoid constructing SecurityOrigin objects from non-main threads
1915         https://bugs.webkit.org/show_bug.cgi?id=184024
1916
1917         Reviewed by Youenn Fablet.
1918
1919         Avoid constructing SecurityOrigin objects from non-main threads as much as possible.
1920
1921         * WebProcess/Storage/WebSWClientConnection.cpp:
1922         (WebKit::WebSWClientConnection::mayHaveServiceWorkerRegisteredForOrigin const):
1923         (WebKit::WebSWClientConnection::matchRegistration):
1924         (WebKit::WebSWClientConnection::getRegistrations):
1925         * WebProcess/Storage/WebSWClientConnection.h:
1926         * WebProcess/Storage/WebSWOriginTable.cpp:
1927         (WebKit::WebSWOriginTable::contains const):
1928         * WebProcess/Storage/WebSWOriginTable.h:
1929
1930 2018-03-27  Chris Dumez  <cdumez@apple.com>
1931
1932         Move online state detection from the WebProcess to the NetworkProcess
1933         https://bugs.webkit.org/show_bug.cgi?id=183989
1934         <rdar://problem/37093299>
1935
1936         Reviewed by Youenn Fablet.
1937
1938         Move online state detection from the WebProcess to the NetworkProcess. This avoid executing the same (expensive) code in
1939         EACH web process whenever a network interface's state changes. Now, the Network Process monitors network interfaces
1940         and determines the online state whenever an interface's state changes. If the onLine state changes, it notifies all
1941         its connected WebProcesses via IPC.
1942
1943         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1944         (WebKit::NetworkConnectionToWebProcess::setOnLineState):
1945         * NetworkProcess/NetworkConnectionToWebProcess.h:
1946         * NetworkProcess/NetworkProcess.cpp:
1947         (WebKit::NetworkProcess::NetworkProcess):
1948         (WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
1949         * WebProcess/Network/NetworkProcessConnection.cpp:
1950         (WebKit::NetworkProcessConnection::setOnLineState):
1951         * WebProcess/Network/NetworkProcessConnection.h:
1952         * WebProcess/Network/NetworkProcessConnection.messages.in:
1953         * WebProcess/Network/WebLoaderStrategy.cpp:
1954         (WebKit::WebLoaderStrategy::isOnLine const):
1955         (WebKit::WebLoaderStrategy::addOnlineStateChangeListener):
1956         (WebKit::WebLoaderStrategy::setOnLineState):
1957         * WebProcess/Network/WebLoaderStrategy.h:
1958
1959 2018-03-27  Wenson Hsieh  <wenson_hsieh@apple.com>
1960
1961         [Extra zoom mode] Add support for new focused form control overlay behaviors
1962         https://bugs.webkit.org/show_bug.cgi?id=184043
1963         <rdar://problem/38758727>
1964
1965         Reviewed by Tim Horton.
1966
1967         See below for more details.
1968
1969         * UIProcess/ios/WKContentViewInteraction.mm:
1970         (-[WKContentView _willStartScrollingOrZooming]):
1971         (-[WKContentView _didEndScrollingOrZooming]):
1972
1973         Suppress focused form control navigation while the scroll view is undergoing a scroll or zoom animation (e.g.,
1974         when moving from one focused form control to another).
1975
1976         (-[WKContentView textInputController:didCommitText:withSuggestion:]):
1977
1978         When dismissing an input view controller, allow focused form control navigation only after updating assisted
1979         node information to ensure that focus rects aren't stale as the user begins to navigate between forms.
1980
1981         (-[WKContentView rectForFocusedFormControlController:inCoordinateSpace:]):
1982         (-[WKContentView nextRectForFocusedFormControlController:inCoordinateSpace:]):
1983         (-[WKContentView previousRectForFocusedFormControlController:inCoordinateSpace:]):
1984         (-[WKContentView scrollViewForFocusedFormControlController:]):
1985         (-[WKContentView highlightedRectForFocusedFormControlController:inCoordinateSpace:]): Deleted.
1986
1987         Implement some new focused form overlay delegate hooks to vend the scroll view, as well as the rects of next and
1988         previous focusable form controls.
1989
1990 2018-03-27  Brent Fulgham  <bfulgham@apple.com>
1991
1992         Further refine cookie read/write logging
1993         https://bugs.webkit.org/show_bug.cgi?id=184044
1994         <rdar://problem/38915610>
1995
1996         Reviewed by Chris Dumez.
1997
1998         Cookie logging was passing the partition, rather than the first party, when logging, which
1999         prevented logging in cases where partitioning or blocking was active. This patch corrects
2000         these calls so that logging is generated in these cases, too.
2001
2002         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2003         (WebKit::NetworkConnectionToWebProcess::cookiesForDOM): Call log routines if needed.
2004         (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM): Ditto.
2005         * NetworkProcess/NetworkResourceLoader.cpp:
2006         (WebKit::escapeIDForJSON): Make available to use in multiple functions.
2007         (WebKit::NetworkResourceLoader::logCookieInformation const): Revise to use shared
2008         convenience functions.
2009         (WebKit::logBlockedCookieInformation): Added.
2010         (WebKit::logCookieInformationInternal): Added.
2011         (WebKit::NetworkResourceLoader::logCookieInformation): Revise to use shared
2012         convenience functions.
2013         * NetworkProcess/NetworkResourceLoader.h:
2014
2015 2018-03-27  Brian Burg  <bburg@apple.com>
2016
2017         Web Automation: support enter/exit fullscreen and hide/restore window operations
2018         https://bugs.webkit.org/show_bug.cgi?id=182837
2019         <rdar://problem/37580732>
2020
2021         Reviewed by Tim Horton.
2022
2023         The W3C specification is more explicit about when to exit fullscreen and
2024         restore the window for a browsing context. So, WebKit needs to have support
2025         for performing these operations on behalf of a driver.
2026
2027         Based on prototyping, it is sufficient to use a JavaScript atom to enter
2028         fullscreen mode. This is included in the patch as EnterFullscreen.js and
2029         can be used to implement the §10.7.5 Fullscreen Window command.
2030
2031         Other window operations cannot be peformed from JavaScript, so we need to
2032         delegate these operations to the session client (i.e., Safari).
2033         This patch adds session client callouts for restoring, minimizing, and
2034         switching to a browsing context.
2035
2036         Exiting fullscreen happens implicitly (per specification) when setting a
2037         window frame without an actual frame, or when switching/restoring/minimizing a window.
2038         If needed, a driver can call Set Window Rect in this way to unfullscreen a context.
2039         Similarly, a driver can restore a minimized window using Set Window Rect.
2040
2041         * UIProcess/API/APIAutomationSessionClient.h:
2042         (API::AutomationSessionClient::requestHideWindowOfPage):
2043         (API::AutomationSessionClient::requestRestoreWindowOfPage):
2044         (API::AutomationSessionClient::requestSwitchToPage):
2045         Add new API client methods.
2046
2047         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
2048         Add new Cocoa API delegate methods.
2049
2050         * UIProcess/Automation/Automation.json:
2051         Make the switch to browsing context command asynchronous, since this functionality
2052         is not always synchronous, and we prefer to use completion handlers in the delegates.
2053
2054         Add new protocol method for hiding the window of a browsing context.
2055         This is expected to minimize/miniaturize a window for desktop window managers.
2056
2057         * UIProcess/Automation/WebAutomationSession.h:
2058         * UIProcess/Automation/WebAutomationSession.cpp:
2059         (WebKit::WebAutomationSession::switchToBrowsingContext):
2060         Make this function asynchronous. Call out to the session client.
2061
2062         (WebKit::WebAutomationSession::setWindowFrameOfBrowsingContext):
2063         Follow the steps in the specification to restore window and exit fullscreen.
2064
2065         (WebKit::WebAutomationSession::hideWindowOfBrowsingContext):
2066         Exit fullscreen and call out to the session client.
2067
2068         (WebKit::WebAutomationSession::exitFullscreenWindowForPage):
2069         This is a little strange. Because there is no async API for exiting fullscreen
2070         from C++ code, we hook into willEnterFullScreen and didExitFullScreen and send
2071         out the response if the page exited fullscreen after we requested it to do so.
2072         Because the W3C specification mandates that drivers only process one command at
2073         a time, there will only ever be one callback installed by this method at a time.
2074
2075         (WebKit::WebAutomationSession::restoreWindowForPage):
2076         (WebKit::WebAutomationSession::hideWindowForPage):
2077         Call out to the session client.
2078
2079         (WebKit::WebAutomationSession::didEnterFullScreenForPage):
2080         (WebKit::WebAutomationSession::didExitFullScreenForPage):
2081         Add methods to be called by instrumentation hooks in WebFullScreenManagerProxy.
2082
2083         * UIProcess/Automation/atoms/EnterFullscreen.js: Added.
2084         (enterFullscreen):
2085
2086         * UIProcess/Cocoa/AutomationSessionClient.h:
2087         * UIProcess/Cocoa/AutomationSessionClient.mm:
2088         (WebKit::AutomationSessionClient::AutomationSessionClient):
2089         (WebKit::AutomationSessionClient::requestSwitchToPage):
2090         (WebKit::AutomationSessionClient::requestHideWindowOfPage):
2091         (WebKit::AutomationSessionClient::requestRestoreWindowOfPage):
2092         (WebKit::AutomationSessionClient::isShowingJavaScriptDialogOnPage):
2093         Add boilerplate to convert C++ API client to Objective-C delegate methods.
2094
2095         * UIProcess/WebFullScreenManagerProxy.cpp:
2096         (WebKit::WebFullScreenManagerProxy::didEnterFullScreen):
2097         (WebKit::WebFullScreenManagerProxy::didExitFullScreen):
2098         Notify the automation session if the page is under automation and
2099         enters or exits fullscreen.
2100
2101         * WebKit.xcodeproj/project.pbxproj:
2102         Add EnterFullscreen.js to the list of WebDriver atoms. These are copied
2103         as WebKit2 private headers and used by driver implementations.
2104
2105 2018-03-27  Eric Carlson  <eric.carlson@apple.com>
2106
2107         Make AVFoundationEnabled preference available on iOS
2108         https://bugs.webkit.org/show_bug.cgi?id=183876
2109         <rdar://problem/38726459>
2110
2111         Reviewed by Youenn Fablet.
2112
2113         * Shared/WebPreferences.yaml: Set AVFoundationEnabled with DEFAULT_AVFOUNDATION_ENABLED.
2114         * Shared/WebPreferencesDefaultValues.h:
2115
2116         * UIProcess/API/Cocoa/WKPreferences.mm:
2117         (-[WKPreferences _setAVFoundationEnabled:]): Enable for iOS.
2118         (-[WKPreferences _avFoundationEnabled]): Ditto.
2119         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2120
2121 2018-03-26  Tim Horton  <timothy_horton@apple.com>
2122
2123         Adopt WK_ALTERNATE_FRAMEWORKS_DIR in WebKit
2124         https://bugs.webkit.org/show_bug.cgi?id=184030
2125         <rdar://problem/38895281>
2126
2127         Reviewed by Dan Bernstein.
2128
2129         * Configurations/Base.xcconfig:
2130         * Configurations/BaseTarget.xcconfig:
2131         * Configurations/WebKit.xcconfig:
2132
2133 2018-03-26  Tim Horton  <timothy_horton@apple.com>
2134
2135         Add and adopt HAVE(CORE_ANIMATION_RENDER_SERVER)
2136         https://bugs.webkit.org/show_bug.cgi?id=184026
2137         <rdar://problem/38883321>
2138
2139         Reviewed by Sam Weinig.
2140
2141         * UIProcess/API/Cocoa/WKWebView.mm:
2142         (-[WKWebView _takeViewSnapshot]):
2143         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
2144
2145 2018-03-26  Wenson Hsieh  <wenson_hsieh@apple.com>
2146
2147         [Extra zoom mode] Refactor input view controller presentation and dismissal helpers
2148         https://bugs.webkit.org/show_bug.cgi?id=184020
2149         Work towards <rdar://problem/38758727>
2150
2151         Reviewed by Tim Horton.
2152
2153         We currently have separate presentation and dismissal helpers for each type of view controller corresponding to
2154         a focused element type. This is excessive, considering that all of these helpers are only invoked from one place
2155         (either -presentViewControllerForCurrentAssistedNode or -dismissAllInputViewControllers), with the exception of
2156         the focused form control overlay.
2157
2158         This refactoring allows us to then adjust the timing of first responder restoration logic, such that the focused
2159         form control view controller can receive forwarded events from the web view. See below for more detail.
2160
2161         * UIProcess/ios/WKContentViewInteraction.mm:
2162         (-[WKContentView presentFocusedFormControlViewController:]):
2163         (-[WKContentView dismissFocusedFormControlViewController:]):
2164
2165         Remove logic to restore the web view as first responder.
2166
2167         (-[WKContentView presentViewControllerForCurrentAssistedNode]):
2168         (-[WKContentView dismissAllInputViewControllers]):
2169
2170         Restore first responder after dismissing a view controller that was presented when focusing a form control, only
2171         if the web view was first responder before presentation.
2172
2173         (-[WKContentView presentDatePickerViewController:]): Deleted.
2174         (-[WKContentView dismissDatePickerViewController:]): Deleted.
2175         (-[WKContentView presentTimePickerViewController:]): Deleted.
2176         (-[WKContentView dismissTimePickerViewController:]): Deleted.
2177         (-[WKContentView presentSelectMenuViewController:]): Deleted.
2178         (-[WKContentView dismissSelectMenuViewController:]): Deleted.
2179         (-[WKContentView dismissNumberPadViewController:]): Deleted.
2180         (-[WKContentView presentNumberPadViewController:]): Deleted.
2181         (-[WKContentView presentTextInputViewController:]): Deleted.
2182         (-[WKContentView dismissTextInputViewController:]): Deleted.
2183
2184 2018-03-06  Brian Burg  <bburg@apple.com>
2185
2186         Web Automation: provide a way to ask clients for a new tab or window
2187         https://bugs.webkit.org/show_bug.cgi?id=183381
2188         <rdar://problem/38167301>
2189
2190         Reviewed by Timothy Hatcher.
2191
2192         Add support for specifying browsing context options when requesting
2193         a new browsing context from the automation session client/delegate.
2194         This is currently just used for specifying tab vs window, but could
2195         also be used for things like toggling certain browser chrome or features.
2196
2197         There is no guarantee that the client has a notion of tabs vs windows,
2198         so this option is purely advisory and should not cause the command to
2199         fail if it cannot be honored.
2200
2201         This behavior caused by specifying this option is client-specific, so no
2202         new tests are included in WebKit for this change.
2203
2204         * UIProcess/API/APIAutomationSessionClient.h:
2205         (API::AutomationSessionClient::didRequestNewPageWithOptions):
2206         (API::AutomationSessionClient::didRequestNewWindow): Deleted.
2207         Add options parameter.
2208
2209         * UIProcess/API/glib/WebKitAutomationSession.cpp:
2210         Adjust to new signature. More work is needed to plumb this information
2211         to the public API for GTK/WPE and support it in WebKitGTK driver.
2212
2213         * UIProcess/Automation/Automation.json: Add new optional parameter.
2214
2215         * UIProcess/Automation/WebAutomationSession.h:
2216         * UIProcess/Automation/WebAutomationSession.cpp:
2217         (WebKit::WebAutomationSession::createBrowsingContext):
2218         Convert the protocol option to an API option.
2219
2220         * UIProcess/Cocoa/AutomationSessionClient.h:
2221         * UIProcess/Cocoa/AutomationSessionClient.mm:
2222         (WebKit::AutomationSessionClient::AutomationSessionClient):
2223         (WebKit::toAPI):
2224         (WebKit::AutomationSessionClient::didRequestNewPageWithOptions):
2225         (WebKit::AutomationSessionClient::didRequestNewWindow): Deleted.
2226         Convert the internal option to a Cocoa SPI option and pass it along.
2227
2228         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
2229         Adjust delegate methods to include options. Clients need to adopt the new signature(s).
2230
2231 2018-03-26  Wenson Hsieh  <wenson_hsieh@apple.com>
2232
2233         [Extra zoom mode] Add plumbing for next and previous focusable element rects
2234         https://bugs.webkit.org/show_bug.cgi?id=184016
2235         Work towards <rdar://problem/38758727>
2236
2237         Reviewed by Tim Horton.
2238
2239         When building up AssistedNodeInformation, we currently compute the element rect of the current focused element,
2240         as well as flags indicating whether or not there are next or previous focusable elements. For
2241         <rdar://problem/38758727>, we additionally send the rects of the next or previous focusable elements as well.
2242
2243         * Shared/AssistedNodeInformation.cpp:
2244         (WebKit::AssistedNodeInformation::encode const):
2245         (WebKit::AssistedNodeInformation::decode):
2246
2247         IPC support for nextNodeRect and previousNodeRect.
2248
2249         * Shared/AssistedNodeInformation.h:
2250         * WebProcess/WebPage/ios/WebPageIOS.mm:
2251         (WebKit::elementRectInRootViewCoordinates):
2252
2253         Add a helper to compute an element's rect in root view coordinates. We use this to compute the rects of the
2254         current focused element as well as those of the next and previous elements, if any.
2255
2256         (WebKit::WebPage::getAssistedNodeInformation):
2257         (WebKit::hasAssistableElement): Deleted.
2258
2259         Since we need the next or previous focusable element to get its rect, we don't need this helper anymore.
2260
2261 2018-03-26  Chris Dumez  <cdumez@apple.com>
2262
2263         Use SecurityOriginData more consistently in Service Worker code
2264         https://bugs.webkit.org/show_bug.cgi?id=183969
2265
2266         Reviewed by Darin Adler.
2267
2268         Use SecurityOriginData more consistently in Service Worker code to avoid constructing
2269         SecurityOrigin objects unnecessarily.
2270
2271         * NetworkProcess/NetworkResourceLoadParameters.cpp:
2272         (WebKit::NetworkResourceLoadParameters::encode const):
2273         * Shared/API/c/WKSecurityOriginRef.cpp:
2274         (WKSecurityOriginCopyDatabaseIdentifier):
2275         * StorageProcess/ServiceWorker/WebSWOriginStore.cpp:
2276         (WebKit::WebSWOriginStore::addToStore):
2277         (WebKit::WebSWOriginStore::removeFromStore):
2278         * StorageProcess/ServiceWorker/WebSWOriginStore.h:
2279         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2280         (WebKit::WebSWServerConnection::scheduleJobInServer):
2281         (WebKit::WebSWServerConnection::registerServiceWorkerClient):
2282         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
2283         (WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
2284         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
2285         * StorageProcess/StorageProcess.cpp:
2286         (WebKit::StorageProcess::connectionToContextProcessWasClosed):
2287         (WebKit::StorageProcess::needsServerToContextConnectionForOrigin const):
2288         (WebKit::StorageProcess::createStorageToWebProcessConnection):
2289         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
2290         (WebKit::StorageProcess::serverToContextConnectionForOrigin):
2291         (WebKit::StorageProcess::createServerToContextConnection):
2292         (WebKit::StorageProcess::swContextConnectionMayNoLongerBeNeeded):
2293         * StorageProcess/StorageProcess.h:
2294         * UIProcess/API/APIFrameInfo.cpp:
2295         (API::FrameInfo::create):
2296         * UIProcess/API/C/WKApplicationCacheManager.cpp:
2297         (WKApplicationCacheManagerDeleteEntriesForOrigin):
2298         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
2299         (WKKeyValueStorageManagerDeleteEntriesForOrigin):
2300         * UIProcess/API/C/WKResourceCacheManager.cpp:
2301         (WKResourceCacheManagerClearCacheForOrigin):
2302         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2303         (WKWebsiteDataStoreRemoveFetchCacheForOrigin):
2304         (WKWebsiteDataStoreGetFetchCacheSizeForOrigin):
2305         * UIProcess/ServiceWorkerProcessProxy.cpp:
2306         (WebKit::ServiceWorkerProcessProxy::create):
2307         (WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
2308         (WebKit::ServiceWorkerProcessProxy::getLaunchOptions):
2309         * UIProcess/ServiceWorkerProcessProxy.h:
2310         * UIProcess/Storage/StorageProcessProxy.cpp:
2311         (WebKit::StorageProcessProxy::getStorageProcessConnection):
2312         * UIProcess/WebProcessPool.cpp:
2313         (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
2314         (WebKit::WebProcessPool::disconnectProcess):
2315         (WebKit::WebProcessPool::updateProcessAssertions):
2316         * UIProcess/WebProcessPool.h:
2317         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2318         (WebKit::WebsiteDataStore::fetchDataAndApply):
2319         * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
2320         (WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation):
2321         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2322         (WKBundlePageCopyOriginsWithApplicationCache):
2323         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
2324         (WebKit::UserMediaPermissionRequestManager::sendUserMediaRequest):
2325         (WebKit::UserMediaPermissionRequestManager::enumerateMediaDevices):
2326         * WebProcess/Storage/WebSWClientConnection.cpp:
2327         (WebKit::WebSWClientConnection::registerServiceWorkerClient):
2328         (WebKit::WebSWClientConnection::matchRegistration):
2329         (WebKit::WebSWClientConnection::whenRegistrationReady):
2330         (WebKit::WebSWClientConnection::getRegistrations):
2331         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2332         (WebKit::WebChromeClient::exceededDatabaseQuota):
2333         (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
2334         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2335         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2336         * WebProcess/WebProcess.cpp:
2337         (WebKit::WebProcess::fetchWebsiteData):
2338         * WebProcess/WebStorage/StorageAreaImpl.cpp:
2339         (WebKit::StorageAreaImpl::securityOrigin const):
2340         * WebProcess/WebStorage/StorageAreaImpl.h:
2341         * WebProcess/WebStorage/StorageAreaMap.cpp:
2342         (WebKit::StorageAreaMap::StorageAreaMap):
2343         (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
2344         (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
2345         * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
2346         (WebKit::StorageNamespaceImpl::didDestroyStorageAreaMap):
2347
2348 2018-03-26  Brent Fulgham  <bfulgham@apple.com>
2349
2350         Warn against cookie access in the WebContent process using ProcessPrivilege assertions
2351         https://bugs.webkit.org/show_bug.cgi?id=183911
2352         <rdar://problem/38762306>
2353
2354         Reviewed by Youenn Fablet.
2355
2356         Add a set of ProcessPrivilege assertions to enforce the rule that the WebContent process
2357         should never call Cookie API directly. That should only happen in the Networking or
2358         UIProcess. 
2359
2360         * NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
2361         (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
2362         (WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy):
2363         * NetworkProcess/NetworkProcess.cpp:
2364         (WebKit::NetworkProcess::initializeNetworkProcess):
2365         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2366         (WebKit::NetworkDataTaskCocoa::applyCookieBlockingPolicy):
2367         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2368         (WebKit::NetworkProcess::setSharedHTTPCookieStorage):
2369         (WebKit::NetworkProcess::syncAllCookies):
2370         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2371         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
2372         * NetworkProcess/mac/RemoteNetworkingContext.mm:
2373         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
2374         * PluginProcess/PluginProcess.cpp:
2375         (WebKit::PluginProcess::initializeProcess):
2376         * Shared/cf/CookieStorageUtilsCF.mm:
2377         (WebKit::cookieStorageFromIdentifyingData):
2378         (WebKit::identifyingDataFromCookieStorage):
2379         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2380         (WebKit::WebProcessPool::platformInitializeWebProcess):
2381         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2382         (WebKit::privateBrowsingSession):
2383         * UIProcess/WebProcessPool.cpp:
2384         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
2385         (WebKit::WebsiteDataStore::parameters):
2386         * UIProcess/mac/WebCookieManagerProxyMac.mm:
2387         (WebKit::WebCookieManagerProxy::persistHTTPCookieAcceptPolicy):
2388         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2389         (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
2390         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2391         (WebKit::WebFrameLoaderClient::createNetworkingContext):
2392         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
2393         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
2394         (WebKit::WebFrameNetworkingContext::storageSession const):
2395         * WebProcess/WebProcess.cpp:
2396         (WebKit::WebProcess::initializeProcess):
2397
2398 2018-03-26  Alex Christensen  <achristensen@webkit.org>
2399
2400         Merge ResourceHandleClient::willCacheResponseAsync with ResourceHandleClient::willCacheResponse
2401         https://bugs.webkit.org/show_bug.cgi?id=183965
2402
2403         Reviewed by Chris Dumez.
2404
2405         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2406         (WebKit::WebFrameLoaderClient::willCacheResponse const):
2407         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2408
2409 2018-03-25  Carlos Garcia Campos  <cgarcia@igalia.com>
2410
2411         [GTK][WPE] Add API to convert between DOM and JSCValue
2412         https://bugs.webkit.org/show_bug.cgi?id=183448
2413
2414         Reviewed by Michael Catanzaro.
2415
2416         Add methods to get a JSCValue for a WebKitDOMObject and to create a WebKitDOMNode from a JSCValue. Deprecate
2417         most of the GTK+ DOM bindings API and move the non-deprecated parts to glib dir to be exposed by WPE too.
2418
2419         * PlatformGTK.cmake:
2420         * PlatformWPE.cmake:
2421         * SourcesGTK.txt:
2422         * SourcesWPE.txt:
2423         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
2424         * WebProcess/InjectedBundle/API/glib/DOM/DOMObjectCache.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/DOMObjectCache.cpp.
2425         * WebProcess/InjectedBundle/API/glib/DOM/DOMObjectCache.h: Copied from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/DOMObjectCache.h.
2426         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMDocument.cpp: Added.
2427         (WebKit::kit):
2428         (WebKit::core):
2429         (WebKit::wrapDocument):
2430         (webkit_dom_document_class_init):
2431         (webkit_dom_document_init):
2432         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMDocumentPrivate.h: Copied from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentPrivate.h.
2433         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMElement.cpp: Added.
2434         (WebKit::kit):
2435         (WebKit::core):
2436         (WebKit::wrapElement):
2437         (webkit_dom_element_class_init):
2438         (webkit_dom_element_init):
2439         (webkit_dom_element_html_input_element_is_user_edited):
2440         (webkit_dom_element_html_input_element_get_auto_filled):
2441         (webkit_dom_element_html_input_element_set_auto_filled):
2442         (webkit_dom_element_html_input_element_set_editing_value):
2443         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMElementPrivate.h: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElementPrivate.h.
2444         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMNode.cpp: Added.
2445         (_WebKitDOMNodePrivate::~_WebKitDOMNodePrivate):
2446         (WebKit::kit):
2447         (WebKit::core):
2448         (WebKit::wrapNode):
2449         (webkitDOMNodeConstructor):
2450         (webkitDOMNodeFinalize):
2451         (webkit_dom_node_init):
2452         (webkit_dom_node_class_init):
2453         (webkitDOMNodeSetCoreObject):
2454         (webkitDOMNodeGetCoreObject):
2455         (webkit_dom_node_for_js_value):
2456         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMNodePrivate.h: Copied from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodePrivate.h.
2457         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMObject.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMObject.cpp.
2458         (webkitDOMObjectSetProperty):
2459         (webkit_dom_object_class_init):
2460         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMPrivate.cpp: Added.
2461         (WebKit::wrap):
2462         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMPrivate.h: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/DOMObjectCache.h.
2463         * WebProcess/InjectedBundle/API/glib/WebKitFrame.cpp:
2464         (webkit_frame_get_js_value_for_dom_object):
2465         (webkit_frame_get_js_value_for_dom_object_in_script_world):
2466         * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
2467         (webkit_web_page_class_init):
2468         (webkitWebPageCreate):
2469         (webkit_web_page_get_dom_document):
2470         * WebProcess/InjectedBundle/API/gtk/DOM/GObjectEventListener.cpp:
2471         (WebKit::GObjectEventListener::handleEvent):
2472         * WebProcess/InjectedBundle/API/gtk/DOM/GObjectNodeFilterCondition.cpp:
2473         * WebProcess/InjectedBundle/API/gtk/DOM/GObjectXPathNSResolver.cpp:
2474         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.cpp:
2475         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.h:
2476         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMBlob.cpp:
2477         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMBlob.h:
2478         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.cpp:
2479         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.h:
2480         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.cpp:
2481         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.h:
2482         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleList.cpp:
2483         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleList.h:
2484         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclaration.cpp:
2485         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclaration.h:
2486         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.cpp:
2487         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.h:
2488         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.cpp:
2489         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.h:
2490         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp:
2491         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.h:
2492         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.cpp:
2493         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.h:
2494         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp:
2495         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.h:
2496         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.cpp:
2497         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.h:
2498         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.cpp:
2499         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.h:
2500         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.cpp:
2501         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.h:
2502         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.cpp:
2503         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.h:
2504         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp:
2505         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.h:
2506         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp:
2507         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.h:
2508         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp:
2509         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.h:
2510         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp.
2511         (webkitDOMDocumentDOMEventTargetInit):
2512         (webkitDOMDocumentInstallProperties):
2513         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.cpp:
2514         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.h:
2515         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.h:
2516         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElementGtk.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp.
2517         (webkitDOMElementDOMEventTargetInit):
2518         (webkitDOMElementInstallProperties):
2519         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.cpp:
2520         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.h:
2521         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEventTarget.cpp:
2522         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEventTarget.h:
2523         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFile.cpp:
2524         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFile.h:
2525         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileList.cpp:
2526         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileList.h:
2527         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.cpp:
2528         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.h:
2529         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.cpp:
2530         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.h:
2531         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.cpp:
2532         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.h:
2533         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.cpp:
2534         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.h:
2535         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.cpp:
2536         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.h:
2537         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.cpp:
2538         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.h:
2539         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.cpp:
2540         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.h:
2541         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.cpp:
2542         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.h:
2543         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollection.cpp:
2544         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollection.h:
2545         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.cpp:
2546         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.h:
2547         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.cpp:
2548         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.h:
2549         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.cpp:
2550         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.h:
2551         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.cpp:
2552         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.h:
2553         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp:
2554         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.h:
2555         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.cpp:
2556         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.h:
2557         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.cpp:
2558         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.h:
2559         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.cpp:
2560         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.h:
2561         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.cpp:
2562         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.h:
2563         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.cpp:
2564         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.h:
2565         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.cpp:
2566         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.h:
2567         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.cpp:
2568         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.h:
2569         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.cpp:
2570         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.h:
2571         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.cpp:
2572         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.h:
2573         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.cpp:
2574         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.h:
2575         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.cpp:
2576         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.h:
2577         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.cpp:
2578         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.h:
2579         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
2580         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.h:
2581         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.cpp:
2582         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.h:
2583         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.cpp:
2584         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.h:
2585         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.cpp:
2586         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.h:
2587         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.cpp:
2588         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.h:
2589         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.cpp:
2590         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.h:
2591         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.cpp:
2592         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.h:
2593         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.cpp:
2594         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.h:
2595         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.cpp:
2596         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.h:
2597         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.cpp:
2598         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.h:
2599         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.cpp:
2600         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.h:
2601         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.cpp:
2602         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.h:
2603         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.cpp:
2604         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.h:
2605         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.cpp:
2606         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.h:
2607         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollection.cpp:
2608         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollection.h:
2609         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.cpp:
2610         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.h:
2611         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.cpp:
2612         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.h:
2613         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.cpp:
2614         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.h:
2615         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPrivate.cpp:
2616         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElement.cpp:
2617         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElement.h:
2618         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElement.cpp:
2619         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElement.h:
2620         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
2621         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.h:
2622         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElement.cpp:
2623         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElement.h:
2624         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElement.cpp:
2625         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElement.h:
2626         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.cpp:
2627         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.h:
2628         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElement.cpp:
2629         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElement.h:
2630         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.cpp:
2631         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.h:
2632         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.cpp:
2633         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.h:
2634         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.cpp:
2635         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.h:
2636         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.cpp:
2637         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.h:
2638         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElement.cpp:
2639         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElement.h:
2640         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElement.cpp:
2641         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElement.h:
2642         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMKeyboardEvent.cpp:
2643         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMKeyboardEvent.h:
2644         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.cpp:
2645         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.h:
2646         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMouseEvent.cpp:
2647         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMouseEvent.h:
2648         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.cpp:
2649         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.h:
2650         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNode.h:
2651         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeFilter.cpp:
2652         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeFilter.h:
2653         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeGtk.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNode.cpp.
2654         (webkitDOMNodeDOMEventTargetInit):
2655         (webkitDOMNodeInstallProperties):
2656         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIterator.cpp:
2657         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIterator.h:
2658         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeList.cpp:
2659         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeList.h:
2660         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMObject.h:
2661         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivateGtk.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivate.cpp.
2662         (WebKit::wrapNodeGtk):
2663         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivateGtk.h: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivate.h.
2664         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstruction.cpp:
2665         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstruction.h:
2666         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRange.cpp:
2667         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRange.h:
2668         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheet.cpp:
2669         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheet.h:
2670         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetList.cpp:
2671         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetList.h:
2672         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp:
2673         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.h:
2674         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalker.cpp:
2675         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalker.h:
2676         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMUIEvent.cpp:
2677         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMUIEvent.h:
2678         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEvent.cpp:
2679         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEvent.h:
2680         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathExpression.cpp:
2681         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathExpression.h:
2682         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathNSResolver.cpp:
2683         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathNSResolver.h:
2684         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResult.cpp:
2685         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResult.h:
2686         * WebProcess/InjectedBundle/API/gtk/DOM/docs/webkitdomgtk-4.0-sections.txt:
2687         * WebProcess/InjectedBundle/API/gtk/WebKitFrame.h:
2688         * WebProcess/InjectedBundle/API/wpe/DOM/WebKitDOMDefines.h: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentPrivate.h.
2689         * WebProcess/InjectedBundle/API/wpe/DOM/WebKitDOMDocument.h: Added.
2690         * WebProcess/InjectedBundle/API/wpe/DOM/WebKitDOMElement.h: Added.
2691         * WebProcess/InjectedBundle/API/wpe/DOM/WebKitDOMNode.h: Added.
2692         * WebProcess/InjectedBundle/API/wpe/DOM/WebKitDOMObject.h: Copied from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMObject.h.
2693         * WebProcess/InjectedBundle/API/wpe/DOM/webkitdom.h: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodePrivate.h.
2694         * WebProcess/InjectedBundle/API/wpe/WebKitFrame.h:
2695         * WebProcess/InjectedBundle/API/wpe/WebKitWebHitTestResult.h: Added.
2696         * WebProcess/InjectedBundle/API/wpe/WebKitWebPage.h:
2697         * WebProcess/InjectedBundle/API/wpe/WebKitWebProcessEnumTypes.cpp.template: Added.
2698         * WebProcess/InjectedBundle/API/wpe/WebKitWebProcessEnumTypes.h.template: Copied from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMObjectPrivate.h.
2699         * WebProcess/InjectedBundle/API/wpe/webkit-web-extension.h:
2700
2701 2018-03-26  Zan Dobersek  <zdobersek@igalia.com>
2702
2703         [CoordGraphics] Clean up CoordinatedGraphicsScene construct-time initializations
2704         https://bugs.webkit.org/show_bug.cgi?id=184002
2705
2706         Reviewed by Carlos Garcia Campos.
2707
2708         Move the CoordinatedGraphicsScene constant-expression initializations
2709         from constructor to the point of declaration.
2710
2711         Default the CoordinatedGraphicsScene destructor.
2712
2713         The m_scrollPosition member variable is unused in this class, while the
2714         similarly-named m_renderedContentsScrollPosition tracks scroll position
2715         of the scene. Remove the latter and use m_scrollPosition in its place.
2716
2717         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
2718         (WebKit::CoordinatedGraphicsScene::CoordinatedGraphicsScene):
2719         (WebKit::CoordinatedGraphicsScene::adjustPositionForFixedLayers):
2720         (WebKit::CoordinatedGraphicsScene::commitSceneState):
2721         (WebKit::CoordinatedGraphicsScene::~CoordinatedGraphicsScene): Deleted.
2722         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
2723
2724 2018-03-25  Michael Catanzaro  <mcatanzaro@igalia.com>
2725
2726         [GTK] WebKitWebProcessEnumTypes.h missing from webkit-web-extension.h
2727         https://bugs.webkit.org/show_bug.cgi?id=183998
2728
2729         Reviewed by Carlos Garcia Campos.
2730
2731         * WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h:
2732
2733 2018-03-25  Carlos Garcia Campos  <cgarcia@igalia.com>
2734
2735         [GTK] Unresolved type warnings when generating gir
2736         https://bugs.webkit.org/show_bug.cgi?id=183926
2737
2738         Reviewed by Michael Catanzaro.
2739
2740         Skip deprecated functions using JSC C API from introspection.
2741
2742         * UIProcess/API/glib/WebKitJavascriptResult.cpp:
2743         * UIProcess/API/glib/WebKitWebView.cpp:
2744         * WebProcess/InjectedBundle/API/glib/WebKitFrame.cpp:
2745
2746 2018-03-25  Commit Queue  <commit-queue@webkit.org>
2747
2748         Unreviewed, rolling out r229954.
2749         https://bugs.webkit.org/show_bug.cgi?id=184000
2750
2751         Caused many layout tests to crash on Apple High Sierra,
2752         Sierra, iOS Simulator and GTK Linux Debug test bots (Requested
2753         by dydz on #webkit).
2754
2755         Reverted changeset:
2756
2757         "Use SecurityOriginData more consistently in Service Worker
2758         code"
2759         https://bugs.webkit.org/show_bug.cgi?id=183969
2760         https://trac.webkit.org/changeset/229954
2761
2762 2018-03-23  Brian Burg  <bburg@apple.com>
2763
2764         Web Automation: remove unnecessary member variable WebAutomationSession
2765         https://bugs.webkit.org/show_bug.cgi?id=183971
2766
2767         Reviewed by Timothy Hatcher.
2768
2769         The concept of the "active" browsing context is something in the WebDriver
2770         specification, but we were a bit too literal when first implementing this.
2771         There's no actual need for this on the browser side since most commands
2772         require implicitly switching to the target window passed in with the
2773         Automation command. The driver, however, still needs to track the current
2774         browsing context and current top-level browsing context.
2775
2776         For returning whether a browsing context is active,  we can just look at
2777         the page's activity state to know whether the page is active or not. For
2778         a normal browser, only one page is going to be visible and focused at a time.
2779
2780         * UIProcess/Automation/WebAutomationSession.h:
2781         * UIProcess/Automation/WebAutomationSession.cpp:
2782         (WebKit::WebAutomationSession::buildBrowsingContextForPage):
2783         Consult the page's activity state to determine whether it's active.
2784
2785         (WebKit::WebAutomationSession::createBrowsingContext):
2786         (WebKit::WebAutomationSession::closeBrowsingContext):
2787         (WebKit::WebAutomationSession::switchToBrowsingContext):
2788         (WebKit::WebAutomationSession::handleRunOpenPanel):
2789         Stop reading and writing the current browsing context handle.
2790
2791         * UIProcess/WebPageProxy.h:
2792         (WebKit::WebPageProxy::isViewFocused const):
2793         (WebKit::WebPageProxy::isViewWindowActive const):
2794         Add new accessor.
2795
2796 2018-03-25  Tim Horton  <timothy_horton@apple.com>
2797
2798         Add and adopt ENABLE(AIRPLAY_PICKER)
2799         https://bugs.webkit.org/show_bug.cgi?id=183992
2800
2801         Reviewed by Daniel Bates.
2802
2803         * UIProcess/ios/WKContentViewInteraction.h:
2804         * UIProcess/ios/WKContentViewInteraction.mm:
2805         (-[WKContentView _showPlaybackTargetPicker:fromRect:]):
2806         * UIProcess/ios/forms/WKAirPlayRoutePicker.h:
2807         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
2808
2809 2018-03-25  Tim Horton  <timothy_horton@apple.com>
2810
2811         Move WKAnimationDelegate to its own header
2812         https://bugs.webkit.org/show_bug.cgi?id=183976
2813         <rdar://problem/38822299>
2814
2815         Reviewed by Dan Bernstein.
2816
2817         * Shared/RemoteLayerTree/WKAnimationDelegate.h: Added.
2818         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
2819         * WebKit.xcodeproj/project.pbxproj:
2820         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
2821         RemoteLayerTreeHost uses a forward declaration of WKAnimationDelegate,
2822         so we're just getting lucky that an -invalidate method exists on
2823         some other object. Instead, move WKAnimationDelegate to its own
2824         header, and include it in the places we use it.
2825
2826 2018-03-24  Tim Horton  <timothy_horton@apple.com>
2827
2828         Adopt WK_PLATFORM_NAME in WebKit
2829         https://bugs.webkit.org/show_bug.cgi?id=183978
2830
2831         Reviewed by Dan Bernstein.
2832
2833         * Configurations/WebKit.xcconfig:
2834         * WebKit.xcodeproj/project.pbxproj:
2835         * mac/MigrateHeadersFromWebKitLegacy.make:
2836         * mac/postprocess-framework-headers.sh:
2837
2838 2018-03-24  Tim Horton  <timothy_horton@apple.com>
2839
2840         Ignore sandbox_init_with_parameters deprecation warnings
2841         https://bugs.webkit.org/show_bug.cgi?id=183979
2842
2843         Reviewed by Dan Bernstein.
2844
2845         * Shared/ios/ChildProcessIOS.mm:
2846         (WebKit::ChildProcess::initializeSandbox):
2847
2848 2018-03-24  Chris Dumez  <cdumez@apple.com>
2849
2850         Use SecurityOriginData more consistently in Service Worker code
2851         https://bugs.webkit.org/show_bug.cgi?id=183969
2852
2853         Reviewed by Darin Adler.
2854
2855         Use SecurityOriginData more consistently in Service Worker code to avoid constructing
2856         SecurityOrigin objects unnecessarily.
2857
2858         * NetworkProcess/NetworkResourceLoadParameters.cpp:
2859         (WebKit::NetworkResourceLoadParameters::encode const):
2860         * Shared/API/c/WKSecurityOriginRef.cpp:
2861         (WKSecurityOriginCopyDatabaseIdentifier):
2862         * StorageProcess/ServiceWorker/WebSWOriginStore.cpp:
2863         (WebKit::WebSWOriginStore::addToStore):
2864         (WebKit::WebSWOriginStore::removeFromStore):
2865         * StorageProcess/ServiceWorker/WebSWOriginStore.h:
2866         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2867         (WebKit::WebSWServerConnection::scheduleJobInServer):
2868         (WebKit::WebSWServerConnection::registerServiceWorkerClient):
2869         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
2870         (WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
2871         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
2872         * StorageProcess/StorageProcess.cpp:
2873         (WebKit::StorageProcess::connectionToContextProcessWasClosed):
2874         (WebKit::StorageProcess::needsServerToContextConnectionForOrigin const):
2875         (WebKit::StorageProcess::createStorageToWebProcessConnection):
2876         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
2877         (WebKit::StorageProcess::serverToContextConnectionForOrigin):
2878         (WebKit::StorageProcess::createServerToContextConnection):
2879         (WebKit::StorageProcess::swContextConnectionMayNoLongerBeNeeded):
2880         * StorageProcess/StorageProcess.h:
2881         * UIProcess/API/APIFrameInfo.cpp:
2882         (API::FrameInfo::create):
2883         * UIProcess/API/C/WKApplicationCacheManager.cpp:
2884         (WKApplicationCacheManagerDeleteEntriesForOrigin):
2885         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
2886         (WKKeyValueStorageManagerDeleteEntriesForOrigin):
2887         * UIProcess/API/C/WKResourceCacheManager.cpp:
2888         (WKResourceCacheManagerClearCacheForOrigin):
2889         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2890         (WKWebsiteDataStoreRemoveFetchCacheForOrigin):
2891         (WKWebsiteDataStoreGetFetchCacheSizeForOrigin):
2892         * UIProcess/ServiceWorkerProcessProxy.cpp:
2893         (WebKit::ServiceWorkerProcessProxy::create):
2894         (WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
2895         (WebKit::ServiceWorkerProcessProxy::getLaunchOptions):
2896         * UIProcess/ServiceWorkerProcessProxy.h:
2897         * UIProcess/Storage/StorageProcessProxy.cpp:
2898         (WebKit::StorageProcessProxy::getStorageProcessConnection):
2899         * UIProcess/WebProcessPool.cpp:
2900         (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
2901         (WebKit::WebProcessPool::disconnectProcess):
2902         (WebKit::WebProcessPool::updateProcessAssertions):
2903         * UIProcess/WebProcessPool.h:
2904         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2905         (WebKit::WebsiteDataStore::fetchDataAndApply):
2906         * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
2907         (WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation):
2908         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2909         (WKBundlePageCopyOriginsWithApplicationCache):
2910         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
2911         (WebKit::UserMediaPermissionRequestManager::sendUserMediaRequest):
2912         (WebKit::UserMediaPermissionRequestManager::enumerateMediaDevices):
2913         * WebProcess/Storage/WebSWClientConnection.cpp:
2914         (WebKit::WebSWClientConnection::registerServiceWorkerClient):
2915         (WebKit::WebSWClientConnection::matchRegistration):
2916         (WebKit::WebSWClientConnection::whenRegistrationReady):
2917         (WebKit::WebSWClientConnection::getRegistrations):
2918         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2919         (WebKit::WebChromeClient::exceededDatabaseQuota):
2920         (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
2921         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2922         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2923         * WebProcess/WebProcess.cpp:
2924         (WebKit::WebProcess::fetchWebsiteData):
2925         * WebProcess/WebStorage/StorageAreaImpl.cpp:
2926         (WebKit::StorageAreaImpl::securityOrigin const):
2927         * WebProcess/WebStorage/StorageAreaImpl.h:
2928         * WebProcess/WebStorage/StorageAreaMap.cpp:
2929         (WebKit::StorageAreaMap::StorageAreaMap):
2930         (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
2931         (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
2932         * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
2933         (WebKit::StorageNamespaceImpl::didDestroyStorageAreaMap):
2934
2935 2018-03-24  Tim Horton  <timothy_horton@apple.com>
2936
2937         Fix the !ENABLE(MEDIA_STREAM) build
2938         https://bugs.webkit.org/show_bug.cgi?id=183977
2939
2940         Reviewed by Wenson Hsieh.
2941
2942         * UIProcess/Cocoa/UIDelegate.mm:
2943         (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
2944         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
2945         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2946         * WebProcess/cocoa/UserMediaCaptureManager.messages.in:
2947
2948 2018-03-24  Tim Horton  <timothy_horton@apple.com>
2949
2950         WKFileUploadPanel shouldn't depend on WebKitLegacy
2951         https://bugs.webkit.org/show_bug.cgi?id=183981
2952
2953         Reviewed by Wenson Hsieh.
2954
2955         * UIProcess/ios/forms/WKFileUploadPanel.mm:
2956         (-[WKFileUploadPanel _uploadItemForImageData:imageName:successBlock:failureBlock:]):
2957         Just use the underlying WebCore function instead of the
2958         unnecessary NSFileManager category method.
2959
2960 2018-03-23  Tim Horton  <timothy_horton@apple.com>
2961
2962         Fix the build with no pasteboard
2963         https://bugs.webkit.org/show_bug.cgi?id=183973
2964
2965         Reviewed by Dan Bernstein.
2966
2967         * Configurations/FeatureDefines.xcconfig:
2968
2969 2018-03-23  Megan Gardner  <megan_gardner@apple.com>
2970
2971         Enable unified text selection in select cases for gradual testing
2972         https://bugs.webkit.org/show_bug.cgi?id=183967
2973         <rdar://problem/38815328>
2974
2975         Reviewed by Tim Horton.
2976         
2977         Enable in select places for a more gradual switch, as this is a big change and we want to make sure
2978         it works before switching completely.
2979
2980         * UIProcess/ios/WKContentViewInteraction.mm:
2981         (-[WKContentView useSelectionAssistantWithGranularity:]):
2982
2983 2018-03-23  John Wilander  <wilander@apple.com>
2984
2985         Resource Load Statistics: Pick up ITP debug mode flag from defaults
2986         https://bugs.webkit.org/show_bug.cgi?id=183956
2987         <rdar://problem/38559574>
2988
2989         Reviewed by Brent Fulgham.
2990
2991         * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
2992         (WebKit::WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded):
2993
2994 2018-03-23  Wenson Hsieh  <wenson_hsieh@apple.com>
2995
2996         [Extra zoom mode] Adopt list view controller UI for select menus
2997         https://bugs.webkit.org/show_bug.cgi?id=183944
2998         <rdar://problem/38799062>
2999
3000         Reviewed by Tim Horton.
3001
3002         Move UIProcess/WKSelectMenuListViewController.* to UIProcess/ios/forms, where it was intended to go.
3003
3004         * UIProcess/ios/forms/WKSelectMenuListViewController.h: Renamed from Source/WebKit/UIProcess/WKSelectMenuListViewController.h.
3005         * UIProcess/ios/forms/WKSelectMenuListViewController.mm: Renamed from Source/WebKit/UIProcess/WKSelectMenuListViewController.mm.
3006         * WebKit.xcodeproj/project.pbxproj:
3007
3008 2018-03-23  Chris Dumez  <cdumez@apple.com>
3009
3010         Promptly terminate service worker processes when they are no longer needed
3011         https://bugs.webkit.org/show_bug.cgi?id=183873
3012         <rdar://problem/38676995>
3013
3014         Reviewed by Youenn Fablet.
3015
3016         The StorageProcess now keeps track of service worker clients for each security
3017         origin. When there is no longer any clients for a given security origin, the
3018         StorageProcess asks the service worker process for the given origin to terminate
3019         and severs its connection to it.
3020
3021         * Shared/Storage/StorageProcessCreationParameters.h:
3022         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
3023         (WebKit::WebSWServerToContextConnection::connectionMayNoLongerBeNeeded):
3024         (WebKit::WebSWServerToContextConnection::terminate):
3025         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
3026         * StorageProcess/StorageProcess.cpp:
3027         (WebKit::StorageProcess::connectionToContextProcessWasClosed):
3028         (WebKit::StorageProcess::needsServerToContextConnectionForOrigin const):
3029         (WebKit::StorageProcess::initializeWebsiteDataStore):
3030         (WebKit::StorageProcess::swServerForSession):
3031         (WebKit::StorageProcess::swContextConnectionMayNoLongerBeNeeded):
3032         (WebKit::StorageProcess::disableServiceWorkerProcessTerminationDelay):
3033         * StorageProcess/StorageProcess.h:
3034         * StorageProcess/StorageProcess.messages.in:
3035         * UIProcess/API/Cocoa/WKProcessPool.mm:
3036         (-[WKProcessPool _disableServiceWorkerProcessTerminationDelay]):
3037         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
3038         * UIProcess/WebProcessPool.cpp:
3039         (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
3040         (WebKit::WebProcessPool::disableServiceWorkerProcessTerminationDelay):
3041         * UIProcess/WebProcessPool.h:
3042         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
3043         (WebKit::WebSWContextManagerConnection::terminateProcess):
3044         * WebProcess/Storage/WebSWContextManagerConnection.h:
3045         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
3046
3047 2018-03-23  Brady Eidson  <beidson@apple.com>
3048
3049         Go to back/forward list items after a process-swapped navigation.
3050         <rdar://problem/38690544> and https://bugs.webkit.org/show_bug.cgi?id=183920
3051
3052         Reviewed by Andy Estes.
3053
3054         This takes the initial work of "process swap a normal navigation" and extends it to
3055         process swapping for back/forward item navigations.
3056
3057         * Scripts/webkit/messages.py:
3058
3059         Make sure state objects are serialized to the UI Process back/forward list items, as otherwise
3060         they will be lost in process-swap scenarios:
3061         * Shared/SessionState.cpp:
3062         (WebKit::PageState::encode const):
3063         (WebKit::PageState::decode):
3064         * Shared/SessionState.h:
3065
3066         Make a new variant of APINavigation specifically for back/forward list items.
3067         * UIProcess/API/APINavigation.cpp:
3068         (API::Navigation::Navigation):
3069         (API::Navigation::loggingURL const):
3070         * UIProcess/API/APINavigation.h:
3071         (API::Navigation::create):
3072         (API::Navigation::backForwardListItem):
3073         (API::Navigation::backForwardFrameLoadType const):
3074
3075         * UIProcess/API/C/WKPage.cpp:
3076         (WKPageGoToBackForwardListItem):
3077
3078         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
3079         (-[WKBrowsingContextController goToBackForwardListItem:]):
3080
3081         * UIProcess/API/Cocoa/WKWebView.mm:
3082         (-[WKWebView goToBackForwardListItem:]):
3083
3084         * UIProcess/WebNavigationState.cpp:
3085         (WebKit::WebNavigationState::createLoadRequestNavigation):
3086         (WebKit::WebNavigationState::createBackForwardNavigation):
3087         * UIProcess/WebNavigationState.h:
3088
3089         * UIProcess/WebPageProxy.cpp:
3090         (WebKit::WebPageProxy::reattachToWebProcessForReload):
3091         (WebKit::WebPageProxy::reattachToWebProcessWithItem):
3092         (WebKit::WebPageProxy::goForward):
3093         (WebKit::WebPageProxy::goBack):
3094         (WebKit::WebPageProxy::goToBackForwardItem):
3095         (WebKit::WebPageProxy::receivedPolicyDecision):
3096         (WebKit::WebPageProxy::continueNavigationInNewProcess): Handle back/forward navigations differently than others.
3097         (WebKit::WebPageProxy::restoreFromSessionState):
3098         * UIProcess/WebPageProxy.h:
3099
3100         * UIProcess/WebProcessProxy.cpp:
3101         (WebKit::WebProcessProxy::addOrUpdateBackForwardItem): Renamed from "addBackForwardItem" for clarity
3102         (WebKit::WebProcessProxy::addBackForwardItem): Deleted.
3103         * UIProcess/WebProcessProxy.h:
3104         * UIProcess/WebProcessProxy.messages.in:
3105
3106         * UIProcess/ios/ViewGestureControllerIOS.mm:
3107         (WebKit::ViewGestureController::endSwipeGesture):
3108
3109         * UIProcess/mac/ViewGestureControllerMac.mm:
3110         (WebKit::ViewGestureController::endSwipeGesture):
3111
3112         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
3113         (WebKit::toPageState):
3114         (WebKit::toHistoryItem):
3115
3116         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
3117         (WebKit::updateBackForwardItem):
3118
3119         * WebProcess/WebPage/WebPage.cpp:
3120         (WebKit::WebPage::goToBackForwardItem): Combined "goBack" and "goForward" with this method,
3121           passing the appropriate FrameLoadType around as needed to remember the specific type.
3122         (WebKit::WebPage::goForward): Deleted.
3123         (WebKit::WebPage::goBack): Deleted.
3124         * WebProcess/WebPage/WebPage.h:
3125         * WebProcess/WebPage/WebPage.messages.in:
3126
3127 2018-03-23  Megan Gardner  <megan_gardner@apple.com>
3128
3129         Don't use the presence of a textSelectionAssistant as a proxy for if we are in content editable.
3130         https://bugs.webkit.org/show_bug.cgi?id=183804
3131
3132         Reviewed by Tim Horton.
3133
3134         We need to stop using the presence of a textSelectionAssistant as a proxy for if we are selecting in a content editable
3135         or not. As we are planning on switching to only using a textSelectionAssistant for selection, these checks need to 
3136         be more direct in checking what we actually need to know i.e. are we selecting in a content editable.
3137
3138         * Platform/spi/ios/UIKitSPI.h:
3139         * UIProcess/ios/WKContentViewInteraction.mm:
3140         (hasAssistedNode):
3141         (-[WKContentView inputView]):
3142         (-[WKContentView _selectionClipRect]):
3143         (-[WKContentView gestureRecognizer:canBePreventedByGestureRecognizer:]):
3144         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
3145         (-[WKContentView gestureRecognizerShouldBegin:]):
3146         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
3147         (-[WKContentView webSelectionRects]):
3148         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
3149         (-[WKContentView _autofillContext]):
3150
3151 2018-03-23  Youenn Fablet  <youenn@apple.com>
3152
3153         WebProcessPool should not ask to register all clients for each service worker process creation
3154         https://bugs.webkit.org/show_bug.cgi?id=183941
3155
3156         Reviewed by Chris Dumez.
3157
3158         Call registerServiceWorkerClients when there is no service worker process.
3159         Update service worker clients to register all of them no matter the session ID.
3160
3161         * UIProcess/WebProcessPool.cpp:
3162         (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
3163         * WebProcess/WebProcess.cpp:
3164         (WebKit::WebProcess::registerServiceWorkerClients):
3165         * WebProcess/WebProcess.h:
3166         * WebProcess/WebProcess.messages.in:
3167
3168 2018-03-23  Wenson Hsieh  <wenson_hsieh@apple.com>
3169
3170         [Extra zoom mode] Adopt list view controller UI for select menus
3171         https://bugs.webkit.org/show_bug.cgi?id=183944
3172         <rdar://problem/38799062>
3173
3174         Reviewed by Andy Estes.
3175
3176         Rename WKSelectMenuViewController to WKSelectMenuListViewController, and also rename the relevant
3177         WebKitAdditions harness files. See corresponding changes for more details.
3178
3179         * UIProcess/WKSelectMenuListViewController.h: Renamed from Source/WebKit/UIProcess/ios/forms/WKSelectMenuViewController.h.
3180         * UIProcess/WKSelectMenuListViewController.mm: Renamed from Source/WebKit/UIProcess/ios/forms/WKSelectMenuViewController.mm.
3181         * UIProcess/ios/WKContentViewInteraction.h:
3182         * UIProcess/ios/WKContentViewInteraction.mm:
3183         (-[WKContentView presentSelectMenuViewController:]):
3184         (-[WKContentView dismissSelectMenuViewController:]):
3185         (-[WKContentView selectMenu:didSelectItemAtIndex:]):
3186         (-[WKContentView numberOfItemsInSelectMenu:]):
3187         (-[WKContentView selectMenu:displayTextForItemAtIndex:]):
3188         (-[WKContentView selectMenu:didCheckItemAtIndex:checked:]):
3189         (-[WKContentView selectMenuUsesMultipleSelection:]):
3190         (-[WKContentView selectMenu:hasSelectedOptionAtIndex:]):
3191         (-[WKContentView _wheelChangedWithEvent:]):
3192
3193         Overriding wheel events and re-dispatching them is no longer needed after r229437, so we can just remove special
3194         handling for select menus here.
3195
3196         (-[WKContentView didCancelSelectionInSelectMenu:]): Deleted.
3197         (-[WKContentView selectMenuSupportsMultipleSelection:]): Deleted.
3198         (-[WKContentView selectMenu:hasCheckedOptionAtIndex:]): Deleted.
3199         (-[WKContentView startingIndexForSelectMenu:]): Deleted.
3200
3201         The starting index for a select menu is no longer relevant when using list view controllers for input, so we can
3202         just remove this delegate hook altogether.
3203
3204         * WebKit.xcodeproj/project.pbxproj:
3205
3206 2018-03-23  Youenn Fablet  <youenn@apple.com>
3207
3208         CacheStorage::Caches should clear m_caches when clearing its representation even though it is not yet initialized
3209         https://bugs.webkit.org/show_bug.cgi?id=183945
3210
3211         Reviewed by Chris Dumez.
3212
3213         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
3214         (WebKit::CacheStorage::Caches::clearMemoryRepresentation):
3215         In case we clear Caches in the middle of the initialization, m_caches might not be empty
3216         but m_isInitialized is not yet set to true since we are computing the Caches size.
3217         Update the assertion and clear m_caches in that case.
3218
3219 2018-03-23  David Kilzer  <ddkilzer@apple.com>
3220
3221         Stop using dispatch_set_target_queue()
3222         <https://webkit.org/b/183908>
3223         <rdar://problem/33553533>
3224
3225         Reviewed by Daniel Bates.
3226
3227         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
3228         (WebKit::NetworkCache::IOChannel::IOChannel): Remove the call to
3229         dispatch_set_target_queue() since this is handled in the
3230         dispatch_io_create() call above.
3231
3232 2018-03-23  Youenn Fablet  <youenn@apple.com>
3233
3234         CacheStorage::Engine should not ref itself when hopping to a background thread
3235         https://bugs.webkit.org/show_bug.cgi?id=183925
3236         <rdar://problem/38580483>
3237
3238         Reviewed by Chris Dumez.
3239
3240         Add support for weak pointers to CacheStorage Engine.
3241         Use weak pointer when hopping to background threads.
3242         Store callbacks in CacheStorage::Engine maps to keep them being destroyed in the main thread only.
3243         Made some callbacks CompletionHandler as a bonus.
3244
3245         Made sure to use just one Engine for all private sessions.
3246
3247         * NetworkProcess/cache/CacheStorageEngine.cpp:
3248         (WebKit::CacheStorage::Engine::~Engine):
3249         (WebKit::CacheStorage::Engine::from):
3250         (WebKit::CacheStorage::Engine::initialize):
3251         (WebKit::CacheStorage::Engine::writeFile):
3252         (WebKit::CacheStorage::Engine::readFile):
3253         * NetworkProcess/cache/CacheStorageEngine.h:
3254         (WebKit::CacheStorage::Engine::weakPtrFactory):
3255
3256 2018-03-23  Ryan Haddad  <ryanhaddad@apple.com>
3257
3258         Unreviewed build fix.
3259
3260         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3261
3262 2018-03-23  Miguel Gomez  <magomez@igalia.com>
3263
3264         [GTK][WPE] Avoid software color conversion inside BitmapTextureGL
3265         https://bugs.webkit.org/show_bug.cgi?id=183892
3266
3267         Remove the UpdateContentsFlag parameter when calling BitmapTexture::updateContents().
3268
3269         Reviewed by Žan Doberšek.
3270
3271         * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
3272         (WebKit::CoordinatedBackingStoreTile::swapBuffers):
3273
3274 2018-03-23  Michael Catanzaro  <mcatanzaro@igalia.com>
3275
3276         [WPE][GTK] Fix -Wswitch warnings after r229778
3277         https://bugs.webkit.org/show_bug.cgi?id=183927
3278
3279         Reviewed by Carlos Garcia Campos.
3280
3281         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
3282         (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse): Log a warning if Suspend is
3283         received as a PolicyAction
3284         * UIProcess/API/glib/WebKitNavigationClient.cpp: Ignore the ProcessSwap termination reason,
3285         which should be invisible to WebKit clients
3286
3287 2018-03-22  Chris Dumez  <cdumez@apple.com>
3288
3289         Include security origin in the service worker process name
3290         https://bugs.webkit.org/show_bug.cgi?id=183913
3291
3292         Reviewed by Youenn Fablet.
3293
3294         Include security origin in the service worker process name to facilitate debugging. This way, we
3295         can differentiate which service worker process is used for which origin in activity monitor.
3296
3297         * Shared/ChildProcess.h:
3298         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
3299         (WebKit::XPCServiceInitializerDelegate::getExtraInitializationData):
3300         * UIProcess/ServiceWorkerProcessProxy.cpp:
3301         (WebKit::ServiceWorkerProcessProxy::getLaunchOptions):
3302         * WebProcess/cocoa/WebProcessCocoa.mm:
3303         (WebKit::WebProcess::initializeProcessName):
3304
3305 2018-03-22  Michael Catanzaro  <mcatanzaro@igalia.com>
3306
3307         Unreviewed, silence unused variable warning
3308
3309         * UIProcess/WebPageProxy.cpp:
3310         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
3311
3312 2018-03-22  Dan Bernstein  <mitz@apple.com>
3313
3314         WKWebView doesn’t expose its spellCheckerDocumentTag
3315         https://bugs.webkit.org/show_bug.cgi?id=183797
3316         <rdar://problem/38678089>
3317
3318         Reviewed by Tim Horton.
3319
3320         * UIProcess/API/Cocoa/WKWebView.mm:
3321         (-[WKWebView _spellCheckerDocumentTag]): Added this getter which calls through to the WebViewImpl.
3322         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared _spellCheckerDocumentTag property.
3323
3324 2018-03-22  Chris Dumez  <cdumez@apple.com>
3325
3326         Use the same SWServer for all ephemeral sessions
3327         https://bugs.webkit.org/show_bug.cgi?id=183921
3328         <rdar://problem/36873075>
3329
3330         Reviewed by Youenn Fablet.
3331
3332         Use the same SWServer for all ephemeral sessions. SWServers never go away and we create
3333         one per sessionID. When browsing doing private browsing in Safari (and other fetching
3334         favorite icons), the sessionID is ephemeral and keeps changing. This means that we kept
3335         constructing new SWServers that would never go away. Each SWServer has a thread so we
3336         would eventually hit the thread limit for the storage process.
3337
3338         * StorageProcess/StorageProcess.cpp:
3339         (WebKit::StorageProcess::swServerForSession):
3340
3341 2018-03-22  Michael Catanzaro  <mcatanzaro@igalia.com>
3342
3343         Unreviewed, fix format string warnings in service worker code
3344
3345         On Linux x86_64, uint64_t is unsigned long, not unsigned long long.
3346
3347         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3348         (WebKit::WebSWServerConnection::startFetch):
3349         (WebKit::WebSWServerConnection::didFinishFetch):
3350         (WebKit::WebSWServerConnection::didFailFetch):
3351         (WebKit::WebSWServerConnection::didNotHandleFetch):
3352
3353 2018-03-22  Daniel Bates  <dabates@apple.com>
3354
3355         Expose SchemeRegistry::registerAsCanDisplayOnlyIfCanRequest() as WebKit SPI
3356         https://bugs.webkit.org/show_bug.cgi?id=183907
3357         <rdar://problem/38759127>
3358
3359         Reviewed by Alex Christensen.
3360
3361         Adds both modern Objective-C SPI and C SPI to allow an embedding client to register a scheme
3362         whose content should be displayed/loaded if and only if it can be requested. Disregarding an
3363         app that enables universal access, by using this SPI WebKit will refuse to display cross-origin
3364         content for the registered schemes.
3365
3366         We need to add C SPI for embedding clients that have not transitioned to the modern Objective-
3367         C API/SPI.
3368
3369         * Shared/WebProcessCreationParameters.cpp:
3370         (WebKit::WebProcessCreationParameters::encode const):
3371         (WebKit::WebProcessCreationParameters::decode):
3372         * Shared/WebProcessCreationParameters.h:
3373         * UIProcess/API/C/WKContext.cpp:
3374         (WKContextRegisterURLSchemeAsCanDisplayOnlyIfCanRequest):
3375         * UIProcess/API/C/WKContextPrivate.h:
3376         * UIProcess/API/Cocoa/WKProcessPool.mm:
3377         (-[WKProcessPool _registerURLSchemeAsCanDisplayOnlyIfCanRequest:]):
3378         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
3379         * UIProcess/WebProcessPool.cpp:
3380         (WebKit::WebProcessPool::initializeNewWebProcess):
3381         (WebKit::WebProcessPool::registerURLSchemeAsCanDisplayOnlyIfCanRequest):
3382         * UIProcess/WebProcessPool.h:
3383         * WebProcess/WebProcess.cpp:
3384         (WebKit::WebProcess::initializeWebProcess):
3385         (WebKit::WebProcess::registerURLSchemeAsCanDisplayOnlyIfCanRequest const):
3386         * WebProcess/WebProcess.h:
3387         * WebProcess/WebProcess.messages.in:
3388
3389 2018-03-22  Tim Horton  <timothy_horton@apple.com>
3390
3391         Improve readability of WebCore's OTHER_LDFLAGS
3392         https://bugs.webkit.org/show_bug.cgi?id=183909
3393         <rdar://problem/38760992>
3394
3395         Reviewed by Dan Bernstein.
3396
3397         * Configurations/Base.xcconfig:
3398         * Configurations/FeatureDefines.xcconfig:
3399
3400 2018-03-22  Zan Dobersek  <zdobersek@igalia.com>
3401
3402         [TexMap] Make TextureMapperContextAttributes thread-specific
3403         https://bugs.webkit.org/show_bug.cgi?id=183895
3404
3405         Reviewed by Carlos Garcia Campos.
3406
3407         CoordinatedGraphicsScene, as an implementor of the
3408         TextureMapperPlatformLayerProxy::Compositor interface, doesn't have to
3409         implement the texmapGL() method anymore.
3410
3411         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
3412         (WebKit::CoordinatedGraphicsScene::onNewBufferAvailable):
3413         (WebKit::CoordinatedGraphicsScene::texmapGL): Deleted.
3414         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
3415
3416 2018-03-21  Frederic Wang  <fwang@igalia.com>
3417
3418         Unreviewed, update comment added in r229801.
3419
3420         * WebProcess/WebPage/ios/FindControllerIOS.mm:
3421         (WebKit::FindController::didFindString): Remove "On Mobile" and mention bug 183889.
3422
3423 2018-03-21  Chris Dumez  <cdumez@apple.com>
3424
3425         Regression(r229831): ProcessSwap.Basic API test is crashing
3426         https://bugs.webkit.org/show_bug.cgi?id=183884
3427
3428         Reviewed by Brady Eidson.
3429
3430         This code should only be called for navigation policy decisions.
3431         It used to work without this check because of an early return, which
3432         was dropped in r229831.
3433
3434         * UIProcess/WebPageProxy.cpp:
3435         (WebKit::WebPageProxy::receivedPolicyDecision):
3436
3437 2018-03-21  Wenson Hsieh  <wenson_hsieh@apple.com>
3438
3439         [Extra zoom mode] Add new SPI hooks for clients to vend an input session context view
3440         https://bugs.webkit.org/show_bug.cgi?id=183866
3441         <rdar://problem/38692256>
3442
3443         Reviewed by Tim Horton.
3444
3445         Add new SPI hooks to _WKInputDelegate allowing internal clients to provide a view that gives additional context
3446         when editing form controls, on top of the default label or placeholder text displayed by WebKit. The height
3447         delegate is invoked first, giving the client an opportunity to lay out the context view to fit the given size;
3448         the actual view is then queried.
3449
3450         If the view changes, clients may tell WebKit to reload the context view via SPI on WKFormInputSession; this call
3451         to reload is plumbed through to the currently presented list view controller (at the moment, this is only the
3452         text input list view controller).
3453
3454         * UIProcess/API/Cocoa/_WKFormInputSession.h:
3455         * UIProcess/API/Cocoa/_WKInputDelegate.h:
3456
3457         Add the new SPI hooks, described above.
3458
3459         * UIProcess/ios/WKContentViewInteraction.h:
3460         * UIProcess/ios/WKContentViewInteraction.mm:
3461         (-[WKFormInputSession reloadFocusedElementContextView]):
3462
3463         Plumb the context view reload hook through WKContentView to WKTextInputListViewController.
3464
3465         (-[WKContentView setupInteraction]):
3466         (-[WKContentView _stopAssistingNode]):
3467         (-[WKContentView reloadContextViewForPresentedListViewController]):
3468         (-[WKContentView focusedFormControllerDidUpdateSuggestions:]):
3469
3470         Slight tweak to only reload text suggestions if we are not blurring the focused element. Without this extra
3471         condition, the list view controller's inner table view would get reloaded when the form input session's text
3472         suggestions are set to nil when the list view controller is dismissed, causing a visible stutter in the
3473         dismissal animation of view controller.
3474
3475 2018-03-21  Chris Dumez  <cdumez@apple.com>
3476
3477         WebKitTestRunner crashed in com.apple.WebKit: WebKit::WebProcessPool::terminateServiceWorkerProcesses
3478         https://bugs.webkit.org/show_bug.cgi?id=183875
3479
3480         Reviewed by Brent Fulgham.
3481
3482         Protect |this| while we're iterating over m_serviceWorkerProcesses and terminating
3483         each service worker process. It is possible for the WebProcess pool to get destroyed
3484         as a result of terminating a service worker process.
3485
3486         This change is covered by layout tests that are currently crashing on the ASAN bots.
3487
3488         * UIProcess/WebProcessPool.cpp:
3489         (WebKit::WebProcessPool::terminateServiceWorkerProcesses):
3490
3491 2018-03-21  Eric Carlson  <eric.carlson@apple.com>
3492
3493         Fix typo in inactive media stream timeout default value
3494         https://bugs.webkit.org/show_bug.cgi?id=183872
3495         <rdar://problem/38723903>
3496
3497         Reviewed by Jer Noble.
3498
3499         * Shared/WebPreferences.yaml: Fix typo.
3500         * Shared/WebPreferencesDefaultValues.h: Ditto.
3501
3502 2018-03-21  Chris Dumez  <cdumez@apple.com>
3503
3504         Make policy decisions asynchronous
3505         https://bugs.webkit.org/show_bug.cgi?id=180568
3506         <rdar://problem/37131297>
3507
3508         Reviewed by Alex Christensen.
3509
3510         Get rid of synchronous IPC and synchronous code paths for policy delegates.
3511         Policy decisions are now all made asynchronously and rely on asynchronous
3512         IPC.
3513
3514         This code change is based on work by Alex Christensen.
3515
3516         * UIProcess/WebPageProxy.cpp:
3517         (WebKit::WebPageProxy::receivedPolicyDecision):
3518         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
3519         (WebKit::WebPageProxy::decidePolicyForResponse):
3520         * UIProcess/WebPageProxy.h:
3521         * UIProcess/WebPageProxy.messages.in:
3522         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3523         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
3524         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
3525
3526 2018-03-21  Chris Dumez  <cdumez@apple.com>
3527
3528         ScrollViewInsetTests.RestoreInitialContentOffsetAfterCrash API test is failing with async delegates
3529         https://bugs.webkit.org/show_bug.cgi?id=183787
3530
3531         Reviewed by Wenson Hsieh.
3532
3533         Without asynchronous policy delegates, when the client requests a navigation, we would:
3534         1. Do a synchronous navigation policy check
3535         2. If the client allows the navigation, start the provisional load
3536
3537         Starting the provisional load would freeze the layer tree until first meaningful
3538         layout via WebFrameLoaderClient::provisionalLoadStarted() -> WebPage::didStartPageTransition().
3539
3540         When constructing a WebView and then requesting a load right away. This would make sure
3541         we do not commit a layer tree for the initial about:blank page because the layer tree
3542         would be frozen until we have something meaningful to show for the following load.
3543
3544         However, with asynchronous policy delegates, we are able to do a layer tree commit
3545         during the asynchronous navigation policy check because the layer tree is not frozen
3546         yet (provisional load has not started) and the process is not stuck on synchronous
3547         IPC. When constructing a WebView and then requesting a load right away, this would
3548         allow a layer tree commit for about:blank to happen before we've even started the
3549         load. This would cause some API tests to fail on iOS.
3550
3551         To address the issue, we try and maintain pre-existing behavior by freezing the
3552         layer tree during navigation policy decision.
3553
3554         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3555         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
3556         (WebKit::WebFrameLoaderClient::didDecidePolicyForNavigationAction):
3557         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
3558         * WebProcess/WebPage/WebPage.cpp:
3559         (WebKit::WebPage::didStartNavigationPolicyCheck):
3560         (WebKit::WebPage::didCompleteNavigationPolicyCheck):
3561         * WebProcess/WebPage/WebPage.h:
3562
3563 2018-03-21  Brent Fulgham  <bfulgham@apple.com>
3564
3565         Allow the WebContent process to read ViewBridge preferences
3566         https://bugs.webkit.org/show_bug.cgi?id=183862
3567         <rdar://problem/38459456>
3568
3569         Reviewed by Eric Carlson.
3570
3571         * WebProcess/com.apple.WebProcess.sb.in:
3572
3573 2018-03-21  Frederic Wang  <fwang@igalia.com>
3574
3575         [iOS] Text highlighted by the Find UI overlaps with NBC news header on google.com
3576         https://bugs.webkit.org/show_bug.cgi?id=183658
3577
3578         Reviewed by Tim Horton.
3579
3580         On Mobile, many sites have overlay headers or footers that may overlap with the highlighted
3581         text inside a scrollable overflow node. To workaround that issue, this commit changes the
3582         behavior so that the text is revealed at the center of the overflow node.
3583
3584         * WebProcess/WebPage/ios/FindControllerIOS.mm:
3585         (WebKit::FindController::didFindString): Use alignCenterAlways instead of alignToEdgeIfNeeded.
3586
3587 2018-03-21  Carlos Garcia Campos  <cgarcia@igalia.com>
3588
3589         [GTK][WPE] JSC bindings not introspectable
3590         https://bugs.webkit.org/show_bug.cgi?id=136989
3591
3592         Reviewed by Michael Catanzaro.
3593
3594         Deprecate the functions that are not introspectable due to JSC C API in GTK+ port and remove them in WPE
3595         port. Add alternative functions using the new JSC GLib API. We no longer need to keep a global context attached
3596         to every view. We can simply create a temporary global context on demand and release it after 1 second. This
3597         also allows us to remove WebPageProxy::javascriptGlobalContext() and all the related code.
3598
3599         * PlatformGTK.cmake:
3600         * PlatformWPE.cmake:
3601         * UIProcess/API/glib/WebKitJavascriptResult.cpp:
3602         (_WebKitJavascriptResult::_WebKitJavascriptResult):
3603         (webkitJavascriptResultCreate):
3604         (webkit_javascript_result_get_global_context):
3605         (webkit_javascript_result_get_value):
3606         (webkit_javascript_result_get_js_value):
3607         * UIProcess/API/glib/WebKitJavascriptResultPrivate.h:
3608         (SharedJavascriptContext::singleton):
3609         (SharedJavascriptContext::SharedJavascriptContext):
3610         (SharedJavascriptContext::getOrCreateContext):
3611         (SharedJavascriptContext::releaseContext):
3612         * UIProcess/API/glib/WebKitUserContentManager.cpp:
3613         * UIProcess/API/glib/WebKitWebView.cpp:
3614         (webkit_web_view_get_javascript_global_context):
3615         (webkitWebViewRunJavaScriptCallback):
3616         * UIProcess/API/gtk/PageClientImpl.cpp:
3617         * UIProcess/API/gtk/PageClientImpl.h:
3618         * UIProcess/API/gtk/WebKitJavascriptResult.h:
3619         * UIProcess/API/gtk/WebKitWebView.h:
3620         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
3621         * UIProcess/API/wpe/APIViewClient.h:
3622         (API::ViewClient::handleDownloadRequest):
3623         * UIProcess/API/wpe/PageClientImpl.cpp:
3624         * UIProcess/API/wpe/PageClientImpl.h:
3625         * UIProcess/API/wpe/WPEView.cpp:
3626         * UIProcess/API/wpe/WPEView.h:
3627         * UIProcess/API/wpe/WebKitJavascriptResult.h:
3628         * UIProcess/API/wpe/WebKitWebView.h:
3629         * UIProcess/PageClient.h:
3630         * UIProcess/WebPageProxy.h:
3631         * UIProcess/gtk/WebPageProxyGtk.cpp:
3632         * UIProcess/wpe/WebPageProxyWPE.cpp:
3633         * WebProcess/InjectedBundle/API/glib/WebKitFrame.cpp:
3634         (webkit_frame_get_js_context):
3635         (webkit_frame_get_js_context_for_script_world):
3636         * WebProcess/InjectedBundle/API/gtk/WebKitFrame.h:
3637         * WebProcess/InjectedBundle/API/wpe/WebKitFrame.h:
3638
3639 2018-03-21  Carlos Garcia Campos  <cgarcia@igalia.com>
3640
3641         [GTK][WPE] Initial implementation of JavaScriptCore glib bindings
3642         https://bugs.webkit.org/show_bug.cgi?id=164061
3643
3644         Reviewed by Michael Catanzaro.
3645
3646         Set decorator and deprecation_guard options in API docs config files, since they are no longer common to all
3647         libraries.
3648
3649         * PlatformGTK.cmake:
3650
3651 2018-03-21  Zan Dobersek  <zdobersek@igalia.com>
3652
3653         [CoordGraphics] Simplify CoordinatedGraphicsScene activation
3654         https://bugs.webkit.org/show_bug.cgi?id=183772
3655
3656         Reviewed by Carlos Garcia Campos.
3657
3658         Simplify CoordinatedGraphicsScene::setActive() into a simple setter of
3659         the m_isActive member variable. We don't have to call renderNextFrame()
3660         anymore as that was only necessary to unblock CoordinatedLayerTreeHost,
3661         but that can be avoided if m_isWaitingForRenderer in that class is
3662         initialized to false.
3663
3664         CoordinatedGraphicsSceneClient::renderNextFrame() virtual method and its
3665         ThreadedCompositor implementation are removed. renderNextFrame() in the
3666         CoordinatedGraphicsScene class can also be removed, along with the
3667         unused dispatchOnMainThread() and dispatchOnClientRunLoop() methods and
3668         the associated m_clientRunLoop member variable.
3669
3670         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
3671         (WebKit::CoordinatedGraphicsScene::CoordinatedGraphicsScene):
3672         (WebKit::CoordinatedGraphicsScene::dispatchOnMainThread): Deleted.
3673         (WebKit::CoordinatedGraphicsScene::dispatchOnClientRunLoop): Deleted.
3674         (WebKit::CoordinatedGraphicsScene::renderNextFrame): Deleted.
3675         (WebKit::CoordinatedGraphicsScene::setActive): Deleted.
3676         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
3677         (WebKit::CoordinatedGraphicsSceneClient::~CoordinatedGraphicsSceneClient):
3678         (WebKit::CoordinatedGraphicsScene::setActive):
3679         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
3680         (WebKit::m_displayRefreshMonitor):
3681         (WebKit::ThreadedCompositor::setNativeSurfaceHandleForCompositing):
3682         (WebKit::ThreadedCompositor::renderNextFrame): Deleted.
3683         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
3684         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
3685
3686 2018-03-21  Zan Dobersek  <zdobersek@igalia.com>
3687
3688         [TexMap] Have TextureMapperLayer::applyAnimationsRecursively() return running animation status
3689         https://bugs.webkit.org/show_bug.cgi?id=183771
3690
3691         Reviewed by Carlos Garcia Campos.
3692
3693         In CoordinatedGraphicsScene::paintToCurrentGLContext(), retrieve
3694         information about any running animation in the scene via the
3695         TextureMapperLayer::applyAnimationsRecursively() call. Use that boolean
3696         value at the end up the method, instead of again traversing the
3697         TextureMapperLayer tree to determine whether any running animations are
3698         present.
3699
3700         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
3701         (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
3702
3703 2018-03-20  Tim Horton  <timothy_horton@apple.com>
3704
3705         Enable the minimal simulator feature flag when appropriate
3706         https://bugs.webkit.org/show_bug.cgi?id=183807
3707
3708         Reviewed by Dan Bernstein.
3709
3710         * Configurations/FeatureDefines.xcconfig:
3711
3712 2018-03-19  Ryosuke Niwa  <rniwa@webkit.org>
3713
3714         Expose content attributes on _WKLinkIconParameters
3715         https://bugs.webkit.org/show_bug.cgi?id=183768
3716
3717         Reviewed by Alex Christensen.
3718
3719         Added _WKLinkIconParameters.attributes to expose content attributes of a link element
3720         which defined a favicon, touch icon, or pre-compressed touch icon.
3721
3722         * UIProcess/API/Cocoa/_WKLinkIconParameters.h:
3723         (_WKLinkIconParameters.attributes): Added.
3724         * UIProcess/API/Cocoa/_WKLinkIconParameters.mm:
3725         (_WKLinkIconParameters._attributes): Added.
3726         (-[_WKLinkIconParameters _initWithLinkIcon:]): Convert the hash map from WebCore to a NSDictionary.
3727         (-[_WKLinkIconParameters attributes]): Added.
3728
3729 2018-03-20  Wenson Hsieh  <wenson_hsieh@apple.com>
3730
3731         Add AssistedNodeInformation plumbing for form control placeholder text and label text
3732         https://bugs.webkit.org/show_bug.cgi?id=183802
3733         <rdar://problem/38686273>
3734
3735         Reviewed by Tim Horton.
3736
3737         Surfaces some additional information about the currently focused element to the input delegate in the UI process.
3738         See comments below for more details.
3739
3740         Test: WebKit.FocusedElementInfo
3741
3742         * Shared/AssistedNodeInformation.cpp:
3743         (WebKit::AssistedNodeInformation::encode const):
3744         (WebKit::AssistedNodeInformation::decode):
3745         * Shared/AssistedNodeInformation.h:
3746
3747         Add `placeholder` and `label` to AssistedNodeInformation, which capture the value of the placeholder attribute
3748         and the text of the first associated label element for the focused form control. Also add boilerplate encoder/
3749         decoder support for these members.
3750
3751         * UIProcess/API/Cocoa/_WKFocusedElementInfo.h:
3752
3753         Augment _WKFocusedElementInfo to include placeholder and label.
3754
3755         * UIProcess/ios/WKContentViewInteraction.mm:
3756         (-[WKFocusedElementInfo initWithAssistedNodeInformation:isUserInitiated:userObject:]):
3757         (-[WKFocusedElementInfo label]):
3758         (-[WKFocusedElementInfo placeholder]):
3759         * WebProcess/WebPage/ios/WebPageIOS.mm:
3760         (WebKit::WebPage::getAssistedNodeInformation):
3761
3762         For input elements and textareas, set the placeholder to the value of the placeholder attribute. For all
3763         elements with associated labels, grab the inner text of the first label that is not empty, ignoring all labels
3764         that are `display: none` (i.e. not being rendered).
3765
3766 2018-03-20  Brady Eidson  <beidson@apple.com>
3767
3768         First piece of process swapping on navigation.
3769         https://bugs.webkit.org/show_bug.cgi?id=183665
3770
3771         Reviewed by Andy Estes.
3772
3773         This patch adds the first pieces of the following feature:
3774         "When a navigation originating inside a WKWebView goes to a different origin,
3775          swap to a new WebProcess for that navigation"
3776
3777         There are significant bugs to be resolved and significant optimizations to be made.
3778         Which is why the feature is disabled by default.
3779
3780         Besides the core logic implementing the feature, this patch does a lot of related 
3781         work such as:
3782         - Removing some now-invalid ASSERTs
3783         - Adding some ASSERTs
3784         - Update various switch states to handle the new "Suspend" policy and "NavigationSwap"
3785           process termination reason
3786
3787         * NetworkProcess/NetworkDataTaskBlob.cpp:
3788         (WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse):
3789
3790         * NetworkProcess/capture/NetworkDataTaskReplay.cpp:
3791         (WebKit::NetworkCapture::NetworkDataTaskReplay::didReceiveResponse):
3792
3793         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3794         (toNSURLSessionResponseDisposition):
3795
3796         * Platform/Logging.h:
3797
3798         * Shared/LoadParameters.cpp:
3799         (WebKit::LoadParameters::encode const):
3800         (WebKit::LoadParameters::decode):
3801         * Shared/LoadParameters.h:
3802
3803         * Shared/ProcessTerminationReason.h: Add "NavigationSwap" as a process termination reason.
3804
3805         * UIProcess/API/APINavigation.h:
3806
3807         * UIProcess/API/APIProcessPoolConfiguration.cpp:
3808         (API::ProcessPoolConfiguration::copy):
3809
3810         * UIProcess/API/C/WKAPICast.h:
3811         (WebKit::toAPI):
3812
3813         * UIProcess/Cocoa/NavigationState.mm:
3814         (WebKit::wkProcessTerminationReason):
3815
3816         * UIProcess/WebFramePolicyListenerProxy.cpp:
3817         (WebKit::WebFramePolicyListenerProxy::WebFramePolicyListenerProxy):
3818         * UIProcess/WebFramePolicyListenerProxy.h:
3819         (WebKit::WebFramePolicyListenerProxy::create):
3820         (WebKit::WebFramePolicyListenerProxy::policyListenerType const):
3821
3822         * UIProcess/WebFrameProxy.cpp:
3823         (WebKit::WebFrameProxy::setUpPolicyListenerProxy):
3824         (WebKit::WebFrameProxy::activePolicyListenerProxy):
3825         * UIProcess/WebFrameProxy.h:
3826
3827         * UIProcess/WebNavigationState.cpp:
3828         (WebKit::WebNavigationState::navigation):
3829         (WebKit::WebNavigationState::takeNavigation):
3830
3831         * UIProcess/WebPageProxy.cpp:
3832         (WebKit::WebPageProxy::reattachToWebProcess):
3833         (WebKit::WebPageProxy::attachToProcessForNavigation): Pretend that the existing process 
3834           terminated using the new "NavigationSwap" reason, then manually start the next load.
3835         (WebKit::WebPageProxy::loadRequest):
3836         (WebKit::WebPageProxy::loadRequestWithNavigation):
3837         (WebKit::WebPageProxy::receivedPolicyDecision):
3838         (WebKit::WebPageProxy::continueNavigationInNewProcess):
3839         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
3840         (WebKit::WebPageProxy::decidePolicyForResponse):
3841         (WebKit::WebPageProxy::processDidTerminate):
3842         (WebKit::WebPageProxy::resetState):
3843         (WebKit::WebPageProxy::resetStateAfterProcessExited):
3844         * UIProcess/WebPageProxy.h:
3845
3846         * UIProcess/WebProcessPool.cpp:
3847         (WebKit::WebProcessPool::processForNavigation): Determine which process should be used
3848           for a proposed navigation, creating a new one if necessary.
3849         * UIProcess/WebProcessPool.h:
3850
3851         * UIProcess/WebStorage/StorageManager.cpp:
3852         (WebKit::StorageManager::SessionStorageNamespace::setAllowedConnection):
3853
3854         * WebProcess/WebPage/WebPage.cpp:
3855         (WebKit::WebPage::loadRequest):
3856
3857 2018-03-20  Youenn Fablet  <youenn@apple.com>
3858
3859         ServiceWorkerClientFetch::didReceiveData should check for m_encodedDataLength
3860         https://bugs.webkit.org/show_bug.cgi?id=183668
3861
3862         Reviewed by Chris Dumez.
3863
3864         Crash happens when releasing a RefPtr<SharedBuffer> buffer that is null.
3865         It happens because ServiceWorkerClientFetch can call m_loader->didReceiveBuffer at two different places.
3866         Either when receiving an IPC call or as part of completion handler for the response validation check.
3867         At each call site, we release the buffer to pass it to the loader and we set m_encodedLength to zero.
3868         The fix is to add the m_encodedLength check like done in the case of response validation check completion handler.
3869
3870         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
3871         (WebKit::ServiceWorkerClientFetch::didReceiveData):
3872
3873 2018-03-20  Jeff Miller  <jeffm@apple.com>
3874
3875         Expose aggressiveTileRetentionEnabled in WKPreferences SPI to match C SPI
3876         https://bugs.webkit.org/show_bug.cgi?id=183790
3877
3878         Reviewed by Alex Christensen.
3879         
3880         Expose this property on macOS only.
3881
3882         * UIProcess/API/Cocoa/WKPreferences.mm:
3883         (-[WKPreferences _setAggressiveTileRetentionEnabled:]):
3884         (-[WKPreferences _aggressiveTileRetentionEnabled]):
3885         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
3886
3887 2018-03-20  Tim Horton  <timothy_horton@apple.com>
3888
3889         Add and adopt WK_PLATFORM_NAME and adjust default feature defines
3890         https://bugs.webkit.org/show_bug.cgi?id=183758
3891         <rdar://problem/38017644>
3892
3893         Reviewed by Dan Bernstein.
3894
3895         * Configurations/FeatureDefines.xcconfig:
3896
3897 2018-03-20  Chris Dumez  <cdumez@apple.com>
3898
3899         Unreviewed, rolling out r229726 and r229763.
3900
3901         Caused some API test failures on iOS
3902
3903         Reverted changesets:
3904
3905         "Make policy decisions asynchronous"
3906         https://bugs.webkit.org/show_bug.cgi?id=180568
3907         https://trac.webkit.org/changeset/229726
3908
3909         "Rebaseline three webarchive tests for WK2 after r229726."
3910         https://bugs.webkit.org/show_bug.cgi?id=180568
3911         https://trac.webkit.org/changeset/229763
3912
3913 2018-03-20  Brent Fulgham  <bfulgham@apple.com>
3914
3915         [iOS] Grant IOKit preference access for the Home button
3916         https://bugs.webkit.org/show_bug.cgi?id=183754
3917         <rdar://problem/38179704>
3918
3919         Reviewed by Eric Carlson.
3920
3921         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
3922
3923 2018-03-20  Wenson Hsieh  <wenson_hsieh@apple.com>
3924
3925         [Extra zoom mode] Adopt updated input view controller machinery for text input
3926         https://bugs.webkit.org/show_bug.cgi?id=183765
3927         <rdar://problem/36926269>
3928
3929         Reviewed by Tim Horton.
3930
3931         Adopt new classes for extra zoomed text inputs. Massage WKTextInputViewController into WKTextInputListView-
3932         Controller and introduce WKFormControlListViewController, the eventual replacement for the base class
3933         WKTextFormControlViewController that will act as the base class of all list-view-controller-based input UI in
3934         extra zoom mode.
3935
3936         * UIProcess/ios/WKContentViewInteraction.h:
3937         * UIProcess/ios/WKContentViewInteraction.mm:
3938         (-[WKContentView presentTextInputViewController:]):
3939         (-[WKContentView dismissTextInputViewController:]):
3940         (-[WKContentView focusedFormControllerDidUpdateSuggestions:]):
3941         (-[WKContentView _wheelChangedWithEvent:]):
3942         * UIProcess/ios/forms/WKFormControlListViewController.h: Copied from Source/WebKit/UIProcess/ios/forms/WKTextInputViewController.h.
3943         * UIProcess/ios/forms/WKFormControlListViewController.mm: Renamed from Source/WebKit/UIProcess/ios/forms/WKTextInputViewController.mm.
3944         * UIProcess/ios/forms/WKTextInputListViewController.h: Copied from Source/WebKit/UIProcess/ios/forms/WKTextInputViewController.h.
3945         * UIProcess/ios/forms/WKTextInputListViewController.mm: Renamed from Source/WebKit/UIProcess/ios/forms/WKTextInputViewController.h.
3946         * WebKit.xcodeproj/project.pbxproj:
3947
3948 2018-03-19  Megan Gardner  <megan_gardner@apple.com>
3949
3950         Clear style colors when setting default appearance
3951         https://bugs.webkit.org/show_bug.cgi?id=183759
3952
3953         Reviewed by Tim Horton.
3954
3955         Colors are cached and need to be cleared and recalculated.
3956
3957         * WebProcess/WebPage/WebPage.cpp:
3958         (WebKit::WebPage::setDefaultAppearance):
3959
3960 2018-03-19  Chris Dumez  <cdumez@apple.com>
3961
3962         WKWebView.ClearAppCache is a flaky API test failure on High Sierra.
3963         https://bugs.webkit.org/show_bug.cgi?id=181546
3964         <rdar://problem/36444327>
3965
3966         Reviewed by Ryosuke Niwa.
3967
3968         in LocalStorageDatabaseTracker::deleteDatabasesModifiedSince(), add origin
3969         to originIdentifiersToDelete if we cannot determine the last modification
3970         time of the database file. This likely means the database file does not
3971         exist. However, we still needs to make sure the origin gets removed from
3972         the origins database and there may be *.wal / *.shm variants of the database
3973         that are still on disk and need to be deleted.
3974
3975         * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
3976         (WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince):
3977
3978 2018-03-19  Chris Dumez  <cdumez@apple.com>
3979
3980         Have one service worker process per security origin
3981         https://bugs.webkit.org/show_bug.cgi?id=183600
3982         <rdar://problem/35280128>
3983
3984         Reviewed by Brady Eidson.
3985
3986         Split service workers from different origins into their own processes
3987         for security reasons.
3988
3989         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: