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