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