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