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