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