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