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