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