c6d17bbf70a8c724db5ab05db7b200321e6f676e
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2019-01-10  Jiewen Tan  <jiewen_tan@apple.com>
2
3         [WebAuthN] Change the nonce in the CTAP kInit command to weak random values
4         https://bugs.webkit.org/show_bug.cgi?id=192061
5         <rdar://problem/46471091>
6
7         Reviewed by Chris Dumez.
8
9         Change the nonce in the CTAP kInit command to weak random values as the nonce is mainly
10         for being a probabilistically unique global identifier for hand shakes, instead of
11         preventing replay attacks. Otherwise, it might exhaust system entropy unnecessarily.
12
13         The patch also removes all logging when debugging the test case flakiness.
14
15         * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
16         (WebKit::AuthenticatorManager::respondReceived):
17         (WebKit::AuthenticatorManager::initTimeOutTimer):
18         (WebKit::AuthenticatorManager::timeOutTimerFired):
19         * UIProcess/WebAuthentication/Cocoa/HidService.mm:
20         (WebKit::HidService::deviceAdded):
21         * UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.cpp:
22         (WebKit::MockAuthenticatorManager::respondReceivedInternal):
23         * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
24         (WebKit::MockHidConnection::send):
25         * UIProcess/WebAuthentication/fido/CtapHidAuthenticator.cpp:
26         (WebKit::CtapHidAuthenticator::makeCredential):
27         (WebKit::CtapHidAuthenticator::getAssertion):
28         * UIProcess/WebAuthentication/fido/CtapHidDriver.cpp:
29         (WebKit::CtapHidDriver::Worker::write):
30         (WebKit::CtapHidDriver::Worker::read):
31         (WebKit::CtapHidDriver::Worker::returnMessage):
32         (WebKit::CtapHidDriver::transact):
33         (WebKit::CtapHidDriver::continueAfterChannelAllocated):
34         (WebKit::CtapHidDriver::continueAfterResponseReceived):
35
36 2019-01-10  Timothy Hatcher  <timothy@apple.com>
37
38         Add WKBundlePage SPI to temporarily force light or dark appearance on a page.
39         https://bugs.webkit.org/show_bug.cgi?id=193327
40         rdar://problem/47093222
41
42         Reviewed by Tim Horton.
43
44         Tests: WebKit.ForceLightAppearanceInBundle API Test
45
46         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
47         (WKBundlePageSetUseDarkAppearance): Added.
48         (WKBundlePageIsUsingDarkAppearance): Added.
49         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
50
51 2019-01-10  Eric Carlson  <eric.carlson@apple.com>
52
53         DeviceID hash salt manager can be NULL
54         https://bugs.webkit.org/show_bug.cgi?id=193334
55         <rdar://problem/47179650>
56
57         Reviewed by Youenn Fablet.
58
59         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
60         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): No need to
61         NULL-check websiteDataStore.deviceIdHashSaltStorage, it is a Ref.
62         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Ditto.
63         (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo): Ditto.
64         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Ditto.
65
66         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
67         (WebKit::WebsiteDataStore::WebsiteDataStore): m_deviceIdHashSaltStorage is a Ref.
68         (WebKit::WebsiteDataStore::fetchDataAndApply): Ditto.
69         (WebKit::WebsiteDataStore::removeData): Ditto.
70         * UIProcess/WebsiteData/WebsiteDataStore.h:
71         (WebKit::WebsiteDataStore::deviceIdHashSaltStorage): Ditto.
72
73 2019-01-10  Per Arne Vollan  <pvollan@apple.com>
74
75         [macOS] Add name of IORegistry key in sandbox.
76         https://bugs.webkit.org/show_bug.cgi?id=193335
77         <rdar://problem/47184951>
78
79         Reviewed by Alexey Proskuryakov.
80
81         The property IOGVAHEVCDecodeCapabilities was added in https://bugs.webkit.org/show_bug.cgi?id=193324.
82         Also, the property IOGVAHEVCEncodeCapabilities needs to be added.
83
84         * WebProcess/com.apple.WebProcess.sb.in:
85
86 2019-01-10  Zalan Bujtas  <zalan@apple.com>
87
88         REGRESSION (r237658): Tap highlight limits cause the highlight to no longer show with legitimate button sizes
89         https://bugs.webkit.org/show_bug.cgi?id=193294
90         <rdar://problem/46006678>
91
92         Reviewed by Simon Fraser.
93
94         Input type elements should always paint tap highlight (ignore size heuristic). 
95
96         * UIProcess/PageClient.h:
97         * UIProcess/WebPageProxy.h:
98         * UIProcess/WebPageProxy.messages.in:
99         * UIProcess/ios/PageClientImplIOS.h:
100         * UIProcess/ios/PageClientImplIOS.mm:
101         (WebKit::PageClientImpl::didGetTapHighlightGeometries):
102         * UIProcess/ios/WKContentViewInteraction.h:
103         * UIProcess/ios/WKContentViewInteraction.mm:
104         (-[WKContentView _showTapHighlight]):
105         (-[WKContentView _didGetTapHighlightForRequest:color:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:nodeHasBuiltInClickHandling:]):
106         (-[WKContentView _didGetTapHighlightForRequest:color:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:]): Deleted.
107         * UIProcess/ios/WebPageProxyIOS.mm:
108         (WebKit::WebPageProxy::didGetTapHighlightGeometries):
109         * WebProcess/WebPage/ios/WebPageIOS.mm:
110         (WebKit::WebPage::sendTapHighlightForNodeIfNecessary):
111
112 2019-01-10  Alexey Proskuryakov  <ap@apple.com>
113
114         Remove unneeded XPCService variant for plugin service
115         https://bugs.webkit.org/show_bug.cgi?id=193326
116
117         Reviewed by Tim Horton.
118
119         * Configurations/PluginService.32.xcconfig: Removed.
120         * Configurations/PluginService.64.xcconfig:
121         * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist: Removed.
122         * PluginProcess/EntryPoint/mac/XPCService/PluginService.64.Info.plist: Copied from Source/WebKit/PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist.
123         * WebKit.xcodeproj/project.pbxproj:
124
125 2019-01-10  Eric Carlson  <eric.carlson@apple.com>
126
127         Define page media state flags for display capture.
128         https://bugs.webkit.org/show_bug.cgi?id=193230
129         <rdar://problem/47095142>
130
131         Reviewed by Youenn Fablet.
132
133         * UIProcess/API/C/WKPage.cpp:
134         (WKPageGetMediaState):
135         * UIProcess/API/C/WKPagePrivate.h:
136         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
137         (WebKit::UserMediaCaptureManager::Source::Source):
138         (WebKit::UserMediaCaptureManager::createCaptureSource):
139
140 2019-01-10  Alex Christensen  <achristensen@webkit.org>
141
142         REGRESSION(r239815) http/tests/workers/service/serviceworker-private-browsing.https.html test times out
143         https://bugs.webkit.org/show_bug.cgi?id=193325
144
145         Reviewed by Joseph Pecoraro.
146
147         InjectedBundle::setPrivateBrowsingEnabled effectively didn't do anything when enabled was false.
148         I made it destroy the legacy private browsing session in the NetworkProcess, which caused a test to time out.
149         This functionality is only used for testing, so it's no big deal to revert that part of the patch.
150
151         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
152         (WebKit::NetworkConnectionToWebProcess::destroyLegacyPrivateBrowsingSession): Deleted.
153         * NetworkProcess/NetworkConnectionToWebProcess.h:
154         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
155         * WebProcess/InjectedBundle/InjectedBundle.cpp:
156         (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
157         * WebProcess/WebProcess.cpp:
158         (WebKit::WebProcess::destroyLegacyPrivateBrowsingSessionInNetworkProcess): Deleted.
159         * WebProcess/WebProcess.h:
160
161 2019-01-10  Per Arne Vollan  <pvollan@apple.com>
162
163         [macOS] Add name of IORegistry key in sandbox.
164         https://bugs.webkit.org/show_bug.cgi?id=193324
165
166         Reviewed by Brent Fulgham.
167
168         IOGVAVTCapabilities key has been changed to IOGVAHEVCDecodeCapabilities.
169
170         * WebProcess/com.apple.WebProcess.sb.in:
171
172 2019-01-10  John Wilander  <wilander@apple.com>
173
174         Override the session configuration for cookieAcceptPolicy
175         https://bugs.webkit.org/show_bug.cgi?id=190925
176         <rdar://problem/45497382>
177
178         Reviewed by Alexey Proskuryakov and Alex Christensen.
179
180         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
181         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
182             Now sets cookieStorage._overrideSessionCookieAcceptPolicy to YES.
183
184 2019-01-09  Matt Rajca  <mrajca@apple.com>
185
186         Put per-document autoplay behavior behind runtime website policies quirk instead of a compile time flag
187         https://bugs.webkit.org/show_bug.cgi?id=193301
188
189         Reviewed by Jer Noble.
190
191         Register a new quirk that can be configured per-load for per-document media
192         autoplay behaviors.
193
194         * Shared/WebsiteAutoplayQuirk.h:
195         * Shared/WebsitePoliciesData.cpp:
196         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
197         * UIProcess/API/C/WKWebsitePolicies.cpp:
198         (WKWebsitePoliciesSetAllowedAutoplayQuirks):
199         (WKWebsitePoliciesGetAllowedAutoplayQuirks):
200         * UIProcess/API/C/WKWebsitePolicies.h:
201         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
202         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
203         (-[_WKWebsitePolicies setAllowedAutoplayQuirks:]):
204         (-[_WKWebsitePolicies allowedAutoplayQuirks]):
205
206 2019-01-10  Tim Horton  <timothy_horton@apple.com>
207
208         Rename some entitlements files to be more clear about their target platform
209         https://bugs.webkit.org/show_bug.cgi?id=193311
210
211         Reviewed by Alexey Proskuryakov.
212
213         * Configurations/Network-iOSMac.entitlements: Renamed from Source/WebKit/Configurations/Network-iOS-minimalsimulator.entitlements.
214         * Configurations/NetworkService.xcconfig:
215         * Configurations/WebContent-iOSMac.entitlements: Renamed from Source/WebKit/Configurations/WebContent-iOS-minimalsimulator.entitlements.
216         * Configurations/WebContentService.xcconfig:
217         * WebKit.xcodeproj/project.pbxproj:
218
219 2019-01-09  Brent Fulgham  <bfulgham@apple.com>
220
221         Unreviewed build fix after r239816.
222
223         Although EWS had no problem with the patch, I'm seeing build errors on the actual bots.
224         This patch corrects the problem.
225
226         * NetworkProcess/NetworkProcess.cpp:
227         (WebKit::NetworkProcess::logFrameNavigation):
228         (WebKit::NetworkProcess::logUserInteraction):
229
230 2019-01-09  Brent Fulgham  <bfulgham@apple.com>
231
232         Create a WebResourceLoadStatisticsStore attached to the NetworkSession
233         https://bugs.webkit.org/show_bug.cgi?id=193261
234         <rdar://problem/47158616>
235
236         Reviewed by Alex Christensen.
237
238         This patch modifies NetworkSession so that it owns a WebResourceLoadStatisticsStore
239         object. This object is only created if the ResourceLoadStatistics feature is turned on.
240
241         The patch also modifies WebResourceLoadStatisticsStore so that it can be constructed
242         with an owning NetworkSession as an alternative to the current practice of using a
243         WebsiteDataStore object.
244
245         Two initial messages from the WebContent process are added (logFrameNavigation and
246         logUserNavigation) that notify the network process of these actions. Currently they
247         are called in addition the calls to the WebsiteDataStore object. These redundant calls
248         will be removed in a future patch.
249
250         This patch forces the ResourceLoadStatistics code in the NetworkSession to be off by
251         default, so there should be no change in behavior with this patch.
252
253         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
254         (WebKit::ResourceLoadStatisticsMemoryStore::updateClientSideCookiesAgeCap):
255         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
256         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
257         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccessForFrame):
258         (WebKit::WebResourceLoadStatisticsStore::callHasStorageAccessForFrameHandler):
259         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
260         (WebKit::WebResourceLoadStatisticsStore::callGrantStorageAccessHandler):
261         (WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess):
262         (WebKit::WebResourceLoadStatisticsStore::logFrameNavigation):
263         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
264         (WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCapForPrevalentResources):
265         (WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCap):
266         (WebKit::WebResourceLoadStatisticsStore::updatePrevalentDomainsToBlockCookiesFor):
267         (WebKit::WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToBlockCookiesForHandler):
268         (WebKit::WebResourceLoadStatisticsStore::removePrevalentDomains):
269         (WebKit::WebResourceLoadStatisticsStore::callRemoveDomainsHandler):
270         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
271         * NetworkProcess/NetworkProcess.cpp:
272         (WebKit::NetworkProcess::initializeNetworkProcess):
273         (WebKit::NetworkProcess::logFrameNavigation):
274         (WebKit::NetworkProcess::logUserInteraction):
275         * NetworkProcess/NetworkProcess.h:
276         * NetworkProcess/NetworkProcess.messages.in:
277         * NetworkProcess/NetworkSession.cpp:
278         (WebKit::NetworkSession::enableResourceLoadStatistics):
279         * NetworkProcess/NetworkSession.h:
280         (WebKit::NetworkSession::resourceLoadStatistics const):
281         * NetworkProcess/NetworkSessionCreationParameters.cpp:
282         (WebKit::NetworkSessionCreationParameters::privateSessionParameters):
283         (WebKit::NetworkSessionCreationParameters::encode const):
284         (WebKit::NetworkSessionCreationParameters::decode):
285         * NetworkProcess/NetworkSessionCreationParameters.h:
286         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
287         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
288         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
289         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
290         * UIProcess/Network/NetworkProcessProxy.cpp:
291         (WebKit::NetworkProcessProxy::didLogUserInteraction):
292         * UIProcess/Network/NetworkProcessProxy.h:
293         * UIProcess/Network/NetworkProcessProxy.messages.in:
294         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
295         (WebsiteDataStore::parameters):
296         * UIProcess/WebPageProxy.cpp:
297         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
298         (WebKit::WebPageProxy::logFrameNavigation):
299         * UIProcess/WebPageProxy.h:
300         * UIProcess/WebProcessPool.cpp:
301         (WebKit::WebProcessPool::ensureNetworkProcess):
302         (WebKit::WebProcessPool::initializeNewWebProcess):
303
304 2019-01-09  Alex Christensen  <achristensen@webkit.org>
305
306         Replace SessionTracker with HashMap member of NetworkProcess
307         https://bugs.webkit.org/show_bug.cgi?id=193266
308
309         Reviewed by Joseph Pecoraro.
310
311         * NetworkProcess/Downloads/DownloadManager.cpp:
312         (WebKit::DownloadManager::startDownload):
313         * NetworkProcess/Downloads/DownloadManager.h:
314         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
315         (WebKit::Download::resume):
316         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
317         (WebKit::NetworkCORSPreflightChecker::startPreflight):
318         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
319         (WebKit::NetworkConnectionToWebProcess::preconnectTo):
320         (WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
321         (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
322         (WebKit::NetworkConnectionToWebProcess::destroyLegacyPrivateBrowsingSession):
323         * NetworkProcess/NetworkConnectionToWebProcess.h:
324         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
325         * NetworkProcess/NetworkProcess.cpp:
326         (WebKit::NetworkProcess::initializeNetworkProcess):
327         (WebKit::NetworkProcess::clearCachedCredentials):
328         (WebKit::NetworkProcess::networkSession):
329         (WebKit::NetworkProcess::setSession):
330         (WebKit::NetworkProcess::destroySession):
331         (WebKit::NetworkProcess::preconnectTo):
332         * NetworkProcess/NetworkProcess.h:
333         * NetworkProcess/NetworkResourceLoader.cpp:
334         (WebKit::NetworkResourceLoader::startNetworkLoad):
335         (WebKit::NetworkResourceLoader::didFinishLoading):
336         (WebKit::NetworkResourceLoader::sendResultForCacheEntry):
337         (WebKit::NetworkResourceLoader::shouldLogCookieInformation):
338         (WebKit::NetworkResourceLoader::logCookieInformation const):
339         (WebKit::logBlockedCookieInformation):
340         (WebKit::logCookieInformationInternal):
341         (WebKit::NetworkResourceLoader::logCookieInformation):
342         * NetworkProcess/NetworkResourceLoader.h:
343         * NetworkProcess/PingLoad.cpp:
344         (WebKit::PingLoad::loadRequest):
345         * NetworkProcess/PingLoad.h:
346         * NetworkProcess/PreconnectTask.cpp:
347         (WebKit::PreconnectTask::PreconnectTask):
348         * NetworkProcess/PreconnectTask.h:
349         * NetworkProcess/RemoteNetworkingContext.h:
350         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
351         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
352         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
353         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
354         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
355         * NetworkProcess/mac/RemoteNetworkingContext.mm:
356         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
357         * Shared/SessionTracker.cpp: Removed.
358         * Shared/SessionTracker.h: Removed.
359         * Sources.txt:
360         * WebKit.xcodeproj/project.pbxproj:
361         * WebProcess/InjectedBundle/InjectedBundle.cpp:
362         (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
363         * WebProcess/Network/WebLoaderStrategy.cpp:
364         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
365         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
366         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
367         * WebProcess/WebPage/WebPage.cpp:
368         * WebProcess/WebProcess.cpp:
369         (WebKit::WebProcess::destroyLegacyPrivateBrowsingSessionInNetworkProcess):
370         * WebProcess/WebProcess.h:
371         * WebProcess/cocoa/WebProcessCocoa.mm:
372
373 2019-01-09  Alex Christensen  <achristensen@webkit.org>
374
375         Expand use of sourceApplicationAuditData
376         https://bugs.webkit.org/show_bug.cgi?id=192995
377         <rdar://problem/46627875>
378
379         Reviewed by Brady Eidson.
380
381         sourceApplicationAuditData has been used for a long time on iOS, but it's needed on more platforms.
382         I also made it return an Optional instead of a bool and returning by reference. Ahhh. So much nicer.
383         The NetworkProcess needed an additional entitlement on Mac to continue to load anything, which is desirable.
384
385         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
386         (WebKit::NetworkProcess::sourceApplicationAuditData const):
387         * Platform/IPC/Connection.h:
388         * Platform/IPC/mac/ConnectionMac.mm:
389         (IPC::Connection::getAuditToken):
390         * WebProcess/WebProcess.cpp:
391         (WebKit::WebProcess::initializeWebProcess):
392         * WebProcess/cocoa/WebProcessCocoa.mm:
393         (WebKit::WebProcess::sourceApplicationAuditData const):
394
395 2019-01-09  Brent Fulgham  <bfulgham@apple.com>
396
397         [iOS] Update sandbox profile to use iconservices instead of lsdiconservice
398         https://bugs.webkit.org/show_bug.cgi?id=193115
399         <rdar://problem/44867379>
400
401         Reviewed by Eric Carlson.
402
403         Add access to the 'com.apple.iconservices' endpoint. We will remove access to
404         the older name ('com.apple.lsdiconservices') once existing clients have completed
405         the switch.
406
407         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
408
409 2019-01-09  Antti Koivisto  <antti@apple.com>
410
411         [PSON] Flash of blank content while transitioning from page A to page B.
412         https://bugs.webkit.org/show_bug.cgi?id=193283
413
414         Reviewed by Chris Dumez.
415
416         Layer tree is not frozen during WebPage construction. If the flush timer (started for the initial
417         empty document) manages to run before the actual page load starts, we'll get a flash.
418
419         * Shared/WebPageCreationParameters.cpp:
420         (WebKit::WebPageCreationParameters::encode const):
421         (WebKit::WebPageCreationParameters::decode):
422         * Shared/WebPageCreationParameters.h:
423
424         Rename shouldDelayAttachingDrawingArea bit to isSwapFromSuspended and make it available on all platforms.
425
426         * UIProcess/RemoteLayerTree/mac/ScrollerMac.h: Removed.
427         * UIProcess/RemoteLayerTree/mac/ScrollerMac.mm: Removed.
428         * UIProcess/RemoteLayerTree/mac/ScrollerPairMac.h: Removed.
429         * UIProcess/RemoteLayerTree/mac/ScrollerPairMac.mm: Removed.
430         * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp: Removed.
431         * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.h: Removed.
432         * UIProcess/WebPageProxy.cpp:
433         (WebKit::WebPageProxy::swapToWebProcess):
434         (WebKit::WebPageProxy::finishAttachingToWebProcess):
435         (WebKit::WebPageProxy::initializeWebPage):
436         (WebKit::WebPageProxy::continueNavigationInNewProcess):
437         * UIProcess/WebPageProxy.h:
438         * WebProcess/WebPage/WebPage.cpp:
439         (WebKit::m_shouldAttachDrawingAreaOnPageTransition):
440
441         Freeze the layer tree in WebPage constructor if this is a swap from a suspended process.
442
443         (WebKit::WebPage::reinitializeWebPage):
444         (WebKit::WebPage::didCompletePageTransition):
445
446         Unfreeze on first non-initial empty document page transition.
447
448         * WebProcess/WebPage/WebPage.h:
449         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
450         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
451
452 2019-01-09  Chris Dumez  <cdumez@apple.com>
453
454         WebKit Networking process crashes if the HTTPSUpgradeList is not found in the bundle
455         https://bugs.webkit.org/show_bug.cgi?id=193285
456         <rdar://problem/47147610>
457
458         Reviewed by Geoffrey Garen.
459
460         * NetworkProcess/NetworkHTTPSUpgradeChecker.cpp:
461         (WebKit::networkHTTPSUpgradeCheckerDatabasePath):
462         (WebKit::NetworkHTTPSUpgradeChecker::NetworkHTTPSUpgradeChecker):
463
464 2019-01-09  Michael Catanzaro  <mcatanzaro@igalia.com>
465
466         [GTK] Add missing autocleanups
467         https://bugs.webkit.org/show_bug.cgi?id=193068
468
469         Reviewed by Carlos Garcia Campos.
470
471         * UIProcess/API/gtk/WebKitAutocleanups.h:
472
473 2019-01-08  Alex Christensen  <achristensen@webkit.org>
474
475         Fix CompletionHandler assertions introduced today.
476         https://bugs.webkit.org/show_bug.cgi?id=193237
477
478         This reverts part of r239710 and all of r239725, r239738, and r239748 which unsuccessfully tried to fix all the assertions.
479         This code is a mess that will have to be cleaned up later.
480
481         * NetworkProcess/NetworkResourceLoader.cpp:
482         (WebKit::NetworkResourceLoader::tryStoreAsCacheEntry):
483         * NetworkProcess/cache/CacheStorageEngine.cpp:
484         (WebKit::CacheStorage::Engine::from):
485         * NetworkProcess/cache/CacheStorageEngine.h:
486         * NetworkProcess/cache/NetworkCache.cpp:
487         (WebKit::NetworkCache::Cache::store):
488         (WebKit::NetworkCache::Cache::remove):
489         (WebKit::NetworkCache::Cache::traverse):
490         (WebKit::NetworkCache::Cache::clear):
491         (WebKit::NetworkCache::Cache::retrieveData):
492         * NetworkProcess/cache/NetworkCache.h:
493         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
494         (WebKit::NetworkCache::SpeculativeLoad::didFinishLoading):
495         * NetworkProcess/cache/NetworkCacheStorage.cpp:
496         (WebKit::NetworkCache::Storage::store):
497         (WebKit::NetworkCache::Storage::WriteOperation::~WriteOperation): Deleted.
498         * NetworkProcess/cache/NetworkCacheStorage.h:
499         (WebKit::NetworkCache::Storage::store):
500
501 2019-01-08  Jiewen Tan  <jiewen_tan@apple.com>
502
503         [Mac] Layout Test http/wpt/webauthn/public-key-credential-create-success-hid.https.html and http/wpt/webauthn/public-key-credential-get-success-hid.https.html are flaky
504         https://bugs.webkit.org/show_bug.cgi?id=192061
505
506         Reviewed by Dewei Zhu.
507
508         Part 6.
509
510         Add some additional temporary logging info to determine if data is actually sent.
511         Once the bug is determined and fixed, we should remove all logging added in this patch.
512
513         * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
514         (WebKit::MockHidConnection::send):
515
516 2019-01-08  Jiewen Tan  <jiewen_tan@apple.com>
517
518         [WebAuthN] Support U2F HID Authenticators on macOS
519         https://bugs.webkit.org/show_bug.cgi?id=191535
520         <rdar://problem/47102027>
521
522         Reviewed by Brent Fulgham.
523
524         This patch implements the support for U2F authenticators, and enables it for hid devices.
525         It follows the CTAP spec to map WebAuthN requests to U2F commands and return the responses:
526         https://fidoalliance.org/specs/fido-v2.0-id-20180227/fido-client-to-authenticator-protocol-v2.0-id-20180227.html#u2f-interoperability
527         Most of the parts are done before this patch, this patch focues on: 7.2.2 and 7.3.2.
528
529         Besides implementing the U2fHidAuthenticator, this patch also adds support in the mocking
530         environment for U2F authenticators. It is done by extending the stages in MockHidConnection
531         from 4 to indefinite as multi-round communications are expected to map WebAuthN requests
532         to U2F requests.
533
534         * Sources.txt:
535         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
536         (WKWebsiteDataStoreSetWebAuthenticationMockConfiguration):
537         * UIProcess/WebAuthentication/Cocoa/HidService.mm:
538         (WebKit::HidService::continueAddDeviceAfterGetInfo):
539         * UIProcess/WebAuthentication/fido/CtapHidDriver.cpp:
540         (WebKit::CtapHidDriver::continueAfterChannelAllocated):
541         * UIProcess/WebAuthentication/fido/CtapHidDriver.h:
542         (WebKit::CtapHidDriver::setProtocol):
543         * UIProcess/WebAuthentication/fido/U2fHidAuthenticator.cpp: Added.
544         (WebKit::U2fHidAuthenticator::U2fHidAuthenticator):
545         (WebKit::U2fHidAuthenticator::makeCredential):
546         (WebKit::U2fHidAuthenticator::checkExcludeList):
547         (WebKit::U2fHidAuthenticator::issueRegisterCommand):
548         (WebKit::U2fHidAuthenticator::getAssertion):
549         (WebKit::U2fHidAuthenticator::issueSignCommand):
550         (WebKit::U2fHidAuthenticator::issueNewCommand):
551         (WebKit::U2fHidAuthenticator::issueCommand):
552         (WebKit::U2fHidAuthenticator::responseReceived):
553         (WebKit::U2fHidAuthenticator::continueRegisterCommandAfterResponseReceived):
554         (WebKit::U2fHidAuthenticator::continueCheckOnlyCommandAfterResponseReceived):
555         (WebKit::U2fHidAuthenticator::continueBogusCommandAfterResponseReceived):
556         (WebKit::U2fHidAuthenticator::continueSignCommandAfterResponseReceived):
557         * UIProcess/WebAuthentication/fido/U2fHidAuthenticator.h: Added.
558         * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
559         (WebKit::MockHidConnection::parseRequest):
560         (WebKit::MockHidConnection::feedReports):
561         * UIProcess/WebAuthentication/Mock/MockHidConnection.h:
562         * UIProcess/WebAuthentication/Mock/MockWebAuthenticationConfiguration.h:
563         * WebKit.xcodeproj/project.pbxproj:
564
565 2019-01-08  Youenn Fablet  <youenn@apple.com>
566
567         service worker fetch handler results in bad referrer
568         https://bugs.webkit.org/show_bug.cgi?id=188248
569         <rdar://problem/47050478>
570
571         Reviewed by Alex Christensen.
572
573         NetworkDataTaskCocoa is sometimes updating the referrer on its own.
574         Instead of updating the referrer when sending the request to WebProcess for evaluation,
575         Update the referrer once the web process decides to follow the redirection.
576         This ensures that any referrer that the WebProcess will set will be updated by NetworkDataTaskCocoa.
577
578         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
579         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
580         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
581         (WebKit::NetworkDataTaskCocoa::restrictRequestReferrerToOriginIfNeeded):
582         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
583
584 2019-01-08  Alex Christensen  <achristensen@webkit.org>
585
586         Fix more assertions after r239710
587         https://bugs.webkit.org/show_bug.cgi?id=193237
588
589         * NetworkProcess/cache/NetworkCacheStorage.h:
590         (WebKit::NetworkCache::Storage::store):
591         Make default parameter an empty lambda instead of a null CompletionHandler.
592         This way it can be called once instead of thinking it has already been called.
593
594 2019-01-08  Brent Fulgham  <bfulgham@apple.com>
595
596         Move ResourceLoadStatistics files from UIProcess to NetworkProcess
597         https://bugs.webkit.org/show_bug.cgi?id=193252
598         <rdar://problem/47125401>
599
600         Reviewed by Alex Christensen.
601
602         This patch is the first part of a refactoring to move the ResourceLoadStatistics logic from the UIProcess to the NetworkProcess.
603
604         This patch moves code into different folders and adjusts necessary build files, but does not change where the code executes. These
605         changes have no impact on behavior or test results.
606
607         I also modified a few files to add missing include files uncovered by the unified build system.
608
609         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp: Renamed from Source/WebKit/UIProcess/ResourceLoadStatisticsMemoryStore.cpp.
610         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h: Renamed from Source/WebKit/UIProcess/ResourceLoadStatisticsMemoryStore.h.
611         * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.cpp: Renamed from Source/WebKit/UIProcess/ResourceLoadStatisticsPersistentStorage.cpp.
612         * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.h: Renamed from Source/WebKit/UIProcess/ResourceLoadStatisticsPersistentStorage.h.
613         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: Renamed from Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp.
614         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h: Renamed from Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.h.
615         * NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.cpp: Renamed from Source/WebKit/UIProcess/WebResourceLoadStatisticsTelemetry.cpp.
616         * NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.h: Renamed from Source/WebKit/UIProcess/WebResourceLoadStatisticsTelemetry.h.
617         * NetworkProcess/Downloads/PendingDownload.cpp:
618         * NetworkProcess/Downloads/PendingDownload.h:
619         * CMakeLists.txt:
620         * PlatformMac.cmake:
621         * PlatformWin.cmake:
622         * Shared/PersistencyUtils.cpp: Renamed from Source/WebKit/UIProcess/PersistencyUtils.cpp.
623         * Shared/PersistencyUtils.h: Renamed from Source/WebKit/UIProcess/PersistencyUtils.h.
624         * Sources.txt:
625         * SourcesCocoa.txt:
626         * SourcesGTK.txt:
627         * SourcesWPE.txt:
628         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
629         (WKWebsiteDataStoreSetWebAuthenticationMockConfiguration): Add missing WebKit:: scope.
630         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: Add missing include.
631         * UIProcess/WebDataListSuggestionsDropdown.cpp: Ditto.
632         * UIProcess/mac/DisplayLink.cpp:
633         * UnifiedSources-input.xcfilelist:
634         * WebKit.xcodeproj/project.pbxproj:
635
636 2019-01-08  Chris Dumez  <cdumez@apple.com>
637
638         Mark SuspendedPageProxy as fast allocated
639         https://bugs.webkit.org/show_bug.cgi?id=193248
640
641         Reviewed by Alex Christensen.
642
643         * UIProcess/SuspendedPageProxy.h:
644
645 2019-01-08  Chris Dumez  <cdumez@apple.com>
646
647         Prevent cross-site top-level navigations from third-party iframes
648         https://bugs.webkit.org/show_bug.cgi?id=193076
649         <rdar://problem/36074736>
650
651         Reviewed by Alex Christensen.
652
653         Add experimental feature flag, on by default.
654
655         * Shared/WebPreferences.yaml:
656
657 2019-01-08  Alex Christensen  <achristensen@webkit.org>
658
659         Remove more use of NetworkProcess::singleton
660         https://bugs.webkit.org/show_bug.cgi?id=193244
661
662         Reviewed by Brent Fulgham.
663
664         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
665         (WebKit::NetworkCORSPreflightChecker::NetworkCORSPreflightChecker):
666         (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
667         * NetworkProcess/NetworkCORSPreflightChecker.h:
668         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
669         (WebKit::NetworkConnectionToWebProcess::loadPing):
670         * NetworkProcess/NetworkContentRuleListManager.cpp:
671         (WebKit::NetworkContentRuleListManager::NetworkContentRuleListManager):
672         (WebKit::NetworkContentRuleListManager::contentExtensionsBackend):
673         * NetworkProcess/NetworkContentRuleListManager.h:
674         * NetworkProcess/NetworkLoadChecker.cpp:
675         (WebKit::NetworkLoadChecker::NetworkLoadChecker):
676         (WebKit::NetworkLoadChecker::applyHTTPSUpgradeIfNeeded const):
677         (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
678         (WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad):
679         * NetworkProcess/NetworkLoadChecker.h:
680         * NetworkProcess/NetworkProcess.cpp:
681         (WebKit::NetworkProcess::NetworkProcess):
682         (WebKit::NetworkProcess::didReceiveMessage):
683         (WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
684         * NetworkProcess/NetworkProcess.h:
685         (WebKit::NetworkProcess::networkContentRuleListManager):
686         * NetworkProcess/NetworkResourceLoader.cpp:
687         * NetworkProcess/PingLoad.cpp:
688         (WebKit::PingLoad::PingLoad):
689         * NetworkProcess/PingLoad.h:
690         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
691         (WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
692         (WebKit::WebSWServerToContextConnection::connectionMayNoLongerBeNeeded):
693         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
694
695 2019-01-08  Alex Christensen  <achristensen@webkit.org>
696
697         Stop using NetworkProcess::singleton in NetworkCache code
698         https://bugs.webkit.org/show_bug.cgi?id=193243
699
700         Reviewed by Brent Fulgham.
701
702         * NetworkProcess/cache/NetworkCache.cpp:
703         (WebKit::NetworkCache::Cache::open):
704         (WebKit::NetworkCache::Cache::Cache):
705         * NetworkProcess/cache/NetworkCache.h:
706         (WebKit::NetworkCache::Cache::networkProcess):
707         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
708         (WebKit::NetworkCache::logSpeculativeLoadingDiagnosticMessage):
709         (WebKit::NetworkCache::SpeculativeLoadManager::canRetrieve const):
710         (WebKit::NetworkCache::SpeculativeLoadManager::addPreloadedEntry):
711         (WebKit::NetworkCache::SpeculativeLoadManager::revalidateSubresource):
712         (WebKit::NetworkCache::SpeculativeLoadManager::preloadEntry):
713         (WebKit::NetworkCache::SpeculativeLoadManager::startSpeculativeRevalidation):
714         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
715         (WebKit::NetworkCache::Statistics::recordRetrievalRequest):
716         (WebKit::NetworkCache::Statistics::recordNotUsingCacheForRequest):
717         (WebKit::NetworkCache::Statistics::recordRetrievalFailure):
718         (WebKit::NetworkCache::Statistics::recordRetrievedCachedEntry):
719         (WebKit::NetworkCache::Statistics::recordRevalidationSuccess):
720         * NetworkProcess/cache/NetworkCacheStorage.cpp:
721         (WebKit::NetworkCache::retrieveFromMemory):
722         * NetworkProcess/cache/NetworkCacheStorage.h:
723         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
724         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
725
726 2019-01-08  Alex Christensen  <achristensen@webkit.org>
727
728         Call CompletionHandler when destroying a NetworkCache::Storage::WriteOperation
729         https://bugs.webkit.org/show_bug.cgi?id=193251
730
731         Reviewed by Chris Dumez.
732
733         This fixes another assertion introduced in r239710.
734
735         * NetworkProcess/cache/NetworkCacheStorage.cpp:
736         (WebKit::NetworkCache::Storage::WriteOperation::~WriteOperation):
737
738 2019-01-08  Alex Christensen  <achristensen@webkit.org>
739
740         Stop using NetworkStorageSession in WebProcess
741         https://bugs.webkit.org/show_bug.cgi?id=193236
742
743         Reviewed by Don Olmstead.
744
745         * Shared/WebProcessCreationParameters.cpp:
746         (WebKit::WebProcessCreationParameters::encode const):
747         (WebKit::WebProcessCreationParameters::decode):
748         * Shared/WebProcessCreationParameters.h:
749         * Shared/WebsitePoliciesData.cpp:
750         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
751         * UIProcess/WebProcessPool.cpp:
752         (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
753         (WebKit::WebProcessPool::tryTakePrewarmedProcess):
754         (WebKit::WebProcessPool::initializeNewWebProcess):
755         (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
756         (WebKit::WebProcessPool::pageEndUsingWebsiteDataStore):
757         (WebKit::WebProcessPool::processForNavigationInternal):
758         * WebProcess/InjectedBundle/InjectedBundle.cpp:
759         (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
760         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
761         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
762         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession): Deleted.
763         (WebKit::WebFrameNetworkingContext::storageSession const): Deleted.
764         * WebProcess/WebPage/WebPage.cpp:
765         (WebKit::WebPage::setSessionID):
766         * WebProcess/WebProcess.cpp:
767         (WebKit::WebProcess::initializeWebProcess):
768         (WebKit::WebProcess::fetchWebsiteData):
769         (WebKit::WebProcess::addWebsiteDataStore): Deleted.
770         (WebKit::WebProcess::destroySession): Deleted.
771         * WebProcess/WebProcess.h:
772         * WebProcess/WebProcess.messages.in:
773
774 2019-01-08  Michael Catanzaro  <mcatanzaro@igalia.com>
775
776         Unreviewed, silence -Wformat warnings
777
778         * NetworkProcess/NetworkHTTPSUpgradeChecker.cpp:
779         (WebKit::NetworkHTTPSUpgradeChecker::NetworkHTTPSUpgradeChecker):
780         (WebKit::NetworkHTTPSUpgradeChecker::query):
781
782 2019-01-08  Alex Christensen  <achristensen@webkit.org>
783
784         Unreviewed, rolling out r239727.
785
786         Broke API tests
787
788         Reverted changeset:
789
790         "Stop using NetworkStorageSession in WebProcess"
791         https://bugs.webkit.org/show_bug.cgi?id=193236
792         https://trac.webkit.org/changeset/239727
793
794 2019-01-08  Brian Burg  <bburg@apple.com>
795
796         Remove WKPageRef-based SPI in _WKAutomationSessionDelegate
797         https://bugs.webkit.org/show_bug.cgi?id=193202
798         <rdar://problem/37408718>
799
800         Reviewed by Alex Christensen.
801
802         This code is no longer used, it should be deleted.
803
804         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
805         * UIProcess/Cocoa/AutomationSessionClient.h:
806         * UIProcess/Cocoa/AutomationSessionClient.mm:
807         (WebKit::AutomationSessionClient::AutomationSessionClient):
808         (WebKit::AutomationSessionClient::requestNewPageWithOptions):
809         (WebKit::AutomationSessionClient::requestSwitchToPage):
810         (WebKit::AutomationSessionClient::requestHideWindowOfPage):
811         (WebKit::AutomationSessionClient::requestRestoreWindowOfPage):
812         (WebKit::AutomationSessionClient::requestMaximizeWindowOfPage):
813         (WebKit::AutomationSessionClient::isShowingJavaScriptDialogOnPage):
814         (WebKit::AutomationSessionClient::dismissCurrentJavaScriptDialogOnPage):
815         (WebKit::AutomationSessionClient::acceptCurrentJavaScriptDialogOnPage):
816         (WebKit::AutomationSessionClient::messageOfCurrentJavaScriptDialogOnPage):
817         (WebKit::AutomationSessionClient::setUserInputForCurrentJavaScriptPromptOnPage):
818         (WebKit::AutomationSessionClient::typeOfCurrentJavaScriptDialogOnPage):
819         Clean up the delegate bridging methods now that only one delegate implementation is possible.
820
821 2019-01-08  Patrick Griffis  <pgriffis@igalia.com>
822
823         [GTK][WPE] Remove DConf permissions from sandbox
824         https://bugs.webkit.org/show_bug.cgi?id=193021
825
826         Reviewed by Michael Catanzaro.
827
828         The latest development releases of xdg-desktop-portal and gtk3 use a
829         new portal for settings on Wayland org.freedesktop.portal.Settings.
830
831         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
832         (WebKit::bubblewrapSpawn):
833
834 2019-01-08  Alex Christensen  <achristensen@webkit.org>
835
836         Stop using NetworkStorageSession in WebProcess
837         https://bugs.webkit.org/show_bug.cgi?id=193236
838
839         Reviewed by Don Olmstead.
840
841         * Shared/WebProcessCreationParameters.cpp:
842         (WebKit::WebProcessCreationParameters::encode const):
843         (WebKit::WebProcessCreationParameters::decode):
844         * Shared/WebProcessCreationParameters.h:
845         * Shared/WebsitePoliciesData.cpp:
846         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
847         * UIProcess/WebProcessPool.cpp:
848         (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
849         (WebKit::WebProcessPool::tryTakePrewarmedProcess):
850         (WebKit::WebProcessPool::initializeNewWebProcess):
851         (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
852         (WebKit::WebProcessPool::pageEndUsingWebsiteDataStore):
853         (WebKit::WebProcessPool::processForNavigationInternal):
854         * WebProcess/InjectedBundle/InjectedBundle.cpp:
855         (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
856         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
857         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
858         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession): Deleted.
859         (WebKit::WebFrameNetworkingContext::storageSession const): Deleted.
860         * WebProcess/WebPage/WebPage.cpp:
861         (WebKit::WebPage::setSessionID):
862         * WebProcess/WebProcess.cpp:
863         (WebKit::WebProcess::initializeWebProcess):
864         (WebKit::WebProcess::fetchWebsiteData):
865         (WebKit::WebProcess::addWebsiteDataStore): Deleted.
866         (WebKit::WebProcess::destroySession): Deleted.
867         * WebProcess/WebProcess.h:
868         * WebProcess/WebProcess.messages.in:
869
870 2019-01-08  Alex Christensen  <achristensen@webkit.org>
871
872         Always call CompletionHandler in Cache::store
873         https://bugs.webkit.org/show_bug.cgi?id=193237
874
875         Reviewed by Chris Dumez.
876
877         No change in behavior. This just fixes an assertion introduced in r239710 when the speculative loader finishes.
878
879         * NetworkProcess/NetworkResourceLoader.cpp:
880         (WebKit::NetworkResourceLoader::tryStoreAsCacheEntry):
881         * NetworkProcess/cache/NetworkCache.cpp:
882         (WebKit::NetworkCache::Cache::store):
883         * NetworkProcess/cache/NetworkCache.h:
884         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
885         (WebKit::NetworkCache::SpeculativeLoad::didFinishLoading):
886
887 2019-01-08  Carlos Garcia Campos  <cgarcia@igalia.com>
888
889         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.23.2 release
890
891         * gtk/NEWS: Add release notes for 2.23.2.
892
893 2019-01-07  Chris Dumez  <cdumez@apple.com>
894
895         Cannot scoll for 5 seconds after swiping back on quoteunquoteapps.com
896         https://bugs.webkit.org/show_bug.cgi?id=193215
897         <rdar://problem/45108222>
898
899         Reviewed by Tim Horton.
900
901         When doing the history navigation, if the source and destination history
902         items are clones then we will not trigger a main frame load. We may
903         however trigger loads in subframes if needed. This was an issue for the
904         ViewGestureController because it was expecting a main frame load after
905         calling WebPageProxy::goToBackForwardItem() in order to determine when
906         taking down the view snapshot is appropriate.
907
908         To address the problem, the ViewGestureController now takes the snapshot
909         down as soon as the swipe gesture ends when the source and destination
910         items are clones.
911
912         * Shared/WebBackForwardListItem.cpp:
913         (WebKit::childItemWithTarget):
914         (WebKit::WebBackForwardListItem::itemIsInSameDocument const):
915         (WebKit::hasSameFrames):
916         (WebKit::WebBackForwardListItem::itemIsClone):
917         * Shared/WebBackForwardListItem.h:
918         * UIProcess/ios/ViewGestureControllerIOS.mm:
919         (WebKit::ViewGestureController::endSwipeGesture):
920         * UIProcess/mac/ViewGestureControllerMac.mm:
921         (WebKit::ViewGestureController::endSwipeGesture):
922
923 2019-01-07  David Kilzer  <ddkilzer@apple.com>
924
925         Leak of ScrollCompletionCallbackData (16 bytes) in com.apple.WebKit.WebContent running WebKit layout tests
926         <https://webkit.org/b/193222>
927         <rdar://problem/46862309>
928
929         Reviewed by Joseph Pecoraro.
930
931         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
932         (WKBundlePageRegisterScrollOperationCompletionCallback): Change
933         to return true if callback will be called, else false.
934         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
935         (WKBundlePageRegisterScrollOperationCompletionCallback): Change
936         to return `bool` value to denote whether callback will be called
937         (true) or not called (false).
938
939 2019-01-07  Alex Christensen  <achristensen@webkit.org>
940
941         Remove use of NetworkProcess::singleton from CacheStorage::Engine::from
942         https://bugs.webkit.org/show_bug.cgi?id=193220
943
944         Reviewed by Andy Estes.
945
946         This required passing the NetworkProcess& in from all its callers.
947         While I was at it, I made them use CompletionHandlers where appropriate.
948
949         * NetworkProcess/NetworkProcess.cpp:
950         (WebKit::NetworkProcess::destroySession):
951         (WebKit::NetworkProcess::fetchWebsiteData):
952         (WebKit::NetworkProcess::deleteWebsiteData):
953         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
954         (WebKit::NetworkProcess::findCacheEngine):
955         (WebKit::NetworkProcess::ensureCacheEngine):
956         (WebKit::NetworkProcess::removeCacheEngine):
957         * NetworkProcess/NetworkProcess.h:
958         * NetworkProcess/cache/CacheStorageEngine.cpp:
959         (WebKit::CacheStorage::Engine::from):
960         (WebKit::CacheStorage::Engine::destroyEngine):
961         (WebKit::CacheStorage::Engine::fetchEntries):
962         (WebKit::CacheStorage::Engine::open):
963         (WebKit::CacheStorage::Engine::remove):
964         (WebKit::CacheStorage::Engine::retrieveCaches):
965         (WebKit::CacheStorage::Engine::retrieveRecords):
966         (WebKit::CacheStorage::Engine::putRecords):
967         (WebKit::CacheStorage::Engine::deleteMatchingRecords):
968         (WebKit::CacheStorage::Engine::lock):
969         (WebKit::CacheStorage::Engine::unlock):
970         (WebKit::CacheStorage::Engine::clearMemoryRepresentation):
971         (WebKit::CacheStorage::Engine::representation):
972         (WebKit::CacheStorage::Engine::clearAllCaches):
973         (WebKit::CacheStorage::Engine::clearCachesForOrigin):
974         (WebKit::CacheStorage::globalEngineMap): Deleted.
975         * NetworkProcess/cache/CacheStorageEngine.h:
976         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
977         (WebKit::CacheStorageEngineConnection::~CacheStorageEngineConnection):
978         (WebKit::CacheStorageEngineConnection::open):
979         (WebKit::CacheStorageEngineConnection::remove):
980         (WebKit::CacheStorageEngineConnection::caches):
981         (WebKit::CacheStorageEngineConnection::retrieveRecords):
982         (WebKit::CacheStorageEngineConnection::deleteMatchingRecords):
983         (WebKit::CacheStorageEngineConnection::putRecords):
984         (WebKit::CacheStorageEngineConnection::reference):
985         (WebKit::CacheStorageEngineConnection::dereference):
986         (WebKit::CacheStorageEngineConnection::clearMemoryRepresentation):
987         (WebKit::CacheStorageEngineConnection::engineRepresentation):
988         * NetworkProcess/cache/NetworkCache.cpp:
989         (WebKit::NetworkCache::Cache::store):
990         (WebKit::NetworkCache::Cache::remove):
991         (WebKit::NetworkCache::Cache::traverse):
992         (WebKit::NetworkCache::Cache::clear):
993         (WebKit::NetworkCache::Cache::retrieveData):
994         * NetworkProcess/cache/NetworkCache.h:
995
996 2019-01-07  David Kilzer  <ddkilzer@apple.com>
997
998         Prefer RetainPtr<NSObject> to RetainPtr<NSObject *>
999         <https://webkit.org/b/193056>
1000
1001         Reviewed by Alex Christensen.
1002
1003         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
1004         (WebKit::XPCServiceMain):
1005         * UIProcess/API/Cocoa/_WKThumbnailView.mm:
1006         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
1007         * UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
1008         * UIProcess/Plugins/PluginProcessProxy.h:
1009         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
1010         (WebKit::RemoteLayerTreeHost::createEmbeddedView):
1011         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm:
1012         (WebKit::PlatformCALayerRemoteCustom::clone const):
1013         - Remove '*' from RetainPtr<> type.
1014
1015 2019-01-07  Dean Jackson  <dino@apple.com>
1016
1017         Turn on Pointer Events by default for iOS
1018         https://bugs.webkit.org/show_bug.cgi?id=193214
1019         <rdar://problem/46974878>
1020
1021         Reviewed by Wenson Hsieh.
1022
1023         Turn on Pointer Events.
1024
1025         * Shared/WebPreferences.yaml:
1026         * Shared/WebPreferencesDefaultValues.h: Make a new #define for iOS.
1027
1028 2019-01-07  Alex Christensen  <achristensen@webkit.org>
1029
1030         Remove use of NetworkProcess::singleton in ServiceWorker code
1031         https://bugs.webkit.org/show_bug.cgi?id=193209
1032
1033         Reviewed by Megan Gardner.
1034
1035         Use a member Ref<NetworkProcess> instead to avoid global singleton use.
1036
1037         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1038         (WebKit::NetworkConnectionToWebProcess::establishSWServerConnection):
1039         * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
1040         (WebKit::WebSWServerConnection::WebSWServerConnection):
1041         (WebKit::WebSWServerConnection::~WebSWServerConnection):
1042         (WebKit::WebSWServerConnection::startFetch):
1043         (WebKit::WebSWServerConnection::postMessageToServiceWorker):
1044         (WebKit::WebSWServerConnection::scheduleJobInServer):
1045         * NetworkProcess/ServiceWorker/WebSWServerConnection.h:
1046
1047 2019-01-07  Alex Christensen  <achristensen@webkit.org>
1048
1049         Remove use of NetworkProcess::singleton in NetworkLoad/NetworkDataTask code
1050         https://bugs.webkit.org/show_bug.cgi?id=193212
1051
1052         Reviewed by Andy Estes.
1053
1054         * NetworkProcess/NetworkDataTaskBlob.cpp:
1055         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
1056         (WebKit::NetworkDataTaskBlob::download):
1057         (WebKit::NetworkDataTaskBlob::writeDownload):
1058         (WebKit::NetworkDataTaskBlob::didFailDownload):
1059         (WebKit::NetworkDataTaskBlob::didFinishDownload):
1060         * NetworkProcess/NetworkDataTaskBlob.h:
1061         * NetworkProcess/NetworkLoad.cpp:
1062         (WebKit::NetworkLoad::NetworkLoad):
1063         (WebKit::NetworkLoad::convertTaskToDownload):
1064         (WebKit::NetworkLoad::didReceiveChallenge):
1065         (WebKit::NetworkLoad::didReceiveResponse):
1066         * NetworkProcess/NetworkLoad.h:
1067
1068 2019-01-07  Alex Christensen  <achristensen@webkit.org>
1069
1070         Remove use of NetworkProcess::singleton for downloads
1071         https://bugs.webkit.org/show_bug.cgi?id=193207
1072
1073         Reviewed by Brady Eidson.
1074
1075         No change in behavior.  The DownloadManager is now a member of the NetworkProcess instead of a static singleton.
1076
1077         * NetworkProcess/Downloads/Download.cpp:
1078         (WebKit::Download::Download):
1079         (WebKit::Download::didReceiveChallenge):
1080         * NetworkProcess/Downloads/Download.h:
1081         * NetworkProcess/Downloads/DownloadManager.cpp:
1082         (WebKit::DownloadManager::startDownload):
1083         (WebKit::DownloadManager::convertNetworkLoadToDownload):
1084         * NetworkProcess/Downloads/DownloadManager.h:
1085         (WebKit::DownloadManager::client):
1086         * NetworkProcess/Downloads/PendingDownload.cpp:
1087         (WebKit::PendingDownload::PendingDownload):
1088         (WebKit::PendingDownload::messageSenderConnection):
1089         * NetworkProcess/Downloads/PendingDownload.h:
1090         * NetworkProcess/NetworkLoadChecker.cpp:
1091         * NetworkProcess/NetworkProcess.cpp:
1092         (WebKit::NetworkProcess::NetworkProcess):
1093         (WebKit::NetworkProcess::downloadManager):
1094         * NetworkProcess/NetworkProcess.h:
1095
1096 2019-01-07  Devin Rousso  <drousso@apple.com>
1097
1098         Web Inspector: Network: show secure connection details per-request
1099         https://bugs.webkit.org/show_bug.cgi?id=191539
1100         <rdar://problem/45979891>
1101
1102         Reviewed by Joseph Pecoraro.
1103
1104         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1105         (stringForSSLProtocol): Added.
1106         (stringForSSLCipher): Added.
1107         (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
1108
1109 2019-01-07  Joseph Pecoraro  <pecoraro@apple.com>
1110
1111         Web Inspector: Remote inspector can crash if attempting to navigate inspector page
1112         https://bugs.webkit.org/show_bug.cgi?id=193204
1113         <rdar://problem/45550428>
1114
1115         Reviewed by Devin Rousso.
1116
1117         * UIProcess/mac/RemoteWebInspectorProxyMac.mm:
1118         (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):
1119         * UIProcess/mac/WKInspectorViewController.mm:
1120         (-[WKInspectorViewController webView:decidePolicyForNavigationAction:decisionHandler:]):
1121
1122 2019-01-07  Eric Carlson  <eric.carlson@apple.com>
1123
1124         Deactivate audio session whenever possible
1125         https://bugs.webkit.org/show_bug.cgi?id=193188
1126         <rdar://problem/42678977>
1127
1128         Reviewed by Jer Noble.
1129
1130         * WebProcess/WebPage/WebPage.cpp:
1131         (WebKit::WebPage::WebPage):
1132
1133 2019-01-07  Joseph Pecoraro  <pecoraro@apple.com>
1134
1135         [Cocoa] Add SPI to check if a WKWebView has an inspector frontend
1136         https://bugs.webkit.org/show_bug.cgi?id=193162
1137         <rdar://problem/24267143>
1138
1139         Reviewed by Alex Christensen.
1140
1141         * UIProcess/API/Cocoa/WKWebView.mm:
1142         (-[WKWebView _hasInspectorFrontend]):
1143         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1144         * UIProcess/WebPageProxy.h:
1145         (WebKit::WebPageProxy::hasInspectorFrontend const):
1146
1147 2019-01-07  Antti Koivisto  <antti@apple.com>
1148
1149         UI process side scrollbars for UI side compositing on Mac
1150         https://bugs.webkit.org/show_bug.cgi?id=193106
1151
1152         Reviewed by Tim Horton.
1153
1154         This patch implements Mac scrollbars on UI process side using the low level NSScrollerImp/NSScrollerPairImp
1155         SPIs. With this patch scrollbars mostly work for the main frame and also render (but can't be interacted with)
1156         for the subframes.
1157
1158         This is based on the similar code for web process side scrollbars in ScrollAnimatorMac. There is quite a bit of
1159         copy code as there is no way to share nicely. One of these will eventually go away anyway.
1160
1161         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
1162         (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
1163         (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
1164         * Shared/WebCoreArgumentCoders.cpp:
1165         (IPC::ArgumentCoder<ScrollableAreaParameters>::encode):
1166         (IPC::ArgumentCoder<ScrollableAreaParameters>::decode):
1167         * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h:
1168         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
1169         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
1170         (WebKit::RemoteScrollingCoordinatorProxy::handleMouseEvent):
1171         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
1172         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
1173         (WebKit::RemoteScrollingTree::createScrollingTreeNode):
1174         (WebKit::RemoteScrollingTree::handleMouseEvent):
1175         * UIProcess/RemoteLayerTree/RemoteScrollingTree.h:
1176         * UIProcess/RemoteLayerTree/mac: Added.
1177         * UIProcess/RemoteLayerTree/mac/ScrollerMac.h: Added.
1178
1179         Wraps NSScrollerImp for vertical or horizontal scrollbar.
1180
1181         (WebKit::ScrollerMac::pair):
1182         (WebKit::ScrollerMac::orientation const):
1183         (WebKit::ScrollerMac::hostLayer const):
1184         (WebKit::ScrollerMac::scrollerImp):
1185         * UIProcess/RemoteLayerTree/mac/ScrollerMac.mm: Added.
1186         (-[WKScrollbarPartAnimation initWithScroller:featureToAnimate:animateFrom:animateTo:duration:]):
1187         (-[WKScrollbarPartAnimation startAnimation]):
1188         (-[WKScrollbarPartAnimation setStartValue:]):
1189         (-[WKScrollbarPartAnimation setEndValue:]):
1190         (-[WKScrollbarPartAnimation setCurrentProgress:]):
1191         (-[WKScrollbarPartAnimation invalidate]):
1192         (-[WKScrollerImpDelegate initWithScroller:]):
1193         (-[WKScrollerImpDelegate cancelAnimations]):
1194         (-[WKScrollerImpDelegate scrollerPair]):
1195         (-[WKScrollerImpDelegate convertRectToBacking:]):
1196         (-[WKScrollerImpDelegate convertRectFromBacking:]):
1197         (-[WKScrollerImpDelegate layer]):
1198         (-[WKScrollerImpDelegate mouseLocationInScrollerForScrollerImp:]):
1199         (-[WKScrollerImpDelegate convertRectToLayer:]):
1200         (-[WKScrollerImpDelegate shouldUseLayerPerPartForScrollerImp:]):
1201         (-[WKScrollerImpDelegate effectiveAppearanceForScrollerImp:]):
1202         (-[WKScrollerImpDelegate setUpAlphaAnimation:scrollerPainter:part:animateAlphaTo:duration:]):
1203         (-[WKScrollerImpDelegate scrollerImp:animateKnobAlphaTo:duration:]):
1204         (-[WKScrollerImpDelegate scrollerImp:animateTrackAlphaTo:duration:]):
1205         (-[WKScrollerImpDelegate scrollerImp:animateUIStateTransitionWithDuration:]):
1206         (-[WKScrollerImpDelegate scrollerImp:animateExpansionTransitionWithDuration:]):
1207         (-[WKScrollerImpDelegate scrollerImp:overlayScrollerStateChangedTo:]):
1208         (-[WKScrollerImpDelegate invalidate]):
1209         (WebKit::ScrollerMac::ScrollerMac):
1210         (WebKit::ScrollerMac::~ScrollerMac):
1211         (WebKit::ScrollerMac::attach):
1212         (WebKit::ScrollerMac::setHostLayer):
1213         (WebKit::ScrollerMac::updatePosition):
1214         (WebKit::ScrollerMac::convertFromContent const):
1215         * UIProcess/RemoteLayerTree/mac/ScrollerPairMac.h: Added.
1216         (WebKit::ScrollerPairMac::verticalScroller):
1217         (WebKit::ScrollerPairMac::horizontalScroller):
1218         (WebKit::ScrollerPairMac::scrollerImpPair):
1219         (WebKit::ScrollerPairMac::lastKnownMousePosition const):
1220         * UIProcess/RemoteLayerTree/mac/ScrollerPairMac.mm: Added.
1221
1222         Wraps NSScrollerPairImp and owns the vertical and horizontal scrollers.
1223
1224         (-[WKScrollerImpPairDelegate initWithScrollerPair:]):
1225         (-[WKScrollerImpPairDelegate invalidate]):
1226         (-[WKScrollerImpPairDelegate contentAreaRectForScrollerImpPair:]):
1227         (-[WKScrollerImpPairDelegate inLiveResizeForScrollerImpPair:]):
1228         (-[WKScrollerImpPairDelegate mouseLocationInContentAreaForScrollerImpPair:]):
1229         (-[WKScrollerImpPairDelegate scrollerImpPair:convertContentPoint:toScrollerImp:]):
1230         (-[WKScrollerImpPairDelegate scrollerImpPair:setContentAreaNeedsDisplayInRect:]):
1231         (-[WKScrollerImpPairDelegate scrollerImpPair:updateScrollerStyleForNewRecommendedScrollerStyle:]):
1232         (WebKit::ScrollerPairMac::ScrollerPairMac):
1233         (WebKit::ScrollerPairMac::~ScrollerPairMac):
1234         (WebKit::ScrollerPairMac::handleWheelEvent):
1235         (WebKit::ScrollerPairMac::handleMouseEvent):
1236         (WebKit::ScrollerPairMac::updatePositions):
1237         (WebKit::ScrollerPairMac::contentsSize const):
1238         (WebKit::ScrollerPairMac::visibleContentsRect const):
1239         (WebKit::ScrollerPairMac::useDarkAppearance const):
1240         * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp: Added.
1241
1242         Special node for UI side Mac scrolling. Owns ScrollerPairMac instance.
1243
1244         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::ScrollingTreeFrameScrollingNodeRemoteMac):
1245         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::~ScrollingTreeFrameScrollingNodeRemoteMac):
1246         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::create):
1247         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::commitStateBeforeChildren):
1248         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::setScrollLayerPosition):
1249         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::handleWheelEvent):
1250         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::handleMouseEvent):
1251         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::scrollingTree const):
1252         * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.h: Added.
1253         * UIProcess/WebPageProxy.cpp:
1254         (WebKit::WebPageProxy::handleMouseEvent):
1255         * WebKit.xcodeproj/project.pbxproj:
1256
1257 2019-01-07  Brian Burg  <bburg@apple.com>
1258
1259         Unwanted page navigation after showing & dismissing contextual menu with control-click
1260         https://bugs.webkit.org/show_bug.cgi?id=192912
1261         <rdar://problem/46318508>
1262
1263         Reviewed by Timothy Hatcher.
1264
1265         After the conversion to use a mouse event queue, this behavior was observed rarely, especially
1266         when CPU is under load and lots of things are going on in the page. In other words, it's racy.
1267
1268         Based on NSEvent logging, it seems that when the system is under load, we simply take too long
1269         to enter the nested runloop that AppKit uses to handle events when the context menu is present.
1270         AppKit doesn't care whether or not the MouseDown triggered a nested runloop; on my machine it delivers
1271         the MouseUp event about 130ms after the MouseDown event. If we haven't show the context menu in
1272         that time, then the MouseUp is enqueued as a normal mouse event. If the Ctrl-click is on a link,
1273         then the MouseUp will be interpreted by EventHandler as a click event, which in the simplest case
1274         will initiate a main frame navigation. When the context menu is dismissed and the nested runloop
1275         is torn down, the navigation IPC message is handled in UIProcess and the page navigates away.
1276
1277         We can't do much to change AppKit's inherently racy behavior, but we can avoid processing
1278         mouse events that are delivered whilst we are processing the context menu-initiating event.
1279         From the WebProcess point of view, there is no race anymore because it does not receive the
1280         MouseUp event.
1281
1282         * UIProcess/WebPageProxy.cpp:
1283         (WebKit::WebPageProxy::showContextMenu):
1284         If new events come in, drop them on the floor. Based on testing, the nested runloop will discard
1285         the unpaired MouseUp event anyway, so this does not cause a change in behavior.
1286
1287 2019-01-07  Wenson Hsieh  <wenson_hsieh@apple.com>
1288
1289         Native caret shows up alongside the page's caret when requesting desktop site on jsfiddle.net
1290         https://bugs.webkit.org/show_bug.cgi?id=193180
1291         <rdar://problem/45971041>
1292
1293         Reviewed by Tim Horton.
1294
1295         JSFiddle uses CodeMirror; CodeMirror's editor works by capturing keystrokes and input in a hidden textarea
1296         element, and then drawing its own selection caret using web content. This textarea is hidden by being placed
1297         underneath an empty div with `overflow: hidden;`.
1298
1299         When requesting desktop site on iOS, both CodeMirror's caret and the native iOS caret are shown because iOS
1300         selection UI consists of native views overlaid on the page, whereas on macOS, the entire textarea (along with
1301         the caret) are occluded by the hidden overflow container. Additionally, various iOS behaviors related to
1302         selection and editing, such as zooming to reveal the focused element and showing the platform callout bar, are
1303         active when focusing this hidden editable area; these don't work as intended, and just interfere with the page's
1304         custom editing UI.
1305
1306         To fix this, we augment the text interaction suppression mechanism added in r238146 to detect when the focused
1307         element is in an empty `overflow: hidden` container, and bail out of native text editing behaviors.
1308
1309         * Shared/EditorState.cpp:
1310         (WebKit::EditorState::PostLayoutData::encode const):
1311         (WebKit::EditorState::PostLayoutData::decode):
1312         * Shared/EditorState.h:
1313
1314         Rename elementIsTransparent to elementIsTransparentOrFullyClipped.
1315
1316         * Shared/FocusedElementInformation.cpp:
1317         (WebKit::FocusedElementInformation::encode const):
1318         (WebKit::FocusedElementInformation::decode):
1319         * Shared/FocusedElementInformation.h:
1320         * UIProcess/ios/WKContentViewInteraction.h:
1321
1322         Rename FocusedElementIsTransparent to FocusedElementIsTransparentOrFullyClipped.
1323
1324         * UIProcess/ios/WKContentViewInteraction.mm:
1325         (-[WKContentView _zoomToRevealFocusedElement]):
1326         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
1327         (-[WKContentView _elementDidBlur]):
1328
1329         Make an additional tweak here to only stop suppressing text interaction assistant in `-_elementDidBlur` if we're
1330         not also in the middle of changing the focused element. Without this, focusing a hidden editable element while
1331         another hidden editable element is currently focused causes us to zoom to reveal the newly focused hidden
1332         editable element, when we should be avoiding this behavior.
1333
1334         (-[WKContentView _updateChangedSelection:]):
1335         * WebProcess/WebPage/ios/WebPageIOS.mm:
1336         (WebKit::WebPage::platformEditorState const):
1337         (WebKit::WebPage::getFocusedElementInformation):
1338
1339 2019-01-07  Alex Christensen  <achristensen@webkit.org>
1340
1341         Move identifierBase from SessionTracker to NetworkProcess/WebProcess
1342         https://bugs.webkit.org/show_bug.cgi?id=193201
1343
1344         Reviewed by Tim Horton.
1345
1346         No change in behavior.  This just reduces process-global state.
1347
1348         * NetworkProcess/NetworkProcess.h:
1349         (WebKit::NetworkProcess::uiProcessBundleIdentifier const):
1350         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1351         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
1352         * NetworkProcess/mac/RemoteNetworkingContext.mm:
1353         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
1354         * Shared/SessionTracker.cpp:
1355         (WebKit::identifierBase): Deleted.
1356         (WebKit::SessionTracker::getIdentifierBase): Deleted.
1357         (WebKit::SessionTracker::setIdentifierBase): Deleted.
1358         * Shared/SessionTracker.h:
1359         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
1360         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
1361         (WebKit::WebFrameNetworkingContext::sourceApplicationIdentifier const):
1362         * WebProcess/WebProcess.h:
1363         (WebKit::WebProcess::uiProcessBundleIdentifier const):
1364         * WebProcess/cocoa/WebProcessCocoa.mm:
1365         (WebKit::WebProcess::platformInitializeWebProcess):
1366
1367 2019-01-07  Alex Christensen  <achristensen@webkit.org>
1368
1369         Reduce use of NetworkProcess::singleton
1370         https://bugs.webkit.org/show_bug.cgi?id=193197
1371
1372         Reviewed by Brady Eidson.
1373
1374         Pass it around as a Ref<NetworkProcess> as a step towards reducing global state.
1375         Soup's WebFrameNetworkingContext no longer makes a NetworkSession like all other ports
1376         because networking is no longer done in the WebProcess.
1377
1378         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
1379         (WebKit::WebIDBConnectionToClient::create):
1380         (WebKit::WebIDBConnectionToClient::WebIDBConnectionToClient):
1381         (WebKit::WebIDBConnectionToClient::disconnectedFromWebProcess):
1382         (WebKit::WebIDBConnectionToClient::deleteDatabase):
1383         (WebKit::WebIDBConnectionToClient::openDatabase):
1384         (WebKit::WebIDBConnectionToClient::abortTransaction):
1385         (WebKit::WebIDBConnectionToClient::commitTransaction):
1386         (WebKit::WebIDBConnectionToClient::didFinishHandlingVersionChangeTransaction):
1387         (WebKit::WebIDBConnectionToClient::createObjectStore):
1388         (WebKit::WebIDBConnectionToClient::deleteObjectStore):
1389         (WebKit::WebIDBConnectionToClient::renameObjectStore):
1390         (WebKit::WebIDBConnectionToClient::clearObjectStore):
1391         (WebKit::WebIDBConnectionToClient::createIndex):
1392         (WebKit::WebIDBConnectionToClient::deleteIndex):
1393         (WebKit::WebIDBConnectionToClient::renameIndex):
1394         (WebKit::WebIDBConnectionToClient::putOrAdd):
1395         (WebKit::WebIDBConnectionToClient::getRecord):
1396         (WebKit::WebIDBConnectionToClient::getAllRecords):
1397         (WebKit::WebIDBConnectionToClient::getCount):
1398         (WebKit::WebIDBConnectionToClient::deleteRecord):
1399         (WebKit::WebIDBConnectionToClient::openCursor):
1400         (WebKit::WebIDBConnectionToClient::iterateCursor):
1401         (WebKit::WebIDBConnectionToClient::establishTransaction):
1402         (WebKit::WebIDBConnectionToClient::databaseConnectionPendingClose):
1403         (WebKit::WebIDBConnectionToClient::databaseConnectionClosed):
1404         (WebKit::WebIDBConnectionToClient::abortOpenAndUpgradeNeeded):
1405         (WebKit::WebIDBConnectionToClient::didFireVersionChangeEvent):
1406         (WebKit::WebIDBConnectionToClient::openDBRequestCancelled):
1407         (WebKit::WebIDBConnectionToClient::confirmDidCloseFromServer):
1408         (WebKit::WebIDBConnectionToClient::getAllDatabaseNames):
1409         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
1410         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1411         (WebKit::NetworkConnectionToWebProcess::create):
1412         (WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):
1413         (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
1414         (WebKit::NetworkConnectionToWebProcess::didClose):
1415         (WebKit::NetworkConnectionToWebProcess::createSocketStream):
1416         (WebKit::NetworkConnectionToWebProcess::prefetchDNS):
1417         (WebKit::NetworkConnectionToWebProcess::startDownload):
1418         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
1419         (WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession):
1420         (WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer):
1421         (WebKit::NetworkConnectionToWebProcess::establishSWServerConnection):
1422         * NetworkProcess/NetworkConnectionToWebProcess.h:
1423         (WebKit::NetworkConnectionToWebProcess::networkProcess):
1424         * NetworkProcess/NetworkProcess.cpp:
1425         (WebKit::NetworkProcess::singleton):
1426         (WebKit::NetworkProcess::initializeNetworkProcess):
1427         (WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
1428         (WebKit::NetworkProcess::addWebsiteDataStore):
1429         (WebKit::fetchDiskCacheEntries):
1430         (WebKit::NetworkProcess::fetchWebsiteData):
1431         (WebKit::clearDiskCacheEntries):
1432         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
1433         (WebKit::NetworkProcess::getNetworkProcessStatistics):
1434         (WebKit::NetworkProcess::idbServer):
1435         * NetworkProcess/NetworkProcess.h:
1436         * NetworkProcess/NetworkResourceLoader.cpp:
1437         (WebKit::NetworkResourceLoader::startNetworkLoad):
1438         (WebKit::NetworkResourceLoader::convertToDownload):
1439         (WebKit::NetworkResourceLoader::isAlwaysOnLoggingAllowed const):
1440         * NetworkProcess/NetworkSession.cpp:
1441         (WebKit::NetworkSession::create):
1442         (WebKit::NetworkSession::NetworkSession):
1443         * NetworkProcess/NetworkSession.h:
1444         (WebKit::NetworkSession::networkProcess):
1445         * NetworkProcess/RemoteNetworkingContext.h:
1446         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1447         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
1448         (WebKit::NetworkDataTaskCocoa::isAlwaysOnLoggingAllowed const):
1449         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1450         (WebKit::NetworkProcess::clearDiskCache):
1451         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
1452         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1453         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
1454         (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
1455         (-[WKNetworkSessionDelegate URLSession:downloadTask:didFinishDownloadingToURL:]):
1456         (-[WKNetworkSessionDelegate URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:]):
1457         (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]):
1458         (WebKit::NetworkSessionCocoa::create):
1459         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
1460         * NetworkProcess/curl/NetworkSessionCurl.cpp:
1461         (WebKit::NetworkSessionCurl::NetworkSessionCurl):
1462         * NetworkProcess/curl/NetworkSessionCurl.h:
1463         * NetworkProcess/mac/RemoteNetworkingContext.mm:
1464         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
1465         * NetworkProcess/soup/NetworkSessionSoup.cpp:
1466         (WebKit::NetworkSessionSoup::NetworkSessionSoup):
1467         * NetworkProcess/soup/NetworkSessionSoup.h:
1468
1469 2019-01-07  Alex Christensen  <achristensen@webkit.org>
1470
1471         Modernize CacheModel and disk cache fetching and clearing
1472         https://bugs.webkit.org/show_bug.cgi?id=193164
1473
1474         Reviewed by Joseph Pecoraro.
1475
1476         fetchDiskCacheEntries and clearDiskCacheEntries now use an early-return model.
1477         CacheModel is now an enum class.
1478
1479         * NetworkProcess/NetworkProcess.cpp:
1480         (WebKit::NetworkProcess::NetworkProcess):
1481         (WebKit::NetworkProcess::initializeNetworkProcess):
1482         (WebKit::fetchDiskCacheEntries):
1483         (WebKit::NetworkProcess::fetchWebsiteData):
1484         (WebKit::clearDiskCacheEntries):
1485         (WebKit::NetworkProcess::setCacheModel):
1486         * NetworkProcess/NetworkProcess.h:
1487         * NetworkProcess/NetworkProcess.messages.in:
1488         * NetworkProcess/NetworkProcessCreationParameters.h:
1489         * NetworkProcess/cache/NetworkCacheEntry.cpp:
1490         (WebKit::NetworkCache::Entry::initializeShareableResourceHandleFromStorageRecord const):
1491         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1492         (WebKit::NetworkProcess::clearDiskCache):
1493         * Shared/CacheModel.cpp:
1494         (WebKit::calculateMemoryCacheSizes):
1495         (WebKit::calculateURLCacheSizes):
1496         * Shared/CacheModel.h:
1497         (): Deleted.
1498         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1499         (API::ProcessPoolConfiguration::createWithLegacyOptions):
1500         * UIProcess/API/APIProcessPoolConfiguration.h:
1501         * UIProcess/API/C/WKAPICast.h:
1502         (WebKit::toCacheModel):
1503         (WebKit::toAPI):
1504         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
1505         (-[_WKProcessPoolConfiguration pageCacheEnabled]):
1506         (-[_WKProcessPoolConfiguration setPageCacheEnabled:]):
1507         * WebProcess/WebProcess.cpp:
1508         (WebKit::WebProcess::initializeWebProcess):
1509         (WebKit::WebProcess::setCacheModel):
1510         (WebKit::WebProcess::clearResourceCaches):
1511         * WebProcess/WebProcess.h:
1512         * WebProcess/WebProcess.messages.in:
1513
1514 2019-01-06  Jiewen Tan  <jiewen_tan@apple.com>
1515
1516         [WebAuthN] Import U2F command/response converters from Chromium
1517         https://bugs.webkit.org/show_bug.cgi?id=193150
1518         <rdar://problem/47054028>
1519
1520         Reviewed by Brent Fulgham.
1521
1522         Moves helper functions to WebAuthenticationUtils.
1523
1524         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
1525         (WebKit::LocalAuthenticatorInternal::produceHashSet):
1526         (WebKit::LocalAuthenticator::continueMakeCredentialAfterAttested):
1527         (): Deleted.
1528         (WebKit::LocalAuthenticatorInternal::buildAuthData): Deleted.
1529         * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
1530         (WebKit::MockHidConnection::feedReports):
1531
1532 2019-01-04  Joseph Pecoraro  <pecoraro@apple.com>
1533
1534         Web Inspector: Use save sheet instead of dialog where possible
1535         https://bugs.webkit.org/show_bug.cgi?id=193160
1536         <rdar://problem/37399759>
1537
1538         Reviewed by Devin Rousso.
1539
1540         * UIProcess/mac/RemoteWebInspectorProxyMac.mm:
1541         (WebKit::RemoteWebInspectorProxy::platformSave):
1542         * UIProcess/mac/WebInspectorProxyMac.mm:
1543         (WebKit::WebInspectorProxy::platformSave):
1544
1545 2019-01-04  Jer Noble  <jer.noble@apple.com>
1546
1547         [WebKitLegacy] Media playback pauses on scroll
1548         https://bugs.webkit.org/show_bug.cgi?id=192829
1549
1550         Reviewed by Eric Carlson.
1551
1552         Add a new WebPage, WebPageProxy, & WKWebView SPI to stop, suspend, and resume all
1553         existing media playback in the page.
1554
1555         * UIProcess/API/Cocoa/WKWebView.mm:
1556         (-[WKWebView _stopAllMediaPlayback]):
1557         (-[WKWebView _suspendAllMediaPlayback]):
1558         (-[WKWebView _resumeAllMediaPlayback]):
1559         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1560         * UIProcess/WebPageProxy.cpp:
1561         (WebKit::WebPageProxy::stopAllMediaPlayback):
1562         (WebKit::WebPageProxy::suspendAllMediaPlayback):
1563         (WebKit::WebPageProxy::resumeAllMediaPlayback):
1564         * UIProcess/WebPageProxy.h:
1565         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
1566         (-[WKFullScreenViewController _showPhishingAlert]):
1567         * WebProcess/WebPage/WebPage.cpp:
1568         (WebKit::WebPage::stopAllMediaPlayback):
1569         (WebKit::WebPage::suspendAllMediaPlayback):
1570         (WebKit::WebPage::resumeAllMediaPlayback):
1571         * WebProcess/WebPage/WebPage.h:
1572         * WebProcess/WebPage/WebPage.messages.in:
1573
1574 2019-01-04  Chris Dumez  <cdumez@apple.com>
1575
1576         Add support for toggling device orientation API support per site
1577         https://bugs.webkit.org/show_bug.cgi?id=193143
1578         <rdar://problem/46605724>
1579
1580         Reviewed by Alex Christensen.
1581
1582         Add support for toggling device orientation API support per site via _WKWebsitePolicies.
1583
1584         * Shared/WebsitePoliciesData.cpp:
1585         (WebKit::WebsitePoliciesData::encode const):
1586         (WebKit::WebsitePoliciesData::decode):
1587         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
1588         * Shared/WebsitePoliciesData.h:
1589         * UIProcess/API/APIWebsitePolicies.cpp:
1590         (API::WebsitePolicies::data):
1591         * UIProcess/API/APIWebsitePolicies.h:
1592         * UIProcess/API/Cocoa/WKWebView.mm:
1593         (-[WKWebView _simulateDeviceOrientationChangeWithAlpha:beta:gamma:]):
1594         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1595         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
1596         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
1597         (-[_WKWebsitePolicies setDeviceOrientationEventEnabled:]):
1598         (-[_WKWebsitePolicies deviceOrientationEventEnabled]):
1599         * UIProcess/WebPageProxy.cpp:
1600         (WebKit::WebPageProxy::simulateDeviceOrientationChange):
1601         * UIProcess/WebPageProxy.h:
1602         * WebProcess/WebPage/WebPage.cpp:
1603         (WebKit::WebPage::simulateDeviceOrientationChange):
1604         * WebProcess/WebPage/WebPage.h:
1605         * WebProcess/WebPage/WebPage.messages.in:
1606
1607 2019-01-04  Chris Dumez  <cdumez@apple.com>
1608
1609         Crash under WebPageProxy::continueNavigationInNewProcess()
1610         https://bugs.webkit.org/show_bug.cgi?id=193113
1611         <rdar://problem/46938686>
1612
1613         Reviewed by Brady Eidson.
1614
1615         The crash was happening in continueNavigationInNewProcess() when dereferencing
1616         the Optional<> value returned by API::Navigation::backForwardFrameLoadType(), after verifying
1617         that API::Navigation::targetItem() is not null.
1618
1619         When constructing an API::Navigation object with a targetItem, you HAVE to pass
1620         in a backForwardFrameLoadType as well so this normally is not possible. However,
1621         it can happen because API::Navigation::setTargetItem() can get called later on and
1622         set a target item on a Navigation object which potentially does not have a
1623         backForwardFrameLoadType. This setter was only called in one place in
1624         decidePolicyForNavigationAction() to update an existing Navigation object using
1625         the targetItem provided by a NavigationAction. This logic was added with PSON
1626         support.
1627
1628         Because I was unable to write a test case reproducing this and because I do not know
1629         how it can happen in practice that we'd have a NavigationAction with a targetItem
1630         even though the Navigation object itself is not for a back/forward navigation, I have
1631         chosen to drop the unsafe API::Navigation::setTargetItem() setter and the call site.
1632         When the call site was added, with ProcessSwap.NavigateToDataURLThenBack API test,
1633         the intention was to create a back/forward navigation object instead of a standard load
1634         navigation one if there is currently no existing Navigation object in the UIProcess.
1635         This can happen when the back/forward navigation is triggered by the WebProcess via
1636         JS (e.g. history.back()) and this is what the API test covers. The part of the logic
1637         that updates an existing Navigation object with a targetItem coming from the
1638         NavigationAction is untested and I have no evidence it does anything useful. However,
1639         we DO have evidence that it can cause crashes.
1640
1641         * UIProcess/API/APINavigation.h:
1642         * UIProcess/WebPageProxy.cpp:
1643         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1644
1645 2019-01-04  Tim Horton  <timothy_horton@apple.com>
1646
1647         Remove some nonexistent files from the WebKit Xcode project
1648
1649         * WebKit.xcodeproj/project.pbxproj:
1650         r238468 and r237205 forgot to remove some files from the project.
1651
1652 2019-01-04  Youenn Fablet  <youenn@apple.com>
1653
1654         CSP violation reports should bypass CSP checks
1655         https://bugs.webkit.org/show_bug.cgi?id=192857
1656         <rdar://problem/46887236>
1657
1658         Reviewed by Chris Dumez.
1659
1660         * WebProcess/Network/WebLoaderStrategy.cpp:
1661         (WebKit::WebLoaderStrategy::startPingLoad):
1662         * WebProcess/Network/WebLoaderStrategy.h:
1663
1664 2019-01-04  Alex Christensen  <achristensen@webkit.org>
1665
1666         Use WebsiteDataStoreParameters instead of NetworkProcessCreationParameters for IndexedDB directories
1667         https://bugs.webkit.org/show_bug.cgi?id=193114
1668
1669         Reviewed by Brady Eidson.
1670
1671         * NetworkProcess/NetworkProcess.cpp:
1672         (WebKit::NetworkProcess::initializeNetworkProcess):
1673         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1674         (WebKit::NetworkProcessCreationParameters::encode const):
1675         (WebKit::NetworkProcessCreationParameters::decode):
1676         * NetworkProcess/NetworkProcessCreationParameters.h:
1677         * UIProcess/WebProcessPool.cpp:
1678         (WebKit::WebProcessPool::ensureNetworkProcess):
1679
1680 2019-01-04  Alex Christensen  <achristensen@webkit.org>
1681
1682         Deprecate WKContextCreate
1683         https://bugs.webkit.org/show_bug.cgi?id=193118
1684
1685         Reviewed by Brady Eidson.
1686
1687         It has only one use that is being removed in rdar://problem/47030792
1688         This is a step towards removing ProcessPoolConfiguration::createWithLegacyOptions.
1689         Also make WKContextCreateWithConfiguration accept a null configuration to make it easier to use.
1690
1691         * UIProcess/API/C/WKContext.cpp:
1692         (WKContextCreateWithConfiguration):
1693         * UIProcess/API/C/WKContext.h:
1694
1695 2019-01-04  Tim Horton  <timothy_horton@apple.com>
1696
1697         Fix the build
1698
1699         * UIProcess/ios/WKContentViewInteraction.mm:
1700         (-[WKContentView cleanupInteraction]):
1701
1702 2019-01-04  Tim Horton  <timothy_horton@apple.com>
1703
1704         Share ink choice and ruler between all editable images
1705         https://bugs.webkit.org/show_bug.cgi?id=193130
1706         <rdar://problem/46826491>
1707
1708         Reviewed by Wenson Hsieh.
1709
1710         * SourcesCocoa.txt:
1711         Add WKDrawingCoordinator, which maintains WKWebView-wide drawing state,
1712         and manages a single shared ink picker.
1713
1714         * UIProcess/PageClient.h:
1715         (WebKit::PageClient::createDrawingView):
1716         * UIProcess/ios/EditableImageController.mm:
1717         (WebKit::EditableImageController::ensureEditableImage):
1718         * UIProcess/ios/PageClientImplIOS.h:
1719         * UIProcess/ios/PageClientImplIOS.mm:
1720         (WebKit::PageClientImpl::createDrawingView):
1721         Plumb WKDrawingView creation through PageClient, so that it can be instantiated
1722         with knowledge of its owning WKContentView.
1723
1724         * UIProcess/ios/WKContentViewInteraction.h:
1725         * UIProcess/ios/WKContentViewInteraction.mm:
1726         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
1727         (-[WKContentView _elementDidBlur]):
1728         (-[WKContentView _drawingCoordinator]):
1729         (-[WKContentView _installInkPickerForDrawingViewWithID:]): Deleted.
1730         (-[WKContentView _uninstallInkPicker]): Deleted.
1731         Move ink picker management into WKDrawingCoordinator.
1732
1733         * UIProcess/ios/WKDrawingView.h:
1734         * UIProcess/ios/WKDrawingView.mm:
1735         (-[WKDrawingView initWithEmbeddedViewID:contentView:]):
1736         (-[WKDrawingView _canvasViewWillBeginDrawing:]):
1737         (-[WKDrawingView invalidateAttachment]):
1738         (-[WKDrawingView didChangeRulerState:]):
1739         (-[WKDrawingView initWithEmbeddedViewID:webPageProxy:]): Deleted.
1740         (-[WKDrawingView canvasView]): Deleted.
1741         Use a shared ruler, owned by WKDrawingCoordinator.
1742         Update the editable image's ink when drawing begins. This way, we don't have
1743         to push ink changes to all drawings as they happen.
1744
1745         * UIProcess/ios/WKInkPickerView.h:
1746         * UIProcess/ios/WKInkPickerView.mm:
1747         (-[WKInkPickerView initWithContentView:]):
1748         (-[WKInkPickerView inlineInkPickerDidToggleRuler:]):
1749         (-[WKInkPickerView viewControllerForPopoverPresentationFromInlineInkPicker:]):
1750         (-[WKInkPickerView setInk:]):
1751         (-[WKInkPickerView ink]):
1752         (-[WKInkPickerView initWithDrawingView:]): Deleted.
1753         (-[WKInkPickerView didPickInk]): Deleted.
1754         (-[WKInkPickerView inlineInkPicker:didSelectTool:]): Deleted.
1755         (-[WKInkPickerView inlineInkPicker:didSelectColor:]): Deleted.
1756         * WebKit.xcodeproj/project.pbxproj:
1757
1758 2019-01-04  Wenson Hsieh  <wenson_hsieh@apple.com>
1759
1760         [Cocoa] Merge WebEditCommandProxy::nameForEditAction and undoNameForEditAction into a single function
1761         https://bugs.webkit.org/show_bug.cgi?id=193129
1762
1763         Reviewed by Tim Horton.
1764
1765         Remove WebEditCommandProxy::nameForEditAction and use WebCore::nameForUndoRedo instead.
1766
1767         * UIProcess/Cocoa/WebViewImpl.mm:
1768         (WebKit::WebViewImpl::registerEditCommand):
1769         * UIProcess/WebEditCommandProxy.cpp:
1770         (WebKit::WebEditCommandProxy::WebEditCommandProxy):
1771         (WebKit::WebEditCommandProxy::~WebEditCommandProxy):
1772         (WebKit::WebEditCommandProxy::nameForEditAction): Deleted.
1773         * UIProcess/WebEditCommandProxy.h:
1774         * UIProcess/WebPageProxy.cpp:
1775         (WebKit::WebPageProxy::addEditCommand):
1776         (WebKit::WebPageProxy::removeEditCommand):
1777         (WebKit::WebPageProxy::isValidEditCommand): Deleted.
1778
1779         Bit of drive-by refactoring: remove an unused function, and make addEditCommand and removeEditCommand take
1780         references instead of pointers, since these are assumed to be nonnull.
1781
1782         * UIProcess/WebPageProxy.h:
1783         * UIProcess/ios/PageClientImplIOS.mm:
1784         (WebKit::PageClientImpl::registerEditCommand):
1785
1786 2019-01-03  Matt Rajca  <mrajca@apple.com>
1787
1788         Make DidPlayMediaPreventedFromPlaying autoplay event more generic.
1789         https://bugs.webkit.org/show_bug.cgi?id=193128
1790         rdar://34554231
1791
1792         Reviewed by Jer Noble.
1793
1794         Today, the "DidPlayMediaPreventedFromPlaying" autoplay event is only sent for
1795         media prevented from autoplaying. It could be generalized to a "DidPlayMediaWithUserGesture"
1796         event along with a flag that indicates whether or not autoplay was actually prevented.
1797
1798         Tests: existing API tests were updated to reflect the new names. New API tests
1799         were added for the new case in which the "DidPlayMediaWithUserGesture" event is sent.
1800
1801         * Shared/WebCoreArgumentCoders.h: Take into account new flags.
1802         * UIProcess/API/C/WKPage.cpp: Ditto.
1803         (WKPageSetPageUIClient):
1804         * UIProcess/API/C/WKPageUIClient.h: Ditto.
1805         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Ditto.
1806         * UIProcess/Cocoa/UIDelegate.mm: Ditto.
1807         (WebKit::toWKAutoplayEventFlags):
1808         (WebKit::toWKAutoplayEvent):
1809
1810 2019-01-04  Fujii Hironori  <Hironori.Fujii@sony.com>
1811
1812         [curl] Move cookiePersistentStorageFile from NetworkProcessCreationParameters to NetworkSessionCreationParameters
1813         https://bugs.webkit.org/show_bug.cgi?id=192970
1814
1815         Reviewed by Alex Christensen.
1816
1817         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1818         (WebKit::NetworkProcessCreationParameters::encode const): Removed code for cookiePersistentStorageFile.
1819         (WebKit::NetworkProcessCreationParameters::decode): Ditto.
1820         * NetworkProcess/NetworkProcessCreationParameters.h: Ditto.
1821         * NetworkProcess/curl/NetworkProcessCurl.cpp:
1822         (WebKit::NetworkProcess::platformInitializeNetworkProcess): Ditto.
1823
1824         * NetworkProcess/NetworkSessionCreationParameters.cpp:
1825         (WebKit::NetworkSessionCreationParameters::privateSessionParameters): Added code for cookiePersistentStorageFile.
1826         (WebKit::NetworkSessionCreationParameters::encode const): Ditto.
1827         (WebKit::NetworkSessionCreationParameters::decode): Ditto.
1828         * NetworkProcess/NetworkSessionCreationParameters.h: Ditto.
1829         * NetworkProcess/curl/NetworkSessionCurl.cpp:
1830         (WebKit::NetworkSessionCurl::NetworkSessionCurl): Ditto.
1831
1832         * NetworkProcess/Cookies/WebCookieManager.h: Removed setCookiePersistentStorage method of curl port extension.
1833         * NetworkProcess/Cookies/curl/WebCookieManagerCurl.cpp:
1834         (WebKit::WebCookieManager::setCookiePersistentStorage): Deleted.
1835
1836 2019-01-04  Chris Dumez  <cdumez@apple.com>
1837
1838         [PSON] Calling history.back() from inside the load event handler prevents process-swapping
1839         https://bugs.webkit.org/show_bug.cgi?id=193120
1840
1841         Reviewed by Alex Christensen.
1842
1843         A HistoryItem is created only *after* we've fired the load event. As a result, if you call
1844         history.back() in JS from inside the load event handler, the current HistoryItem and and
1845         the target HistoryItem will be the same. This is normally not an issue. However, there was
1846         logic inside of WebProcessPool::processForNavigationInternal() which would compare the
1847         processID of the source and destination BackForwardListItems and which would force a process
1848         reuse if both BackForwardListItems came from the same WebContent process. So even though
1849         we swapped when doing a standard load from site A to site B, we would fail to swap if site
1850         B called history.back() from inside its load event handler.
1851
1852         To address the issue, stop relying on the source backforward item's processID. Instead, just
1853         use the WebContent process matching the destination backforward item's processID if it still
1854         exists.
1855
1856         * UIProcess/WebProcessPool.cpp:
1857         (WebKit::WebProcessPool::processForNavigationInternal):
1858
1859 2019-01-04  Keith Rollin  <krollin@apple.com>
1860
1861         Bring back parent processID for logging
1862         https://bugs.webkit.org/show_bug.cgi?id=193121
1863         <rdar://problem/47031634>
1864
1865         Reviewed by Alex Christensen.
1866
1867         Bug 192961 removes presentingApplicationPID from
1868         NetworkProcessCreationParameters because it was (a) stored in some
1869         global state, the use of which is being minimized, and (b) it was
1870         largely unused. However, it was actually still being used in some
1871         useful logging in order to tie together child processes with their
1872         parent process. Re-introduce this value in NetworkLoadParameters so
1873         that we can log it.
1874
1875         * NetworkProcess/NetworkLoadParameters.h:
1876         * NetworkProcess/NetworkResourceLoadParameters.cpp:
1877         (WebKit::NetworkResourceLoadParameters::encode const):
1878         (WebKit::NetworkResourceLoadParameters::decode):
1879         * NetworkProcess/NetworkResourceLoader.cpp:
1880         (WebKit::NetworkResourceLoader::start):
1881         * WebProcess/Network/WebLoaderStrategy.cpp:
1882         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
1883         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
1884         (WebKit::WebLoaderStrategy::startPingLoad):
1885         (WebKit::WebLoaderStrategy::preconnectTo):
1886
1887 2019-01-04  Youenn Fablet  <youenn@apple.com>
1888
1889         Make RestrictedHTTPResponseAccess an internal flag
1890         https://bugs.webkit.org/show_bug.cgi?id=193145
1891
1892         Reviewed by Chris Dumez.
1893
1894         * Shared/WebPreferences.yaml: This will ease debugging.
1895
1896 2019-01-04  Per Arne Vollan  <pvollan@apple.com>
1897
1898         [iOS] Enable logging for services in sandbox
1899         https://bugs.webkit.org/show_bug.cgi?id=192705
1900
1901         Reviewed by Brent Fulgham.
1902
1903         When running layout tests, we didn’t see 107 services being looked up through launchd. We should
1904         add logging to these services to determine which services we actually need in the sandbox.
1905
1906         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1907
1908 2019-01-04  Commit Queue  <commit-queue@webkit.org>
1909
1910         Unreviewed, rolling out r239603.
1911         https://bugs.webkit.org/show_bug.cgi?id=193146
1912
1913         Breaks shipping tests (Requested by bfulgha__ on #webkit).
1914
1915         Reverted changeset:
1916
1917         "[iOS] Update sandbox profile to use iconservices instead of
1918         lsdiconservice"
1919         https://bugs.webkit.org/show_bug.cgi?id=193115
1920         https://trac.webkit.org/changeset/239603
1921
1922 2019-01-04  Chris Dumez  <cdumez@apple.com>
1923
1924         Crash under WebProcessPool::addSuspendedPage()
1925         https://bugs.webkit.org/show_bug.cgi?id=193110
1926
1927         Reviewed by Youenn Fablet.
1928
1929         When PageCache is disabled, WebProcessPool::m_maxSuspendedPageCount is 0 and WebProcessPool::addSuspendedPage()
1930         would call m_suspendedPages.removeFirst() even though m_suspendedPages is empty, causing a crash.
1931         Do an early return when m_maxSuspendedPageCount is 0 since we do not want to add any suspended page in this
1932         case.
1933
1934         * UIProcess/WebProcessPool.cpp:
1935         (WebKit::WebProcessPool::addSuspendedPage):
1936
1937 2019-01-03  Brent Fulgham  <bfulgham@apple.com>
1938
1939         [iOS] Silently deny access to mail settings triggered by MessageUI framework
1940         https://bugs.webkit.org/show_bug.cgi?id=193123
1941         <rdar://problem/42485581>
1942
1943         Reviewed by Alexey Proskuryakov.
1944
1945         Remove unhelpful logging generated when we block access to non-WebKit preferences. These
1946         invalid checks are done by an system framework that we cannot modify.
1947
1948         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1949
1950 2019-01-03  Brent Fulgham  <bfulgham@apple.com>
1951
1952         [iOS] Update sandbox profile to use iconservices instead of lsdiconservice
1953         https://bugs.webkit.org/show_bug.cgi?id=193115
1954         <rdar://problem/44867379>
1955
1956         Reviewed by Eric Carlson.
1957
1958         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1959
1960 2019-01-03  Brent Fulgham  <bfulgham@apple.com>
1961
1962         Remove logic handling DNT header during redirects
1963         https://bugs.webkit.org/show_bug.cgi?id=193082
1964         <rdar://problem/45555965>
1965
1966         Reviewed by Chris Dumez.
1967
1968         Test: http/wpt/fetch/dnt-header-after-redirection.html.
1969
1970         Don't bother looking for (or passing along) DNT headers during redirects.
1971
1972         * NetworkProcess/NetworkLoadChecker.cpp:
1973         (WebKit::NetworkLoadChecker::check):
1974         (WebKit::NetworkLoadChecker::prepareRedirectedRequest): Deleted.
1975         * NetworkProcess/NetworkLoadChecker.h:
1976         * NetworkProcess/NetworkResourceLoader.cpp:
1977         (WebKit::NetworkResourceLoader::restartNetworkLoad):
1978         (WebKit::NetworkResourceLoader::continueWillSendRequest):
1979         * NetworkProcess/PingLoad.cpp:
1980         (WebKit::PingLoad::willPerformHTTPRedirection):
1981
1982 2019-01-03  Chris Dumez  <cdumez@apple.com>
1983
1984         Add release logging to help debug HTTPS upgrade issues
1985         https://bugs.webkit.org/show_bug.cgi?id=193075
1986
1987         Reviewed by Alex Christensen.
1988
1989         Add release logging to help debug HTTPS upgrade issues like Bug 193026.
1990
1991         * NetworkProcess/NetworkHTTPSUpgradeChecker.cpp:
1992         (WebKit::NetworkHTTPSUpgradeChecker::NetworkHTTPSUpgradeChecker):
1993         (WebKit::NetworkHTTPSUpgradeChecker::query):
1994
1995 2019-01-03  Alex Christensen  <achristensen@webkit.org>
1996
1997         NetworkProcess should initialize its default NetworkSession with parameters from the UIProcess
1998         https://bugs.webkit.org/show_bug.cgi?id=192967
1999
2000         Reviewed by Brent Fulgham.
2001
2002         I moved 3 of the NetworkProcessCreationParameters to use corresponding values of a WebsiteDataStoreParameters.
2003         More will be moved in the near future, like indexedDatabaseDirectory.
2004
2005         * NetworkProcess/NetworkProcess.cpp:
2006         (WebKit::NetworkProcess::initializeNetworkProcess):
2007         * NetworkProcess/NetworkProcessCreationParameters.cpp:
2008         (WebKit::NetworkProcessCreationParameters::encode const):
2009         (WebKit::NetworkProcessCreationParameters::decode):
2010         * NetworkProcess/NetworkProcessCreationParameters.h:
2011         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2012         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2013         * UIProcess/WebProcessPool.cpp:
2014         (WebKit::WebProcessPool::ensureNetworkProcess):
2015
2016 2019-01-03  Wenson Hsieh  <wenson_hsieh@apple.com>
2017
2018         [iOS] REGRESSION (r239441): Tab cycling to offscreen <select> may not scroll it into view
2019         https://bugs.webkit.org/show_bug.cgi?id=193084
2020         <rdar://problem/47006882>
2021
2022         Reviewed by Simon Fraser.
2023
2024         In `WKWebView.mm`, `-_zoomToFocusRect:` will ignore the given selection rect if it is of size `{ 0, 0 }` and at
2025         the origin. Prior to r239441, when using the tab key to move focus between non-editable form controls (or any
2026         other method that doesn't involve tapping on the focused select element, with the exception of the next and
2027         previous buttons in the input accessory view), we would compute a selection rect of `{{ 0, 0 }, { 0, 0 }}`, and
2028         subsequently try to scroll the focused element to the center of the visible area, without taking the selection
2029         rect into account.
2030
2031         However, after r239441, the web process sends the element interaction location to the UI process, which then
2032         computes the selection rect by taking this location and adding a size of `{ 1, 1 }` (before r239441, this was
2033         done in `WebPage::getAssistedNodeInformation`). However, our new implementation doesn't take into account the
2034         case where the element interaction rect is null, which happens when the last interaction location is outside of
2035         the bounding rect of the element. In this case, we set the element interaction location to { 0, 0 } and end up
2036         computing a selection rect of `{{ 0, 0 }, { 1, 1 }}` instead of `{{ 0, 0 }, { 0, 0 }}` as we would have
2037         previously done. This causes us to scroll up to the origin, instead of revealing the focused element.
2038
2039         To fix this, we restore the pre-r239441 behavior. See additional comments below for details.
2040
2041         Test: fast/forms/ios/scroll-to-reveal-focused-select.html
2042
2043         * Shared/FocusedElementInformation.cpp:
2044         (WebKit::FocusedElementInformation::encode const):
2045         (WebKit::FocusedElementInformation::decode):
2046         * Shared/FocusedElementInformation.h:
2047
2048         Rename `elementInteractionLocation` to `lastInteractionLocation`. This was previously
2049         `elementInteractionLocation` due to existing logic that tries to move the interaction location into the bounding
2050         rect of the element in the case where visual viewports are disabled; however, since this feature has long been
2051         enabled by default for all modern WebKit clients (internal and external), it's simpler to just use always send
2052         the last interaction location over to the UI process, and have the UI process use `{{ 0, 0 }, { 0, 0 }}` if
2053         the interaction location is outside of the element rect.
2054
2055         In the very unlikely event that any modern WebKit client disables visual viewports, this will still behave
2056         reasonably, since we'll just use `{{ 0, 0 }, { 0, 0 }}` as the target rect and scroll to reveal the entire
2057         element rather than the top left corner of the element.
2058
2059         * UIProcess/ios/WKContentViewInteraction.mm:
2060         (rectToRevealWhenZoomingToFocusedElement):
2061         * WebProcess/WebPage/ios/WebPageIOS.mm:
2062
2063         Move the check for whether the interaction location is inside the element's bounding rect from the web process
2064         to the UI process. This relocates the logic to determine whether the selection rect should be a 1 by 1 fallback
2065         interaction rect or the zero rect (`{{ 0, 0 }, { 0, 0 }}`) closer to the code that actually uses this rect.
2066
2067         (WebKit::WebPage::getFocusedElementInformation):
2068
2069 2019-01-03  Wenson Hsieh  <wenson_hsieh@apple.com>
2070
2071         WebUndoStep's monotonically increasing identifier should be a WebUndoStepID instead of uint64_t
2072         https://bugs.webkit.org/show_bug.cgi?id=193100
2073
2074         Reviewed by Simon Fraser.
2075
2076         Add a type alias, WebUndoStepID, to represent the monotonically increasing undo step ID for each undoable
2077         editing command, and use this type alias in lieu of `uint64_t`. No change in behavior.
2078
2079         * UIProcess/WebEditCommandProxy.cpp:
2080         (WebKit::WebEditCommandProxy::WebEditCommandProxy):
2081         * UIProcess/WebEditCommandProxy.h:
2082         (WebKit::WebEditCommandProxy::create):
2083         (WebKit::WebEditCommandProxy::commandID const):
2084         * UIProcess/WebPageProxy.cpp:
2085         (WebKit::WebPageProxy::registerEditCommandForUndo):
2086         * UIProcess/WebPageProxy.h:
2087         * WebKit.xcodeproj/project.pbxproj:
2088         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2089         (WebKit::WebEditorClient::registerUndoStep):
2090
2091         Store the step ID in a temporary variable, since `webUndoStep` is now moved when calling `addWebUndoStep`.
2092
2093         * WebProcess/WebPage/WebPage.cpp:
2094         (WebKit::WebPage::webUndoStep):
2095         (WebKit::WebPage::addWebUndoStep):
2096
2097         Make this take a `Ref<WebUndoStep>&&` instead of a `WebUndoStep*`, and use move semantics to transfer the
2098         given `Ref` to the table.
2099
2100         (WebKit::WebPage::removeWebEditCommand):
2101         (WebKit::WebPage::unapplyEditCommand):
2102         (WebKit::WebPage::reapplyEditCommand):
2103
2104         Use `auto*` in a couple of places.
2105
2106         (WebKit::WebPage::didRemoveEditCommand):
2107         * WebProcess/WebPage/WebPage.h:
2108         * WebProcess/WebPage/WebUndoStep.cpp:
2109         (WebKit::generateUndoStep):
2110         * WebProcess/WebPage/WebUndoStep.h:
2111         (WebKit::WebUndoStep::stepID const):
2112         (WebKit::WebUndoStep::WebUndoStep):
2113         * WebProcess/WebPage/WebUndoStepID.h: Copied from Source/WebKit/WebProcess/WebPage/WebUndoStep.cpp.
2114
2115 2019-01-02  Wenson Hsieh  <wenson_hsieh@apple.com>
2116
2117         Add support for using the current text selection as the find string on iOS
2118         https://bugs.webkit.org/show_bug.cgi?id=193034
2119         <rdar://problem/45138739>
2120
2121         Reviewed by Tim Horton.
2122
2123         * SourcesCocoa.txt:
2124         * UIProcess/API/Cocoa/WKWebView.mm:
2125         (-[WKWebView _takeFindStringFromSelection:]):
2126
2127         Provides a way to set the find string on iOS and macOS (an aside: takeFindStringFromSelection: already exists on
2128         macOS, but there is no equivalent protocol method on iOS, so this new SPI acts as a cross-platform way for
2129         WebKit clients to take the find string from the selection across all Cocoa platforms).
2130
2131         (+[WKWebView _stringForFind]):
2132         (+[WKWebView _setStringForFind:]):
2133
2134         Call into find-in-page helper functions.
2135
2136         (-[WKWebView _findString:options:maxCount:]):
2137
2138         On iOS, additionally update the find-in-page string when exercising the _findString:options:maxCount: SPI. This
2139         mirrors macOS behavior of updating the find pasteboard every time the find string changes; however, on macOS,
2140         this is implemented by the platform (in AppKit), whereas there's no platform find pasteboard on iOS, let alone
2141         logic to update it in UIKit. As such, we directly drive updates to the find string within WebKit.
2142
2143         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2144
2145         Add some new cross-platform find-in-page SPI. See above for more details.
2146
2147         * UIProcess/Cocoa/GlobalFindInPageState.h: Added.
2148         * UIProcess/Cocoa/GlobalFindInPageState.mm: Added.
2149         (WebKit::findPasteboard):
2150         (WebKit::globalStringForFind):
2151
2152         Fetch the string to use when finding text in the page. On macOS, this accesses the AppKit find pasteboard; on
2153         iOS, this instead returns the current global find string.
2154
2155         (WebKit::updateStringForFind):
2156
2157         Sets the global find string. Uses the find pasteboard on macOS, and sets the global find string on iOS.
2158
2159         (WebKit::stringForFind):
2160         * UIProcess/WebPageProxy.h:
2161         * UIProcess/WebPageProxy.messages.in:
2162
2163         Add plumbing to allow WebEditorClient to deliver the update the global find string in the UI process.
2164
2165         * UIProcess/ios/WebPageProxyIOS.mm:
2166         (WebKit::WebPageProxy::updateStringForFind):
2167         * WebKit.xcodeproj/project.pbxproj:
2168         * WebProcess/WebCoreSupport/WebEditorClient.h:
2169         * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
2170         (WebKit::WebEditorClient::updateStringForFind):
2171         * WebProcess/WebPage/WebPage.h:
2172         * WebProcess/WebPage/ios/WebPageIOS.mm:
2173         (WebKit::WebPage::updateStringForFind):
2174
2175 2019-01-02  Brent Fulgham  <bfulgham@apple.com>
2176
2177         Allow WebContent process access to some drawing-related IOKit properties
2178         https://bugs.webkit.org/show_bug.cgi?id=193086
2179         <rdar://problem/46568088>
2180
2181         Reviewed by Eric Carlson.
2182
2183         Update the iOS WebContent process sandbox to allow access to some IOKit properties
2184         that are needed for drawing and media playback operations.
2185
2186         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2187         * WebProcess/com.apple.WebKit.WebContent.sb.in:
2188
2189 2019-01-02  Brent Fulgham  <bfulgham@apple.com>
2190
2191         Remove unused logging service 
2192         https://bugs.webkit.org/show_bug.cgi?id=193081
2193         <rdar://problem/40414815>
2194
2195         Reviewed by Alexey Proskuryakov.
2196
2197         We don't use this logging service, so don't open an exception for it.
2198
2199         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2200
2201 2019-01-02  Brent Fulgham  <bfulgham@apple.com>
2202
2203         Remove temporary workaround for CVMS code signing objects
2204         https://bugs.webkit.org/show_bug.cgi?id=193079
2205         <rdar://problem/40139202>
2206
2207         Reviewed by Alexey Proskuryakov.
2208
2209         * WebProcess/com.apple.WebProcess.sb.in:
2210
2211 2019-01-02  Wenson Hsieh  <wenson_hsieh@apple.com>
2212
2213         REGRESSION (r239441): [iOS] Selection UI sometimes doesn't change after tapping "select all" in the callout bar
2214         https://bugs.webkit.org/show_bug.cgi?id=193070
2215         <rdar://problem/46921508>
2216
2217         Reviewed by Tim Horton.
2218
2219         r239441 added logic to include an EditorState in the next layer tree commit when refocusing an element; this was
2220         done to ensure that after tapping an element that has already been programmatically focused, we still send up-
2221         to-date editor information to the UI process for the purposes of zooming to the selection rect, even if the
2222         selection in the DOM is unchanged, since other aspects of the editor state may have changed since the element
2223         was initially focused.
2224
2225         We currently try to flag the next layer tree commit by setting `m_hasPendingEditorStateUpdate` to `true`.
2226         However, this is problematic since we aren't guaranteed in all cases that a compositing flush has been
2227         scheduled. In the case where it hasn't, we'll end up in a state where the editor state update flag has been set,
2228         yet the update will not make it over to the UI process until something happens that forces a layer tree commit
2229         (e.g. scrolling, pinch zooming). Worse still, if the selection is then programmatically changed from the web
2230         process, we will bail from sending a subsequent editor state update to the UI process because `WebPage` thinks
2231         that a pending editor state has already been scheduled. This manifests in selection UI not updating after
2232         tapping "Select All" in the callout bar, if the callout bar was brought up by tapping near the selection (since
2233         this refocuses the element).
2234
2235         To fix this, we adjust this logic in `WebPage::elementDidRefocus` so that it sets the flag and then schedules a
2236         compositing flush, but only if the user is actually interacting with the focused element (i.e., if the page
2237         calls `focus` repeatedly, we won't continue to schedule compositing flushes).
2238
2239         Test: editing/selection/ios/change-selection-after-tapping-focused-element.html
2240
2241         * WebProcess/WebPage/WebPage.cpp:
2242         (WebKit::WebPage::elementDidRefocus):
2243         (WebKit::WebPage::sendEditorStateUpdate):
2244         (WebKit::WebPage::scheduleFullEditorStateUpdate):
2245
2246         Add a private helper method to schedule an editor state update by setting `m_hasPendingEditorStateUpdate` to
2247         `true` and then scheduling a compositing layer flush. Also, add a FIXME aluding to the fact that scheduling an
2248         entire compositing layer flush to send an editor state update is somewhat wasteful, and should be replaced by
2249         just scheduling this work to be done before the next frame (see: <rdar://problem/36523583> for more detail).
2250
2251         We also use this helper method in a few places where we currently turn on the editor state flag and schedule a
2252         subsequent compositing flush.
2253
2254         (WebKit::WebPage::sendPartialEditorStateAndSchedulePostLayoutUpdate):
2255         * WebProcess/WebPage/WebPage.h:
2256
2257 2019-01-02  Commit Queue  <commit-queue@webkit.org>
2258
2259         Unreviewed, rolling out r239524.
2260         https://bugs.webkit.org/show_bug.cgi?id=193083
2261
2262         basic browsing seems not to work (Requested by thorton on
2263         #webkit).
2264
2265         Reverted changeset:
2266
2267         "Expand use of sourceApplicationAuditData"
2268         https://bugs.webkit.org/show_bug.cgi?id=192995
2269         https://trac.webkit.org/changeset/239524
2270
2271 2019-01-01  Jeff Miller  <jeffm@apple.com>
2272
2273         Update user-visible copyright strings to include 2019
2274         https://bugs.webkit.org/show_bug.cgi?id=192811
2275
2276         Reviewed by Mark Lam.
2277
2278         * Info.plist:
2279         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX.plist:
2280         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-iOS.plist:
2281         * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist:
2282         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist:
2283         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-iOS.plist:
2284
2285 2018-12-28  Wenson Hsieh  <wenson_hsieh@apple.com>
2286
2287         Move WKEditCommandObjC and WKEditorUndoTargetObjC into a separate file
2288         https://bugs.webkit.org/show_bug.cgi?id=193049
2289
2290         Reviewed by Sam Weinig.
2291
2292         Pull common code (WKEditCommandObjC and WKEditorUndoTargetObjC) on iOS and macOS out into a separate file. No
2293         change in behavior.
2294
2295         * SourcesCocoa.txt:
2296         * UIProcess/Cocoa/WKEditCommand.h: Added.
2297         * UIProcess/Cocoa/WKEditCommand.mm: Added.
2298
2299         Rename WKEditCommandObjC to WKEditCommand, and WKEditorUndoTargetObjC to WKEditorUndoTarget. The ObjC suffix in
2300         the name seems to diverge from the common naming scheme in other parts of WebKit, where most WK- and _WK-
2301         prefixed names already refer to Objective-C objects. Additionally, mark -[WKEditCommand init] as unavailable.
2302
2303         (-[WKEditCommand initWithWebEditCommandProxy:]):
2304
2305         Make the return type instancetype instead of id, and also make this take a Ref<WebEditCommandProxy>&& instead
2306         of a RefPtr.
2307
2308         (-[WKEditCommand command]):
2309
2310         Make this return a reference to the WebEditCommandProxy, rather than a pointer, since the WebEditCommandProxy
2311         should always be non-null.
2312
2313         (-[WKEditorUndoTarget undoEditing:]):
2314         (-[WKEditorUndoTarget redoEditing:]):
2315         * UIProcess/Cocoa/WebViewImpl.h:
2316         * UIProcess/Cocoa/WebViewImpl.mm:
2317         (WebKit::WebViewImpl::WebViewImpl):
2318         (WebKit::WebViewImpl::registerEditCommand):
2319
2320         Use WTFMove instead of copying the Ref when creating a WKEditCommand.
2321
2322         (-[WKEditCommandObjC initWithWebEditCommandProxy:]): Deleted.
2323         (-[WKEditCommandObjC command]): Deleted.
2324         (-[WKEditorUndoTargetObjC undoEditing:]): Deleted.
2325         (-[WKEditorUndoTargetObjC redoEditing:]): Deleted.
2326         * UIProcess/ios/PageClientImplIOS.h:
2327         * UIProcess/ios/PageClientImplIOS.mm:
2328         (WebKit::PageClientImpl::PageClientImpl):
2329         (WebKit::PageClientImpl::registerEditCommand):
2330
2331         Use WTFMove instead of creating a new RefPtr when creating a WKEditCommand.
2332
2333         (-[WKEditCommandObjC initWithWebEditCommandProxy:]): Deleted.
2334         (-[WKEditCommandObjC command]): Deleted.
2335         (-[WKEditorUndoTargetObjC undoEditing:]): Deleted.
2336         (-[WKEditorUndoTargetObjC redoEditing:]): Deleted.
2337         * UIProcess/mac/PageClientImplMac.h:
2338         * WebKit.xcodeproj/project.pbxproj:
2339
2340 2018-12-27  Alex Christensen  <achristensen@webkit.org>
2341
2342         Resurrect Mac CMake build
2343         https://bugs.webkit.org/show_bug.cgi?id=192658
2344
2345         Reviewed by Yusuke Suzuki.
2346
2347         * PlatformMac.cmake:
2348
2349 2018-12-26  Fujii Hironori  <Hironori.Fujii@sony.com>
2350
2351         [MSVC] error C2381: 'WebKit::NetworkHTTPSUpgradeChecker::~NetworkHTTPSUpgradeChecker': redefinition; '__declspec(noreturn)' or '[[noreturn]]' differs
2352         https://bugs.webkit.org/show_bug.cgi?id=193030
2353
2354         Reviewed by Ross Kirsling.
2355
2356         Windows Debug builds are failing to compile due to
2357         NO_RETURN_DUE_TO_ASSERT inconsistency of
2358         NetworkHTTPSUpgradeChecker destructor's definition and
2359         declaration.
2360
2361         * NetworkProcess/NetworkHTTPSUpgradeChecker.h: Added
2362         NO_RETURN_DUE_TO_ASSERT to NetworkHTTPSUpgradeChecker destructor
2363         declaration.
2364         * NetworkProcess/NetworkHTTPSUpgradeChecker.cpp: Removed
2365         NO_RETURN_DUE_TO_ASSERT from the definition.
2366
2367 2018-12-24  Fujii Hironori  <Hironori.Fujii@sony.com>
2368
2369         [WebKit][Win] Remove using namespace in the global scope
2370         https://bugs.webkit.org/show_bug.cgi?id=192968
2371
2372         Reviewed by Alex Christensen.
2373
2374         Moved using namespace statements in the global scope to inside
2375         namespaces.
2376         <https://webkit.org/code-style-guidelines/#using-position>
2377
2378         * NetworkProcess/Cookies/curl/WebCookieManagerCurl.cpp:
2379         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
2380         * NetworkProcess/curl/NetworkProcessCurl.cpp:
2381         * NetworkProcess/curl/NetworkSessionCurl.cpp:
2382         * NetworkProcess/curl/RemoteNetworkingContextCurl.cpp:
2383         * Shared/Plugins/Netscape/NetscapePluginModuleNone.cpp:
2384         * Shared/WebWheelEvent.cpp:
2385         * Shared/curl/WebCoreArgumentCodersCurl.cpp:
2386         * Shared/win/NativeWebKeyboardEventWin.cpp:
2387         * Shared/win/WebEventFactory.cpp:
2388         * UIProcess/Automation/WebAutomationSession.cpp:
2389
2390 2018-12-24  Fujii Hironori  <Hironori.Fujii@sony.com>
2391
2392         Remove "using namespace std;"
2393         https://bugs.webkit.org/show_bug.cgi?id=192973
2394
2395         Reviewed by Alex Christensen.
2396
2397         * Platform/IPC/win/ConnectionWin.cpp:
2398
2399 2018-12-24  Simon Fraser  <simon.fraser@apple.com>
2400
2401         Change ScrollingNodeType to an enum class
2402         https://bugs.webkit.org/show_bug.cgi?id=193009
2403
2404         Reviewed by Zalan Bujtas.
2405
2406         Change the ScrollingNodeType enum to an enum class.
2407         
2408         No behavior change.
2409
2410         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
2411         (WebKit::encodeNodeAndDescendants):
2412         (WebKit::RemoteScrollingCoordinatorTransaction::decode):
2413         (WebKit::dump):
2414         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
2415         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
2416         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
2417         (WebKit::RemoteScrollingTree::createScrollingTreeNode):
2418         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
2419         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
2420         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
2421         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateChildNodesAfterScroll):
2422
2423 2018-12-23  Wenson Hsieh  <wenson_hsieh@apple.com>
2424
2425         [iOS] Remove some unnecessary editing SPI after <rdar://problem/46047546>
2426         https://bugs.webkit.org/show_bug.cgi?id=193019
2427
2428         Reviewed by Dan Bernstein.
2429
2430         Remove these SPI method declarations, as well as method forwarding in WKContentView. Mail was the only adoptee
2431         of these methods; after <rdar://problem/46047546>, they have moved to the underscore-prefixed versions, so we
2432         we have no need for these erroneously-named SPI methods anymore. There is no change in behavior; verified this
2433         through existing API tests (WKWebViewEditActions), as well as building iOS Mail against WebKit with these
2434         changes to WKWebViewPrivate.h.
2435
2436         * UIProcess/API/Cocoa/WKWebView.mm:
2437         (-[WKWebView canPerformAction:withSender:]):
2438         (-[WKWebView targetForAction:withSender:]):
2439         (-[WKWebView _setFont:sender:]):
2440         (-[WKWebView _setFontSize:sender:]):
2441         (-[WKWebView _setTextColor:sender:]):
2442         (-[WKWebView setFont:sender:]): Deleted.
2443         (-[WKWebView setTextColor:sender:]): Deleted.
2444         (-[WKWebView setFontSize:sender:]): Deleted.
2445         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2446         * UIProcess/ios/WKContentViewInteraction.h:
2447         * UIProcess/ios/WKContentViewInteraction.mm:
2448         (-[WKContentView canPerformActionForWebView:withSender:]):
2449         (-[WKContentView setFontForWebView:sender:]): Deleted.
2450         (-[WKContentView setFontSizeForWebView:sender:]): Deleted.
2451         (-[WKContentView setTextColorForWebView:sender:]): Deleted.
2452
2453 2018-12-23  Wenson Hsieh  <wenson_hsieh@apple.com>
2454
2455         Fix fast/ruby/ruby-base-merge-block-children-crash-2.html after r239543
2456         https://bugs.webkit.org/show_bug.cgi?id=193015
2457         <rdar://problem/46583527>
2458
2459         Reviewed by Tim Horton.
2460
2461         Fix the crash by gracefully handling integer overflow when computing the area of a very large editable element.
2462
2463         * UIProcess/ios/WKContentViewInteraction.mm:
2464         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
2465         (-[WKContentView _updateChangedSelection:]):
2466
2467 2018-12-22  Wenson Hsieh  <wenson_hsieh@apple.com>
2468
2469         [iOS] Suppress native selection behaviors when focusing a very small editable element
2470         https://bugs.webkit.org/show_bug.cgi?id=193005
2471         <rdar://problem/46583527>
2472
2473         Reviewed by Tim Horton.
2474
2475         In r238146, I added a mechanism to detect when the selection is hidden within transparent editable elements, and
2476         used this to suppress native selection on iOS (such as selection handles, highlight, callout bar, etc.) to avoid
2477         conflicts between the page's editing UI and the platform.
2478
2479         However, one additional technique observed on some websites involves hiding the selection by moving it into a
2480         tiny (1x1) editable element. Here, we currently still present a callout bar with editing actions, as well as
2481         show a selection caret or handles on iOS. To fix this, we extend the mechanism added in r238146 by also
2482         suppressing the selection assistant in the case where the editable element's area is beneath a tiny minimum
2483         threshold.
2484
2485         Test: editing/selection/ios/hide-selection-in-tiny-contenteditable.html
2486
2487         * Shared/EditorState.cpp:
2488         (WebKit::EditorState::PostLayoutData::encode const):
2489         (WebKit::EditorState::PostLayoutData::decode):
2490         (WebKit::operator<<):
2491         * Shared/EditorState.h:
2492
2493         Rename selectionClipRect to focusedElementRect. We currently propagate the bounds of the focused element to the
2494         UI process through EditorState updates, but only for the purpose of returning it in the computed selection clip
2495         rect; instead, rename this member to something more general-purpose, so we can also use it when determining
2496         whether to suppress the selection assistant.
2497
2498         * UIProcess/API/Cocoa/WKWebView.mm:
2499         (-[WKWebView _candidateRect]):
2500         * UIProcess/Cocoa/WebViewImpl.mm:
2501         (WebKit::WebViewImpl::handleRequestedCandidates):
2502         * UIProcess/ios/WKContentViewInteraction.h:
2503
2504         Add a new SuppressSelectionAssistantReason that corresponds to focusing tiny editable elements.
2505
2506         * UIProcess/ios/WKContentViewInteraction.mm:
2507         (-[WKContentView _zoomToRevealFocusedElement]):
2508         (-[WKContentView _selectionClipRect]):
2509         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
2510         (-[WKContentView _updateChangedSelection:]):
2511
2512         Check the size of the focused element, and begin or stop suppressing the selection assistant accordingly.
2513
2514         * WebProcess/WebPage/ios/WebPageIOS.mm:
2515         (WebKit::WebPage::platformEditorState const):
2516         * WebProcess/WebPage/mac/WebPageMac.mm:
2517         (WebKit::WebPage::platformEditorState const):
2518
2519 2018-12-20  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
2520
2521         Use Ref<> as much as possible
2522         https://bugs.webkit.org/show_bug.cgi?id=192808
2523
2524         Reviewed by Alex Christensen.
2525
2526         * PluginProcess/WebProcessConnection.cpp:
2527         (WebKit::WebProcessConnection::create):
2528         * PluginProcess/WebProcessConnection.h:
2529         * UIProcess/API/Cocoa/WKConnection.mm:
2530         (-[WKConnection sendMessageWithName:body:]):
2531         * UIProcess/API/Cocoa/WKWebView.mm:
2532         (-[WKWebView takeSnapshotWithConfiguration:completionHandler:]):
2533         (-[WKWebView _takeViewSnapshot]):
2534         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
2535         * UIProcess/API/glib/WebKitGeolocationProvider.cpp:
2536         (WebKit::WebKitGeolocationProvider::notifyPositionChanged):
2537         * UIProcess/API/glib/WebKitWebContext.cpp:
2538         (webkit_web_context_allow_tls_certificate_for_host):
2539         * UIProcess/Automation/cairo/WebAutomationSessionCairo.cpp:
2540         (WebKit::WebAutomationSession::platformGetBase64EncodedPNGData):
2541         * UIProcess/Automation/cocoa/WebAutomationSessionCocoa.mm:
2542         (WebKit::WebAutomationSession::platformGetBase64EncodedPNGData):
2543         * UIProcess/BackingStore.cpp:
2544         (WebKit::BackingStore::incorporateUpdate):
2545         * UIProcess/Cocoa/NavigationState.mm:
2546         (WebKit::createErrorWithRecoveryAttempter):
2547         * UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
2548         * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
2549         (WebKit::PlaybackSessionManagerProxy::create):
2550         * UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
2551         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
2552         (WebKit::VideoFullscreenManagerProxy::create):
2553         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
2554         (WebKit::WebPasteboardProxy::setPasteboardBufferForType):
2555         * UIProcess/Cocoa/WebViewImpl.mm:
2556         (WebKit::WebViewImpl::takeViewSnapshot):
2557         * UIProcess/Downloads/DownloadProxyMap.cpp:
2558         (WebKit::DownloadProxyMap::createDownloadProxy):
2559         * UIProcess/Notifications/WebNotificationManagerProxy.cpp:
2560         (WebKit::WebNotificationManagerProxy::show):
2561         * UIProcess/WebPageProxy.cpp:
2562         (WebKit::WebPageProxy::didCreateSubframe):
2563         * UIProcess/WebProcessPool.cpp:
2564         (WebKit::WebProcessPool::getStatistics):
2565         (WebKit::WebProcessPool::requestWebContentStatistics):
2566         (WebKit::WebProcessPool::requestNetworkingStatistics):
2567         * UIProcess/WebProcessPool.h:
2568         * UIProcess/gstreamer/WebPageProxyGStreamer.cpp:
2569         (WebKit::WebPageProxy::requestInstallMissingMediaPlugins):
2570         * UIProcess/gtk/RemoteWebInspectorProxyGtk.cpp:
2571         (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):
2572         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
2573         (WebKit::WebInspectorProxy::platformCreateFrontendPage):
2574         * UIProcess/ios/WKGeolocationProviderIOS.mm:
2575         (-[WKGeolocationProviderIOS geolocationAuthorizationGranted]):
2576         * UIProcess/mac/PageClientImplMac.mm:
2577         (WebKit::PageClientImpl::setPromisedDataForImage):
2578         * UIProcess/win/WebInspectorProxyWin.cpp:
2579         (WebKit::WebInspectorProxy::platformCreateFrontendPage):
2580         * WebProcess/InjectedBundle/API/mac/WKDOMRange.mm:
2581         (-[WKDOMRange initWithDocument:]):
2582         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
2583         (WebKit::InjectedBundleRangeHandle::renderedImage):
2584         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp:
2585         (WebKit::InjectedBundlePageEditorClient::getPasteboardDataForRange):
2586         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
2587         (WebKit::InjectedBundlePageUIClient::mouseDidMoveOverElement):
2588         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
2589         (WebKit::NetscapePlugin::snapshot):
2590         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2591         (WebKit::PDFPlugin::addArchiveResource):
2592         (WebKit::PDFPlugin::snapshot):
2593         (WebKit::PDFPlugin::writeItemsToPasteboard):
2594         * WebProcess/Plugins/PluginProcessConnectionManager.cpp:
2595         (WebKit::PluginProcessConnectionManager::getPluginProcessConnection):
2596         * WebProcess/Plugins/PluginProxy.cpp:
2597         (WebKit::PluginProxy::snapshot):
2598         * WebProcess/Plugins/PluginView.cpp:
2599         (WebKit::PluginView::performURLRequest):
2600         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2601         (WebKit::WebChromeClient::exceededDatabaseQuota):
2602         (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
2603         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2604         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
2605         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2606         (WebKit::WebPlatformStrategies::getPathnamesForType):
2607         * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
2608         (WebKit::convertCairoSurfaceToShareableBitmap):
2609         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
2610         (WebKit::WebDragClient::declareAndWriteDragImage):
2611         * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
2612         (WebKit::WebPage::dictionaryPopupInfoForRange):
2613         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2614         (WebKit::DrawingAreaImpl::display):
2615         * WebProcess/WebPage/FindController.cpp:
2616         (WebKit::FindController::updateFindIndicator):
2617         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
2618         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
2619         * WebProcess/WebPage/WebFrame.cpp:
2620         (WebKit::WebFrame::webArchiveData):
2621         * WebProcess/WebPage/WebPage.cpp:
2622         (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick):
2623         (WebKit::WebPage::performDragControllerAction):
2624         * WebProcess/WebPage/ios/FindControllerIOS.mm:
2625         (WebKit::FindController::updateFindIndicator):
2626         * WebProcess/WebPage/ios/WebPageIOS.mm:
2627         (WebKit::WebPage::replaceDictatedText):
2628         (WebKit::WebPage::getPositionInformation):
2629         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2630         (WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom):
2631         * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
2632         (WebKit::StorageNamespaceImpl::createSessionStorageNamespace):
2633         (WebKit::StorageNamespaceImpl::createEphemeralLocalStorageNamespace):
2634         (WebKit::StorageNamespaceImpl::createLocalStorageNamespace):
2635         (WebKit::StorageNamespaceImpl::createTransientLocalStorageNamespace):
2636         (WebKit::StorageNamespaceImpl::storageArea):
2637         (WebKit::StorageNamespaceImpl::ephemeralLocalStorageArea):
2638         (WebKit::StorageNamespaceImpl::copy):
2639         * WebProcess/WebStorage/StorageNamespaceImpl.h:
2640         * WebProcess/WebStorage/WebStorageNamespaceProvider.cpp:
2641         (WebKit::WebStorageNamespaceProvider::getOrCreate):
2642         (WebKit::WebStorageNamespaceProvider::createSessionStorageNamespace):
2643         (WebKit::WebStorageNamespaceProvider::createEphemeralLocalStorageNamespace):
2644         (WebKit::WebStorageNamespaceProvider::createLocalStorageNamespace):
2645         (WebKit::WebStorageNamespaceProvider::createTransientLocalStorageNamespace):
2646         * WebProcess/WebStorage/WebStorageNamespaceProvider.h:
2647         * WebProcess/cocoa/PlaybackSessionManager.mm:
2648         (WebKit::PlaybackSessionManager::createModelAndInterface):
2649         * WebProcess/cocoa/VideoFullscreenManager.mm:
2650         (WebKit::VideoFullscreenManager::createModelAndInterface):
2651
2652 2018-12-21  Chris Dumez  <cdumez@apple.com>
2653
2654         navigator.userAgent in service workers does not reflect customUserAgent set by client
2655         https://bugs.webkit.org/show_bug.cgi?id=192951
2656
2657         Reviewed by Youenn Fablet.
2658
2659         * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
2660         (WebKit::WebSWServerConnection::registerServiceWorkerClient):
2661         * NetworkProcess/ServiceWorker/WebSWServerConnection.h:
2662         * NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in:
2663         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
2664         (WebKit::WebSWServerToContextConnection::installServiceWorkerContext):
2665         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
2666         * WebProcess/Storage/WebSWClientConnection.cpp:
2667         (WebKit::WebSWClientConnection::registerServiceWorkerClient):
2668         * WebProcess/Storage/WebSWClientConnection.h:
2669         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2670         (WebKit::WebSWContextManagerConnection::installServiceWorker):
2671         * WebProcess/Storage/WebSWContextManagerConnection.h:
2672         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
2673
2674 2018-12-21  Alex Christensen  <achristensen@webkit.org>
2675
2676         Expand use of sourceApplicationAuditData
2677         https://bugs.webkit.org/show_bug.cgi?id=192995
2678         <rdar://problem/46627875>
2679
2680         Reviewed by Brady Eidson.
2681
2682         sourceApplicationAuditData has been used for a long time on iOS, but it's needed on more platforms.
2683         I also made it return an Optional instead of a bool and returning by reference. Ahhh. So much nicer.
2684
2685         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2686         (WebKit::NetworkProcess::sourceApplicationAuditData const):
2687         * Platform/IPC/Connection.h:
2688         * Platform/IPC/mac/ConnectionMac.mm:
2689         (IPC::Connection::getAuditToken):
2690         * WebProcess/WebProcess.cpp:
2691         (WebKit::WebProcess::initializeWebProcess):
2692         * WebProcess/cocoa/WebProcessCocoa.mm:
2693         (WebKit::WebProcess::sourceApplicationAuditData const):
2694
2695 2018-12-21  Jiewen Tan  <jiewen_tan@apple.com>
2696
2697         [Mac] Layout Test http/wpt/webauthn/public-key-credential-create-success-hid.https.html and http/wpt/webauthn/public-key-credential-get-success-hid.https.html are flaky
2698         https://bugs.webkit.org/show_bug.cgi?id=192061
2699
2700         Reviewed by Dewei Zhu.
2701
2702         Part 5.
2703
2704         Add some additional temporary logging info to determine if the time out value passed to the timer is respected.
2705         Once the bug is determined and fixed, we should remove all logging added in this patch.
2706
2707         Reviewed by Dewei Zhu.
2708
2709         * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
2710         (WebKit::AuthenticatorManager::initTimeOutTimer):
2711         (WebKit::AuthenticatorManager::timeOutTimerFired):
2712
2713 2018-12-21  Keith Rollin  <krollin@apple.com>
2714
2715         Crash in com.apple.WebKit: WebKit::WebResourceLoader::willSendRequest + 223
2716         https://bugs.webkit.org/show_bug.cgi?id=192989
2717
2718         Reviewed by Chris Dumez.
2719
2720         willSendRequest is calling maybeLoadFallbackForRedirect, which can
2721         delete “this”. After that, some new logging code tries to access
2722         “this” and causes the crash. Fix this by adjusting the scope of a
2723         "protectedThis".
2724
2725         * WebProcess/Network/WebResourceLoader.cpp:
2726         (WebKit::WebResourceLoader::willSendRequest):
2727
2728 2018-12-21  Alejandro G. Castro  <alex@igalia.com>
2729
2730         [GTK][WPE] Add DeviceIdHashSaltStorage disk persistence
2731         https://bugs.webkit.org/show_bug.cgi?id=190466
2732
2733         Reviewed by Youenn Fablet.
2734
2735         Added persistency to the DeviceIdHashSaltStorage. Implemented a
2736         decoder and an encoder for the HashSaltForOrigin struct to store
2737         it in a file, this allows us to save the lastTimeUsed, the origin
2738         and the hash salt. It uses a new directory where it creates a file
2739         per hash salt, the name of the file is the hash salt to avoid
2740         leaking information in the system. The last time used and the
2741         origin are stored inside the file, it also adds a version
2742         directory used to change the structure of the file in the future,
2743         if we need to do it. In the DeviceIdHashSaltStorage class the disk
2744         operations happen in a WorkQueue, but all interactions go in the
2745         main thread. We added code to handle the operations when the load
2746         still did not finish.
2747
2748         * Platform/Logging.h:
2749         Added channel DiskPersistency..
2750         * Sources.txt: Added new files.
2751         * UIProcess/API/APIProcessPoolConfiguration.cpp: Added code to set
2752         the directory for the deviceIdHashSalts. That way we can use the
2753         configuration when creating the DeviceIdHashSaltStorage.
2754         (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
2755         (API::ProcessPoolConfiguration::ProcessPoolConfiguration):
2756         (API::ProcessPoolConfiguration::copy):
2757         * UIProcess/API/APIProcessPoolConfiguration.h:
2758         * UIProcess/API/APIWebsiteDataStore.cpp:
2759         (API::WebsiteDataStore::legacyDefaultDataStoreConfiguration):
2760         Added code to set the directory in the disk used to store the
2761         information.
2762         * UIProcess/API/APIWebsiteDataStore.h: Ditto.
2763         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm: Added dummy
2764         implementation to get the directory in cocoa.
2765         (API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory):
2766         (API::WebsiteDataStore::legacyDefaultDeviceIdHashSaltsStorageDirectory):
2767         * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp: Defined the
2768         default directories used to store the information in the disk.
2769         (API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory):
2770         (API::WebsiteDataStore::legacyDefaultDeviceIdHashSaltsStorageDirectory):
2771         (API::WebsiteDataStore::defaultDataStoreConfiguration):
2772         * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
2773         (webkitWebsiteDataManagerGetDataStore): Added the directory used
2774         to store the information.
2775         (webkit_website_data_manager_remove): Modified the way we use to
2776         make sure when we remove the cookies we also remove the hash salts.
2777         * UIProcess/API/win/APIWebsiteDataStoreWin.cpp: Added dummy
2778         implementations to get the directory in windows platform.
2779         (API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory):
2780         (API::WebsiteDataStore::legacyDefaultDeviceIdHashSaltsStorageDirectory):
2781         * UIProcess/API/C/WKBackForwardListItemRef.cpp: Add namespace, it
2782         seems some unified build compilation issue.
2783         * UIProcess/DeviceIdHashSaltStorage.cpp:
2784         (WebKit::DeviceIdHashSaltStorage::create): Added a create method
2785         used to pass the directory and the persistency status of the websitedatastore.
2786         (WebKit::DeviceIdHashSaltStorage::completeHandler): Added to share
2787         the code copying the origins to complete the get handler.
2788         (WebKit::DeviceIdHashSaltStorage::completeDeviceIdHashSaltForOriginCall):
2789         Added to share the code when completing the task of getting a new
2790         hash salt.
2791         (WebKit::DeviceIdHashSaltStorage::DeviceIdHashSaltStorage): Added
2792         a new constructor for the create method.
2793         (WebKit::getSecurityOriginData): Added to get the
2794         SecurityOriginData from a field in the decoder and do all the
2795         checks.
2796         (WebKit::DeviceIdHashSaltStorage::loadStorageFromDisk): Open the
2797         directory and restore all the hash salts from disk to the memory
2798         structure.
2799         (WebKit::DeviceIdHashSaltStorage::createEncoderFromData const):
2800         Creates the decoder to store the HashSaltForOrigin structure.
2801         (WebKit::DeviceIdHashSaltStorage::storeHashSaltToDisk): Write to
2802         disk a decoder object created from a HashSaltForOrigin
2803         structure. It uses the writeEncoderToDisk function.
2804         (WebKit::DeviceIdHashSaltStorage::deviceIdHashSaltForOrigin): Make
2805         sure we store in disk a new hash salt when it is generated and the
2806         WebsiteDataStore is persistent. Add a completionHandler to return
2807         the value found or generated, this way we can control if the
2808         HashMap is already loaded from disk.
2809         (WebKit::DeviceIdHashSaltStorage::getDeviceIdHashSaltOrigins):
2810         Make sure we run the get in a queue now that we store information
2811         in disk.
2812         (WebKit::DeviceIdHashSaltStorage::deleteHashSaltFromDiskIfNeeded):
2813         Added code to make sure we remove the files in disk.
2814         (WebKit::DeviceIdHashSaltStorage::deleteDeviceIdHashSaltForOrigins):
2815         Added code to use the deleteHashSaltFromDiskIfNeeded and remove the files in disk.
2816         (WebKit::DeviceIdHashSaltStorage::deleteDeviceIdHashSaltOriginsModifiedSince):
2817         Added code to use the deleteHashSaltFromDiskIfNeeded and remove the files in disk.
2818         * UIProcess/DeviceIdHashSaltStorage.h: Ditto.
2819         * UIProcess/PersistencyUtils.cpp: Added file to share the
2820         persistency code with the ResourceLoadStatisticsPersistentStorage class.
2821         (WebKit::createDecoderForFile): Ditto.
2822         (WebKit::writeEncoderToDisk): Ditto.
2823         * UIProcess/PersistencyUtils.h: Ditto.
2824         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp: Use the
2825         new PersistencyUtils functions shared with the
2826         DeviceIdHashSaltStorage class.
2827         (WebKit::ResourceLoadStatisticsPersistentStorage::refreshMemoryStoreFromDisk):
2828         (WebKit::ResourceLoadStatisticsPersistentStorage::populateMemoryStoreFromDisk):
2829         (WebKit::ResourceLoadStatisticsPersistentStorage::writeMemoryStoreToDisk):
2830         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: After
2831         changing the API of the deviceIdHashSaltForOrigin we now use a
2832         completionHandler because it could happen the HashMap is not still
2833         loaded and we would have to wait for it. We refactored the calls
2834         to the method to use this new completionHandler.
2835         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
2836         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
2837         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
2838         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2839         (WebKit::WebsiteDataStore::WebsiteDataStore): Create the
2840         DeviceIdHashSaltStorage class with the persistency information.
2841         (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary): Make
2842         sure we have the directory to store the information.
2843         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h: Add get
2844         and set functions for the deviceHashSaltStorageDirectory.
2845         * WebKit.xcodeproj/project.pbxproj: Added PersistencyUtils file to
2846         the xcode compilation.
2847
2848 2018-12-20  Alex Christensen  <achristensen@webkit.org>
2849
2850         Remove unused NetworkProcessCreationParameters
2851         https://bugs.webkit.org/show_bug.cgi?id=192961
2852
2853         Reviewed by Andy Estes.
2854
2855         loadThrottleLatency isn't used since I replaced it with NetworkSessionCreationParameters.loadThrottleLatency in r238654
2856         presentingApplicationPID has no effect because that value is only used in the WebProcess in NetworkExtensionContentFilter::initialize
2857
2858         * NetworkProcess/NetworkProcess.cpp:
2859         (WebKit::NetworkProcess::initializeNetworkProcess):
2860         * NetworkProcess/NetworkProcessCreationParameters.cpp:
2861         (WebKit::NetworkProcessCreationParameters::encode const):
2862         (WebKit::NetworkProcessCreationParameters::decode):
2863         * NetworkProcess/NetworkProcessCreationParameters.h:
2864         * UIProcess/WebProcessPool.cpp:
2865         (WebKit::WebProcessPool::ensureNetworkProcess):
2866
2867 2018-12-20  Chris Dumez  <cdumez@apple.com>
2868
2869         Use Optional::hasValue() instead of Optional::has_value()
2870         https://bugs.webkit.org/show_bug.cgi?id=192948
2871
2872         Reviewed by Tim Horton.
2873
2874         * UIProcess/Automation/WebAutomationSession.cpp:
2875         (WebKit::AutomationCommandError::toProtocolString):
2876         (WebKit::WebAutomationSession::willClosePage):
2877         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
2878         (WebKit::WebAutomationSessionProxy::computeElementLayout):
2879
2880 2018-12-20  Jeremy Jones  <jeremyj@apple.com>
2881
2882         Flicker when exiting element fullscreen.
2883         https://bugs.webkit.org/show_bug.cgi?id=192774
2884         rdar://problem/33088878
2885
2886         Reviewed by Jer Noble.
2887
2888         Fixes an issue where the web page would flicker upon exiting element fullscreen.
2889
2890         Replace WebView with a snapshot while the WebView is restyled and resized for inline.
2891
2892         * UIProcess/mac/WKFullScreenWindowController.h:
2893         * UIProcess/mac/WKFullScreenWindowController.mm:
2894         (-[WKFullScreenWindowController initWithWindow:webView:page:]):
2895         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
2896         (-[WKFullScreenWindowController completeFinishExitFullScreenAnimationAfterRepaint]):
2897
2898 2018-12-20  Chris Dumez  <cdumez@apple.com>
2899
2900         Move HTTPS_UPGRADE code behind a runtime flag, off by default
2901         https://bugs.webkit.org/show_bug.cgi?id=192937
2902
2903         Reviewed by Youenn Fablet.
2904
2905         Move HTTPS_UPGRADE code behind a runtime flag, off by default and drop the build time flag.
2906
2907         * Configurations/WebKit.xcconfig:
2908         * DerivedSources.make:
2909         * NetworkProcess/NetworkHTTPSUpgradeChecker.cpp:
2910         * NetworkProcess/NetworkHTTPSUpgradeChecker.h:
2911         * NetworkProcess/NetworkLoadChecker.cpp:
2912         (WebKit::NetworkLoadChecker::NetworkLoadChecker):
2913         (WebKit::NetworkLoadChecker::applyHTTPSUpgradeIfNeeded const):
2914         (WebKit::NetworkLoadChecker::checkRequest):
2915         * NetworkProcess/NetworkLoadChecker.h:
2916         * NetworkProcess/NetworkProcess.h:
2917         (WebKit::NetworkProcess::networkHTTPSUpgradeChecker):
2918         * NetworkProcess/NetworkResourceLoadParameters.cpp:
2919         (WebKit::NetworkResourceLoadParameters::encode const):
2920         (WebKit::NetworkResourceLoadParameters::decode):
2921         * NetworkProcess/NetworkResourceLoadParameters.h:
2922         * NetworkProcess/NetworkResourceLoader.cpp:
2923         * NetworkProcess/PingLoad.cpp:
2924         (WebKit::PingLoad::PingLoad):
2925         * Shared/WebPreferences.yaml:
2926         * WebProcess/Network/WebLoaderStrategy.cpp:
2927         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
2928         * config.h:
2929
2930 2018-12-20  Jiewen Tan  <jiewen_tan@apple.com>
2931
2932         [WebAuthN] Add a runtime flag for local authenticator
2933         https://bugs.webkit.org/show_bug.cgi?id=192792
2934         <rdar://problem/46798738>
2935
2936         Reviewed by Brent Fulgham.
2937
2938         * Shared/WebPreferences.yaml:
2939         * UIProcess/API/C/WKPreferences.cpp:
2940         (WKPreferencesSetWebAuthenticationLocalAuthenticatorEnabled):
2941         (WKPreferencesGetWebAuthenticationLocalAuthenticatorEnabled):
2942         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2943         * UIProcess/WebAuthentication/Cocoa/LocalService.mm:
2944         (WebKit::LocalService::isAvailable):
2945
2946 2018-12-20  Chris Dumez  <cdumez@apple.com>
2947
2948         Use Optional::valueOr() instead of Optional::value_or()
2949         https://bugs.webkit.org/show_bug.cgi?id=192933
2950
2951         Reviewed by Geoffrey Garen.
2952
2953         * Shared/API/c/WKSecurityOriginRef.cpp:
2954         (WKSecurityOriginGetPort):
2955         * UIProcess/API/APIProcessPoolConfiguration.h:
2956         * UIProcess/API/Cocoa/WKSecurityOrigin.mm:
2957         (-[WKSecurityOrigin port]):
2958         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2959         (-[WKWebViewConfiguration _cpuLimit]):
2960         * UIProcess/API/glib/WebKitSecurityOrigin.cpp:
2961         (webkit_security_origin_get_port):
2962         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2963         (webkitWebViewBaseHandleWheelEvent):
2964         * UIProcess/Automation/SimulatedInputDispatcher.cpp:
2965         (WebKit::SimulatedInputKeyFrame::maximumDuration const):
2966         (WebKit::SimulatedInputDispatcher::transitionInputSourceToState):
2967         * UIProcess/Automation/WebAutomationSession.cpp:
2968         (WebKit::WebAutomationSession::setWindowFrameOfBrowsingContext):
2969         (WebKit::WebAutomationSession::performInteractionSequence):
2970         * UIProcess/Automation/WebAutomationSessionMacros.h:
2971         * UIProcess/ServiceWorkerProcessProxy.cpp:
2972         (WebKit::ServiceWorkerProcessProxy::start):
2973         * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
2974         (WebKit::AuthenticatorManager::initTimeOutTimer):
2975         * UIProcess/WebPageProxy.cpp:
2976         (WebKit::WebPageProxy::deviceScaleFactor const):
2977         * UIProcess/WebPageProxy.h:
2978         (WebKit::WebPageProxy::viewportSizeForCSSViewportUnits const):
2979         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
2980         (WebKit::WebPopupMenuProxyGtk::activateItem):
2981         * UIProcess/mac/LegacySessionStateCoding.cpp:
2982         (WebKit::encodeFormDataElement):
2983         * WebProcess/Network/WebLoaderStrategy.cpp:
2984         (WebKit::WebLoaderStrategy::scheduleLoad):
2985         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2986         (WebKit::PDFPlugin::convertFromPDFViewToRootView const):
2987         (WebKit::PDFPlugin::boundsOnScreen const):
2988         (WebKit::PDFPlugin::geometryDidChange):
2989         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
2990         (WebKit::toFormData):
2991         * WebProcess/WebPage/ios/WebPageIOS.mm:
2992         (WebKit::WebPage::updateVisibleContentRects):
2993         * WebProcess/WebPage/wpe/CompositingManager.cpp:
2994         (WebKit::CompositingManager::releaseConnectionFd):
2995
2996 2018-12-20  Keith Rollin  <krollin@apple.com>
2997
2998         Improve release-level page-load logging
2999         https://bugs.webkit.org/show_bug.cgi?id=192872
3000         <rdar://problem/46850309>
3001
3002         Reviewed by Chris Dumez.
3003
3004         There are a number of reported bugs that are difficult or impossible
3005         to track down with our current level of logging. Additionally, some
3006         software groups lower in the page-loading stack have requested logging
3007         sufficient for tracking a user-visible error message down to the
3008         requested resource that caused the message. Add more-comprehensive
3009         logging to address these issues/requests.
3010
3011         * UIProcess/WebPageProxy.cpp:
3012         (WebKit::m_editableImageController):
3013         (WebKit::WebPageProxy::~WebPageProxy):
3014         (WebKit::WebPageProxy::reattachToWebProcess):
3015         (WebKit::WebPageProxy::swapToWebProcess):
3016         (WebKit::WebPageProxy::reattachToWebProcessForReload):
3017         (WebKit::WebPageProxy::reattachToWebProcessWithItem):
3018         (WebKit::WebPageProxy::close):
3019         (WebKit::WebPageProxy::tryClose):
3020         (WebKit::WebPageProxy::loadRequest):
3021         (WebKit::WebPageProxy::loadRequestWithNavigation):
3022         (WebKit::WebPageProxy::loadFile):
3023         (WebKit::WebPageProxy::loadData):
3024         (WebKit::WebPageProxy::loadDataWithNavigation):
3025         (WebKit::WebPageProxy::loadAlternateHTML):
3026         (WebKit::WebPageProxy::loadWebArchiveData):
3027         (WebKit::WebPageProxy::navigateToPDFLinkWithSimulatedClick):
3028         (WebKit::WebPageProxy::stopLoading):
3029         (WebKit::WebPageProxy::reload):
3030         (WebKit::WebPageProxy::goToBackForwardItem):
3031         (WebKit::WebPageProxy::tryRestoreScrollPosition):
3032         (WebKit::WebPageProxy::updateThrottleState):
3033         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
3034         (WebKit::WebPageProxy::continueNavigationInNewProcess):
3035         (WebKit::WebPageProxy::restoreFromSessionState):
3036         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
3037         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
3038         (WebKit::WebPageProxy::willPerformClientRedirectForFrame):
3039         (WebKit::WebPageProxy::didCancelClientRedirectForFrame):
3040         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
3041         (WebKit::WebPageProxy::didCommitLoadForFrame):
3042         (WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
3043         (WebKit::WebPageProxy::didFinishLoadForFrame):
3044         (WebKit::WebPageProxy::didFailLoadForFrame):
3045         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
3046         (WebKit::WebPageProxy::didNavigateWithNavigationData):
3047         (WebKit::WebPageProxy::didPerformClientRedirect):
3048         (WebKit::WebPageProxy::didPerformServerRedirect):
3049         (WebKit::WebPageProxy::processDidBecomeUnresponsive):
3050         (WebKit::WebPageProxy::processDidBecomeResponsive):
3051         (WebKit::WebPageProxy::processDidTerminate):
3052         (WebKit::WebPageProxy::dispatchProcessDidTerminate):
3053         (WebKit::WebPageProxy::tryReloadAfterProcessTermination):
3054         (WebKit::WebPageProxy::didExceedInactiveMemoryLimitWhileActive):
3055         (WebKit::WebPageProxy::didExceedBackgroundCPULimitWhileInForeground):
3056         * WebProcess/Network/WebLoaderStrategy.cpp:
3057         (WebKit::WebLoaderStrategy::scheduleLoad):
3058         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
3059         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
3060         * WebProcess/Network/WebResourceLoader.cpp:
3061         (WebKit::WebResourceLoader::willSendRequest):
3062         (WebKit::WebResourceLoader::didReceiveResponse):
3063         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3064         (WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad):
3065         (WebKit::WebFrameLoaderClient::dispatchDidFailLoad):
3066
3067 2018-12-20  Wenson Hsieh  <wenson_hsieh@apple.com>
3068
3069         [iOS] Replace "node assistance" terminology in WebKit with "focused element"
3070         https://bugs.webkit.org/show_bug.cgi?id=192936
3071
3072         Reviewed by Tim Horton.
3073
3074         Renames a few methods and data structures in WebKit, to refer to "focused elements" rather than "assisted nodes";
3075         see below for more details. No new tests, because there should be no change in behavior.
3076
3077         * Shared/FocusedElementInformation.cpp: Renamed from Source/WebKit/Shared/AssistedNodeInformation.cpp.
3078         (WebKit::OptionItem::encode const):
3079         (WebKit::OptionItem::decode):
3080         (WebKit::FocusedElementInformation::encode const):
3081         (WebKit::FocusedElementInformation::decode):
3082         * Shared/FocusedElementInformation.h: Renamed from Source/WebKit/Shared/AssistedNodeInformation.h.
3083
3084         Rename AssistedNodeInformation to FocusedElementInformation. Additionally, introduce a named type for the
3085         focusedElementIdentifier (which is currently just a `uint64_t`).
3086
3087         (WebKit::OptionItem::OptionItem):
3088         * Shared/ios/InteractionInformationAtPosition.h:
3089         * Shared/ios/InteractionInformationAtPosition.mm:
3090         (WebKit::InteractionInformationAtPosition::encode const):
3091         (WebKit::InteractionInformationAtPosition::decode):
3092         * SourcesCocoa.txt:
3093         * UIProcess/API/Cocoa/WKWebView.mm:
3094         (-[WKWebView _shouldUpdateKeyboardWithInfo:]):
3095         * UIProcess/PageClient.h:
3096         * UIProcess/WebPageProxy.cpp:
3097         (WebKit::WebPageProxy::resetStateAfterProcessExited):
3098         * UIProcess/WebPageProxy.h:
3099
3100         Rename NodeAssistanceArguments to ElementDidFocusArguments (and also add a FIXME for removing this mechanism
3101         eventually).
3102
3103         (WebKit::WebPageProxy::focusNextFocusedElement):
3104         (WebKit::WebPageProxy::focusNextAssistedNode): Deleted.
3105         * UIProcess/WebPageProxy.messages.in:
3106
3107         Rename StartAssistingNode to ElementDidFocus, and StopAssistingNode to ElementDidBlur.
3108
3109         * UIProcess/ios/PageClientImplIOS.h:
3110         * UIProcess/ios/PageClientImplIOS.mm:
3111         (WebKit::PageClientImpl::elementDidFocus):
3112         (WebKit::PageClientImpl::isFocusingElement):
3113         (WebKit::PageClientImpl::elementDidBlur):
3114         (WebKit::PageClientImpl::startAssistingNode): Deleted.
3115         (WebKit::PageClientImpl::isAssistingNode): Deleted.
3116         (WebKit::PageClientImpl::stopAssistingNode): Deleted.
3117         * UIProcess/ios/WKContentView.h:
3118         * UIProcess/ios/WKContentView.mm:
3119         (-[WKContentView isFocusingElement]):
3120         (-[WKContentView _didCommitLoadForMainFrame]):
3121         (-[WKContentView isAssistingNode]): Deleted.
3122         * UIProcess/ios/WKContentViewInteraction.h:
3123         * UIProcess/ios/WKContentViewInteraction.mm:
3124         (-[WKFocusedElementInfo initWithFocusedElementInformation:isUserInitiated:userObject:]):
3125         (hasFocusedElement):
3126         (-[WKContentView cleanupInteraction]):
3127         (-[WKContentView shouldHideSelectionWhenScrolling]):
3128         (-[WKContentView resignFirstResponderForWebView]):
3129         (-[WKContentView _didGetTapHighlightForRequest:color:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:]):
3130         (-[WKContentView _requiresKeyboardWhenFirstResponder]):
3131         (-[WKContentView _zoomToRevealFocusedElement]):
3132         (-[WKContentView inputView]):
3133         (-[WKContentView _selectionClipRect]):
3134         (-[WKContentView gestureRecognizerShouldBegin:]):
3135         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
3136         (-[WKContentView clearSelection]):
3137         (-[WKContentView requiresAccessoryView]):
3138         (-[WKContentView canPerformActionForWebView:withSender:]):
3139         (-[WKContentView _isInteractingWithFocusedElement]):
3140         (-[WKContentView changeSelectionWithGestureAt:withGesture:withState:withFlags:]):
3141         (-[WKContentView selectPositionAtPoint:completionHandler:]):
3142         (-[WKContentView selectPositionAtBoundary:inDirection:fromPoint:completionHandler:]):
3143         (-[WKContentView selectTextWithGranularity:atPoint:completionHandler:]):
3144         (-[WKContentView updateSelectionWithExtentPoint:completionHandler:]):
3145         (-[WKContentView updateSelectionWithExtentPoint:withBoundary:completionHandler:]):
3146         (-[WKContentView accessoryTab:]):
3147         (-[WKContentView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]):
3148         (-[WKContentView accessoryClear]):
3149         (-[WKContentView _updateAccessory]):
3150         (-[WKContentView insertTextSuggestion:]):
3151         (-[WKContentView setSelectedTextRange:]):
3152         (-[WKContentView textInputTraits]):
3153         (-[WKContentView isScrollableForKeyboardScrollViewAnimator:]):
3154         (-[WKContentView focusedElementInformation]):
3155         (-[WKContentView focusedSelectElementOptions]):
3156         (rectToRevealWhenZoomingToFocusedElement):
3157         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
3158         (-[WKContentView _elementDidBlur]):
3159         (-[WKContentView _didReceiveEditorStateUpdateAfterFocus]):
3160         (-[WKContentView updateCurrentFocusedElementInformation:]):
3161         (-[WKContentView presentViewControllerForCurrentFocusedElement]):
3162         (-[WKContentView focusedFormControlViewDidSubmit:]):
3163         (-[WKContentView focusedFormControlViewDidCancel:]):
3164         (-[WKContentView focusedFormControlViewDidBeginEditing:]):
3165         (-[WKContentView rectForFocusedFormControlView:]):
3166         (-[WKContentView nextRectForFocusedFormControlView:]):
3167         (-[WKContentView previousRectForFocusedFormControlView:]):
3168         (-[WKContentView actionNameForFocusedFormControlView:]):
3169         (-[WKContentView focusedFormControlViewDidRequestNextNode:]):
3170         (-[WKContentView focusedFormControlViewDidRequestPreviousNode:]):
3171         (-[WKContentView hasNextNodeForFocusedFormControlView:]):
3172         (-[WKContentView hasPreviousNodeForFocusedFormControlView:]):
3173         (-[WKContentView selectMenu:didSelectItemAtIndex:]):
3174         (-[WKContentView numberOfItemsInSelectMenu:]):
3175         (-[WKContentView selectMenu:displayTextForItemAtIndex:]):
3176         (-[WKContentView selectMenu:didCheckItemAtIndex:checked:]):
3177         (-[WKContentView selectMenuUsesMultipleSelection:]):
3178         (-[WKContentView selectMenu:hasSelectedOptionAtIndex:]):
3179         (-[WKContentView _updateChangedSelection:]):
3180         (-[WKContentView _autofillContext]):
3181         (-[WKContentView dismissQuickboardViewControllerAndRevealFocusedFormOverlayIfNecessary:]):
3182         (-[WKContentView allowsLanguageSelectionMenuForListViewController:]):
3183         (-[WKContentView inputLabelTextForViewController:]):
3184         (-[WKContentView initialValueForViewController:]):
3185         (-[WKContentView shouldDisplayInputContextViewForListViewController:]):
3186         (-[WKContentView numericInputModeForListViewController:]):
3187         (-[WKContentView textContentTypeForListViewController:]):
3188         (-[WKContentView allowsDictationInputForListViewController:]):
3189         (-[WKFocusedElementInfo initWithAssistedNodeInformation:isUserInitiated:userObject:]): Deleted.
3190         (hasAssistedNode): Deleted.
3191
3192         Replaced with hasFocusedElement.
3193
3194         (-[WKContentView _isInteractingWithAssistedNode]): Deleted.
3195         (-[WKContentView assistedNodeInformation]): Deleted.
3196         (-[WKContentView assistedNodeSelectOptions]): Deleted.
3197         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]): Deleted.
3198         (-[WKContentView _stopAssistingNode]): Deleted.
3199         (-[WKContentView updateCurrentAssistedNodeInformation:]): Deleted.
3200         (-[WKContentView presentViewControllerForCurrentAssistedNode]): Deleted.
3201         * UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm:
3202         (-[WKDataListSuggestionsControl textAlignment]):
3203         * UIProcess/ios/WebPageProxyIOS.mm:
3204         (WebKit::WebPageProxy::focusedElementInformationCallback):
3205         (WebKit::WebPageProxy::requestFocusedElementInformation):
3206         (WebKit::WebPageProxy::computeCustomFixedPositionRect const):
3207         (WebKit::WebPageProxy::didCommitLayerTree):
3208         (WebKit::WebPageProxy::selectWithGesture):
3209         (WebKit::WebPageProxy::selectTextWithGranularityAtPoint):
3210         (WebKit::WebPageProxy::selectPositionAtBoundaryWithDirection):
3211         (WebKit::WebPageProxy::selectPositionAtPoint):
3212         (WebKit::WebPageProxy::updateSelectionWithExtentPoint):
3213         (WebKit::WebPageProxy::updateSelectionWithExtentPointAndBoundary):
3214         (WebKit::WebPageProxy::blurFocusedElement):
3215         (WebKit::WebPageProxy::elementDidFocus):
3216         (WebKit::WebPageProxy::elementDidBlur):
3217         (WebKit::WebPageProxy::focusNextFocusedElement):
3218         (WebKit::WebPageProxy::setFocusedElementValue):
3219         (WebKit::WebPageProxy::setFocusedElementValueAsNumber):
3220         (WebKit::WebPageProxy::setFocusedElementSelectedIndex):
3221         (WebKit::WebPageProxy::assistedNodeInformationCallback): Deleted.
3222         (WebKit::WebPageProxy::requestAssistedNodeInformation): Deleted.
3223         (WebKit::WebPageProxy::blurAssistedNode): Deleted.
3224         (WebKit::WebPageProxy::startAssistingNode): Deleted.
3225         (WebKit::WebPageProxy::stopAssistingNode): Deleted.
3226         (WebKit::WebPageProxy::focusNextAssistedNode): Deleted.
3227         (WebKit::WebPageProxy::setAssistedNodeValue): Deleted.
3228         (WebKit::WebPageProxy::setAssistedNodeValueAsNumber): Deleted.
3229         (WebKit::WebPageProxy::setAssistedNodeSelectedIndex): Deleted.
3230         * UIProcess/ios/forms/WKFormColorPicker.mm:
3231         (-[WKColorPicker initWithView:]):
3232         (-[WKColorPicker setControlValueFromUIColor:]):
3233         * UIProcess/ios/forms/WKFormInputControl.mm:
3234         (-[WKDateTimePicker initWithView:datePickerMode:]):
3235         (-[WKDateTimePicker shouldPresentGregorianCalendar:]):
3236         (-[WKDateTimePicker _dateChangedSetAsNumber]):
3237         (-[WKDateTimePicker _dateChangedSetAsString]):
3238         (-[WKDateTimePicker controlBeginEditing]):
3239         (-[WKFormInputControl initWithView:]):
3240         (-[WKDateTimePopover clear:]):
3241         (-[WKDateTimePopover initWithView:datePickerMode:]):
3242         * UIProcess/ios/forms/WKFormPopover.mm:
3243         (-[WKRotatingPopover presentPopoverAnimated:]):
3244         * UIProcess/ios/forms/WKFormSelectControl.h:
3245         * UIProcess/ios/forms/WKFormSelectControl.mm:
3246         (-[WKFormSelectControl initWithView:]):
3247         * UIProcess/ios/forms/WKFormSelectPicker.mm:
3248         (-[WKMultipleSelectPicker initWithView:]):
3249         (-[WKMultipleSelectPicker pickerView:viewForRow:forComponent:reusingView:]):
3250         (-[WKMultipleSelectPicker pickerView:numberOfRowsInComponent:]):
3251         (-[WKMultipleSelectPicker findItemIndexAt:]):
3252         (-[WKMultipleSelectPicker pickerView:row:column:checked:]):
3253         (-[WKSelectSinglePicker initWithView:]):
3254         (-[WKSelectSinglePicker controlEndEditing]):
3255         (-[WKSelectSinglePicker pickerView:numberOfRowsInComponent:]):
3256         (-[WKSelectSinglePicker pickerView:attributedTitleForRow:forComponent:]):
3257         (-[WKSelectSinglePicker pickerView:didSelectRow:inComponent:]):
3258         * UIProcess/ios/forms/WKFormSelectPopover.mm:
3259         (-[WKSelectTableViewController initWithView:hasGroups:]):
3260         (-[WKSelectTableViewController tableView:numberOfRowsInSection:]):
3261         (-[WKSelectTableViewController tableView:titleForHeaderInSection:]):
3262         (-[WKSelectTableViewController findItemIndexAt:]):
3263         (-[WKSelectTableViewController findItemAt:]):
3264         (-[WKSelectTableViewController tableView:cellForRowAtIndexPath:]):
3265         (-[WKSelectTableViewController tableView:didSelectRowAtIndexPath:]):
3266         (-[WKSelectPopover initWithView:hasGroups:]):
3267         * WebKit.xcodeproj/project.pbxproj:
3268         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3269         (WebKit::WebChromeClient::elementDidFocus):
3270         (WebKit::WebChromeClient::elementDidRefocus):
3271         (WebKit::WebChromeClient::elementDidBlur):
3272         * WebProcess/WebPage/WebPage.cpp:
3273         (WebKit::WebPage::didStartPageTransition):
3274         (WebKit::WebPage::setTextAsync):
3275         (WebKit::WebPage::resetFocusedElementForFrame):
3276         (WebKit::WebPage::elementDidRefocus):
3277         (WebKit::WebPage::elementDidFocus):
3278         (WebKit::WebPage::elementDidBlur):
3279         (WebKit::WebPage::didCommitLoad):
3280         (WebKit::WebPage::resetAssistedNodeForFrame): Deleted.
3281         * WebProcess/WebPage/WebPage.h:
3282
3283         Refactor elementDid{Refocus|Focus|Blur} to take `Element&` rather than `Node*`.
3284
3285         * WebProcess/WebPage/WebPage.messages.in:
3286         * WebProcess/WebPage/ios/WebPageIOS.mm:
3287
3288         Replace m_assistedNode (a `RefPtr<Node>`) with m_focusedElement (a `RefPtr<Element>`).
3289
3290         (WebKit::WebPage::platformEditorState const):
3291         (WebKit::WebPage::completeSyntheticClick):
3292         (WebKit::WebPage::requestFocusedElementInformation):
3293         (WebKit::WebPage::blurFocusedElement):
3294         (WebKit::WebPage::setFocusedElementValue):
3295         (WebKit::WebPage::setFocusedElementValueAsNumber):
3296         (WebKit::WebPage::setFocusedElementSelectedIndex):
3297         (WebKit::innerFrameQuad):
3298         (WebKit::constrainPoint):
3299         (WebKit::WebPage::selectWithGesture):
3300         (WebKit::WebPage::startAutoscrollAtPosition):
3301         (WebKit::WebPage::visiblePositionInFocusedNodeForPoint):
3302         (WebKit::WebPage::selectPositionAtPoint):
3303         (WebKit::WebPage::selectPositionAtBoundaryWithDirection):
3304         (WebKit::WebPage::rangeForGranularityAtPoint):
3305         (WebKit::WebPage::selectTextWithGranularityAtPoint):
3306         (WebKit::WebPage::updateSelectionWithExtentPointAndBoundary):
3307         (WebKit::WebPage::updateSelectionWithExtentPoint):
3308         (WebKit::WebPage::getPositionInformation):
3309         (WebKit::WebPage::focusNextFocusedElement):
3310         (WebKit::WebPage::getFocusedElementInformation):
3311         (WebKit::WebPage::autofillLoginCredentials):
3312         (WebKit::WebPage::requestAssistedNodeInformation): Deleted.
3313         (WebKit::WebPage::blurAssistedNode): Deleted.
3314         (WebKit::WebPage::setAssistedNodeValue): Deleted.
3315         (WebKit::WebPage::setAssistedNodeValueAsNumber): Deleted.
3316         (WebKit::WebPage::setAssistedNodeSelectedIndex): Deleted.
3317         (WebKit::WebPage::focusNextAssistedNode): Deleted.
3318         (WebKit::WebPage::getAssistedNodeInformation): Deleted.
3319
3320 2018-12-20  Brent Fulgham  <bfulgham@apple.com>
3321
3322         WKWebView default UA doesn't freeze the build number
3323         https://bugs.webkit.org/show_bug.cgi?id=192809
3324         <rdar://problem/44687185>
3325
3326         Reviewed by Andy Estes.
3327
3328         Always reports the frozen build number.
3329
3330         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3331         (defaultApplicationNameForUserAgent): Do not expose the actual build number through this API.
3332
3333 2018-12-20  Jer Noble  <jer.noble@apple.com>
3334
3335         Enable MediaCapabilities by default.
3336         https://bugs.webkit.org/show_bug.cgi?id=192340
3337         <rdar://problem/46435149>
3338
3339         Reviewed by Dean Jackson.
3340
3341         * Shared/WebPreferences.yaml:
3342
3343 2018-12-20  Carlos Garcia Campos  <cgarcia@igalia.com>
3344
3345         [GTK] WebDriver: tests in imported/w3c/webdriver/tests/element_clear/user_prompts.py are failing
3346         https://bugs.webkit.org/show_bug.cgi?id=192927
3347
3348         Reviewed by Michael Catanzaro.
3349
3350         Give the focus back to the web view when a dialog is dismissed.
3351
3352         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3353         (webkitWebViewBaseContainerRemove):
3354
3355 2018-12-20  Tim Horton  <timothy_horton@apple.com>
3356
3357         Unparented WKWebView can't retrieve main resource data for a main frame plugin
3358         https://bugs.webkit.org/show_bug.cgi?id=192923
3359         <rdar://problem/46859068>
3360
3361         Reviewed by Wenson Hsieh.
3362
3363         * WebProcess/Plugins/PluginView.cpp:
3364         (WebKit::PluginView::liveResourceData const):
3365         If the WKWebView is unparented, we may not immediately initialize the plugin.
3366         In that case, PluginView holds on to the backing data until the plugin
3367         is initialized. If a WKWebView API client asks for the backing data
3368         for the plugin during this time, we should return it, instead of bailing.
3369
3370 2018-12-20  Wenson Hsieh  <wenson_hsieh@apple.com>
3371
3372         [iOS] Focusing an editable element should scroll to reveal the selection
3373         https://bugs.webkit.org/show_bug.cgi?id=192802
3374         <rdar://problem/46781759>
3375
3376         Reviewed by Tim Horton.
3377
3378         Currently, when tapping on an editable element, logic in -[WKWebView _zoomToFocusRect:…:] attempts to adjust the
3379         visible viewport such that the rect containing the selection is visible. However, AssistedNodeInformation's
3380         selectionRect is used here, which (as the FIXME in WebPage::getAssistedNodeInformation notes) is either the last
3381         touch location, or the top left of the element if the touch location is outside of the element's bounding rect.
3382         This leads to confusing and undesirable behavior when tapping near the bottom of a large contenteditable element
3383         to focus it, since the actual selection will end up near the top of the element, yet we'll try to scroll to
3384         reveal the bottom of the element, which causes the visible selection to scroll offscreen. Notably, this affects
3385         scenarios involving editable web views embedded in apps, such as Mail compose.
3386
3387         Right now, we use the last touch location as an approximation for the selection rect because the selection may
3388         have not yet been updated at the moment when focus moves into an editable element. To fix this, we defer the
3389         process of zooming to the focused element rect until after the selection changes and the UI process is updated
3390         with information about the new selection rects.
3391
3392         Test: editing/selection/ios/selection-is-visible-after-focusing-editable-area.html
3393
3394         * Shared/AssistedNodeInformation.cpp:
3395         (WebKit::AssistedNodeInformation::encode const):
3396         (WebKit::AssistedNodeInformation::decode):
3397         * Shared/AssistedNodeInformation.h:
3398
3399         Rename selectionRect to elementInteractionLocation, to more accurately reflect its value and purpose. This isn't
3400         strictly always the last touch location, since we may default to the focused element location instead if the
3401         last touch location is outside of the element rect.
3402
3403         * UIProcess/API/Cocoa/WKWebView.mm:
3404         (-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):
3405
3406         Tweak a constant that determines the minimum amount of margin to leave between the selection rect and the edge
3407         of the window when scrolling to reveal the focused element. Previously, this was larger than necessary to
3408         accomodate for the fact that the "selection rect" used when zooming to the focused element did not take the
3409         actual selection into account at all, and was simply a 1 by 1 rect; this meant that the margin needed to be
3410         large enough to exceed the usual height of a text caret in editable content. Since we now use the real selection
3411         rect, we can be much less generous with this margin.
3412
3413         * UIProcess/ios/WKContentViewInteraction.h:
3414         * UIProcess/ios/WKContentViewInteraction.mm:
3415         (-[WKContentView cleanupInteraction]):
3416         (-[WKContentView observeValueForKeyPath:ofObject:change:context:]):
3417
3418         Don't additionally update the selection in the middle of triggering zooming to the focused element; on
3419         particular versions of iOS, this now attempts to scroll the selection rect on-screen, which then conflicts with
3420         zooming to reveal the focused element.
3421
3422         (-[WKContentView _zoomToRevealFocusedElement]):
3423
3424         Renamed from _displayFormNodeInputView to _zoomToRevealFocusedElement, to make the purpose of this function more
3425         clear. Additionally, pull logic to update the accessory view out of this method, so that it's strictly concerned
3426         with zooming to the focused element.
3427
3428         (-[WKContentView inputView]):
3429
3430         Add a FIXME describing the implications of zooming to the focused element in the implementation of -inputView.
3431         See also: <https://bugs.webkit.org/show_bug.cgi?id=192878>.
3432
3433         (-[WKContentView accessoryTab:]):
3434
3435         Fix a subtle issue when keeping track of _didAccessoryTabInitiateFocus. Currently, this is set to YES in
3436         -accessoryTab: and unset in _displayFormNodeInputView, but since _displayFormNodeInputView may be invoked
3437         multiple times for the same focused element (see: -inputView), we might end up zooming to the focused element
3438         with _didAccessoryTabInitiateFocus set to NO, even though we initiated focus with the previous/next buttons.
3439
3440         Instead, temporarily set a different ivar, _isChangingFocusUsingAccessoryTab, to YES in -accessoryTab:, and
3441         unset it in the completion handler after the focused element has changed. Then, when we _startAssistingNode:,
3442         set _didAccessoryTabInitiateFocus to _isChangingFocusUsingAccessoryTab. This ensures that the correctness of
3443         _didAccessoryTabInitiateFocus isn't tied to the number of times -[WKContentView inputView] is invoked when
3444         focusing an element.
3445
3446         (shouldZoomToRevealSelectionRect):
3447         (rectToRevealWhenZoomingToFocusedElement):
3448
3449         Add a helper method to determine the selection rect to use when zooming to reveal the focused element. ASSERTs
3450         that we have post-layout data in the EditorState.
3451
3452         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
3453
3454         When "assisting" a focused element, immediately zoom to it if we don't need selection information to compute the
3455         rect to zoom to; otherwise, defer zooming until we receive the first editor state update in the UI process that
3456         contains information about our selection rects.
3457
3458         (-[WKContentView _stopAssistingNode]):
3459         (-[WKContentView _didReceiveEditorStateUpdateAfterFocus]):
3460
3461         If necessary, reveal the focused element by zooming.
3462
3463         (-[WKContentView _updateInitialWritingDirectionIfNecessary]):
3464
3465         Pull this initial writing direction update logic out into a separate helper method.
3466
3467         (-[WKContentView _displayFormNodeInputView]): Deleted.
3468
3469         Replaced by _zoomToRevealFocusedElement.
3470
3471         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3472         (WebKit::WebChromeClient::elementDidRefocus):
3473
3474         This currently calls WebChromeClient::elementDidFocus; instead, call the new WebPage::elementDidRefocus;
3475         additionally, make this available on all PLATFORM(COCOA), rather than just IOS_FAMILY.
3476
3477         * WebProcess/WebCoreSupport/WebChromeClient.h:
3478         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
3479         (WebKit::WebChromeClient::elementDidRefocus): Deleted.
3480
3481         Replaced by the PLATFORM(COCOA) version.
3482
3483         * WebProcess/WebPage/WebPage.cpp:
3484         (WebKit::WebPage::elementDidRefocus):
3485
3486         When refocusing an element, ensure that post-layout editor state data is sent to the UI process by including a
3487         full EditorState in the next layer tree transaction.
3488
3489         * WebProcess/WebPage/WebPage.h:
3490         * WebProcess/WebPage/ios/WebPageIOS.mm:
3491         (WebKit::WebPage::completeSyntheticClick):
3492
3493         Call elementDidRefocus instead of elementDidFocus, in the case where the existing focused element is clicked.
3494
3495         (WebKit::WebPage::getAssistedNodeInformation):
3496
3497         Adjust for the change from selectionRect to elementInteractionLocation.
3498
3499 2018-12-20  Patrick Griffis  <pgriffis@igalia.com>
3500
3501         [GTK][WPE] Grant the sandbox read access to XDG_DATA_HOME/prgname
3502         https://bugs.webkit.org/show_bug.cgi?id=192929
3503
3504         Reviewed by Michael Catanzaro.
3505
3506         * UIProcess/API/glib/WebKitWebContext.cpp:
3507         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
3508         (WebKit::bubblewrapSpawn):
3509
3510 2018-12-20  Chris Dumez  <cdumez@apple.com>
3511
3512         [PSON] SuspendedPageProxy fails to release its process assertion if the WebPage fails to enter PageCache
3513         https://bugs.webkit.org/show_bug.cgi?id=192873
3514
3515         Reviewed by Antti Koivisto.
3516
3517         SuspendedPageProxy fails to release its process assertion if the WebPage fails to enter PageCache, preventing
3518         the process from suspending on iOS.
3519
3520         * UIProcess/SuspendedPageProxy.cpp:
3521         (WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
3522         (WebKit::SuspendedPageProxy::didReceiveMessage):
3523         (WebKit::SuspendedPageProxy::didSuspend): Deleted.
3524         (WebKit::SuspendedPageProxy::didFailToSuspend): Deleted.
3525         * UIProcess/SuspendedPageProxy.h:
3526
3527 2018-12-19  Chris Dumez  <cdumez@apple.com>
3528
3529         wtf/Optional.h: move-constructor and move-assignment operator should disengage the value being moved from
3530         https://bugs.webkit.org/show_bug.cgi?id=192728
3531         <rdar://problem/46746779>
3532
3533         Reviewed by Geoff Garen.
3534
3535         * NetworkProcess/*:
3536         * Platform/*:
3537         * Scripts/*:
3538         * Shared/*:
3539         * UIProcess/*:
3540         * WebProcess/*:
3541
3542 2018-12-19  Michael Catanzaro  <mcatanzaro@igalia.com>
3543
3544         Unreviewed, silence -Wpragmas warning
3545
3546         * WebProcess/WebCoreSupport/WebAlternativeTextClient.h:
3547
3548 2018-12-19  Vivek Seth  <v_seth@apple.com>
3549
3550         HTTPS Upgrade: Use full sqlite upgrade list
3551         https://bugs.webkit.org/show_bug.cgi?id=192736
3552         <rdar://problem/45851427>
3553
3554         Reviewed by Chris Dumez.
3555
3556         * NetworkProcess/NetworkHTTPSUpgradeChecker.cpp: Added.
3557         (WebKit::NetworkHTTPSUpgradeCheckerDatabasePath):
3558         (WebKit::NetworkHTTPSUpgradeChecker::NetworkHTTPSUpgradeChecker):
3559         (WebKit::NetworkHTTPSUpgradeChecker::~NetworkHTTPSUpgradeChecker):
3560         (WebKit::NetworkHTTPSUpgradeChecker::query):
3561         (WebKit::NetworkHTTPSUpgradeChecker::isAlwaysOnLoggingAllowed const):
3562         * NetworkProcess/NetworkHTTPSUpgradeChecker.h: Added.
3563         (WebKit::NetworkHTTPSUpgradeChecker::didSetupCompleteSuccessfully const):
3564         * NetworkProcess/NetworkLoadChecker.cpp:
3565         (WebKit::NetworkLoadChecker::applyHTTPSUpgradeIfNeeded const):
3566         (WebKit::NetworkLoadChecker::checkRequest):
3567         * NetworkProcess/NetworkLoadChecker.h:
3568         * NetworkProcess/NetworkProcess.h:
3569         (WebKit::NetworkProcess::networkHTTPSUpgradeChecker):
3570         * Sources.txt:
3571         * WebKit.xcodeproj/project.pbxproj:
3572
3573 2018-12-19  Tim Horton  <timothy_horton@apple.com>
3574
3575         Use delegate instead of drawingDelegate in WKDrawingView
3576         https://bugs.webkit.org/show_bug.cgi?id=192899
3577         <rdar://problem/46733339>
3578
3579         Reviewed by Wenson Hsieh.
3580
3581         * UIProcess/ios/WKDrawingView.mm:
3582         (-[WKDrawingView initWithEmbeddedViewID:webPageProxy:]):
3583         Do the dance.
3584
3585 2018-12-19  Alex Christensen  <achristensen@webkit.org>
3586
3587         Navigations away from the SafeBrowsing interstitial show a flash of old content
3588         https://bugs.webkit.org/show_bug.cgi?id=192676
3589
3590         Reviewed by Chris Dumez.
3591
3592         When a user clicks through a safe browsing warning, do not remove the warning until content is drawn for the destination.
3593         Otherwise, the user will confusingly see the page before the warning while the navigation happens.
3594         We can only do this for warnings caused by main frame navigations, though.  Other warnings (such as those caused by iframes)
3595         need to be cleared immediately, and we still need to clear the warning immediately if the user has said to go back.
3596
3597         This change is reflected in an updated API test.
3598
3599         * UIProcess/API/Cocoa/WKWebView.mm:
3600         (-[WKWebView _showSafeBrowsingWarning:completionHandler:]):
3601         * UIProcess/Cocoa/SafeBrowsingWarningCocoa.mm:
3602         (WebKit::SafeBrowsingWarning::SafeBrowsingWarning):
3603         * UIProcess/Cocoa/WKSafeBrowsingWarning.h:
3604         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
3605         (-[WKSafeBrowsingWarning forMainFrameNavigation]):
3606         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
3607         (WebKit::WebPageProxy::beginSafeBrowsingCheck):
3608         * UIProcess/Cocoa/WebViewImpl.h:
3609         * UIProcess/Cocoa/WebViewImpl.mm:
3610         (WebKit::WebViewImpl::showSafeBrowsingWarning):
3611         (WebKit::WebViewImpl::clearSafeBrowsingWarningIfForMainFrameNavigation):
3612         * UIProcess/PageClient.h:
3613         (WebKit::PageClient::clearSafeBrowsingWarningIfForMainFrameNavigation):
3614         * UIProcess/SafeBrowsingWarning.h:
3615         (WebKit::SafeBrowsingWarning::create):
3616         (WebKit::SafeBrowsingWarning::forMainFrameNavigation const):
3617         * UIProcess/WebPageProxy.cpp:
3618         (WebKit::WebPageProxy::didReachLayoutMilestone):
3619         (WebKit::WebPageProxy::beginSafeBrowsingCheck):
3620         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
3621         * UIProcess/WebPageProxy.h:
3622         * UIProcess/ios/PageClientImplIOS.h:
3623         * UIProcess/mac/PageClientImplMac.h:
3624         * UIProcess/mac/PageClientImplMac.mm:
3625         (WebKit::PageClientImpl::clearSafeBrowsingWarningIfForMainFrameNavigation):
3626
3627 2018-12-19  Tim Horton  <timothy_horton@apple.com>
3628
3629         UI process crash when focusing an editable image
3630         https://bugs.webkit.org/show_bug.cgi?id=192839
3631         <rdar://problem/46786670>
3632
3633         Reviewed by Wenson Hsieh.
3634
3635         * SourcesCocoa.txt:
3636         * UIProcess/ios/WKContentViewInteraction.h:
3637         * UIProcess/ios/WKContentViewInteraction.mm:
3638         (-[WKContentView _requiresKeyboardWhenFirstResponder]):
3639         (-[WKContentView inputView]):
3640         (-[WKContentView requiresAccessoryView]):
3641         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
3642         (-[WKContentView _stopAssistingNode]):
3643         (-[WKContentView _installInkPickerForDrawingViewWithID:]):
3644         (-[WKContentView _uninstallInkPicker]):
3645         * UIProcess/ios/WKInkPickerView.h: Renamed from Source/WebKit/UIProcess/ios/WKInkPickerControl.h.
3646         * UIProcess/ios/WKInkPickerView.mm: Renamed from Source/WebKit/UIProcess/ios/WKInkPickerControl.mm.
3647         (-[WKInkPickerView initWithDrawingView:]):
3648         (-[WKInkPickerView didPickInk]):
3649         (-[WKInkPickerView inlineInkPickerDidToggleRuler:]):
3650         (-[WKInkPickerView inlineInkPicker:didSelectTool:]):
3651         (-[WKInkPickerView inlineInkPicker:didSelectColor:]):
3652         (-[WKInkPickerView inkPickerSize]):
3653         (-[WKInkPickerView layoutSubviews]):
3654         (-[WKInkPickerView sizeThatFits:]):
3655         (-[WKInkPickerView viewControllerForPopoverPresentationFromInlineInkPicker:]):
3656         * WebKit.xcodeproj/project.pbxproj:
3657         Make WKInkPickerView a WKWebView subview instead of an inputView.
3658         Also, don't force the keyboard to be visible when an editable image is focused.
3659
3660 2018-12-19  Eric Carlson  <eric.carlson@apple.com>
3661
3662         [MediaStream] Force system camera/microphone TCC prompt if necessary
3663         https://bugs.webkit.org/show_bug.cgi?id=192820
3664         <rdar://problem/42680098>
3665
3666         Reviewed by Jer Noble.
3667
3668         * UIProcess/Cocoa/UIDelegate.mm:
3669         (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest): Enable TCC check 
3670         and prompt on Mojave.
3671
3672 2018-12-19  Megan Gardner  <megan_gardner@apple.com>
3673
3674         Allow clients to set the navigator platform
3675         https://bugs.webkit.org/show_bug.cgi?id=192735
3676
3677         Reviewed by Tim Horton.
3678
3679         Add private API to allow clients to override the default navigator
3680         platform. Some websites check for the platform, which 
3681         interfears with our request desktop site feature. This should
3682         help more sites function as expected.
3683
3684         * Shared/WebsitePoliciesData.cpp:
3685         (WebKit::WebsitePoliciesData::encode const):
3686         (WebKit::WebsitePoliciesData::decode):
3687         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
3688         * Shared/WebsitePoliciesData.h:
3689         * UIProcess/API/APIWebsitePolicies.cpp:
3690         (API::WebsitePolicies::data):
3691         * UIProcess/API/APIWebsitePolicies.h:
3692         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
3693         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
3694         (-[_WKWebsitePolicies setCustomNavigatorPlatform:]):
3695         (-[_WKWebsitePolicies customNavigatorPlatform]):
3696         * UIProcess/Cocoa/NavigationState.mm:
3697         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
3698
3699 2018-12-19  Truitt Savell  <tsavell@apple.com>
3700
3701         Unreviewed, rolling out r239358.
3702
3703         Revision caused imported/w3c/web-platform-tests/IndexedDB/ to
3704         crash on Debug bots
3705
3706         Reverted changeset:
3707
3708         "Clean up IndexedDB files between tests"
3709         https://bugs.webkit.org/show_bug.cgi?id=192796
3710         https://trac.webkit.org/changeset/239358
3711
3712 2018-12-18  Alex Christensen  <achristensen@webkit.org>
3713
3714         REGRESSION(r239134) iOS safe browsing warning unable to show details
3715         https://bugs.webkit.org/show_bug.cgi?id=192837
3716
3717         Reviewed by Tim Horton.
3718
3719         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
3720         (-[WKSafeBrowsingWarning addContent]):
3721         I had a fragile design that relied on the internal view heirarchy structure of UIScrollView,
3722         which I changed in r239134 by introducing a layout which changed where its scrollbars were in the view heirarchy.
3723         I now have a more robust design that saves a WeakObjCPtr to the view I need to traverse to.
3724         Testing is problematic because this had to do with scrollbars and UIScrollView internals which seem to behave
3725         differently in TestWebKitAPI, but I verified manually that this fixes the issue.
3726
3727 2018-12-18  Fujii Hironori  <Hironori.Fujii@sony.com>
3728
3729         [Win][Clang] Fix compilation warnings under Source/WebKit directory
3730         https://bugs.webkit.org/show_bug.cgi?id=192695
3731
3732         Reviewed by Alex Christensen.
3733
3734         * NetworkProcess/cache/NetworkCacheData.cpp:
3735         (makeSalt): Enclosed by #if !OS(WINDOWS).
3736         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
3737         (WebKit::NetworkCache::directoryEntryType): Ditto.
3738         * Platform/win/ModuleWin.cpp:
3739         (WebKit::Module::platformFunctionPointer const): Cast a function pointer with reinterpret_cast<void*>().
3740         * UIProcess/DrawingAreaProxyImpl.cpp:
3741         (WebKit::DrawingAreaProxyImpl::DrawingMonitor::DrawingMonitor):
3742         Moved the initializer of m_webPage in order to be encluded by #if PLATFORM(GTK).
3743         * UIProcess/DrawingAreaProxyImpl.h: Ditto.
3744         * UIProcess/Launcher/win/ProcessLauncherWin.cpp:
3745         (WebKit::processName): Removed the duplicated 'const' type qualifier.
3746         * UIProcess/win/WebInspectorProxyWin.cpp:
3747         (WebKit::WebInspectorProxy::platformAttach): Removed an unused variable.
3748         (WebKit::WebInspectorProxy::platformDetach): Ditto.
3749         * UIProcess/win/WebPopupMenuProxyWin.cpp: Ditto.
3750         * UIProcess/win/WebView.cpp:
3751         (WebKit::WebView::paint): Ditto.
3752         (WebKit::WebPopupMenu::setUpPlatformData): Ditto.
3753         * UIProcess/win/WebPopupMenuProxyWin.h: Marked override methods with 'override'.
3754         * WebProcess/WebCoreSupport/curl/WebFrameNetworkingContext.h: Ditto.
3755         * WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp: Removed an unused variable.
3756
3757 2018-12-18  Wenson Hsieh  <wenson_hsieh@apple.com>
3758
3759         [macOS] fast/forms/datalist/datalist-textinput-suggestions-order.html sometimes crashes after r239337
3760         https://bugs.webkit.org/show_bug.cgi?id=192836
3761         <rdar://problem/45321184>
3762
3763         Reviewed by Tim Horton.
3764
3765         r239337 exposed a subtle issue in the implementation of `-[WKDataListSuggestionsView updateWithInformation:]`,
3766         wherein we might end up recomputing information for table view cells at rows that no longer exist. This currently
3767         happens because we first set the datalist's `_suggestions`, then change the table view's frame, and then finally
3768         reload the table view; however, in the case where the number of suggestions decreased and the frame changed
3769         (which prompts AppKit to ask us again for table cell views), we'll attempt to access an out-of-bounds index in
3770         the `_suggestions` vector.
3771
3772         To address this, we change our suggestions and immediately reload the table view before updating `NSTableView`'s
3773         frame, so that we only provide table view cells for rows that actually correspond to items in `_suggestions`.
3774
3775         * UIProcess/mac/WebDataListSuggestionsDropdownMac.mm:
3776         (-[WKDataListSuggestionsView updateWithInformation:]):
3777
3778 2018-12-18  Jiewen Tan  <jiewen_tan@apple.com>
3779
3780         [Mac] Layout Test http/wpt/webauthn/public-key-credential-create-success-hid.https.html and http/wpt/webauthn/public-key-credential-get-success-hid.https.html are flaky
3781         https://bugs.webkit.org/show_bug.cgi?id=192061
3782
3783         Reviewed by Dewei Zhu.
3784
3785         Part 4.
3786
3787         Add some additional temporary logging info to determine if the time out value passed to the timer is right.
3788         Once the bug is determined and fixed, we should remove all logging added in this patch.
3789
3790         * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
3791         (WebKit::AuthenticatorManager::initTimeOutTimer):
3792
3793 2018-12-18  Sihui Liu  <sihui_liu@apple.com>
3794
3795         Clean up IndexedDB files between tests
3796         https://bugs.webkit.org/show_bug.cgi?id=192796
3797
3798         Reviewed by Geoffrey Garen.
3799
3800         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
3801         (WKWebsiteDataStoreRemoveAllIndexedDatabasesSync):
3802         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
3803
3804 2018-12-18  Vivek Seth  <v_seth@apple.com>
3805
3806         HTTPS Upgrade: Scripts / preprocessing necessary to create new database in future
3807         https://bugs.webkit.org/show_bug.cgi?id=192612
3808         <rdar://problem/46651207>
3809
3810         Reviewed by Andy Estes.
3811
3812         * Configurations/WebKit.xcconfig:
3813         * DerivedSources.make:
3814         * Scripts/generate-https-upgrade-database.sh: Added.
3815         * WebKit.xcodeproj/project.pbxproj:
3816
3817 2018-12-18  Wenson Hsieh  <wenson_hsieh@apple.com>
3818
3819         Unreviewed, fix the 32-bit watchOS build after r239314
3820
3821         * UIProcess/API/Cocoa/WKWebView.mm:
3822         (-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):
3823
3824 2018-12-18  Alex Christensen  <achristensen@webkit.org>
3825
3826         WKWebView has old URL while displaying SafeBrowsing interstitial, for link-click navigations
3827         https://bugs.webkit.org/show_bug.cgi?id=192675
3828
3829         Reviewed by Geoffrey Garen.
3830
3831         When a safe browsing warning is being shown, WKWebView.URL should be the unsafe website, not the safe website before it.
3832
3833         * UIProcess/API/Cocoa/WKWebView.mm:
3834         (-[WKWebView _showSafeBrowsingWarningWithTitle:warning:details:completionHandler:]):
3835         (-[WKWebView _showSafeBrowsingWarningWithURL:title:warning:details:completionHandler:]):
3836         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3837         * UIProcess/Cocoa/SafeBrowsingWarningCocoa.mm:
3838         (WebKit::SafeBrowsingWarning::SafeBrowsingWarning):
3839         * UIProcess/SafeBrowsingWarning.h:
3840         (WebKit::SafeBrowsingWarning::create):
3841         (WebKit::SafeBrowsingWarning::url const):
3842         * UIProcess/WebPageProxy.cpp:
3843         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
3844
3845 2018-12-18  Chris Dumez  <cdumez@apple.com>
3846
3847         Regression(r239182) SuspendedPage's process reuse for link navigation optimization sometimes broken
3848         https://bugs.webkit.org/show_bug.cgi?id=192772
3849
3850         Reviewed by Antti Koivisto.
3851
3852         With r239182, if the page in the previous process would fail to enter PageCache, we would destroy
3853         the corresponding SuspendedPageProxy, which would potentially terminate the process. This would
3854         regress performance when trying to navigate back in history to that page. This would also regress
3855         performance when link-navigating to the same domain as we would have previously reused the suspended
3856         page's process for such navigation.
3857
3858         Address the issue by keeping the SuspendedPageProxy alive even if the WebPage fails to suspend.
3859         When trying to reuse a SuspendedPageProxy, if the page failed to suspend, reuse its process but
3860         not the suspended page itself.
3861
3862         * UIProcess/SuspendedPageProxy.cpp:
3863         (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
3864         (WebKit::SuspendedPageProxy::waitUntilReadyToUnsuspend):
3865         (WebKit::SuspendedPageProxy::unsuspend):
3866         (WebKit::SuspendedPageProxy::didSuspend):
3867         (WebKit::SuspendedPageProxy::didFailToSuspend):
3868         (WebKit::SuspendedPageProxy::loggingString const):
3869         * UIProcess/SuspendedPageProxy.h:
3870         * UIProcess/WebPageProxy.cpp:
3871         (WebKit::WebPageProxy::swapToWebProcess):
3872         * UIProcess/WebProcessPool.cpp:
3873         (WebKit::WebProcessPool::processForNavigationInternal):
3874
3875 2018-12-17  Jiewen Tan  <jiewen_tan@apple.com>
3876
3877         [Mac] Layout Test http/wpt/webauthn/public-key-credential-create-success-hid.https.html and http/wpt/webauthn/public-key-credential-get-success-hid.https.html are flaky
3878         https://bugs.webkit.org/show_bug.cgi?id=192061
3879
3880         Reviewed by Dewei Zhu.
3881
3882         Part 3.
3883
3884         Add some additional temporary logging info to determine if the timer is working as expected.
3885         Once the bug is determined and fixed, we should remove all logging added in this patch.
3886
3887         * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
3888         (WebKit::AuthenticatorManager::respondReceived):
3889         (WebKit::AuthenticatorManager::initTimeOutTimer):
3890         (WebKit::AuthenticatorManager::timeOutTimerFired):
3891         * UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.cpp:
3892         (WebKit::MockAuthenticatorManager::respondReceivedInternal):
3893
3894 2018-12-17  Saam barati  <sbarati@apple.com>
3895
3896         Enable HTTP and HTTPS proxies on iOS and make it a property of the NSURLSession
3897         https://bugs.webkit.org/show_bug.cgi?id=192374
3898         <rdar://problem/46506286>
3899
3900         Reviewed by Alex Christensen.
3901
3902         This patch makes it so that we can use HTTP/HTTPS proxies on iOS as well.
3903         To enable on iOS, you can do something like:
3904         $ defaults write -g WebKit2HTTPProxy -string "http://localhost:8080"
3905         $ defaults write -g WebKit2HTTPSProxy -string "http://localhost:8080"
3906         
3907         This patch also changes the Proxy to be enabled on a per NSURLSession
3908         basis instead of a per process basis.
3909
3910         * NetworkProcess/NetworkProcess.cpp:
3911         (WebKit::NetworkProcess::initializeNetworkProcess):
3912         * NetworkProcess/NetworkSessionCreationParameters.cpp:
3913         (WebKit::NetworkSessionCreationParameters::privateSessionParameters):
3914         (WebKit::NetworkSessionCreationParameters::encode const):
3915         (WebKit::NetworkSessionCreationParameters::decode):
3916         * NetworkProcess/NetworkSessionCreationParameters.h:
3917         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3918         (WebKit::proxyDictionary):
3919         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
3920         * NetworkProcess/mac/NetworkProcessMac.mm:
3921         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
3922         (WebKit::overrideSystemProxies): Deleted.
3923         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3924         (-[WKWebsiteDataStore _initWithConfiguration:]):
3925         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
3926         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
3927         (-[_WKWebsiteDataStoreConfiguration httpProxy]):
3928         (-[_WKWebsiteDataStoreConfiguration setHTTPProxy:]):
3929         (-[_WKWebsiteDataStoreConfiguration httpsProxy]):
3930         (-[_WKWebsiteDataStoreConfiguration setHTTPSProxy:]):
3931         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3932         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
3933         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
3934         (WebKit::WebsiteDataStore::parameters):
3935         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
3936         (WebKit::WebsiteDataStoreConfiguration::copy):
3937         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
3938         (WebKit::WebsiteDataStoreConfiguration::httpProxy const):
3939         (WebKit::WebsiteDataStoreConfiguration::setHTTPProxy):
3940         (WebKit::WebsiteDataStoreConfiguration::httpsProxy const):
3941         (WebKit::WebsiteDataStoreConfiguration::setHTTPSProxy):
3942
3943 2018-12-17  Wenson Hsieh  <wenson_hsieh@apple.com>
3944
3945         Tap highlights should not be shown on iOSMac
3946         https://bugs.webkit.org/show_bug.cgi?id=192797
3947         <rdar://problem/46793995>
3948
3949         Reviewed by Tim Horton.
3950
3951         WKWebViews in iOSMac should avoid painting tap highlights, since tap highlights are not present in the rest of
3952         the macOS platform. Simply disable this functionality by bailing in `-[WKContentView _showTapHighlight]`.
3953
3954         * UIProcess/ios/WKContentViewInteraction.mm:
3955         (-[WKContentView _showTapHighlight]):
3956
3957 2018-12-17  Wenson Hsieh  <wenson_hsieh@apple.com>
3958
3959         Unreviewed, fix the iOSMac engineering build again
3960
3961         After r239311, `WebProcessProxy::fullKeyboardAccessEnabled` in `WebProcessProxyIOS.mm` attempts to use
3962         `WKFullKeyboardAccessWatcher`, which is guarded by `ENABLE(FULL_KEYBOARD_ACCESS)`. However, on iOSMac,
3963         `ENABLE(FULL_KEYBOARD_ACCESS)` is 0. Fix the build by putting access to `WKFullKeyboardAccessWatcher` behind
3964         `ENABLE(FULL_KEYBOARD_ACCESS)`.
3965
3966         * UIProcess/ios/WebProcessProxyIOS.mm:
3967         (WebKit::WebProcessProxy::fullKeyboardAccessEnabled):
3968
3969 2018-12-17  Wenson Hsieh  <wenson_hsieh@apple.com>
3970
3971         Unreviewed, fix the iOSMac engineering build
3972
3973         `generateRequestID()` is only invoked from code under `ENABLE(MEDIA_STREAM)`; move it under this guard to avoid
3974         an unused function warning.
3975
3976         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
3977
3978 2018-12-17  David Kilzer  <ddkilzer@apple.com>
3979
3980         clang-tidy: Fix unnecessary object copy in CPUMonitor::setCPULimit()
3981         <https://webkit.org/b/192707>