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