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