Web Automation: clean up some WebAutomationSession methods to use modern async IPC
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2019-04-05  Brian Burg  <bburg@apple.com>
2
3         Web Automation: clean up some WebAutomationSession methods to use modern async IPC
4         https://bugs.webkit.org/show_bug.cgi?id=196168
5
6         Reviewed by Devin Rousso.
7
8         Modern WebKit IPC is capable of providing completion handlers and can track callback IDs.
9         So, most messages between WebAutomationSession and its proxy can use this facility and stop
10         keeping track of callback IDs manually. This makes most code easier to read on both the
11         sender and receiver side.
12
13         There are two cases that could not be converted:
14         - For evaluateJavaScript, we cannot use async IPC because WebAutomationSession expects to
15         be able to cancel all pending replies when a page navigates away, the web process crashes,
16         or when handling an alert.
17         - For takeScreenshot, there is not currently support in the modern async IPC code paths for
18         sending the result back. ShareableBitmap and friends lack a modern decoder implementation.
19
20         * UIProcess/Automation/WebAutomationSession.cpp:
21         (WebKit::WebAutomationSession::resolveChildFrameHandle):
22         (WebKit::WebAutomationSession::resolveParentFrameHandle):
23         (WebKit::WebAutomationSession::computeElementLayout):
24         (WebKit::WebAutomationSession::selectOptionElement):
25         (WebKit::WebAutomationSession::getAllCookies):
26         (WebKit::WebAutomationSession::deleteSingleCookie):
27         (WebKit::WebAutomationSession::viewportInViewCenterPointOfElement):
28         (WebKit::WebAutomationSession::didResolveChildFrame): Deleted.
29         (WebKit::WebAutomationSession::didResolveParentFrame): Deleted.
30         (WebKit::WebAutomationSession::didComputeElementLayout): Deleted.
31         (WebKit::WebAutomationSession::didSelectOptionElement): Deleted.
32         (WebKit::WebAutomationSession::didGetCookiesForFrame): Deleted.
33         (WebKit::WebAutomationSession::didDeleteCookie): Deleted.
34         * UIProcess/Automation/WebAutomationSession.h:
35         * UIProcess/Automation/WebAutomationSession.messages.in:
36         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
37         (WebKit::WebAutomationSessionProxy::resolveChildFrameWithOrdinal):
38         (WebKit::WebAutomationSessionProxy::resolveChildFrameWithNodeHandle):
39         (WebKit::WebAutomationSessionProxy::resolveChildFrameWithName):
40         (WebKit::WebAutomationSessionProxy::resolveParentFrame):
41         (WebKit::WebAutomationSessionProxy::computeElementLayout):
42         (WebKit::WebAutomationSessionProxy::selectOptionElement):
43         (WebKit::WebAutomationSessionProxy::getCookiesForFrame):
44         (WebKit::WebAutomationSessionProxy::deleteCookie):
45         * WebProcess/Automation/WebAutomationSessionProxy.h:
46         * WebProcess/Automation/WebAutomationSessionProxy.messages.in:
47
48 2019-04-08  Alex Christensen  <achristensen@webkit.org>
49
50         REGRESSION(236463) DownloadManager can call a null CompletionHandler
51         https://bugs.webkit.org/show_bug.cgi?id=196414
52         <rdar://problem/48389434>
53
54         Reviewed by Geoff Garen.
55
56         * NetworkProcess/NetworkResourceLoader.cpp:
57         (WebKit::NetworkResourceLoader::convertToDownload):
58         DownloadManager::continueDecidePendingDownloadDestination is being called when there is no completion handler.
59         r236463 introduced an unchecked code path that can allow this to happen.
60
61 2019-04-07  Commit Queue  <commit-queue@webkit.org>
62
63         Unreviewed, rolling out r243956.
64         https://bugs.webkit.org/show_bug.cgi?id=196688
65
66         Broke API Test SafeBrowsing.WKWebViewGoBackIFrame (Requested
67         by aakashjain on #webkit).
68
69         Reverted changeset:
70
71         "Clicking "Go Back" from a safe browsing warning from an
72         iframe should navigate the WKWebView back to the previous
73         page"
74         https://bugs.webkit.org/show_bug.cgi?id=196665
75         https://trac.webkit.org/changeset/243956
76
77 2019-04-07  Geoffrey Garen  <ggaren@apple.com>
78
79         Remove stray byte added by r241131
80         https://bugs.webkit.org/show_bug.cgi?id=196682
81
82         Reviewed by Alexey Proskuryakov.
83
84         Sublime Text thinks WKWebView.mm is binary instead of text.
85
86         According to online documentation and bisecting, this is because r241131
87         introduced a stray byte (probably a null byte?) into the file.
88
89         I fixed this with Cmd-C Cmd-V.
90
91         * UIProcess/API/Cocoa/WKWebView.mm:
92         (-[WKWebView _initializeWithConfiguration:]):
93
94 2019-04-06  Wenson Hsieh  <wenson_hsieh@apple.com>
95
96         Hide next and previous form control buttons when WKWebView is editable
97         https://bugs.webkit.org/show_bug.cgi?id=196672
98         <rdar://problem/35625321>
99
100         Reviewed by Tim Horton.
101
102         Adopt new UIKit SPI to hide or show next and previous controls in the form accessory view when changing
103         editability.
104
105         Test: KeyboardInputTests.FormNavigationAssistantBarButtonItems
106
107         * Platform/spi/ios/UIKitSPI.h:
108         * UIProcess/API/Cocoa/WKWebView.mm:
109         (-[WKWebView _setEditable:]):
110         * UIProcess/ios/WKContentViewInteraction.h:
111         * UIProcess/ios/WKContentViewInteraction.mm:
112         (-[WKContentView _updateAccessory]):
113         (-[WKContentView _didChangeWebViewEditability]):
114
115 2019-04-06  Antti Koivisto  <antti@apple.com>
116
117         Combine event and touch action regions into a single class
118         https://bugs.webkit.org/show_bug.cgi?id=196644
119         <rdar://problem/49643614>
120
121         Reviewed by Darin Adler.
122
123         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
124         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
125         (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
126         * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h:
127         (WebKit::RemoteLayerTreeNode::eventRegion const):
128         * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm:
129         (WebKit::RemoteLayerTreeNode::setEventRegion):
130         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
131         (WebKit::PlatformCALayerRemote::setEventRegion):
132         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h:
133
134 2019-04-05  Yongjun Zhang  <yongjun_zhang@apple.com>
135
136         We should pass minimumEffectiveDeviceWidth to web process on new page creation.
137         https://bugs.webkit.org/show_bug.cgi?id=196077
138         <rdar://problem/49108202>
139
140         Reviewed by Chris Dumez.
141
142         When a new web view is created, it is possible we don't have the web content process till a load
143         is requested. This patch stashes minimumEffectiveDeviceWidth in WebPageProxy.cpp and passes that
144         value down to web process via WebPageCreationParameters when a new process is created, just like
145         we did for other values like viewportConfigurationLayoutSizeScaleFactor or viewportConfigurationViewLayoutSize.
146
147         * Shared/WebPageCreationParameters.cpp:
148         (WebKit::WebPageCreationParameters::encode const): Encode viewportConfigurationMinimumEffectiveDeviceWidth value.
149         (WebKit::WebPageCreationParameters::decode): Decode viewportConfigurationMinimumEffectiveDeviceWidth value.
150         * Shared/WebPageCreationParameters.h:
151         * UIProcess/API/Cocoa/WKWebView.mm: Now that we stash the minimumEffectiveDeviceWidth value in WebPageProxy, we
152             don't need the iVar in WKWebView any more.
153         (-[WKWebView _dispatchSetViewLayoutSize:]): Use _page->minimumEffectiveDeviceWidth().
154         (-[WKWebView _setViewScale:]): Ditto.
155         (-[WKWebView _setMinimumEffectiveDeviceWidth:]): Ditto.
156         (-[WKWebView _minimumEffectiveDeviceWidth]): Ditto.
157         * UIProcess/WebPageProxy.cpp:
158         (WebKit::WebPageProxy::creationParameters): Also add viewportConfigurationMinimumEffectiveDeviceWidth to
159             web process creation parameter.
160         * UIProcess/WebPageProxy.h:
161         (WebKit::WebPageProxy::minimumEffectiveDeviceWidth const): Returns m_viewportConfigurationMinimumEffectiveDeviceWidth.
162         * UIProcess/ios/WebPageProxyIOS.mm:
163         (WebKit::WebPageProxy::setViewportConfigurationViewLayoutSize): Pass parameters.viewportConfigurationMinimumEffectiveDeviceWidth
164             to web process.
165         * WebProcess/WebPage/WebPage.cpp:
166         (WebKit::WebPage::WebPage): Take viewportConfigurationMinimumEffectiveDeviceWidth value from the parameter and
167             set that to viewport configuration.
168
169 2019-04-05  Jer Noble  <jer.noble@apple.com>
170
171         [Cocoa] Deactivate the audio session before the WebProcess suspends.
172         https://bugs.webkit.org/show_bug.cgi?id=196658
173
174         Reviewed by Eric Carlson.
175
176         Notify the PlatformMediaSessionManager when the process suspends or resumes.
177
178         * WebProcess/WebProcess.cpp:
179         (WebKit::WebProcess::actualPrepareToSuspend):
180         (WebKit::WebProcess::cancelPrepareToSuspend):
181         (WebKit::WebProcess::processDidResume):
182
183 2019-04-05  Sihui Liu  <sihui_liu@apple.com>
184
185         [iOS] Web process gets suspended while holding locked database files
186         https://bugs.webkit.org/show_bug.cgi?id=196519
187         <rdar://problem/49531797>
188
189         Reviewed by Chris Dumez.
190
191         * WebProcess/WebProcess.cpp:
192         (WebKit::WebProcess::actualPrepareToSuspend):
193
194 2019-04-05  Alex Christensen  <achristensen@webkit.org>
195
196         Clicking "Go Back" from a safe browsing warning from an iframe should navigate the WKWebView back to the previous page
197         https://bugs.webkit.org/show_bug.cgi?id=196665
198         <rdar://45115669>
199
200         Reviewed by Geoff Garen.
201
202         It is insufficient to just not navigate the subframe.  We must leave the page that contained it.
203
204         * UIProcess/API/Cocoa/WKWebView.mm:
205         (-[WKWebView _showSafeBrowsingWarning:completionHandler:]):
206         * UIProcess/Cocoa/WebViewImpl.mm:
207         (WebKit::WebViewImpl::showSafeBrowsingWarning):
208
209 2019-04-05  Alex Christensen  <achristensen@webkit.org>
210
211         Undeprecate WKNavigationData
212         https://bugs.webkit.org/show_bug.cgi?id=196559
213         <rdar://44927425>
214
215         Reviewed by Geoff Garen.
216
217         * UIProcess/API/Cocoa/WKNavigationData.h:
218         It is used to communicate information from FrameLoaderClient::updateGlobalHistory() to the application.
219         This use in WKBrowsingContextHistoryDelegate is definitely still deprecated, but its use in
220         WKHistoryDelegatePrivate does not have an adequate replacement yet, so it must remain undeprecated SPI.
221
222 2019-04-05  Sihui Liu  <sihui_liu@apple.com>
223
224         [iOS] Web process gets suspended while holding locked database files
225         https://bugs.webkit.org/show_bug.cgi?id=196519
226         <rdar://problem/49531797>
227
228         Reviewed by Chris Dumez.
229
230         * Shared/WebSQLiteDatabaseTracker.cpp:
231         (WebKit::WebSQLiteDatabaseTracker::~WebSQLiteDatabaseTracker):
232         * Shared/WebSQLiteDatabaseTracker.h:
233         * WebProcess/WebProcess.cpp:
234         (WebKit::m_webSQLiteDatabaseTracker):
235         (WebKit::WebProcess::actualPrepareToSuspend):
236         (WebKit::WebProcess::processWillSuspendImminently):
237         (WebKit::WebProcess::cancelPrepareToSuspend):
238         (WebKit::WebProcess::processDidResume):
239         * WebProcess/WebProcess.h:
240
241 2019-04-05  Commit Queue  <commit-queue@webkit.org>
242
243         Unreviewed, rolling out r243833.
244         https://bugs.webkit.org/show_bug.cgi?id=196645
245
246         This change breaks build of WPE and GTK ports (Requested by
247         annulen on #webkit).
248
249         Reverted changeset:
250
251         "[CMake][WTF] Mirror XCode header directories"
252         https://bugs.webkit.org/show_bug.cgi?id=191662
253         https://trac.webkit.org/changeset/243833
254
255 2019-04-05  David Kilzer  <ddkilzer@apple.com>
256
257         REGRESSION(r240685): Remove duplicate Headers entry for _WKInspectorWindow.h in Xcode project
258         <https://bugs.webkit.org/show_bug.cgi?id=193951>
259         <rdar://problem/47621366>
260
261         Fixes the following build warnings:
262             Warning: Multiple build commands for output file WebKit2_WebKit.roots/BuildRecords/WebKit2_installhdrs/Root/System/Library/Frameworks/WebKit.framework/PrivateHeaders/_WKInspectorWindow.h
263             Warning: Multiple build commands for output file WebKit2_WebKit.roots/BuildRecords/WebKit2_installapi/Root/System/Library/Frameworks/WebKit.framework/PrivateHeaders/_WKInspectorWindow.h
264             Warning: Multiple build commands for output file WebKit2_WebKit.roots/BuildRecords/WebKit2_install/Root/System/Library/Frameworks/WebKit.framework/PrivateHeaders/_WKInspectorWindow.h
265
266         * WebKit.xcodeproj/project.pbxproj: Remove duplicate entry for
267         _WKInspectorWindow.h.  In r240685, a second Headers entry was
268         added, but the first one was never removed.
269
270 2019-04-05  Carlos Garcia Campos  <cgarcia@igalia.com>
271
272         [ATK] Use a smart pointer for AccessibilityObject wrapper and remove GTK specific code
273         https://bugs.webkit.org/show_bug.cgi?id=196593
274         <rdar://problem/49599153>
275
276         Reviewed by Michael Catanzaro.
277
278         * WebProcess/WebPage/atk/WebKitWebPageAccessibilityObject.cpp:
279         (accessibilityRootObjectWrapper): Cast wrapper() as AtkObject.
280
281 2019-04-04  Simon Fraser  <simon.fraser@apple.com>
282
283         Simple iframe scrolling test fails to get a composited scrolling frame in WebKitTestRunnerApp
284         https://bugs.webkit.org/show_bug.cgi?id=196635
285
286         Reviewed by Antti Koivisto.
287
288         Remove WKBundleSetAsyncFrameScrollingEnabled().
289
290         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
291         (WKBundleSetAsyncFrameScrollingEnabled): Deleted.
292         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
293
294 2019-04-04  Simon Fraser  <simon.fraser@apple.com>
295
296         [iOS WK2] REGRESSION (r242687): Programmatic scroll of overflow scroll results in bad rendering
297         https://bugs.webkit.org/show_bug.cgi?id=195584
298
299         Reviewed by Zalan Bujtas.
300
301         Push data to the scrolling tree about whether an overflow:scroll scroll was programmatic, by having
302         RenderLayer::scrollToOffset() call into AsyncScrollingCoordinator::requestScrollPositionUpdate(),
303         just as we do for frames.
304
305         AsyncScrollingCoordinator::requestScrollPositionUpdate() is generalized to take any ScrollableArea.
306
307         Fix an assumption in the ScrollingTree that we only care about programmatic scrolls on the root node.
308         ScrollingTree::commitTreeState() no longer sets isHandlingProgrammaticScroll; instead,
309         callers of ScrollingTreeScrollingNode::scrollTo() pass a ScrollType. Commit functions pass
310         ScrollType::Programmatic when handling RequestedScrollPosition changes as necessary.
311
312         Programmatic scrolls need to get to the scrolling tree in the UI process so that we update
313         the tree's notion of scroll position, and trigger actual UIScrollView scrolls (layers may have
314         already been put in the right locations, but the UI process needs to know that a scroll happened).
315         However, we need to prevent notifications from programmatic scrolls getting back to the
316         web process, because this causes jumpiness. This is done via an early return in
317         RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll().
318
319         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
320         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
321         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
322         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateAfterChildren): Subframe nodes have
323         a delegate, and that will take care of the requestedScrollPosition update.
324         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
325         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
326         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateAfterChildren):
327         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
328         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):
329
330 2019-04-04  Ryan Haddad  <ryanhaddad@apple.com>
331
332         Unreviewed, rolling out r243888.
333
334         Introduced layout test crashes.
335
336         Reverted changeset:
337
338         "[macOS][iOS] Add filter to syscall sandbox rule"
339         https://bugs.webkit.org/show_bug.cgi?id=196613
340         https://trac.webkit.org/changeset/243888
341
342 2019-04-04  Youenn Fablet  <youenn@apple.com>
343
344         Pass storage quota parameters from UIProcess to NetworkProcess as part of WebsiteDataStore parameters
345         https://bugs.webkit.org/show_bug.cgi?id=196543
346
347         Reviewed by Alex Christensen.
348
349         Renamed methods used to set cache storage quota to be storage generic
350         since they will apply to all storage.
351
352         Pass quota parameters as part of WebsiteDataStoreParameters from UIProcess
353         to NetworkProcess (start-up time and new WebsiteDataStore time).
354
355         Compute on UIProcess the quota for third party origins using the default rule of dividing by 10.
356
357         * NetworkProcess/NetworkProcess.cpp:
358         (WebKit::NetworkProcess::initializeNetworkProcess):
359         (WebKit::NetworkProcess::addWebsiteDataStore):
360         (WebKit::NetworkProcess::initializeStorageQuota):
361         (WebKit::NetworkProcess::setCacheStorageParameters):
362         * NetworkProcess/NetworkProcess.h:
363         * NetworkProcess/NetworkProcess.messages.in:
364         * Shared/WebsiteDataStoreParameters.cpp:
365         (WebKit::WebsiteDataStoreParameters::encode const):
366         (WebKit::WebsiteDataStoreParameters::decode):
367         * Shared/WebsiteDataStoreParameters.h:
368         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
369         (WKWebsiteDataStoreSetPerOriginStorageQuota):
370         (WKWebsiteDataStoreSetCacheStoragePerOriginQuota): Deleted.
371         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
372         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
373         (-[WKWebsiteDataStore _perOriginStorageQuota]):
374         (-[WKWebsiteDataStore _setPerOriginStorageQuota:]):
375         (-[WKWebsiteDataStore _cacheStoragePerOriginQuota]): Deleted.
376         (-[WKWebsiteDataStore _setCacheStoragePerOriginQuota:]): Deleted.
377         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
378         * UIProcess/Network/NetworkProcessProxy.cpp:
379         (WebKit::NetworkProcessProxy::retrieveCacheStorageParameters):
380         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
381         (WebKit::WebsiteDataStore::parameters):
382         * UIProcess/WebsiteData/WebsiteDataStore.h:
383         (WebKit::WebsiteDataStore::perOriginStorageQuota const):
384         (WebKit::WebsiteDataStore::setPerOriginStorageQuota):
385         (WebKit::WebsiteDataStore::cacheStoragePerOriginQuota const): Deleted.
386         (WebKit::WebsiteDataStore::setCacheStoragePerOriginQuota): Deleted.
387         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
388         (WebKit::WebsiteDataStoreConfiguration::copy):
389         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
390         (WebKit::WebsiteDataStoreConfiguration::perOriginStorageQuota):
391         (WebKit::WebsiteDataStoreConfiguration::setPerOriginStorageQuota):
392         (WebKit::WebsiteDataStoreConfiguration::cacheStoragePerOriginQuota): Deleted.
393         (WebKit::WebsiteDataStoreConfiguration::setCacheStoragePerOriginQuota): Deleted.
394
395 2019-04-04  Wenson Hsieh  <wenson_hsieh@apple.com>
396
397         Changing default website policies shouldn't change default website policies in subsequent navigations
398         https://bugs.webkit.org/show_bug.cgi?id=196562
399         <rdar://problem/49573377>
400
401         Reviewed by Tim Horton.
402
403         Currently, changing the default WKWebpagePreferences object when deciding navigation policy causes the set of
404         default policies to change in subsequent navigations. Among other things, this prevents clients from passing
405         a modified version of the default website policies into the decision handler without impacting future
406         navigations. To fix this, teach API::WebsitePolicies to make a copy of itself, and then use this to pass a copy
407         of the default website policies to the navigation delegate when deciding navigation policies.
408
409         Test: DoNotAllowChangingDefaultWebpagePreferencesInDelegateMethod
410
411         * UIProcess/API/APIWebsitePolicies.cpp:
412         (API::WebsitePolicies::copy const):
413
414         Add a helper method to copy a set of website policies.
415
416         * UIProcess/API/APIWebsitePolicies.h:
417         * UIProcess/Cocoa/NavigationState.mm:
418         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
419
420 2019-04-04  Michael Catanzaro  <mcatanzaro@igalia.com>
421
422         Unreviewed, fix -Wreturn-type warning
423
424         * Shared/WebsiteData/WebsiteData.cpp:
425         (WebKit::WebsiteData::ownerProcess):
426
427 2019-04-04  Per Arne Vollan  <pvollan@apple.com>
428
429         [macOS] Fix sandbox violations
430         https://bugs.webkit.org/show_bug.cgi?id=196616
431         <rdar://problem/49498040>
432
433         Reviewed by Brent Fulgham.
434
435         Fix some observed sandbox violations in the WebContent process on macOS.
436
437         * WebProcess/com.apple.WebProcess.sb.in:
438
439 2019-04-04  Eric Carlson  <eric.carlson@apple.com>
440
441         [MediaStream] Host should be able to mute screen capture and camera/microphone independently
442         https://bugs.webkit.org/show_bug.cgi?id=196555
443         <rdar://problem/47303865>
444
445         Reviewed by Youenn Fablet.
446
447         * UIProcess/API/C/WKPagePrivate.h: Add kWKMediaScreenCaptureMuted.
448
449         * UIProcess/API/Cocoa/WKWebView.mm:
450         (-[WKWebView _setPageMuted:]):
451         (-[WKWebView _setMediaCaptureMuted:]): Deleted, it was unused.
452         (-[WKWebView _muteMediaCapture]): Deleted, it was unused.
453         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
454
455         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
456         (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionValidRequest): Fix
457         a log comment typo.
458
459         * UIProcess/WebPageProxy.cpp:
460         (WebKit::WebPageProxy::setMediaStreamCaptureMuted): Use the new flag.
461         (WebKit::WebPageProxy::activateMediaStreamCaptureInPage): Ditto.
462         (WebKit::WebPageProxy::setMuted): Ditto.
463         * UIProcess/WebPageProxy.h:
464         (WebKit::WebPageProxy::isMediaStreamCaptureMuted const): Ditto.
465
466 2019-04-04  Per Arne Vollan  <pvollan@apple.com>
467
468         [macOS][iOS] Add filter to syscall sandbox rule
469         https://bugs.webkit.org/show_bug.cgi?id=196613
470         <rdar://problem/49531420>
471
472         Reviewed by Brent Fulgham.
473
474         This will restrict the existing sandbox rule for the syscall.
475
476         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
477         * WebProcess/com.apple.WebProcess.sb.in:
478
479 2019-04-04  Youenn Fablet  <youenn@apple.com>
480
481         Service Worker Process does not have the right domain name
482         https://bugs.webkit.org/show_bug.cgi?id=196585
483
484         Reviewed by Chris Dumez.
485
486         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm:
487         (WebKit::XPCServiceInitializerDelegate::getExtraInitializationData):
488         Updated extraInitializationData to go from "security-origin" to "registrable-domain".
489
490 2019-04-04  Chris Dumez  <cdumez@apple.com>
491
492         Temporarily disable delayed WebProcess launch on iOS to address PLT regression
493         https://bugs.webkit.org/show_bug.cgi?id=196604
494         <rdar://problem/49074131>
495
496         Reviewed by Geoffrey Garen.
497
498         Temporarily disable delayed WebProcess launch on iOS to address PLT regression. This
499         is while I figure out how to enable this on iOS without regressed PLT.
500
501         * UIProcess/WebProcessPool.h:
502
503 2019-04-04  Miguel Gomez  <magomez@igalia.com>
504
505         [CoordGraphics] Revalidate need for 'coordinated update completion' in ThreadedCompositor
506         https://bugs.webkit.org/show_bug.cgi?id=188839
507
508         Reviewed by Žan Doberšek.
509
510         Even if a platform layer has changed, don't wait for a main thread callback to finish the
511         CompositingRunLoop update. It can be finished as soon as we receive the frameComplete signal.
512
513         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
514         (WebKit::CompositingRunLoop::scheduleUpdate):
515         (WebKit::CompositingRunLoop::stopUpdates):
516         (WebKit::CompositingRunLoop::updateCompleted):
517         (WebKit::CompositingRunLoop::updateTimerFired):
518         (WebKit::CompositingRunLoop::compositionCompleted): Deleted.
519         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
520         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
521         (WebKit::ThreadedCompositor::renderLayerTree):
522         (WebKit::ThreadedCompositor::sceneUpdateFinished):
523         (WebKit::ThreadedCompositor::displayRefreshMonitor):
524         (WebKit::ThreadedCompositor::handleDisplayRefreshMonitorUpdate): Deleted.
525         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
526         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
527         (WebKit::LayerTreeHost::handleDisplayRefreshMonitorUpdate):
528
529 2019-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
530
531         [ATK] Cleanup WebPageAccessibilityObjectAtk
532         https://bugs.webkit.org/show_bug.cgi?id=196537
533
534         Reviewed by Michael Catanzaro.
535
536         Several changes and cleanups:
537
538          - Add WebKit prefix so that style checker doesn't complain about GObject conventions.
539          - Rename the header to remove the Atk prefix to match the cpp file and class name.
540          - Use pragma once.
541          - Use nullptr instead of 0.
542          - Use WEBKIT_DEFINE_TYPE instead of G_DEFINE_TYPE.
543          - Return generic AtkObject* from constructor.
544
545         * SourcesGTK.txt:
546         * WebProcess/WebPage/WebPage.h:
547         * WebProcess/WebPage/atk/WebKitWebPageAccessibilityObject.cpp: Renamed from Source/WebKit/WebProcess/WebPage/atk/WebPageAccessibilityObjectAtk.cpp.
548         (accessibilityRootObjectWrapper):
549         (webkitWebPageAccessibilityObjectInitialize):
550         (webkitWebPageAccessibilityObjectGetIndexInParent):
551         (webkitWebPageAccessibilityObjectGetNChildren):
552         (webkitWebPageAccessibilityObjectRefChild):
553         (webkit_web_page_accessibility_object_class_init):
554         (webkitWebPageAccessibilityObjectNew):
555         (webkitWebPageAccessibilityObjectRefresh):
556         * WebProcess/WebPage/atk/WebKitWebPageAccessibilityObject.h: Added.
557         * WebProcess/WebPage/atk/WebPageAccessibilityObject.h: Removed.
558         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
559         (WebKit::WebPage::platformInitialize):
560         (WebKit::WebPage::updateAccessibilityTree):
561
562 2019-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
563
564         [ATK] Set ATK_STATE_TRANSIENT on the atk socket until it's embedded
565         https://bugs.webkit.org/show_bug.cgi?id=196535
566
567         Reviewed by Michael Catanzaro.
568
569         This way the properties are not cached. Right now, if number of children is queried before the socket is
570         embedded, 0 is returned and cached, so ATs don't see the child even after the socket has been embedded.
571
572         * UIProcess/API/gtk/WebKitWebViewBaseAccessible.cpp:
573         (webkitWebViewBaseAccessibleRefStateSet): Set ATK_STATE_TRANSIENT is the socket is not occupied.
574         * UIProcess/gtk/WebPageProxyGtk.cpp:
575         (WebKit::WebPageProxy::bindAccessibilityTree): Unset ATK_STATE_TRANSIENT.
576
577 2019-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
578
579         [ATK] Embed the AtkSocket as soon as we receive the plug ID
580         https://bugs.webkit.org/show_bug.cgi?id=196534
581
582         Reviewed by Michael Catanzaro.
583
584         We are currently storing the ID and waiting for the next time get_accessible is called to embed the socket. We
585         can simply embed the socket when the plug ID is received.
586
587         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
588         (webkitWebViewBaseGetAccessible):
589         * UIProcess/WebPageProxy.h:
590         * UIProcess/gtk/WebPageProxyGtk.cpp:
591         (WebKit::WebPageProxy::bindAccessibilityTree):
592
593 2019-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
594
595         [ATK] Don't touch accessibility tree in WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld
596         https://bugs.webkit.org/show_bug.cgi?id=193914
597
598         Reviewed by Michael Catanzaro.
599
600         Move it to dispatchDidFinishDocumentLoad, since we know we have the document at that point and we can create the
601         root accessibility object wrapper.
602
603         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
604         (WebKit::WebFrameLoaderClient::dispatchDidFinishDocumentLoad):
605         (WebKit::WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld):
606
607 2019-04-03  Simon Fraser  <simon.fraser@apple.com>
608
609         Simplify some "programmaticScroll" code paths
610         https://bugs.webkit.org/show_bug.cgi?id=196589
611
612         Reviewed by Zalan Bujtas.
613
614         * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm: Remove the parameter.
615         (WebKit::RemoteScrollingCoordinator::scrollPositionChangedForNode): Use the enum type.
616         * WebProcess/WebPage/ios/WebPageIOS.mm:
617         (WebKit::WebPage::updateVisibleContentRects):
618
619 2019-04-03  Chris Dumez  <cdumez@apple.com>
620
621         The page's focusedFrame / frameSetLargestFrame do not get cleared on process swap or crash
622         https://bugs.webkit.org/show_bug.cgi?id=196588
623         <rdar://problem/49365787>
624
625         Reviewed by Ryosuke Niwa.
626
627         The page's focusedFrame / frameSetLargestFrame do not get cleared on process swap or crash.
628         This can lead to returning stale frames to the client if it asks for those.
629
630         * UIProcess/WebPageProxy.cpp:
631         (WebKit::WebPageProxy::resetState):
632
633 2019-04-03  Simon Fraser  <simon.fraser@apple.com>
634
635         Remove the isProgrammaticScroll argument to requestScroll() because no-one uses it
636         https://bugs.webkit.org/show_bug.cgi?id=196587
637
638         Reviewed by Zalan Bujtas.
639
640         This argument was unused.
641
642         * UIProcess/API/gtk/PageClientImpl.cpp:
643         (WebKit::PageClientImpl::requestScroll):
644         * UIProcess/API/gtk/PageClientImpl.h:
645         * UIProcess/API/wpe/PageClientImpl.cpp:
646         (WebKit::PageClientImpl::requestScroll):
647         * UIProcess/API/wpe/PageClientImpl.h:
648         * UIProcess/PageClient.h:
649         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
650         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
651         * UIProcess/WebPageProxy.cpp:
652         (WebKit::WebPageProxy::requestScroll):
653         * UIProcess/WebPageProxy.h:
654         * UIProcess/ios/PageClientImplIOS.h:
655         * UIProcess/ios/PageClientImplIOS.mm:
656         (WebKit::PageClientImpl::requestScroll):
657         * UIProcess/mac/PageClientImplMac.h:
658         * UIProcess/mac/PageClientImplMac.mm:
659         (WebKit::PageClientImpl::requestScroll):
660         * UIProcess/win/PageClientImpl.cpp:
661         (WebKit::PageClientImpl::requestScroll):
662         * UIProcess/win/PageClientImpl.h:
663
664 2019-04-03  Myles C. Maxfield  <mmaxfield@apple.com>
665
666         -apple-trailing-word is needed for browser detection
667         https://bugs.webkit.org/show_bug.cgi?id=196575
668
669         Unreviewed.
670
671         * Configurations/FeatureDefines.xcconfig:
672
673 2019-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>
674
675         Add a WebKit internal feature flag to always enable modern compatibility mode by default
676         https://bugs.webkit.org/show_bug.cgi?id=196526
677         <rdar://problem/49532923>
678
679         Reviewed by Tim Horton.
680
681         Change UseModernCompatibilityModeByDefault from an internal preference to a debug preference, so that it may be
682         enabled for all apps on the system.
683
684         * Shared/WebPreferences.yaml:
685
686 2019-04-03  Alex Christensen  <achristensen@webkit.org>
687
688         Fix internal build after r243829
689         https://bugs.webkit.org/show_bug.cgi?id=196549
690
691         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
692         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
693         Some SDK's don't include this selector in the header.
694         Use NSSelectorFromString.
695
696 2019-04-03  Don Olmstead  <don.olmstead@sony.com>
697
698         [CMake][WTF] Mirror XCode header directories
699         https://bugs.webkit.org/show_bug.cgi?id=191662
700
701         Reviewed by Konstantin Tokarev.
702
703         Use WTFFramework as a dependency and include frameworks/WTF.cmake for AppleWin internal
704         builds.
705
706         * CMakeLists.txt:
707
708 2019-04-03  Alex Christensen  <achristensen@webkit.org>
709
710         Add SPI to disable legacy TLS fallback
711         https://bugs.webkit.org/show_bug.cgi?id=196549
712         <rdar://44979744>
713
714         Reviewed by Geoffrey Garen.
715
716         * NetworkProcess/NetworkSessionCreationParameters.cpp:
717         (WebKit::NetworkSessionCreationParameters::privateSessionParameters):
718         (WebKit::NetworkSessionCreationParameters::encode const):
719         (WebKit::NetworkSessionCreationParameters::decode):
720         * NetworkProcess/NetworkSessionCreationParameters.h:
721         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
722         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
723         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
724         (-[WKWebsiteDataStore _setAllowsTLSFallback:]):
725         (-[WKWebsiteDataStore _allowsTLSFallback]):
726         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
727         * UIProcess/WebProcessPool.cpp:
728         (WebKit::WebProcessPool::ensureNetworkProcess):
729         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
730         (WebKit::WebsiteDataStore::parameters):
731         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
732         (WebKit::WebsiteDataStore::setSourceApplicationSecondaryIdentifier):
733         (WebKit::WebsiteDataStore::setAllowsTLSFallback):
734         (WebKit::WebsiteDataStore::setSourceApplicationBundleIdentifier):
735         * UIProcess/WebsiteData/WebsiteDataStore.h:
736         (WebKit::WebsiteDataStore::allowsTLSFallback const):
737         (WebKit::WebsiteDataStore::networkingHasBegun):
738         (WebKit::WebsiteDataStore::finalizeApplicationIdentifiers): Deleted.
739
740 2019-04-03  Myles C. Maxfield  <mmaxfield@apple.com>
741
742         Remove support for -apple-trailing-word
743         https://bugs.webkit.org/show_bug.cgi?id=196525
744
745         Reviewed by Zalan Bujtas.
746
747         This CSS property is nonstandard and not used.
748
749         * Configurations/FeatureDefines.xcconfig:
750
751 2019-04-03  Alex Christensen  <achristensen@webkit.org>
752
753         Resurrect and fix layout test http/tests/adClickAttribution/store-ad-click-attribution.html
754         https://bugs.webkit.org/show_bug.cgi?id=196476
755
756         Reviewed by Chris Dumez.
757
758         Re-apply a change I reverted in r241754 now that it's safe to do so.
759
760         * UIProcess/WebPageProxy.cpp:
761         (WebKit::WebPageProxy::didCommitLoadForFrame):
762
763 2019-04-03  Daniel Bates  <dabates@apple.com>
764
765         [iOS] Should be able to dismiss picker or popover using the keyboard
766         https://bugs.webkit.org/show_bug.cgi?id=196272
767         <rdar://problem/48943170>
768
769         Reviewed by Wenson Hsieh.
770
771         Intercept key events and route them to the current input peripheral (if we have one). Add a base key event handler
772         for all form peripherals that dismisses the accessory when either the Escape key is pressed or Command + . is pressed.
773         I will fix this issue for the file upload picker/popover in <https://bugs.webkit.org/show_bug.cgi?id=196287>.
774
775         * SourcesCocoa.txt: Add file WKFormPeripheralBase.mm.
776         * UIProcess/ios/WKContentViewInteraction.mm:
777         (-[WKContentView endEditingAndUpdateFocusAppearanceWithReason]): Added.
778         (-[WKContentView resignFirstResponderForWebView]): Write in terms of -endEditingAndUpdateFocusAppearance.
779         (-[WKContentView inputView]): Code style nit while I am here; add an empty line to demarcate the "crazy"
780         code that the FIXME is referring to and should ideally be removed from the code that is sane to always do.
781         (-[WKContentView accessoryDone]): When the accessory is dismissed via the Done button (iPhone) or by pressing
782         Escape or Command + . using a hardware keyboard (iPhone or iPad) then end the current editing session, but
783         do not resign first responder status as the page activation state should not be changed.
784         (-[WKContentView _handleKeyUIEvent:]): Bring back this code when building with USE(UIKIT_KEYBOARD_ADDITIONS)
785         as we need to route key events to the input peripheral (if we have one). If the input peripheral handles it
786         then we're done: no need to let UIKit or WebKit handle it when building with USE(UIKIT_KEYBOARD_ADDITIONS),
787         respectively. If the input peripheral does not handle it then do what we do now.
788         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
789         If the element is re-focused and we have an input peripheral then we want to ensure we are first responder,
790         reveal the focused element, update the accessory and tell the peripheral that editing has begun (again).
791         For all other element re-focusing where we don't have a peripheral do what we do now. Also, update _isEditable
792         to reflect whether the focused element contains selectable text. This is what UIKit wants to know when it queries
793         -isEditable. Now that we no longer blur the focused element on iPad when the popover is dismissed and keep the
794         peripheral until there is a focus change we need to ensure that we give the correct answer to UIKit on view
795         editability. Otherwise, UIKit thinks it needs to update the text selection state when a popup button is tapped
796         again (as part of its gesture recognizer logic) and this causes an assertion failure in UIKit after it calls back
797         into us to ask for selection details, which we correctly respond with the equivalent of "we have none" and is
798         not the answer UIKit expects since we told it we are editable. (Currently we manage to get away with telling UIKit
799         we are always editable because it is not possible to perform a selection operation when we have a popover open.
800         Closing the popover blurs the element, setting -isEditable to NO and deallocates the peripheral avoiding this issue).
801         * UIProcess/ios/forms/WKFormColorControl.h:
802         * UIProcess/ios/forms/WKFormColorControl.mm:
803         (-[WKColorPopover controlEndEditing]): Dismiss the popover.
804         (-[WKFormColorControl initWithView:]): Modified to call base class initializer.
805         (-[WKFormColorControl assistantView]): Deleted.
806         (-[WKFormColorControl beginEditing]): Deleted.
807         (-[WKFormColorControl endEditing]): Deleted.
808         * UIProcess/ios/forms/WKFormInputControl.h:
809         * UIProcess/ios/forms/WKFormInputControl.mm:
810         (-[WKFormInputControl initWithView:]): Modified to call base class initializer.
811         (-[WKFormInputControl dateTimePickerCalendarType]): Write in terms of self.control.
812         (-[WKDateTimePopover controlEndEditing]): Dismiss the popover and tell the controller that editing ended.
813         (-[WKFormInputControl beginEditing]): Deleted.
814         (-[WKFormInputControl endEditing]): Deleted.
815         (-[WKFormInputControl assistantView]): Deleted.
816         * UIProcess/ios/forms/WKFormPeripheral.h:
817         * UIProcess/ios/forms/WKFormPeripheralBase.h: Added.
818         * UIProcess/ios/forms/WKFormPeripheralBase.mm: Added.
819         (-[WKFormPeripheralBase initWithView:control:]): Take ownership of the passed WKFormControl.
820         (-[WKFormPeripheralBase beginEditing]): Turn around and tell the control.
821         (-[WKFormPeripheralBase endEditing]): Ditto.
822         (-[WKFormPeripheralBase assistantView]): Ditto.
823         (-[WKFormPeripheralBase control]): Return the control.
824         (-[WKFormPeripheralBase handleKeyEvent:]): Dismiss the accessory (in the same way we dismiss when the Done
825         button is pressed on iPhone) on keydown of the Escape key or when we receive a UIKeyInputEscape event (for
826         Command + .).
827         * UIProcess/ios/forms/WKFormSelectControl.h:
828         * UIProcess/ios/forms/WKFormSelectControl.mm:
829         (-[WKFormSelectControl initWithView:]): Modified to call base class initializer.
830         (-[WKFormSelectControl selectRow:inComponent:extendingSelection:]): Write in terms of self.control.
831         (-[WKFormSelectControl selectFormPopoverTitle]): Ditto.
832         (-[WKFormSelectControl assistantView]): Deleted.
833         (-[WKFormSelectControl beginEditing]): Deleted.
834         (-[WKFormSelectControl endEditing]): Deleted.
835         * UIProcess/ios/forms/WKFormSelectPopover.mm:
836         (-[WKSelectPopover controlEndEditing]): Dismiss the popover.
837         * WebKit.xcodeproj/project.pbxproj: Add files WKFormPeripheralBase.{h, mm}.
838
839 2019-04-03  Youenn Fablet  <youenn@apple.com>
840
841         Resetting quota should take into account third party origins
842         https://bugs.webkit.org/show_bug.cgi?id=196462
843
844         Reviewed by Geoffrey Garen.
845
846         When clearing the storage quota, we were resetting it to the default value
847         without taking care of whether third party or not.
848         Updated the code to ensure that the default quota is computed based on the origin.
849
850         Updated existing test to cover this case.
851
852         * NetworkProcess/NetworkProcess.cpp:
853         (WebKit::NetworkProcess::clearStorageQuota):
854         (WebKit::NetworkProcess::setCacheStorageParameters):
855         (WebKit::NetworkProcess::updateQuotaBasedOnSpaceUsageForTesting):
856         (WebKit::NetworkProcess::storageQuotaManager):
857         * NetworkProcess/NetworkProcess.h:
858         (WebKit::NetworkProcess::StorageQuotaManagers::defaultQuota const):
859         (WebKit::NetworkProcess::StorageQuotaManagers::setDefaultQuotas):
860         (WebKit::NetworkProcess::StorageQuotaManagers::managersPerOrigin):
861
862 2019-04-03  Michael Catanzaro  <mcatanzaro@igalia.com>
863
864         Get rid of HTMLInputElement::setEditingValue
865         https://bugs.webkit.org/show_bug.cgi?id=196402
866
867         Reviewed by Darin Adler.
868
869         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMElement.cpp:
870         (webkit_dom_element_html_input_element_set_editing_value):
871         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
872         (webkit_dom_html_input_element_set_editing_value):
873
874 2019-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>
875
876         Add a WebKit internal feature flag to always enable modern compatibility mode by default
877         https://bugs.webkit.org/show_bug.cgi?id=196526
878         <rdar://problem/49532923>
879
880         Reviewed by Antoine Quint.
881
882         * Shared/WebPreferences.yaml:
883
884 2019-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>
885
886         Introduce and add plumbing for a website policy for meta viewport tag handling
887         https://bugs.webkit.org/show_bug.cgi?id=196285
888
889         Reviewed by Tim Horton.
890
891         Add WebsiteMetaViewportPolicy, a bit that can be used to determine whether to respect or ignore the meta
892         viewport tag and use native web page parameters instead of the default parameters.
893
894         * Shared/WebsiteMetaViewportPolicy.h: Copied from Source/WebKit/Shared/WebsitePoliciesData.h.
895         * Shared/WebsitePoliciesData.cpp:
896         (WebKit::WebsitePoliciesData::encode const):
897         (WebKit::WebsitePoliciesData::decode):
898         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
899
900         Convert WebKit::WebsiteMetaViewportPolicy into WebCore::MetaViewportPolicy.
901
902         * Shared/WebsitePoliciesData.h:
903         * UIProcess/API/APIWebsitePolicies.cpp:
904         (API::WebsitePolicies::data):
905         * UIProcess/API/APIWebsitePolicies.h:
906
907         Add additional plumbing for the policy flag.
908
909         * WebKit.xcodeproj/project.pbxproj:
910         * WebProcess/WebPage/ios/WebPageIOS.mm:
911         (WebKit::WebPage::resetViewportDefaultConfiguration):
912
913         Use native web page parameters if either "shouldIgnoreMetaViewport" is enabled, or the new policy is set.
914         Eventually, the policy should completely replace the former preference once no internal clients depend on it.
915
916 2019-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>
917
918         Add plumbing for a compatibility mode preference in WebKit
919         https://bugs.webkit.org/show_bug.cgi?id=196005
920
921         Reviewed by Tim Horton.
922
923         Add plumbing between the Cocoa API object (WKWebpagePreferences) and the inner C++ API object
924         (API::WebsitePolicies) for compatibility mode.
925
926         * Shared/WebCompatibilityMode.h: Added.
927         * UIProcess/API/APIWebsitePolicies.h:
928         * UIProcess/API/Cocoa/WKWebpagePreferences.mm:
929         * UIProcess/Cocoa/NavigationState.mm:
930         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
931         * UIProcess/WebPageProxy.cpp:
932         (WebKit::WebPageProxy::adjustPoliciesForCompatibilityMode):
933         * UIProcess/WebPageProxy.h:
934         * UIProcess/ios/WebPageProxyIOS.mm:
935         * WebKit.xcodeproj/project.pbxproj:
936
937 2019-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
938
939         [CoordinatedGraphics] Hidden pages are not suspended after a web view resize
940         https://bugs.webkit.org/show_bug.cgi?id=196487
941
942         Reviewed by Žan Doberšek.
943
944         When resizing the window, the hidden tabs are updated too, to avoid flickering or getting the old size when
945         switching tabs. For that we need to resume painting but we are not suspending it again after the update.
946
947         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
948         (WebKit::DrawingAreaCoordinatedGraphics::updateBackingStoreState): Suspend the painting again after a
949         synchronous update if needed.
950
951 2019-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
952
953         Web Inspector: [GTK] Copy copies to nowhere
954         https://bugs.webkit.org/show_bug.cgi?id=181228
955
956         Reviewed by Michael Catanzaro.
957
958         The thing is that those items are actually submenu items, with options, for example in the case of Copy to copy
959         HTML, Text, XPath, etc. We are not correctly handling submenus when populating the context menu received from
960         the web process.
961
962         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
963         (WebKit::WebContextMenuProxyGtk::populateSubMenu): Helper to populate submenu items recursively.
964         (WebKit::WebContextMenuProxyGtk::populate): Handle submenu items.
965         * UIProcess/gtk/WebContextMenuProxyGtk.h:
966
967 2019-04-02  Wenson Hsieh  <wenson_hsieh@apple.com>
968
969         [Cocoa] Add new API around WKWebpagePreferences in WKNavigationDelegate and WKWebViewConfiguration
970         https://bugs.webkit.org/show_bug.cgi?id=196284
971         <rdar://problem/47228232>
972
973         Reviewed by Tim Horton.
974
975         Tests for both of these APIs will be added in a subsequent patch.
976
977         * Shared/API/Cocoa/WebKit.h:
978         * UIProcess/API/APIPageConfiguration.cpp:
979         (API::PageConfiguration::defaultWebsitePolicies const):
980         (API::PageConfiguration::setDefaultWebsitePolicies):
981         * UIProcess/API/APIPageConfiguration.h:
982         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
983
984         Add a new navigation delegate hook to allow clients to return a WKWebpagePreference targeting the given
985         navigation action.
986
987         * UIProcess/API/Cocoa/WKWebView.mm:
988         (-[WKWebView _initializeWithConfiguration:]):
989         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
990         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
991
992         Add new API on WKWebViewConfiguration to specify a default WKWebpagePreference to use when navigating.
993
994         (-[WKWebViewConfiguration copyWithZone:]):
995         (-[WKWebViewConfiguration defaultWebpagePreferences]):
996         (-[WKWebViewConfiguration setDefaultWebpagePreferences:]):
997         * UIProcess/API/Cocoa/WKWebpagePreferences.h:
998         * UIProcess/Cocoa/NavigationState.h:
999         * UIProcess/Cocoa/NavigationState.mm:
1000         (WebKit::NavigationState::setNavigationDelegate):
1001         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
1002
1003         Invoke the new WKWebpagePreferences-based navigation delegate method.
1004
1005         * WebKit.xcodeproj/project.pbxproj:
1006         * mac/postprocess-framework-headers.sh:
1007         * mac/replace-webkit-additions-in-framework-headers.sh: Added.
1008
1009         Move logic in the "Postprocess Framework Headers" step responsible for stripping away included files from
1010         WebKitAdditions out into a separate build phase, called "Replace WebKitAdditions in Framework Headers". This
1011         ensures headers attempting to include from WebKitAdditions have these additional statements removed.
1012
1013 2019-04-02  Geoffrey Garen  <ggaren@apple.com>
1014
1015         Eliminate plugin sandbox exceptions
1016         https://bugs.webkit.org/show_bug.cgi?id=196510
1017
1018         Reviewed by Chris Dumez.
1019
1020         * PluginProcess/mac/PluginProcessMac.mm:
1021         (WebKit::PluginProcess::initializeSandbox):
1022         * UIProcess/Plugins/PluginInfoStore.cpp:
1023         (WebKit::PluginInfoStore::shouldAllowPluginToRunUnsandboxed): Deleted.
1024         * UIProcess/Plugins/PluginInfoStore.h:
1025         * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
1026         (WebKit::PluginInfoStore::shouldUsePlugin):
1027         (WebKit::PluginInfoStore::shouldAllowPluginToRunUnsandboxed): Deleted.
1028
1029 2019-04-02  Alex Christensen  <achristensen@webkit.org>
1030
1031         Fix assertion in http/tests/adClickAttribution/store-ad-click-attribution.html
1032         https://bugs.webkit.org/show_bug.cgi?id=196503
1033
1034         Reviewed by Chris Dumez.
1035
1036         In WebPageProxy::didDestroyNavigation we try to ignore a request to destroy a navigation from a page being navigated from
1037         during a cross-site navigation, but if the old web process sends the message after WebPageProxy::commitProvisionalPage
1038         has been called, we can still destroy a navigation when we are continuing a navigation in another process.  To prevent this,
1039         have the process not send the message when it knows the navigation is continuing in another process.
1040         Also make the use of unchecked navigation pointers more robust by checking it for nullity.
1041
1042         * UIProcess/WebPageProxy.cpp:
1043         (WebKit::WebPageProxy::didCommitLoadForFrame):
1044         * WebProcess/WebPage/WebFrame.cpp:
1045         (WebKit::WebFrame::didReceivePolicyDecision):
1046         (WebKit::WebFrame::documentLoaderDetached):
1047         * WebProcess/WebPage/WebFrame.h:
1048
1049 2019-04-02  Per Arne Vollan  <pvollan@apple.com>
1050
1051         [iOS] Fix iokit-get-properties sandbox violation in the WebContent process
1052         https://bugs.webkit.org/show_bug.cgi?id=196500
1053         <rdar://problem/49497788>
1054
1055         Reviewed by Brent Fulgham.
1056
1057         Attempting to get the iokit properties 'product-description', 'artwork-display-gamut' and
1058         'artwork-scale-factor' is causing sandbox violations.
1059
1060         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1061
1062 2019-04-02  Chris Dumez  <cdumez@apple.com>
1063
1064         [WK2] Add support for Window's beforeprint / afterprint events
1065         https://bugs.webkit.org/show_bug.cgi?id=196478
1066
1067         Reviewed by Alex Christensen.
1068
1069         Add support for Window's beforeprint / afterprint events as per:
1070         - https://html.spec.whatwg.org/#dom-print
1071
1072         Blink and Gecko already support this.
1073
1074         * WebProcess/WebPage/WebPage.cpp:
1075         (WebKit::WebPage::beginPrinting):
1076         (WebKit::WebPage::endPrinting):
1077
1078 2019-04-02  Wenson Hsieh  <wenson_hsieh@apple.com>
1079
1080         REGRESSION (r243726): Crash at unrecognized selector: -[WKWebpagePreferences webpagePreferences]
1081         https://bugs.webkit.org/show_bug.cgi?id=196496
1082         <rdar://problem/49521634>
1083
1084         Reviewed by Chris Dumez.
1085
1086         r243726 made an incorrect assumption that all callers of -decidePolicyForNavigationAction:decisionHandler: and
1087         -decidePolicyForNavigationAction:userInfo:decisionHandler: must be instances of _WKWebsitePolicies, as opposed
1088         to the new WKWebpagePreferences. However, it's possible for clients (in this case, Safari) to already generate
1089         and pass in an instance of WKWebpagePreferences by bridging the C API opaque ref (WKWebsitePoliciesRef) into the
1090         Objective-C object (which is now WKWebpagePreferences, after my change).
1091
1092         To maintain binary compatibility of trunk WebKit against prior versions of Safari, we need to handle both
1093         WKWebpagePreferences and the soon-to-be-deprecated _WKWebsitePolicies in the navigation action policy decision
1094         handler.
1095
1096         Tests:  WebKit.WebsitePoliciesWithBridgingCast
1097                 WebKit.WebsitePoliciesWithUnexpectedType
1098
1099         * UIProcess/Cocoa/NavigationState.mm:
1100         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
1101
1102 2019-04-01  Chris Dumez  <cdumez@apple.com>
1103
1104         Unreviewed, drop debug logging landed as part of r242903 by mistake.
1105
1106         * UIProcess/WebPageProxy.cpp:
1107         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1108
1109 2019-04-01  Remy Demarest  <rdemarest@apple.com>
1110
1111         Add SPI to give injected bundles access to displayed PDFDocuments
1112         https://bugs.webkit.org/show_bug.cgi?id=196471
1113         <rdar://problem/48080768>
1114
1115         Reviewed by Tim Horton.
1116
1117         * WebKit.xcodeproj/project.pbxproj:
1118
1119         * WebProcess/InjectedBundle/API/c/mac/WKBundlePageMac.h: Added.
1120         * WebProcess/InjectedBundle/API/c/mac/WKBundlePageMac.mm: Added.
1121         (WKBundlePageGetPDFDocumentInFrame):
1122
1123 2019-04-01  Wenson Hsieh  <wenson_hsieh@apple.com>
1124
1125         [WebKit2] Introduce a public version of WKWebsitePolicies
1126         https://bugs.webkit.org/show_bug.cgi?id=195989
1127         <rdar://problem/47228232>
1128
1129         Reviewed by Tim Horton.
1130
1131         Expose the existing _WKWebsitePolicies object as WKWebpagePreferences, in what will eventually become a public
1132         header in the WebKit SDK (WKWebpagePreferences.h). Following a similar transitioning strategy as
1133         _WKWebsiteDataStore and WKWebsiteDataStore, we move existing logic from _WKWebsitePolicies to WKWebpagePreferences
1134         and make _WKWebsitePolicies a wrapper around WKWebpagePreferences.
1135
1136         No change in behavior.
1137
1138         * Shared/Cocoa/APIObject.mm:
1139         (API::Object::newObject):
1140
1141         Wrap API::WebsitePolicies with WKWebpagePreferences.
1142
1143         * SourcesCocoa.txt:
1144         * UIProcess/API/Cocoa/WKWebView.mm:
1145         (-[WKWebView _updateWebsitePolicies:]):
1146         * UIProcess/API/Cocoa/WKWebpagePreferences.h: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKWebsitePoliciesInternal.h.
1147         * UIProcess/API/Cocoa/WKWebpagePreferences.mm: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKWebsitePolicies.mm.
1148
1149         Introduce WKWebpagePreferences.
1150
1151         (+[WKWebpagePreferences defaultPreferences]):
1152         (-[WKWebpagePreferences dealloc]):
1153         (-[WKWebpagePreferences init]):
1154         (-[WKWebpagePreferences _setContentBlockersEnabled:]):
1155         (-[WKWebpagePreferences _contentBlockersEnabled]):
1156         (-[WKWebpagePreferences _setAllowedAutoplayQuirks:]):
1157         (-[WKWebpagePreferences _allowedAutoplayQuirks]):
1158         (-[WKWebpagePreferences _setAutoplayPolicy:]):
1159         (-[WKWebpagePreferences _autoplayPolicy]):
1160         (-[WKWebpagePreferences _setDeviceOrientationAndMotionAccessPolicy:]):
1161         (-[WKWebpagePreferences _deviceOrientationAndMotionAccessPolicy]):
1162         (-[WKWebpagePreferences _setPopUpPolicy:]):
1163         (-[WKWebpagePreferences _popUpPolicy]):
1164         (-[WKWebpagePreferences _customHeaderFields]):
1165         (-[WKWebpagePreferences _setCustomHeaderFields:]):
1166         (-[WKWebpagePreferences _websiteDataStore]):
1167         (-[WKWebpagePreferences _setWebsiteDataStore:]):
1168         (-[WKWebpagePreferences _setCustomUserAgent:]):
1169         (-[WKWebpagePreferences _customUserAgent]):
1170         (-[WKWebpagePreferences _setCustomJavaScriptUserAgentAsSiteSpecificQuirks:]):
1171         (-[WKWebpagePreferences _customJavaScriptUserAgentAsSiteSpecificQuirks]):
1172         (-[WKWebpagePreferences _setCustomNavigatorPlatform:]):
1173         (-[WKWebpagePreferences _customNavigatorPlatform]):
1174         (-[WKWebpagePreferences _apiObject]):
1175         * UIProcess/API/Cocoa/WKWebpagePreferencesInternal.h: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKWebsitePoliciesInternal.h.
1176         * UIProcess/API/Cocoa/WKWebpagePreferencesPrivate.h: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKWebsitePolicies.h.
1177
1178         Reintroduce all the interfaces currently available on _WKWebsitePolicies as underscore-prefixed SPI on
1179         WKWebpagePreferences.
1180
1181         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
1182         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
1183
1184         Make _WKWebsitePolicies wrap WKWebpagePreferences, and plumb all existing SPI on WKWebsitePolicies through to
1185         WKWebpagePreferences.
1186
1187         (-[_WKWebsitePolicies init]):
1188         (-[_WKWebsitePolicies webpagePreferences]):
1189         (-[_WKWebsitePolicies setContentBlockersEnabled:]):
1190         (-[_WKWebsitePolicies contentBlockersEnabled]):
1191         (-[_WKWebsitePolicies setAllowedAutoplayQuirks:]):
1192         (-[_WKWebsitePolicies allowedAutoplayQuirks]):
1193         (-[_WKWebsitePolicies setAutoplayPolicy:]):
1194         (-[_WKWebsitePolicies autoplayPolicy]):
1195         (-[_WKWebsitePolicies setDeviceOrientationAndMotionAccessPolicy:]):
1196         (-[_WKWebsitePolicies deviceOrientationAndMotionAccessPolicy]):
1197         (-[_WKWebsitePolicies setPopUpPolicy:]):
1198         (-[_WKWebsitePolicies popUpPolicy]):
1199         (-[_WKWebsitePolicies customHeaderFields]):
1200         (-[_WKWebsitePolicies setCustomHeaderFields:]):
1201         (-[_WKWebsitePolicies websiteDataStore]):
1202         (-[_WKWebsitePolicies setWebsiteDataStore:]):
1203         (-[_WKWebsitePolicies setCustomUserAgent:]):
1204         (-[_WKWebsitePolicies customUserAgent]):
1205         (-[_WKWebsitePolicies setCustomJavaScriptUserAgentAsSiteSpecificQuirks:]):
1206         (-[_WKWebsitePolicies customJavaScriptUserAgentAsSiteSpecificQuirks]):
1207         (-[_WKWebsitePolicies setCustomNavigatorPlatform:]):
1208         (-[_WKWebsitePolicies customNavigatorPlatform]):
1209         (-[_WKWebsitePolicies description]):
1210         (-[_WKWebsitePolicies _apiObject]):
1211         (-[_WKWebsitePolicies dealloc]): Deleted.
1212         * UIProcess/API/Cocoa/_WKWebsitePoliciesInternal.h:
1213         * UIProcess/Cocoa/NavigationState.mm:
1214         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
1215         * WebKit.xcodeproj/project.pbxproj:
1216
1217 2019-04-01  Wenson Hsieh  <wenson_hsieh@apple.com>
1218
1219         Unable to copy and paste a PDF from Notes into Mail compose body
1220         https://bugs.webkit.org/show_bug.cgi?id=196442
1221         <rdar://problem/48573098>
1222
1223         Reviewed by Tim Horton.
1224
1225         Relax the -canPerformAction: logic in the case of pasting an attachment. Consider an NSItemProvider to possibly
1226         paste as an attachment if either it has a preferred presentation style of UIPreferredPresentationStyleAttachment
1227         or has a style of UIPreferredPresentationStyleUnspecified, but has a suggested file name.
1228
1229         This allows for the "Paste" action to be shown in the callout menu when copying and pasting a non-text file.
1230
1231         * UIProcess/ios/WKContentViewInteraction.mm:
1232         (-[WKContentView canPerformActionForWebView:withSender:]):
1233
1234 2019-04-01  Tim Horton  <timothy_horton@apple.com>
1235
1236         Make UIWKDocumentContext rects per-character instead of per-word
1237         https://bugs.webkit.org/show_bug.cgi?id=196459
1238
1239         Reviewed by Wenson Hsieh.
1240
1241         * WebProcess/WebPage/ios/WebPageIOS.mm:
1242         (WebKit::WebPage::requestDocumentEditingContext):
1243         Switch to CharacterIterator instead of TextIterator directly, to get
1244         per-character rects as the API requests.
1245
1246 2019-04-01  Chris Dumez  <cdumez@apple.com>
1247
1248         UIProcess crash when a prewarmed process is terminated
1249         https://bugs.webkit.org/show_bug.cgi?id=196451
1250         <rdar://problem/49245471>
1251
1252         Reviewed by Geoffrey Garen.
1253
1254         Stop assuming that WebProcessProxy::m_websiteDataStore is non-null as this is no longer
1255         true after r243384. For example, prewarmed WebContent processe do not get a data store
1256         until they actually get used.
1257
1258         * UIProcess/API/Cocoa/WKProcessPool.mm:
1259         (-[WKProcessPool _prewarmedProcessIdentifier]):
1260         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1261         * UIProcess/WebProcessPool.cpp:
1262         (WebKit::WebProcessPool::networkProcessIdentifier):
1263         (WebKit::WebProcessPool::prewarmedProcessIdentifier):
1264         * UIProcess/WebProcessPool.h:
1265         * UIProcess/WebProcessProxy.cpp:
1266         (WebKit::WebProcessProxy::didClose):
1267         (WebKit::WebProcessProxy::didFinishLaunching):
1268         (WebKit::WebProcessProxy::requestTermination):
1269         (WebKit::WebProcessProxy::isReleaseLoggingAllowed const):
1270         * UIProcess/WebProcessProxy.h:
1271
1272 2019-04-01  Patrick Griffis  <pgriffis@igalia.com>
1273
1274         [GTK][WPE] Add more websitedatastore directories to web process sandbox
1275         https://bugs.webkit.org/show_bug.cgi?id=196447
1276
1277         Reviewed by Michael Catanzaro.
1278
1279         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
1280         (WebKit::bubblewrapSpawn):
1281         * UIProcess/glib/WebProcessProxyGLib.cpp:
1282         (WebKit::WebProcessProxy::platformGetLaunchOptions):
1283
1284 2019-04-01  Per Arne Vollan  <pvollan@apple.com>
1285
1286         [macOS] Crash when loading Twitter with autoplay video enabled.
1287         https://bugs.webkit.org/show_bug.cgi?id=196446
1288         <rdar://problem/49060359>
1289
1290         Reviewed by Brent Fulgham.
1291
1292         This is caused by a syscall violation.
1293
1294         * WebProcess/com.apple.WebProcess.sb.in:
1295
1296 2019-04-01  Patrick Griffis  <pgriffis@igalia.com>
1297
1298         [GTK][WPE] Fix seccomp rule for blacklisting TIOCSTI
1299         https://bugs.webkit.org/show_bug.cgi?id=196297
1300
1301         Reviewed by Michael Catanzaro.
1302
1303         More information can be found here: https://www.exploit-db.com/exploits/46594
1304
1305         Note that this sandbox never made it into production so does not
1306         warrant any CVE specific to WebKit.
1307
1308         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
1309         (WebKit::setupSeccomp):
1310
1311 2019-03-31  Wenson Hsieh  <wenson_hsieh@apple.com>
1312
1313         [iOS] Crash when changing inputmode for certain types of focusable elements
1314         https://bugs.webkit.org/show_bug.cgi?id=196431
1315         <rdar://problem/49454962>
1316
1317         Reviewed by Tim Horton.
1318
1319         The crash is happening because WebPage::focusedElementDidChangeInputMode assumes that the document's focused
1320         element must be the same as m_focusedElement in WebPage. However, this is not the case, since m_focusedElement
1321         is only set for certain types of elements that require user input (e.g. text fields, editable content, select
1322         menus, etc.). The function then attempts to dereference m_focusedElement, which may be null if the document's
1323         focused element doesn't fall into one of the aforementioned categories.
1324
1325         To fix this, bail if the element that is changing inputmode is not equal to the WebPage's current focused
1326         element. See below for more details.
1327
1328         Test: fast/forms/change-inputmode-crash.html
1329
1330         * WebProcess/WebPage/WebPage.cpp:
1331         (WebKit::isTextFormControlOrEditableContent):
1332
1333         Clean up some existing logic by introducing a helper method for determining whether an element should
1334         propagate inputmode attribute changes to the UI process. Also, check the element type using type traits instead
1335         of checking against the tag name.
1336
1337         (WebKit::WebPage::elementDidFocus):
1338         (WebKit::WebPage::focusedElementDidChangeInputMode):
1339
1340 2019-03-31  Sam Weinig  <weinig@apple.com>
1341
1342         Remove more i386 specific configurations
1343         https://bugs.webkit.org/show_bug.cgi?id=196430
1344
1345         Reviewed by Alexey Proskuryakov.
1346
1347         * Configurations/BaseTarget.xcconfig:
1348         WK_HAVE_CORE_PREDICTION can now be enabled unconditionally.
1349  
1350         * Configurations/FeatureDefines.xcconfig:
1351         ENABLE_WEB_AUTHN_macosx can now be enabled unconditionally on macOS.
1352
1353 2019-03-31  Andy Estes  <aestes@apple.com>
1354
1355         [iOS] WebKit should consult the navigation response policy delegate before previewing a QuickLook document
1356         https://bugs.webkit.org/show_bug.cgi?id=196433
1357         <rdar://problem/49293305>
1358
1359         Reviewed by Tim Horton.
1360
1361         Added WKWebViewConfiguration SPI for setting the QuickLook navigation response policy
1362         decision behavior. The configuration setting defaults to YES for clients linked on or after
1363         this WebKit change and NO otherwise.
1364
1365         * NetworkProcess/NetworkResourceLoader.cpp:
1366         (WebKit::NetworkResourceLoader::shouldInterruptLoadForCSPFrameAncestorsOrXFrameOptions):
1367         * Shared/WebPreferences.yaml:
1368         * Shared/ios/QuickLookDocumentData.cpp:
1369         (WebKit::QuickLookDocumentData::isEmpty const):
1370         * Shared/ios/QuickLookDocumentData.h:
1371         * UIProcess/API/Cocoa/WKWebView.mm:
1372         (-[WKWebView _initializeWithConfiguration:]):
1373         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1374         (defaultShouldDecidePolicyBeforeLoadingQuickLookPreview):
1375         (-[WKWebViewConfiguration init]):
1376         (-[WKWebViewConfiguration encodeWithCoder:]):
1377         (-[WKWebViewConfiguration initWithCoder:]):
1378         (-[WKWebViewConfiguration copyWithZone:]):
1379         (-[WKWebViewConfiguration _shouldDecidePolicyBeforeLoadingQuickLookPreview]):
1380         (-[WKWebViewConfiguration _setShouldDecidePolicyBeforeLoadingQuickLookPreview:]):
1381         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
1382         * UIProcess/Cocoa/VersionChecks.h:
1383         * WebProcess/WebCoreSupport/ios/WebPreviewLoaderClient.cpp:
1384         (WebKit::WebPreviewLoaderClient::didReceiveDataArray):
1385
1386 2019-03-30  Zalan Bujtas  <zalan@apple.com>
1387
1388         [ContentChangeObserver] Subframe load should not reset content observation on the mainframe
1389         https://bugs.webkit.org/show_bug.cgi?id=196408
1390         <rdar://problem/49436797>
1391
1392         Reviewed by Simon Fraser.
1393
1394         Hover intent fails when an unrelated frame commits a load the same time.
1395         cancelPotentialTapInFrame is called from didCommitLoad, but what we are looking for here is the user initiated cancel of a tap (cancelPotentialTap).
1396         (If the current frame navigates away, willDetachPage takes care of canceling the observation.)
1397
1398         * WebProcess/WebPage/ios/WebPageIOS.mm:
1399         (WebKit::WebPage::cancelPotentialTap):
1400         (WebKit::WebPage::cancelPotentialTapInFrame):
1401
1402 2019-03-29  John Wilander  <wilander@apple.com>
1403
1404         Move WebResourceLoadStatisticsStore IPC calls from the UI process to the network process
1405         https://bugs.webkit.org/show_bug.cgi?id=196407
1406         <rdar://problem/47859936>
1407
1408         Reviewed by Brent Fulgham.
1409
1410         The two WebResourceLoadStatisticsStore IPC endpoints were left behind when we
1411         moved Resource Load Statistics from the UI process to the network process. One
1412         of the endpoints is the message RequestStorageAccessUnderOpener which underpins
1413         our compatibility fix for federated logins using popups. This patch redirects
1414         these IPC calls to the network process and cleans up some assumptions around
1415         them.
1416
1417         * CMakeLists.txt:
1418             Removed the old IPC receiver.
1419         * DerivedSources.make:
1420             Removed the old IPC receiver.
1421         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
1422         (WebKit::WebResourceLoadStatisticsStore::requestUpdate): Deleted.
1423             This is no longer needed since there is a dedicated update mechanism
1424             that actually sends the update.
1425         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
1426         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1427         (WebKit::NetworkConnectionToWebProcess::resourceLoadStatisticsUpdated):
1428         (WebKit::NetworkConnectionToWebProcess::requestStorageAccessUnderOpener):
1429             Two new IPC receivers to pipe the calls to the network process.
1430         (WebKit::NetworkConnectionToWebProcess::requestResourceLoadStatisticsUpdate): Deleted.
1431             NetworkConnectionToWebProcess::resourceLoadStatisticsUpdated now serves
1432             this purpose.
1433         * NetworkProcess/NetworkConnectionToWebProcess.h:
1434         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1435         * UIProcess/WebResourceLoadStatisticsStore.messages.in: Removed.
1436             Removed the old IPC receiver.
1437         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1438         * WebKit.xcodeproj/project.pbxproj:
1439         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
1440         (WKBundleResourceLoadStatisticsNotifyObserver):
1441             Function name update.
1442         * WebProcess/WebProcess.cpp:
1443             Now calls IPC to the network process instead of the UI process.
1444
1445 2019-03-29  Myles C. Maxfield  <mmaxfield@apple.com>
1446
1447         Delete WebMetal implementation in favor of WebGPU
1448         https://bugs.webkit.org/show_bug.cgi?id=195418
1449
1450         Reviewed by Dean Jackson.
1451
1452         * Configurations/FeatureDefines.xcconfig:
1453         * Shared/WebPreferences.yaml:
1454         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1455         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1456
1457 2019-03-29  Takashi Komori  <Takashi.Komori@sony.com>
1458
1459         [Curl] Add Server Trust Evaluation Support.
1460         https://bugs.webkit.org/show_bug.cgi?id=191646
1461
1462         Reviewed by Fujii Hironori.
1463
1464         Tests: http/tests/ssl/iframe-upgrade.https.html
1465                http/tests/ssl/mixedContent/insecure-websocket.html
1466                http/tests/ssl/upgrade-origin-usage.html
1467
1468         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
1469         (WebKit::NetworkDataTaskCurl::curlDidFailWithError):
1470         (WebKit::NetworkDataTaskCurl::tryServerTrustEvaluation):
1471         (WebKit::NetworkDataTaskCurl::restartWithCredential):
1472         * NetworkProcess/curl/NetworkDataTaskCurl.h:
1473
1474 2019-03-29  Cathie Chen  <cathiechen@igalia.com>
1475
1476         Implement ResizeObserver.
1477         https://bugs.webkit.org/show_bug.cgi?id=157743
1478
1479         Reviewed by Simon Fraser.
1480
1481         Add WebPreferences and FeatureDefines for ResizeObserver.
1482
1483         * Configurations/FeatureDefines.xcconfig:
1484         * Shared/WebPreferences.yaml:
1485
1486 2019-03-28  Timothy Hatcher  <timothy@apple.com>
1487
1488         CFDictionary encoder crashes on non-string keys.
1489         https://bugs.webkit.org/show_bug.cgi?id=196388
1490         rdar://problem/49339242
1491
1492         Reviewed by Ryosuke Niwa.
1493
1494         Allow non-string keys in CFDictionary encoding/decoding. Encode the correct
1495         size for dictionaries and arrays when unknown keys or values are skipped.
1496         Allow null array encoding and decoding like dictionary already allowed.
1497
1498         * Shared/cf/ArgumentCodersCF.cpp:
1499         (IPC::encode):
1500         (IPC::decode):
1501
1502 2019-03-28  John Wilander  <wilander@apple.com>
1503
1504         Resource Load Statistics: IPC to the WebsiteDataStore in the UI process from NetworkProcess::deleteWebsiteDataForRegistrableDomains()
1505         https://bugs.webkit.org/show_bug.cgi?id=196281
1506         <rdar://problem/48938748>
1507
1508         Reviewed by Alex Christensen.
1509
1510         The move of Resource Load Statistics to the network process requires that it
1511         calls the UI process when clearing website data (previously the other way
1512         around). This patch achieves that.
1513
1514         Specifically, NetworkProcess::deleteWebsiteDataForRegistrableDomains() now
1515         filters its WebsiteDataTypes down to just the ones applicable for the UI
1516         process and then calls DeleteWebsiteDataInUIProcessForRegistrableDomains over
1517         IPC.
1518
1519         NetworkProcessProxy::deleteWebsiteDataInUIProcessForRegistrableDomains() on
1520         the UI process side makes use of the re-introduced
1521         WebsiteDataStore::fetchDataForRegistrableDomains() function to get the relevant
1522         data records and call WebsiteDataStore::removeData(). The re-introduced
1523         WebsiteDataStore::fetchDataForRegistrableDomains() was removed as dead code in
1524         https://trac.webkit.org/changeset/242056/webkit, then under the name
1525         WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains(). The reason it
1526         was dead code was the lack of IPC call that this patch adds.
1527
1528         * NetworkProcess/NetworkProcess.cpp:
1529         (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
1530            Now calls DeleteWebsiteDataInUIProcessForRegistrableDomains over IPC if there
1531            are WebsiteDataTypes applicable to the UI process.
1532         * NetworkProcess/NetworkProcess.h:
1533         * Shared/WebsiteData/WebsiteData.cpp:
1534         (WebKit::WebsiteData::ownerProcess):
1535         (WebKit::WebsiteData::filter):
1536             Convenience functions to manage process ownership of website data types.
1537         * Shared/WebsiteData/WebsiteData.h:
1538         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1539         (WKWebsiteDataStoreStatisticsHasLocalStorage):
1540             Test infrastructure, called by the TestRunner.
1541         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
1542         * UIProcess/Network/NetworkProcessProxy.cpp:
1543         (WebKit::NetworkProcessProxy::deleteWebsiteDataInUIProcessForRegistrableDomains):
1544             New function to be called from the network process.
1545         * UIProcess/Network/NetworkProcessProxy.h:
1546         * UIProcess/Network/NetworkProcessProxy.messages.in:
1547         * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
1548         (WebKit::WebsiteDataRecord::matches const):
1549             Now matches with WebCore::RegistrableDomain instead of a string.
1550         (WebKit::WebsiteDataRecord::matchesTopPrivatelyControlledDomain const): Deleted.
1551             Replaced by WebsiteDataRecord::matches().
1552         * UIProcess/WebsiteData/WebsiteDataRecord.h:
1553         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1554         (WebKit::WebsiteDataStore::fetchDataForRegistrableDomains):
1555             Re-introduced. It was removed as dead code in r242056.
1556         (WebKit::computeNetworkProcessAccessTypeForDataRemoval):
1557         (WebKit::WebsiteDataStore::hasLocalStorageForTesting const):
1558             Test infrastructure, called by the TestRunner.
1559         * UIProcess/WebsiteData/WebsiteDataStore.h:
1560
1561 2019-03-28  Jiewen Tan  <jiewen_tan@apple.com>
1562
1563         API::Data::createWithoutCopying should do a null check before calling CFRelease
1564         https://bugs.webkit.org/show_bug.cgi?id=196276
1565         <rdar://problem/48059859>
1566
1567         Reviewed by Alex Christensen.
1568
1569         * Shared/Cocoa/APIDataCocoa.mm:
1570         (API::Data::createWithoutCopying):
1571
1572 2019-03-28  Per Arne Vollan  <pvollan@apple.com>
1573
1574         [iOS] Automatic focus of input field is flaky
1575         https://bugs.webkit.org/show_bug.cgi?id=196302
1576
1577         Reviewed by Brent Fulgham.
1578
1579         Sometimes the status of whether a keyboard is connected can be incorrect, both in the UI process, and in
1580         the WebContent process. Fix this by sending the keyboard status to the WebContent process as part of the
1581         Web page creation parameters. Stop caching the keyboard status in the Web process proxy, and call
1582         [UIKeyboard isInHardwareKeyboardMode] instead, since this method is swizzled in the test harness.
1583
1584         * Shared/WebPageCreationParameters.cpp:
1585         (WebKit::WebPageCreationParameters::encode const):
1586         (WebKit::WebPageCreationParameters::decode):
1587         * Shared/WebPageCreationParameters.h:
1588         * UIProcess/API/Cocoa/WKWebView.mm:
1589         (hardwareKeyboardAvailabilityChangedCallback):
1590         * UIProcess/WebPageProxy.cpp:
1591         (WebKit::WebPageProxy::creationParameters):
1592         * UIProcess/WebPageProxy.h:
1593         * UIProcess/WebProcessProxy.cpp:
1594         * UIProcess/WebProcessProxy.h:
1595         (WebKit::WebProcessProxy::setKeyboardIsAttached): Deleted.
1596         (WebKit::WebProcessProxy::keyboardIsAttached const): Deleted.
1597         * UIProcess/ios/WKContentViewInteraction.mm:
1598         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
1599         * UIProcess/ios/WebPageProxyIOS.mm:
1600         (WebKit::WebPageProxy::isInHardwareKeyboardMode):
1601         (WebKit::WebPageProxy::applicationWillEnterForeground):
1602         * WebProcess/WebPage/WebPage.cpp:
1603         * WebProcess/WebPage/WebPage.h:
1604
1605 2019-03-28  Tim Horton  <timothy_horton@apple.com>
1606
1607         Fix the build.
1608
1609         * UIProcess/ios/WKActionSheetAssistant.mm:
1610         (-[WKActionSheetAssistant showImageSheet]):
1611         * UIProcess/ios/WKContentViewInteraction.mm:
1612         (-[WKContentView actionSheetAssistant:showCustomSheetForElement:]):
1613
1614 2019-03-28  Michael Catanzaro  <mcatanzaro@igalia.com>
1615
1616         [WPE][GTK] webkit_web_resource_get_data_finish can return NULL without setting error
1617         https://bugs.webkit.org/show_bug.cgi?id=186276
1618
1619         Reviewed by Carlos Garcia Campos.
1620
1621         Currently it's possible for webkit_web_resource_get_data_finish() to return NULL without
1622         setting the error parameter. This is illegal because it is an API guarantee (and a GObject
1623         convention) that if an error parameter exists, it should be set whenever a function call
1624         returns NULL. Epiphany correctly dereferences the error in this case without checking if it
1625         is NULL, because it knows it does not have to, and crashes. Fix this. We'll return a byte
1626         array of length 1 containing a NUL character. This isn't great, but there's not really any
1627         better solution without deprecating the API or returning an error code to indicate an empty
1628         resource, and it at least fixes the Epiphany crash.
1629
1630         This does not fix bug #186276, in which this function incorrectly returns no data when it
1631         ought to. But that is a different bug. Now, at least we won't crash when no data is
1632         available.
1633
1634         * UIProcess/API/glib/WebKitWebResource.cpp:
1635         (resourceDataCallback):
1636
1637 2019-03-28  Daniel Bates  <dabates@apple.com>
1638
1639         [iPad] Tapping on a popup form control may not show a popover
1640         https://bugs.webkit.org/show_bug.cgi?id=196322
1641         <rdar://problem/49229632>
1642
1643         Reviewed by Wenson Hsieh.
1644
1645         Stop taking advantage of -[WKContentView inputView] being called when we invoke -reloadInputViews
1646         to "lazily" allocate the input peripheral for the currently focused element. In theory, UIKit only
1647         needs to call -inputView when it actually needs to display the input view (the keyboard). For
1648         popup menu buttons, like <select>, no keyboard is needed. Instead we should create the peripheral
1649         as part of the logic in the UI process to focus a new element before we call -reloadInputViews.
1650
1651         * UIProcess/ios/WKContentViewInteraction.mm:
1652         (-[WKContentView inputView]): Extract logic to allocate the peripheral from here and moved it to createInputPeripheralWithView().
1653         (-[WKContentView accessoryTab:]): While I am here, add a FIXME comment to explain why we need to
1654         end the input sessions and nullify the input peripheral before we tell the web process to switch
1655         focus as opposed to letting this happen after the web process tells us it focused a new element.
1656         (createInputPeripheralWithView): Added.
1657         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
1658         Write in terms of createInputPeripheralWithView(). Create the input peripheral after becoming
1659         first responder because creating the peripheral has known side-effects: for popup buttons it
1660         tells the popup controller to present the popover. For key input to popovers to work from the get-go,
1661         the content view must be the first responder. See <https://bugs.webkit.org/show_bug.cgi?id=196272>
1662         for more details.
1663
1664 2019-03-28  Víctor Manuel Jáquez Leal  <vjaquez@igalia.com>
1665
1666         Silence lot of warnings when compiling with clang
1667         https://bugs.webkit.org/show_bug.cgi?id=196310
1668
1669         Reviewed by Michael Catanzaro.
1670
1671         * UIProcess/API/glib/WebKitInjectedBundleClient.cpp: add missing
1672         override clause.
1673         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h: add
1674         missing override clause.
1675
1676 2019-03-27  Ryosuke Niwa  <rniwa@webkit.org>
1677
1678         [macOS] Select element doesn't show popup if select element had lost focus while popup was previosuly shown
1679         https://bugs.webkit.org/show_bug.cgi?id=196336
1680
1681         Reviewed by Tim Horton.
1682
1683         The bug was caused by WebPopupMenu::hide never notifying PopupClient that the popup had been dismissed.
1684         This resulted in RenderMenuList::m_popupIsVisible to be never reset.
1685
1686         Also fixed a bug in WebPopupMenuProxyMac::hidePopupMenu that this function was never dismissing
1687         the popup as the selector "dismissPopUp", on the contrary to its name, does not dimiss the popup.
1688         Send cancelTracking to NSMenu instead, which DOES dismiss the popup.
1689
1690         Tests: fast/forms/select/mac-wk2/blur-dismisses-select-popup.html
1691                fast/forms/select/mac-wk2/open-select-popup-after-dismissing-by-blur.html
1692
1693         * UIProcess/mac/WebPopupMenuProxyMac.mm:
1694         (WebKit::WebPopupMenuProxyMac::hidePopupMenu):
1695         * WebProcess/WebCoreSupport/WebPopupMenu.cpp:
1696         (WebKit::WebPopupMenu::hide):
1697
1698 2019-03-27  Dean Jackson  <dino@apple.com>
1699
1700         [ARKit] Black view when opening a 3D model usdz file in new tab
1701         https://bugs.webkit.org/show_bug.cgi?id=196333
1702         <rdar://problem/47693367>
1703
1704         Reviewed by Tim Horton.
1705
1706         When opening a new WKSystemPreviewView, we were exiting if there was no
1707         presentingViewController. This code was unnecessary, and causing blank
1708         content when opening a new tab.
1709
1710         * UIProcess/ios/WKSystemPreviewView.mm:
1711         (-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]):
1712         Remove the code looking for a presentingViewController.
1713
1714 2019-03-27  Wenson Hsieh  <wenson_hsieh@apple.com>
1715
1716         Need a way to include WebKitAdditions code in WebKit API headers
1717         https://bugs.webkit.org/show_bug.cgi?id=196173
1718
1719         Reviewed by Tim Horton.
1720
1721         Introduce a mechanism that allows us to insert code from WebKitAdditions into public or private SDK headers
1722         using `#import`s of the form:
1723
1724         ```
1725         #if USE(APPLE_INTERNAL_SDK)
1726         #import <WebKitAdditions/WKWebViewConfigurationAdditions.h>
1727         #endif
1728         ```
1729
1730         The resulting header in the built products directory will contain the contents of the imported file inserted in
1731         place of the `#if USE(APPLE_INTERNAL_SDK) … #endif` block; however, when building with the Apple internal SDK,
1732         the additions header content will be imported by the usual means.
1733
1734         * mac/postprocess-framework-headers.sh:
1735         * mac/replace-webkit-additions-includes.py: Added.
1736
1737         Add a step when post-processing framework headers to replace instances of `#if USE(APPLE_INTERNAL_SDK) … #endif`
1738         with the text content of the additions files. The replacement script first searches in the built products
1739         directory for the matching additions file, and falls back to the SDK if no matching file is found. If neither
1740         are present (e.g. a build using the public SDK), then the block is simply replaced by the empty string.
1741
1742         (read_content_from_webkit_additions):
1743         (main):
1744
1745 2019-03-27  Andy Estes  <aestes@apple.com>
1746
1747         REGRESSION (r242686): package-root creates roots with broken symlinks in WebKit.framework/XPCServices/
1748         https://bugs.webkit.org/show_bug.cgi?id=196317
1749
1750         Reviewed by Dan Bernstein.
1751
1752         Removed some remnants of the Storage Process.
1753
1754         * Configurations/BaseTarget.xcconfig:
1755         * Resources/SandboxProfiles/ios/com.apple.WebKit.Storage.sb: Removed.
1756         * WebKit.xcodeproj/project.pbxproj:
1757
1758 2019-03-27  Keith Rollin  <krollin@apple.com>
1759
1760         Include the CFNetworking task UUID to the NSError when a resource-load fails
1761         https://bugs.webkit.org/show_bug.cgi?id=196156
1762
1763         Reviewed by Alex Christensen.
1764
1765         In order to help track the connection between a failed resource-load
1766         and a user-visible error message, include the CFNetworking task UUID
1767         in the associated error as an element of the userInfo property. This
1768         can then be pulled out and reported in the logging at the point the
1769         error is reported to the user.
1770
1771         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1772         (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
1773
1774 2019-03-27  Chris Dumez  <cdumez@apple.com>
1775
1776         [ iOS Sim ] REGRESSION (r242277) Layout Test http/tests/cookies/same-site/lax-samesite-cookie-after-cross-site-history-load.php is a flaky timeout
1777         https://bugs.webkit.org/show_bug.cgi?id=195425
1778         <rdar://problem/48682403>
1779
1780         Reviewed by Alex Christensen.
1781
1782         When process-swapping on history navigation, we lookup the WebProcessProxy we'd like to use from the
1783         process identifier that is saved on the WebBackForwardListItem, to try and load the item in the process
1784         in which it was previously loaded. However, we were failing to check if the WebProcess in question was
1785         still running so we could potentially try to use a process that's already exited.
1786
1787         * UIProcess/WebProcessPool.cpp:
1788         (WebKit::WebProcessPool::processForNavigationInternal):
1789
1790 2019-03-27  Zalan Bujtas  <zalan@apple.com>
1791
1792         [ContentChangeObserver] Always dispatch the synthetic click asynchronously
1793         https://bugs.webkit.org/show_bug.cgi?id=196278
1794         <rdar://problem/49299968>
1795
1796         Reviewed by Simon Fraser.
1797
1798         This patch ensures that all completeSyntheticClick() calls happen in an asynchronous manner (unless the feature is turned off).
1799
1800         * WebProcess/WebPage/ios/WebPageIOS.mm:
1801         (WebKit::dispatchSyntheticMouseMove):
1802         (WebKit::WebPage::handleSyntheticClick):
1803
1804 2019-03-27  Tim Horton  <timothy_horton@apple.com>
1805
1806         Fix some more deprecation warnings in WKDrawingView
1807         https://bugs.webkit.org/show_bug.cgi?id=196282
1808         <rdar://problem/47637608>
1809
1810         Reviewed by Wenson Hsieh.
1811
1812         * Platform/spi/ios/PencilKitSPI.h:
1813         * SourcesCocoa.txt:
1814         * UIProcess/ios/PencilKitSoftLink.h:
1815         * UIProcess/ios/PencilKitSoftLink.mm:
1816         * UIProcess/ios/WKContentViewInteraction.mm:
1817         * UIProcess/ios/WKDrawingCoordinator.h:
1818         * UIProcess/ios/WKDrawingCoordinator.mm:
1819         (-[WKDrawingCoordinator initWithContentView:]):
1820         (-[WKDrawingCoordinator currentInk]):
1821         (-[WKDrawingCoordinator undoManagerForInkPicker:]):
1822         (-[WKDrawingCoordinator containingViewForInkPicker:]):
1823         (-[WKDrawingCoordinator inkPickerDidToggleRuler:]):
1824         (-[WKDrawingCoordinator inkPickerDidChangeInk:]):
1825         (-[WKDrawingCoordinator installInkPickerForDrawing:]):
1826         (-[WKDrawingCoordinator uninstallInkPicker]):
1827         (-[WKDrawingCoordinator inkPicker]): Deleted.
1828         (-[WKDrawingCoordinator didChangeRulerState:]): Deleted.
1829         (-[WKDrawingCoordinator didChangeInk:]): Deleted.
1830         * UIProcess/ios/WKDrawingView.mm:
1831         (-[WKDrawingView _canvasViewWillBeginDrawing:]):
1832         * UIProcess/ios/WKInkPickerView.h: Removed.
1833         * UIProcess/ios/WKInkPickerView.mm: Removed.
1834         * WebKit.xcodeproj/project.pbxproj:
1835         Adopt the new names.
1836
1837 2019-03-27  Carlos Garcia Campos  <cgarcia@igalia.com>
1838
1839         Geolocation request not complete when watch request was started in a different web process
1840         https://bugs.webkit.org/show_bug.cgi?id=195996
1841
1842         Reviewed by Alex Christensen.
1843
1844         In WebGeolocationManagerProxy::startUpdating() we do nothing when the provider is already updating. We should
1845         reply with a DidChangePosition using the last known position, if available. If we are updating, but we still
1846         don't have a known position, the request will be completed when
1847         WebGeolocationManagerProxy::providerDidChangePosition() is called since it always notifies all web
1848         processes.
1849
1850         * UIProcess/WebGeolocationManagerProxy.cpp:
1851         (WebKit::WebGeolocationManagerProxy::providerDidChangePosition): Cache the position.
1852         (WebKit::WebGeolocationManagerProxy::startUpdating): Reply using cached position if already known.
1853         * UIProcess/WebGeolocationManagerProxy.h:
1854         (WebKit::WebGeolocationManagerProxy::lastPosition const): Return cached position.
1855         * WebProcess/WebCoreSupport/WebGeolocationClient.cpp:
1856         (WebKit::WebGeolocationClient::lastPosition): Remove the FIXME since we don't want this feature.
1857
1858 2019-03-26  Brent Fulgham  <bfulgham@apple.com>
1859
1860         [macOS] Correct kerberos-related sandbox violations
1861         https://bugs.webkit.org/show_bug.cgi?id=196279
1862         <rdar://problem/48622502>
1863
1864         Reviewed by Per Arne Vollan.
1865
1866         We need to allow communications with a Kerberos-related service on macOS
1867         until <rdar://problem/35542803> is fixed.
1868
1869         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
1870
1871 2019-03-26  Chris Dumez  <cdumez@apple.com>
1872
1873         [macOS] The network process is not exiting reliably when the WebProcessPool is destroyed
1874         https://bugs.webkit.org/show_bug.cgi?id=196277
1875         <rdar://problem/49127581>
1876
1877         Reviewed by Alex Christensen.
1878
1879         When, an AuxiliaryProcess receives the AuxiliaryProcess::Terminate IPC, it calls stopRunLoop()
1880         to exit. WebProcess overrides AuxiliaryProcess::stopRunLoop() to call exit(0) on the main
1881         thread. Other auxiliary processes such as the NetworkProcess would end up calling
1882         platformStopRunLoop(). On iOS and iOSMac, platformStopRunLoop() calls XPCServiceExit(), which
1883         makes sense since auxiliary processes run their run loop by calling xpc_main(). However, on
1884         macOS, platformStopRunLoop() was calling RunLoop::main().stop() to exit instead, which was
1885         unreliable as demonstrated by the test app attached to the radar.
1886
1887         Updating platformStopRunLoop() to call XPCServiceExit() on macOS fixes the problem and I now
1888         see the NetworkProcess exiting reliably there. This is the approach I have chosen in this
1889         patch since it appears to be reliable and it makes the code consistent on all Cocoa platforms.
1890
1891         * Shared/AuxiliaryProcess.cpp:
1892         * Shared/Cocoa/AuxiliaryProcessCocoa.mm:
1893         (WebKit::AuxiliaryProcess::platformStopRunLoop):
1894         * Shared/ios/AuxiliaryProcessIOS.mm:
1895         (WebKit::AuxiliaryProcess::platformStopRunLoop): Deleted.
1896         * Shared/mac/AuxiliaryProcessMac.mm:
1897         (WebKit::AuxiliaryProcess::platformStopRunLoop): Deleted.
1898
1899 2019-03-26  Keith Rollin  <krollin@apple.com>
1900
1901         Inhibit CFNetwork logging in private sessions
1902         https://bugs.webkit.org/show_bug.cgi?id=196268
1903         <rdar://problem/48210793>
1904
1905         Reviewed by Alex Christensen.
1906
1907         Before performing any logging, the NetworkProcess checks to see if
1908         it's performing an operation associated with a private (ephemeral)
1909         browsing session. If so, it skips the logging. However, networking
1910         layers below the NetworkProcess don't know about private browsing, so
1911         they would still perform their own logging. CFNetwork now has a flag
1912         that lets us control that, so set it to False if private browsing.
1913
1914         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1915         (WebKit::configurationForSessionID):
1916
1917 2019-03-26  Chris Dumez  <cdumez@apple.com>
1918
1919         Add basic layout test coverage for File Picker on iOS
1920         https://bugs.webkit.org/show_bug.cgi?id=196265
1921
1922         Reviewed by Wenson Hsieh.
1923
1924         Add layout test infrastructure to test the file picker on iOS.
1925
1926         * UIProcess/API/Cocoa/WKWebView.mm:
1927         (-[WKWebView _dismissFilePicker]):
1928         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1929         * UIProcess/ios/WKContentViewInteraction.h:
1930         * UIProcess/ios/WKContentViewInteraction.mm:
1931         (-[WKContentView dismissFilePicker]):
1932         (-[WKContentView _contentsOfUserInterfaceItem:]):
1933         * UIProcess/ios/forms/WKFileUploadPanel.h:
1934         * UIProcess/ios/forms/WKFileUploadPanel.mm:
1935         (-[WKFileUploadPanel currentAvailableActionTitles]):
1936
1937 2019-03-26  Daniel Bates  <dabates@apple.com>
1938
1939         [iOS][WK2] Use a better concept to describe the reason we defer zooming a focused element: selectabiltiy
1940         https://bugs.webkit.org/show_bug.cgi?id=196264
1941
1942         Reviewed by Wenson Hsieh.
1943
1944         Rename shouldDeferZoomingToSelectionWhenRevealingFocusedElement() to mayContainSelectableText() to describe
1945         the criterion that we will use to decide whether to defer zooming or not. We defer zooming only for elements
1946         that may support text selection on initial focus because we do not have an up-to-date selection rect at that
1947         time. For element, like <select>, that do not support text selection, we can zoom them immediately when focused.
1948
1949         * UIProcess/ios/WKContentViewInteraction.mm:
1950         (mayContainSelectableText): Renamed from shouldDeferZoomingToSelectionWhenRevealingFocusedElement.
1951         List all the input types in the switch block and remove the default case to force the compiler to check that we
1952         covered all cases. This will prevent unforseen keyboard issues (why isn't the keyboard shown? or why is the keyboard shown?)
1953         for future input types that we may add.
1954         (rectToRevealWhenZoomingToFocusedElement): Update for renaming.
1955         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]): Add a
1956         comment to explain why we may need to defer the zoom: the focused element supports text selection and we need
1957         to wait for the web process to call back to provide an up-to-date selection rect for us to zoom and reveal.
1958         (-[WKContentView _didReceiveEditorStateUpdateAfterFocus]): Update for renaming.
1959         (shouldDeferZoomingToSelectionWhenRevealingFocusedElement): Deleted.
1960
1961 2019-03-26  Wenson Hsieh  <wenson_hsieh@apple.com>
1962
1963         Implement async paste method on UIWKInteractionViewProtocol
1964         https://bugs.webkit.org/show_bug.cgi?id=196267
1965         <rdar://problem/49236346>
1966
1967         Reviewed by Tim Horton.
1968
1969         Implement a new UIWKInteractionViewProtocol hook to perform a paste command, and invoke the given completion
1970         handler when pasting is finished.
1971
1972         Test: UIPasteboardTests.PasteWithCompletionHandler
1973
1974         * UIProcess/ios/WKContentViewInteraction.mm:
1975         (-[WKContentView pasteWithCompletionHandler:]):
1976
1977 2019-03-26  Per Arne Vollan  <pvollan@apple.com>
1978
1979         [macOS] Fix sandbox violations
1980         https://bugs.webkit.org/show_bug.cgi?id=196262
1981         <rdar://problem/47738015>
1982
1983         Reviewed by Brent Fulgham.
1984
1985         Fix various observed sandbox violations.
1986
1987         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
1988         * WebProcess/com.apple.WebProcess.sb.in:
1989
1990 2019-03-26  Tomoki Imai  <Tomoki.Imai@sony.com>
1991
1992         Assertion failure !isInAcceleratedCompositingMode() in DrawingAreaProxyCoordinatedGraphics::incorporateUpdate when forceCompositingMode is turned on
1993         https://bugs.webkit.org/show_bug.cgi?id=195879
1994
1995         Reviewed by Carlos Garcia Campos.
1996
1997         The root cause is that DrawingAreaProxyCoordinatedGraphics::isInAcceleratedCompositingMode checks both of alwaysUseCompositing() and !m_layerTreeContext.isEmpty().
1998         alwaysUseCompositing() refers preferences, which is written by the application (UIProcess).
1999         On the other hand, m_layerTreeContext is changed when it receives enterAcceleratedCompositingMode/exitAcceleratedCompositingMode from WebProcess.
2000
2001         It results when we set forceCompositingMode and acceleratedCompositingEnabled to true, WebProcess and UIProcess is out of sync until WebProcess sends enterAcceleratedCompositingMode message.
2002         In such situation, WebProcess sends incorporateUpdate to UIProcess because WebProcess is in non-AC mode, but isInAcceleratedCompositingMode becomes true in UIProcess side.
2003
2004         * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:
2005         (WebKit::DrawingAreaProxyCoordinatedGraphics::~DrawingAreaProxyCoordinatedGraphics): Should call exitAcceleratedCompositingMode even when alwaysUseCompositing is true.
2006         (WebKit::DrawingAreaProxyCoordinatedGraphics::enterAcceleratedCompositingMode): enterAcceleratedCompositingMode should check enterAcceleratedCompositingMode is not called twice.
2007         * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h: Remove alwaysUseCompositing from isInAcceleratedCompositingMode
2008
2009 2019-03-26  Antoine Quint  <graouts@apple.com>
2010
2011         Remove mousemoveEventHandlingPreventsDefault internal setting and quirk
2012         https://bugs.webkit.org/show_bug.cgi?id=196254
2013         <rdar://problem/49124334>
2014
2015         Reviewed by Dean Jackson.
2016
2017         * Shared/WebPreferences.yaml:
2018
2019 2019-03-26  Philippe Normand  <pnormand@igalia.com>
2020
2021         [WPE][Qt] Uninitialized racy ViewBackend
2022         https://bugs.webkit.org/show_bug.cgi?id=196247
2023
2024         Reviewed by Carlos Garcia Campos.
2025
2026         * UIProcess/API/wpe/qt/WPEQtView.h: Initialize the backend pointer to nullptr.
2027
2028 2019-03-26  Carlos Garcia Campos  <cgarcia@igalia.com>
2029
2030         Unreviewed. Fix typo in GLib geolocation API after r243285.
2031
2032         gelocation -> geolocation.
2033
2034         * UIProcess/API/glib/WebKitGeolocationManager.cpp:
2035         (webkit_geolocation_manager_class_init):
2036         (webkit_geolocation_manager_update_position):
2037         (webkit_geolocation_manager_failed):
2038         (webkit_gelocation_manager_update_position): Deleted.
2039         (webkit_gelocation_manager_failed): Deleted.
2040         * UIProcess/API/gtk/WebKitGeolocationManager.h:
2041         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
2042         * UIProcess/API/wpe/WebKitGeolocationManager.h:
2043         * UIProcess/API/wpe/docs/wpe-1.0-sections.txt:
2044
2045 2019-03-26  Patrick Griffis  <pgriffis@igalia.com>
2046
2047         [GTK][WPE] Disable process warming
2048         https://bugs.webkit.org/show_bug.cgi?id=196208
2049
2050         Reviewed by Chris Dumez.
2051
2052         Fixes crash caused by r243384.
2053
2054         Process warming is incompatible with our launcher as it expects a valid
2055         WebsiteDataStore at initialization time for sandbox permissions.
2056
2057         * UIProcess/glib/WebProcessPoolGLib.cpp:
2058         (WebKit::WebProcessPool::platformInitialize):
2059
2060 2019-03-25  Alex Christensen  <achristensen@webkit.org>
2061
2062         Do not terminate the NetworkProcess if a third party application sends a NSCredential with a SecIdentityRef
2063         https://bugs.webkit.org/show_bug.cgi?id=196213
2064
2065         Reviewed by Geoff Garen.
2066
2067         A release assertion added in r230225 was reachable.  I reached it in a unit test that responds to a challenge
2068         with a SecIdentityRef wrapped in an NSCredential.
2069
2070         * Shared/cf/ArgumentCodersCF.cpp:
2071         (IPC::decode):
2072
2073 2019-03-25  Chris Dumez  <cdumez@apple.com>
2074
2075         Regression(r242369) Trying to change profile picture on linked in shows file picker, not the image picker
2076         https://bugs.webkit.org/show_bug.cgi?id=196205
2077         <rdar://problem/49083324>
2078
2079         Reviewed by Geoffrey Garen.
2080
2081         Update our FileUploadPanel code on iOS to properly deal with the MIME types containing
2082         wild cards (e.g. "image/*") that are defined in the HTML specification:
2083         - https://html.spec.whatwg.org/multipage/input.html#attr-input-accept
2084
2085         Previously, we would fail to convert those to UTIs.
2086
2087         * UIProcess/ios/forms/WKFileUploadPanel.mm:
2088
2089 2019-03-25  Tim Horton  <timothy_horton@apple.com>
2090
2091         Remove some now-unnecessary dynamic class lookup
2092         https://bugs.webkit.org/show_bug.cgi?id=196237
2093
2094         Reviewed by Simon Fraser.
2095
2096         * Shared/DocumentEditingContext.mm:
2097         (WebKit::DocumentEditingContext::toPlatformContext):
2098
2099 2019-03-25  Tim Horton  <timothy_horton@apple.com>
2100
2101         Get rid of ENABLE(ANIMATED_KEYBOARD_SCROLLING)
2102         https://bugs.webkit.org/show_bug.cgi?id=196224
2103
2104         Reviewed by Simon Fraser.
2105
2106         * Platform/spi/ios/AccessibilitySupportSPI.h:
2107         * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
2108         (-[WKKeyboardScrollingAnimator invalidate]):
2109         (perpendicularAbsoluteUnitVector):
2110         (-[WKKeyboardScrollingAnimator beginWithEvent:]):
2111         (-[WKKeyboardScrollingAnimator stopAnimatedScroll]):
2112         (-[WKKeyboardScrollingAnimator willStartInteractiveScroll]):
2113         (-[WKKeyboardScrollViewAnimator scrollToContentOffset:animated:]):
2114         (-[WKKeyboardScrollViewAnimator scrollWithScrollToExtentAnimationTo:]):
2115         (-[WKKeyboardScrollingAnimator startRepeatTimerIfNeeded]): Deleted.
2116         (-[WKKeyboardScrollingAnimator stopRepeatTimer]): Deleted.
2117         (-[WKKeyboardScrollingAnimator performDiscreteScroll]): Deleted.
2118
2119 2019-03-25  Fujii Hironori  <Hironori.Fujii@sony.com>
2120
2121         Enable IPC sending and receiving non-default-constructible types
2122         https://bugs.webkit.org/show_bug.cgi?id=196132
2123         <rdar://problem/49229221>
2124
2125         Unreviewed build fix for WinCairo port.
2126
2127         error C2440: '=': cannot convert from 'int' to 'HANDLE'
2128
2129         * Platform/win/SharedMemoryWin.cpp:
2130         (WebKit::SharedMemory::Handle::Handle): std::exchange HANDLE with nullptr, not 0.
2131         (WebKit::SharedMemory::Handle::operator=): Ditto.
2132
2133 2019-03-25  Fujii Hironori  <Hironori.Fujii@sony.com>
2134
2135         [Coordinated Graphics][WinCairo] ASSERTION FAILED: state.id == m_nicosia.state.id
2136         https://bugs.webkit.org/show_bug.cgi?id=196190
2137
2138         Reviewed by Žan Doberšek.
2139
2140         This assertion assumes the pre-committed and the committed scenes
2141         are identical. But, the pre-committed scene is updated in the main
2142         thread. Removed the false assertion.
2143
2144         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
2145         (WebKit::CoordinatedGraphicsScene::purgeGLResources): Remove the
2146         assertion. Removed layers of committed scene, not pre-committed
2147         scene.
2148
2149 2019-03-25  Brady Eidson  <beidson@apple.com>
2150
2151         Add socket-delegate to another entitlements config
2152         rdar://problem/48090350 and https://bugs.webkit.org/show_bug.cgi?id=196227
2153
2154         Reviewed by Geoffrey Garen.
2155
2156         * Configurations/Network-iOSMac.entitlements:
2157
2158 2019-03-25  Commit Queue  <commit-queue@webkit.org>
2159
2160         Unreviewed, rolling out r243465.
2161         https://bugs.webkit.org/show_bug.cgi?id=196226
2162
2163         the test doesn't build (Requested by thorton on #webkit).
2164
2165         Reverted changeset:
2166
2167         "Do not terminate the NetworkProcess if a third party
2168         application sends a NSCredential with a SecIdentityRef"
2169         https://bugs.webkit.org/show_bug.cgi?id=196213
2170         https://trac.webkit.org/changeset/243465
2171
2172 2019-03-25  Simon Fraser  <simon.fraser@apple.com>
2173
2174         REGRESSION (r242687): Flicker when pinch-zooming pages in macOS Safari
2175         https://bugs.webkit.org/show_bug.cgi?id=196126
2176         rdar://problem/49095791
2177
2178         Reviewed by Tim Horton.
2179         
2180         I fumbled the commit after the enum rename. Make this actually work.
2181
2182         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2183         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
2184
2185 2019-03-25  Simon Fraser  <simon.fraser@apple.com>
2186
2187         Zoom on macOS is centered around a point lower than the cursor
2188         https://bugs.webkit.org/show_bug.cgi?id=196225
2189         rdar://problem/49213574
2190
2191         Reviewed by Tim Horton.
2192         
2193         The origin handed to ViewGestureController::handleMagnificationGestureEvent is in WKWebView
2194         coordinates, but we end up setting the transform on the RenderView's layer, so we need
2195         to subtract the topContentInset.
2196
2197         * UIProcess/mac/ViewGestureControllerMac.mm:
2198         (WebKit::ViewGestureController::handleMagnificationGestureEvent):
2199
2200 2019-03-25  Alex Christensen  <achristensen@webkit.org>
2201
2202         Do not terminate the NetworkProcess if a third party application sends a NSCredential with a SecIdentityRef
2203         https://bugs.webkit.org/show_bug.cgi?id=196213
2204
2205         Reviewed by Geoff Garen.
2206
2207         A release assertion added in r230225 was reachable.  I reached it in a unit test that responds to a challenge
2208         with a SecIdentityRef wrapped in an NSCredential.
2209
2210         * Shared/cf/ArgumentCodersCF.cpp:
2211         (IPC::decode):
2212
2213 2019-03-25  Chris Dumez  <cdumez@apple.com>
2214
2215         Get rid of WebPage::m_shouldResetDrawingAreaAfterSuspend flag
2216         https://bugs.webkit.org/show_bug.cgi?id=196210
2217         <rdar://problem/48681326>
2218
2219         Reviewed by Geoffrey Garen.
2220
2221         Get rid of WebPage::m_shouldResetDrawingAreaAfterSuspend flag and use the drawing area identifier
2222         instead to reset the DrawingArea in the WebProcess whenever the UIProcess did.
2223
2224         This is less error-prone and guarantees that the WebProcess and the UIProcess can reliably
2225         communicate via DrawingArea IPC.
2226
2227         * WebProcess/WebPage/WebPage.cpp:
2228         (WebKit::WebPage::reinitializeWebPage):
2229         (WebKit::WebPage::setIsSuspended):
2230         * WebProcess/WebPage/WebPage.h:
2231
2232 2019-03-25  Alex Christensen  <achristensen@webkit.org>
2233
2234         Enable IPC sending and receiving non-default-constructible types
2235         https://bugs.webkit.org/show_bug.cgi?id=196132
2236
2237         Reviewed by Geoff Garen.
2238
2239         * Platform/IPC/ArgumentCoder.h:
2240         * Platform/IPC/ArgumentCoders.h:
2241         (IPC::TupleEncoder::encode):
2242         (IPC::tupleFromTupleAndObject):
2243         (IPC::TupleDecoderImpl::decode):
2244         (IPC::TupleDecoderImpl<Type>::decode):
2245         (IPC::TupleDecoder::decode):
2246         (IPC::TupleDecoder<0>::decode):
2247         (IPC::TupleCoder::encode): Deleted.
2248         (IPC::TupleCoder::decode): Deleted.
2249         * Platform/IPC/Connection.h:
2250         (IPC::Connection::sendWithReply):
2251         (IPC::TupleMover::move):
2252         (IPC::moveTuple):
2253         (IPC::Connection::sendSync):
2254         * Platform/IPC/Decoder.h:
2255         (IPC::Decoder::decode):
2256         (IPC::Decoder::operator>>):
2257         * Platform/IPC/HandleMessage.h:
2258         (IPC::handleMessage):
2259         (IPC::handleMessageSynchronous):
2260         (IPC::handleMessageSynchronousWantsConnection):
2261         (IPC::handleMessageAsync):
2262         * Platform/SharedMemory.h:
2263         * Scripts/webkit/LegacyMessages-expected.h:
2264         * Scripts/webkit/Messages-expected.h:
2265         * Scripts/webkit/MessagesSuperclass-expected.h:
2266         * Scripts/webkit/messages.py:
2267         * Shared/Databases/IndexedDB/WebIDBResult.h:
2268         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
2269         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
2270         * Shared/ShareableBitmap.h:
2271         * Shared/ShareableResource.h:
2272         * Shared/UpdateInfo.h:
2273         * Shared/WebEvent.h:
2274         * Shared/WebProcessCreationParameters.cpp:
2275         * Shared/WebProcessCreationParameters.h:
2276         * Shared/mac/SecItemResponseData.cpp:
2277         (WebKit::SecItemResponseData::SecItemResponseData):
2278         (WebKit::SecItemResponseData::decode):
2279         * Shared/mac/SecItemResponseData.h:
2280         * WebProcess/MediaStream/MediaDeviceSandboxExtensions.h:
2281
2282 2019-03-25  Tim Horton  <timothy_horton@apple.com>
2283
2284         Animated keyboard scrolling is extremely chaotic
2285         https://bugs.webkit.org/show_bug.cgi?id=196164
2286         <rdar://problem/48702444>
2287
2288         Reviewed by Simon Fraser.
2289
2290         * UIProcess/ios/WKContentViewInteraction.mm:
2291         (-[WKContentView _interpretKeyEvent:isCharEvent:]):
2292         Consume keyboard events instead of interpreting them traditionally
2293         if WKKeyboardScrollingAnimator is animating.
2294
2295         * UIProcess/ios/WKKeyboardScrollingAnimator.h:
2296         * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
2297         (-[WKKeyboardScrollingAnimator beginWithEvent:]):
2298         (-[WKKeyboardScrollingAnimator handleKeyEvent:]):
2299         (-[WKKeyboardScrollingAnimator stopAnimatedScroll]):
2300         (-[WKKeyboardScrollingAnimator scrollTriggeringKeyIsPressed]):
2301         (-[WKKeyboardScrollingAnimator displayLinkFired:]):
2302         (-[WKKeyboardScrollViewAnimator scrollTriggeringKeyIsPressed]):
2303         Expose the current state of interactive scrolling, and rename the related member.
2304
2305 2019-03-25  Keith Rollin  <krollin@apple.com>
2306
2307         Add WebKit logging for first paint and other interesting layout milestones
2308         https://bugs.webkit.org/show_bug.cgi?id=196159
2309         <rdar://problem/49128952>
2310
2311         Reviewed by Simon Fraser.
2312
2313         Add some logging to indicate what layout milestones have been reached.
2314         This should help us determine if there's a client, rendering, layout,
2315         or some other issue when page content does not appear in the client
2316         window.
2317
2318         The logging is being added to
2319         WebFrameLoaderClient::dispatchDidReachLayoutMilestone. This seems like
2320         a nice central place to capture layout milestones. However, it will
2321         only log notifications that are being sent to clients. It does not
2322         indicate all milestones that have occurred. That is, it does not
2323         report milestones that are filtered out due to client disinterest.
2324         There doesn't seem to be a good central place to capture all
2325         milestones, regardless of client interest.
2326
2327         * Platform/Logging.h:
2328         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2329         (WebKit::WebFrameLoaderClient::dispatchDidReachLayoutMilestone):
2330
2331 2019-03-25  Patrick Griffis  <pgriffis@igalia.com>
2332
2333         [GTK][WPE] Remove network access from web process sandbox
2334         https://bugs.webkit.org/show_bug.cgi?id=189967
2335
2336         Reviewed by Michael Catanzaro.
2337
2338         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
2339         (WebKit::createFlatpakInfo):
2340         (WebKit::bubblewrapSpawn):
2341         * UIProcess/Launcher/glib/FlatpakLauncher.cpp:
2342         (WebKit::flatpakSpawn):
2343
2344 2019-03-25  Andy Estes  <aestes@apple.com>
2345
2346         [Apple Pay] Call +canMakePayments on a work queue
2347         https://bugs.webkit.org/show_bug.cgi?id=196179
2348         <rdar://problem/45388749>
2349
2350         Reviewed by Brady Eidson.
2351
2352         Calling +canMakePayments on either PKPaymentAuthorizationController or
2353         PKPaymentAuthorizationViewController results in synchronous IPC and is therefore very
2354         expensive to call on the main thread. On iOS, these calls are made in the network process,
2355         and on Mac in the UI process.
2356
2357         Call these methods on a work queue to avoid main thread spins.
2358
2359         * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp:
2360         (WebKit::WebPaymentCoordinatorProxy::canMakePayments):
2361         * Shared/ApplePay/WebPaymentCoordinatorProxy.h:
2362         * Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
2363         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments):
2364         * Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
2365         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments):
2366
2367 2019-03-25  Andy Estes  <aestes@apple.com>
2368
2369         [Apple Pay] Remove the AvailablePaymentNetworks synchronous message
2370         https://bugs.webkit.org/show_bug.cgi?id=196180
2371
2372         Reviewed by Youenn Fablet.
2373
2374         Unlike many PassKit interactions, it's ok to call +[PKPaymentRequest availableNetworks]
2375         without an entitlement. Therefore, we can call it from the web process directly rather than
2376         synchronously messaging the entitled UI or networking process.
2377
2378         * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp:
2379         * Shared/ApplePay/WebPaymentCoordinatorProxy.h:
2380         * Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in:
2381         * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2382         * SourcesCocoa.txt:
2383         * WebKit.xcodeproj/project.pbxproj:
2384         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
2385         (WebKit::WebPaymentCoordinator::availablePaymentNetworks):
2386         * WebProcess/ApplePay/WebPaymentCoordinator.h:
2387         * WebProcess/ApplePay/cocoa/WebPaymentCoordinatorCocoa.mm: Added.
2388         (WebKit::WebPaymentCoordinator::platformAvailablePaymentNetworks const):
2389         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
2390         (-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]):
2391         (-[WKAccessibilityWebPageObjectBase setWebPage:]):
2392
2393 2019-03-25  Chris Dumez  <cdumez@apple.com>
2394
2395         Unreviewed, tiny fix after r243388 to address API test failures on iOS
2396
2397         m_processType was properly initialized on macOS but not iOS.
2398
2399         * WebProcess/cocoa/WebProcessCocoa.mm:
2400         (WebKit::WebProcess::platformInitializeProcess):
2401
2402 2019-03-25  Carlos Garcia Campos  <cgarcia@igalia.com>
2403
2404         [GTK][WPE] Do not allow changes in active URI before provisional load starts for non-API requests
2405         https://bugs.webkit.org/show_bug.cgi?id=194208
2406
2407         Reviewed by Michael Catanzaro.
2408
2409         * UIProcess/API/glib/WebKitWebView.cpp:
2410         (webkitWebViewWillStartLoad): Block updates of active URL.
2411         (webkitWebViewLoadChanged): Unblock updates of active URL on WEBKIT_LOAD_STARTED.
2412
2413 2019-03-25  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2414
2415         Remove NavigatorContentUtils in WebCore/Modules
2416         https://bugs.webkit.org/show_bug.cgi?id=196070
2417
2418         Reviewed by Alex Christensen.
2419
2420         NavigatorContentUtils was to support the custom scheme spec [1].
2421         However, in WebKit side, no port has supported the feature in
2422         WebKit layer after EFL port was removed. So there has been the
2423         only IDL implementation of the NavigatorContentUtils in WebCore.
2424         So we don't need to keep the implementation in WebCore anymore.
2425
2426         [1] https://html.spec.whatwg.org/multipage/system-state.html#custom-handlers
2427
2428         * Configurations/FeatureDefines.xcconfig:
2429         * WebProcess/WebCoreSupport/WebNavigatorContentUtilsClient.h: Removed.
2430
2431 2019-03-24  Zan Dobersek  <zdobersek@igalia.com>
2432
2433         Unreviewed WPE build fix.
2434
2435         * UIProcess/wpe/WebPasteboardProxyWPE.cpp:
2436         Add an explicit CompletionHandler.h include to avoid a trip-up in
2437         unified builds.
2438
2439 2019-03-24  Fujii Hironori  <Hironori.Fujii@sony.com>
2440
2441         [WinCairo] WebProcessDataStoreParameters.h(32): error C2653: 'SandboxExtension': is not a class or namespace name
2442         https://bugs.webkit.org/show_bug.cgi?id=196192
2443
2444         Unreviewed for WinCairo port.
2445
2446         * Shared/WebProcessDataStoreParameters.h: Added #include "SandboxExtension.h".
2447
2448 2019-03-24  Andy Estes  <aestes@apple.com>
2449
2450         [watchOS] Remove unused Proximity Networking code
2451         https://bugs.webkit.org/show_bug.cgi?id=196188
2452
2453         Reviewed by Tim Horton.
2454
2455         * Configurations/WebKit.xcconfig:
2456         * NetworkProcess/NetworkProcess.cpp:
2457         (WebKit::NetworkProcess::NetworkProcess):
2458         * NetworkProcess/NetworkProcess.h:
2459         * NetworkProcess/NetworkProcessCreationParameters.cpp:
2460         (WebKit::NetworkProcessCreationParameters::encode const):
2461         (WebKit::NetworkProcessCreationParameters::decode):
2462         * NetworkProcess/NetworkProcessCreationParameters.h:
2463         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
2464         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2465         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
2466         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2467         (WebKit::NetworkProcess::platformPrepareToSuspend):
2468         (WebKit::NetworkProcess::platformProcessDidResume):
2469         (WebKit::NetworkProcess::platformProcessDidTransitionToBackground):
2470         (WebKit::NetworkProcess::platformProcessDidTransitionToForeground):
2471         * NetworkProcess/watchos/NetworkProximityAssertion.h: Removed.
2472         * NetworkProcess/watchos/NetworkProximityAssertion.mm: Removed.
2473         * NetworkProcess/watchos/NetworkProximityManager.h: Removed.
2474         * NetworkProcess/watchos/NetworkProximityManager.mm: Removed.
2475         * SourcesCocoa.txt:
2476         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2477         (API::ProcessPoolConfiguration::copy):
2478         * UIProcess/API/APIProcessPoolConfiguration.h:
2479         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
2480         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
2481         (-[_WKProcessPoolConfiguration wirelessContextIdentifier]):
2482         (-[_WKProcessPoolConfiguration setWirelessContextIdentifier:]):
2483         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2484         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2485         * WebKit.xcodeproj/project.pbxproj:
2486
2487 2019-03-23  Chris Dumez  <cdumez@apple.com>
2488
2489         Unreviewed, fix typo in comment added in r243379.
2490
2491         * UIProcess/API/Cocoa/WKProcessGroup.mm:
2492         (-[WKProcessGroup setDelegate:]):
2493
2494 2019-03-23  Simon Fraser  <simon.fraser@apple.com>
2495
2496         REGRESSION (iOS 8): Scrollbar can't be hidden when webkit-overflow-scrolling is set to touch
2497         https://bugs.webkit.org/show_bug.cgi?id=137043
2498         rdar://problem/16595330
2499
2500         Reviewed by Zalan Bujtas.
2501
2502         Plumb horizontalScrollbarHiddenByStyle/verticalScrollbarHiddenByStyle through ScrollableAreaParameters
2503         to the UI process, and use it to set UIScrollView indicators visible or not.
2504         
2505         The scroll snap changes in ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren() fix a bug
2506         where hasChangedProperty(HorizontalSnapOffsets) was nested inside another set of hasChangedProperty()
2507         tests, so would never get called.
2508
2509         * Shared/WebCoreArgumentCoders.cpp:
2510         (IPC::ArgumentCoder<ScrollableAreaParameters>::encode):
2511         (IPC::ArgumentCoder<ScrollableAreaParameters>::decode):
2512         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
2513         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):
2514
2515 2019-03-23  Zalan Bujtas  <zalan@apple.com>
2516
2517         [ContentChangeObserver] Taping on a form control should always result in click.
2518         https://bugs.webkit.org/show_bug.cgi?id=196177
2519
2520         Reviewed by Simon Fraser.
2521
2522         This patch enures that we send a synthetic click when the traget node is a form control (button, edit field etc) even if
2523         the mousemove brings up some hover content.
2524
2525         * WebProcess/WebPage/ios/WebPageIOS.mm:
2526         (WebKit::WebPage::handleSyntheticClick):
2527
2528 2019-03-23  Andy Estes  <aestes@apple.com>
2529
2530         [Apple Pay] Stop calling PKPaymentAuthorizationViewController class methods on iOS
2531         https://bugs.webkit.org/show_bug.cgi?id=196163
2532         <rdar://problem/48787564>
2533
2534         Reviewed by Anders Carlsson.
2535
2536         Now that we've transitioned to PKPaymentAuthorizationController on iOS, we should stop
2537         calling PKPaymentAuthorizationViewController class methods on iOS in favor of their
2538         PKPaymentAuthorizationController alternatives.
2539
2540         While we're here, we should also transition to calling
2541         +paymentServicesMerchantURLForAPIType:completion: on both
2542         PKPaymentAuthorizationViewController and PKPaymentAuthorizationController.
2543
2544         * Platform/cocoa/PaymentAuthorizationViewController.mm:
2545         (-[WKPaymentAuthorizationViewControllerDelegate _paymentServicesMerchantURLForAPIType:completion:]):
2546         * Platform/cocoa/WKPaymentAuthorizationDelegate.h:
2547         * Platform/cocoa/WKPaymentAuthorizationDelegate.mm:
2548         (-[WKPaymentAuthorizationDelegate _initWithRequest:presenter:]):
2549         (-[WKPaymentAuthorizationDelegate _paymentServicesMerchantURLForAPIType:completion:]):
2550         * Platform/ios/PaymentAuthorizationController.mm:
2551         (-[WKPaymentAuthorizationControllerDelegate _paymentServicesMerchantURLForAPIType:completion:]):
2552         * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2553         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments): Deleted.
2554         * Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
2555         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments):
2556         * Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
2557         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments):
2558
2559 2019-03-23  Carlos Garcia Campos  <cgarcia@igalia.com>
2560
2561         Unreviewed. Fix GTK build after r243409.
2562
2563         Build failure is actually unrelated to r243409, it's yet another unified build failure that happens when source
2564         file list changes.
2565
2566         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
2567         (WebKit::WebInspectorProxy::platformShowCertificate): Use WebCore namespace for CertificateInfo parameter.
2568
2569 2019-03-23  Carlos Garcia Campos  <cgarcia@igalia.com>
2570
2571         [GTK] Remove build time dependency on Geoclue2
2572         https://bugs.webkit.org/show_bug.cgi?id=195994
2573
2574         Reviewed by Michael Catanzaro.
2575
2576         Add GeoclueGeolocationProvider class to provide geolocation position updates using Geoclue2 DBus service.
2577
2578         * PlatformGTK.cmake:
2579         * PlatformWPE.cmake:
2580         * SourcesGTK.txt:
2581         * SourcesWPE.txt:
2582         * UIProcess/API/glib/WebKitGeolocationManager.cpp:
2583         (_WebKitGeolocationPosition::_WebKitGeolocationPosition):
2584         (webkitGeolocationManagerStop):
2585         (webkitGeolocationManagerSetEnableHighAccuracy):
2586         (webkitGeolocationManagerDispose):
2587         (webkit_geolocation_manager_class_init):
2588         * UIProcess/geoclue/GeoclueGeolocationProvider.cpp: Added.
2589         (WebKit::GeoclueGeolocationProvider::GeoclueGeolocationProvider):
2590         (WebKit::GeoclueGeolocationProvider::~GeoclueGeolocationProvider):
2591         (WebKit::GeoclueGeolocationProvider::start):
2592         (WebKit::GeoclueGeolocationProvider::stop):
2593         (WebKit::GeoclueGeolocationProvider::setEnableHighAccuracy):
2594         (WebKit::GeoclueGeolocationProvider::destroyManagerLater):
2595         (WebKit::GeoclueGeolocationProvider::destroyManager):
2596         (WebKit::GeoclueGeolocationProvider::setupManager):
2597         (WebKit::GeoclueGeolocationProvider::createClient):
2598         (WebKit::GeoclueGeolocationProvider::setupClient):
2599         (WebKit::GeoclueGeolocationProvider::startClient):
2600         (WebKit::GeoclueGeolocationProvider::stopClient):
2601         (WebKit::GeoclueGeolocationProvider::requestAccuracyLevel):
2602         (WebKit::GeoclueGeolocationProvider::clientLocationUpdatedCallback):
2603         (WebKit::GeoclueGeolocationProvider::createLocation):
2604         (WebKit::GeoclueGeolocationProvider::locationUpdated):
2605         (WebKit::GeoclueGeolocationProvider::didFail):
2606         * UIProcess/geoclue/GeoclueGeolocationProvider.h: Added.
2607
2608 2019-03-22  Simon Fraser  <simon.fraser@apple.com>
2609
2610         Undo collision with r243390.
2611
2612         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2613         (stringForSSLProtocol):
2614
2615 2019-03-22  Simon Fraser  <simon.fraser@apple.com>
2616
2617         Fix internal builds.
2618
2619         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2620         (stringForSSLProtocol):
2621
2622 2019-03-22  Keith Rollin  <krollin@apple.com>
2623
2624         Enable ThinLTO support in Production builds
2625         https://bugs.webkit.org/show_bug.cgi?id=190758
2626         <rdar://problem/45413233>
2627
2628         Reviewed by Daniel Bates.
2629
2630         Enable building with Thin LTO in Production when using Xcode 10.2 or
2631         later. This change results in a 1.45% progression in PLT5. Full
2632         Production build times increase about 2-3%. Incremental build times
2633         are more severely affected, and so LTO is not enabled for local
2634         engineering builds.
2635
2636         LTO is enabled only on macOS for now, until rdar://problem/49013399,
2637         which affects ARM builds, is fixed.
2638
2639         To change the LTO setting when building locally:
2640
2641         - If building with `make`, specify WK_LTO_MODE={none,thin,full} on the
2642           command line.
2643         - If building with `build-webkit`, specify --lto-mode={none,thin,full}
2644           on the command line.
2645         - If building with `build-root`, specify --lto={none,thin,full} on the
2646           command line.
2647         - If building with Xcode, create a LocalOverrides.xcconfig file at the
2648           top level of your repository directory (if needed) and define
2649           WK_LTO_MODE to full, thin, or none.
2650
2651         * Configurations/Base.xcconfig:
2652
2653 2019-03-22  Chris Dumez  <cdumez@apple.com>
2654
2655         Unreviewed build fix after r243388.
2656
2657         * WebProcess/WebProcess.h:
2658
2659 2019-03-22  Per Arne Vollan  <pvollan@apple.com>
2660
2661         [macOS] Fix sandbox violation
2662         https://bugs.webkit.org/show_bug.cgi?id=196153
2663         <rdar://problem/49123855>
2664
2665         Reviewed by Brent Fulgham.
2666
2667         The sandbox on macOS is blocking the mach lookup.
2668
2669         * WebProcess/com.apple.WebProcess.sb.in:
2670
2671 2019-03-21  Ryan Haddad  <ryanhaddad@apple.com>
2672
2673         Unreviewed, fix the build with recent SDKs.
2674
2675         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2676         (stringForSSLProtocol):
2677
2678 2019-03-22  Chris Dumez  <cdumez@apple.com>
2679
2680         Implement WebProcess freezer opt-in completely on WebContent process side
2681         https://bugs.webkit.org/show_bug.cgi?id=196149
2682
2683         Reviewed by Brady Eidson.
2684
2685         Implement WebProcess freezer opt-in completely on WebContent process side, we do not need
2686         to involve the UIProcess with this and rely on IPC which may be fragile.
2687
2688         In the future, we may want to set freezable state from the UIProcess when the API supports
2689         it. We can move the logic to be fully on the UIProcess side then. In the mean time, it is
2690         likely best not to rely on IPC and process coordination for this.
2691
2692         * UIProcess/WebProcessProxy.cpp:
2693         (WebKit::globalPageMap):
2694         (WebKit::WebProcessProxy::WebProcessProxy):
2695         (WebKit::WebProcessProxy::setIsInProcessCache):
2696         (WebKit::WebProcessProxy::markIsNoLongerInPrewarmedPool):
2697         (WebKit::WebProcessProxy::didFinishLaunching):
2698         (WebKit::WebProcessProxy::validateFreezerStatus): Deleted.
2699         * UIProcess/WebProcessProxy.h:
2700         (WebKit::WebProcessProxy::removeProvisionalPageProxy):
2701         (WebKit::WebProcessProxy::WebPageProxyMap::WebPageProxyMap): Deleted.
2702         (WebKit::WebProcessProxy::WebPageProxyMap::size const): Deleted.
2703         (WebKit::WebProcessProxy::WebPageProxyMap::values): Deleted.
2704         (WebKit::WebProcessProxy::WebPageProxyMap::values const): Deleted.
2705         (WebKit::WebProcessProxy::WebPageProxyMap::begin): Deleted.
2706         (WebKit::WebProcessProxy::WebPageProxyMap::end): Deleted.
2707         (WebKit::WebProcessProxy::WebPageProxyMap::get): Deleted.
2708         (WebKit::WebProcessProxy::WebPageProxyMap::contains const): Deleted.
2709         (WebKit::WebProcessProxy::WebPageProxyMap::isEmpty const): Deleted.
2710         (WebKit::WebProcessProxy::WebPageProxyMap::set): Deleted.
2711         (WebKit::WebProcessProxy::WebPageProxyMap::take): Deleted.
2712         * WebProcess/WebProcess.cpp:
2713         (WebKit::WebProcess::setIsInProcessCache):
2714         (WebKit::WebProcess::markIsNoLongerPrewarmed):
2715         (WebKit::WebProcess::actualPrepareToSuspend):
2716         (WebKit::WebProcess::setFreezable): Deleted.
2717         * WebProcess/WebProcess.h:
2718         * WebProcess/WebProcess.messages.in:
2719         * WebProcess/cocoa/WebProcessCocoa.mm:
2720         (WebKit::WebProcess::updateProcessName):
2721         (WebKit::WebProcess::shouldFreezeOnSuspension const):
2722         (WebKit::WebProcess::updateFreezerStatus):
2723
2724 2019-03-22  Chris Dumez  <cdumez@apple.com>
2725
2726         Prewarmed processes should be usable with any website data store
2727         https://bugs.webkit.org/show_bug.cgi?id=196104
2728
2729         Reviewed by Alex Christensen.
2730
2731         Split WebsiteDataStore-specific data out of WebProcessCreationParameters and into a new
2732         WebProcessDataStoreParameters struct so that we do not need a WebsiteDataStore in order
2733         to lauch and initialize a WebProcess. When the process finally gets used and we thus
2734         know which WebsiteDataStore they will be used for, we send the WebProcessDataStoreParameters
2735         to the process to that it can do its data store-specific initialization.
2736
2737         This allows prewarmed processes not not have a WebsiteDataStore assocated with them. They
2738         can then be used for any WebsiteDataStore when we need them.
2739
2740         This is also used by our dummy WebProcessProxy since it does not have a backing process and
2741         thus has no associated WebsiteDataStore.
2742
2743         * Shared/WebProcessCreationParameters.cpp:
2744         (WebKit::WebProcessCreationParameters::encode const):
2745         (WebKit::WebProcessCreationParameters::decode):
2746         * Shared/WebProcessCreationParameters.h:
2747         * Shared/WebProcessDataStoreParameters.h: Added.
2748         (WebKit::WebProcessDataStoreParameters::encode const):
2749         (WebKit::WebProcessDataStoreParameters::decode):
2750         * UIProcess/API/C/WKContext.cpp:
2751         (WKContextWarmInitialProcess):
2752         * UIProcess/API/Cocoa/WKProcessPool.mm:
2753         (-[WKProcessPool _warmInitialProcess]):
2754         * UIProcess/ServiceWorkerProcessProxy.cpp:
2755         (WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
2756         * UIProcess/WebPageProxy.cpp:
2757         (WebKit::WebPageProxy::notifyProcessPoolToPrewarm):
2758         * UIProcess/WebProcessPool.cpp:
2759         (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess):
2760         (WebKit::WebProcessPool::createNewWebProcess):
2761         (WebKit::WebProcessPool::tryTakePrewarmedProcess):
2762         (WebKit::WebProcessPool::sendWebProcessDataStoreParameters):
2763         (WebKit::WebProcessPool::initializeNewWebProcess):
2764         (WebKit::WebProcessPool::prewarmProcess):
2765         (WebKit::WebProcessPool::processForRegistrableDomain):
2766         (WebKit::WebProcessPool::createWebPage):
2767         (WebKit::WebProcessPool::didReachGoodTimeToPrewarm):
2768         * UIProcess/WebProcessPool.h:
2769         (WebKit::WebProcessPool::sendToOneProcess):
2770         * UIProcess/WebProcessProxy.cpp:
2771         (WebKit::WebProcessProxy::create):
2772         (WebKit::WebProcessProxy::WebProcessProxy):
2773         (WebKit::WebProcessProxy::setWebsiteDataStore):
2774         (WebKit::WebProcessProxy::addExistingWebPage):
2775         * UIProcess/WebProcessProxy.h:
2776         (WebKit::WebProcessProxy::websiteDataStore const):
2777         * WebKit.xcodeproj/project.pbxproj:
2778         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
2779         (WebKit::WebMediaKeyStorageManager::setWebsiteDataStore):
2780         * WebProcess/MediaCache/WebMediaKeyStorageManager.h:
2781         * WebProcess/WebProcess.cpp:
2782         (WebKit::WebProcess::initializeWebProcess):
2783         (WebKit::WebProcess::setWebsiteDataStoreParameters):
2784         * WebProcess/WebProcess.h:
2785         * WebProcess/WebProcess.messages.in:
2786         * WebProcess/WebProcessSupplement.h:
2787         (WebKit::WebProcessSupplement::initialize):
2788         (WebKit::WebProcessSupplement::setWebsiteDataStore):
2789         * WebProcess/cocoa/WebProcessCocoa.mm:
2790         (WebKit::WebProcess::platformInitializeWebProcess):
2791         (WebKit::WebProcess::platformSetWebsiteDataStoreParameters):
2792         * WebProcess/win/WebProcessWin.cpp:
2793         (WebKit::WebProcess::platformInitializeWebProcess):
2794         (WebKit::WebProcess::platformSetWebsiteDataStoreParameters):
2795
2796 2019-03-22  Simon Fraser  <simon.fraser@apple.com>
2797
2798         REGRESSION (r242687): Flicker when pinch-zooming pages in macOS Safari
2799         https://bugs.webkit.org/show_bug.cgi?id=196126
2800         rdar://problem/49095791
2801
2802         Reviewed by Antti Koivisto.
2803
2804         The scrolling tree doesn't have an accurate picture of the main view's scroll position
2805         during pinch-zooming, so don't have it apply layer positions if a transient zoom is
2806         in progress.
2807
2808         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
2809         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2810         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
2811         (WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToPage):
2812
2813 2019-03-22  Antti Koivisto  <antti@apple.com>
2814
2815         Handle UI side hit testing for ScrollPositioningBehavior::Stationary positioned nodes
2816         https://bugs.webkit.org/show_bug.cgi?id=196100
2817         <rdar://problem/49117933>
2818
2819         Reviewed by Simon Fraser.
2820
2821         Test: fast/scrolling/ios/overflow-scroll-overlap-6.html
2822
2823         * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h:
2824         (WebKit::RemoteLayerTreeNode::relatedScrollContainerIDs const):
2825         (WebKit::RemoteLayerTreeNode::relatedScrollContainerPositioningBehavior const):
2826
2827         Make more generic and save the associated positioning behavior.
2828
2829         (WebKit::RemoteLayerTreeNode::nonAncestorScrollContainerIDs const): Deleted.
2830         (WebKit::RemoteLayerTreeNode::addNonAncestorScrollContainerID): Deleted.
2831         (WebKit::RemoteLayerTreeNode::clearNonAncestorScrollContainerIDs): Deleted.
2832         * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm:
2833         (WebKit::RemoteLayerTreeNode::setRelatedScrollContainerBehaviorAndIDs):
2834         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
2835         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
2836         (WebKit::isScrolledBy):
2837
2838         Stationary relationship means the layer won't scroll the scroller.
2839
2840         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
2841         (WebKit::RemoteScrollingCoordinatorProxy::establishLayerTreeScrollingRelations):
2842
2843 2019-03-22  Chris Dumez  <cdumez@apple.com>
2844
2845         REGRESSION (r243094): ePub files do not render or open in Books
2846         https://bugs.webkit.org/show_bug.cgi?id=196119
2847         <rdar://problem/49121686>
2848
2849         Reviewed by Brady Eidson.
2850
2851         Do not delay the WebProcess launch until a load when contructing a web view and the client
2852         may observe when its injected bundle is loaded via WKProcessGroupDelegate's
2853         didCreateConnectionToWebProcessPlugIn.
2854
2855         * UIProcess/API/Cocoa/WKProcessGroup.mm:
2856         (-[WKProcessGroup setDelegate:]):
2857         * UIProcess/WebInspectorUtilities.cpp:
2858         (WebKit::inspectorProcessPool):
2859         * UIProcess/WebProcessPool.cpp:
2860         (WebKit::WebProcessPool::createWebPage):
2861         * UIProcess/WebProcessPool.h:
2862
2863 2019-03-22  Carlos Garcia Campos  <cgarcia@igalia.com>
2864
2865         REGRESSION(r243094): Automation: browser crash in WebAutomationSession::exitFullscreenWindowForPage()
2866         https://bugs.webkit.org/show_bug.cgi?id=196140
2867
2868         Reviewed by Chris Dumez.
2869
2870         Since r243094, the WebPageProxy fullscreen manager is not created in the constructor, but once the page has a
2871         process launched.
2872
2873         * UIProcess/Automation/WebAutomationSession.cpp:
2874         (WebKit::WebAutomationSession::exitFullscreenWindowForPage): Null check WebPageProxy::fullScreenManager() before
2875         using it.
2876
2877 2019-03-22  Timothy Hatcher  <timothy@apple.com>
2878
2879         Change macosx() to macos() in WK_API... and JSC_API... macros.
2880         https://bugs.webkit.org/show_bug.cgi?id=196106
2881
2882         Reviewed by Brian Burg.
2883
2884         * Shared/API/Cocoa/WKBrowsingContextHandle.h:
2885         * Shared/API/Cocoa/WKDragDestinationAction.h:
2886         * Shared/API/Cocoa/WKMain.h:
2887         * Shared/API/Cocoa/_WKFrameHandle.h:
2888         * Shared/API/Cocoa/_WKHitTestResult.h:
2889         * Shared/API/Cocoa/_WKNSWindowExtras.h:
2890         * Shared/API/Cocoa/_WKRemoteObjectInterface.h:
2891         * Shared/API/Cocoa/_WKRemoteObjectRegistry.h:
2892         * Shared/API/Cocoa/_WKRenderingProgressEvents.h:
2893         * Shared/API/Cocoa/_WKSameDocumentNavigationType.h:
2894         * UIProcess/API/C/WKPage.h:
2895         * UIProcess/API/Cocoa/NSAttributedString.h:
2896         * UIProcess/API/Cocoa/WKBackForwardList.h:
2897         * UIProcess/API/Cocoa/WKBackForwardListItem.h:
2898         * UIProcess/API/Cocoa/WKBackForwardListItemPrivate.h:
2899         * UIProcess/API/Cocoa/WKBrowsingContextLoadDelegate.h:
2900         * UIProcess/API/Cocoa/WKContentRuleList.h:
2901         * UIProcess/API/Cocoa/WKContentRuleListStore.h:
2902         * UIProcess/API/Cocoa/WKError.h:
2903         * UIProcess/API/Cocoa/WKErrorPrivate.h:
2904         * UIProcess/API/Cocoa/WKFrameInfo.h:
2905         * UIProcess/API/Cocoa/WKFrameInfoPrivate.h:
2906         * UIProcess/API/Cocoa/WKHTTPCookieStore.h:
2907         * UIProcess/API/Cocoa/WKMenuItemIdentifiersPrivate.h:
2908         * UIProcess/API/Cocoa/WKNavigation.h:
2909         * UIProcess/API/Cocoa/WKNavigationAction.h:
2910         * UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
2911         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
2912         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
2913         * UIProcess/API/Cocoa/WKNavigationResponse.h:
2914         * UIProcess/API/Cocoa/WKOpenPanelParameters.h:
2915         * UIProcess/API/Cocoa/WKOpenPanelParametersPrivate.h:
2916         * UIProcess/API/Cocoa/WKPreferences.h:
2917         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2918         * UIProcess/API/Cocoa/WKProcessPool.h:
2919         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2920         * UIProcess/API/Cocoa/WKScriptMessage.h:
2921         * UIProcess/API/Cocoa/WKSecurityOrigin.h:
2922         * UIProcess/API/Cocoa/WKSnapshotConfiguration.h:
2923         * UIProcess/API/Cocoa/WKUIDelegate.h:
2924         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2925         * UIProcess/API/Cocoa/WKURLSchemeHandler.h:
2926         * UIProcess/API/Cocoa/WKURLSchemeTask.h:
2927         * UIProcess/API/Cocoa/WKURLSchemeTaskPrivate.h:
2928         * UIProcess/API/Cocoa/WKUserContentController.h:
2929         * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h:
2930         * UIProcess/API/Cocoa/WKUserScript.h:
2931         * UIProcess/API/Cocoa/WKUserScriptPrivate.h:
2932         * UIProcess/API/Cocoa/WKViewPrivate.h:
2933         * UIProcess/API/Cocoa/WKWebView.h:
2934         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
2935         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2936         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2937         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
2938         * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h:
2939         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
2940         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
2941         * UIProcess/API/Cocoa/WKWindowFeatures.h:
2942         * UIProcess/API/Cocoa/WKWindowFeaturesPrivate.h:
2943         * UIProcess/API/Cocoa/_WKActivatedElementInfo.h:
2944         * UIProcess/API/Cocoa/_WKApplicationManifest.h:
2945         * UIProcess/API/Cocoa/_WKAttachment.h:
2946         * UIProcess/API/Cocoa/_WKAutomationDelegate.h:
2947         * UIProcess/API/Cocoa/_WKAutomationSession.h:
2948         * UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.h:
2949         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
2950         * UIProcess/API/Cocoa/_WKContextMenuElementInfo.h:
2951         * UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h:
2952         * UIProcess/API/Cocoa/_WKDownload.h:
2953         * UIProcess/API/Cocoa/_WKDownloadDelegate.h:
2954         * UIProcess/API/Cocoa/_WKElementAction.h:
2955         * UIProcess/API/Cocoa/_WKExperimentalFeature.h:
2956         * UIProcess/API/Cocoa/_WKFindOptions.h:
2957         * UIProcess/API/Cocoa/_WKFocusedElementInfo.h:
2958         * UIProcess/API/Cocoa/_WKFormInputSession.h:
2959         * UIProcess/API/Cocoa/_WKFullscreenDelegate.h:
2960         * UIProcess/API/Cocoa/_WKGeolocationCoreLocationProvider.h:
2961         * UIProcess/API/Cocoa/_WKInspector.h:
2962         * UIProcess/API/Cocoa/_WKInspectorWindow.h:
2963         * UIProcess/API/Cocoa/_WKInternalDebugFeature.h:
2964         * UIProcess/API/Cocoa/_WKLayoutMode.h:
2965         * UIProcess/API/Cocoa/_WKLinkIconParameters.h:
2966         * UIProcess/API/Cocoa/_WKOverlayScrollbarStyle.h:
2967         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
2968         * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.h:
2969         * UIProcess/API/Cocoa/_WKSessionState.h:
2970         * UIProcess/API/Cocoa/_WKTextInputContext.h:
2971         * UIProcess/API/Cocoa/_WKThumbnailView.h:
2972         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.h:
2973         * UIProcess/API/Cocoa/_WKUserContentExtensionStorePrivate.h:
2974         * UIProcess/API/Cocoa/_WKUserContentFilter.h:
2975         * UIProcess/API/Cocoa/_WKUserContentFilterPrivate.h:
2976         * UIProcess/API/Cocoa/_WKUserContentWorld.h:
2977         * UIProcess/API/Cocoa/_WKUserInitiatedAction.h:
2978         * UIProcess/API/Cocoa/_WKUserStyleSheet.h:
2979         * UIProcess/API/Cocoa/_WKVisitedLinkStore.h:
2980         * UIProcess/API/Cocoa/_WKWebsiteDataSize.h:
2981         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
2982         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
2983         * UIProcess/API/Cocoa/_WKWebsiteDataStoreDelegate.h:
2984         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
2985         * WebProcess/API/Cocoa/WKWebProcess.h:
2986         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h:
2987         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h:
2988         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInHitTestResult.h:
2989         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h:
2990         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandlePrivate.h:
2991         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroup.h:
2992         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.h:
2993         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.h:
2994         * WebProcess/InjectedBundle/API/mac/WKDOMDocument.h:
2995         * WebProcess/InjectedBundle/API/mac/WKDOMElement.h:
2996         * WebProcess/InjectedBundle/API/mac/WKDOMNode.h:
2997         * WebProcess/InjectedBundle/API/mac/WKDOMRange.h:
2998         * WebProcess/InjectedBundle/API/mac/WKDOMText.h:
2999         * WebProcess/InjectedBundle/API/mac/WKDOMTextIterator.h:
3000         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h:
3001         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.h:
3002         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h:
3003
3004 2019-03-22  Yousuke Kimoto  <Yousuke.Kimoto@sony.com>
3005
3006         Unreviewed build fix.
3007
3008         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3009
3010 2019-03-22  Tim Horton  <timothy_horton@apple.com>
3011
3012         Fix the build after r243354
3013         https://bugs.webkit.org/show_bug.cgi?id=196138
3014         <rdar://problem/49145951>
3015
3016         * Platform/spi/ios/UIKitSPI.h:
3017         * Shared/DocumentEditingContext.mm:
3018         (WebKit::DocumentEditingContext::toPlatformContext):
3019         * UIProcess/ios/WKContentViewInteraction.mm:
3020
3021 2019-03-21  Simon Fraser  <simon.fraser@apple.com>
3022
3023         Clean up some TiledCoreAnimationDrawingArea members
3024         https://bugs.webkit.org/show_bug.cgi?id=196124
3025
3026         Reviewed by Tim Horton.
3027
3028         The giant m_transform was unused.
3029         
3030         Group the bools etc.
3031
3032         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
3033         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3034         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
3035         (WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
3036
3037 2019-03-21  Brady Eidson  <beidson@apple.com>
3038
3039         Certain WebProcesses should opt-out of the freezer.
3040         <rdar://problem/42846139> and https://bugs.webkit.org/show_bug.cgi?id=196062
3041
3042         Reviewed by Andy Estes.
3043
3044         WebProcesses should opt-in and opt-out of the freezer as is appropriate.
3045         By default a WebProcess is freezer eligible.
3046         If any of the following become true then it should become ineligible:
3047         - The WebProcess is a pre-warmed process.
3048         - The WebProcess is in the process cache.
3049         - The WebProcess is not actively hosting any web pages (e.g. it only has suspending web pages)
3050
3051         The most complicated part of the above is guaranteeing that any operation that changes
3052         the active pages hosted by the process causes a recalculation of the freezer opt-in state.
3053
3054         To do that this replaces the basic WebPageProxyMap with a custom class.
3055
3056         * UIProcess/WebProcessProxy.cpp:
3057         (WebKit::globalPageMap):
3058         (WebKit::WebProcessProxy::WebProcessProxy):
3059         (WebKit::WebProcessProxy::validateFreezerStatus):
3060         (WebKit::WebProcessProxy::setIsInProcessCache):
3061         (WebKit::WebProcessProxy::markIsNoLongerInPrewarmedPool):
3062         (WebKit::WebProcessProxy::didFinishLaunching):
3063         * UIProcess/WebProcessProxy.h:
3064         (WebKit::WebProcessProxy::WebPageProxyMap::WebPageProxyMap):
3065         (WebKit::WebProcessProxy::WebPageProxyMap::size const):
3066         (WebKit::WebProcessProxy::WebPageProxyMap::values):
3067         (WebKit::WebProcessProxy::WebPageProxyMap::values const):
3068         (WebKit::WebProcessProxy::WebPageProxyMap::begin):
3069         (WebKit::WebProcessProxy::WebPageProxyMap::end):
3070         (WebKit::WebProcessProxy::WebPageProxyMap::get):
3071         (WebKit::WebProcessProxy::WebPageProxyMap::contains const):
3072         (WebKit::WebProcessProxy::WebPageProxyMap::isEmpty const):
3073         (WebKit::WebProcessProxy::WebPageProxyMap::set):
3074         (WebKit::WebProcessProxy::WebPageProxyMap::take):
3075
3076         * WebProcess/WebProcess.cpp:
3077         (WebKit::WebProcess::setFreezable):
3078         * WebProcess/WebProcess.h:
3079         * WebProcess/WebProcess.messages.in:
3080
3081 2019-03-21  Tim Horton  <timothy_horton@apple.com>
3082
3083         Adopt UIWKDocumentContext
3084         https://bugs.webkit.org/show_bug.cgi?id=196040
3085         <rdar://problem/48642440>
3086
3087         Reviewed by Ryosuke Niwa.
3088
3089         * Platform/spi/ios/UIKitSPI.h:
3090         * Scripts/webkit/messages.py:
3091         * Shared/DocumentEditingContext.h: Added.
3092         * Shared/DocumentEditingContext.mm: Added.
3093         (WebKit::toNSRange):
3094         (WebKit::DocumentEditingContext::toPlatformContext):
3095         (IPC::ArgumentCoder<WebKit::DocumentEditingContext::Range>::encode):
3096         (IPC::ArgumentCoder<WebKit::DocumentEditingContext::Range>::decode):
3097         (IPC::ArgumentCoder<WebKit::DocumentEditingContext::TextRect>::encode):
3098         (IPC::ArgumentCoder<WebKit::DocumentEditingContext::TextRect>::decode):
3099         (IPC::ArgumentCoder<WebKit::DocumentEditingContext>::encode):
3100         (IPC::ArgumentCoder<WebKit::DocumentEditingContext>::decode):
3101         (IPC::ArgumentCoder<WebKit::DocumentEditingContextRequest>::encode):
3102         (IPC::ArgumentCoder<WebKit::DocumentEditingContextRequest>::decode):
3103         Add DocumentEditingContext(Request), and coders.
3104         Also expose DocumentEditingContext::toPlatformContext, which populates
3105         a UIWKDocumentContext with the relevant values.
3106
3107         * SourcesCocoa.txt:
3108         * UIProcess/WebPageProxy.h:
3109         * UIProcess/ios/WKContentViewInteraction.mm:
3110         (toWebDocumentRequestOptions):
3111         (toWebRequest):
3112         (-[WKContentView adjustSelectionWithDelta:completionHandler:]):
3113         (-[WKContentView requestDocumentContext:completionHandler:]):
3114         (-[WKContentView selectPositionAtPoint:withContextRequest:completionHandler:]):
3115         * UIProcess/ios/WebPageProxyIOS.mm:
3116         (WebKit::WebPageProxy::adjustSelectionWithDelta):
3117         (WebKit::WebPageProxy::requestDocumentEditingContext):
3118         * WebKit.xcodeproj/project.pbxproj:
3119         * WebProcess/WebPage/WebPage.h:
3120         * WebProcess/WebPage/WebPage.messages.in:
3121         Plumb DocumentEditingContext(Request) around.
3122
3123         * WebProcess/WebPage/ios/WebPageIOS.mm:
3124         (WebKit::WebPage::adjustSelectionWithDelta):
3125         Adjust the current selection given deltas to apply to the location and length.
3126
3127         (WebKit::visiblePositionAdjacentToVisiblePosition):
3128         (WebKit::visiblePositionForPointInRootViewCoordinates):
3129         (WebKit::WebPage::requestDocumentEditingContext):
3130         Retrieve the relevant part of the selection, as well as the context,
3131         given either the selection, or a rect.
3132         If we're collecting context for a rect, we split the context between
3133         before and after (except for the part that intersects the selection).
3134         The three strings will always be directly adjacent, and any of the three
3135         can sometimes be null.
3136
3137 2019-03-21  James Magahern  <jmagahern@apple.com>
3138
3139         Long press gesture recognizers in WKWebView are conflicting with internal scroll view long press gesture recognizers
3140         https://bugs.webkit.org/show_bug.cgi?id=195726
3141         rdar://problem/48582449
3142
3143         Reviewed by Megan Gardner.
3144
3145         We just need to add another clause to WKContentViewInteraction's
3146         canPreventGestureRecognizer whitelist. 
3147
3148         * UIProcess/ios/WKContentViewInteraction.mm:
3149         (-[WKContentView gestureRecognizer:canPreventGestureRecognizer:]):
3150
3151 2019-03-21  Simon Fraser  <simon.fraser@apple.com>
3152
3153         [iOS WK2] Turn on async overflow scrolling by default
3154         https://bugs.webkit.org/show_bug.cgi?id=196011
3155         rdar://problem/48453859
3156
3157         Reviewed by Antti Koivisto.
3158
3159         * Shared/WebPreferences.yaml:
3160         * Shared/WebPreferencesDefaultValues.h:
3161
3162 2019-03-21  Alex Christensen  <achristensen@webkit.org>
3163
3164         Remove last use of LegacySync IPC messages
3165         https://bugs.webkit.org/show_bug.cgi?id=196113
3166
3167         Reviewed by Chris Dumez.
3168
3169         Also rename "Delayed" to "Synchronous" now that there's only one type of synchronous message.
3170
3171         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
3172         * NetworkProcess/NetworkProcess.messages.in:
3173         * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
3174         (WebKit::WebSWServerConnection::syncTerminateWorkerFromClient):
3175         * NetworkProcess/ServiceWorker/WebSWServerConnection.h:
3176         * NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in:
3177         * Platform/IPC/Connection.cpp:
3178         (IPC::Connection::dispatchMessage):
3179         * Platform/IPC/HandleMessage.h:
3180         (IPC::handleMessageSynchronous):
3181         (IPC::handleMessageSynchronousWantsConnection):
3182         (IPC::handleMessageLegacySync): Deleted.
3183         (IPC::handleMessageDelayed): Deleted.
3184         (IPC::handleMessageDelayedWantsConnection): Deleted.
3185         * PluginProcess/PluginControllerProxy.messages.in:
3186         * PluginProcess/WebProcessConnection.messages.in:
3187         * Scripts/webkit/LegacyMessageReceiver-expected.cpp:
3188         (WebKit::WebPage::didReceiveSyncWebPageMessage):
3189         * Scripts/webkit/MessageReceiver-expected.cpp:
3190         (WebKit::WebPage::didReceiveSyncMessage):
3191         * Scripts/webkit/MessageReceiverSuperclass-expected.cpp:
3192         (Messages::WebPage::TestSyncMessage::send):
3193         (Messages::WebPage::TestSynchronousMessage::send):
3194         (WebKit::WebPage::didReceiveSyncMessage):
3195         (Messages::WebPage::TestDelayedMessage::send): Deleted.
3196         * Scripts/webkit/MessagesSuperclass-expected.h:
3197         (Messages::WebPage::TestSynchronousMessage::name):
3198         (Messages::WebPage::TestSynchronousMessage::TestSynchronousMessage):
3199         (Messages::WebPage::TestDelayedMessage::receiverName): Deleted.
3200         (Messages::WebPage::TestDelayedMessage::name): Deleted.
3201         (Messages::WebPage::TestDelayedMessage::TestDelayedMessage): Deleted.
3202         (Messages::WebPage::TestDelayedMessage::arguments const): Deleted.
3203         * Scripts/webkit/messages.py:
3204         * Scripts/webkit/messages_unittest.py:
3205         * Scripts/webkit/test-legacy-messages.in:
3206         * Scripts/webkit/test-messages.in:
3207         * Scripts/webkit/test-superclass-messages.in:
3208         * Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in:
3209         * Shared/Plugins/NPObjectMessageReceiver.messages.in:
3210         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
3211         * UIProcess/Plugins/PluginProcessProxy.messages.in:
3212         * UIProcess/WebFullScreenManagerProxy.messages.in:
3213         * UIProcess/WebPageProxy.messages.in:
3214         * UIProcess/WebPasteboardProxy.messages.in:
3215         * UIProcess/WebProcessPool.messages.in:
3216         * UIProcess/WebProcessProxy.messages.in:
3217         * UIProcess/WebStorage/StorageManager.messages.in:
3218         * UIProcess/mac/SecItemShimProxy.messages.in:
3219         * WebProcess/Plugins/PluginProcessConnection.messages.in:
3220         * WebProcess/Plugins/PluginProxy.messages.in:
3221         * WebProcess/Storage/WebSWClientConnection.cpp:
3222         (WebKit::WebSWClientConnection::syncTerminateWorker):
3223         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
3224         * WebProcess/WebPage/WebPage.messages.in:
3225         * WebProcess/WebProcess.messages.in:
3226
3227 2019-03-21  Brian Burg  <bburg@apple.com>
3228
3229         Web Automation: support uploading non-local file paths
3230         https://bugs.webkit.org/show_bug.cgi?id=196081
3231         <rdar://problem/45819897>
3232
3233         Reviewed by Devin Rousso and Joseph Pecoraro.
3234
3235         To support cases where supplied file paths do not exist on the session host, add support for
3236         receiving file contents via Automation.setFilesToSelectForFileUpload.
3237
3238         * UIProcess/Automation/Automation.json: Add new parameter.
3239
3240         * UIProcess/Automation/WebAutomationSession.h:
3241         * UIProcess/Automation/WebAutomationSession.cpp:
3242         (WebKit::WebAutomationSession::setFilesToSelectForFileUpload):
3243         Add support for receiving and saving file contents to a temporary directory. Rewrite the used paths so
3244         that WebCore knows to look at the revised paths where the file contents have been saved.
3245
3246         (WebKit::WebAutomationSession::platformGenerateLocalFilePathForRemoteFile):
3247         Since WebKit does not have usable FileSystem implementations for all ports, shell out the actual
3248         saving of base64-encoded file data. Provide a Cocoa implementation, since that's what I can test.
3249
3250         * UIProcess/Automation/cocoa/WebAutomationSessionCocoa.mm:
3251         (WebKit::WebAutomationSession::platformGenerateLocalFilePathForRemoteFile):
3252         Use WTF::FileSystem to create a temporary directory, and use Cocoa methods to actually write the file.
3253
3254 2019-03-21  Youenn Fablet  <youenn@apple.com>
3255
3256         Cache API and IDB space usages should be initialized on first quota check
3257         https://bugs.webkit.org/show_bug.cgi?id=195707
3258
3259         Reviewed by Chris Dumez.
3260
3261         When the quota manager is created, make sure it delays quota check decisions until IDB and Cache API quota users are initialized.
3262         For IDB, the creation is synchronous but it may not be synchronous for Cache API.
3263         For that purpose, add a temporary quota user that will stay uninitialized until these two quota users are added.
3264         Once added, the temporary quota user is removed.
3265         The addition of the real users is made asynchronously as this is triggered by the creation of one of the two quota users.
3266
3267         In the case of a Cache API caches being cleared, make sure to reset the size to zero and to redo the quota user initialization dance.
3268
3269         * NetworkProcess/NetworkProcess.cpp:
3270         (WebKit::QuotaUserInitializer::initialize):
3271         (WebKit::QuotaUserInitializer::~QuotaUserInitializer):
3272         (WebKit::QuotaUserInitializer::QuotaUserInitializer):
3273         (WebKit::NetworkProcess::storageQuotaManager):
3274         * NetworkProcess/cache/CacheStorageEngine.cpp:
3275         (WebKit::CacheStorage::Engine::initializeQuotaUser):
3276         * NetworkProcess/cache/CacheStorageEngine.h:
3277         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
3278         (WebKit::CacheStorage::Caches::clear):
3279
3280 2019-03-21  Per Arne Vollan  <pvollan@apple.com>
3281
3282         [iOS][macOS] Fix sandbox call violations
3283         https://bugs.webkit.org/show_bug.cgi?id=195809
3284         <rdar://problem/48829655>
3285
3286         Reviewed by Brent Fulgham.
3287
3288         An additional syscall needs to be added to the sandbox allow list.
3289
3290         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
3291         * WebProcess/com.apple.WebProcess.sb.in:
3292
3293 2019-03-21  Eric Carlson  <eric.carlson@apple.com>
3294
3295         Add UI process WebRTC runtime logging.
3296         https://bugs.webkit.org/show_bug.cgi?id=196020
3297         <rdar://problem/49071443>
3298
3299         Reviewed by Youenn Fablet.
3300
3301         * Platform/Logging.cpp:
3302         (WebKit::getLogChannel): New.
3303         * Platform/Logging.h:
3304         * Shared/WebCoreArgumentCoders.h: Add coders for WTFLogChannelState and WTFLogLevel.
3305
3306         Add runtime logging.
3307         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
3308         (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy):
3309         (WebKit::UserMediaPermissionRequestManagerProxy::stopCapture):
3310         (WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged):
3311         (WebKit::UserMediaPermissionRequestManagerProxy::clearCachedState):
3312         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied):
3313         (WebKit::UserMediaPermissionRequestManagerProxy::denyRequest):
3314         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
3315         (WebKit::UserMediaPermissionRequestManagerProxy::resetAccess):
3316         (WebKit::UserMediaPermissionRequestManagerProxy::grantAccess):
3317         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
3318         (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionRequest):
3319         (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionInvalidRequest):
3320         (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionValidRequest):
3321         (WebKit::UserMediaPermissionRequestManagerProxy::computeFilteredDeviceList):
3322         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
3323         (WebKit::UserMediaPermissionRequestManagerProxy::captureStateChanged):
3324         (WebKit::UserMediaPermissionRequestManagerProxy::watchdogTimerFired):
3325         (WebKit::UserMediaPermissionRequestManagerProxy::logChannel const):
3326         (WebKit::convertEnumerationToString):
3327
3328         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
3329         (WTF::LogArgument<WebKit::UserMediaPermissionRequestManagerProxy::RequestAction>::toString):
3330         * UIProcess/UserMediaPermissionRequestProxy.cpp:
3331         (WebKit::convertEnumerationToString): Add an enum specialization for logging.
3332
3333         * UIProcess/UserMediaPermissionRequestProxy.h:
3334         (WTF::LogArgument<WebKit::UserMediaPermissionRequestProxy::UserMediaAccessDenialReason>::toString): Ditto.
3335
3336         * UIProcess/WebPageProxy.cpp:
3337         (WebKit::WebPageProxy::logger):
3338         (WebKit::WebPageProxy::configureLoggingChannel):
3339         * UIProcess/WebPageProxy.h:
3340         * UIProcess/WebPageProxy.messages.in:
3341
3342         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3343         (WebKit::WebChromeClient::configureLoggingChannel):
3344         * WebProcess/WebCoreSupport/WebChromeClient.h:
3345         * WebProcess/WebPage/WebPage.cpp:
3346         (WebKit::WebPage::configureLoggingChannel):
3347         * WebProcess/WebPage/WebPage.h:
3348
3349 2019-03-21  Alex Christensen  <achristensen@webkit.org>
3350
3351         Stop using LegacySync messages in WebPageProxy
3352         https://bugs.webkit.org/show_bug.cgi?id=196056
3353
3354         Reviewed by Chris Dumez.
3355
3356         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
3357         (WebKit::WebPageProxy::loadRecentSearches):
3358         * UIProcess/ProvisionalPageProxy.cpp:
3359         (WebKit::ProvisionalPageProxy::backForwardGoToItem):
3360         (WebKit::ProvisionalPageProxy::didReceiveSyncMessage):
3361         * UIProcess/ProvisionalPageProxy.h:
3362         * UIProcess/WebPageProxy.cpp:
3363         (WebKit::WebPageProxy::handleSynchronousMessage):
3364         (WebKit::WebPageProxy::hasInsecureContent):
3365         (WebKit::WebPageProxy::accessibilityScreenToRootView):
3366         (WebKit::WebPageProxy::rootViewToAccessibilityScreen):
3367         (WebKit::WebPageProxy::printFrame):
3368         (WebKit::WebPageProxy::backForwardGoToItem):
3369         (WebKit::WebPageProxy::backForwardGoToItemShared):
3370         (WebKit::WebPageProxy::backForwardItemAtIndex):
3371         (WebKit::WebPageProxy::backForwardBackListCount):
3372         (WebKit::WebPageProxy::backForwardForwardListCount):
3373         (WebKit::WebPageProxy::canUndoRedo):
3374         (WebKit::WebPageProxy::executeUndoRedo):
3375         (WebKit::WebPageProxy::checkTextOfParagraph):
3376         (WebKit::WebPageProxy::checkSpellingOfString):
3377         (WebKit::WebPageProxy::checkGrammarOfString):
3378         (WebKit::WebPageProxy::spellingUIIsShowing):
3379         (WebKit::WebPageProxy::getGuessesForWord):
3380         (WebKit::WebPageProxy::substitutionsPanelIsShowing):
3381         (WebKit::WebPageProxy::showCorrectionPanel):
3382         (WebKit::WebPageProxy::dismissCorrectionPanel):
3383         (WebKit::WebPageProxy::dismissCorrectionPanelSoon):
3384         (WebKit::WebPageProxy::recordAutocorrectionResponse):
3385         (WebKit::WebPageProxy::dictationAlternatives):
3386         (WebKit::WebPageProxy::wrapCryptoKey):
3387         (WebKit::WebPageProxy::unwrapCryptoKey):
3388         (WebKit::WebPageProxy::signedPublicKeyAndChallengeString):
3389         (WebKit::WebPageProxy::serializedAttachmentDataForIdentifiers):
3390         (WebKit::WebPageProxy::speechSynthesisVoiceList):
3391         (WebKit::WebPageProxy::printMainFrame): Deleted.
3392         * UIProcess/WebPageProxy.h:
3393         * UIProcess/WebPageProxy.messages.in:
3394         * UIProcess/gtk/WebPageProxyGtk.cpp:
3395         (WebKit::WebPageProxy::createPluginContainer):
3396         * UIProcess/ios/WebPageProxyIOS.mm:
3397         (WebKit::WebPageProxy::interpretKeyEvent):
3398         * UIProcess/mac/WebPageProxyMac.mm:
3399         (WebKit::WebPageProxy::getIsSpeaking):
3400         (WebKit::WebPageProxy::executeSavedCommandBySelector):
3401         (WebKit::WebPageProxy::showPDFContextMenu):
3402
3403 2019-03-21  Alex Christensen  <achristensen@webkit.org>
3404
3405         Stop using LegacySync messages in WebPage
3406         https://bugs.webkit.org/show_bug.cgi?id=196057
3407
3408         Reviewed by Chris Dumez.
3409
3410         * WebProcess/WebPage/WebPage.h:
3411         (WebKit::WebPage::markLayersVolatile):
3412         * WebProcess/WebPage/WebPage.messages.in:
3413         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
3414         (WebKit::WebPage::getCenterForZoomGesture):
3415         * WebProcess/WebPage/ios/WebPageIOS.mm:
3416         (WebKit::WebPage::readSelectionFromPasteboard):
3417         (WebKit::WebPage::getStringSelectionForPasteboard):
3418         (WebKit::WebPage::getDataSelectionForPasteboard):
3419         (WebKit::WebPage::shouldDelayWindowOrderingEvent):
3420         (WebKit::WebPage::acceptsFirstMouse):
3421         * WebProcess/WebPage/mac/WebPageMac.mm:
3422         (WebKit::WebPage::replaceSelectionWithPasteboardData):
3423         (WebKit::WebPage::readSelectionFromPasteboard):
3424         (WebKit::WebPage::getStringSelectionForPasteboard):
3425         (WebKit::WebPage::getDataSelectionForPasteboard):
3426         (WebKit::WebPage::shouldDelayWindowOrderingEvent):
3427         (WebKit::WebPage::acceptsFirstMouse):
3428
3429 2019-03-21  Alex Christensen  <achristensen@webkit.org>
3430
3431         Stop using LegacySync messages in WebPasteboardProxy
3432         https://bugs.webkit.org/show_bug.cgi?id=196060
3433
3434         Reviewed by Chris Dumez.
3435
3436         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
3437         (WebKit::WebPasteboardProxy::getPasteboardTypes):
3438         (WebKit::WebPasteboardProxy::getPasteboardPathnamesForType):
3439         (WebKit::WebPasteboardProxy::getPasteboardStringForType):
3440         (WebKit::WebPasteboardProxy::getPasteboardStringsForType):
3441         (WebKit::WebPasteboardProxy::getPasteboardBufferForType):
3442         (WebKit::WebPasteboardProxy::pasteboardCopy):
3443         (WebKit::WebPasteboardProxy::getPasteboardChangeCount):
3444         (WebKit::WebPasteboardProxy::getPasteboardUniqueName):
3445         (WebKit::WebPasteboardProxy::getPasteboardColor):
3446         (WebKit::WebPasteboardProxy::getPasteboardURL):
3447         (WebKit::WebPasteboardProxy::addPasteboardTypes):
3448         (WebKit::WebPasteboardProxy::setPasteboardTypes):
3449         (WebKit::WebPasteboardProxy::setPasteboardURL):
3450         (WebKit::WebPasteboardProxy::setPasteboardColor):
3451         (WebKit::WebPasteboardProxy::setPasteboardStringForType):
3452         (WebKit::WebPasteboardProxy::setPasteboardBufferForType):
3453         (WebKit::WebPasteboardProxy::getNumberOfFiles):
3454         (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
3455         (WebKit::WebPasteboardProxy::writeCustomData):
3456         (WebKit::WebPasteboardProxy::readStringFromPasteboard):
3457         (WebKit::WebPasteboardProxy::readURLFromPasteboard):
3458         (WebKit::WebPasteboardProxy::readBufferFromPasteboard):
3459         (WebKit::WebPasteboardProxy::getPasteboardItemsCount):
3460         (WebKit::WebPasteboardProxy::allPasteboardItemInfo):
3461         (WebKit::WebPasteboardProxy::informationForItemAtIndex):
3462         * UIProcess/WebPasteboardProxy.cpp:
3463         (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
3464         (WebKit::WebPasteboardProxy::writeCustomData):
3465         * UIProcess/WebPasteboardProxy.h:
3466         * UIProcess/WebPasteboardProxy.messages.in:
3467         * UIProcess/gtk/WebPasteboardProxyGtk.cpp:
3468         (WebKit::WebPasteboardProxy::writeToClipboard):
3469         (WebKit::WebPasteboardProxy::readFromClipboard):
3470         * UIProcess/wpe/WebPasteboardProxyWPE.cpp:
3471         (WebKit::WebPasteboardProxy::getPasteboardTypes):
3472         (WebKit::WebPasteboardProxy::readStringFromPasteboard):
3473         (WebKit::WebPasteboardProxy::writeWebContentToPasteboard):
3474         (WebKit::WebPasteboardProxy::writeStringToPasteboard):
3475
3476 2019-03-21  Andy Estes  <aestes@apple.com>
3477
3478         [iOS] Apple Pay should be available in documents with no user agent scripts
3479         https://bugs.webkit.org/show_bug.cgi?id=196061
3480         <rdar://problem/48649391>
3481
3482         Reviewed by Brady Eidson.
3483
3484         * Shared/AuxiliaryProcess.h:
3485         * Shared/Cocoa/AuxiliaryProcessCocoa.mm:
3486         (WebKit::AuxiliaryProcess::parentProcessHasEntitlement):
3487
3488         Added a convenience function for checking parent process entitlements.
3489
3490         * Shared/WebPreferences.yaml:
3491         * Shared/WebPreferencesDefaultValues.h:
3492         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3493         (-[WKWebViewConfiguration init]):
3494
3495         Enabled Apple Pay by default on platforms that enable APPLE_PAY_REMOTE_UI.
3496
3497         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
3498         (WebKit::WebPaymentCoordinator::supportsUnrestrictedApplePay const):
3499         * WebProcess/ApplePay/WebPaymentCoordinator.h:
3500
3501         Implemented supportsUnrestrictedApplePay by checking for the
3502         com.apple.private.WebKit.UnrestrictedApplePay entitlement on platforms that enable
3503         APPLE_PAY_REMOTE_UI.
3504
3505         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h:
3506         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
3507         (didClearWindowObjectForFrame):
3508         (setUpPageLoaderClient):
3509
3510         Added injected bundle SPI that TestWebKitAPI uses to inject the WebCore Internals interface.
3511
3512         * WebProcess/WebPage/WebPage.cpp:
3513         (WebKit::WebPage::runJavaScript):
3514
3515         Changed to call ScriptController::executeUserAgentScriptInWorld.
3516
3517 2019-03-21  Chris Dumez  <cdumez@apple.com>
3518
3519         WebKit should throw when trying to create a WKWebView with a related view that is using a different data store
3520         https://bugs.webkit.org/show_bug.cgi?id=196041
3521         <rdar://problem/49083230>
3522
3523         Reviewed by Alex Christensen.
3524
3525         WebKit should throw when trying to create a WKWebView with a related view that is using a different data store.
3526         We do not support having several WebsiteDataStores sharing the same WebProcess.
3527
3528         * UIProcess/API/Cocoa/WKWebView.mm:
3529         (-[WKWebView _initializeWithConfiguration:]):
3530         * UIProcess/WebProcessPool.cpp:
3531         (WebKit::WebProcessPool::createWebPage):
3532
3533 2019-03-21  Alex Christensen  <achristensen@webkit.org>
3534
3535         Add SPI to inform applications of WKContentRuleList actions
3536         https://bugs.webkit.org/show_bug.cgi?id=195965
3537         <rdar://problem/42664365>
3538
3539         Reviewed by Geoff Garen.
3540
3541         * NetworkProcess/NetworkLoadChecker.cpp:
3542         (WebKit::NetworkLoadChecker::checkRequest):
3543         (WebKit::NetworkLoadChecker::processContentRuleListsForLoad):
3544         (WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad): Deleted.
3545         * NetworkProcess/NetworkLoadChecker.h:
3546         * UIProcess/API/APINavigationClient.h:
3547         (API::NavigationClient::contentRuleListNotification):
3548         * UIProcess/API/C/WKPage.cpp:
3549         (WKPageSetPageNavigationClient):
3550         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
3551         * UIProcess/Cocoa/NavigationState.h:
3552         * UIProcess/Cocoa/NavigationState.mm:
3553         (WebKit::NavigationState::setNavigationDelegate):
3554         (WebKit::NavigationState::NavigationClient::contentRuleListNotification):
3555         * UIProcess/WebPageProxy.cpp:
3556         (WebKit::WebPageProxy::contentRuleListNotification):
3557         * UIProcess/WebPageProxy.h:
3558         * UIProcess/WebPageProxy.messages.in:
3559         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3560         (WebKit::WebChromeClient::contentRuleListNotification):
3561         * WebProcess/WebCoreSupport/WebChromeClient.h:
3562
3563 2019-03-21  Simon Fraser  <simon.fraser@apple.com>
3564
3565         Add an internal feature flag to disable the -webkit-overflow-scrolling CSS property
3566         https://bugs.webkit.org/show_bug.cgi?id=196058
3567         rdar://problem/49078202
3568
3569         Reviewed by Antti Koivisto.
3570
3571         Add an internal feature flag called "LegacyOverflowScrollingTouchEnabled", initially
3572         on by default.
3573
3574         * Shared/WebPreferences.yaml:
3575
3576 2019-03-21  Antti Koivisto  <antti@apple.com>
3577
3578         UI-process hit-testing needs to know about containing block relationships
3579         https://bugs.webkit.org/show_bug.cgi?id=195845
3580         <rdar://problem/48949633>
3581
3582         Reviewed by Simon Fraser.
3583
3584         Test: fast/scrolling/ios/overflow-scroll-overlap-5.html
3585
3586         When an overflow scroller contains a positioned element the element may not be on a descendant layer of the scroller,
3587         yet should move along with it. This needs to be taken into account in UI-side hit testing.
3588
3589         * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h:
3590         (WebKit::RemoteLayerTreeNode::nonAncestorScrollContainerIDs const):
3591         (WebKit::RemoteLayerTreeNode::addNonAncestorScrollContainerID):
3592         (WebKit::RemoteLayerTreeNode::clearNonAncestorScrollContainerIDs):
3593
3594         Maintain non-ancestor scrolling relationships for layers.
3595
3596         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
3597         (WebKit::RemoteScrollingCoordinatorProxy::commitScrollingTreeState):
3598         (WebKit::RemoteScrollingCoordinatorProxy::establishLayerTreeScrollingRelations):
3599         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
3600         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
3601         (WebKit::isScrolledBy):
3602
3603         Helper to figure out who scrolls who.
3604
3605         (-[UIView _web_findDescendantViewAtPoint:withEvent:]):
3606         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
3607         (WebKit::RemoteScrollingCoordinatorProxy::establishLayerTreeScrollingRelations):
3608
3609         After commit, pull the non-ancestor scrolling relationships from the scrolling tree and update the layer tree.
3610
3611 2019-03-21  Daniel Bates  <dabates@apple.com>
3612
3613         [iOS] Inline -_ensureFormAccessoryView into -formAccessoryView and have -_updateAccessory ensure we have a form accessory
3614         https://bugs.webkit.org/show_bug.cgi?id=196021
3615
3616         Reviewed by Wenson Hsieh.
3617
3618         Every caller of -_ensureFormAccessoryView, except -formAccessoryView, immediately follows the call
3619         with a call to -_updateAccessory. Let's just have -_updateAccessory ensure we have a form accessory
3620         view and inline the implementation of -_ensureFormAccessoryView into -formAccessoryView so we can
3621         remove one method.
3622
3623         * UIProcess/ios/WKContentViewInteraction.mm:
3624         (-[WKContentView inputView]): Remove call to -_ensureFormAccessoryView, -_updateAccessory will do
3625         the equivalent work for us.
3626         (-[WKContentView formAccessoryView]): Moved implementation of -_ensureFormAccessoryView into here.
3627         (-[WKContentView _updateAccessory]): Call self.formAccessoryView to ensure we have a form accessory view.
3628         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
3629         Remove call to -_ensureFormAccessoryView, -_updateAccessory will do
3630         the equivalent work for us.
3631         (-[WKContentView _ensureFormAccessoryView]): Deleted.
3632
3633 2019-03-21  Shawn Roberts  <sroberts@apple.com>
3634
3635         Unreviewed, rolling out r243250.
3636
3637         Causing 109 Failures and 2 crashes on iOS Sim Debug
3638         OpenSource/Internal queues
3639
3640         Reverted changeset:
3641
3642         "[iOS WK2] Turn on async overflow scrolling by default"
3643         https://bugs.webkit.org/show_bug.cgi?id=196011
3644         https://trac.webkit.org/changeset/243250
3645
3646 2019-03-21  Brent Fulgham  <bfulgham@apple.com>
3647
3648         Fix possible memory leak when dismissing a color picker
3649         https://bugs.webkit.org/show_bug.cgi?id=196026
3650         <rdar://problem/48778568>
3651
3652         Reviewed by Wenson Hsieh.
3653
3654         Fix a problem with WebPageProxy::endColorPicker where an early return could leave a color picker
3655         with a +1 reference count after dismissing it.
3656
3657         * UIProcess/WebColorPicker.cpp:
3658         (WebKit::WebColorPicker::endPicker):
3659         * UIProcess/WebPageProxy.cpp:
3660         (WebKit::WebPageProxy::endColorPicker):
3661         (WebKit::WebPageProxy::didEndColorPicker):
3662
3663 2019-03-21  Carlos Garcia Campos  <cgarcia@igalia.com>
3664
3665         [GTK][WPE] Add API to provide geolocation information
3666         https://bugs.webkit.org/show_bug.cgi?id=195940
3667
3668         Reviewed by Michael Catanzaro.
3669
3670         Add WebKitGeolocationManager public class to handle geolocation position updates. WebKitGeolocationProvider has
3671         been removed and the default implementation based on GeoClue is done by WebKitGeolocationManager.
3672
3673         * PlatformGTK.cmake:
3674         * PlatformWPE.cmake:
3675         * SourcesGTK.txt:
3676         * SourcesWPE.txt:
3677         * UIProcess/API/glib/WebKitGeolocationManager.cpp: Added.
3678         (_WebKitGeolocationPosition::_WebKitGeolocationPosition):
3679         (webkit_geolocation_position_new):
3680         (webkit_geolocation_position_copy):
3681         (webkit_geolocation_position_free):
3682         (webkit_geolocation_position_set_timestamp):
3683         (webkit_geolocation_position_set_altitude):
3684         (webkit_geolocation_position_set_altitude_accuracy):
3685         (webkit_geolocation_position_set_heading):
3686         (webkit_geolocation_position_set_speed):
3687         (webkitGeolocationManagerStop):
3688         (webkitGeolocationManagerSetEnableHighAccuracy):
3689         (webkitGeolocationManagerCreate):
3690         (webkitGeolocationManagerGetProperty):
3691         (webkit_geolocation_manager_class_init):
3692         (webkit_gelocation_manager_update_position):
3693         (webkit_gelocation_manager_failed):
3694         (webkit_geolocation_manager_get_enable_high_accuracy):
3695         * UIProcess/API/glib/WebKitGeolocationManagerPrivate.h: Copied from Source/WebCore/platform/geoclue/GeolocationProviderGeoclueClient.h.
3696         * UIProcess/API/glib/WebKitGeolocationProvider.cpp: Removed.
3697         * UIProcess/API/glib/WebKitGeolocationProvider.h: Removed.
3698         * UIProcess/API/glib/WebKitWebContext.cpp:
3699         (webkitWebContextConstructed): Create a WebKitGeolocationManager instead of a WebKitGeolocationProvider.
3700         (webkit_web_context_get_geolocation_manager): Get the WebKitGeolocationManager.
3701         * UIProcess/API/gtk/WebKitGeolocationManager.h: Added.
3702         * UIProcess/API/gtk/WebKitWebContext.h:
3703         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
3704         * UIProcess/API/gtk/docs/webkit2gtk-4.0.types:
3705         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
3706         * UIProcess/API/gtk/webkit2.h:
3707         * UIProcess/API/wpe/WebKitGeolocationManager.h: Added.
3708         * UIProcess/API/wpe/WebKitWebContext.h:
3709         * UIProcess/API/wpe/docs/wpe-0.1-sections.txt:
3710         * UIProcess/API/wpe/docs/wpe-docs.sgml:
3711         * UIProcess/API/wpe/webkit.h:
3712
3713 2019-03-20  Youenn Fablet  <youenn@apple.com>
3714
3715         Compute quota after network process restart based on default quota and space used
3716         https://bugs.webkit.org/show_bug.cgi?id=195804
3717
3718         Reviewed by Chris Dumez.
3719
3720         Make sure that Cache Storage quota user waits to declare as initialized to its manager
3721         until all data is loaded so that it can report a valid space used from the start.
3722
3723         Add test API to reset the quota to its default value and compute it according current space use.
3724
3725         * NetworkProcess/NetworkProcess.cpp:
3726         (WebKit::NetworkProcess::updateQuotaBasedOnSpaceUsageForTesting):
3727         * NetworkProcess/NetworkProcess.h:
3728         * NetworkProcess/NetworkProcess.messages.in:
3729         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
3730         (WebKit::CacheStorage::Caches::create):
3731         (WebKit::CacheStorage::Caches::Caches):
3732         (WebKit::CacheStorage::Caches::whenInitialized):
3733         * NetworkProcess/cache/CacheStorageEngineCaches.h:
3734         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
3735         (WebKit::CacheStorageEngineConnection::dereference):
3736         * WebProcess/Cache/WebCacheStorageConnection.cpp:
3737         (WebKit::WebCacheStorageConnection::setQuotaBasedOnSpaceUsage):
3738         * WebProcess/Cache/WebCacheStorageConnection.h:
3739
3740 2019-03-20  Simon Fraser  <simon.fraser@apple.com>
3741
3742         Rename ENABLE_ACCELERATED_OVERFLOW_SCROLLING macro to ENABLE_OVERFLOW_SCROLLING_TOUCH
3743         https://bugs.webkit.org/show_bug.cgi?id=196049
3744
3745         Reviewed by Tim Horton.
3746
3747         This macro is about the -webkit-overflow-scrolling CSS property, not accelerated
3748         overflow scrolling in general, so rename it.
3749
3750         * Configurations/FeatureDefines.xcconfig:
3751
3752 2019-03-20  Jiewen Tan  <jiewen_tan@apple.com>
3753
3754         Extend Networking Process sandbox for some system frameworks
3755         https://bugs.webkit.org/show_bug.cgi?id=196036
3756         <rdar://problem/47594150>
3757
3758         Reviewed by Brent Fulgham.
3759
3760         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
3761         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
3762
3763 2019-03-20  Alex Christensen  <achristensen@webkit.org>
3764
3765         Reduce use of LegacySync IPC message type
3766         https://bugs.webkit.org/show_bug.cgi?id=194835
3767
3768         Reviewed by Darin Adler.
3769
3770         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3771         (WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
3772         (WebKit::NetworkConnectionToWebProcess::cookiesEnabled):
3773         (WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue):
3774         (WebKit::NetworkConnectionToWebProcess::getRawCookies):
3775         (WebKit::NetworkConnectionToWebProcess::blobSize):
3776         (WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer):
3777         (WebKit::NetworkConnectionToWebProcess::establishSWServerConnection):
3778         * NetworkProcess/NetworkConnectionToWebProcess.h:
3779         (WebKit::NetworkConnectionToWebProcess::getNetworkLoadInformationRequest):
3780         (WebKit::NetworkConnectionToWebProcess::getNetworkLoadInformationResponse):
3781         (WebKit::NetworkConnectionToWebProcess::getNetworkLoadIntermediateInformation):
3782         (WebKit::NetworkConnectionToWebProcess::takeNetworkLoadInformationMetrics):
3783         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
3784         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
3785         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
3786         (WebKit::UserMediaCaptureManagerProxy::capabilities):
3787         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
3788         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
3789         * UIProcess/Plugins/PluginProcessProxy.h:
3790         * UIProcess/Plugins/PluginProcessProxy.messages.in:
3791         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
3792         (WebKit::PluginProcessProxy::launchProcess):
3793         (WebKit::PluginProcessProxy::launchApplicationAtURL):
3794         (WebKit::PluginProcessProxy::openURL):
3795         (WebKit::PluginProcessProxy::openFile):
3796         * UIProcess/WebFullScreenManagerProxy.cpp:
3797         (WebKit::WebFullScreenManagerProxy::supportsFullScreen):
3798         * UIProcess/WebFullScreenManagerProxy.h:
3799         * UIProcess/WebFullScreenManagerProxy.messages.in:
3800         * WebProcess/WebProcess.cpp:
3801         (WebKit::WebProcess::fetchWebsiteData):
3802         (WebKit::WebProcess::deleteWebsiteData):
3803         (WebKit::WebProcess::deleteWebsiteDataForOrigins):
3804         (WebKit::WebProcess::processWillSuspendImminently):
3805         * WebProcess/WebProcess.h:
3806         * WebProcess/WebProcess.messages.in:
3807
3808 2019-03-20  Keith Rollin  <krollin@apple.com>
3809
3810         Update checks that determine if WebKit is system WebKit
3811         https://bugs.webkit.org/show_bug.cgi?id=195756
3812
3813         Unreviewed tweak of r243251 after unreviewed build fix after r243230.
3814
3815         * Shared/mac/AuxiliaryProcessMac.mm:
3816         (WebKit::AuxiliaryProcess::isSystemWebKit):
3817
3818 2019-03-20  Keith Rollin  <krollin@apple.com>
3819
3820         Update checks that determine if WebKit is system WebKit
3821         https://bugs.webkit.org/show_bug.cgi?id=195756
3822
3823         Unreviewed build fix after r243230.
3824
3825         * Shared/mac/AuxiliaryProcessMac.mm:
3826         (WebKit::AuxiliaryProcess::isSystemWebKit):
3827
3828 2019-03-20  Simon Fraser  <simon.fraser@apple.com>
3829
3830         [iOS WK2] Turn on async overflow scrolling by default
3831         https://bugs.webkit.org/show_bug.cgi?id=196011
3832         rdar://problem/48453859
3833
3834         Reviewed by Antti Koivisto.
3835
3836         Turn async overflow scroll on by default for iOS WK2.
3837
3838         * Shared/WebPreferences.yaml:
3839         * Shared/WebPreferencesDefaultValues.h:
3840
3841 2019-03-20  Youenn Fablet  <youenn@apple.com>
3842
3843         Have smaller default quotas for third party frames
3844         https://bugs.webkit.org/show_bug.cgi?id=195841
3845
3846         Reviewed by Geoffrey Garen.
3847
3848         * NetworkProcess/NetworkProcess.cpp:
3849         (WebKit::NetworkProcess::storageQuotaManager):
3850         For third party iframes, use the default quota divided by 10.
3851
3852 2019-03-20  Dean Jackson  <dino@apple.com>
3853
3854         [iOS] Enable fast clicking everywhere
3855         https://bugs.webkit.org/show_bug.cgi?id=196023
3856         <rdar://problem/49073589>
3857
3858         Reviewed by Wenson Hsieh.
3859
3860         Set FastClicksEverywhere to on by default for iPhone & iPad.
3861
3862         * Shared/WebPreferences.yaml:
3863         * Shared/WebPreferencesDefaultValues.h:
3864
3865 2019-03-20  Chris Dumez  <cdumez@apple.com>
3866
3867         Regression(PSON): ViewGestureController is not properly notified of process swaps on iOS
3868         https://bugs.webkit.org/show_bug.cgi?id=196029
3869         <rdar://problem/48954651>
3870
3871         Reviewed by Tim Horton.
3872
3873         If there is a ViewGestureController when process swapping, make sure we disconnect it
3874         from the old process and reconnect it to the new one. This matches what is done in
3875         WebViewImpl for macOS (see r238356).
3876
3877         * UIProcess/API/Cocoa/WKWebView.mm:
3878         (-[WKWebView _processWillSwap]):
3879         (-[WKWebView _processDidExit]):
3880         (-[WKWebView _didRelaunchProcess]):
3881
3882 2019-03-20  Carlos Garcia Campos  <cgarcia@igalia.com>
3883
3884         [GTK] REGRESSION(r243094): crash when launching minibrowser
3885         https://bugs.webkit.org/show_bug.cgi?id=195951
3886
3887         Reviewed by Joseph Pecoraro.
3888
3889         Always return the inspector from WebPageProxy::inspector() when the page hasn't been closed. The inspector is
3890         created in WebPageProxy constructor and it's safe to use even before a process has been launched, because
3891         m_inspectedPage is null-checked everywhere.
3892
3893         * UIProcess/WebPageProxy.cpp:
3894         (WebKit::WebPageProxy::inspector const):
3895
3896 2019-03-20  Keith Rollin  <krollin@apple.com>
3897
3898         Update checks that determine if WebKit is system WebKit
3899         https://bugs.webkit.org/show_bug.cgi?id=195756
3900
3901         Reviewed by Alexey Proskuryakov.
3902
3903         The system WebKit can be installed in additional locations, so check
3904         for and allow those, too.
3905
3906         * Shared/mac/AuxiliaryProcessMac.mm:
3907         (WebKit::AuxiliaryProcess::isSystemWebKit):
3908
3909 2019-03-20  Per Arne Vollan  <pvollan@apple.com>
3910
3911         [iOS] Unable to PiP web videos in Safari due to sandbox violation
3912         https://bugs.webkit.org/show_bug.cgi?id=196015
3913         <rdar://problem/48867037>
3914
3915         Reviewed by Brent Fulgham.
3916
3917         The sandbox should allow getting the iokit property 'ui-pip'.
3918
3919         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
3920
3921 2019-03-20  John Wilander  <wilander@apple.com>
3922
3923         (Test fix) Override minimumTimeBetweenDataRecordsRemoval in ResourceLoadStatisticsStore::shouldRemoveDataRecord() during layout tests
3924         https://bugs.webkit.org/show_bug.cgi?id=196017
3925
3926         Unreviewed test fix.
3927
3928         This patch adds a check of parameters().isRunningTest to the return of
3929         ResourceLoadStatisticsStore::shouldRemoveDataRecord() to allow successive
3930         layout tests to remove website data, effectively overriding the
3931         minimumTimeBetweenDataRecordsRemoval setting.
3932
3933         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
3934         (WebKit::ResourceLoadStatisticsStore::shouldRemoveDataRecords const):
3935
3936 2019-03-20  Daniel Bates  <dabates@apple.com>
3937
3938         [iOS] Group UIWebFormAccessoryDelegate-related code and tighten it up a bit
3939         https://bugs.webkit.org/show_bug.cgi?id=196018
3940
3941         Reviewed by Wenson Hsieh.
3942
3943         * UIProcess/ios/WKContentViewInteraction.mm:
3944         (-[WKContentView accessoryClear]): Use uniform initializer syntax. Code could send the empty
3945         string, but I resisted since null string, as we do now, likely encodes more compactly and we
3946         avoid a per-process alloc.
3947         (-[WKContentView accessoryTab:]): Fix style nit; missing space between capture list and arguments
3948         in lambda. Also use lamdba capture initializer syntax and remove a local.
3949         (-[WKContentView _updateAccessory]): Remove a FIXME as it can't be satified with the current
3950         design without more bookkeeping. The design for showing and hiding an AutoFill button added in
3951         r166933 requires knowing the title for the button when showing it via -setAccessoryViewCustomButtonTitle.
3952         We could re-implement such that -setAccessoryViewCustomButtonTitle: stores the title and calls
3953         -_updateAccessory, but that has the disadvantage of increasing the memory footprint of WKContentView
3954         for the stored title and that seems worse than centralizing the logic in _updateAccessory. So,
3955         let's not fix this FIXME. Now that we are removing the FIXME, change to use an early return style.
3956         (-[WKContentView _hideKeyboard]): Micro optimization; only call _updateAccessory if we have
3957         a form accessory view. This method is called everytime we load a page (more precisely when we
3958         commit the load for a page) in addition to everytime we blur (defocus) an element. No need to
3959         update an accessory if we don't have one.
3960  
3961 2019-03-20  Olivier Robin  <olivierrobin@chromium.org>
3962
3963         Fix _getContentsAsAttributedStringWithCompletionHandler availability for iOS.
3964         https://bugs.webkit.org/show_bug.cgi?id=195999
3965
3966         Reviewed by Tim Horton.
3967
3968         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3969
3970 2019-03-20  Brent Fulgham  <bfulgham@apple.com>
3971
3972         Adopt RegistrableDomain in the Storage Access API prompt code paths
3973         https://bugs.webkit.org/show_bug.cgi?id=195957
3974         <rdar://problem/49048028>
3975
3976         Reviewed by Chris Dumez.
3977
3978         While making the code changes in Bug 195866 we noticed that strings were being
3979         used to pass the origins for the API calls. We should adopt the RegistrableDomain
3980         class to improve type safety and avoid introducing bugs in the future.
3981
3982         * UIProcess/API/APIUIClient.h:
3983         (API::UIClient::requestStorageAccessConfirm):
3984         * UIProcess/API/C/WKPage.cpp:
3985         (WKPageSetPageUIClient):
3986         * UIProcess/Cocoa/UIDelegate.h:
3987         * UIProcess/Cocoa/UIDelegate.mm:
3988         (WebKit::UIDelegate::UIClient::requestStorageAccessConfirm):
3989         * UIProcess/Cocoa/WKStorageAccessAlert.h:
3990         * UIProcess/Cocoa/WKStorageAccessAlert.mm:
3991         (WebKit::presentStorageAccessAlert):
3992         * UIProcess/WebPageProxy.cpp:
3993         (WebKit::WebPageProxy::requestStorageAccessConfirm):
3994
3995 2019-03-20  Chris Dumez  <cdumez@apple.com>
3996
3997         Unreviewed, fix typo in comment added in r243156.
3998
3999         * UIProcess/WebPageProxy.cpp:
4000         (WebKit::WebPageProxy::postMessageToInjectedBundle):
4001
4002 2019-03-20  Chris Dumez  <cdumez@apple.com>
4003
4004         Unreviewed, drop invalid assertions landed in r243163.
4005
4006         Those assertions were causing some API tests to crash.
4007         Also include some post-review suggestions from Darin.
4008
4009         * Shared/CallbackID.h:
4010         (WebKit::CallbackID::operator=):
4011         * Shared/OptionalCallbackID.h:
4012         (WebKit::OptionalCallbackID::operator=):