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