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