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