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