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