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