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