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