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