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