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