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