Add Ad Click Attribution as an internal/experimental feature
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2019-01-24  John Wilander  <wilander@apple.com>
2
3         Add Ad Click Attribution as an internal/experimental feature
4         https://bugs.webkit.org/show_bug.cgi?id=193685
5         <rdar://problem/47450399>
6
7         Reviewed by Brent Fulgham.
8
9         * Shared/WebPreferences.yaml:
10             Added AdClickAttributionEnabled as a runtime enabled feature, off by default.
11
12 2019-01-24  Antti Koivisto  <antti@apple.com>
13
14         [PSON] Flash on back navigation on Mac
15         https://bugs.webkit.org/show_bug.cgi?id=193716
16         <rdar://problem/47148458>
17
18         Reviewed by Chris Dumez.
19
20         We close the page immediately if we fail to suspend. Layers disappear and we get a flash.
21
22         * UIProcess/SuspendedPageProxy.cpp:
23         (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
24         (WebKit::SuspendedPageProxy::close):
25
26         Track closed state so we don't send the message twice, causing unhandled message errors in web process.
27
28         (WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
29
30         Close the suspended page if the suspension fails.
31         Skip this if we are using web process side compositing on Mac.
32
33         * UIProcess/SuspendedPageProxy.h:
34         * UIProcess/WebPageProxy.cpp:
35         (WebKit::WebPageProxy::enterAcceleratedCompositingMode):
36
37         On Mac, close the failed SuspendedPageProxy when entering compositing mode. At this point we don't need it to keep layers alive.
38
39         * UIProcess/WebProcessPool.cpp:
40         (WebKit::WebProcessPool::closeFailedSuspendedPagesForPage):
41         * UIProcess/WebProcessPool.h:
42         * WebProcess/WebPage/WebPage.cpp:
43         (WebKit::WebPage::suspendForProcessSwap):
44
45         Don't close the page on suspension failure. This is now managed by the UI process.
46
47 2019-01-24  Chris Dumez  <cdumez@apple.com>
48
49         Regression(PSON) Back/Forward list items' URL sometimes gets replaced with the URL of a subframe
50         https://bugs.webkit.org/show_bug.cgi?id=193761
51         <rdar://problem/47456405>
52
53         Reviewed by Alex Christensen.
54
55         When doing a history navigation cross-process, the UIProcess would first send the back/forward list items
56         to the destination WebProcess via WebPage::updateBackForwardListForReattach(), then ask the process to
57         navigate to the expected back/forward list item.
58
59         WebPage::updateBackForwardListForReattach() would call restoreSessionInternal(), which would call
60         toHistoryItem() on each BackForwardListItem. This may end up creating more than one HistoryItem for each
61         BackForwardListItem because HistoryItems are part of a tree (each frame has its own list of history items).
62
63         Note that BackForwardListItems and HistoryItem share a BackForwardItemIdentifier which is a
64         (processIdentifier, itemIdentifier) pair. We normally generate the HistoryItem's identifier from inside
65         its constructor like so:
66         `{ Process::identifier(), generateObjectIdentifier<BackForwardItemIdentifier::ItemIdentifierType>() }`
67
68         However, when calling updateBackForwardListForReattach() and constructing children HistoryItem,
69         applyFrameState() would generate the identifier by itself and passing it to the HistoryItem constructor.
70         Its genegates the ID the exact same way so this would in theory not be a problem. Unfortunately, both
71         calls to generateObjectIdentifier() get inlined and both call sites end up with their own static counter
72         to generate ids. As a result, we may end up with conflicts as HistoryItems for child frames (restored
73         by restoreSessionInternal()) can end up with the same identifier as HistoryItems for top frames.
74
75         This confusion would lead to the WebContent process sending the UIProcess bad information and the URL
76         of subframes could end up as the WebBackForwardListItem's mainframe URL.
77
78         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
79         (WebKit::applyFrameState):
80         Stop calling generateObjectIdentifier() explicitly and let the HistoryItem constructor take care of it.
81         Calling generateObjectIdentifier() for the same type from different places is not safe due to inlining.
82
83 2019-01-24  Ross Kirsling  <ross.kirsling@sony.com>
84
85         Move FileSystem to WTF
86         https://bugs.webkit.org/show_bug.cgi?id=193602
87
88         Reviewed by Yusuke Suzuki.
89
90         * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.cpp:
91         * NetworkProcess/NetworkDataTaskBlob.h:
92         * NetworkProcess/NetworkProcess.cpp:
93         * NetworkProcess/cache/CacheStorageEngine.cpp:
94         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
95         * NetworkProcess/cache/NetworkCache.cpp:
96         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
97         * NetworkProcess/cache/NetworkCacheData.cpp:
98         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
99         * NetworkProcess/cache/NetworkCacheFileSystem.h:
100         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
101         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
102         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
103         * NetworkProcess/cache/NetworkCacheStorage.cpp:
104         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
105         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
106         * NetworkProcess/mac/NetworkProcessMac.mm:
107         * NetworkProcess/soup/NetworkProcessSoup.cpp:
108         * PluginProcess/unix/PluginProcessMainUnix.cpp:
109         * Shared/PersistencyUtils.cpp:
110         * Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp:
111         * Shared/Plugins/unix/PluginSearchPath.cpp:
112         * Shared/WebMemorySampler.h:
113         * Shared/glib/ProcessExecutablePathGLib.cpp:
114         * Shared/ios/ChildProcessIOS.mm:
115         * Shared/mac/ChildProcessMac.mm:
116         * Shared/mac/SandboxExtensionMac.mm:
117         * UIProcess/API/APIContentRuleListStore.cpp:
118         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
119         * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
120         * UIProcess/API/glib/IconDatabase.cpp:
121         * UIProcess/API/glib/WebKitFaviconDatabase.cpp:
122         * UIProcess/API/glib/WebKitFileChooserRequest.cpp:
123         * UIProcess/API/glib/WebKitWebContext.cpp:
124         * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
125         * UIProcess/API/win/APIWebsiteDataStoreWin.cpp:
126         * UIProcess/Automation/WebAutomationSession.cpp:
127         * UIProcess/Cocoa/DownloadClient.mm:
128         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
129         * UIProcess/Cocoa/WebViewImpl.mm:
130         * UIProcess/DeviceIdHashSaltStorage.cpp:
131         * UIProcess/Downloads/DownloadProxy.cpp:
132         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
133         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
134         * UIProcess/Plugins/gtk/PluginInfoCache.cpp:
135         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
136         * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
137         * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
138         * UIProcess/ServiceWorkerProcessProxy.cpp:
139         * UIProcess/WebStorage/LocalStorageDatabase.cpp:
140         * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
141         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
142         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
143         * UIProcess/glib/WebProcessProxyGLib.cpp:
144         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
145         * UIProcess/gtk/WebProcessPoolGtk.cpp:
146         * UIProcess/ios/WKContentViewInteraction.mm:
147         * UIProcess/ios/forms/WKFileUploadPanel.mm:
148         * UIProcess/mac/WebPageProxyMac.mm:
149         * UIProcess/win/WebProcessPoolWin.cpp:
150         * UIProcess/win/WebView.cpp:
151         * UIProcess/wpe/WebProcessPoolWPE.cpp:
152         * WebProcess/InjectedBundle/API/glib/WebKitExtensionManager.cpp:
153         * WebProcess/InjectedBundle/glib/InjectedBundleGlib.cpp:
154         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
155         * WebProcess/Plugins/Netscape/NetscapePluginStream.h:
156         * WebProcess/Plugins/PluginProcessConnection.cpp:
157         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
158         * WebProcess/WebPage/gtk/WebInspectorUIGtk.cpp:
159         * WebProcess/WebPage/win/WebInspectorUIWin.cpp:
160         * WebProcess/cocoa/WebProcessCocoa.mm:
161
162 2019-01-23  Simon Fraser  <simon.fraser@apple.com>
163
164         Create "frame hosting" nodes for the scrolling tree
165         https://bugs.webkit.org/show_bug.cgi?id=193753
166
167         Reviewed by Antti Koivisto.
168
169         When the scrolling tree crosses frame boundaries, mutations in the parent frame currently
170         require the iframe's scrolling node to get reparented in a new ancestor, which requires
171         a layer tree walk of the parent frame. This is error-prone, and not very future-proof.
172
173         Fix this by introducing "frame hosting" scrolling tree nodes. These are mostly inert
174         nodes that are owned by the RenderIFrame's layer backing in the parent frame, and exist
175         to provide a consistent parent node for the subframe's scrolling node.
176
177         This patch adds the node types, but does not instantiate them yet.
178
179         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
180         (ArgumentCoder<ScrollingStateFrameHostingNode>::encode):
181         (ArgumentCoder<ScrollingStateFrameHostingNode>::decode):
182         (WebKit::encodeNodeAndDescendants):
183         (WebKit::RemoteScrollingCoordinatorTransaction::decode):
184         (WebKit::dump):
185         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
186         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
187         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
188         (WebKit::RemoteScrollingTree::createScrollingTreeNode):
189         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
190         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
191
192 2019-01-23  Ross Kirsling  <ross.kirsling@sony.com>
193
194         [Curl] Unreviewed build fix for r240292 and friends.
195
196         WinCairo test stability must be restored in subsequent patch.
197
198         * NetworkProcess/curl/NetworkProcessCurl.cpp:
199         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
200         (WebKit::NetworkProcess::setNetworkProxySettings):
201
202 2019-01-23  Commit Queue  <commit-queue@webkit.org>
203
204         Unreviewed, rolling out r240403.
205         https://bugs.webkit.org/show_bug.cgi?id=193757
206
207         "Causes multiple crashes on macOS port (probably used wrong
208         ENABLE macro)" (Requested by ddkilzer on #webkit).
209
210         Reverted changeset:
211
212         "[Curl] Unreviewed build fix for r240292 and friends."
213         https://trac.webkit.org/changeset/240403
214
215 2019-01-23  Ross Kirsling  <ross.kirsling@sony.com>
216
217         [Curl] Unreviewed build fix for r240292 and friends.
218
219         WinCairo test stability must be restored in subsequent patch.
220
221         * NetworkProcess/curl/NetworkProcessCurl.cpp:
222         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
223         (WebKit::NetworkProcess::setNetworkProxySettings):
224
225 2019-01-23  Alex Christensen  <achristensen@webkit.org>
226
227         Stop using NetworkProcess::singleton
228         https://bugs.webkit.org/show_bug.cgi?id=193700
229
230         Reviewed by Don Olmstead.
231
232         This replaces it with a NeverDestroyed<NetworkProcess> and paves the way for more interesting things.
233
234         * NetworkProcess/CustomProtocols/soup/LegacyCustomProtocolManagerSoup.cpp:
235         * NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm:
236         (WebKit::initializeChildProcess<WebKit::NetworkProcess>):
237         * NetworkProcess/NetworkProcess.cpp:
238         (WebKit::NetworkProcess::NetworkProcess):
239         (WebKit::NetworkProcess::singleton): Deleted.
240         * NetworkProcess/NetworkProcess.h:
241         * NetworkProcess/soup/NetworkProcessMainSoup.cpp:
242         (WebKit::initializeChildProcess<WebKit::NetworkProcess>):
243         * NetworkProcess/win/NetworkProcessMainWin.cpp:
244         (WebKit::initializeChildProcess<WebKit::NetworkProcess>):
245         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
246         (WebKit::initializeChildProcess):
247         (WebKit::XPCServiceInitializer):
248
249 2019-01-23  Ryan Haddad  <ryanhaddad@apple.com>
250
251         Unreviewed, rolling out r240343.
252
253         Caused 4 PSON API test failures.
254
255         Reverted changeset:
256
257         "[PSON] Flash on back navigation on Mac"
258         https://bugs.webkit.org/show_bug.cgi?id=193716
259         https://trac.webkit.org/changeset/240343
260
261 2019-01-23  Chris Dumez  <cdumez@apple.com>
262
263         Deprecate API to limit the maximum number of WebProcesses
264         https://bugs.webkit.org/show_bug.cgi?id=193725
265         <rdar://problem/47464879>
266
267         Reviewed by Geoff Garen.
268
269         Deprecate API to limit the maximum number of WebProcesses and make it a no-op. It adds
270         complexity and is not safe (conflicts with PSON).
271
272         Add a new usesSingleWebProcess SPI to _WKProcessPoolConfiguration to be used by
273         Minibrowser / Safari in order to disable process per tab (can be useful for debugging).
274         Note that enabling the single WebProcess mode will disable PSON and process prewarming.
275
276         * UIProcess/API/APIProcessPoolConfiguration.cpp:
277         (API::ProcessPoolConfiguration::createWithLegacyOptions):
278         (API::ProcessPoolConfiguration::copy):
279         * UIProcess/API/APIProcessPoolConfiguration.h:
280         * UIProcess/API/C/WKContext.cpp:
281         (WKContextSetMaximumNumberOfProcesses):
282         (WKContextGetMaximumNumberOfProcesses):
283         * UIProcess/API/C/WKContext.h:
284         * UIProcess/API/Cocoa/WKProcessPool.mm:
285         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
286         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
287         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
288         (-[_WKProcessPoolConfiguration maximumProcessCount]):
289         (-[_WKProcessPoolConfiguration setMaximumProcessCount:]):
290         (-[_WKProcessPoolConfiguration usesSingleWebProcess]):
291         (-[_WKProcessPoolConfiguration setUsesSingleWebProcess:]):
292         (-[_WKProcessPoolConfiguration description]):
293         * UIProcess/API/glib/WebKitWebContext.cpp:
294         (webkitWebContextConstructed):
295         (webkit_web_context_set_process_model):
296         (webkit_web_context_set_web_process_count_limit):
297         * UIProcess/WebProcessPool.cpp:
298         (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):
299         (WebKit::WebProcessPool::didReachGoodTimeToPrewarm):
300         (WebKit::WebProcessPool::processForNavigationInternal):
301         * UIProcess/WebProcessPool.h:
302
303 2019-01-23  Brent Fulgham  <bfulgham@apple.com>
304
305         Switch NetworkStorageSession portions of ResourceLoadStatistics to Async message passing style
306         https://bugs.webkit.org/show_bug.cgi?id=193659
307         <rdar://problem/47433290>
308
309         Reviewed by Alex Christensen.
310
311         Change the implementations of ResourceLoadStatistics code in NetworkStorageSession to use the
312         'sendWithAsyncReply' so that more of the code is autogenerated. This should make test runs more
313         consistent, and should reduce the possibility of bookkeeping errors in the message handling
314         implementations.
315
316         Fix the implementation of NetworkProcessProxy::clearCallbackStates to remove the manually constructed
317         (and incomplete) message callbacks. These errors are a big reason to move to the auto-generated
318         'sendWithAsyncReply' implementatoin. Ditto for NetworkProcessProxy::didClose.
319
320         This patch also moves an initializaton call (WebsiteDataStore::didCreateNetworkProcess) from
321         'ensureNetworkProcess' to 'processDidFinishLaunching'. In current code, the call happens before
322         a connection is established to the network process, causing initialization messages to get dropped
323         leading to test system flakiness.
324
325         Finally: The WK API test code was updated to ensure that completion handlers are always called, even
326         when built without ENABLE_RESOURCE_LOAD_STATISTICS defined.
327
328         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
329         * NetworkProcess/Classifier/ShouldGrandfatherStatistics.h: Added.
330         * NetworkProcess/Classifier/StorageAccessStatus.h: Added.
331         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
332         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
333         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
334         * NetworkProcess/NetworkProcess.cpp:
335         (WebKit::NetworkProcess::updatePrevalentDomainsToBlockCookiesFor):
336         (WebKit::NetworkProcess::setAgeCapForClientSideCookies):
337         (WebKit::NetworkProcess::scheduleClearInMemoryAndPersistent):
338         (WebKit::NetworkProcess::hasStorageAccessForFrame):
339         (WebKit::NetworkProcess::requestStorageAccess):
340         (WebKit::NetworkProcess::grantStorageAccess):
341         (WebKit::NetworkProcess::removeAllStorageAccess):
342         (WebKit::NetworkProcess::setCacheMaxAgeCapForPrevalentResources):
343         (WebKit::NetworkProcess::resetCacheMaxAgeCapForPrevalentResources):
344         (WebKit::NetworkProcess::deleteWebsiteData):
345         * NetworkProcess/NetworkProcess.h:
346         * NetworkProcess/NetworkProcess.messages.in:
347         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
348         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
349         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
350         (WKWebsiteDataStoreStatisticsResetToConsistentState):
351         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
352         * UIProcess/Network/NetworkProcessProxy.cpp:
353         (WebKit::NetworkProcessProxy::clearCallbackStates): Remove incomplete clean-up code that
354         is now autogenerated.
355         (WebKit::NetworkProcessProxy::didClose): Ditto.
356         (WebKit::NetworkProcessProxy::updatePrevalentDomainsToBlockCookiesFor):
357         (WebKit::NetworkProcessProxy::scheduleClearInMemoryAndPersistent):
358         (WebKit::NetworkProcessProxy::setAgeCapForClientSideCookies):
359         (WebKit::NetworkProcessProxy::hasStorageAccessForFrame):
360         (WebKit::NetworkProcessProxy::requestStorageAccess):
361         (WebKit::NetworkProcessProxy::grantStorageAccess):
362         (WebKit::NetworkProcessProxy::removeAllStorageAccess):
363         (WebKit::NetworkProcessProxy::setCacheMaxAgeCapForPrevalentResources):
364         (WebKit::NetworkProcessProxy::setCacheMaxAgeCap):
365         (WebKit::NetworkProcessProxy::resetCacheMaxAgeCapForPrevalentResources):
366         (WebKit::NetworkProcessProxy::didUpdateBlockCookies): Deleted.
367         (WebKit::NetworkProcessProxy::didSetAgeCapForClientSideCookies): Deleted.
368         (WebKit::NetworkProcessProxy::didUpdateRuntimeSettings): Deleted.
369         (WebKit::NetworkProcessProxy::storageAccessRequestResult): Deleted.
370         (WebKit::NetworkProcessProxy::storageAccessOperationResult): Deleted.
371         (WebKit::NetworkProcessProxy::didRemoveAllStorageAccess): Deleted.
372         (WebKit::NetworkProcessProxy::didSetCacheMaxAgeCapForPrevalentResources): Deleted.
373         * UIProcess/Network/NetworkProcessProxy.h:
374         * UIProcess/Network/NetworkProcessProxy.messages.in:
375         * UIProcess/WebPageProxy.cpp:
376         * UIProcess/WebProcessPool.cpp:
377         (WebKit::WebProcessPool::ensureNetworkProcess): Move WebsiteDataStore 'didCreateNetworkProcess'
378         to 'processDidFinishLaunching'. Currently the call happens before a connection is established,
379         causing initialization messages to get dropped.
380         (WebKit::WebProcessPool::processDidFinishLaunching): Ditto.
381         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
382         (WebKit::WebsiteDataStore::removeData):
383         (WebKit::WebsiteDataStore::setMaxStatisticsEntries):
384         (WebKit::WebsiteDataStore::setPruneEntriesDownTo):
385         (WebKit::WebsiteDataStore::setGrandfatheringTime):
386         (WebKit::WebsiteDataStore::setCacheMaxAgeCap):
387         (WebKit::WebsiteDataStore::setMinimumTimeBetweenDataRecordsRemoval):
388         (WebKit::WebsiteDataStore::setPrevalentResource):
389         (WebKit::WebsiteDataStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
390         (WebKit::WebsiteDataStore::scheduleClearInMemoryAndPersistent):
391         (WebKit::WebsiteDataStore::setAgeCapForClientSideCookies):
392         (WebKit::WebsiteDataStore::setNotifyPagesWhenDataRecordsWereScanned):
393         (WebKit::WebsiteDataStore::setNotifyPagesWhenTelemetryWasCaptured):
394         (WebKit::WebsiteDataStore::setTimeToLiveUserInteraction):
395         (WebKit::WebsiteDataStore::setCacheMaxAgeCapForPrevalentResources):
396         (WebKit::WebsiteDataStore::setResourceLoadStatisticsDebugMode):
397         * UIProcess/WebsiteData/WebsiteDataStore.h:
398         * WebKit.xcodeproj/project.pbxproj:
399
400 2019-01-23  Sihui Liu  <sihui_liu@apple.com>
401
402         Clean up IndexedDB files between tests
403         https://bugs.webkit.org/show_bug.cgi?id=192796
404         <rdar://problem/46824999>
405
406         Reviewed by Geoffrey Garen.
407
408         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
409         (WKWebsiteDataStoreRemoveAllIndexedDatabases):
410         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
411
412 2019-01-23  Wenson Hsieh  <wenson_hsieh@apple.com>
413
414         [iOS] fast/events/touch/ios/hover-when-style-change-is-async.html times out
415         https://bugs.webkit.org/show_bug.cgi?id=193182
416         <rdar://problem/47452154>
417
418         Reviewed by Tim Horton.
419
420         Fix an existing bug where blurring an element doesn't always un-suppress text interactions.
421
422         * UIProcess/ios/WKContentViewInteraction.mm:
423         (-[WKContentView _elementDidBlur]):
424
425 2019-01-23  Michael Catanzaro  <mcatanzaro@igalia.com>
426
427         Minor improvements to NetworkProcess
428         https://bugs.webkit.org/show_bug.cgi?id=193708
429
430         Reviewed by Alex Christensen.
431
432         * NetworkProcess/NetworkProcess.cpp:
433         (WebKit::NetworkProcess::switchToNewTestingSession): Fix a spelling error.
434         (WebKit::NetworkProcess::ensureSession): Add useful assertion.
435         (WebKit::NetworkProcess::defaultStorageSession const): Split into platform functions.
436         (WebKit::NetworkProcess::destroySession): Add useful assertion.
437         * NetworkProcess/NetworkProcess.h:
438         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
439         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
440         * NetworkProcess/curl/NetworkProcessCurl.cpp:
441         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
442         * NetworkProcess/soup/NetworkProcessSoup.cpp:
443         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
444
445 2019-01-23  Daniel Bates  <dabates@apple.com>
446
447         Fix the Apple Internal build. See <rdar://problem/47486758>.
448
449         * UIProcess/ios/WKContentViewInteraction.mm:
450         (-[WKContentView dropInteraction:previewForDroppingItem:withDefault:]):
451
452 2019-01-23  Per Arne Vollan  <pvollan@apple.com>
453
454         [macOS] Sandbox fails to compile
455         https://bugs.webkit.org/show_bug.cgi?id=193727
456         <rdar://problem/47476903>
457
458         Reviewed by Brent Fulgham.
459
460         Use '(with send-signal SIGKILL)' instead of '(with termination)'.
461
462         * WebProcess/com.apple.WebProcess.sb.in:
463
464 2019-01-23  Brent Fulgham  <bfulgham@apple.com>
465
466         REGRESSION (r240243): CrashTracer: WebKitTestRunnerApp at com.apple.WebKit: WebKit::WebResourceLoadStatisticsStore::sendDiagnosticMessageWithValue const + 32
467         https://bugs.webkit.org/show_bug.cgi?id=193723
468         <rdar://problem/47476802>
469
470         Reviewed by David Kilzer.
471
472         The new code added in r240243 could attempt to submit telemetry after the relevant
473         WebResourceLoadStatisticsStore was destroyed. We should guard against this possibility.
474
475         * NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.cpp:
476         (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):
477
478 2019-01-23  Antti Koivisto  <antti@apple.com>
479
480         [PSON] Flash on back navigation on Mac
481         https://bugs.webkit.org/show_bug.cgi?id=193716
482         <rdar://problem/47148458>
483
484         Reviewed by Chris Dumez.
485
486         We close the page immediately if we fail to suspend. Layers disappear and we get a flash.
487
488         * UIProcess/SuspendedPageProxy.cpp:
489         (WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
490
491         Remove the suspended page (so closing it on web process side) if the suspension fails.
492         Skip this if we are using web process side compositing on Mac.
493
494         * UIProcess/WebPageProxy.cpp:
495         (WebKit::WebPageProxy::enterAcceleratedCompositingMode):
496
497         On Mac, remove failed SuspendedPageProxy when entering compositing mode. At this point we don't need it to keep layers alive.
498
499         * UIProcess/WebProcessPool.cpp:
500         (WebKit::WebProcessPool::removeFailedSuspendedPagesForPage):
501         * UIProcess/WebProcessPool.h:
502         * WebProcess/WebPage/WebPage.cpp:
503         (WebKit::WebPage::suspendForProcessSwap):
504
505         Don't close the page on suspension failure.
506
507 2019-01-23  Wenson Hsieh  <wenson_hsieh@apple.com>
508
509         Introduce UndoStep::label() and adopt it in WebKitLegacy and WebKit
510         https://bugs.webkit.org/show_bug.cgi?id=193706
511         <rdar://problem/44807048>
512
513         Reviewed by Ryosuke Niwa.
514
515         * UIProcess/Cocoa/WebViewImpl.mm:
516         (WebKit::WebViewImpl::registerEditCommand):
517         * UIProcess/WebEditCommandProxy.cpp:
518         (WebKit::WebEditCommandProxy::WebEditCommandProxy):
519         * UIProcess/WebEditCommandProxy.h:
520
521         Drive-by tweak: make WebEditCommandProxy's backpointer to its WebPageProxy a WeakPtr instead of a raw pointer.
522         Additionally, call clear() instead of setting m_page to 0 upon invalidation. Also, turn the WebPageProxy*
523         argument into a WebPageProxy&, since the WebPageProxy must exist when it creates a new WebEditCommandProxy.
524
525         (WebKit::WebEditCommandProxy::create):
526         (WebKit::WebEditCommandProxy::label const):
527         (WebKit::WebEditCommandProxy::invalidate):
528         (WebKit::WebEditCommandProxy::editAction const): Deleted.
529
530         Adjust UI-side logic to just handle the undo/redo label, rather than map the edit action to a localized string.
531
532         * UIProcess/WebPageProxy.cpp:
533         (WebKit::WebPageProxy::registerEditCommandForUndo):
534         (WebKit::WebPageProxy::resetState):
535
536         Tweak this to use std::exchange instead of copying all the WebEditCommandProxy RefPtrs into a separate Vector
537         and then iterating over the Vector.
538
539         * UIProcess/WebPageProxy.h:
540         * UIProcess/WebPageProxy.messages.in:
541
542         Adjust this so that we only send the undo/redo label over IPC, rather than the edit action type.
543
544         * UIProcess/ios/PageClientImplIOS.mm:
545         (WebKit::PageClientImpl::registerEditCommand):
546         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
547         (WebKit::WebEditorClient::registerUndoStep):
548
549 2019-01-23  Michael Catanzaro  <mcatanzaro@igalia.com>
550
551         [SOUP] Remove libsoup cruft from WebProcess
552         https://bugs.webkit.org/show_bug.cgi?id=193710
553
554         Reviewed by Carlos Garcia Campos.
555
556         SoupNetworkSession is no longer accessible from the web process because it's owned
557         (indirectly) by NetworkProcess after r240292. It doesn't make sense to have any libsoup
558         code under WebProcess anymore. The current libsoup code consists of (a) unused stuff to be
559         removed, (b) stuff unrelated to libsoup, which should move to a WebProcessGLib.cpp, and (c)
560         WebKitSoupRequestInputStream, which is only used by NetworkProcess and should move there
561
562         * NetworkProcess/soup/WebKitSoupRequestInputStream.cpp: Renamed from Source/WebKit/WebProcess/soup/WebKitSoupRequestInputStream.cpp.
563         (AsyncReadData::AsyncReadData):
564         (webkitSoupRequestInputStreamReadAsyncResultComplete):
565         (webkitSoupRequestInputStreamPendingReadAsyncComplete):
566         (webkitSoupRequestInputStreamHasDataToRead):
567         (webkitSoupRequestInputStreamIsWaitingForData):
568         (webkitSoupRequestInputStreamReadAsync):
569         (webkitSoupRequestInputStreamReadFinish):
570         (webkitSoupRequestInputStreamFinalize):
571         (webkit_soup_request_input_stream_init):
572         (webkit_soup_request_input_stream_class_init):
573         (webkitSoupRequestInputStreamNew):
574         (webkitSoupRequestInputStreamAddData):
575         (webkitSoupRequestInputStreamDidFailWithError):
576         (webkitSoupRequestInputStreamFinished):
577         * NetworkProcess/soup/WebKitSoupRequestInputStream.h: Renamed from Source/WebKit/WebProcess/soup/WebKitSoupRequestInputStream.h.
578         * SourcesGTK.txt:
579         * SourcesWPE.txt:
580         * UIProcess/soup/WebProcessPoolSoup.cpp:
581         (WebKit::WebProcessPool::setNetworkProxySettings): Don't send message to web processes.
582         * WebProcess/WebProcess.h:
583         * WebProcess/WebProcess.messages.in:
584         * WebProcess/glib/WebProcessGLib.cpp: Renamed from Source/WebKit/WebProcess/soup/WebProcessSoup.cpp.
585         (WebKit::WebProcess::platformSetCacheModel):
586         (WebKit::WebProcess::platformInitializeWebProcess):
587         (WebKit::WebProcess::platformTerminate):
588
589 2019-01-23  Michael Catanzaro  <mcatanzaro@igalia.com>
590
591         [SOUP] Clean up NetworkStorageSession
592         https://bugs.webkit.org/show_bug.cgi?id=193707
593
594         Reviewed by Carlos Garcia Campos.
595
596         Restore an important call to clearSoupNetworkSession that was removed in r240292. Also,
597         adapt to NetworkStorageSessions API changes.
598
599         * NetworkProcess/CustomProtocols/soup/LegacyCustomProtocolManagerSoup.cpp:
600         (WebKit::LegacyCustomProtocolManager::registerScheme):
601         * NetworkProcess/soup/NetworkProcessMainSoup.cpp:
602         * NetworkProcess/soup/NetworkProcessSoup.cpp:
603         (WebKit::NetworkProcess::userPreferredLanguagesChanged):
604         (WebKit::NetworkProcess::setNetworkProxySettings):
605         * NetworkProcess/soup/NetworkSessionSoup.cpp:
606         (WebKit::NetworkSessionSoup::soupSession const):
607
608 2019-01-23  Philippe Normand  <pnormand@igalia.com>
609
610         [GTK] Crash when browsing inspector:// uri without port set
611         https://bugs.webkit.org/show_bug.cgi?id=193721
612
613         Reviewed by Michael Catanzaro.
614
615         * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
616         (WebKit::RemoteInspectorProtocolHandler::handleRequest): Return
617         back to caller after setting the error, if no port was provided
618         along with the inspector URL.
619
620 2019-01-23  David Kilzer  <ddkilzer@apple.com>
621
622         Switch remaining CoreMedia soft-linking in WebKit over to CoreMediaSoftLink.{cpp,h}
623         <https://webkit.org/b/193694>
624         <rdar://problem/47464025>
625
626         Reviewed by Tim Horton.
627
628         * Shared/ios/WebIconUtilities.mm:
629         - Switch to using CoreMediaSoftLink.{h,mm} in PAL.
630
631 2019-01-22  Chris Dumez  <cdumez@apple.com>
632
633         Regression(r240178) Some API tests are crashing
634         https://bugs.webkit.org/show_bug.cgi?id=193680
635
636         Reviewed by Alex Christensen.
637
638         r240178 made sure that userScripts / scriptMessageHandlers / contentExtensions are always
639         properly populated in the WebPageCreationParameters. This was needed in case we need to
640         reconstruct the WebUserContentController on the WebProcess side. However, this caused a
641         regression in the case we reuse a process where the WebUserContentController still exists
642         (because it was kept alive, e.g. by the WebPageGroup). In that case, we would add duplicate
643         entries to the existing WebUserContentController instance because its "add" methods did not
644         have duplicate checks. To address the issue, this patch adds duplicate checks to the
645         WebUserContentController "add" methods.
646
647         * WebProcess/UserContent/WebUserContentController.cpp:
648         (WebKit::WebUserContentController::addUserScriptMessageHandlerInternal):
649         (WebKit::WebUserContentController::removeUserScriptMessageHandlerInternal):
650         (WebKit::WebUserContentController::addUserScriptInternal):
651         (WebKit::WebUserContentController::removeUserScriptInternal):
652         (WebKit::WebUserContentController::addUserStyleSheetInternal):
653         (WebKit::WebUserContentController::removeUserStyleSheetInternal):
654         (WebKit::WebUserContentController::forEachUserMessageHandler const):
655         * WebProcess/UserContent/WebUserContentController.h:
656
657 2019-01-22  Michael Catanzaro  <mcatanzaro@igalia.com>
658
659         Unreviewed attempt to fix GTK/WPE bots
660         https://bugs.webkit.org/show_bug.cgi?id=193580
661         <rdar://problem/47457742>
662
663         Doesn't make sense to clear the storage session right after creating it. This should fix
664         network process crash on startup under G_DEBUG=fatal-criticals due to the storage session
665         not having a cookie jar.
666
667         * NetworkProcess/NetworkProcess.cpp:
668         (WebKit::NetworkProcess::NetworkProcess):
669
670 2019-01-22  Megan Gardner  <megan_gardner@apple.com>
671
672         Cancel Web Touches Properly so that long presses on YouTube links do not incorrectly trigger a load
673         https://bugs.webkit.org/show_bug.cgi?id=193687
674         <rdar://problem/47056717>
675
676         Reviewed by Tim Horton.
677
678         Cancel web gestures when a long press is recognized.
679
680         * Platform/spi/ios/UIKitSPI.h:
681         * UIProcess/ios/WKContentViewInteraction.mm:
682         (-[WKContentView _cancelWebGestureRecognizer]):
683         (-[WKContentView _longPressRecognized:]):
684
685 2019-01-22  Alex Christensen  <achristensen@webkit.org>
686
687         Fix an internal build failure after r240292
688         https://bugs.webkit.org/show_bug.cgi?id=193580
689
690         Rubber-stamped by Wenson Hsieh.
691
692         * SourcesCocoa.txt:
693         * UIProcess/mac/WebContextMenuProxyMac.mm:
694         (-[WKMenuTarget forwardContextMenuAction:]):
695         * WebKit.xcodeproj/project.pbxproj:
696         It was apparently unclear to the compiler sometimes which "state" selector to use, and this apparently mattered.
697         Tell the compiler to use the NSMenuItem selector, but at runtime it doesn't matter.
698
699 2019-01-22  Michael Catanzaro  <mcatanzaro@igalia.com>
700
701         Unreviewed, fix -Wunused-but-set-variable warning
702         https://bugs.webkit.org/show_bug.cgi?id=193660
703         <rdar://problem/47433602>
704
705         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
706         (WebKit::WebsiteDataStore::removeData):
707
708 2019-01-22  Michael Catanzaro  <mcatanzaro@igalia.com>
709
710         Unreviewed, further build fixes after r240292
711         https://bugs.webkit.org/show_bug.cgi?id=193580
712         <rdar://problem/47457742>
713
714         Oops.
715
716         * NetworkProcess/NetworkProcess.cpp:
717         (WebKit::NetworkProcess::defaultStorageSession const):
718
719 2019-01-22  Michael Catanzaro  <mcatanzaro@igalia.com>
720
721         Unreviewed, further build fixes after r240292
722         https://bugs.webkit.org/show_bug.cgi?id=193580
723         <rdar://problem/47457742>
724
725         This builds for libsoup. Doesn't work, but at least builds.
726
727         Also, speculative fixes for curl.
728
729         * NetworkProcess/NetworkProcess.cpp:
730         (WebKit::NetworkProcess::defaultStorageSession const):
731
732 2019-01-22  Michael Catanzaro  <mcatanzaro@igalia.com>
733
734         Unreviewed, further build fixes after r240292
735         https://bugs.webkit.org/show_bug.cgi?id=193580
736         <rdar://problem/47457742>
737
738         Still not working yet.
739
740         * NetworkProcess/NetworkProcess.cpp:
741         (WebKit::NetworkProcess::NetworkProcess):
742         * UIProcess/API/APIHTTPCookieStore.h:
743
744 2019-01-22  Antti Koivisto  <antti@apple.com>
745
746         [iOS] Flash when swiping back to Google search result page
747         https://bugs.webkit.org/show_bug.cgi?id=193668
748         <rdar://problem/47071684>
749
750         Reviewed by Simon Fraser.
751
752         If the google page is scrolled, there is sometimes a short flash.
753
754         When restoring the page state we also restore exposedContentRect which is used to determine
755         which part of the page to create layers for. Scroll position is restored by the UI process
756         later so we rely on this to get the right layers for the initial view update.
757
758         A viewport configuration update may sometimes trample over the restored exposedContentRect,
759         moving it to top left. In this case the initial layer tree unfreeze commit may not have
760         layers to cover the actual visible view position.
761
762         * WebProcess/WebPage/WebPage.cpp:
763         (WebKit::WebPage::didCommitLoad):
764         * WebProcess/WebPage/WebPage.h:
765         * WebProcess/WebPage/ios/WebPageIOS.mm:
766         (WebKit::WebPage::restorePageState):
767
768         Set a bit to indicate we have already restored the exposedContentRect.
769
770         (WebKit::WebPage::viewportConfigurationChanged):
771
772         Only reset exposedContentRect if wasn't already set by restorePageState.
773
774 2019-01-22  Alex Christensen  <achristensen@webkit.org>
775
776         Fix more builds.
777
778         * SourcesCocoa.txt:
779         * WebKit.xcodeproj/project.pbxproj:
780
781 2019-01-22  Michael Catanzaro  <mcatanzaro@igalia.com>
782
783         Another build fix after r240292
784         https://bugs.webkit.org/show_bug.cgi?id=193580
785         <rdar://problem/47457742>
786
787         Unreviewed, still not enough to fix soup builds, but closer.
788
789         * UIProcess/API/APIHTTPCookieStore.h:
790
791 2019-01-22  Alex Christensen  <achristensen@webkit.org>
792
793         Fix some builds after r240292
794         https://bugs.webkit.org/show_bug.cgi?id=193580
795
796         * NetworkProcess/NetworkProcess.cpp:
797         (WebKit::NetworkProcess::switchToNewTestingSession):
798         * NetworkProcess/cache/NetworkCache.cpp:
799         (WebKit::NetworkCache::Cache::retrieve):
800
801 2019-01-22  Brian Burg  <bburg@apple.com>
802
803         Automation.computeElementLayout should return visual viewport-aware coordinates
804         https://bugs.webkit.org/show_bug.cgi?id=193598
805         <rdar://problem/35325644>
806
807         Unreviewed, restore a mistakenly-deleted line whose absence causes hangs.
808
809         * Shared/CoordinateSystem.h:
810
811 2019-01-22  Alex Christensen  <achristensen@webkit.org>
812
813         Move NetworkStorageSession ownership to NetworkProcess
814         https://bugs.webkit.org/show_bug.cgi?id=193580
815
816         Reviewed by Geoff Garen.
817
818         * NetworkProcess/Cookies/WebCookieManager.cpp:
819         (WebKit::WebCookieManager::WebCookieManager):
820         (WebKit::WebCookieManager::getHostnamesWithCookies):
821         (WebKit::WebCookieManager::deleteCookiesForHostname):
822         (WebKit::WebCookieManager::deleteAllCookies):
823         (WebKit::WebCookieManager::deleteCookie):
824         (WebKit::WebCookieManager::deleteAllCookiesModifiedSince):
825         (WebKit::WebCookieManager::getAllCookies):
826         (WebKit::WebCookieManager::getCookies):
827         (WebKit::WebCookieManager::setCookie):
828         (WebKit::WebCookieManager::setCookies):
829         (WebKit::WebCookieManager::startObservingCookieChanges):
830         (WebKit::WebCookieManager::stopObservingCookieChanges):
831         * NetworkProcess/Cookies/WebCookieManager.h:
832         * NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
833         (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
834         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
835         (WebKit::storageSession):
836         (WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
837         (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
838         (WebKit::NetworkConnectionToWebProcess::cookiesEnabled):
839         (WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue):
840         (WebKit::NetworkConnectionToWebProcess::getRawCookies):
841         (WebKit::NetworkConnectionToWebProcess::deleteCookie):
842         (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForFrame):
843         (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForAllFramesOnPage):
844         * NetworkProcess/NetworkProcess.cpp:
845         (WebKit::NetworkProcess::initializeNetworkProcess):
846         (WebKit::NetworkProcess::clearCachedCredentials):
847         (WebKit::NetworkProcess::switchToNewTestingSession):
848         (WebKit::NetworkProcess::ensureSession):
849         (WebKit::NetworkProcess::storageSession const):
850         (WebKit::NetworkProcess::defaultStorageSession const):
851         (WebKit::NetworkProcess::forEachNetworkStorageSession):
852         (WebKit::NetworkProcess::destroySession):
853         (WebKit::NetworkProcess::updatePrevalentDomainsToBlockCookiesFor):
854         (WebKit::NetworkProcess::setAgeCapForClientSideCookies):
855         (WebKit::NetworkProcess::hasStorageAccessForFrame):
856         (WebKit::NetworkProcess::getAllStorageAccessEntries):
857         (WebKit::NetworkProcess::grantStorageAccess):
858         (WebKit::NetworkProcess::removeAllStorageAccess):
859         (WebKit::NetworkProcess::removePrevalentDomains):
860         (WebKit::NetworkProcess::setCacheMaxAgeCapForPrevalentResources):
861         (WebKit::NetworkProcess::resetCacheMaxAgeCapForPrevalentResources):
862         (WebKit::NetworkProcess::fetchWebsiteData):
863         (WebKit::NetworkProcess::deleteWebsiteData):
864         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
865         * NetworkProcess/NetworkProcess.h:
866         * NetworkProcess/NetworkResourceLoader.cpp:
867         (WebKit::NetworkResourceLoader::validateCacheEntryForMaxAgeCapValidation):
868         (WebKit::NetworkResourceLoader::logCookieInformation const):
869         * NetworkProcess/NetworkSession.cpp:
870         (WebKit::NetworkSession::networkStorageSession const):
871         * NetworkProcess/NetworkStorageSessionProvider.h:
872         * NetworkProcess/cache/NetworkCache.cpp:
873         (WebKit::NetworkCache::makeUseDecision):
874         (WebKit::NetworkCache::Cache::retrieve):
875         (WebKit::NetworkCache::Cache::makeEntry):
876         (WebKit::NetworkCache::Cache::makeRedirectEntry):
877         (WebKit::NetworkCache::Cache::update):
878         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
879         (WebKit::NetworkCache::SpeculativeLoad::willSendRedirectedRequest):
880         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
881         (WebKit::NetworkProcess::platformSyncAllCookies):
882         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
883         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
884         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
885         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
886         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
887         * NetworkProcess/mac/RemoteNetworkingContext.mm:
888         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
889         * SourcesCocoa.txt:
890         * UIProcess/API/APIHTTPCookieStore.cpp:
891         (API::HTTPCookieStore::~HTTPCookieStore):
892         (API::HTTPCookieStore::cookies):
893         (API::HTTPCookieStore::setCookie):
894         (API::HTTPCookieStore::deleteCookie):
895         (API::HTTPCookieStore::registerObserver):
896         (API::HTTPCookieStore::unregisterObserver):
897         (API::HTTPCookieStore::registerForNewProcessPoolNotifications):
898         (API::HTTPCookieStore::flushDefaultUIProcessCookieStore):
899         (API::HTTPCookieStore::getAllDefaultUIProcessCookieStoreCookies):
900         (API::HTTPCookieStore::setCookieInDefaultUIProcessCookieStore):
901         (API::HTTPCookieStore::deleteCookieFromDefaultUIProcessCookieStore):
902         (API::HTTPCookieStore::startObservingChangesToDefaultUIProcessCookieStore):
903         (API::HTTPCookieStore::stopObservingChangesToDefaultUIProcessCookieStore):
904         * UIProcess/API/APIHTTPCookieStore.h:
905         * UIProcess/API/Cocoa/APIHTTPCookieStoreCocoa.mm: Added.
906         (API::HTTPCookieStore::flushDefaultUIProcessCookieStore):
907         (API::HTTPCookieStore::getAllDefaultUIProcessCookieStoreCookies):
908         (API::HTTPCookieStore::setCookieInDefaultUIProcessCookieStore):
909         (API::HTTPCookieStore::deleteCookieFromDefaultUIProcessCookieStore):
910         (API::HTTPCookieStore::startObservingChangesToDefaultUIProcessCookieStore):
911         (API::HTTPCookieStore::stopObservingChangesToDefaultUIProcessCookieStore):
912         * UIProcess/WebProcessPool.cpp:
913         (WebKit::WebProcessPool::clearCachedCredentials):
914         * WebKit.xcodeproj/project.pbxproj:
915         * WebProcess/Plugins/PluginView.cpp:
916         (WebKit::PluginView::getAuthenticationInfo):
917         * WebProcess/WebProcess.cpp:
918         (WebKit::WebProcess::deleteWebsiteData):
919         (WebKit::WebProcess::clearCachedCredentials): Deleted.
920         * WebProcess/WebProcess.h:
921         * WebProcess/WebProcess.messages.in:
922
923 2019-01-22  Per Arne Vollan  <pvollan@apple.com>
924
925         [macOS] Adjust logging policy in WebKit's sandbox
926         https://bugs.webkit.org/show_bug.cgi?id=193454
927
928         Reviewed by Brent Fulgham.
929
930         Add a rule to initially deny all calls, since the default is to allow every call.
931         Later rules allow syscalls that we determined are needed for proper WebKit function.
932         This reduces the API surface available to attackers.
933
934         * WebProcess/com.apple.WebProcess.sb.in:
935
936 2019-01-22  Daniel Bates  <dabates@apple.com>
937
938         [iOS] WebKit should handle shift state changes when using the software keyboard
939         https://bugs.webkit.org/show_bug.cgi?id=191475
940         <rdar://problem/45949246>
941
942         Reviewed by Brent Fulgham.
943
944         Implement UIKit SPI to be notified of shift state changes to the software keyboard
945         and dispatch a synthetic keydown or keyup event for either the Shift key or Caps Lock
946         key.
947
948         A side benefit of this change is that we now show and hide the caps lock indicator
949         in a focused password field when caps lock is enabled or disabled using the software
950         keyboard, respectively.
951
952         * Platform/spi/ios/UIKitSPI.h: Expose more SPI.
953         * SourcesCocoa.txt:
954         * UIProcess/ios/WKContentViewInteraction.mm:
955         (-[WKContentView modifierFlagsDidChangeFrom:to:]): Create a synthetic flags changed
956         web event based on the state change and dispatch it.
957         (-[WKContentView _didHandleKeyEvent:eventWasHandled:]): Early return if the event
958         was a synethic flags change event so that we do not notify UIKit about this event
959         as it does not know anything about such synthetic events.
960         * UIProcess/ios/WKSyntheticFlagsChangedWebEvent.h: Added.
961         * UIProcess/ios/WKSyntheticFlagsChangedWebEvent.mm: Added.
962         (-[WKSyntheticFlagsChangedWebEvent initWithKeyCode:modifiers:keyDown:]):
963         (-[WKSyntheticFlagsChangedWebEvent initWithCapsLockState:]):
964         (-[WKSyntheticFlagsChangedWebEvent initWithShiftState:]):
965         * WebKit.xcodeproj/project.pbxproj:
966
967 2019-01-22  Daniel Bates  <dabates@apple.com>
968
969         [iOS] Interpret text key commands on keydown and app key commands on keypress
970         https://bugs.webkit.org/show_bug.cgi?id=192897
971         <rdar://problem/46857378>
972
973         Reviewed by Brent Fulgham.
974
975         Adopt SPI to interpret text key commands and app key commands independently on keydown (isCharEvent
976         is false) and keypress (isCharEvent is true), respectively.
977
978         * Platform/spi/ios/UIKitSPI.h: Add more SPI.
979         * UIProcess/ios/WKContentViewInteraction.mm:
980         (-[WKContentView _interpretKeyEvent:isCharEvent:]):
981
982 2019-01-22  David Kilzer  <ddkilzer@apple.com>
983
984         C strings in ClientCertificateAuthenticationXPCConstants.h are duplicated
985         <https://webkit.org/b/193607>
986         <rdar://problem/47334613>
987
988         Reviewed by Alex Christensen.
989
990         * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
991         (WebKit::AuthenticationManager::initializeConnection):
992         * UIProcess/Authentication/cocoa/AuthenticationChallengeProxyCocoa.mm:
993         (WebKit::AuthenticationChallengeProxy::sendClientCertificateCredentialOverXpc):
994         - Update name of constants.
995
996         * Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.cpp: Copied from Source/WebKit/Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.h.
997         * Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.h:
998         - Put constant values in a namespace, and move values to
999           ClientCertificateAuthenticationXPCConstants.cpp.
1000
1001         * SourcesCocoa.txt:
1002         * UnifiedSources-input.xcfilelist:
1003         * WebKit.xcodeproj/project.pbxproj:
1004         - Add ClientCertificateAuthenticationXPCConstants.cpp.
1005
1006 2019-01-22  David Kilzer  <ddkilzer@apple.com>
1007
1008         Switch remaining QuickLook soft-linking in WebCore, WebKit over to QuickLookSoftLink.{cpp,h}
1009         <https://webkit.org/b/193654>
1010         <rdar://problem/47430290>
1011
1012         Reviewed by Alex Christensen.
1013
1014         - Moves QuickLookSoftLink.{h,mm} to PAL.
1015         - Adds soft-link to 3 classes to consolidate QuickLook.framework
1016           soft-linking.
1017         - Updates existing source to work with above changes.
1018
1019         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
1020         (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
1021         (WebKit::SystemPreviewController::start):
1022         * UIProcess/ios/WKSystemPreviewView.mm:
1023         (-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]):
1024         - Switch to using QuickLookSoftLink.{h,mm} in PAL.
1025
1026 2019-01-22  Oriol Brufau  <obrufau@igalia.com>
1027
1028         [css-logical] Implement flow-relative margin, padding and border shorthands
1029         https://bugs.webkit.org/show_bug.cgi?id=188697
1030
1031         Reviewed by Simon Fraser and Antti Koivisto.
1032
1033         Add a CSSLogicalEnabled runtime flag.
1034
1035         * Shared/WebPreferences.yaml:
1036
1037 2019-01-22  Frederic Wang  <fwang@igalia.com>
1038
1039         Enable CSSOMViewScrollingAPI
1040         https://bugs.webkit.org/show_bug.cgi?id=189472
1041
1042         Reviewed by Simon Fraser.
1043
1044         This patch enables the CSSOMViewScrollingAPI option by default. This feature has already been
1045         enabled in tests since r235855. Basically, this change fixes an old compatibility issue
1046         regarding which scrolling element correspond to the viewport in standard mode (WebKit uses
1047         document.body while Gecko/Edge/Chromium use document.documentElement as described in the
1048         CSSOM View specification). WebKit developers writing tests can use document.scrollingElement
1049         for that purpose, so that they work independently of whether the option is enabled.
1050
1051         [1] https://lists.webkit.org/pipermail/webkit-dev/2018-January/029857.html
1052
1053         * Shared/WebPreferences.yaml: Enable by default and remove "experimental" category in
1054         accordance with the new policy. Instead, keep an internal flag only for developers.
1055
1056 2019-01-21  Antti Koivisto  <antti@apple.com>
1057
1058         [iOS] Handle hit testing for subframes
1059         https://bugs.webkit.org/show_bug.cgi?id=192303
1060
1061         Reviewed by Frédéric Wang.
1062
1063         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1064         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
1065
1066         Only set delegatesScrolling for the main frame.
1067
1068 2019-01-21  Brent Fulgham  <bfulgham@apple.com>
1069
1070         Unreviewed test fix after r240243
1071         Nhttps://bugs.webkit.org/show_bug.cgi?id=193660
1072         <rdar://problem/47433602>
1073
1074         The new ResourceLoadStatistics section of 'removeData' was incrementing the
1075         pending callback count before deciding whether to send a message to delete
1076         data. This left the count out-of-balance leading to the operation never
1077         completing.
1078
1079         This patch also prevents sending a second message to the NetworkProcess
1080         requesting data be deleted if the message was already sent in an earlier
1081         section of the method (e.g., as typically happens when all website data
1082         is being deleted).
1083
1084         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1085         (WebKit::WebsiteDataStore::removeData):
1086
1087 2019-01-21  Brent Fulgham  <bfulgham@apple.com>
1088
1089         Implement message handlers for NetworkProcess-based ResourceLoadStatistics
1090         https://bugs.webkit.org/show_bug.cgi?id=193556
1091         <rdar://problem/47368501>
1092
1093         Reviewed by Alex Christensen.
1094
1095         This patch adds a number of sibling methods for tracking ResourceLoadStatistics when the
1096         observations are being handled in the NetworkProcess, rather than the UIProcess. The
1097         original versions of these methods will be removed as part of Bug 193303.
1098
1099         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
1100         (WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords):
1101         (WebKit::ResourceLoadStatisticsMemoryStore::processStatisticsAndDataRecords):
1102         (WebKit::ResourceLoadStatisticsMemoryStore::grandfatherExistingWebsiteData):
1103         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
1104         (WebKit::ResourceLoadStatisticsMemoryStore::store const):
1105         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
1106         (WebKit::WebResourceLoadStatisticsStore::setNotifyPagesWhenDataRecordsWereScanned):
1107         (WebKit::WebResourceLoadStatisticsStore::setNotifyPagesWhenTelemetryWasCaptured):
1108         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
1109         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResourceForDebugMode):
1110         (WebKit::WebResourceLoadStatisticsStore::scheduleStatisticsAndDataRecordsProcessing):
1111         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
1112         (WebKit::WebResourceLoadStatisticsStore::callHasStorageAccessForFrameHandler):
1113         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
1114         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
1115         (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
1116         (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
1117         (WebKit::WebResourceLoadStatisticsStore::setLastSeen):
1118         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
1119         (WebKit::WebResourceLoadStatisticsStore::setVeryPrevalentResource):
1120         (WebKit::WebResourceLoadStatisticsStore::isPrevalentResource):
1121         (WebKit::WebResourceLoadStatisticsStore::isVeryPrevalentResource):
1122         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubresourceUnder):
1123         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder):
1124         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo):
1125         (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
1126         (WebKit::WebResourceLoadStatisticsStore::setGrandfathered):
1127         (WebKit::WebResourceLoadStatisticsStore::isGrandfathered):
1128         (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
1129         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
1130         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
1131         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom):
1132         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo):
1133         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom):
1134         (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
1135         (WebKit::WebResourceLoadStatisticsStore::logTestingEvent):
1136         (WebKit::WebResourceLoadStatisticsStore::notifyResourceLoadStatisticsProcessed):
1137         (WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
1138         (WebKit::WebResourceLoadStatisticsStore::topPrivatelyControlledDomainsWithWebsiteData):
1139         (WebKit::WebResourceLoadStatisticsStore::sendDiagnosticMessageWithValue const):
1140         (WebKit::WebResourceLoadStatisticsStore::notifyPageStatisticsTelemetryFinished const):
1141         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
1142         * NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.cpp:
1143         (WebKit::submitTopList):
1144         (WebKit::submitTopLists):
1145         (WebKit::notifyPages):
1146         (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):
1147         (WebKit::nonEphemeralWebPageProxy): Deleted.
1148         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1149         (WebKit::NetworkConnectionToWebProcess::logUserInteraction):
1150         * NetworkProcess/NetworkConnectionToWebProcess.h:
1151         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1152         * NetworkProcess/NetworkProcess.cpp:
1153         (WebKit::NetworkProcess::dumpResourceLoadStatistics):
1154         (WebKit::NetworkProcess::isGrandfathered):
1155         (WebKit::NetworkProcess::isPrevalentResource):
1156         (WebKit::NetworkProcess::isVeryPrevalentResource):
1157         (WebKit::NetworkProcess::setGrandfathered):
1158         (WebKit::NetworkProcess::setPrevalentResource):
1159         (WebKit::NetworkProcess::setPrevalentResourceForDebugMode):
1160         (WebKit::NetworkProcess::setVeryPrevalentResource):
1161         (WebKit::NetworkProcess::clearPrevalentResource):
1162         (WebKit::NetworkProcess::submitTelemetry):
1163         (WebKit::NetworkProcess::scheduleCookieBlockingUpdate):
1164         (WebKit::NetworkProcess::scheduleClearInMemoryAndPersistent):
1165         (WebKit::NetworkProcess::resetParametersToDefaultValues):
1166         (WebKit::NetworkProcess::scheduleStatisticsAndDataRecordsProcessing):
1167         (WebKit::NetworkProcess::setNotifyPagesWhenDataRecordsWereScanned):
1168         (WebKit::NetworkProcess::setNotifyPagesWhenTelemetryWasCaptured):
1169         (WebKit::NetworkProcess::setSubframeUnderTopFrameOrigin):
1170         (WebKit::NetworkProcess::isRegisteredAsRedirectingTo):
1171         (WebKit::NetworkProcess::isRegisteredAsSubFrameUnder):
1172         (WebKit::NetworkProcess::setSubresourceUnderTopFrameOrigin):
1173         (WebKit::NetworkProcess::setSubresourceUniqueRedirectTo):
1174         (WebKit::NetworkProcess::setSubresourceUniqueRedirectFrom):
1175         (WebKit::NetworkProcess::isRegisteredAsSubresourceUnder):
1176         (WebKit::NetworkProcess::setTopFrameUniqueRedirectTo):
1177         (WebKit::NetworkProcess::setTopFrameUniqueRedirectFrom):
1178         (WebKit::NetworkProcess::setLastSeen):
1179         (WebKit::NetworkProcess::hasStorageAccess):
1180         (WebKit::NetworkProcess::requestStorageAccess):
1181         (WebKit::NetworkProcess::grantStorageAccess):
1182         (WebKit::NetworkProcess::logUserInteraction):
1183         (WebKit::NetworkProcess::hadUserInteraction):
1184         (WebKit::NetworkProcess::clearUserInteraction):
1185         (WebKit::NetworkProcess::setGrandfatheringTime):
1186         (WebKit::NetworkProcess::setMaxStatisticsEntries):
1187         (WebKit::NetworkProcess::setMinimumTimeBetweenDataRecordsRemoval):
1188         (WebKit::NetworkProcess::setPruneEntriesDownTo):
1189         (WebKit::NetworkProcess::setTimeToLiveUserInteraction):
1190         (WebKit::NetworkProcess::setShouldClassifyResourcesBeforeDataRecordsRemoval):
1191         (WebKit::NetworkProcess::setResourceLoadStatisticsEnabled):
1192         (WebKit::NetworkProcess::setResourceLoadStatisticsDebugMode):
1193         (WebKit::NetworkProcess::resetCacheMaxAgeCapForPrevalentResources):
1194         (WebKit::NetworkProcess::deleteWebsiteData):
1195         (WebKit::filterForTopLevelDomains):
1196         (WebKit::NetworkProcess::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
1197         (WebKit::NetworkProcess::topPrivatelyControlledDomainsWithWebsiteData):
1198         * NetworkProcess/NetworkProcess.h:
1199         * NetworkProcess/NetworkProcess.messages.in:
1200         * NetworkProcess/NetworkSession.cpp:
1201         (WebKit::NetworkSession::setResourceLoadStatisticsEnabled):
1202         (WebKit::NetworkSession::notifyResourceLoadStatisticsProcessed):
1203         (WebKit::NetworkSession::logDiagnosticMessageWithValue):
1204         (WebKit::NetworkSession::notifyPageStatisticsTelemetryFinished):
1205         (WebKit::NetworkSession::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
1206         (WebKit::NetworkSession::topPrivatelyControlledDomainsWithWebsiteData):
1207         (WebKit::NetworkSession::enableResourceLoadStatistics): Deleted.
1208         * NetworkProcess/NetworkSession.h:
1209         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1210         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
1211         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1212         (WKWebsiteDataStoreSetResourceLoadStatisticsDebugModeWithCompletionHandler):
1213         (WKWebsiteDataStoreSetResourceLoadStatisticsPrevalentResourceForDebugMode):
1214         (WKWebsiteDataStoreSetStatisticsLastSeen):
1215         (WKWebsiteDataStoreSetStatisticsPrevalentResource):
1216         (WKWebsiteDataStoreSetStatisticsVeryPrevalentResource):
1217         (WKWebsiteDataStoreDumpResourceLoadStatistics):
1218         (WKWebsiteDataStoreIsStatisticsPrevalentResource):
1219         (WKWebsiteDataStoreIsStatisticsVeryPrevalentResource):
1220         (WKWebsiteDataStoreIsStatisticsRegisteredAsSubresourceUnder):
1221         (WKWebsiteDataStoreIsStatisticsRegisteredAsSubFrameUnder):
1222         (WKWebsiteDataStoreIsStatisticsRegisteredAsRedirectingTo):
1223         (WKWebsiteDataStoreSetStatisticsHasHadUserInteraction):
1224         (WKWebsiteDataStoreIsStatisticsHasHadUserInteraction):
1225         (WKWebsiteDataStoreSetStatisticsGrandfathered):
1226         (WKWebsiteDataStoreIsStatisticsGrandfathered):
1227         (WKWebsiteDataStoreSetStatisticsSubframeUnderTopFrameOrigin):
1228         (WKWebsiteDataStoreSetStatisticsSubresourceUnderTopFrameOrigin):
1229         (WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectTo):
1230         (WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectFrom):
1231         (WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectTo):
1232         (WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectFrom):
1233         (WKWebsiteDataStoreSetStatisticsTimeToLiveUserInteraction):
1234         (WKWebsiteDataStoreStatisticsProcessStatisticsAndDataRecords):
1235         (WKWebsiteDataStoreStatisticsUpdateCookieBlocking):
1236         (WKWebsiteDataStoreStatisticsSubmitTelemetry):
1237         (WKWebsiteDataStoreSetStatisticsNotifyPagesWhenDataRecordsWereScanned):
1238         (WKWebsiteDataStoreSetStatisticsShouldClassifyResourcesBeforeDataRecordsRemoval):
1239         (WKWebsiteDataStoreSetStatisticsNotifyPagesWhenTelemetryWasCaptured):
1240         (WKWebsiteDataStoreSetStatisticsMinimumTimeBetweenDataRecordsRemoval):
1241         (WKWebsiteDataStoreSetStatisticsGrandfatheringTime):
1242         (WKWebsiteDataStoreSetStatisticsMaxStatisticsEntries):
1243         (WKWebsiteDataStoreSetStatisticsPruneEntriesDownTo):
1244         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
1245         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
1246         (WKWebsiteDataStoreStatisticsResetToConsistentState):
1247         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1248         (-[WKWebsiteDataStore _setResourceLoadStatisticsTestingCallback:]):
1249         * UIProcess/Network/NetworkProcessProxy.cpp:
1250         (WebKit::NetworkProcessProxy::clearCallbackStates):
1251         (WebKit::NetworkProcessProxy::didClose):
1252         (WebKit::nonEphemeralWebPageProxy):
1253         (WebKit::NetworkProcessProxy::logGlobalDiagnosticMessageWithValue):
1254         (WebKit::NetworkProcessProxy::dumpResourceLoadStatistics):
1255         (WebKit::NetworkProcessProxy::didDumpResourceLoadStatistics):
1256         (WebKit::NetworkProcessProxy::updatePrevalentDomainsToBlockCookiesFor):
1257         (WebKit::NetworkProcessProxy::didUpdateBlockCookies):
1258         (WebKit::NetworkProcessProxy::isPrevalentResource):
1259         (WebKit::NetworkProcessProxy::isPrevalentResourceResult):
1260         (WebKit::NetworkProcessProxy::isVeryPrevalentResource):
1261         (WebKit::NetworkProcessProxy::setPrevalentResource):
1262         (WebKit::NetworkProcessProxy::setPrevalentResourceForDebugMode):
1263         (WebKit::NetworkProcessProxy::setVeryPrevalentResource):
1264         (WebKit::NetworkProcessProxy::didSetResourceLoadStatisticData):
1265         (WebKit::NetworkProcessProxy::setLastSeen):
1266         (WebKit::NetworkProcessProxy::clearPrevalentResource):
1267         (WebKit::NetworkProcessProxy::scheduleCookieBlockingUpdate):
1268         (WebKit::NetworkProcessProxy::didScheduleCookieBlockingUpdate):
1269         (WebKit::NetworkProcessProxy::scheduleClearInMemoryAndPersistent):
1270         (WebKit::NetworkProcessProxy::didScheduleStatisticsProcessing):
1271         (WebKit::NetworkProcessProxy::scheduleStatisticsAndDataRecordsProcessing):
1272         (WebKit::NetworkProcessProxy::logUserInteraction):
1273         (WebKit::NetworkProcessProxy::hasHadUserInteraction):
1274         (WebKit::NetworkProcessProxy::didHaveUserInteraction):
1275         (WebKit::NetworkProcessProxy::clearUserInteraction):
1276         (WebKit::NetworkProcessProxy::setAgeCapForClientSideCookies):
1277         (WebKit::NetworkProcessProxy::didSetAgeCapForClientSideCookies):
1278         (WebKit::NetworkProcessProxy::setTimeToLiveUserInteraction):
1279         (WebKit::NetworkProcessProxy::didUpdateRuntimeSettings):
1280         (WebKit::NetworkProcessProxy::setNotifyPagesWhenTelemetryWasCaptured):
1281         (WebKit::NetworkProcessProxy::setNotifyPagesWhenDataRecordsWereScanned):
1282         (WebKit::NetworkProcessProxy::setSubframeUnderTopFrameOrigin):
1283         (WebKit::NetworkProcessProxy::isRegisteredAsRedirectingTo):
1284         (WebKit::NetworkProcessProxy::didIsRegisteredAsRedirectingTo):
1285         (WebKit::NetworkProcessProxy::isRegisteredAsSubFrameUnder):
1286         (WebKit::NetworkProcessProxy::didIsRegisteredAsSubFrameUnder):
1287         (WebKit::NetworkProcessProxy::setSubresourceUnderTopFrameOrigin):
1288         (WebKit::NetworkProcessProxy::isRegisteredAsSubresourceUnder):
1289         (WebKit::NetworkProcessProxy::didIsRegisteredAsSubresourceUnder):
1290         (WebKit::NetworkProcessProxy::setSubresourceUniqueRedirectTo):
1291         (WebKit::NetworkProcessProxy::setSubresourceUniqueRedirectFrom):
1292         (WebKit::NetworkProcessProxy::setTopFrameUniqueRedirectTo):
1293         (WebKit::NetworkProcessProxy::setTopFrameUniqueRedirectFrom):
1294         (WebKit::NetworkProcessProxy::isGrandfathered):
1295         (WebKit::NetworkProcessProxy::didIsGrandfathered):
1296         (WebKit::NetworkProcessProxy::setGrandfathered):
1297         (WebKit::NetworkProcessProxy::hasStorageAccess):
1298         (WebKit::NetworkProcessProxy::requestStorageAccess):
1299         (WebKit::NetworkProcessProxy::grantStorageAccess):
1300         (WebKit::NetworkProcessProxy::storageAccessRequestResult):
1301         (WebKit::NetworkProcessProxy::storageAccessOperationResult):
1302         (WebKit::NetworkProcessProxy::didRemoveAllStorageAccess):
1303         (WebKit::NetworkProcessProxy::didSetCacheMaxAgeCapForPrevalentResources):
1304         (WebKit::NetworkProcessProxy::setCacheMaxAgeCap):
1305         (WebKit::NetworkProcessProxy::setGrandfatheringTime):
1306         (WebKit::NetworkProcessProxy::setMaxStatisticsEntries):
1307         (WebKit::NetworkProcessProxy::setMinimumTimeBetweenDataRecordsRemoval):
1308         (WebKit::NetworkProcessProxy::setPruneEntriesDownTo):
1309         (WebKit::NetworkProcessProxy::setShouldClassifyResourcesBeforeDataRecordsRemoval):
1310         (WebKit::NetworkProcessProxy::setResourceLoadStatisticsDebugMode):
1311         (WebKit::NetworkProcessProxy::resetParametersToDefaultValues):
1312         (WebKit::NetworkProcessProxy::submitTelemetry):
1313         (WebKit::NetworkProcessProxy::notifyResourceLoadStatisticsProcessed):
1314         (WebKit::NetworkProcessProxy::notifyWebsiteDataDeletionForTopPrivatelyOwnedDomainsFinished):
1315         (WebKit::NetworkProcessProxy::notifyWebsiteDataScanForTopPrivatelyControlledDomainsFinished):
1316         (WebKit::NetworkProcessProxy::notifyResourceLoadStatisticsTelemetryFinished):
1317         (WebKit::NetworkProcessProxy::didLogUserInteraction): Deleted.
1318         (WebKit::NetworkProcessProxy::didResetCacheMaxAgeCapForPrevalentResources): Deleted.
1319         * UIProcess/Network/NetworkProcessProxy.h:
1320         * UIProcess/Network/NetworkProcessProxy.messages.in:
1321         * UIProcess/WebPageProxy.cpp:
1322         (WebKit::WebPageProxy::nonEphemeralWebPageProxy):
1323         * UIProcess/WebPageProxy.h:
1324         * UIProcess/WebProcessPool.cpp:
1325         (WebKit::WebProcessPool::ensureNetworkProcess):
1326         * UIProcess/WebProcessProxy.cpp:
1327         (WebKit::WebProcessProxy::notifyWebsiteDataScanForTopPrivatelyControlledDomainsFinished):
1328         (WebKit::WebProcessProxy::notifyWebsiteDataDeletionForTopPrivatelyOwnedDomainsFinished):
1329         * UIProcess/WebProcessProxy.h:
1330         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
1331         (WebKit::WebsiteDataStore::parameters):
1332         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1333         (WebKit::WebsiteDataStore::removeData):
1334         (WebKit::WebsiteDataStore::setMaxStatisticsEntries):
1335         (WebKit::WebsiteDataStore::setPruneEntriesDownTo):
1336         (WebKit::WebsiteDataStore::setGrandfatheringTime):
1337         (WebKit::WebsiteDataStore::setCacheMaxAgeCap):
1338         (WebKit::WebsiteDataStore::setMinimumTimeBetweenDataRecordsRemoval):
1339         (WebKit::WebsiteDataStore::dumpResourceLoadStatistics):
1340         (WebKit::WebsiteDataStore::isPrevalentResource):
1341         (WebKit::WebsiteDataStore::setPrevalentResource):
1342         (WebKit::WebsiteDataStore::setPrevalentResourceForDebugMode):
1343         (WebKit::WebsiteDataStore::isVeryPrevalentResource):
1344         (WebKit::WebsiteDataStore::setVeryPrevalentResource):
1345         (WebKit::WebsiteDataStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
1346         (WebKit::WebsiteDataStore::setSubframeUnderTopFrameOrigin):
1347         (WebKit::WebsiteDataStore::isRegisteredAsSubFrameUnder):
1348         (WebKit::WebsiteDataStore::setSubresourceUnderTopFrameOrigin):
1349         (WebKit::WebsiteDataStore::isRegisteredAsSubresourceUnder):
1350         (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectTo):
1351         (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectFrom):
1352         (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectTo):
1353         (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectFrom):
1354         (WebKit::WebsiteDataStore::isRegisteredAsRedirectingTo):
1355         (WebKit::WebsiteDataStore::clearPrevalentResource):
1356         (WebKit::WebsiteDataStore::resetParametersToDefaultValues):
1357         (WebKit::WebsiteDataStore::submitTelemetry):
1358         (WebKit::WebsiteDataStore::scheduleClearInMemoryAndPersistent):
1359         (WebKit::WebsiteDataStore::scheduleCookieBlockingUpdate):
1360         (WebKit::WebsiteDataStore::scheduleStatisticsAndDataRecordsProcessing):
1361         (WebKit::WebsiteDataStore::updatePrevalentDomainsToBlockCookiesFor):
1362         (WebKit::WebsiteDataStore::setAgeCapForClientSideCookies):
1363         (WebKit::WebsiteDataStore::setLastSeen):
1364         (WebKit::WebsiteDataStore::setNotifyPagesWhenDataRecordsWereScanned):
1365         (WebKit::WebsiteDataStore::setNotifyPagesWhenTelemetryWasCaptured):
1366         (WebKit::WebsiteDataStore::hasStorageAccessForFrameHandler):
1367         (WebKit::WebsiteDataStore::getAllStorageAccessEntries):
1368         (WebKit::WebsiteDataStore::grantStorageAccessHandler):
1369         (WebKit::WebsiteDataStore::removeAllStorageAccessHandler):
1370         (WebKit::WebsiteDataStore::removePrevalentDomains):
1371         (WebKit::WebsiteDataStore::hasStorageAccess):
1372         (WebKit::WebsiteDataStore::requestStorageAccess):
1373         (WebKit::WebsiteDataStore::grantStorageAccess):
1374         (WebKit::WebsiteDataStore::setTimeToLiveUserInteraction):
1375         (WebKit::WebsiteDataStore::logUserInteraction):
1376         (WebKit::WebsiteDataStore::hasHadUserInteraction):
1377         (WebKit::WebsiteDataStore::clearUserInteraction):
1378         (WebKit::WebsiteDataStore::isGrandfathered):
1379         (WebKit::WebsiteDataStore::setGrandfathered):
1380         (WebKit::WebsiteDataStore::setCacheMaxAgeCapForPrevalentResources):
1381         (WebKit::WebsiteDataStore::resetCacheMaxAgeCapForPrevalentResources):
1382         (WebKit::WebsiteDataStore::webPageWasAdded):
1383         (WebKit::WebsiteDataStore::webPageWasInvalidated):
1384         (WebKit::WebsiteDataStore::webProcessWillOpenConnection):
1385         (WebKit::WebsiteDataStore::webPageWillOpenConnection):
1386         (WebKit::WebsiteDataStore::webPageDidCloseConnection):
1387         (WebKit::WebsiteDataStore::webProcessDidCloseConnection):
1388         (WebKit::WebsiteDataStore::isAssociatedProcessPool const):
1389         (WebKit::WebsiteDataStore::processPools const):
1390         (WebKit::WebsiteDataStore::resourceLoadStatisticsEnabled const):
1391         (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
1392         (WebKit::WebsiteDataStore::setResourceLoadStatisticsDebugMode):
1393         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
1394         (WebKit::WebsiteDataStore::logTestingEvent):
1395         * UIProcess/WebsiteData/WebsiteDataStore.h:
1396         (WebKit::WebsiteDataStore::setStatisticsTestingCallback):
1397         * WebProcess/WebProcess.cpp:
1398         (WebKit::WebProcess::initializeWebProcess):
1399
1400 2019-01-15  Darin Adler  <darin@apple.com>
1401
1402         Use references rather than pointers for register/unregister functions, and more
1403         https://bugs.webkit.org/show_bug.cgi?id=175028
1404
1405         Reviewed by Daniel Bates.
1406
1407         * WebProcess/FullScreen/WebFullScreenManager.cpp:
1408         (WebKit::WebFullScreenManager::willEnterFullScreen): Update for change to the
1409         functions in Document; pass a reference.
1410         (WebKit::WebFullScreenManager::didEnterFullScreen): Ditto, don't pass the element.
1411         (WebKit::WebFullScreenManager::willExitFullScreen): Ditto.
1412         (WebKit::WebFullScreenManager::didExitFullScreen): Ditto.
1413
1414         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
1415         (WebKit::UserMediaPermissionRequestManager::startUserMediaRequest): Pass a reference.
1416         (WebKit::UserMediaPermissionRequestManager::mediaCanStart): Ditto.
1417         (WebKit::UserMediaPermissionRequestManager::removeMediaRequestFromMaps): Ditto.
1418         * WebProcess/Plugins/PluginView.cpp:
1419         (WebKit::PluginView::~PluginView): Ditto.
1420         (WebKit::PluginView::initializePlugin): Ditto.
1421
1422 2019-01-20  Michael Catanzaro  <mcatanzaro@igalia.com>
1423
1424         Unreviewed, fix -Wreturn-type warning
1425         https://bugs.webkit.org/show_bug.cgi?id=193333
1426         <rdar://problem/45649489>
1427
1428         * UIProcess/Automation/WebAutomationSession.cpp:
1429         (WebKit::toProtocol):
1430
1431 2019-01-20  chris fleizach  <cfleizach@apple.com>
1432
1433         AX: Support returning relative frames for accessibility
1434         https://bugs.webkit.org/show_bug.cgi?id=193414
1435         <rdar://problem/47268501>
1436
1437         Reviewed by Zalan Bujtas.
1438
1439         * UIProcess/API/Cocoa/WKWebView.mm:
1440         (-[WKWebView accessibilityAttributeValue:forParameter:]):
1441         (-[WKWebView IGNORE_WARNINGS_END]):
1442         * UIProcess/API/mac/WKView.mm:
1443         (-[WKView accessibilityAttributeValue:forParameter:]):
1444         (-[WKView IGNORE_WARNINGS_END]):
1445         * UIProcess/Cocoa/WebViewImpl.h:
1446         * UIProcess/Cocoa/WebViewImpl.mm:
1447         (WebKit::WebViewImpl::accessibilityAttributeValue):
1448         * UIProcess/ios/WKContentView.mm:
1449         (-[WKContentView accessibilityConvertRelativeFrameFromPage:]):
1450
1451 2019-01-20  Michael Catanzaro  <mcatanzaro@igalia.com>
1452
1453         Unreviewed, rolling out r240209.
1454
1455         Broke GTK/WPE injected bundle
1456
1457         Reverted changeset:
1458
1459         "AX: Support returning relative frames for accessibility"
1460         https://bugs.webkit.org/show_bug.cgi?id=193414
1461         https://trac.webkit.org/changeset/240209
1462
1463 2019-01-12  Dan Bernstein  <mitz@apple.com>
1464
1465         [Cocoa] Avoid importing directly from subumbrella frameworks
1466         https://bugs.webkit.org/show_bug.cgi?id=186016
1467         <rdar://problem/40591038>
1468
1469         Reviewed by Sam Weinig.
1470
1471         * Configurations/BaseTarget.xcconfig: Removed -iframework options from OTHER_CFLAGS and
1472           OTHER_CPLUSPLUSFLAGS.
1473         * UIProcess/Automation/mac/WebAutomationSessionMac.mm: Import Carbon.h instead of an
1474           HIToolbox header.
1475         * UIProcess/Cocoa/WebViewImpl.mm: Ditto.
1476         * UIProcess/mac/WKPrintingView.mm: Import Quartz.h instead of a PDFKit header.
1477         * UIProcess/mac/WKTextInputWindowController.mm: Import Carbon.h instead of an HIToolbox
1478           header.
1479         * WebProcess/Plugins/PDF/PDFAnnotationTextWidgetDetails.h: Import Quartz.h instead of a
1480           PDFKit header.
1481         * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h: Ditto.
1482         * WebProcess/Plugins/PDF/PDFPlugin.mm: Ditto.
1483         * WebProcess/Plugins/PDF/PDFPluginAnnotation.mm: Ditto.
1484         * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm: Ditto.
1485         * WebProcess/Plugins/PDF/PDFPluginPasswordField.mm: Ditto.
1486         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm: Ditto.
1487         * WebProcess/WebPage/mac/WebPageMac.mm: Ditto.
1488
1489 2019-01-20  chris fleizach  <cfleizach@apple.com>
1490
1491         AX: Support returning relative frames for accessibility
1492         https://bugs.webkit.org/show_bug.cgi?id=193414
1493         <rdar://problem/47268501>
1494
1495         Reviewed by Zalan Bujtas.
1496
1497         * UIProcess/API/Cocoa/WKWebView.mm:
1498         (-[WKWebView accessibilityAttributeValue:forParameter:]):
1499         (-[WKWebView IGNORE_WARNINGS_END]):
1500         * UIProcess/API/mac/WKView.mm:
1501         (-[WKView accessibilityAttributeValue:forParameter:]):
1502         (-[WKView IGNORE_WARNINGS_END]):
1503         * UIProcess/Cocoa/WebViewImpl.h:
1504         * UIProcess/Cocoa/WebViewImpl.mm:
1505         (WebKit::WebViewImpl::accessibilityAttributeValue):
1506         * UIProcess/ios/WKContentView.mm:
1507         (-[WKContentView accessibilityConvertRelativeFrameFromPage:]):
1508
1509 2019-01-20  Antoine Quint  <graouts@apple.com>
1510
1511         Add a POINTER_EVENTS feature flag
1512         https://bugs.webkit.org/show_bug.cgi?id=193577
1513         <rdar://problem/47408511>
1514
1515         Unreviewed. Also enable Pointer Events for iosmac.
1516
1517         * Configurations/FeatureDefines.xcconfig:
1518
1519 2019-01-19  David Kilzer  <ddkilzer@apple.com>
1520
1521         Follow-up: iOS: Updating input mode should update the software keyboard
1522         <https://bugs.webkit.org/show_bug.cgi?id=193565>
1523         <rdar://problem/47376334>
1524
1525         * WebProcess/WebPage/WebPage.cpp:
1526         (WebKit::WebPage::focusedElementDidChangeInputMode): Fix iOS
1527         Debug builds after r240199 by downcasting `element` to
1528         `HTMLElement` before calling canonicalInputMode().
1529
1530 2019-01-19  David Kilzer  <ddkilzer@apple.com>
1531
1532         Sort WebKit Xcode project file
1533
1534         * WebKit.xcodeproj/project.pbxproj:
1535
1536 2019-01-19  Antoine Quint  <graouts@apple.com>
1537
1538         Add a POINTER_EVENTS feature flag
1539         https://bugs.webkit.org/show_bug.cgi?id=193577
1540
1541         Reviewed by Dean Jackson.
1542
1543         * Configurations/FeatureDefines.xcconfig:
1544
1545 2019-01-18  Ryosuke Niwa  <rniwa@webkit.org>
1546
1547         iOS: Updating input mode should update the software keyboard
1548         https://bugs.webkit.org/show_bug.cgi?id=193565
1549         <rdar://problem/47376334>
1550
1551         Reviewed by Wenson Hsieh.
1552
1553         Update the software keyboard when the inputmode content attribute on the focused element had been mutated.
1554
1555         * Scripts/webkit/messages.py:
1556         * Shared/WebCoreArgumentCoders.h:
1557         * UIProcess/PageClient.h:
1558         * UIProcess/WebPageProxy.h:
1559         * UIProcess/WebPageProxy.messages.in:
1560         * UIProcess/ios/PageClientImplIOS.h:
1561         * UIProcess/ios/PageClientImplIOS.mm:
1562         (WebKit::PageClientImpl::focusedElementDidChangeInputMode):
1563         * UIProcess/ios/WKContentViewInteraction.h:
1564         * UIProcess/ios/WKContentViewInteraction.mm:
1565         (-[WKContentView _didUpdateInputMode:]):
1566         * UIProcess/ios/WebPageProxyIOS.mm:
1567         (WebKit::WebPageProxy::focusedElementDidChangeInputMode):
1568         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1569         (WebKit::WebChromeClient::focusedElementDidChangeInputMode):
1570         * WebProcess/WebCoreSupport/WebChromeClient.h:
1571         * WebProcess/WebPage/WebPage.cpp:
1572         (WebKit::WebPage::focusedElementDidChangeInputMode):
1573         * WebProcess/WebPage/WebPage.h:
1574
1575 2019-01-18  Tim Horton  <timothy_horton@apple.com>
1576
1577         Adjust WKDrawingView protocol method name
1578         https://bugs.webkit.org/show_bug.cgi?id=193604
1579
1580         Reviewed by Wenson Hsieh.
1581
1582         * UIProcess/ios/WKDrawingView.mm:
1583         (-[WKDrawingView canvasViewDrawingDidChange:]):
1584         (-[WKDrawingView drawingDidChange:]): Deleted.
1585
1586 2019-01-18  David Kilzer  <ddkilzer@apple.com>
1587
1588         [WebKit] Change Xcode folders to map to folders on disk
1589
1590         * WebKit.xcodeproj/project.pbxproj: Update these folders:
1591         - Shared/Authentication
1592         - Shared/Authentication/cocoa
1593
1594 2019-01-18  Brian Burg  <bburg@apple.com>
1595
1596         Automation.computeElementLayout should return visual viewport-aware coordinates
1597         https://bugs.webkit.org/show_bug.cgi?id=193598
1598         <rdar://problem/35325644>
1599
1600         Reviewed by Simon Fraser.
1601
1602         Previously I added CoordinateSystem::VisualViewport to stub out this for iOS.
1603         But I think that it's a mistake for safaridriver to care about VisualViewport
1604         being enabled or not, because it is a runtime-switchable setting.
1605
1606         This patch removes CoordinateSystem::VisualViewport. Make the existing
1607         CoordinateSystem::LayoutViewport use visual viewport semantics if needed.
1608
1609         This is tested by WebDriver element clicking tests. There should not be any
1610         difference in behavior until it is possible to zoom with gestures via WebDriver.
1611
1612         * Shared/CoordinateSystem.h:
1613         * UIProcess/Automation/Automation.json:
1614         * UIProcess/Automation/WebAutomationSession.cpp:
1615         (WebKit::protocolStringToCoordinateSystem):
1616         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
1617         (WebKit::WebAutomationSessionProxy::computeElementLayout):
1618
1619 2019-01-18  Daniel Bates  <dabates@apple.com>
1620
1621         Fix some build issues.
1622
1623         Include missing header WKDrawingCoordinator.
1624
1625         * UIProcess/ios/WKInkPickerView.mm:
1626
1627 2019-01-18  Tim Horton  <timothy_horton@apple.com>
1628
1629         Get rid of ADVANCED_SPELL_CHECKING
1630         https://bugs.webkit.org/show_bug.cgi?id=193592
1631
1632         Reviewed by Wenson Hsieh.
1633
1634         * UIProcess/Cocoa/WebViewImpl.mm:
1635         (WebKit::WebViewImpl::requestCandidatesForSelectionIfNeeded):
1636         (WebKit::WebViewImpl::insertText):
1637         * UIProcess/mac/TextCheckerMac.mm:
1638         (WebKit::TextChecker::checkTextOfParagraph):
1639         (WebKit::TextChecker::getGuessesForWord):
1640
1641 2019-01-18  Chris Dumez  <cdumez@apple.com>
1642
1643         Regression(PSON) Content blockers are sometimes lost on back navigation cross-site
1644         https://bugs.webkit.org/show_bug.cgi?id=193588
1645         <rdar://problem/47131566>
1646
1647         Reviewed by Alex Christensen.
1648
1649         When the WebPageProxy needs to create initialization parameters for its WebPage in the
1650         WebContent process, it calls WebProcessProxy::addWebUserContentControllerProxy()
1651         which calls WebUserContentControllerProxy::addProcess(). This last call is supposed to
1652         register the WebProcessProxy with the WebUserContentControllerProxy and adding the
1653         contentRuleLists to the WebPageCreationParameters. The issue is that if the
1654         WebUserContentControllerProxy already knows about this WebProcessProxy, it would return
1655         early and not populate the WebPageCreationParameters.
1656
1657         In PSON world, when navigating back to a page that failed to enter page cache, we reuse
1658         the process where we previously loaded the page but re-create a new WebPage on the
1659         WebContent process site. When this happens, WebUserContentControllerProxy would not
1660         add the contentRuleLists to the WebPageCreationParameters and the new WebPage in the
1661         previously-suspended process would be missing them.
1662
1663         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
1664         (WebKit::WebUserContentControllerProxy::addProcess):
1665
1666 2019-01-18  Jer Noble  <jer.noble@apple.com>
1667
1668         SDK_VARIANT build destinations should be separate from non-SDK_VARIANT builds
1669         https://bugs.webkit.org/show_bug.cgi?id=189553
1670
1671         Reviewed by Tim Horton.
1672
1673         * Configurations/Base.xcconfig:
1674         * Configurations/BaseTarget.xcconfig:
1675         * Configurations/SDKVariant.xcconfig: Added.
1676
1677 2019-01-18  Antti Koivisto  <antti@apple.com>
1678
1679         Implement asynchronous frame scrolling for iOS
1680         https://bugs.webkit.org/show_bug.cgi?id=193539
1681         <rdar://problem/47379873>
1682
1683         Reviewed by Simon Fraser.
1684
1685         Add a scrolling node type that can handle UIScrollView backed frames.
1686         It basically just instantiates and forwards to the existing ScrollingTreeScrollingNodeDelegateIOS.
1687
1688         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
1689         (WebKit::RemoteScrollingTree::createScrollingTreeNode):
1690         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
1691         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
1692         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h: Added.
1693         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm: Added.
1694         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::create):
1695         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::ScrollingTreeFrameScrollingNodeRemoteIOS):
1696         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::~ScrollingTreeFrameScrollingNodeRemoteIOS):
1697         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateBeforeChildren):
1698         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateAfterChildren):
1699         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterAncestorChange):
1700         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::scrollPosition const):
1701         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollLayerPosition):
1702         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterDelegatedScroll):
1703         * WebKit.xcodeproj/project.pbxproj:
1704
1705 2019-01-18  Chris Dumez  <cdumez@apple.com>
1706
1707         Regression(PSON) Scroll position is not always restored properly when navigating back
1708         https://bugs.webkit.org/show_bug.cgi?id=193578
1709         <rdar://problem/47386331>
1710
1711         Reviewed by Tim Horton.
1712
1713         Fix issues causing the scroll position to not be restored at all (or incorrectly) when
1714         navigating back cross-site with PSON enabled. Also make sure that the swipe gesture
1715         snapshot really stays up until we've restored the scroll position.
1716
1717         Note that even after those changes, I can still sometimes reproduce a white flash when
1718         swiping back to Google search results (scroll position being correct now). This is
1719         tracked by <rdar://problem/47071684> and happens even if I disable PSON entirely.
1720
1721         * Shared/SessionState.cpp:
1722         (WebKit::FrameState::encode const):
1723         (WebKit::FrameState::decode):
1724         * Shared/SessionState.h:
1725         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
1726         (WebKit::toFrameState):
1727         (WebKit::applyFrameState):
1728         obscuredInsets is present on the HistoryItem in the WebProcess but was never passed to
1729         or stored by the UIProcess on the WebBackForwardListItem. obscuredInsets is needed to
1730         properly restore the scrollPosition (position was 70px off on my iPad without this).
1731         With PSON enabled, if you swipe back cross-process and the previous page was not put
1732         into PageCache, then the HistoryItem is gone on the WebProcess side. What happens is
1733         that the UIProcess sends its WebBackForwardListItem to the WebProcess, which restores
1734         the HistoryItem there, and then asks it to load it. The obscuredInsets was getting lost
1735         in the process since the UIProcess never knew about it.
1736
1737         * UIProcess/Cocoa/ViewGestureController.cpp:
1738         (WebKit::ViewGestureController::didReachMainFrameLoadTerminalState):
1739         Drop logic that was causing the ViewGestureController to not wait for the scroll position
1740         to be restored before taking down the snapshot, when UI-side compositing is enabled.
1741         If you look at the comment above the code, you'll see that the code in question was meant
1742         to impact only the non-UI side compositing code path. As a matter of fact, when the code
1743         was reviewed at https://bugs.webkit.org/show_bug.cgi?id=151224, it was protected by a
1744         #if PLATFORM(MAC), before getting modified the wrong way before landing. In practice, we
1745         would have often restored the scroll position by the time the load is finished so it would
1746         not cause a flash in most cases. However, with PSON enabled and the layer tree freezing we
1747         do on process-swap, the first post-scroll restoration layer tree commit may now occur a
1748         little bit later and we would lose the race more often.
1749
1750         * UIProcess/WebProcessProxy.cpp:
1751         (WebKit::WebProcessProxy::updateBackForwardItem):
1752         * UIProcess/WebProcessProxy.h:
1753         When adding PageCache support to PSON, we used to navigate the "suspended" page to
1754         about:blank. This would lead to unwanted WebProcessProxy::updateBackForwardItem()
1755         calls from the WebProcess which we wanted to ignore. We thus added logic to ignore
1756         updateBackForwardItem() IPC from the old WebProcess after a swap. The issue with this
1757         is that we sometimes miss/ignore legit updates to the HistoryItem from the old process,
1758         in particular with regards to the scroll position and the pageScaleFactor. So if you
1759         swiped and then quickly enough did a cross-site navigation, the UIProcess'
1760         WebBackForwardList would not get updated with the latest scroll position and we would
1761         thus fail to restore it later on. To address the issue, we now stop ignoring updates
1762         from the old WebProcess after a swap. This logic is no longer needed since we no longer
1763         navigate the old page to about:blank after a swap, we merely suspend it "in place".
1764
1765 2019-01-18  Wenson Hsieh  <wenson_hsieh@apple.com>
1766
1767         Remove some last vestiges of assisted node terminology in WebKit
1768         https://bugs.webkit.org/show_bug.cgi?id=193572
1769
1770         Reviewed by Tim Horton.
1771
1772         * UIProcess/API/Cocoa/_WKFocusedElementInfo.h:
1773         * UIProcess/ios/WKContentViewInteraction.mm:
1774         (-[WKContentView gestureRecognizerShouldBegin:]):
1775         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
1776         (-[WKContentView _showKeyboard]):
1777         (-[WKContentView _hideKeyboard]):
1778
1779         Add a FIXME about invoking `-reloadInputViews` on watchOS when the focused element is blurred.
1780
1781         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
1782         (-[WKContentView _elementDidBlur]):
1783         (-[WKContentView updateCurrentFocusedElementInformation:]):
1784         (-[WKContentView _startAssistingKeyboard]): Deleted.
1785         (-[WKContentView _stopAssistingKeyboard]): Deleted.
1786         * WebProcess/WebPage/ios/WebPageIOS.mm:
1787         (WebKit::WebPage::getFocusedElementInformation):
1788
1789 2019-01-18  Youenn Fablet  <youenn@apple.com>
1790
1791         Add a new SPI to request for cache storage quota increase
1792         https://bugs.webkit.org/show_bug.cgi?id=193323
1793
1794         Reviewed by Alex Christensen.
1795
1796         Add a delegate on the WebSiteDataStore for WebKit to ask for quota update.
1797         The current SPI is currently CacheStorage specific but future work should
1798         make it so that other storage like IDB use the same mechanism.
1799         By default, quota remains unchanged if delegate is not implemented.
1800
1801         * NetworkProcess/NetworkProcess.cpp:
1802         * UIProcess/API/Cocoa/WKStorageQuotaDelegatePrivate.h: Added.
1803         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1804         (WebsiteDataStoreQuotaManager::WebsiteDataStoreQuotaManager):
1805         (-[WKWebsiteDataStore _quotaDelegate]):
1806         (-[WKWebsiteDataStore set_quotaDelegate:]):
1807         * UIProcess/API/Cocoa/WKWebsiteDataStoreInternal.h:
1808         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
1809         * UIProcess/Network/NetworkProcessProxy.cpp:
1810         (WebKit::NetworkProcessProxy::requestCacheStorageSpace):
1811         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1812         (WebKit::WebsiteDataStore::WebsiteDataStore):
1813         * UIProcess/WebsiteData/WebsiteDataStore.h:
1814         (WebKit::WebsiteDataStore::quotaManager):
1815         (WebKit::WebsiteDataStore::setQuotaManager):
1816         * UIProcess/WebsiteData/WebsiteDataStoreQuotaManager.h: Added.
1817         (WebKit::WebsiteDataStoreQuotaManager::~WebsiteDataStoreQuotaManager):
1818         (WebKit::WebsiteDataStoreQuotaManager::requestCacheStorageSpace):
1819         * WebKit.xcodeproj/project.pbxproj:
1820
1821 2019-01-18  Philippe Normand  <pnormand@igalia.com>
1822
1823         [WPE] Add Qt extension
1824         https://bugs.webkit.org/show_bug.cgi?id=191464
1825
1826         Reviewed by Carlos Garcia Campos.
1827
1828         This new extension is a QML plugin embedding a WPE ViewBackend
1829         implementation. It provides a public API very similar to Qt's
1830         WebView module. It comes with a simple mini-browser implemented in
1831         QML.
1832
1833         QtWPE is known to work with the Wayland-EGL (in GNOME and Weston
1834         compositors) and EGLFS QPAs.
1835
1836         * PlatformWPE.cmake:
1837         * UIProcess/API/wpe/qt/WPEQmlExtensionPlugin.cpp: Added.
1838         (WPEQmlExtensionPlugin::registerTypes):
1839         * UIProcess/API/wpe/qt/WPEQmlExtensionPlugin.h: Added.
1840         * UIProcess/API/wpe/qt/WPEQtView.cpp: Added.
1841         (WPEQtView::WPEQtView):
1842         (WPEQtView::~WPEQtView):
1843         (WPEQtView::geometryChanged):
1844         (WPEQtView::configureWindow):
1845         (WPEQtView::createOffscreen):
1846         (WPEQtView::backendCreated):
1847         (WPEQtView::notifyUrlChangedCallback):
1848         (WPEQtView::notifyTitleChangedCallback):
1849         (WPEQtView::notifyLoadProgressCallback):
1850         (WPEQtView::notifyLoadChangedCallback):
1851         (WPEQtView::notifyLoadFailedCallback):
1852         (WPEQtView::updatePaintNode):
1853         (WPEQtView::url const):
1854         (WPEQtView::setUrl):
1855         (WPEQtView::loadProgress const):
1856         (WPEQtView::title const):
1857         (WPEQtView::canGoBack const):
1858         (WPEQtView::isLoading const):
1859         (WPEQtView::canGoForward const):
1860         (WPEQtView::goBack):
1861         (WPEQtView::goForward):
1862         (WPEQtView::reload):
1863         (WPEQtView::stop):
1864         (WPEQtView::loadHtml):
1865         (WPEQtView::jsAsyncReadyCallback):
1866         (WPEQtView::handleJsResult):
1867         (WPEQtView::runJavaScript):
1868         (WPEQtView::mousePressEvent):
1869         (WPEQtView::mouseReleaseEvent):
1870         (WPEQtView::hoverEnterEvent):
1871         (WPEQtView::hoverLeaveEvent):
1872         (WPEQtView::hoverMoveEvent):
1873         (WPEQtView::wheelEvent):
1874         (WPEQtView::keyPressEvent):
1875         (WPEQtView::keyReleaseEvent):
1876         (WPEQtView::touchEvent):
1877         * UIProcess/API/wpe/qt/WPEQtView.h: Added.
1878         * UIProcess/API/wpe/qt/WPEQtViewBackend.cpp: Added.
1879         (configureCallback):
1880         (WPEQtViewBackend::WPEQtViewBackend):
1881         (WPEQtViewBackend::~WPEQtViewBackend):
1882         (WPEQtViewBackend::configureGlibEglDisplay):
1883         (WPEQtViewBackend::configureEglDisplay):
1884         (WPEQtViewBackend::initialize):
1885         (WPEQtViewBackend::backend const):
1886         (WPEQtViewBackend::resize):
1887         (WPEQtViewBackend::getTexture):
1888         (WPEQtViewBackend::initSurface):
1889         (WPEQtViewBackend::displayImage):
1890         (WPEQtViewBackend::modifiers const):
1891         (WPEQtViewBackend::dispatchHoverEnterEvent):
1892         (WPEQtViewBackend::dispatchHoverLeaveEvent):
1893         (WPEQtViewBackend::dispatchHoverMoveEvent):
1894         (WPEQtViewBackend::dispatchMousePressEvent):
1895         (WPEQtViewBackend::dispatchMouseReleaseEvent):
1896         (WPEQtViewBackend::dispatchWheelEvent):
1897         (WPEQtViewBackend::dispatchKeyEvent):
1898         (WPEQtViewBackend::dispatchTouchEvent):
1899         * UIProcess/API/wpe/qt/WPEQtViewBackend.h: Added.
1900         * UIProcess/API/wpe/qt/WPEQtViewLoadRequest.cpp: Added.
1901         (WPEQtViewLoadRequest::WPEQtViewLoadRequest):
1902         (WPEQtViewLoadRequest::~WPEQtViewLoadRequest):
1903         (WPEQtViewLoadRequest::url const):
1904         (WPEQtViewLoadRequest::status const):
1905         (WPEQtViewLoadRequest::errorString const):
1906         * UIProcess/API/wpe/qt/WPEQtViewLoadRequest.h: Added.
1907         * UIProcess/API/wpe/qt/WPEQtViewLoadRequestPrivate.h: Added.
1908         (WPEQtViewLoadRequestPrivate::WPEQtViewLoadRequestPrivate):
1909         (WPEQtViewLoadRequestPrivate::~WPEQtViewLoadRequestPrivate):
1910         * UIProcess/API/wpe/qt/qmldir: Added.
1911
1912 2019-01-17  Wenson Hsieh  <wenson_hsieh@apple.com>
1913
1914         [iOS] Content offset jumps erratically when autoscrolling near scroll view content inset areas
1915         https://bugs.webkit.org/show_bug.cgi?id=193494
1916         <rdar://problem/46859627>
1917
1918         Reviewed by Simon Fraser and Tim Horton.
1919
1920         Adds `contentInsets` to `VisibleContentRectUpdateInfo`. This keeps track of the visible content insets
1921         surrounding the unobscured content rect. See WebCore ChangeLog for more details.
1922
1923         * Shared/VisibleContentRectUpdateInfo.cpp:
1924         (WebKit::VisibleContentRectUpdateInfo::encode const):
1925         (WebKit::VisibleContentRectUpdateInfo::decode):
1926         (WebKit::operator<<):
1927         * Shared/VisibleContentRectUpdateInfo.h:
1928         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
1929         (WebKit::VisibleContentRectUpdateInfo::contentInsets const):
1930         (WebKit::operator==):
1931         * UIProcess/API/Cocoa/WKWebView.mm:
1932         (-[WKWebView _computedObscuredInset]):
1933         (-[WKWebView _computedContentInset]):
1934         (-[WKWebView _computedUnobscuredSafeAreaInset]):
1935
1936         We don't care about source compatibility with iOS 10 and below anymore, so we should change these >= iOS 11
1937         target checks to simply `PLATFORM(IOS)`.
1938
1939         (-[WKWebView _updateVisibleContentRects]):
1940
1941         Compute the visible content insets on all sides of the unobscured content rect. These insets are scaled to
1942         content coordinates.
1943
1944         * UIProcess/ios/WKContentView.h:
1945         * UIProcess/ios/WKContentView.mm:
1946         (floatBoxExtent):
1947
1948         Add a helper to convert `UIEdgeInsets` to `WebCore::FloatBoxExtent`, and use it in a few places below.
1949
1950         (-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
1951         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): Deleted.
1952         * WebProcess/WebPage/ios/WebPageIOS.mm:
1953         (WebKit::WebPage::updateVisibleContentRects):
1954
1955         Update the Page's content insets.
1956
1957 2019-01-17  Truitt Savell  <tsavell@apple.com>
1958
1959         Unreviewed, rolling out r240124.
1960
1961         This commit broke an internal build.
1962
1963         Reverted changeset:
1964
1965         "SDK_VARIANT build destinations should be separate from non-
1966         SDK_VARIANT builds"
1967         https://bugs.webkit.org/show_bug.cgi?id=189553
1968         https://trac.webkit.org/changeset/240124
1969
1970 2019-01-17  John Wilander  <wilander@apple.com>
1971
1972         Add infrastructure to enable/disable ITP Debug Mode through Preferences
1973         https://bugs.webkit.org/show_bug.cgi?id=193510
1974         <rdar://problem/47330969>
1975
1976         Reviewed by Dean Jackson.
1977
1978         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
1979         (WebKit::ResourceLoadStatisticsMemoryStore::ensurePrevalentResourcesForDebugMode):
1980         (WebKit::ResourceLoadStatisticsMemoryStore::setResourceLoadStatisticsDebugMode):
1981         (WebKit::ResourceLoadStatisticsMemoryStore::setPrevalentResourceForDebugMode):
1982             These functions are now suited for runtime switching of ITP Debug Mode.
1983         * Shared/WebPreferences.yaml:
1984             Changed name from ResourceLoadStatisticsDebugMode to ItpDebugModeEnabled.
1985         * UIProcess/API/Cocoa/WKPreferences.mm:
1986         (-[WKPreferences _setItpDebugModeEnabled:]):
1987         (-[WKPreferences _itpDebugModeEnabled]):
1988             New private preferences functions.
1989         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1990         * UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm:
1991         (WebKit::ResourceLoadStatisticsMemoryStore::registerUserDefaultsIfNeeded):
1992             Removed support for old experimental user default. Added a new one that's
1993             not connected to any UI, i.e. merely for command line debugging where
1994             ITP Debug Mode needs to be on all the time.
1995
1996 2019-01-17  Tim Horton  <timothy_horton@apple.com>
1997
1998         Adopt NSTextCheckingSuppressInitialCapitalizationKey
1999         https://bugs.webkit.org/show_bug.cgi?id=193545
2000
2001         Reviewed by Dean Jackson.
2002
2003         * UIProcess/mac/TextCheckerMac.mm:
2004         (WebKit::TextChecker::checkTextOfParagraph):
2005         (WebKit::TextChecker::getGuessesForWord):
2006
2007 2019-01-17  Jer Noble  <jer.noble@apple.com>
2008
2009         SDK_VARIANT build destinations should be separate from non-SDK_VARIANT builds
2010         https://bugs.webkit.org/show_bug.cgi?id=189553
2011
2012         Reviewed by Tim Horton.
2013
2014         * Configurations/Base.xcconfig:
2015         * Configurations/BaseTarget.xcconfig:
2016         * Configurations/SDKVariant.xcconfig: Added.
2017
2018 2019-01-16  Dean Jackson  <dino@apple.com>
2019
2020         (iPad) Link tapping is sluggish on many sites
2021         https://bugs.webkit.org/show_bug.cgi?id=193522
2022         <rdar://problem/47102987>
2023
2024         Reviewed by Wenson Hsieh.
2025
2026         Some WKWebView clients might set the initial zoom scale of the page to
2027         something other than 1, which disables the "fast tap" behaviour.
2028         The fix is very simple -- just check against the initial scale rather
2029         than 1.
2030
2031         The most likely regression from this would be pages designed for desktop,
2032         but provide a viewport tag saying width=device-width and initial-scale.
2033         They might stop allowing double-tap-to-zoom.
2034
2035         * UIProcess/API/Cocoa/WKWebView.mm:
2036         (-[WKWebView _allowsDoubleTapGestures]): Check against initial page scale.
2037
2038 2019-01-17  Alex Christensen  <achristensen@webkit.org>
2039
2040         Stop using NetworkStorageSession::storageSession in WebCore
2041         https://bugs.webkit.org/show_bug.cgi?id=193529
2042
2043         Reviewed by Tim Horton.
2044
2045         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2046         (WebKit::NetworkConnectionToWebProcess::createSocketStream):
2047         * NetworkProcess/NetworkProcess.h:
2048         * NetworkProcess/NetworkSocketStream.cpp:
2049         (WebKit::NetworkSocketStream::create):
2050         (WebKit::NetworkSocketStream::NetworkSocketStream):
2051         * NetworkProcess/NetworkSocketStream.h:
2052         * NetworkProcess/NetworkStorageSessionProvider.h: Added.
2053         * WebKit.xcodeproj/project.pbxproj:
2054         * WebProcess/Network/WebSocketProvider.cpp:
2055         (WebKit::WebSocketProvider::createSocketStreamHandle):
2056         * WebProcess/Network/WebSocketProvider.h:
2057         * WebProcess/WebPage/WebCookieJar.cpp:
2058         (WebKit::WebCookieJar::WebCookieJar):
2059         * WebProcess/WebPage/WebCookieJar.h:
2060
2061 2019-01-16  Youenn Fablet  <youenn@apple.com>
2062
2063         Add a new SPI for controlling getUserMedia
2064         https://bugs.webkit.org/show_bug.cgi?id=192793
2065
2066         Reviewed by Eric Carlson.
2067
2068         Some weaknesses of the current getUserMedia/enumerateDevices SPI were found.
2069         In particular:
2070         - The hash salt should be handled by WebKit not by apps using WebKit.
2071         - No need to expose the frame URL, only the top level origin is needed.
2072         - The names of the callback are changed to improve the intent of these callbacks.
2073         Addressed these by creating a new SPI which will replace the current one.
2074         The current SPI will be removed later on.
2075
2076         Did some refactoring by making the callbacks not return false.
2077         Instead, implement the default behavior inside the request objects as deny methods.
2078         Some further refactoring will be done as a follow-up to better align the C API with the Cocoa API.
2079
2080         * UIProcess/API/APIUIClient.h:
2081         (API::UIClient::decidePolicyForUserMediaPermissionRequest):
2082         (API::UIClient::checkUserMediaPermissionForOrigin):
2083         * UIProcess/API/C/WKPage.cpp:
2084         (WKPageSetPageUIClient):
2085         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2086         * UIProcess/API/Cocoa/WKWebView.mm:
2087         (-[WKWebView _mediaCaptureState]):
2088         (-[WKWebView _setMediaCaptureMuted:]):
2089         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2090         * UIProcess/API/glib/WebKitUIClient.cpp:
2091         * UIProcess/Cocoa/MediaCaptureUtilities.h: Added.
2092         * UIProcess/Cocoa/MediaCaptureUtilities.mm: Added.
2093         * UIProcess/Cocoa/UIDelegate.h:
2094         * UIProcess/Cocoa/UIDelegate.mm:
2095         (WebKit::UIDelegate::setDelegate):
2096         (WebKit::requestUserMediaAuthorizationForFrame):
2097         (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
2098         (WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin):
2099         (WebKit::UIDelegate::UIClient::mediaCaptureStateDidChange):
2100         * UIProcess/UserMediaPermissionCheckProxy.h:
2101         (WebKit::UserMediaPermissionCheckProxy::deny):
2102         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2103         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
2104         (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo):
2105         * UIProcess/UserMediaPermissionRequestProxy.h:
2106
2107 2019-01-16  Youenn Fablet  <youenn@apple.com>
2108
2109         Pipe cache quota request from Network Process to UIProcess
2110         https://bugs.webkit.org/show_bug.cgi?id=193296
2111
2112         Reviewed by Alex Christensen.
2113
2114         When cache storage hits quota for a given origin, pipe the request back to NetworkProcess.
2115         No record will be put until the quota request is answered.
2116         The request is sent from CacheStorage::Caches to CacheStorage::Engine and to NetworkProcess.
2117         NetworkProcess then sends it to NetworkProcessProxy.
2118         Currently NetworkProcessProxy just answers by keeping the quota as it is.
2119         In the future, NetworkProcessProxy should make a delegate call to let the app using WebKit
2120         make a decision on the quota. This will allow prompting user to bump it as done for other data.
2121
2122         * NetworkProcess/NetworkProcess.cpp:
2123         (WebKit::NetworkProcess::requestCacheStorageSpace):
2124         * NetworkProcess/NetworkProcess.h:
2125         * NetworkProcess/cache/CacheStorageEngine.cpp:
2126         (WebKit::CacheStorage::Engine::~Engine):
2127         (WebKit::CacheStorage::Engine::from):
2128         (WebKit::CacheStorage::Engine::Engine):
2129         (WebKit::CacheStorage::Engine::requestSpace):
2130         (WebKit::CacheStorage::Engine::requestSpaceCompleted):
2131         * NetworkProcess/cache/CacheStorageEngine.h:
2132         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
2133         (WebKit::CacheStorage::Cache::put):
2134         (WebKit::CacheStorage::Cache::retryPuttingPendingRecords):
2135         * NetworkProcess/cache/CacheStorageEngineCache.h:
2136         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2137         (WebKit::CacheStorage::Caches::requestSpace):
2138         (WebKit::CacheStorage::Caches::notifyCachesOfRequestSpaceEnd):
2139         * NetworkProcess/cache/CacheStorageEngineCaches.h:
2140         (WebKit::CacheStorage::Caches::isRequestingSpace const):
2141         * UIProcess/Network/NetworkProcessProxy.cpp:
2142         (WebKit::NetworkProcessProxy::requestCacheStorageSpace):
2143         * UIProcess/Network/NetworkProcessProxy.h:
2144         * UIProcess/Network/NetworkProcessProxy.messages.in:
2145
2146 2019-01-16  Alex Christensen  <achristensen@webkit.org>
2147
2148         sendBeacon to previously-unvisited https domain always fails
2149         https://bugs.webkit.org/show_bug.cgi?id=193508
2150
2151         Reviewed by Geoffrey Garen.
2152
2153         * NetworkProcess/PingLoad.cpp:
2154         (WebKit::PingLoad::didReceiveChallenge):
2155         If a ping load is doing a TLS handshake, continue if the server has good certificates.
2156
2157 2019-01-16  Youenn Fablet  <youenn@apple.com>
2158
2159         ASSERTION FAILED: m_networkLoadInformationByID.contains(identifier) in WebKit::NetworkConnectionToWebProcess::addNetworkLoadInformationMetrics
2160         https://bugs.webkit.org/show_bug.cgi?id=189097
2161         <rdar://problem/43856423>
2162
2163         Reviewed by Alex Christensen.
2164
2165         In case where the inspector is launched, it will instruct the NetworkConnectionToWebProcess to start capturing network metrics.
2166         If this happens in the middle of a load, addNetworkLoadInformationMetrics might fail since addNetworkLoadInformation will not be called.
2167         To fix this issue, store whether to capture metrics at NetworkResourceLoader level.
2168
2169         To ensure that the case of switching back and forth capture of metrics, disable loader capture of metrics whenver NetworkConnectionToWebProcess is asked to.
2170
2171         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2172         (WebKit::NetworkConnectionToWebProcess::setCaptureExtraNetworkLoadMetricsEnabled):
2173         * NetworkProcess/NetworkConnectionToWebProcess.h:
2174         (WebKit::NetworkConnectionToWebProcess::addNetworkLoadInformationMetrics):
2175         * NetworkProcess/NetworkResourceLoader.cpp:
2176         (WebKit::m_shouldCaptureExtraNetworkLoadMetrics):
2177         (WebKit::NetworkResourceLoader::shouldCaptureExtraNetworkLoadMetrics const):
2178         * NetworkProcess/NetworkResourceLoader.h:
2179
2180 2019-01-16  Alex Christensen  <achristensen@webkit.org>
2181
2182         Revert r239938
2183         https://bugs.webkit.org/show_bug.cgi?id=193267
2184         <rdar://problem/47297304>
2185
2186         * Configurations/WebContent-iOS.entitlements:
2187
2188 2019-01-16  Chris Dumez  <cdumez@apple.com>
2189
2190         Regression(r240046) Several API tests are crashing
2191         https://bugs.webkit.org/show_bug.cgi?id=193509
2192
2193         Reviewed by Geoffrey Garen.
2194
2195         The crashes would happen because loadRequestShared() would take a WebProcessProxy& in parameter but
2196         then call reattachToWebProcess() if the page is not valid, which would replace m_process and invalidate
2197         our process reference.
2198
2199         To address the issue, move the reattachToWebProcess() call to loadRequest(), before calling
2200         loadRequestShared(). Also, update *Shared() methods to take a Ref<WebProcessProxy>&& instead
2201         of a WebProcessProxy& in parameter. Since we call client delegates, we need to make sure
2202         our process stays alive.
2203
2204         * UIProcess/ProvisionalPageProxy.cpp:
2205         (WebKit::ProvisionalPageProxy::loadData):
2206         (WebKit::ProvisionalPageProxy::loadRequest):
2207         (WebKit::ProvisionalPageProxy::didCreateMainFrame):
2208         (WebKit::ProvisionalPageProxy::didPerformClientRedirect):
2209         (WebKit::ProvisionalPageProxy::didStartProvisionalLoadForFrame):
2210         (WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame):
2211         (WebKit::ProvisionalPageProxy::didNavigateWithNavigationData):
2212         (WebKit::ProvisionalPageProxy::didChangeProvisionalURLForFrame):
2213         (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionAsync):
2214         (WebKit::ProvisionalPageProxy::decidePolicyForResponse):
2215         (WebKit::ProvisionalPageProxy::startURLSchemeTask):
2216         (WebKit::ProvisionalPageProxy::backForwardGoToItem):
2217         * UIProcess/WebPageProxy.cpp:
2218         (WebKit::WebPageProxy::loadRequest):
2219         (WebKit::WebPageProxy::loadRequestWithNavigationShared):
2220         (WebKit::WebPageProxy::loadData):
2221         (WebKit::WebPageProxy::loadDataWithNavigationShared):
2222         (WebKit::WebPageProxy::didPerformDragControllerAction):
2223         (WebKit::WebPageProxy::findPlugin):
2224         (WebKit::WebPageProxy::didCreateMainFrame):
2225         (WebKit::WebPageProxy::didCreateSubframe):
2226         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
2227         (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
2228         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
2229         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrameShared):
2230         (WebKit::WebPageProxy::willPerformClientRedirectForFrame):
2231         (WebKit::WebPageProxy::didCancelClientRedirectForFrame):
2232         (WebKit::WebPageProxy::didChangeProvisionalURLForFrame):
2233         (WebKit::WebPageProxy::didChangeProvisionalURLForFrameShared):
2234         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
2235         (WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared):
2236         (WebKit::WebPageProxy::didCommitLoadForFrame):
2237         (WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
2238         (WebKit::WebPageProxy::didFinishLoadForFrame):
2239         (WebKit::WebPageProxy::didFailLoadForFrame):
2240         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
2241         (WebKit::WebPageProxy::didReceiveTitleForFrame):
2242         (WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame):
2243         (WebKit::WebPageProxy::didDisplayInsecureContentForFrame):
2244         (WebKit::WebPageProxy::didRunInsecureContentForFrame):
2245         (WebKit::WebPageProxy::frameDidBecomeFrameSet):
2246         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
2247         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsyncShared):
2248         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2249         (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
2250         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
2251         (WebKit::WebPageProxy::decidePolicyForResponse):
2252         (WebKit::WebPageProxy::decidePolicyForResponseShared):
2253         (WebKit::WebPageProxy::unableToImplementPolicy):
2254         (WebKit::WebPageProxy::willSubmitForm):
2255         (WebKit::WebPageProxy::didNavigateWithNavigationData):
2256         (WebKit::WebPageProxy::didNavigateWithNavigationDataShared):
2257         (WebKit::WebPageProxy::didPerformClientRedirect):
2258         (WebKit::WebPageProxy::didPerformClientRedirectShared):
2259         (WebKit::WebPageProxy::didPerformServerRedirect):
2260         (WebKit::WebPageProxy::didUpdateHistoryTitle):
2261         (WebKit::WebPageProxy::createNewPage):
2262         (WebKit::WebPageProxy::runJavaScriptAlert):
2263         (WebKit::WebPageProxy::runJavaScriptConfirm):
2264         (WebKit::WebPageProxy::runJavaScriptPrompt):
2265         (WebKit::WebPageProxy::unavailablePluginButtonClicked):
2266         (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel):
2267         (WebKit::WebPageProxy::runOpenPanel):
2268         (WebKit::WebPageProxy::printFrame):
2269         (WebKit::WebPageProxy::backForwardGoToItem):
2270         (WebKit::WebPageProxy::backForwardGoToItemShared):
2271         (WebKit::WebPageProxy::learnWord):
2272         (WebKit::WebPageProxy::ignoreWord):
2273         (WebKit::WebPageProxy::didReceiveEvent):
2274         (WebKit::WebPageProxy::editingRangeCallback):
2275         (WebKit::WebPageProxy::rectForCharacterRangeCallback):
2276         (WebKit::WebPageProxy::focusedFrameChanged):
2277         (WebKit::WebPageProxy::frameSetLargestFrameChanged):
2278         (WebKit::WebPageProxy::exceededDatabaseQuota):
2279         (WebKit::WebPageProxy::requestGeolocationPermissionForFrame):
2280         (WebKit::WebPageProxy::requestUserMediaPermissionForFrame):
2281         (WebKit::WebPageProxy::enumerateMediaDevicesForFrame):
2282         (WebKit::WebPageProxy::startURLSchemeTask):
2283         (WebKit::WebPageProxy::startURLSchemeTaskShared):
2284         (WebKit::WebPageProxy::stopURLSchemeTask):
2285         (WebKit::WebPageProxy::loadSynchronousURLSchemeTask):
2286         * UIProcess/WebPageProxy.h:
2287
2288 2019-01-16  Chris Dumez  <cdumez@apple.com>
2289
2290         Regression(PSON) View becomes blank after click a cross-site download link
2291         https://bugs.webkit.org/show_bug.cgi?id=193361
2292         <rdar://problem/47099573>
2293
2294         Reviewed by Geoffrey Garen.
2295
2296         The issue tracked by rdar://problem/47099573 is that a provisional load may get
2297         canceled (or converted into a download) *after* we've decided to process-swap.
2298         In such cases, the view should keep displaying the current site and it should
2299         still be interactive. However, with the previous PSON model, the view (pageProxy)
2300         would have already swapped to the new process and would end up displaying the
2301         initially empty document.
2302
2303         To address the issue, this patch introduces the concept of a provisional load
2304         in the UIProcess, handled by a ProvisionalPageProxy which has its own privisional
2305         process. The WebPageProxy owns the ProvisionalPageProxy but we do not commit the
2306         provisional page until after the load was committed in the new process. This means
2307         that the view / WebPageProxy keeps using the old process and displays the current
2308         content until a load has committed in the provisional page. If no load commits
2309         in the provisional process (e.g. because the load is cancelled or converted into
2310         a download), then we merely destroy the ProvisionalPageProxy and terminate its
2311         process, without impacting the WebPageProxy.
2312
2313         * Shared/WebPageCreationParameters.cpp:
2314         (WebKit::WebPageCreationParameters::encode const):
2315         (WebKit::WebPageCreationParameters::decode):
2316         * Shared/WebPageCreationParameters.h:
2317         Rename isSwapFromSuspended to isProcessSwap for clarity as we always want to
2318         delay attaching the drawing area in case of a process-swap, no matter what
2319         now that the previous process is kept alive until the provisional load is
2320         committed in the new process.
2321
2322         * Shared/WebPolicyAction.h:
2323         Drop Suspend policy action. At decidePolicyForNavigationAction time, in case of
2324         process-swap, we now tell the previous process to simply ignore the load, while
2325         we create a ProvisionalPageProxy to do the new load in a new process.
2326         Suspension of the previous page in the old process, happens later, when a load
2327         is actually committed in the new process.
2328
2329         * Sources.txt:
2330         Add new ProvisionalPageProxy file.
2331
2332         * UIProcess/API/Cocoa/WKWebView.mm:
2333         (-[WKWebView _killWebContentProcessAndResetState]):
2334         When calling _killWebContentProcessAndResetState on a WKWebView, kill both the current
2335         process and the provisional one, to maintain previous behavior in our API tests.
2336
2337         * UIProcess/API/gtk/PageClientImpl.cpp:
2338         (WebKit::PageClientImpl::createDrawingAreaProxy):
2339         * UIProcess/API/gtk/PageClientImpl.h:
2340         * UIProcess/API/wpe/PageClientImpl.cpp:
2341         (WebKit::PageClientImpl::createDrawingAreaProxy):
2342         * UIProcess/API/wpe/PageClientImpl.h:
2343         * UIProcess/AcceleratedDrawingAreaProxy.cpp:
2344         (WebKit::AcceleratedDrawingAreaProxy::AcceleratedDrawingAreaProxy):
2345         (WebKit::AcceleratedDrawingAreaProxy::didUpdateBackingStoreState):
2346         (WebKit::AcceleratedDrawingAreaProxy::sendUpdateBackingStoreState):
2347         (WebKit::AcceleratedDrawingAreaProxy::waitForAndDispatchDidUpdateBackingStoreState):
2348         (WebKit::AcceleratedDrawingAreaProxy::setNativeSurfaceHandleForCompositing):
2349         (WebKit::AcceleratedDrawingAreaProxy::destroyNativeSurfaceHandleForCompositing):
2350         * UIProcess/AcceleratedDrawingAreaProxy.h:
2351         * UIProcess/Cocoa/WebViewImpl.h:
2352         * UIProcess/Cocoa/WebViewImpl.mm:
2353         (WebKit::WebViewImpl::createDrawingAreaProxy):
2354         * UIProcess/DrawingAreaProxy.cpp:
2355         (WebKit::DrawingAreaProxy::DrawingAreaProxy):
2356         (WebKit::DrawingAreaProxy::~DrawingAreaProxy):
2357         (WebKit::DrawingAreaProxy::viewExposedRectChangedTimerFired):
2358         * UIProcess/DrawingAreaProxy.h:
2359         (WebKit::DrawingAreaProxy::process):
2360         * UIProcess/DrawingAreaProxyImpl.cpp:
2361         (WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl):
2362         (WebKit::DrawingAreaProxyImpl::update):
2363         * UIProcess/DrawingAreaProxyImpl.h:
2364         * UIProcess/PageClient.h:
2365         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
2366         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
2367         (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
2368         (WebKit::RemoteLayerTreeDrawingAreaProxy::~RemoteLayerTreeDrawingAreaProxy):
2369         (WebKit::RemoteLayerTreeDrawingAreaProxy::deviceScaleFactorDidChange):
2370         (WebKit::RemoteLayerTreeDrawingAreaProxy::sendUpdateGeometry):
2371         (WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidStart):
2372         (WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidEnd):
2373         (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
2374         (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateActivityState):
2375         (WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing):
2376         * UIProcess/ios/PageClientImplIOS.h:
2377         * UIProcess/ios/PageClientImplIOS.mm:
2378         (WebKit::PageClientImpl::createDrawingAreaProxy):
2379         * UIProcess/ios/WKContentView.h:
2380         * UIProcess/ios/WKContentView.mm:
2381         (-[WKContentView _createDrawingAreaProxy:]):
2382         * UIProcess/mac/PageClientImplMac.h:
2383         * UIProcess/mac/PageClientImplMac.mm:
2384         (WebKit::PageClientImpl::createDrawingAreaProxy):
2385         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
2386         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
2387         (WebKit::TiledCoreAnimationDrawingAreaProxy::TiledCoreAnimationDrawingAreaProxy):
2388         (WebKit::TiledCoreAnimationDrawingAreaProxy::deviceScaleFactorDidChange):
2389         (WebKit::TiledCoreAnimationDrawingAreaProxy::colorSpaceDidChange):
2390         (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateActivityState):
2391         (WebKit::TiledCoreAnimationDrawingAreaProxy::createFence):
2392         (WebKit::TiledCoreAnimationDrawingAreaProxy::sendUpdateGeometry):
2393         (WebKit::TiledCoreAnimationDrawingAreaProxy::adjustTransientZoom):
2394         (WebKit::TiledCoreAnimationDrawingAreaProxy::commitTransientZoom):
2395         (WebKit::TiledCoreAnimationDrawingAreaProxy::dispatchAfterEnsuringDrawing):
2396         * UIProcess/mac/WebPageProxyMac.mm:
2397         * UIProcess/win/PageClientImpl.cpp:
2398         (WebKit::PageClientImpl::createDrawingAreaProxy):
2399         * UIProcess/win/PageClientImpl.h:
2400         * UIProcess/win/PageClientImpl.cpp:
2401         (WebKit::PageClientImpl::createDrawingAreaProxy):
2402         * UIProcess/win/PageClientImpl.h:
2403         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2404         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
2405         Pass the drawing area's associated process when constructing it and store it as a member
2406         in addition to the page. This is necessary now that a page can be associated with 2
2407         WebProcesses at a time, each having its own drawing area.
2408
2409         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
2410         (WebKit::WebPageProxy::createSandboxExtensionsIfNeeded):
2411         Pass the process.
2412
2413         * UIProcess/ProvisionalPageProxy.cpp: Added.
2414         (WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
2415         (WebKit::ProvisionalPageProxy::~ProvisionalPageProxy):
2416         (WebKit::ProvisionalPageProxy::processDidTerminate):
2417         (WebKit::ProvisionalPageProxy::takeDrawingArea):
2418         (WebKit::ProvisionalPageProxy::cancel):
2419         (WebKit::ProvisionalPageProxy::processDidFinishLaunching):
2420         (WebKit::ProvisionalPageProxy::finishInitializingWebPageAfterProcessLaunch):
2421         (WebKit::ProvisionalPageProxy::initializeWebPage):
2422         (WebKit::ProvisionalPageProxy::loadData):
2423         (WebKit::ProvisionalPageProxy::loadRequest):
2424         (WebKit::ProvisionalPageProxy::goToBackForwardItem):
2425         (WebKit::ProvisionalPageProxy::didCreateMainFrame):
2426         (WebKit::ProvisionalPageProxy::didPerformClientRedirect):
2427         (WebKit::ProvisionalPageProxy::didStartProvisionalLoadForFrame):
2428         (WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame):
2429         (WebKit::ProvisionalPageProxy::didCommitLoadForFrame):
2430         (WebKit::ProvisionalPageProxy::didNavigateWithNavigationData):
2431         (WebKit::ProvisionalPageProxy::didChangeProvisionalURLForFrame):
2432         (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionAsync):
2433         (WebKit::ProvisionalPageProxy::decidePolicyForResponse):
2434         (WebKit::ProvisionalPageProxy::startURLSchemeTask):
2435         (WebKit::ProvisionalPageProxy::backForwardGoToItem):
2436         (WebKit::ProvisionalPageProxy::didReceiveMessage):
2437         (WebKit::ProvisionalPageProxy::didReceiveSyncMessage):
2438         * UIProcess/ProvisionalPageProxy.h: Added.
2439         (WebKit::ProvisionalPageProxy::page):
2440         (WebKit::ProvisionalPageProxy::mainFrame const):
2441         (WebKit::ProvisionalPageProxy::process):
2442         (WebKit::ProvisionalPageProxy::processSwapRequestedByClient const):
2443         (WebKit::ProvisionalPageProxy::navigationID const):
2444         (WebKit::ProvisionalPageProxy::drawingArea const):
2445         New WebPageProxy-like class which is owned by the WebPageProxy and proxies IPC from
2446         the provisional process.
2447
2448         * UIProcess/SuspendedPageProxy.cpp:
2449         (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
2450         (WebKit::SuspendedPageProxy::unsuspend):
2451         (WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
2452         Unregister the SuspendedPageProxy as an IPC message receiver a little bit earlier
2453         when we're going to unsuspend it. This avoids conflicting with the ProvisionalPageProxy
2454         which tries to register itself as an IPC message receiver for the same pageID when
2455         a process-swap occurs and we're switching to a suspended page.
2456
2457         * UIProcess/WebFrameProxy.cpp:
2458         (WebKit::WebFrameProxy::isMainFrame const):
2459         WebFrameProxy::isMainFrame() relies on checking that the frame is the WebPageProxy's m_mainFrame.
2460         Now that the WebPageProxy can have a ProvisionalPageProxy, also check if it is the ProvisionalPageProxy's
2461         m_mainFrame to maintain previous behavior.
2462
2463         * UIProcess/WebPageProxy.cpp:
2464         (WebKit::WebPageProxy::provisionalDrawingArea const):
2465         Add getter for the provisional drawing area. We normally only deal with the page's current drawing area, but
2466         the ViewGestureController needs access to the provisional once to display the swipe gesture snapshot.
2467
2468         (WebKit::WebPageProxy::swapToWebProcess):
2469         swapToWebProcess() no longer takes care of unsuspending the SuspendedPage because we now call swapToWebProcess()
2470         later, when a load is actually committed in the provisional page / process. swapToWebProcess() now also needs
2471         to initialize some data members such as the drawing area and the main frame as it is transferring them over from
2472         the ProvisionalPageProxy which started the provisional load.
2473
2474         (WebKit::WebPageProxy::finishAttachingToWebProcess):
2475         We no longer need IsSwapFromSuspended parameter as this is called later now, after a load has actually been
2476         committed in the provisional process.
2477
2478         (WebKit::WebPageProxy::setDrawingArea):
2479         (WebKit::WebPageProxy::initializeWebPage):
2480         - We no longer need IsSwapFromSuspended parameter as this is called later now, after a load has actually been
2481           committed in the provisional process.
2482         - Factor some code out to WebPageProxy::setDrawingArea() so that it can be shared with swapToWebProcess().
2483
2484         (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
2485         (WebKit::WebPageProxy::loadRequest):
2486         (WebKit::WebPageProxy::loadRequestWithNavigationShared):
2487         Only call setPendingAPIRequestURL() in loadRequestWithNavigation() only if ShouldTreatAsContinuingLoad is not
2488         Yes. This avoids hitting some assertions as this was already called during the first API call if needed.
2489
2490         (WebKit::WebPageProxy::loadData):
2491         (WebKit::WebPageProxy::loadDataWithNavigationShared):
2492         (WebKit::WebPageProxy::stopLoading):
2493         (WebKit::WebPageProxy::reload):
2494         (WebKit::WebPageProxy::didPerformDragControllerAction):
2495         (WebKit::WebPageProxy::findPlugin):
2496         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
2497         In case of process swap, tell the previous process to ignore the load instead of suspending it right away.
2498         Suspension now happens later, only if we end up committing the provisional load in the new process.
2499         Also discard the SuspendedPage if it failed to suspend (we only reuse its process in this case). This used
2500         to happen a bit later but it is clearer if we do this as early as possible I think.
2501
2502         (WebKit::WebPageProxy::commitProvisionalPage):
2503         When the load is committed in the new process, we call WebPageProxy::commitProvisionalPage(). It takes care of:
2504         - Actually swapping the WebPageProxy to the new process by calling processDidTerminate() / swapToWebProcess().
2505         - Suspending the current page.
2506         - Letting the client know the load is comitted
2507         - Destroy the ProvisionalPageProxy.
2508         This work used to happen earlier in continueNavigationInNewProcess().
2509
2510         (WebKit::WebPageProxy::continueNavigationInNewProcess):
2511         Moved some of the logic to commitProvisionalPage(). We now merely start the load in a new ProvisionalPageProxy,
2512         without actually having the WebPageProxy switch to the new process yet.
2513
2514         (WebKit::WebPageProxy::didCreateMainFrame):
2515         (WebKit::WebPageProxy::didCreateSubframe):
2516         (WebKit::WebPageProxy::didCreateWindow):
2517         Drop some code that is no longer needed, now that the ProvisionalPageProxy takes care of this.
2518
2519         (WebKit::WebPageProxy::didDestroyNavigation):
2520         On process-swap, when telling the previous process to ignore the load and starting the new load in a new
2521         ProvisionalPageProxy, the previous WebPage attempts to destroy the navigation. In this case, we ignore
2522         the call since the navigation is merely taken over by the ProvisionalPageProxy.
2523
2524         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
2525         (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
2526         Moved some PSON logic to the ProvisionalPageProxy instead.
2527
2528         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
2529         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrameShared):
2530         (WebKit::WebPageProxy::willPerformClientRedirectForFrame):
2531         (WebKit::WebPageProxy::didCancelClientRedirectForFrame):
2532         (WebKit::WebPageProxy::didChangeProvisionalURLForFrame):
2533         (WebKit::WebPageProxy::didChangeProvisionalURLForFrameShared):
2534
2535         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
2536         (WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared):
2537         When didFailProvisionalLoadForFrame() is called for a ProvisionalPageProxy, destroy it.
2538
2539         (WebKit::WebPageProxy::didCommitLoadForFrame):
2540         (WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
2541         (WebKit::WebPageProxy::didFinishLoadForFrame):
2542         (WebKit::WebPageProxy::didFailLoadForFrame):
2543         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
2544         (WebKit::WebPageProxy::didReceiveTitleForFrame):
2545         (WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame):
2546         (WebKit::WebPageProxy::didDisplayInsecureContentForFrame):
2547         (WebKit::WebPageProxy::didRunInsecureContentForFrame):
2548         (WebKit::WebPageProxy::frameDidBecomeFrameSet):
2549         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
2550         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsyncShared):
2551         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2552         (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
2553         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
2554         (WebKit::WebPageProxy::decidePolicyForResponse):
2555         (WebKit::WebPageProxy::decidePolicyForResponseShared):
2556         (WebKit::WebPageProxy::unableToImplementPolicy):
2557         (WebKit::WebPageProxy::willSubmitForm):
2558         (WebKit::WebPageProxy::didNavigateWithNavigationData):
2559         (WebKit::WebPageProxy::didNavigateWithNavigationDataShared):
2560         (WebKit::WebPageProxy::didPerformClientRedirect):
2561         (WebKit::WebPageProxy::didPerformClientRedirectShared):
2562         (WebKit::WebPageProxy::didPerformServerRedirect):
2563         (WebKit::WebPageProxy::didUpdateHistoryTitle):
2564         (WebKit::WebPageProxy::createNewPage):
2565         (WebKit::WebPageProxy::runJavaScriptAlert):
2566         (WebKit::WebPageProxy::runJavaScriptConfirm):
2567         (WebKit::WebPageProxy::runJavaScriptPrompt):
2568         (WebKit::WebPageProxy::unavailablePluginButtonClicked):
2569         (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel):
2570         (WebKit::WebPageProxy::runOpenPanel):
2571         (WebKit::WebPageProxy::printFrame):
2572         (WebKit::WebPageProxy::backForwardGoToItem):
2573         (WebKit::WebPageProxy::backForwardGoToItemShared):
2574         (WebKit::WebPageProxy::learnWord):
2575         (WebKit::WebPageProxy::ignoreWord):
2576         (WebKit::WebPageProxy::didReceiveEvent):
2577         (WebKit::WebPageProxy::editingRangeCallback):
2578         (WebKit::WebPageProxy::rectForCharacterRangeCallback):
2579         (WebKit::WebPageProxy::focusedFrameChanged):
2580         (WebKit::WebPageProxy::frameSetLargestFrameChanged):
2581
2582         (WebKit::WebPageProxy::provisionalProcessDidTerminate):
2583         Cancel the provisiona load and destroy the ProvisionalPageProxy if
2584         the provisional process crashes.
2585
2586         (WebKit::WebPageProxy::resetState):
2587         Drop some code that is no longer needed.
2588
2589         (WebKit::WebPageProxy::creationParameters):
2590         - Move the hasRegisteredServiceWorkers flag initialization from the call site to here now that we have
2591         more than one call site. This was just some bad factoring.
2592         - Take the process in parameter now that we page can be associated with several processes at a time.
2593
2594         (WebKit::WebPageProxy::exceededDatabaseQuota):
2595         (WebKit::WebPageProxy::requestGeolocationPermissionForFrame):
2596         (WebKit::WebPageProxy::requestUserMediaPermissionForFrame):
2597         (WebKit::WebPageProxy::enumerateMediaDevicesForFrame):
2598         (WebKit::WebPageProxy::startURLSchemeTask):
2599         (WebKit::WebPageProxy::startURLSchemeTaskShared):
2600         (WebKit::WebPageProxy::stopURLSchemeTask):
2601         (WebKit::WebPageProxy::loadSynchronousURLSchemeTask):
2602         (WebKit::WebPageProxy::checkURLReceivedFromCurrentOrPreviousWebProcess):
2603         (WebKit::WebPageProxy::willAcquireUniversalFileReadSandboxExtension):
2604         * UIProcess/WebPageProxy.h:
2605         (WebKit::WebPageProxy::visitedLinkStore):
2606         (WebKit::WebPageProxy::provisionalPageProxy const):
2607
2608         * UIProcess/WebProcessProxy.cpp:
2609         (WebKit::WebProcessProxy::hasProvisionalPageWithID const):
2610         (WebKit::WebProcessProxy::updateBackForwardItem):
2611         (WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
2612         (WebKit::WebProcessProxy::didFinishLaunching):
2613         (WebKit::WebProcessProxy::canTerminateChildProcess):
2614         * UIProcess/WebProcessProxy.h:
2615         (WebKit::WebProcessProxy::addProvisionalPageProxy):
2616         (WebKit::WebProcessProxy::removeProvisionalPageProxy):
2617         Before updating a BackForwardListItem, we normally make sure the process has a WebPageProxy with the
2618         item's pageID. We have to tweak the logic because there may now be no WebPageProxy with this pageID
2619         associated with this process yet, because it is still a ProvisionalPageProxy.        
2620
2621         * UIProcess/WebURLSchemeHandler.cpp:
2622         (WebKit::WebURLSchemeHandler::startTask):
2623         * UIProcess/WebURLSchemeHandler.h:
2624         * UIProcess/WebURLSchemeTask.cpp:
2625         (WebKit::WebURLSchemeTask::create):
2626         (WebKit::WebURLSchemeTask::WebURLSchemeTask):
2627         (WebKit::WebURLSchemeTask::didPerformRedirection):
2628         (WebKit::WebURLSchemeTask::didReceiveResponse):
2629         (WebKit::WebURLSchemeTask::didReceiveData):
2630         (WebKit::WebURLSchemeTask::didComplete):
2631         (WebKit::WebURLSchemeTask::pageDestroyed):
2632         * UIProcess/WebURLSchemeTask.h:
2633         Pass the process when constructing a WebURLSchemeTask and store it as a data member in addition to
2634         the page. This is necessary now that a WebPageProxy can be associated with several WebProcesses.
2635
2636         * UIProcess/ios/ViewGestureControllerIOS.mm:
2637         (WebKit::ViewGestureController::endSwipeGesture):
2638         Use the provisional drawing area to display the swipe snapshot as it may differ from the one currently
2639         associated with the page in case of process swap.
2640
2641         * WebKit.xcodeproj/project.pbxproj:
2642         Add ProvisionalPageProxy class.
2643
2644         * WebProcess/WebPage/WebFrame.cpp:
2645         (WebKit::toPolicyAction):
2646         (WebKit::WebFrame::didReceivePolicyDecision):
2647         * WebProcess/WebPage/WebPage.cpp:
2648         (WebKit::m_shouldAttachDrawingAreaOnPageTransition):
2649         (WebKit::WebPage::reinitializeWebPage):
2650         (WebKit::WebPage::didReceivePolicyDecision):
2651         Stop dealing with WebPolicyAction::Suspend as it no longer exists.
2652
2653         (WebKit::WebPage::didCompletePageTransition):
2654
2655         (WebKit::WebPage::setIsSuspended):
2656         Suspend the Page when setIsSuspended(true) is called, now that there is no longer a WebPolicyAction::Suspend.
2657         setIsSuspended(true) IPC is sent when we actually commit the provisional page.
2658
2659         * WebProcess/WebPage/WebPage.h:
2660
2661 2019-01-16  Tim Horton  <timothy_horton@apple.com>
2662
2663         Frequent null-deref under TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded()
2664         https://bugs.webkit.org/show_bug.cgi?id=193468
2665         <rdar://problem/38645869>
2666
2667         Reviewed by Zalan Bujtas.
2668
2669         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2670         (WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):
2671         Adjust the null-check a bit; Zalan pointed out that the layout could
2672         be responsible for the Frame/RenderView going away, so we should bail
2673         *after* layout, not before.
2674
2675 2019-01-15  Fujii Hironori  <Hironori.Fujii@sony.com>
2676
2677         Unreviewed WinCairo build fix.
2678
2679         * WebProcess/WebPage/WebPageInspectorTargetController.cpp:
2680         (WebKit::WebPageInspectorTargetController::connectInspector): Use 'auto' instead of unprefixed InspectorTarget.
2681         (WebKit::WebPageInspectorTargetController::disconnectInspector): Ditto.
2682         (WebKit::WebPageInspectorTargetController::sendMessageToTargetBackend): Ditto.
2683
2684 2019-01-15  Alex Christensen  <achristensen@webkit.org>
2685
2686         Reduce use of NetworkStorageSession::defaultStorageSession in WebCore
2687         https://bugs.webkit.org/show_bug.cgi?id=193368
2688
2689         Reviewed by Geoff Garen.
2690
2691         * WebProcess/Plugins/PluginView.cpp:
2692         (WebKit::PluginView::getAuthenticationInfo):
2693
2694 2019-01-15  Alex Christensen  <achristensen@webkit.org>
2695
2696         Remove more NetworkProcess::singleton use
2697         https://bugs.webkit.org/show_bug.cgi?id=193484
2698
2699         Reviewed by Geoffrey Garen.
2700
2701         This removes the use of NetworkProcess::singleton in the LegacyCustomProtocolManager.
2702         This is the kind of awful duct tape code that keeps me awake at night, but it's necessary
2703         because we can't quite remove LegacyCustomProtocolManager yet but we need to allow more than
2704         one NetworkProcess object.  To make it work well enough until we remove LegacyCustomProtocolManager,
2705         use the last NetworkProcess object that has been created.
2706
2707         * NetworkProcess/CustomProtocols/Cocoa/LegacyCustomProtocolManagerCocoa.mm:
2708         (newestNetworkProcess):
2709         (LegacyCustomProtocolManager::networkProcessCreated):
2710         (+[WKCustomProtocol canInitWithRequest:]):
2711         (-[WKCustomProtocol initWithRequest:cachedResponse:client:]):
2712         (-[WKCustomProtocol startLoading]):
2713         (-[WKCustomProtocol stopLoading]):
2714         * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.cpp:
2715         (WebKit::LegacyCustomProtocolManager::LegacyCustomProtocolManager):
2716         (WebKit::LegacyCustomProtocolManager::startLoading):
2717         (WebKit::LegacyCustomProtocolManager::stopLoading):
2718         * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.h:
2719         * NetworkProcess/NetworkProcess.cpp:
2720         (WebKit::NetworkProcess::NetworkProcess):
2721
2722 2019-01-15  Alex Christensen  <achristensen@webkit.org>
2723
2724         Fix WinCairo build after r240014
2725         https://bugs.webkit.org/show_bug.cgi?id=161106
2726
2727         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
2728
2729 2019-01-15  Ryosuke Niwa  <rniwa@webkit.org>
2730
2731         VisualViewport API should be updated upon opening of keyboard
2732         https://bugs.webkit.org/show_bug.cgi?id=193475
2733
2734         Reviewed by Simon Fraser.
2735
2736         The bug was caused by the changes to unobscuredContentRectRespectingInputViewBounds not updating the visual viewport
2737         unless it caused a layout to happen. Added a code to update the visual viewport in WebPage::updateVisibleContentRects.
2738
2739         Also fixed the bug that VisibleContentRectUpdateInfo::operator== was not checking differences in
2740         unobscuredContentRectRespectingInputViewBounds which resulted in the visual viewport override not getting updated
2741         while the keyboard is getting brought up.
2742
2743         * Shared/VisibleContentRectUpdateInfo.h:
2744         (WebKit::operator==):
2745         * WebProcess/WebPage/ios/WebPageIOS.mm:
2746         (WebKit::WebPage::updateVisibleContentRects):
2747
2748 2019-01-15  Megan Gardner  <megan_gardner@apple.com>
2749
2750         Add Reveal support in iOSMac
2751         https://bugs.webkit.org/show_bug.cgi?id=193408
2752         <rdar://problem/47300699>
2753
2754         Reviewed by Tim Horton.
2755
2756         Add calls to DictionaryLookup from the appropriate places.
2757
2758         * UIProcess/PageClient.h:
2759         * UIProcess/ios/PageClientImplIOS.h:
2760         * UIProcess/ios/PageClientImplIOS.mm:
2761         (WebKit::PageClientImpl::didPerformDictionaryLookup):
2762         * UIProcess/ios/WebPageProxyIOS.mm:
2763         (WebKit::WebPageProxy::didPerformDictionaryLookup):
2764         * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
2765         (WebKit::WebPage::dictionaryPopupInfoForRange):
2766
2767 2019-01-15  Claudio Saavedra  <csaavedra@igalia.com>
2768
2769         [SOUP] Remove usage of NetworkProcess::singleton()
2770         https://bugs.webkit.org/show_bug.cgi?id=193444
2771
2772         Reviewed by Michael Catanzaro.
2773
2774         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
2775         (WebKit::NetworkDataTaskSoup::download):
2776         (WebKit::NetworkDataTaskSoup::didWriteDownload):
2777         (WebKit::NetworkDataTaskSoup::didFinishDownload):
2778         (WebKit::NetworkDataTaskSoup::didFailDownload):
2779         * NetworkProcess/soup/NetworkSessionSoup.cpp:
2780         (WebKit::NetworkSessionSoup::NetworkSessionSoup):
2781
2782 2019-01-15  Eric Carlson  <eric.carlson@apple.com>
2783
2784         Fix incorrect ASSERT added in r239840
2785         https://bugs.webkit.org/show_bug.cgi?id=193466
2786         <rdar://problem/47095142>
2787
2788         Reviewed by Youenn Fablet.
2789
2790         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
2791         (WebKit::UserMediaCaptureManager::Source::Source):
2792
2793 2019-01-15  Tim Horton  <timothy_horton@apple.com>
2794
2795         Frequent null-deref under TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded()
2796         https://bugs.webkit.org/show_bug.cgi?id=193468
2797         <rdar://problem/38645869>
2798
2799         Reviewed by Beth Dakin.
2800
2801         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2802         (WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):
2803         I'm not sure why this got *worse*, but we should null-check RenderView.
2804         It's OK to bail from scaleViewToFitDocumentIfNeeded, we'll re-do it
2805         the next time we paint (which will surely happen if we gain a RenderView).
2806
2807 2019-01-15  Chris Dumez  <cdumez@apple.com>
2808
2809         Unreviewed, rolling out r239993, r239995, r239997, and
2810         r239999.
2811
2812         Caused assertions under
2813         ViewGestureController::disconnectFromProcess()
2814
2815         Reverted changesets:
2816
2817         "Regression(PSON) View becomes blank after click a cross-site
2818         download link"
2819         https://bugs.webkit.org/show_bug.cgi?id=193361
2820         https://trac.webkit.org/changeset/239993
2821
2822         "Unreviewed iOS build fix after r239993."
2823         https://trac.webkit.org/changeset/239995
2824
2825         "Fix iOS build after r239993"
2826         https://bugs.webkit.org/show_bug.cgi?id=193361
2827         https://trac.webkit.org/changeset/239997
2828
2829         "Unreviewed, revert part of r239997 as it is not needed to fix
2830         the build."
2831         https://trac.webkit.org/changeset/239999
2832
2833 2019-01-15  Alex Christensen  <achristensen@webkit.org>
2834
2835         Stop using CookiesStrategy
2836         https://bugs.webkit.org/show_bug.cgi?id=161106
2837
2838         Reviewed by Don Olmstead and Antti Koivisto.
2839
2840         * NetworkProcess/NetworkProcessPlatformStrategies.cpp:
2841         (WebKit::NetworkProcessPlatformStrategies::createCookiesStrategy): Deleted.
2842         * NetworkProcess/NetworkProcessPlatformStrategies.h:
2843         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
2844         * Scripts/webkit/messages.py:
2845         * Sources.txt:
2846         * WebKit.xcodeproj/project.pbxproj:
2847         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
2848         (WebKit::WebAutomationSessionProxy::getCookiesForFrame):
2849         (WebKit::WebAutomationSessionProxy::deleteCookie):
2850         * WebProcess/Plugins/PluginView.cpp:
2851         (WebKit::PluginView::cookiesForURL):
2852         (WebKit::PluginView::setCookiesForURL):
2853         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2854         (WebKit::WebPlatformStrategies::createCookiesStrategy): Deleted.
2855         (WebKit::WebPlatformStrategies::cookiesForDOM): Deleted.
2856         (WebKit::WebPlatformStrategies::setCookiesFromDOM): Deleted.
2857         (WebKit::WebPlatformStrategies::cookiesEnabled): Deleted.
2858         (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue): Deleted.
2859         (WebKit::WebPlatformStrategies::getRawCookies): Deleted.
2860         (WebKit::WebPlatformStrategies::deleteCookie): Deleted.
2861         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
2862         * WebProcess/WebPage/WebCookieJar.cpp: Added.
2863         (WebKit::WebCookieJar::cookies const):
2864         (WebKit::WebCookieJar::setCookies):
2865         (WebKit::WebCookieJar::cookiesEnabled const):
2866         (WebKit::WebCookieJar::cookieRequestHeaderFieldValue const):
2867         (WebKit::WebCookieJar::getRawCookies const):
2868         (WebKit::WebCookieJar::deleteCookie):
2869         * WebProcess/WebPage/WebCookieJar.h: Added.
2870         * WebProcess/WebPage/WebPage.cpp:
2871         (WebKit::m_shouldAttachDrawingAreaOnPageTransition):
2872
2873 2019-01-15  Per Arne Vollan  <pvollan@apple.com>
2874
2875         Remove reporting for iOS mach lookups confirmed in-use
2876         https://bugs.webkit.org/show_bug.cgi?id=193455
2877         <rdar://problem/47259551>
2878
2879         Reviewed by Brent Fulgham.
2880
2881         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2882
2883 2019-01-15  Tim Horton  <timothy_horton@apple.com>
2884
2885         Cannot tab out of WKWebView on macOS
2886         https://bugs.webkit.org/show_bug.cgi?id=161448
2887         <rdar://problem/28100085>
2888
2889         Reviewed by Dean Jackson.
2890
2891         * UIProcess/WebPageProxy.cpp:
2892         (WebKit::WebPageProxy::takeFocus):
2893         If the UIDelegate doesn't implement takeFocus, provide a simple default
2894         implementation that just uses AppKit's key view loop to move the focus.
2895
2896         * UIProcess/API/APIUIClient.h:
2897         (API::UIClient::takeFocus):
2898         * UIProcess/API/C/WKPage.cpp:
2899         (WKPageSetPageUIClient):
2900         * UIProcess/Cocoa/UIDelegate.h:
2901         * UIProcess/Cocoa/UIDelegate.mm:
2902         (WebKit::UIDelegate::UIClient::takeFocus):
2903         Make API::UIClient's takeFocus return a bool indicating whether the
2904         client implements it or not.
2905
2906         * UIProcess/PageClient.h:
2907         * UIProcess/mac/PageClientImplMac.h:
2908         * UIProcess/mac/PageClientImplMac.mm:
2909         (WebKit::PageClientImpl::takeFocus):
2910         Plumb takeFocus to WebViewImpl.
2911
2912         * UIProcess/Cocoa/WebViewImpl.h:
2913         * UIProcess/Cocoa/WebViewImpl.mm:
2914         (WebKit::WebViewImpl::takeFocus):
2915         Borrow the relevant portion of WebKitLegacy's implementation of takeFocus,
2916         shifting focus to the next/previous key view in the window.
2917
2918 2019-01-15  Youenn Fablet  <youenn@apple.com>
2919
2920         Remove the specific handling of ephemeral sessions from CacheStorage::Engine::from
2921         https://bugs.webkit.org/show_bug.cgi?id=193400
2922
2923         Reviewed by Alex Christensen.
2924
2925         It is no longer needed as we correctly handle ephemeral sessions removal.
2926
2927         * NetworkProcess/cache/CacheStorageEngine.cpp:
2928         (WebKit::CacheStorage::Engine::from):
2929
2930 2019-01-15  Alex Christensen  <achristensen@webkit.org>
2931
2932         Fix iOS build after r239993
2933         https://bugs.webkit.org/show_bug.cgi?id=193361
2934
2935         * UIProcess/ProvisionalPageProxy.h:
2936         * UIProcess/SuspendedPageProxy.h:
2937
2938 2019-01-15  Per Arne Vollan  <pvollan@apple.com>
2939
2940         [macOS] Adjust logging policy in WebKit's sandbox
2941         https://bugs.webkit.org/show_bug.cgi?id=193454
2942         <rdar://problem/47256325>
2943
2944         Reviewed by Brent Fulgham.
2945
2946         * WebProcess/com.apple.WebProcess.sb.in:
2947
2948 2019-01-15  Chris Dumez  <cdumez@apple.com>
2949
2950         Unreviewed iOS build fix after r239993.
2951
2952         * UIProcess/SuspendedPageProxy.h:
2953
2954 2019-01-15  Per Arne Vollan  <pvollan@apple.com>
2955
2956         Add allow directive for MTLCompilerService.xpc to PluginProcess and WebContent
2957         https://bugs.webkit.org/show_bug.cgi?id=193453
2958         <rdar://problem/47268166>
2959
2960         Reviewed by Brent Fulgham.
2961
2962         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
2963         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2964         * WebProcess/com.apple.WebProcess.sb.in:
2965
2966 2019-01-15  Chris Dumez  <cdumez@apple.com>
2967
2968         Regression(PSON) View becomes blank after click a cross-site download link
2969         https://bugs.webkit.org/show_bug.cgi?id=193361
2970         <rdar://problem/47099573>
2971
2972         Reviewed by Geoff Garen.
2973
2974         The issue tracked by rdar://problem/47099573 is that a provisional load may get
2975         canceled (or converted into a download) *after* we've decided to process-swap.
2976         In such cases, the view should keep displaying the current site and it should
2977         still be interactive. However, with the previous PSON model, the view (pageProxy)
2978         would have already swapped to the new process and would end up displaying the
2979         initially empty document.
2980
2981         To address the issue, this patch introduces the concept of a provisional load
2982         in the UIProcess, handled by a ProvisionalPageProxy which has its own privisional
2983         process. The WebPageProxy owns the ProvisionalPageProxy but we do not commit the
2984         provisional page until after the load was committed in the new process. This means
2985         that the view / WebPageProxy keeps using the old process and displays the current
2986         content until a load has committed in the provisional page. If no load commits
2987         in the provisional process (e.g. because the load is cancelled or converted into
2988         a download), then we merely destroy the ProvisionalPageProxy and terminate its
2989         process, without impacting the WebPageProxy.
2990
2991         * Shared/WebPageCreationParameters.cpp:
2992         (WebKit::WebPageCreationParameters::encode const):
2993         (WebKit::WebPageCreationParameters::decode):
2994         * Shared/WebPageCreationParameters.h:
2995         Rename isSwapFromSuspended to isProcessSwap for clarity as we always want to
2996         delay attaching the drawing area in case of a process-swap, no matter what
2997         now that the previous process is kept alive until the provisional load is
2998         committed in the new process.
2999
3000         * Shared/WebPolicyAction.h:
3001         Drop Suspend policy action. At decidePolicyForNavigationAction time, in case of
3002         process-swap, we now tell the previous process to simply ignore the load, while
3003         we create a ProvisionalPageProxy to do the new load in a new process.
3004         Suspension of the previous page in the old process, happens later, when a load
3005         is actually committed in the new process.
3006
3007         * Sources.txt:
3008         Add new ProvisionalPageProxy file.
3009
3010         * UIProcess/API/Cocoa/WKWebView.mm:
3011         (-[WKWebView _killWebContentProcessAndResetState]):
3012         When calling _killWebContentProcessAndResetState on a WKWebView, kill both the current
3013         process and the provisional one, to maintain previous behavior in our API tests.
3014
3015         * UIProcess/PageClient.h:
3016         Tiny build fix.
3017
3018         * UIProcess/ProvisionalPageProxy.cpp: Added.
3019         (WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
3020         (WebKit::ProvisionalPageProxy::~ProvisionalPageProxy):
3021         (WebKit::ProvisionalPageProxy::takeDrawingArea):
3022         (WebKit::ProvisionalPageProxy::cancel):
3023         (WebKit::ProvisionalPageProxy::initializeWebPage):
3024         (WebKit::ProvisionalPageProxy::loadDataWithNavigation):
3025         (WebKit::ProvisionalPageProxy::loadRequestWithNavigation):
3026         (WebKit::ProvisionalPageProxy::goToBackForwardItem):
3027         (WebKit::ProvisionalPageProxy::didCreateMainFrame):
3028         (WebKit::ProvisionalPageProxy::didStartProvisionalLoadForFrame):
3029         (WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame):
3030         (WebKit::ProvisionalPageProxy::didCommitLoadForFrame):
3031         (WebKit::ProvisionalPageProxy::didReceiveMessage):
3032         (WebKit::ProvisionalPageProxy::didReceiveSyncMessage):
3033         * UIProcess/ProvisionalPageProxy.h: Added.
3034         (WebKit::ProvisionalPageProxy::page):
3035         (WebKit::ProvisionalPageProxy::mainFrame const):
3036         (WebKit::ProvisionalPageProxy::process):
3037         (WebKit::ProvisionalPageProxy::processSwapRequestedByClient const):
3038         (WebKit::ProvisionalPageProxy::navigationID const):
3039         Add new ProvisionalPageProxy class to wrap the provisional load in the new process
3040         after a swap. The provisional page is owned by the WebPageProxy and we only commit
3041         the provisional page when the load is committed. Until then, the WebPageProxy keeps
3042         using the old process and displaying the current content.
3043
3044         * UIProcess/SuspendedPageProxy.cpp:
3045         (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
3046         (WebKit::SuspendedPageProxy::unsuspend):
3047         (WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
3048         Unregister the SuspendedPageProxy as an IPC message receiver a little bit earlier
3049         when we're going to unsuspend it. This avoids conflicting with the ProvisionalPageProxy
3050         which tries to register itself as an IPC message receiver for the same pageID when
3051         a process-swap occurs and we're switching to a suspended page.
3052
3053         * UIProcess/WebFrameProxy.cpp:
3054         (WebKit::WebFrameProxy::isMainFrame const):
3055         WebFrameProxy::isMainFrame() relies on checking that the frame is the WebPageProxy's m_mainFrame.
3056         Now that the WebPageProxy can have a ProvisionalPageProxy, also check if it is the ProvisionalPageProxy's
3057         m_mainFrame to maintain previous behavior.
3058
3059         * UIProcess/WebPageProxy.cpp:
3060         (WebKit::WebPageProxy::swapToWebProcess):
3061         swapToWebProcess() no longer takes care of unsuspending the SuspendedPage because we now call swapToWebProcess()
3062         later, when a load is actually committed in the provisional page / process. swapToWebProcess() now also needs
3063         to initialize some data members such as the drawing area and the main frame as it is transferring them over from
3064         the ProvisionalPageProxy which started the provisional load.
3065
3066         (WebKit::WebPageProxy::finishAttachingToWebProcess):
3067         We no longer need IsSwapFromSuspended parameter as this is called later now, after a load has actually been
3068         committed in the provisional process.
3069
3070         (WebKit::WebPageProxy::initializeWebPage):
3071         - We no longer need IsSwapFromSuspended parameter as this is called later now, after a load has actually been
3072           committed in the provisional process.
3073         - Factor some code out to WebPageProxy::setDrawingArea() so that it can be shared with swapToWebProcess().
3074
3075         (WebKit::WebPageProxy::loadRequestWithNavigation):
3076         Only call setPendingAPIRequestURL() in loadRequestWithNavigation() only if ShouldTreatAsContinuingLoad is not
3077         Yes. This avoids hitting some assertions as this was already called during the first API call if needed.
3078
3079         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
3080         In case of process swap, tell the previous process to ignore the load instead of suspending it right away.
3081         Suspension now happens later, only if we end up committing the provisional load in the new process.
3082         Also discard the SuspendedPage if it failed to suspend (we only reuse its process in this case). This used
3083         to happen a bit later but it is clearer if we do this as early as possible I think.
3084
3085         (WebKit::WebPageProxy::commitProvisionalPage):
3086         When the load is committed in the new process, we call WebPageProxy::commitProvisionalPage(). It takes care of:
3087         - Actually swapping the WebPageProxy to the new process by calling processDidTerminate() / swapToWebProcess().
3088         - Suspending the current page.
3089         - Letting the client know the load is comitted
3090         - Destroy the ProvisionalPageProxy.
3091         This work used to happen earlier in continueNavigationInNewProcess().
3092
3093         (WebKit::WebPageProxy::continueNavigationInNewProcess):
3094         Moved some of the logic to commitProvisionalPage(). We now merely start the load in a new ProvisionalPageProxy,
3095         without actually having the WebPageProxy switch to the new process yet.
3096
3097         (WebKit::WebPageProxy::didCreateMainFrame):
3098         (WebKit::WebPageProxy::didCreateWindow):
3099         Drop some code that is no longer needed, now that the ProvisionalPageProxy takes care of this.
3100
3101         (WebKit::WebPageProxy::didDestroyNavigation):
3102         On process-swap, when telling the previous process to ignore the load and starting the new load in a new
3103         ProvisionalPageProxy, the previous WebPage attempts to destroy the navigation. In this case, we ignore
3104         the call since the navigation is merely taken over by the ProvisionalPageProxy.
3105
3106         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
3107         Moved some PSON logic to the ProvisionalPageProxy instead.
3108
3109         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
3110         When didFailProvisionalLoadForFrame() is called for a ProvisionalPageProxy, destroy it.
3111
3112         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
3113         (WebKit::WebPageProxy::decidePolicyForResponse):
3114         Capture the process in the lambda, to make sure we send the policy decision to the same process that
3115         asked for it, so as to not get confused by process swaps.
3116
3117         (WebKit::WebPageProxy::resetState):
3118         Drop some code that is no longer needed.
3119
3120         (WebKit::WebPageProxy::creationParameters):
3121         Move the hasRegisteredServiceWorkers flag initialization from the call site to here now that we have
3122         more than one call site. This was just some bad factoring.
3123
3124         (WebKit::WebPageProxy::PageProcessOverride::PageProcessOverride):
3125         (WebKit::WebPageProxy::PageProcessOverride::~PageProcessOverride):
3126         * UIProcess/WebPageProxy.h:
3127         (WebKit::WebPageProxy::temporarilyOverrideProcess):
3128         Add utility class to temporarily override the WebPageProxy's m_process with the provisional one when
3129         the ProvisionalPageProxy interacts with the WebPageProxy.
3130
3131         * UIProcess/WebProcessProxy.cpp:
3132         (WebKit::WebProcessProxy::hasProvisionalPageWithID const):
3133         (WebKit::WebProcessProxy::updateBackForwardItem):
3134         Before updating a BackForwardListItem, we normally make sure the process has a WebPageProxy with the
3135         item's pageID. We have to tweak the logic because there may now be no WebPageProxy with this pageID
3136         associated with this process yet, because it is still a ProvisionalPageProxy.
3137
3138         (WebKit::WebProcessProxy::canTerminateChildProcess):
3139         Do not terminate the WebProcess if there are ProvisionalPageProxy objects using it.
3140
3141         * UIProcess/WebProcessProxy.h:
3142         (WebKit::WebProcessProxy::addProvisionalPageProxy):
3143         (WebKit::WebProcessProxy::removeProvisionalPageProxy):
3144
3145         * WebKit.xcodeproj/project.pbxproj:
3146
3147         * WebProcess/WebPage/WebFrame.cpp:
3148         (WebKit::toPolicyAction):
3149         (WebKit::WebFrame::didReceivePolicyDecision):
3150         Stop dealing with WebPolicyAction::Suspend as it no longer exists.
3151
3152         * WebProcess/WebPage/WebPage.cpp:
3153         (WebKit::WebPage::reinitializeWebPage):
3154         (WebKit::WebPage::didReceivePolicyDecision):
3155
3156         (WebKit::WebPage::setIsSuspended):
3157         Suspend the Page when setIsSuspended(true) is called, now that there is no longer a WebPolicyAction::Suspend.
3158         setIsSuspended(true) IPC is sent when we actually commit the provisional page.
3159
3160         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3161         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
3162
3163 2019-01-15  Brian Burg  <bburg@apple.com>
3164
3165         WebDriver: update Create Window implementation to support newest specification
3166         https://bugs.webkit.org/show_bug.cgi?id=193333
3167         <rdar://problem/45649489>
3168
3169         Reviewed by Carlos Garcia Campos.
3170
3171         Spec link: https://w3c.github.io/webdriver/#create-window
3172
3173         The command as specified returns a value indicating whether the new browsing context
3174         was presented as a new tab or new window. Add a new delegate method to query the current
3175         'presentation' of the browsing context. The presentation can change over time due to
3176         things such as screen orientation, so the value that is returned by the command only
3177         reflects how the browsing context was initially presented to the user.
3178
3179         This is covered by existing WPT and internal tests. More will be added when Selenium
3180         exposes this command in its various bindings.
3181
3182         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
3183         Add new SPI delegate method to query the 'presentation' (tab or window) for an automated WKWebView.
3184
3185         * UIProcess/API/APIAutomationSessionClient.h:
3186         (API::AutomationSessionClient::currentPresentationOfPage):
3187         * UIProcess/Cocoa/AutomationSessionClient.h:
3188         * UIProcess/Cocoa/AutomationSessionClient.mm:
3189         (WebKit::AutomationSessionClient::AutomationSessionClient):
3190         (WebKit::toImpl):
3191         (WebKit::AutomationSessionClient::currentPresentationOfPage):
3192         * UIProcess/Automation/WebAutomationSession.cpp:
3193         (WebKit::toProtocol):
3194         (WebKit::WebAutomationSession::createBrowsingContext):
3195         Add plumbing between ObjC delegate and C++.
3196
3197         * UIProcess/Automation/Automation.json:
3198         Include the initial presentation in the createBrowsingContext command result.
3199
3200 2019-01-14  Alex Christensen  <achristensen@webkit.org>
3201
3202         Split headerValueForVary into specialized functions for NetworkProcess and WebProcess/WebKitLegacy
3203         https://bugs.webkit.org/show_bug.cgi?id=193429
3204
3205         Reviewed by Joseph Pecoraro.
3206
3207         * NetworkProcess/cache/NetworkCache.cpp:
3208         (WebKit::NetworkCache::makeUseDecision):
3209         (WebKit::NetworkCache::Cache::retrieve):
3210         (WebKit::NetworkCache::Cache::makeEntry):
3211         (WebKit::NetworkCache::Cache::makeRedirectEntry):
3212         (WebKit::NetworkCache::Cache::update):
3213
3214 2019-01-14  Tim Horton  <timothy_horton@apple.com>
3215
3216         Fix a style mistake in PageClientImplMac
3217
3218         * UIProcess/mac/PageClientImplMac.h:
3219         Somehow these methods ended up above the members.
3220
3221 2019-01-14  Per Arne Vollan  <pvollan@apple.com>
3222
3223         [macOS] Remove reporting for mach lookups confirmed in-use
3224         https://bugs.webkit.org/show_bug.cgi?id=193415
3225         <rdar://problem/47266542>
3226
3227         Reviewed by Brent Fulgham.
3228
3229         Also, start denying the services which have not been confirmed to be in use.
3230
3231         * WebProcess/com.apple.WebProcess.sb.in:
3232
3233 2019-01-14  Commit Queue  <commit-queue@webkit.org>
3234
3235         Unreviewed, rolling out r239901, r239909, r239910, r239912,
3236         r239913, and r239914.
3237         https://bugs.webkit.org/show_bug.cgi?id=193407
3238
3239         These revisions caused an internal failure (Requested by
3240         Truitt on #webkit).
3241
3242         Reverted changesets:
3243
3244         "[Cocoa] Avoid importing directly from subumbrella frameworks"
3245         https://bugs.webkit.org/show_bug.cgi?id=186016
3246         https://trac.webkit.org/changeset/239901
3247
3248         "Tried to fix USE(APPLE_INTERNAL_SDK) builds after r239901."
3249         https://trac.webkit.org/changeset/239909
3250
3251         "Tried to fix the build."
3252         https://trac.webkit.org/changeset/239910
3253
3254         "Fixed iOS builds after r239910."
3255         https://trac.webkit.org/changeset/239912
3256
3257         "More build fixing."
3258         https://trac.webkit.org/changeset/239913
3259
3260         "Tried to fix USE(APPLE_INTERNAL_SDK) 32-bit builds."
3261         https://trac.webkit.org/changeset/239914
3262
3263 2019-01-14  Mark Lam  <mark.lam@apple.com>
3264
3265         Re-enable ability to build --cloop builds.
3266         https://bugs.webkit.org/show_bug.cgi?id=192955
3267         <rdar://problem/46882363>
3268
3269         Reviewed by Saam barati and Keith Miller.
3270
3271         * Configurations/FeatureDefines.xcconfig:
3272
3273 2019-01-14  Alex Christensen  <achristensen@webkit.org>
3274
3275         Remove unused networking entitlement from iOS WebProcess entitlements
3276         https://bugs.webkit.org/show_bug.cgi?id=193267
3277
3278         Reviewed by Dean Jackson.
3279
3280         * Configurations/WebContent-iOS.entitlements:
3281         This gave access to VPN stuff.  It's not needed any more.
3282
3283 2019-01-14  Youenn Fablet  <youenn@apple.com>
3284
3285         Enable MDNS ICE candidate support by default
3286         https://bugs.webkit.org/show_bug.cgi?id=193358
3287
3288         Reviewed by Geoffrey Garen.
3289
3290         * Shared/WebPreferences.yaml:
3291
3292 2019-01-11  Matt Rajca  <mrajca@apple.com>
3293
3294         Expose preference for site-specific quirks on iOS
3295         https://bugs.webkit.org/show_bug.cgi?id=193353
3296
3297         Reviewed by Dean Jackson.
3298
3299         * UIProcess/API/Cocoa/WKPreferences.mm:
3300         (-[WKPreferences _setNeedsSiteSpecificQuirks:]):
3301         (-[WKPreferences _needsSiteSpecificQuirks]):
3302         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
3303
3304 2019-01-14  Wenson Hsieh  <wenson_hsieh@apple.com>
3305
3306         [iOS] Expose SPI to access the current sentence boundary and selection state
3307         https://bugs.webkit.org/show_bug.cgi?id=193398
3308         <rdar://problem/45893108>
3309
3310         Reviewed by Dean Jackson.
3311
3312         Expose SPI on WKWebView for internal clients to grab information about attributes at the current selection; so
3313         far, this only includes whether the selection is a caret or a range, and whether or not the start of the
3314         selection is at the start of a new sentence.
3315
3316         Test: EditorStateTests.ObserveSelectionAttributeChanges
3317
3318         * Shared/EditorState.cpp:
3319         (WebKit::EditorState::PostLayoutData::encode const):
3320         (WebKit::EditorState::PostLayoutData::decode):
3321         * Shared/EditorState.h:
3322
3323         Add a new bit in EditorState on iOS to compute whether or not the start of the selection is at the start of a
3324         new sentence. This is computed and set when sending post-layout data in `WebPageIOS.mm`.
3325
3326         * UIProcess/API/Cocoa/WKWebView.mm:
3327         (selectionAttributes):
3328         (-[WKWebView _didChangeEditorState]):
3329         (-[WKWebView _selectionAttributes]):
3330
3331         Make the new SPI property support KVO by invoking `-willChangeValueForKey:` and `-didChangeValueForKey:`
3332         whenever the selection attributes change.
3333
3334         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3335         * WebProcess/WebPage/ios/WebPageIOS.mm:
3336         (WebKit::WebPage::platformEditorState const):
3337
3338 2019-01-14  Carlos Garcia Campos  <cgarcia@igalia.com>
3339
3340         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.23.3 release
3341
3342         * gtk/NEWS: Add release notes for 2.23.3.
3343
3344 2019-01-13  Dan Bernstein  <mitz@apple.com>
3345
3346         Fixed iOS builds after r239910.
3347
3348         * Platform/spi/ios/PDFKitSPI.h:
3349
3350 2019-01-13  Dan Bernstein  <mitz@apple.com>
3351
3352         Tried to fix the build.
3353
3354         * Platform/spi/ios/PDFKitSPI.h:
3355
3356 2019-01-13  Dan Bernstein  <mitz@apple.com>
3357
3358         Tried to fix USE(APPLE_INTERNAL_SDK) builds after r239901.
3359
3360         Patch by Keith Rollin.
3361
3362         * Platform/IPC/mac/ConnectionMac.mm:
3363         * Shared/mac/ChildProcessMac.mm:
3364         (WebKit::ChildProcess::launchServicesCheckIn):
3365
3366 2019-01-12  Timothy Hatcher  <timothy@apple.com>
3367
3368         Have prefers-color-scheme: light always match on macOS versions before Mojave.
3369         https://bugs.webkit.org/show_bug.cgi?id=191655
3370         rdar://problem/46074680
3371
3372         Reviewed by Megan Gardner.
3373
3374         * Configurations/FeatureDefines.xcconfig: ENABLE_DARK_MODE_CSS_macosx for all OS versions.
3375         * UIProcess/Cocoa/WebViewImpl.mm:
3376         (WebKit::WebViewImpl::effectiveAppearanceIsDark):
3377         * UIProcess/RemoteLayerTree/mac/ScrollerMac.mm:
3378
3379 2019-01-12  Dan Bernstein  <mitz@apple.com>
3380
3381         [Cocoa] Avoid importing directly from subumbrella frameworks
3382         https://bugs.webkit.org/show_bug.cgi?id=186016
3383         <rdar://problem/40591038>
3384
3385         Reviewed by Sam Weinig.
3386
3387         * Configurations/BaseTarget.xcconfig: Removed -iframework options from OTHER_CFLAGS and
3388           OTHER_CPLUSPLUSFLAGS.
3389         * UIProcess/Automation/mac/WebAutomationSessionMac.mm: Import Carbon.h instead of an
3390           HIToolbox header.
3391         * UIProcess/Cocoa/WebViewImpl.mm: Ditto.
3392         * UIProcess/mac/WKPrintingView.mm: Import Quartz.h instead of a PDFKit header.
3393         * UIProcess/mac/WKTextInputWindowController.mm: Import Carbon.h instead of an HIToolbox
3394           header.
3395         * WebProcess/Plugins/PDF/PDFAnnotationTextWidgetDetails.h: Import Quartz.h instead of a
3396           PDFKit header.
3397         * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h: Ditto.
3398         * WebProcess/Plugins/PDF/PDFPlugin.mm: Ditto.
3399         * WebProcess/Plugins/PDF/PDFPluginAnnotation.mm: Ditto.
3400         * WebProcess/Plug