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