MAP_JIT is not present for minimal simulator builds
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2018-06-19  Brent Fulgham  <bfulgham@apple.com>
2
3         MAP_JIT is not present for minimal simulator builds
4         https://bugs.webkit.org/show_bug.cgi?id=186608
5
6         Reviewed by Darin Adler.
7
8         * Configurations/WebContent-iOS-minimalsimulator.entitlements:
9
10 2018-06-18  John Wilander  <wilander@apple.com>
11
12         Resource Load Statistics: Make sure to call callbacks even if there is no store (test infrastructure)
13         https://bugs.webkit.org/show_bug.cgi?id=186777
14         <rdar://problem/41216181>
15
16         Reviewed by Chris Dumez.
17
18         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
19         (WKWebsiteDataStoreStatisticsUpdateCookiePartitioning):
20         (WKWebsiteDataStoreSetStatisticsShouldPartitionCookiesForHost):
21         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
22         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
23
24 2018-06-18  Chris Dumez  <cdumez@apple.com>
25
26         Crash under WebProcessPool::networkProcessFailedToLaunch():
27         https://bugs.webkit.org/show_bug.cgi?id=186784
28         <rdar://problem/33535377>
29
30         Reviewed by Brady Eidson.
31
32         * UIProcess/API/Cocoa/WKProcessPool.mm:
33         (+[WKProcessPool _allProcessPoolsForTesting]):
34         Add SPI to retrieve all WebProcessPool for testing purposes.
35
36         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
37         * UIProcess/Network/NetworkProcessProxy.cpp:
38         (WebKit::NetworkProcessProxy::clearCallbackStates):
39         Make iteration over completion handlers robust against completion handlers
40         getting removed while we iterate.
41
42         (WebKit::NetworkProcessProxy::didClose):
43         Ref the WebProcessPool (which keeps the NetworkProcessProxy alive too)
44         as several calls within this method might cause the WebProcessPool /
45         NetworkProcessProxy to get destroyed.
46
47 2018-06-18  Chris Dumez  <cdumez@apple.com>
48
49         Implement IPC throttling to keep the main thread responsive when a process misbehaves
50         https://bugs.webkit.org/show_bug.cgi?id=186607
51
52         Reviewed by Geoffrey Garen.
53
54         Implement IPC throttling to keep the main thread responsive when a process misbehaves.
55         Instead of doing one main runloop dispatch per incoming message, we now do a single
56         runloop dispatch and process incoming messages in batch. We put a limit on the number
57         of messages to be processed in a batch (600). If the queue is larger that this limit,
58         we'll schedule a 0-timer to process remaining messages, giving the main runloop a chance
59         to process other events. Additionally, if an IPC connection keeps hitting this maximum
60         batch size limit, we implement back off and we'll further decrease the number of messages
61         we process in each batch (going as low as 60). This keeps Safari responsive enough to
62         allow the user to close the bad tab (even on older devices such as iPhone 5s).
63
64         Finally, if the incoming message queue becomes too large (50000), we go one step further
65         and kill the IPC connection in order to maintain performance / battery life.
66
67         Every time we apply throttling or terminate a connection due to throttling, we do a
68         RELEASE_LOG_ERROR() with useful information in order to help diagnose potential issues
69         in the future.
70
71         * Platform/IPC/Connection.cpp:
72         (IPC::Connection::Connection):
73         (IPC::Connection::enqueueIncomingMessage):
74         (IPC::Connection::MessagesThrottler::MessagesThrottler):
75         (IPC::Connection::MessagesThrottler::scheduleMessagesDispatch):
76         (IPC::Connection::MessagesThrottler::numberOfMessagesToProcess):
77         (IPC::Connection::dispatchIncomingMessages):
78         * Platform/IPC/Connection.h:
79         * Platform/IPC/mac/ConnectionMac.mm:
80         (IPC::Connection::kill):
81
82 2018-06-18  Jiewen Tan  <jiewen_tan@apple.com>
83
84         Add a graceful exit for AuthenticationManager::initializeConnection
85         https://bugs.webkit.org/show_bug.cgi?id=186632
86         <rdar://problem/41041033>
87
88         Reviewed by Brent Fulgham.
89
90         Add a graceful exit for AuthenticationManager::initializeConnection when the provided IPC connection
91         is null or the underlying xpc connection is null.
92
93         * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
94         (WebKit::AuthenticationManager::initializeConnection):
95
96 2018-06-18  Youenn Fablet  <youenn@apple.com>
97
98         Validate Cross-Origin-Resource-Policy for resources cached in the MemoryCache
99         https://bugs.webkit.org/show_bug.cgi?id=186639
100         <rdar://problem/41106984>
101
102         Reviewed by Geoffrey Garen.
103
104         Make use of WebCore method to check CORP.
105
106         * NetworkProcess/NetworkLoadChecker.cpp:
107         (WebKit::NetworkLoadChecker::validateResponse):
108         * NetworkProcess/NetworkLoadChecker.h:
109
110 2018-06-18  Karl Leplat  <karl.leplat_ext@softathome.com>
111
112         [Threaded paintingEngine] Fix rendering glitches
113         https://bugs.webkit.org/show_bug.cgi?id=186764
114
115         Reviewed by Žan Doberšek.
116
117         * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
118         (WebKit::CoordinatedBackingStoreTile::swapBuffers):
119         We call Nicosia::Buffer function waitUntilPaintingComplete()
120         in order to synchronize of using Nicosia:buffer between MainThread
121         and ThreadedCompositor.
122
123
124 2018-06-17  Chris Dumez  <cdumez@apple.com>
125
126         Crash under SuspendedPageProxy::~SuspendedPageProxy()
127         https://bugs.webkit.org/show_bug.cgi?id=186688
128         <rdar://problem/41060769>
129
130         Reviewed by Darin Adler.
131
132         Ref the WebProcessProxy before calling suspendedPageWasDestroyed() on it as this
133         might cause the WebProcessProxy / WebProcessPool to get destroyed otherwise, and
134         we would crash trying to call unregisterSuspendedPageProxy() on the WebProcessPool
135         on the next line.
136
137         * UIProcess/SuspendedPageProxy.cpp:
138         (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
139
140 2018-06-17  Wenson Hsieh  <wenson_hsieh@apple.com>
141
142         [WebKit on watchOS] Upstream watchOS source additions to OpenSource (Part 3)
143         https://bugs.webkit.org/show_bug.cgi?id=186442
144         <rdar://problem/40879364>
145
146         Reviewed by Darin Adler.
147
148         Rename a category referencing "Extra zoom mode".
149
150         * UIProcess/ios/WKContentViewInteraction.mm:
151
152 2018-06-12  Darin Adler  <darin@apple.com>
153
154         [Cocoa] Make some RetainPtr refinements to get more ready for ARC
155         https://bugs.webkit.org/show_bug.cgi?id=186526
156
157         Reviewed by Anders Carlsson.
158
159         * Platform/cf/ModuleCF.cpp:
160         (WebKit::Module::load): Use move assignment instead of adoptCF/leakRef.
161
162         * Shared/Cocoa/WKNSURLExtras.mm:
163         (+[NSURL _web_URLWithWTFString:]): Cast to NSURL * instead of doing the autorelease
164         here, since the NSURL * operator already does what we want.
165         (+[NSURL _web_URLWithWTFString:relativeToURL:]): Ditto.
166
167         * UIProcess/ios/WKContentView.mm:
168         (-[WKContentView _wk_printedDocument]): Get rid of incorrect use of
169         RetainPtr::autorelease. We don't want to null out _printedDocument each time this
170         function is called.
171
172         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
173         (collectIcons): Get rid of unnecessary use of RetainPtr::autorelease in a function
174         that returns a RetainPtr.
175
176 2018-06-15  Chris Dumez  <cdumez@apple.com>
177
178         Add API test coverage for SW RegistrationDatabase destruction and fix issues found by the test
179         https://bugs.webkit.org/show_bug.cgi?id=186681
180
181         Reviewed by Brady Eidson.
182
183         Make sure StorageProcess::unregisterSWServerConnection() does not unnecessarily
184         create a SWServer. Otherwise, we were in quick session destroying the SWServer
185         and then re-constructing it for the same sessionID, merely to try ot unregister
186         a SWServerConnection.
187
188         * StorageProcess/StorageProcess.cpp:
189         (WebKit::StorageProcess::existingSWOriginStoreForSession const):
190         (WebKit::StorageProcess::unregisterSWServerConnection):
191         * StorageProcess/StorageProcess.h:
192
193 2018-06-15  Basuke Suzuki  <Basuke.Suzuki@sony.com>
194
195         [WinCairo] Move unrelated features of WorkQueueWin into IPC::Connection
196         https://bugs.webkit.org/show_bug.cgi?id=186582
197
198         Add EventListener private class to handle signaled tasks for I/O.
199         Originally they were in WTF::WorkQueueWin, but those features were not related
200         to WorkQueue and only used in IPC::ConnectionWin. Moved logic is more specialized
201         than old generalized logic. That was unneeded generalization.
202
203         Reviewed by Brent Fulgham.
204
205         * Platform/IPC/Connection.h:
206         (IPC::Connection::EventListener::state):
207         * Platform/IPC/win/ConnectionWin.cpp:
208         (IPC::Connection::platformInitialize):
209         (IPC::Connection::platformInvalidate):
210         (IPC::Connection::readEventHandler):
211         (IPC::Connection::writeEventHandler):
212         (IPC::Connection::invokeReadEventHandler):
213         (IPC::Connection::invokeWriteEventHandler):
214         (IPC::Connection::open):
215         (IPC::Connection::sendOutgoingMessage):
216         (IPC::Connection::EventListener::open):
217         (IPC::Connection::EventListener::callback):
218         (IPC::Connection::EventListener::close):
219
220 2018-06-15  Brady Eidson  <beidson@apple.com>
221
222         Crash in both StorageProcess and UIProcess when using custom WKWebsiteDataStores for data management.
223         <rdar://problem/41019893> and https://bugs.webkit.org/show_bug.cgi?id=186682
224
225         Reviewed by Chris Dumez.
226
227         * UIProcess/Storage/StorageProcessProxy.cpp:
228         (WebKit::StorageProcessProxy::didClose): Protect this and the process pool as the cleanup that follows
229           might cause either to get destroyed.
230
231         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
232         (WebKit::WebsiteDataStore::fetchDataAndApply): Protect the operating WebsiteDataStore while async operations
233           are in flight. Otherwise if the data store is destroyed, the SessionIDs for those operations will get
234           destroyed before they complete.
235         (WebKit::WebsiteDataStore::removeData): Ditto.
236
237 2018-06-15  Per Arne Vollan  <pvollan@apple.com>
238
239         Unreviewed build fix after r232634.
240
241         * WebProcess/WebPage/DrawingArea.h:
242         * WebProcess/WebPage/DrawingArea.messages.in:
243
244 2018-06-15  Per Arne Vollan  <pvollan@apple.com>
245
246         DisplayRefreshMonitorMac should hold a weak pointer to WebPage.
247         https://bugs.webkit.org/show_bug.cgi?id=186683
248
249         Reviewed by Brent Fulgham.
250
251         Instead of DisplayRefreshMonitorMac having a RefPtr to WebPage, it should have a weak pointer.
252         Having a RefPtr could in theory create reference cycles. This potential problem has not been
253         observed in practice, but it is safer to use a weak pointer.
254
255         * WebProcess/WebPage/WebPage.h:
256         * WebProcess/WebPage/mac/DrawingAreaMac.cpp:
257         (WebKit::DisplayRefreshMonitorMac::DisplayRefreshMonitorMac):
258         (WebKit::DisplayRefreshMonitorMac::~DisplayRefreshMonitorMac):
259         (WebKit::DisplayRefreshMonitorMac::requestRefreshCallback):
260
261 2018-06-15  Carlos Alberto Lopez Perez  <clopez@igalia.com>
262
263         [GTK][WKE] Disable memory pressure handling when running layout tests (WTR)
264         https://bugs.webkit.org/show_bug.cgi?id=186663
265
266         Reviewed by Michael Catanzaro.
267
268         r196943 added a mechanism to disable the memory pressure handling
269         on Mac. This patch enables using that mechanism also for GTK/WPE.
270         To do that the environment variable WEBKIT_DISABLE_MEMORY_PRESSURE_MONITOR
271         should bet set to 1.
272         We want to use this on the layout tests to avoid flaky tests caused
273         by accumulated leaks on the WebProcess by different tests.
274
275         * UIProcess/gtk/WebProcessPoolGtk.cpp:
276         (WebKit::WebProcessPool::platformInitializeWebProcess):
277         * UIProcess/wpe/WebProcessPoolWPE.cpp:
278         (WebKit::WebProcessPool::platformInitializeWebProcess):
279
280 2018-06-15  Per Arne Vollan  <pvollan@apple.com>
281
282         Rollout r231818, as it introduced regression on tickets.com.
283         https://bugs.webkit.org/show_bug.cgi?id=186675
284
285         Unreviewed, rolling out.
286
287         * UIProcess/WebPageProxy.cpp:
288         (WebKit::WebPageProxy::dispatchActivityStateChange):
289         * UIProcess/mac/DisplayLink.cpp:
290         (WebKit::DisplayLink::pause): Deleted.
291         (WebKit::DisplayLink::resume): Deleted.
292         * UIProcess/mac/DisplayLink.h:
293
294 2018-06-15  Thibault Saunier  <tsaunier@igalia.com>
295
296         [GTK][WPE]: Avoid using uninitialized launchOptions in getLaunchOptions
297         https://bugs.webkit.org/show_bug.cgi?id=185611
298
299         Reviewed by Chris Dumez.
300
301         Otherwise we might segfault.
302
303         * UIProcess/Plugins/PluginProcessProxy.cpp:
304         (WebKit::PluginProcessProxy::getLaunchOptions):
305
306 2018-06-14  Youenn Fablet  <youenn@apple.com>
307
308         Make NetworkProcess get cache storage parameters at creation of the CacheStorage engine
309         https://bugs.webkit.org/show_bug.cgi?id=186166
310
311         Reviewed by Alex Christensen.
312
313         Make CacheStorage::Engine creation asynchronous.
314         Update Engine public methods be static methods taking a SessionID, which will be used to create the engine.
315
316         Add IPC methods to retrieve cache storage parameters from NetworkProcess to UIProcess.
317
318         Add NetworkProcessProxy ability to compute the cache storage parameters based on the SessionID.
319         For that purpose, make NetworkProcessProxy store a map of SessionID-to-WebsiteDataStore.
320
321         * NetworkProcess/NetworkProcess.cpp:
322         (WebKit::NetworkProcess::deleteWebsiteData):
323         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
324         (WebKit::NetworkProcess::cacheStorageParameters):
325         (WebKit::NetworkProcess::setCacheStorageParameters):
326         (WebKit::NetworkProcess::cacheStorageDirectory const): Deleted.
327         (WebKit::NetworkProcess::cacheStoragePerOriginQuota const): Deleted.
328         * NetworkProcess/NetworkProcess.h:
329         * NetworkProcess/NetworkProcess.messages.in:
330         * NetworkProcess/NetworkProcessCreationParameters.cpp:
331         (WebKit::NetworkProcessCreationParameters::encode const):
332         (WebKit::NetworkProcessCreationParameters::decode):
333         * NetworkProcess/NetworkProcessCreationParameters.h:
334         * NetworkProcess/cache/CacheStorageEngine.cpp:
335         (WebKit::CacheStorage::Engine::from):
336         (WebKit::CacheStorage::Engine::fetchEntries):
337         (WebKit::CacheStorage::Engine::open):
338         (WebKit::CacheStorage::Engine::remove):
339         (WebKit::CacheStorage::Engine::retrieveCaches):
340         (WebKit::CacheStorage::Engine::retrieveRecords):
341         (WebKit::CacheStorage::Engine::putRecords):
342         (WebKit::CacheStorage::Engine::deleteMatchingRecords):
343         (WebKit::CacheStorage::Engine::lock):
344         (WebKit::CacheStorage::Engine::unlock):
345         (WebKit::CacheStorage::Engine::clearMemoryRepresentation):
346         (WebKit::CacheStorage::Engine::representation):
347         (WebKit::CacheStorage::Engine::clearAllCaches):
348         (WebKit::CacheStorage::Engine::clearCachesForOrigin):
349         (WebKit::CacheStorage::Engine::Engine):
350         (WebKit::CacheStorage::Engine::readCachesFromDisk):
351         (WebKit::CacheStorage::Engine::defaultEngine): Deleted.
352         * NetworkProcess/cache/CacheStorageEngine.h:
353         (WebKit::CacheStorage::Engine::shouldPersist const):
354         (WebKit::CacheStorage::Engine::weakPtrFactory):
355         (WebKit::CacheStorage::Engine::create): Deleted.
356         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
357         (WebKit::CacheStorageEngineConnection::~CacheStorageEngineConnection):
358         (WebKit::CacheStorageEngineConnection::open):
359         (WebKit::CacheStorageEngineConnection::remove):
360         (WebKit::CacheStorageEngineConnection::caches):
361         (WebKit::CacheStorageEngineConnection::retrieveRecords):
362         (WebKit::CacheStorageEngineConnection::deleteMatchingRecords):
363         (WebKit::CacheStorageEngineConnection::putRecords):
364         (WebKit::CacheStorageEngineConnection::reference):
365         (WebKit::CacheStorageEngineConnection::dereference):
366         (WebKit::CacheStorageEngineConnection::clearMemoryRepresentation):
367         (WebKit::CacheStorageEngineConnection::engineRepresentation):
368         * NetworkProcess/cache/CacheStorageEngineConnection.h:
369         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
370         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
371         * NetworkProcess/mac/RemoteNetworkingContext.mm:
372         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
373         * Shared/WebsiteDataStoreParameters.cpp:
374         (WebKit::WebsiteDataStoreParameters::encode const):
375         (WebKit::WebsiteDataStoreParameters::decode):
376         (WebKit::WebsiteDataStoreParameters::privateSessionParameters):
377         * Shared/WebsiteDataStoreParameters.h:
378         (): Deleted.
379         * UIProcess/Network/NetworkProcessProxy.cpp:
380         (WebKit::NetworkProcessProxy::addSession):
381         (WebKit::NetworkProcessProxy::removeSession):
382         (WebKit::NetworkProcessProxy::retrieveCacheStorageParameters):
383         * UIProcess/Network/NetworkProcessProxy.h:
384         * UIProcess/Network/NetworkProcessProxy.messages.in:
385         * UIProcess/WebProcessPool.cpp:
386         (WebKit::WebProcessPool::ensureNetworkProcess):
387         (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
388         (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
389         (WebKit::WebProcessPool::pageEndUsingWebsiteDataStore):
390         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
391         (WebKit::WebsiteDataStore::parameters):
392         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
393         (WebKit::WebsiteDataStore::~WebsiteDataStore):
394
395 2018-06-14  Basuke Suzuki  <Basuke.Suzuki@sony.com>
396
397         [Win] Add IPC error case for broken pipe
398         https://bugs.webkit.org/show_bug.cgi?id=186445
399
400         Add error handling for ERROR_BROKEN_PIPE on IPC::Connection::readEventHandler.
401
402         Reviewed by Ryosuke Niwa.
403
404         * Platform/IPC/win/ConnectionWin.cpp:
405         (IPC::Connection::readEventHandler):
406
407 2018-06-14  John Wilander  <wilander@apple.com>
408
409         Resource Load Statistics: Shortcut classification for redirect to prevalent resource
410         https://bugs.webkit.org/show_bug.cgi?id=186627
411         <rdar://problem/41132308>
412
413         Reviewed by Brent Fulgham.
414
415         This patch shortcuts classification of redirect collusion so that we more seldom
416         have to rely on the recursive backtrace of the redirect graph. The initial
417         implementation of Resource Load Statistics actually had this classification method.
418
419         * UIProcess/WebResourceLoadStatisticsStore.cpp:
420         (WebKit::WebResourceLoadStatisticsStore::markAsPrevalentIfHasRedirectedToPrevalent):
421             Iterates through a non-classified resource's data for where it has redirected
422             and classifies it as prevalent if has redirected to 
423         (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
424             Now calls WebResourceLoadStatisticsStore::markAsPrevalentIfHasRedirectedToPrevalent()
425             before regular classification steps. 
426         * UIProcess/WebResourceLoadStatisticsStore.h:
427
428 2018-06-14  Youenn Fablet  <youenn@apple.com>
429
430         Apply CSP checks before Content blocker checks in NetworkLoadChecker as done by CachedResourceLoader
431         https://bugs.webkit.org/show_bug.cgi?id=186550
432
433         Reviewed by Alex Christensen.
434
435         Do CSP checks and URL upgrade before content blocker checks.
436
437         * NetworkProcess/NetworkLoadChecker.cpp:
438         (WebKit::NetworkLoadChecker::checkRequest):
439         (WebKit::NetworkLoadChecker::continueCheckingRequest):
440
441 2018-06-14  Brent Fulgham  <bfulgham@apple.com>
442
443         Plug-in Process crashing on Mojave (affects Flash, others)
444         https://bugs.webkit.org/show_bug.cgi?id=186628
445         <rdar://problem/41120462>
446
447         Reviewed by Eric Carlson.
448
449         Add the missing “com.apple.security.cs.allow-unsigned-executable-memory” entitlement. Also alphabetize
450         the entitlements file to make it easier to read.
451
452         * Configurations/PluginService.entitlements:
453
454 2018-06-14  Carlos Garcia Campos  <cgarcia@igalia.com>
455
456         [GTK][WPE] WebDriver: handle acceptInsecureCertificates capability
457         https://bugs.webkit.org/show_bug.cgi?id=186560
458
459         Reviewed by Brian Burg.
460
461         * UIProcess/API/glib/WebKitAutomationSession.cpp:
462         (webkitAutomationSessionCreate): Check the acceptInsecureCertificates capability and set the TLS error policy in
463         the WebContext accordingly if needed.
464         * UIProcess/API/glib/WebKitAutomationSessionPrivate.h:
465         * UIProcess/API/glib/WebKitWebContext.cpp:
466         * UIProcess/Cocoa/AutomationClient.h:
467         * UIProcess/Cocoa/AutomationClient.mm:
468         (WebKit::AutomationClient::requestAutomationSession): Use SessionCapabilities to fill the session configuration.
469         (WebKit::AutomationClient::requestAutomationSessionWithCapabilities): Deleted.
470
471 2018-06-13  Adrian Perez de Castro  <aperez@igalia.com>
472
473         [WPE] Trying to access the remote inspector hits an assertion in the UIProcess
474         https://bugs.webkit.org/show_bug.cgi?id=186588
475
476         Reviewed by Carlos Garcia Campos.
477
478         Make both the WPE and GTK+ ports use /org/webkit/inspector as base prefix
479         for resource paths, which avoids needing a switcheroo depending on the port.
480
481         * UIProcess/API/wpe/WebKit2InspectorGResourceBundle.xml:
482         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
483         (WebKit::WebInspectorProxy::inspectorPageURL):
484         (WebKit::WebInspectorProxy::inspectorTestPageURL):
485         (WebKit::WebInspectorProxy::inspectorBaseURL):
486         * UIProcess/wpe/WebInspectorProxyWPE.cpp:
487         (WebKit::WebInspectorProxy::inspectorPageURL):
488         (WebKit::WebInspectorProxy::inspectorTestPageURL):
489         (WebKit::WebInspectorProxy::inspectorBaseURL):
490         * WebProcess/WebPage/gtk/WebInspectorUIGtk.cpp:
491         (WebKit::WebInspectorUI::localizedStringsURL):
492         (WebKit::RemoteWebInspectorUI::localizedStringsURL):
493
494 2018-06-13  Chris Dumez  <cdumez@apple.com>
495
496         Crash under SWServer::unregisterConnection(Connection&)
497         https://bugs.webkit.org/show_bug.cgi?id=186584
498         <rdar://problem/40931680>
499
500         Reviewed by Youenn Fablet.
501
502         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
503         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
504         * StorageProcess/StorageToWebProcessConnection.cpp:
505         (WebKit::StorageToWebProcessConnection::~StorageToWebProcessConnection):
506         (WebKit::StorageToWebProcessConnection::didReceiveMessage):
507         (WebKit::StorageToWebProcessConnection::didReceiveSyncMessage):
508         (WebKit::StorageToWebProcessConnection::didClose):
509         (WebKit::StorageToWebProcessConnection::unregisterSWConnections):
510         (WebKit::StorageToWebProcessConnection::establishSWServerConnection):
511         * StorageProcess/StorageToWebProcessConnection.h:
512
513 2018-06-13  Dean Jackson  <dino@apple.com>
514
515         Disable AR support in WKWebView clients
516         https://bugs.webkit.org/show_bug.cgi?id=186611
517         <rdar://problem/39544684>
518
519         Reviewed by Jon Lee.
520
521         Since it hasn't been adequately tested, System Preview (AR) should
522         be disabled by default for WKWebViews.
523
524         Add a new WebPreference, and SPI into WKWebViewConfiguration. Also
525         don't register the WebViewContentProvider if the feature is
526         disabled.
527
528         * Shared/WebPreferences.yaml:
529         * UIProcess/API/Cocoa/WKWebView.mm:
530         (-[WKWebView _initializeWithConfiguration:]):
531         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
532         (-[WKWebViewConfiguration init]):
533         (-[WKWebViewConfiguration encodeWithCoder:]):
534         (-[WKWebViewConfiguration initWithCoder:]):
535         (-[WKWebViewConfiguration copyWithZone:]):
536         (-[WKWebViewConfiguration _contentProviderRegistry]):
537         (-[WKWebViewConfiguration _systemPreviewEnabled]):
538         (-[WKWebViewConfiguration _setSystemPreviewEnabled:]):
539         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
540         * UIProcess/Cocoa/WKWebViewContentProviderRegistry.h:
541         * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
542         (-[WKWebViewContentProviderRegistry initWithConfiguration:]):
543         (-[WKWebViewContentProviderRegistry init]): Deleted.
544
545 2018-06-13  Youenn Fablet  <youenn@apple.com>
546
547         Supported plugin check should be based on plugin identifier
548         https://bugs.webkit.org/show_bug.cgi?id=186578
549         <rdar://problem/40523828>
550
551         Reviewed by Darin Adler.
552
553         Refactoring to move from Plugin name to Plugin identifier.
554         Set built-in pdf plugin identifier.
555         This allows making sure that the PDF plug-in check might not change according localization.
556
557         * Scripts/webkit/messages.py:
558         * Shared/WebCoreArgumentCoders.cpp:
559         (IPC::ArgumentCoder<PluginInfo>::encode):
560         (IPC::ArgumentCoder<PluginInfo>::decode):
561         * UIProcess/Plugins/PluginInfoStore.cpp:
562         (WebKit::PluginInfoStore::supportedPluginIdentifiers):
563         (WebKit::PluginInfoStore::addSupportedPlugin):
564         (WebKit::PluginInfoStore::supportedPluginNames): Deleted.
565         * UIProcess/Plugins/PluginInfoStore.h:
566         * UIProcess/WebProcessProxy.cpp:
567         (WebKit::WebProcessProxy::getPlugins):
568         * UIProcess/WebProcessProxy.h:
569         * UIProcess/WebProcessProxy.messages.in:
570         * WebProcess/Plugins/PDF/PDFPlugin.mm:
571         (WebKit::PDFPlugin::pluginInfo):
572         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
573         (WebKit::WebPluginInfoProvider::pluginInfo):
574         (WebKit::WebPluginInfoProvider::webVisiblePluginInfo):
575         (WebKit::WebPluginInfoProvider::populatePluginCache):
576         * WebProcess/Plugins/WebPluginInfoProvider.h:
577
578 2018-06-13  Chris Dumez  <cdumez@apple.com>
579
580         PSON: http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-collusion.html ASSERTS with process swap enabled
581         https://bugs.webkit.org/show_bug.cgi?id=186545
582
583         Reviewed by Brady Eidson.
584
585         Move frame navigation logging for ITP purposes from the WebProcess to the UIProcess.
586         This information was previously logged in DocumentLoader::willSendRequest() and was getting
587         sync'd to the UIProcess at regular intervals or when the layout tests call testRunner's
588         statisticsNotifyObserver(). We now do the logging directly in the UIProcess, in
589         WebPageProxy::decidePolicyForNavigationAction (which was getting called via IPC from
590         DocumentLoader::willSendRequest()).
591
592         This is more efficient and will also be needed soon due to the way process swap on navigation 
593         deals with cross-origin redirects. On cross-origin redirect of the main frame, PSON cancels
594         the load and started a new load to the redirected to URL in the new WebProcess. As a result,
595         the new WebProcess is not aware that the load is a redirect, which is information that ITP
596         requires. By moving the ITP logging to the UIProcess, we still have access to this
597         information.
598
599         * UIProcess/WebPageProxy.cpp:
600         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
601         (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
602         * UIProcess/WebPageProxy.h:
603         * UIProcess/WebPageProxy.messages.in:
604         - We now pass the full redirect response the the delegate method instead of a simple
605         isRedirect boolean.
606         - Log the navigation in the WebResourceLoadStatisticsStore for ITP purposes.
607
608         * UIProcess/WebResourceLoadStatisticsStore.cpp:
609         (WebKit::areDomainsAssociated):
610         Equivalent of ResourceLoadObserver's areDomainsAssociated(). Most of the logic was moved
611         to ResourceLoadStatistics::areDomainsAssociated() to avoid code duplication.
612
613         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
614         This is called whenever a WebProcess sends new resource load statistics to the UIProcess.
615         Whenever this happens, we call processStatisticsAndDataRecords() right away, which is
616         sometimes the tests currently rely on. As a result, we can cancels any pending statistics
617         processing request that was scheduled by logFrameNavigation().
618
619         (WebKit::WebResourceLoadStatisticsStore::scheduleStatisticsProcessingRequestIfNecessary):
620         (WebKit::WebResourceLoadStatisticsStore::cancelPendingStatisticsProcessingRequest):
621         Whenever a navigation is logged and statistics have been updated, we need to make sure we
622         schedule a "timer" to process the new data. We do this at most every 5 seconds for performance
623         reasons. This 5 second interval matches what the ResourceLoadObserver is using in the WebProcess
624         to notify the UIProcess of new data.
625
626         (WebKit::WebResourceLoadStatisticsStore::logFrameNavigation):
627         This code was moved from ResourceLoadObserver to WebResourceLoadStatisticsStore now that we
628         do this logging in the UIProcess instead of the WebProcess. One difference with WebCore is
629         that we use WebPageProxy::pageLoadState().url() as mainFrameURL instead of
630         WebPageProxy::mainFrame().url(). The reason for that is that WebPageProxy::mainFrame().url()
631         becomes empty in case of process swap but ITP still needs the actual main frame URL when the
632         navigation was triggered. WebPageProxy::pageLoadState().url() gives us this information.
633
634         * UIProcess/WebResourceLoadStatisticsStore.h:
635
636         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
637         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
638         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
639         We now pass the full redirect response the the delegate method instead of a simple
640         isRedirect boolean.
641
642 2018-06-13  Brent Fulgham  <bfulgham@apple.com>
643
644         Crash during interrupted process termination
645         https://bugs.webkit.org/show_bug.cgi?id=185373
646         <rdar://problem/40019480>
647
648         Reviewed by Alex Christensen.
649
650         It's possible to encounter a crash if a user agent feature (such as Safari's responsiveness timer) decides
651         to kill a Web Process around the same time that a user decides to trigger a new page load. One of the two
652         termination operations may attempt to call methods on a nulled process pointer.
653
654         We can avoid this by holding our own reference to the terminating process until the termination steps have
655         been completed.
656
657         * UIProcess/API/C/WKPage.cpp:
658         (WKPageTerminate): Ref<> the active process while the termination call is performed.
659         * UIProcess/API/Cocoa/WKWebView.mm:
660         ([WKWebView _killWebContentProcessAndResetState]): Ditto.
661
662 2018-06-13  Brian Burg  <bburg@apple.com>
663
664         [Cocoa] Web Automation: wrong modifiers sent for 'Help' virtual key
665         https://bugs.webkit.org/show_bug.cgi?id=186600
666         <rdar://problem/41088912>
667
668         Reviewed by Timothy Hatcher.
669
670         This fixes a hang when running W3C test:
671
672             special_keys.py::test_webdriver_special_key_sends_keydown[HELP-expected2]
673
674         * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
675         (WebKit::eventModifierFlagsForVirtualKey):
676         The help modifier doesn't seem to be used when pressing the Help key.
677         I verified this using the Help key on the Keyboard Viewer, since no
678         keyboards from the past decade actually have this physical button.
679
680 2018-06-13  Thibault Saunier  <tsaunier@igalia.com>
681
682         [WPE] Build getUserMedia support
683         https://bugs.webkit.org/show_bug.cgi?id=186547
684
685         Reviewed by Alejandro G. Castro.
686
687         * SourcesWPE.txt: Compile files necessary for MediaStream/webrtc.
688
689 2018-06-13  Andy Estes  <aestes@apple.com>
690
691         [iOS] Synchronize PDF resizing with device rotation
692         https://bugs.webkit.org/show_bug.cgi?id=186587
693         <rdar://problem/40922462>
694
695         Reviewed by Darin Adler.
696
697         Both -beginPDFViewRotation and -endPDFViewRotation need to be called as part of
698         the transition coordinator's -animateAlongsideTransition: block to be synchronized
699         with rotation. Additionally, updateBlock needs to be invoked between the two calls
700         so that PDFKit can capture the frame geometry before and after the update.
701
702         * UIProcess/API/Cocoa/WKWebView.mm:
703         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
704         * UIProcess/Cocoa/WKWebViewContentProvider.h:
705         * UIProcess/ios/WKPDFView.mm:
706         (-[WKPDFView web_beginAnimatedResizeWithUpdates:]):
707         (-[WKPDFView web_beginAnimatedResize]): Renamed to web_beginAnimatedResizeWithUpdates:.
708         (-[WKPDFView web_endAnimatedResize]): Deleted.
709
710 2018-06-12  Brent Fulgham  <bfulgham@apple.com>
711
712         Turn CSS Spring Animations and Link Preload off by default for production builds.
713         https://bugs.webkit.org/show_bug.cgi?id=186548
714         <rdar://problem/41023774>
715
716         Reviewed by Eric Carlson.
717
718         * Shared/WebPreferences.yaml: Switch these features from 'on' to
719         DEFAULT_EXPERIMENTAL_FEATURES_ENABLED.
720
721 2018-06-12  Wenson Hsieh  <wenson_hsieh@apple.com>
722
723         [WebKit on watchOS] Upstream watchOS source additions to OpenSource (Part 2)
724         https://bugs.webkit.org/show_bug.cgi?id=186442
725         <rdar://problem/40879364>
726
727         Reviewed by Tim Horton.
728
729         Upstream most of the work around form controls on watchOS. Also, rename WKFormControlListViewController.* to
730         its intended name, WKQuickboardListViewController.*.
731
732         * UIProcess/ios/WKContentViewInteraction.mm:
733         * UIProcess/ios/forms/WKDatePickerViewController.h:
734         * UIProcess/ios/forms/WKDatePickerViewController.mm:
735         (datePickerSetButtonHeight):
736         (datePickerVerticalMargin):
737         (-[WKDatePickerWheelLabel initWithFrame:]):
738         (-[WKDatePickerWheelLabel lastSelectedDate]):
739         (-[WKDatePickerWheelLabel setLastSelectedDate:]):
740         (-[WKDatePickerWheelLabel needsUpdateForIndex:selectedDate:]):
741         (-[WKDatePickerWheel initWithStyle:]):
742         (-[WKDatePickerWheel initWithController:style:]):
743         (-[WKDatePickerWheel gestureRecognized:]):
744         (-[WKDatePickerWheel setDrawsFocusOutline:]):
745         (-[WKDatePickerWheel drawsFocusOutline]):
746         (-[WKDatePickerWheel gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
747         (-[WKDatePickerViewController initWithDelegate:]):
748         (-[WKDatePickerViewController viewDidLoad]):
749         (-[WKDatePickerViewController prefersStatusBarHidden]):
750         (-[WKDatePickerViewController viewWillAppear:]):
751         (-[WKDatePickerViewController viewDidAppear:]):
752         (-[WKDatePickerViewController viewDidDisappear:]):
753         (-[WKDatePickerViewController _handleStatusBarNavigation]):
754         (-[WKDatePickerViewController viewWillLayoutSubviews]):
755         (-[WKDatePickerViewController becomeFirstResponder]):
756         (-[WKDatePickerViewController defaultMinimumDate]):
757         (-[WKDatePickerViewController defaultMaximumDate]):
758         (-[WKDatePickerViewController _valueForInput]):
759         (-[WKDatePickerViewController _dateFromInitialText]):
760         (-[WKDatePickerViewController _setButtonPressed]):
761         (-[WKDatePickerViewController _updateSelectedPickerViewIndices]):
762         (-[WKDatePickerViewController _configurePickerView:]):
763         (-[WKDatePickerViewController setMinimumDate:]):
764         (-[WKDatePickerViewController minimumDate]):
765         (-[WKDatePickerViewController setMaximumDate:]):
766         (-[WKDatePickerViewController maximumDate]):
767         (-[WKDatePickerViewController setDate:]):
768         (-[WKDatePickerViewController setDateFromComponents:]):
769         (-[WKDatePickerViewController setDay:month:year:era:]):
770         (-[WKDatePickerViewController date]):
771         (-[WKDatePickerViewController _dateComponentForDay:month:year:era:]):
772         (-[WKDatePickerViewController _adjustDateToValidDateIfNecessary]):
773         (-[WKDatePickerViewController _createAndConfigureGranularityLabelWithText:]):
774         (-[WKDatePickerViewController _canonicalizeAndUpdateSelectedDate]):
775         (-[WKDatePickerViewController numberOfItemsInPickerView:]):
776         (-[WKDatePickerViewController pickerView:viewForItemAtIndex:]):
777         (-[WKDatePickerViewController didBeginInteractingWithDatePicker:]):
778         (-[WKDatePickerViewController pickerView:didSelectItemAtIndex:]):
779         (-[WKDatePickerViewController pickerViewWillBeginSelection:]):
780         (-[WKDatePickerViewController pickerViewDidEndSelection:]):
781         (-[WKDatePickerViewController _dayFromIndex:]):
782         (-[WKDatePickerViewController _eraAndYearFromIndex:]):
783         (-[WKDatePickerViewController _monthFromIndex:]):
784         (-[WKDatePickerViewController _indexFromDay:]):
785         (-[WKDatePickerViewController _indexFromYear:era:]):
786         (-[WKDatePickerViewController _indexFromMonth:]):
787         * UIProcess/ios/forms/WKFormControlListViewController.h: Removed.
788         * UIProcess/ios/forms/WKFormControlListViewController.mm: Removed.
789         * UIProcess/ios/forms/WKNumberPadViewController.h:
790         * UIProcess/ios/forms/WKNumberPadViewController.mm:
791         (inputLabelFontSize):
792         (-[WKNumberPadViewController initWithDelegate:initialText:inputMode:]):
793         (-[WKNumberPadViewController dealloc]):
794         (-[WKNumberPadViewController viewDidLoad]):
795         (-[WKNumberPadViewController viewWillDisappear:]):
796         (-[WKNumberPadViewController viewWillLayoutSubviews]):
797         (-[WKNumberPadViewController _reloadHeaderViewFromInputText]):
798         (-[WKNumberPadViewController didSelectKey:]):
799         (-[WKNumberPadViewController _handleKeyPress:]):
800         (-[WKNumberPadViewController _cancelInput]):
801         (-[WKNumberPadViewController _deleteLastInputCharacter]):
802         (-[WKNumberPadViewController _deleteButtonPressed]):
803         (-[WKNumberPadViewController _cancelDeletionTimers]):
804         (-[WKNumberPadViewController _startDeletionTimer]):
805         (-[WKNumberPadViewController _deletionTimerFired]):
806         (-[WKNumberPadViewController addContentViewAnimations:]):
807         * UIProcess/ios/forms/WKQuickboardListViewController.h: Added.
808         * UIProcess/ios/forms/WKQuickboardListViewController.mm: Added.
809         (-[WKQuickboardListItemCell topToLabelBaselineSpecValue]):
810         (-[WKQuickboardListItemCell baselineToBottomSpecValue]):
811         (-[WKQuickboardListViewController initWithDelegate:]):
812         (-[WKQuickboardListViewController updateContextViewIfNeeded]):
813         (-[WKQuickboardListViewController prefersStatusBarHidden]):
814         (-[WKQuickboardListViewController viewDidLoad]):
815         (-[WKQuickboardListViewController viewWillAppear:]):
816         (-[WKQuickboardListViewController viewDidDisappear:]):
817         (-[WKQuickboardListViewController _handleStatusBarNavigation]):
818         (-[WKQuickboardListViewController reloadContextView]):
819         (-[WKQuickboardListViewController actionController]):
820         (-[WKQuickboardListViewController languageControllerDidChangePrimaryLanguage:]):
821         (-[WKQuickboardListViewController headerContentViewHeight]):
822         (-[WKQuickboardListViewController headerContentView]):
823         (configureStatusBarForController):
824         * UIProcess/ios/forms/WKSelectMenuListViewController.h:
825         * UIProcess/ios/forms/WKSelectMenuListViewController.mm:
826         (-[WKSelectMenuItemCell initWithStyle:reuseIdentifier:]):
827         (-[WKSelectMenuItemCell imageView]):
828         (-[WKSelectMenuListViewController initWithDelegate:]):
829         (-[WKSelectMenuListViewController viewDidLoad]):
830         (-[WKSelectMenuListViewController acceptButtonTappedWithCompletion:]):
831         (-[WKSelectMenuListViewController shouldShowTrayView]):
832         (-[WKSelectMenuListViewController didSelectListItem:]):
833         (-[WKSelectMenuListViewController numberOfListItems]):
834         (-[WKSelectMenuListViewController heightForListItem:width:]):
835         (-[WKSelectMenuListViewController cellForListItem:]):
836         (-[WKSelectMenuListViewController selectItemAtIndex:]):
837         * UIProcess/ios/forms/WKTimePickerViewController.h:
838         * UIProcess/ios/forms/WKTimePickerViewController.mm:
839         (-[WKTimePickerViewController initWithDelegate:]):
840         (-[WKTimePickerViewController dateFormatter]):
841         (-[WKTimePickerViewController timeValueForFormControls]):
842         (-[WKTimePickerViewController dateComponentsFromInitialValue]):
843         (-[WKTimePickerViewController viewDidAppear:]):
844         (-[WKTimePickerViewController viewDidLoad]):
845         (-[WKTimePickerViewController becomeFirstResponder]):
846         (-[WKTimePickerViewController setHour:minute:]):
847         (-[WKTimePickerViewController leftButtonWOTAction]):
848         (-[WKTimePickerViewController rightButtonWOTAction]):
849         * WebKit.xcodeproj/project.pbxproj:
850
851 2018-06-12  Jer Noble  <jer.noble@apple.com>
852
853         Make Modern EME An Experimental Feature Again
854         https://bugs.webkit.org/show_bug.cgi?id=186569
855         <rdar://problem/41054402>
856
857         Reviewed by Eric Carlson.
858
859         * Shared/WebPreferences.yaml:
860
861 2018-06-12  Andy Estes  <aestes@apple.com>
862
863         [watchOS] Enable NetworkActivityTracker
864         https://bugs.webkit.org/show_bug.cgi?id=186568
865         <rdar://problem/41050624>
866
867         Reviewed by Tim Horton.
868
869         * NetworkProcess/NetworkActivityTracker.h:
870
871 2018-06-12  Antti Koivisto  <antti@apple.com>
872
873         Add performance logging for slow cache retrieves
874         https://bugs.webkit.org/show_bug.cgi?id=186520
875         <rdar://problem/41002070>
876
877         Reviewed by Chris Dumez.
878
879         We sometimes see slow cache retrieves in logs. Add some more logging to better analyze these cases.
880
881         This patch adds timings to all cache storage retrieve operations and passes them up to the client.
882         We then log the timings on NetworkResourceLoader levels if needed. Items logged include
883
884         - total retrieve time
885         - dispatch delay and number of resources dispatched before this one
886         - record I/O time
887         - blob I/O time
888         - whether cache shrink was in progress
889         - whether cache synchronization was in progress
890         - cancellation
891
892         * NetworkProcess/NetworkResourceLoader.cpp:
893         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
894         (WebKit::NetworkResourceLoader::logSlowCacheRetrieveIfNeeded):
895
896         Log if the retrieve took more than 1s.
897
898         * NetworkProcess/NetworkResourceLoader.h:
899         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
900         (WebKit::CacheStorage::Caches::readRecord):
901         * NetworkProcess/cache/NetworkCache.cpp:
902         (WebKit::NetworkCache::Cache::retrieve):
903         (WebKit::NetworkCache::Cache::completeRetrieve):
904         (WebKit::NetworkCache::Cache::retrieveData):
905         * NetworkProcess/cache/NetworkCache.h:
906         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
907         (WebKit::NetworkCache::SpeculativeLoadManager::retrieveEntryFromStorage):
908         (WebKit::NetworkCache::SpeculativeLoadManager::retrieveSubresourcesEntry):
909
910         SpeculativeLoadManager does not records specific timings yet but at least we do log when they occur.
911
912         * NetworkProcess/cache/NetworkCacheStorage.cpp:
913         (WebKit::NetworkCache::Storage::ReadOperation::cancel):
914         (WebKit::NetworkCache::Storage::ReadOperation::finish):
915
916         Record timing info in ReadOperations.
917
918         (WebKit::NetworkCache::Storage::dispatchReadOperation):
919         (WebKit::NetworkCache::retrieveFromMemory):
920         (WebKit::NetworkCache::Storage::retrieve):
921         * NetworkProcess/cache/NetworkCacheStorage.h:
922
923 2018-06-11  Carlos Garcia Campos  <cgarcia@igalia.com>
924
925         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.21.4 release.
926
927         * gtk/NEWS: Add release notes for 2.21.4.
928
929 2018-06-11  Youenn Fablet  <youenn@apple.com>
930
931         Improve error messages in case FetchEvent.respondWith has a rejected promise
932         https://bugs.webkit.org/show_bug.cgi?id=186368
933
934         Reviewed by Chris Dumez.
935
936         Log in JS console in case of failures.
937         Rely on ThreadableLoader to log which client actually failed.
938
939         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
940         (WebKit::ServiceWorkerClientFetch::didFail):
941
942 2018-06-11  Chris Dumez  <cdumez@apple.com>
943
944         http/tests/security/xss-DENIED-script-inject-into-inactive-window2.html times out with PSON enabled
945         https://bugs.webkit.org/show_bug.cgi?id=186546
946
947         Reviewed by Brady Eidson.
948
949         Disable process swap on navigation in frames that have opened other frames via
950         window.open(). These new windows may have a WindowProxy to their opener, and it
951         would therefore be unsafe to process swap at this point.
952
953         * Shared/NavigationActionData.cpp:
954         (WebKit::NavigationActionData::encode const):
955         (WebKit::NavigationActionData::decode):
956         * Shared/NavigationActionData.h:
957         * UIProcess/API/APINavigation.h:
958         (API::Navigation::setHasOpenedFrames):
959         (API::Navigation::hasOpenedFrames const):
960         * UIProcess/WebPageProxy.cpp:
961         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
962         * UIProcess/WebProcessPool.cpp:
963         (WebKit::WebProcessPool::processForNavigationInternal):
964         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
965         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
966
967 2018-06-11  Keith Rollin  <krollin@apple.com>
968
969         Add logging around internalError(const URL&)
970         https://bugs.webkit.org/show_bug.cgi?id=186369
971         <rdar://problem/40872046>
972
973         Reviewed by Brent Fulgham.
974
975         There are times when we receive bug reports where the user says that
976         they are simply shown a page saying an internal error occurred. To
977         help understand the circumstances of that error, add some logging to
978         internalError() in WebErrors.cpp. This logging logs at the Error level
979         that internalError() was called and then logs a backtrace.
980
981         * Shared/WebErrors.cpp:
982         (WebKit::internalError):
983
984 2018-06-11  Tim Horton  <timothy_horton@apple.com>
985
986         Link drag image is inconsistently unreadable in dark mode
987         https://bugs.webkit.org/show_bug.cgi?id=186472
988
989         Reviewed by Timothy Hatcher.
990
991         * UIProcess/Cocoa/WebViewImpl.mm:
992         (WebKit::WebViewImpl::useDefaultAppearance):
993         Make defaultAppearance accurate even if useSystemAppearance is false.
994         Some parts of WebKit (like the link drag image, but also context menus)
995         want to be able to follow the system appearance regardless of whether
996         the view or content has opted in.
997
998 2018-06-11  Chris Dumez  <cdumez@apple.com>
999
1000         http/tests/security/cors-post-redirect-307.html fails with PSON enabled
1001         https://bugs.webkit.org/show_bug.cgi?id=186441
1002
1003         Reviewed by Brady Eidson.
1004
1005         Rename existing flag to something a bit more generic, now that it is used for
1006         more things than bypassing the navigation policy check.
1007
1008         * Shared/LoadParameters.cpp:
1009         (WebKit::LoadParameters::encode const):
1010         (WebKit::LoadParameters::decode):
1011         * Shared/LoadParameters.h:
1012         * UIProcess/WebPageProxy.cpp:
1013         (WebKit::WebPageProxy::reattachToWebProcessForReload):
1014         (WebKit::WebPageProxy::reattachToWebProcessWithItem):
1015         (WebKit::WebPageProxy::loadRequest):
1016         (WebKit::WebPageProxy::loadRequestWithNavigation):
1017         (WebKit::WebPageProxy::goToBackForwardItem):
1018         (WebKit::WebPageProxy::continueNavigationInNewProcess):
1019         * UIProcess/WebPageProxy.h:
1020         * WebProcess/WebPage/WebPage.cpp:
1021         (WebKit::WebPage::loadRequest):
1022         (WebKit::WebPage::goToBackForwardItem):
1023         * WebProcess/WebPage/WebPage.h:
1024         * WebProcess/WebPage/WebPage.messages.in:
1025
1026 2018-06-11  Nan Wang  <n_wang@apple.com>
1027
1028         AX: [iOS] accessibility sometimes doesn't know process suspension is canceled
1029         https://bugs.webkit.org/show_bug.cgi?id=186450
1030
1031         Reviewed by Chris Fleizach.
1032
1033         There's some early return condition in WebProcess::cancelPrepareToSuspend() which
1034         could lead to accessibility failing to post process status notificaiton. Fixed it
1035         by moving the accessibility notification before the early return condition.
1036
1037         * WebProcess/WebProcess.cpp:
1038         (WebKit::WebProcess::cancelPrepareToSuspend):
1039
1040 2018-06-10  Carlos Garcia Campos  <cgarcia@igalia.com>
1041
1042         [GTK][WPE] Add API run run javascript from a WebKitWebView in an isolated world
1043         https://bugs.webkit.org/show_bug.cgi?id=186192
1044
1045         Reviewed by Michael Catanzaro.
1046
1047         Add webkit_web_view_run_javascript_in_world() that receives a world name. Also add
1048         webkit_script_world_new_with_name() to create an isolated world with a name and webkit_script_world_get_name()
1049         to get the name of a WebKitScriptWorld.
1050
1051         * UIProcess/API/glib/WebKitWebView.cpp:
1052         (webkit_web_view_run_javascript):
1053         (webkit_web_view_run_javascript_finish):
1054         (webkit_web_view_run_javascript_in_world):
1055         (webkit_web_view_run_javascript_in_world_finish):
1056         * UIProcess/API/gtk/WebKitWebView.h:
1057         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols.
1058         * UIProcess/API/wpe/WebKitWebView.h:
1059         * UIProcess/WebPageProxy.cpp:
1060         (WebKit::WebPageProxy::runJavaScriptInMainFrameScriptWorld): Send RunJavaScriptInMainFrameScriptWorld message to
1061         the WebProcess.
1062         * UIProcess/WebPageProxy.h:
1063         * WebProcess/InjectedBundle/API/glib/WebKitScriptWorld.cpp:
1064         (webkitScriptWorldCreate):
1065         (webkit_script_world_new_with_name):
1066         (webkit_script_world_get_name):
1067         * WebProcess/InjectedBundle/API/gtk/WebKitScriptWorld.h:
1068         * WebProcess/InjectedBundle/API/wpe/WebKitScriptWorld.h:
1069         * WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp:
1070         (WebKit::InjectedBundleScriptWorld::find): Find an InjectedBundleScriptWorld by its name.
1071         * WebProcess/InjectedBundle/InjectedBundleScriptWorld.h:
1072         * WebProcess/WebPage/WebPage.cpp:
1073         (WebKit::WebPage::runJavaScriptInMainFrameScriptWorld): Find the InjectedBundleScriptWorld for the given name
1074         and run the script in its js context.
1075         * WebProcess/WebPage/WebPage.h:
1076         * WebProcess/WebPage/WebPage.messages.in: Add RunJavaScriptInMainFrameScriptWorld message.
1077
1078 2018-06-10  Chris Dumez  <cdumez@apple.com>
1079
1080         Reload the Web view in case of crash if the client does not implement webViewWebContentProcessDidTerminate delegate
1081         https://bugs.webkit.org/show_bug.cgi?id=186468
1082
1083         Reviewed by Geoffrey Garen.
1084
1085         We now attempt to reload the Web view if the web content process crashes and the client
1086         does not implement the webViewWebContentProcessDidTerminate delegate (or any of the similar
1087         delegates in our SPI).
1088
1089         * UIProcess/API/APILoaderClient.h:
1090         (API::LoaderClient::processDidCrash):
1091         * UIProcess/API/APINavigationClient.h:
1092         (API::NavigationClient::processDidTerminate):
1093         * UIProcess/API/C/WKPage.cpp:
1094         (WKPageSetPageLoaderClient):
1095         (WKPageSetPageNavigationClient):
1096         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1097         * UIProcess/API/glib/WebKitNavigationClient.cpp:
1098         * UIProcess/Cocoa/NavigationState.h:
1099         * UIProcess/Cocoa/NavigationState.mm:
1100         (WebKit::NavigationState::NavigationClient::processDidTerminate):
1101         * UIProcess/WebPageProxy.cpp:
1102         (WebKit::m_resetRecentCrashCountTimer):
1103         (WebKit::WebPageProxy::didFinishLoadForFrame):
1104         (WebKit::shouldReloadAfterProcessTermination):
1105         (WebKit::WebPageProxy::dispatchProcessDidTerminate):
1106         (WebKit::WebPageProxy::tryReloadAfterProcessTermination):
1107         (WebKit::WebPageProxy::resetRecentCrashCountSoon):
1108         (WebKit::WebPageProxy::resetRecentCrashCount):
1109         (WebKit::m_configurationPreferenceValues): Deleted.
1110         * UIProcess/WebPageProxy.h:
1111
1112 2018-06-09  Dan Bernstein  <mitz@apple.com>
1113
1114         [Xcode] Clean up and modernize some build setting definitions
1115         https://bugs.webkit.org/show_bug.cgi?id=186463
1116
1117         Reviewed by Sam Weinig.
1118
1119         * Configurations/Base.xcconfig: Removed definition for macOS 10.11.
1120         * Configurations/BaseTarget.xcconfig: Simplified the definition of WK_PRIVATE_FRAMEWORKS_DIR
1121           now that WK_XCODE_SUPPORTS_TEXT_BASED_STUBS is true for all supported Xcode versions.
1122         * Configurations/DebugRelease.xcconfig: Removed definition for macOS 10.11.
1123         * Configurations/FeatureDefines.xcconfig: Simplified the definitions of ENABLE_APPLE_PAY and
1124           ENABLE_VIDEO_PRESENTATION_MODE now macOS 10.12 is the earliest supported version.
1125         * Configurations/Version.xcconfig: Removed definition for macOS 10.11.
1126         * Configurations/WebKitTargetConditionals.xcconfig: Removed definitions for macOS 10.11.
1127
1128 2018-06-09  Dan Bernstein  <mitz@apple.com>
1129
1130         Added missing file references to the Configuration group.
1131
1132         * WebKit.xcodeproj/project.pbxproj:
1133
1134 2018-06-08  Wenson Hsieh  <wenson_hsieh@apple.com>
1135
1136         [WebKit on watchOS] Upstream watchOS source additions to OpenSource (Part 1)
1137         https://bugs.webkit.org/show_bug.cgi?id=186442
1138         <rdar://problem/40879364>
1139
1140         Reviewed by Tim Horton.
1141
1142         * Configurations/FeatureDefines.xcconfig:
1143         * UIProcess/ios/WKContentViewInteraction.mm:
1144         (-[WKContentView dismissQuickboardViewControllerAndRevealFocusedFormOverlayIfNecessary:]):
1145         (-[WKContentView quickboard:textEntered:]):
1146         (-[WKContentView quickboardInputCancelled:]):
1147         (-[WKContentView viewController:inputContextViewHeightForSize:]):
1148         (-[WKContentView allowsLanguageSelectionMenuForListViewController:]):
1149         (-[WKContentView inputContextViewForViewController:]):
1150         (-[WKContentView inputLabelTextForViewController:]):
1151         (-[WKContentView initialValueForViewController:]):
1152         (-[WKContentView shouldDisplayInputContextViewForListViewController:]):
1153         (-[WKContentView numericInputModeForListViewController:]):
1154         (-[WKContentView textContentTypeForListViewController:]):
1155         (-[WKContentView textSuggestionsForListViewController:]):
1156         (-[WKContentView listViewController:didSelectTextSuggestion:]):
1157         (-[WKContentView allowsDictationInputForListViewController:]):
1158         * UIProcess/ios/WKScrollView.mm:
1159         (-[WKScrollView initWithFrame:]):
1160         (-[WKScrollView addGestureRecognizer:]):
1161         (-[WKScrollView _configureDigitalCrownScrolling]):
1162         (-[WKScrollView _puic_contentOffsetForCrownInputSequencerOffset:]):
1163         * UIProcess/ios/forms/WKFocusedFormControlView.h:
1164         * UIProcess/ios/forms/WKFocusedFormControlView.mm:
1165         (pathWithRoundedRectInFrame):
1166         (-[WKFocusedFormControlView initWithFrame:delegate:]):
1167         (-[WKFocusedFormControlView handleWheelEvent:]):
1168         (-[WKFocusedFormControlView show:]):
1169         (-[WKFocusedFormControlView hide:]):
1170         (-[WKFocusedFormControlView delegate]):
1171         (-[WKFocusedFormControlView setDelegate:]):
1172         (-[WKFocusedFormControlView dimmingMaskLayer]):
1173         (-[WKFocusedFormControlView handleTap]):
1174         (-[WKFocusedFormControlView _wheelChangedWithEvent:]):
1175         (-[WKFocusedFormControlView didDismiss]):
1176         (-[WKFocusedFormControlView didSubmit]):
1177         (-[WKFocusedFormControlView layoutSubviews]):
1178         (-[WKFocusedFormControlView setHighlightedFrame:]):
1179         (-[WKFocusedFormControlView computeDimmingViewCutoutPath]):
1180         (-[WKFocusedFormControlView disengageFocusedFormControlNavigation]):
1181         (-[WKFocusedFormControlView engageFocusedFormControlNavigation]):
1182         (-[WKFocusedFormControlView reloadData:]):
1183         (-[WKFocusedFormControlView setMaskLayerPosition:animated:]):
1184         (-[WKFocusedFormControlView setHighlightedFrame:animated:]):
1185         (-[WKFocusedFormControlView submitActionName]):
1186         (submitActionNameFontAttributes):
1187         (-[WKFocusedFormControlView setSubmitActionName:]):
1188         (-[WKFocusedFormControlView scrollViewForCrownInputSequencer]):
1189         (-[WKFocusedFormControlView updateViewForCurrentCrownInputSequencerState]):
1190         (-[WKFocusedFormControlView scrollOffsetForCrownInputOffset:]):
1191         (-[WKFocusedFormControlView _crownInputSequencerTimerFired]):
1192         (-[WKFocusedFormControlView cancelPendingCrownInputSequencerUpdate]):
1193         (-[WKFocusedFormControlView scheduleCrownInputSequencerUpdate]):
1194         (-[WKFocusedFormControlView crownInputSequencerOffsetDidChange:]):
1195         (-[WKFocusedFormControlView crownInputSequencerDidBecomeIdle:willDecelerate:]):
1196         (-[WKFocusedFormControlView crownInputSequencerIdleDidChange:]):
1197         (-[WKFocusedFormControlView suggestions]):
1198         (-[WKFocusedFormControlView setSuggestions:]):
1199         (-[WKFocusedFormControlView handleWebViewCredentialsSaveForWebsiteURL:user:password:passwordIsAutoGenerated:]):
1200         (-[WKFocusedFormControlView selectionWillChange:]):
1201         (-[WKFocusedFormControlView selectionDidChange:]):
1202         (-[WKFocusedFormControlView textWillChange:]):
1203         (-[WKFocusedFormControlView textDidChange:]):
1204
1205 2018-06-08  Per Arne Vollan  <pvollan@apple.com>
1206
1207         Only display refresh monitors having requested display refresh callback should get notified on screen updates.
1208         https://bugs.webkit.org/show_bug.cgi?id=186397
1209         <rdar://problem/40897835>
1210
1211         Reviewed by Brent Fulgham.
1212
1213         Since all display refresh monitors in the WebContent process share a single UI process display link,
1214         we should make sure that only the monitors having requested callback are getting notified on screen
1215         updates. I have not been able to reproduce a case where a monitor is being notified without having
1216         requested updates, but we should safeguard the code for future code changes.
1217
1218         * WebProcess/WebPage/mac/DrawingAreaMac.cpp:
1219
1220 2018-06-08  Aditya Keerthi  <akeerthi@apple.com>
1221
1222         [Datalist] Allow TextFieldInputType to show and hide suggestions
1223         https://bugs.webkit.org/show_bug.cgi?id=186151
1224
1225         Reviewed by Tim Horton.
1226
1227         Added WebDataListSuggestionPicker to send messages to the UIProcess in order to update the suggestions view.
1228         This object is also responsible for forwarding messages from WebKit into the DataListSuggestionsClient, which
1229         is the TextFieldInputType in this case. The client needs to know when the suggestions are hidden or if an
1230         suggestion has been selected.
1231
1232         * WebKit.xcodeproj/project.pbxproj:
1233         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1234         (WebKit::WebChromeClient::createDataListSuggestionPicker): Responsible for creating WebDataListSuggestionPicker to send/receive messages.
1235         * WebProcess/WebCoreSupport/WebChromeClient.h:
1236         * WebProcess/WebCoreSupport/WebDataListSuggestionPicker.cpp: Added. Responsible for sending messages to UIProcess and updating the DataListSuggestionsClient.
1237         (WebKit::WebDataListSuggestionPicker::WebDataListSuggestionPicker):
1238         (WebKit::WebDataListSuggestionPicker::~WebDataListSuggestionPicker):
1239         (WebKit::WebDataListSuggestionPicker::handleKeydownWithIdentifier):
1240         (WebKit::WebDataListSuggestionPicker::didSelectOption):
1241         (WebKit::WebDataListSuggestionPicker::didCloseSuggestions):
1242         (WebKit::WebDataListSuggestionPicker::close):
1243         (WebKit::WebDataListSuggestionPicker::displayWithActivationType):
1244         * WebProcess/WebCoreSupport/WebDataListSuggestionPicker.h: Added.
1245         * WebProcess/WebPage/WebPage.cpp:
1246         (WebKit::WebPage::setActiveDataListSuggestionPicker):
1247         (WebKit::WebPage::didSelectDataListOption): Called by UIProcess when option selected.
1248         (WebKit::WebPage::didCloseSuggestions): Called by UIProcess if the suggestions view is closed.
1249         * WebProcess/WebPage/WebPage.h:
1250         * WebProcess/WebPage/WebPage.messages.in:
1251
1252 2018-06-08  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1253
1254         [Win] Fix initial value of HANDLE to INVALID_HANDLE_VALUE
1255         https://bugs.webkit.org/show_bug.cgi?id=186405
1256
1257         The handle was not initialized at all. Initialized with INVALID_HANDLE_VALUE.
1258
1259         Reviewed by Per Arne Vollan.
1260
1261         * Platform/IPC/Attachment.h:
1262         * Platform/IPC/win/AttachmentWin.cpp:
1263         (IPC::Attachment::decode):
1264
1265 2018-06-08  Brian Burg  <bburg@apple.com>
1266
1267         [Cocoa] Web Automation: include browser name and version in listing for automation targets
1268         https://bugs.webkit.org/show_bug.cgi?id=186204
1269         <rdar://problem/36950423>
1270
1271         Reviewed by Darin Adler.
1272
1273         Add a new delegate method that allows the client to set the name and version
1274         of the browser as returned in the 'browserName' and 'browserVersion' capabilities.
1275         If the delegate methods are not implemented, try to get this information from
1276         the main bundle.
1277
1278         In the RWI protocol, these fields are added to automation target listings.
1279
1280         * UIProcess/API/Cocoa/_WKAutomationDelegate.h:
1281         * UIProcess/Cocoa/AutomationClient.h:
1282         * UIProcess/Cocoa/AutomationClient.mm:
1283         (WebKit::AutomationClient::AutomationClient):
1284         (WebKit::AutomationClient::browserName const):
1285         (WebKit::AutomationClient::browserVersion const):
1286
1287 2018-06-08  Per Arne Vollan  <pvollan@apple.com>
1288
1289         Run display links in the UI process when ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING) is true.
1290         https://bugs.webkit.org/show_bug.cgi?id=186379
1291
1292         Reviewed by Brent Fulgham.
1293
1294         Replace __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 with ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING).
1295
1296         * UIProcess/WebPageProxy.cpp:
1297         (WebKit::WebPageProxy::dispatchActivityStateChange):
1298         * UIProcess/WebPageProxy.h:
1299         * UIProcess/WebPageProxy.messages.in:
1300         * UIProcess/mac/DisplayLink.cpp:
1301         * UIProcess/mac/DisplayLink.h:
1302         * UIProcess/mac/WebPageProxyMac.mm:
1303         * WebProcess/WebPage/DrawingArea.cpp:
1304         * WebProcess/WebPage/mac/DrawingAreaMac.cpp:
1305
1306 2018-06-08  Per Arne Vollan  <pvollan@apple.com>
1307
1308         Send display link IPC message from display link thread.
1309         https://bugs.webkit.org/show_bug.cgi?id=186429
1310
1311         Reviewed by Geoffrey Garen.
1312
1313         When the display link callback is firing on the display link thread in the UI process,
1314         we schedule a function to be called on the main thread to send the IPC message to the
1315         WebContent process. Since Connection::send is thread-safe, we can just send the message
1316         from the display link thread, instead. This should be a small performance improvement.
1317
1318         * UIProcess/mac/DisplayLink.cpp:
1319         (WebKit::DisplayLink::DisplayLink):
1320         (WebKit::DisplayLink::displayLinkCallback):
1321         * UIProcess/mac/DisplayLink.h:
1322
1323 2018-06-07  Chris Dumez  <cdumez@apple.com>
1324
1325         Add base class to get WeakPtrFactory member and avoid some boilerplate code
1326         https://bugs.webkit.org/show_bug.cgi?id=186407
1327
1328         Reviewed by Brent Fulgham.
1329
1330         Add CanMakeWeakPtr base class to get WeakPtrFactory member and its getter, in
1331         order to avoid some boilerplate code in every class needing a WeakPtrFactory.
1332         This also gets rid of old-style createWeakPtr() methods in favor of the newer
1333         makeWeakPtr().
1334
1335         * NetworkProcess/NetworkLoadChecker.h:
1336         * NetworkProcess/NetworkProcess.cpp:
1337         (WebKit::NetworkProcess::canAuthenticateAgainstProtectionSpace):
1338         * NetworkProcess/PreconnectTask.h:
1339         * NetworkProcess/cache/CacheStorageEngine.h:
1340         * Shared/Authentication/AuthenticationManager.h:
1341         * UIProcess/API/APIAttachment.cpp:
1342         (API::Attachment::Attachment):
1343         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
1344         (WebKit::WebPaymentCoordinatorProxy::canMakePaymentsWithActiveCard):
1345         (WebKit::WebPaymentCoordinatorProxy::openPaymentSetup):
1346         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
1347         * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
1348         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
1349         * UIProcess/ApplicationStateTracker.h:
1350         * UIProcess/ApplicationStateTracker.mm:
1351         (WebKit::ApplicationStateTracker::ApplicationStateTracker):
1352         * UIProcess/Cocoa/ViewGestureController.cpp:
1353         (WebKit::ViewGestureController::setAlternateBackForwardListSourcePage):
1354         * UIProcess/Cocoa/WebViewImpl.h:
1355         * UIProcess/Cocoa/WebViewImpl.mm:
1356         (WebKit::WebViewImpl::updateWindowAndViewFrames):
1357         (WebKit::WebViewImpl::setTopContentInset):
1358         (WebKit::WebViewImpl::viewDidMoveToWindow):
1359         (WebKit::WebViewImpl::prepareForMoveToWindow):
1360         (WebKit::WebViewImpl::validateUserInterfaceItem):
1361         (WebKit::WebViewImpl::requestCandidatesForSelectionIfNeeded):
1362         (WebKit::WebViewImpl::interpretKeyEvent):
1363         (WebKit::WebViewImpl::firstRectForCharacterRange):
1364         (WebKit::WebViewImpl::performKeyEquivalent):
1365         (WebKit::WebViewImpl::keyUp):
1366         (WebKit::WebViewImpl::keyDown):
1367         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.cpp:
1368         (WebKit::WebCredentialsMessengerProxy::makeCredential):
1369         (WebKit::WebCredentialsMessengerProxy::getAssertion):
1370         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.h:
1371         * UIProcess/Downloads/DownloadProxy.cpp:
1372         (WebKit::DownloadProxy::setOriginatingPage):
1373         * UIProcess/Launcher/ProcessLauncher.h:
1374         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1375         (WebKit::ProcessLauncher::launchProcess):
1376         * UIProcess/ProcessAssertion.h:
1377         * UIProcess/WebPageProxy.h:
1378         * UIProcess/WebsiteData/WebsiteDataStore.h:
1379         * UIProcess/gtk/WaylandCompositor.cpp:
1380         (WebKit::WaylandCompositor::Surface::attachBuffer):
1381         * UIProcess/gtk/WaylandCompositor.h:
1382         * UIProcess/ios/ProcessAssertionIOS.mm:
1383         (WebKit::ProcessAssertion::ProcessAssertion):
1384         * UIProcess/mac/DisplayLink.cpp:
1385         (WebKit::DisplayLink::displayLinkCallback):
1386         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm:
1387         (WebKit::RemoteLayerTreeDisplayRefreshMonitor::RemoteLayerTreeDisplayRefreshMonitor):
1388         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
1389
1390 2018-06-07  Dan Bernstein  <mitz@apple.com>
1391
1392         Don’t install process-webcontent-entitlements.sh into the built XPC services.
1393
1394         * WebKit.xcodeproj/project.pbxproj:
1395
1396 2018-06-07  Andy Estes  <aestes@apple.com>
1397
1398         [iOS] Inform the client when PDFKit's extension process crashes
1399         https://bugs.webkit.org/show_bug.cgi?id=186418
1400         <rdar://problem/40175864>
1401
1402         Reviewed by Tim Horton.
1403
1404         * UIProcess/WebPageProxy.cpp:
1405         (WebKit::WebPageProxy::processDidTerminate):
1406         (WebKit::WebPageProxy::dispatchProcessDidTerminate):
1407
1408         Separated the dispatching of delegate methods from the rest of the web
1409         process-specific processDidTerminate logic.
1410
1411         * UIProcess/WebPageProxy.h:
1412         * UIProcess/ios/WKPDFView.mm:
1413         (-[WKPDFView web_setContentProviderData:suggestedFilename:]):
1414
1415         Minor style fix.
1416
1417         (-[WKPDFView pdfHostViewControllerExtensionProcessDidCrash:]):
1418
1419         Called WebPageProxy::dispatchProcessDidTerminate on the main thread.
1420
1421 2018-06-07  Andy Estes  <aestes@apple.com>
1422
1423         [iOS] Unable to present the share sheet after saving a PDF to Files.app
1424         https://bugs.webkit.org/show_bug.cgi?id=186413
1425         <rdar://problem/39937488>
1426
1427         Reviewed by Tim Horton.
1428
1429         WKApplicationStateTrackingView (WKPDFView's superclass) keeps track of whether
1430         it's in a window so that it can suspend and resume the web process accordingly.
1431         However, in WKPDFView's case, PDFKit's host view is in the window instead of
1432         WKPDFView itself when a PDF is being displayed (WKPDFView is only in a window as a
1433         placeholder while the PDF loads). Since WKApplicationStateTrackingView doesn't
1434         think its in a window, it suspends the web process, preventing messages necessary
1435         to displaying the share sheet from being delivered.
1436
1437         Fix this by teaching WKApplicationStateTrackingView to consider the in-windowness
1438         of the proper content view. For all cases other than WKPDFView, this is |self|.
1439         For WKPDFView, it is the PDFHostViewController's root view if it exists, otherwise
1440         it's |self|.
1441
1442         * UIProcess/ios/WKApplicationStateTrackingView.h:
1443         * UIProcess/ios/WKApplicationStateTrackingView.mm:
1444         (-[WKApplicationStateTrackingView willMoveToWindow:]):
1445         (-[WKApplicationStateTrackingView didMoveToWindow]):
1446         (-[WKApplicationStateTrackingView _contentView]):
1447         * UIProcess/ios/WKPDFView.mm:
1448         (-[WKPDFView _contentView]):
1449         (-[WKPDFView web_contentView]):
1450
1451 2018-06-07  Dean Jackson  <dino@apple.com>
1452
1453         Match HI spec for thumbnail view sizing and location
1454         https://bugs.webkit.org/show_bug.cgi?id=186412
1455         <rdar://problem/40226192>
1456
1457         Reviewed by Tim Horton.
1458
1459         Use the computed obscured inset to position the QuickLook
1460         view inside the WKSystemPreviewView.
1461
1462         * UIProcess/ios/WKSystemPreviewView.mm:
1463         (-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]):
1464         (-[WKSystemPreviewView _layoutThumbnailView]):
1465
1466 2018-06-07  Tadeu Zagallo  <tzagallo@apple.com>
1467
1468         Don't try to allocate JIT memory if we don't have the JIT entitlement
1469         https://bugs.webkit.org/show_bug.cgi?id=182605
1470         <rdar://problem/38271229>
1471
1472         Reviewed by Mark Lam.
1473
1474         Remove processHasEntitlement, which was moved into WTF and update all call sites.
1475
1476         * Shared/mac/SandboxUtilities.h:
1477         * Shared/mac/SandboxUtilities.mm:
1478         (WebKit::processHasEntitlement): Deleted.
1479         * UIProcess/API/Cocoa/WKWebView.mm:
1480         (-[WKWebView _initializeWithConfiguration:]):
1481         * UIProcess/ApplicationStateTracker.mm:
1482         (WebKit::applicationType):
1483         * UIProcess/ios/WKActionSheetAssistant.mm:
1484         (applicationHasAppLinkEntitlements):
1485
1486 2018-06-07  Tim Horton  <timothy_horton@apple.com>
1487
1488         REGRESSION (r232544): Pages are blank after homing out and then resuming on iPad
1489         https://bugs.webkit.org/show_bug.cgi?id=186408
1490         <rdar://problem/40907111>
1491
1492         Reviewed by Wenson Hsieh.
1493
1494         * UIProcess/API/Cocoa/WKWebView.mm:
1495         (-[WKWebView _resizeWhileHidingContentWithUpdates:]):
1496         Clients who use _resizeWhileHidingContentWithUpdates don't call
1497         _endAnimatedResize; the former API is a one-shot. We can't wait for
1498         _endAnimatedResize to complete the animation (and don't need to, since
1499         the content is hidden), but instead should just finish it when the
1500         commit with the resized tiles arrives.
1501
1502 2018-06-07  Jiewen Tan  <jiewen_tan@apple.com>
1503
1504         Use the same overloaded addInputString in WKContentViewInteraction
1505         https://bugs.webkit.org/show_bug.cgi?id=186376
1506         <rdar://problem/18498360>
1507
1508         Reviewed by Brent Fulgham.
1509
1510         Different overloaded variants of [UIKeyboardImpl -addInputString] behaves differently. We should use the same
1511         overloaded variant consistently: [UIKeyboardImpl -addInputString:withFlags:withInputManagerHint:].
1512
1513         Sadly, there is no test case for this change as:
1514         1) UIScriptController has troubles simulating '\r' keyboard event, and
1515         2) API test couldn't simulate proper UI keyboard events.
1516
1517         * UIProcess/ios/WKContentViewInteraction.mm:
1518         (-[WKContentView _interpretKeyEvent:isCharEvent:]):
1519
1520 2018-06-07  Alex Christensen  <achristensen@webkit.org>
1521
1522         REGRESSION(r224134) Client certificate challenges don't always appear
1523         https://bugs.webkit.org/show_bug.cgi?id=186402
1524         <rdar://problem/35967150>
1525
1526         Reviewed by Brian Weinstein.
1527
1528         * NetworkProcess/NetworkLoad.cpp:
1529         (WebKit::NetworkLoad::completeAuthenticationChallenge):
1530         Add an exception for all TLS-handshake-related challenges, not just server trust.
1531
1532 2018-06-07  Ryosuke Niwa  <rniwa@webkit.org>
1533
1534         Release assert in Document::updateLayout() in WebPage::determinePrimarySnapshottedPlugIn()
1535         https://bugs.webkit.org/show_bug.cgi?id=186383
1536         <rdar://problem/40849498>
1537
1538         Reviewed by Jon Lee.
1539
1540         The release assert was hit because the descendent elemenet iterator, which instantiates ScriptDisallowedScope,
1541         was alive as determinePrimarySnapshottedPlugIn invoked Document::updateLayout. Avoid this by copying
1542         the list of plugin image elements into a vector first.
1543
1544         * WebProcess/WebPage/WebPage.cpp:
1545         (WebKit::WebPage::determinePrimarySnapshottedPlugIn): Fixed the release assert, and deployed Ref and RefPtr
1546         to make this code safe.
1547
1548 2018-06-07  Don Olmstead  <don.olmstead@sony.com>
1549
1550         [CoordGraphics] Fix compilation errors around USE(COORDINATED_GRAPHICS)
1551         https://bugs.webkit.org/show_bug.cgi?id=186374
1552
1553         Reviewed by Žan Doberšek.
1554
1555         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1556         (WebKit::ThreadedCompositor::sceneUpdateFinished):
1557
1558 2018-06-07  Brent Fulgham  <bfulgham@apple.com>
1559
1560         Remove unused debug mode conditions
1561         https://bugs.webkit.org/show_bug.cgi?id=186358
1562         <rdar://problem/39117121>
1563
1564         Reviewed by Zalan Bujtas.
1565
1566         Remove some unused code paths related to ResourceLoadStatistics debug mode.
1567
1568         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1569         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
1570         (WebKit::WebResourceLoadStatisticsStore::shouldPartitionCookies const):
1571
1572 2018-06-07  Dan Bernstein  <mitz@apple.com>
1573
1574         REGRESSION (r232520): Crash under IPC::ArgumentCoder<WebCore::Credential>::encodePlatformData
1575         https://bugs.webkit.org/show_bug.cgi?id=186385
1576         <rdar://problem/40853796>
1577
1578         Reviewed by Daniel Bates.
1579
1580         * Shared/mac/WebCoreArgumentCodersMac.mm:
1581         (IPC::ArgumentCoder<Credential>::encodePlatformData): Fixed an incorrect cast.
1582
1583 2018-06-06  Per Arne Vollan  <pvollan@apple.com>
1584
1585         Crash in lambda function WTF::Function<void ()>::CallableWrapper<WebKit::DisplayLink::displayLinkCallback
1586         https://bugs.webkit.org/show_bug.cgi?id=186370
1587         <rdar://problem/39791647>
1588
1589         Reviewed by Brent Fulgham.
1590
1591         When the display link is firing, the callback function is called on the display link thread, where a lambda function
1592         is created to be executed on the main thread. The WebPageProxy object is captured as a RefPtr in the lambda. This
1593         might crash when executing on the main thread, since the WebPageProxy object is possibly deleted then. Capturing
1594         the WebPageProxy will not prevent the object from being deleted if the destruction of the WebPageProxy object already
1595         has started on the main thread when the object is captured, which sometimes is the case. Instead, we can create a
1596         weak pointer to the object, which will work as intended, even if the WebPageProxy object is in the process of being
1597         deleted. This also matches the display link implementation used when the WebContent process has access to the
1598         WindowServer. This is not a frequent crash. I have not been able to reproduce it.
1599  
1600         * UIProcess/mac/DisplayLink.cpp:
1601         (WebKit::DisplayLink::displayLinkCallback):
1602
1603 2018-06-06  Antoine Quint  <graouts@apple.com>
1604
1605         Rename color-filter to -apple-color-filter and do not expose it to Web content
1606         https://bugs.webkit.org/show_bug.cgi?id=186306
1607         <rdar://problem/39874167>
1608
1609         Reviewed by Simon Fraser.
1610
1611         Change the ColorFilter setting to no longer be exposed as an experimental feature and ensure it's turned off by default.
1612         To allow internal clients to use the -apple-color-filter property, we expose a new _colorFilterEnabled property as SPI
1613         to WKWebViewConfigurationPrivate.
1614
1615         * Shared/WebPreferences.yaml:
1616         * UIProcess/API/C/WKPreferences.cpp:
1617         (WKPreferencesSetColorFilterEnabled):
1618         (WKPreferencesGetColorFilterEnabled):
1619         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1620         * UIProcess/API/Cocoa/WKWebView.mm:
1621         (-[WKWebView _initializeWithConfiguration:]):
1622         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1623         (-[WKWebViewConfiguration init]):
1624         (-[WKWebViewConfiguration copyWithZone:]):
1625         (-[WKWebViewConfiguration _setAttachmentElementEnabled:]):
1626         (-[WKWebViewConfiguration _colorFilterEnabled]):
1627         (-[WKWebViewConfiguration _setColorFilterEnabled:]):
1628         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
1629
1630 2018-06-06  Jer Noble  <jer.noble@apple.com>
1631
1632         REGRESSION (r232301) - Unable to enter video fullscreen
1633         https://bugs.webkit.org/show_bug.cgi?id=186357
1634         <rdar://problem/40838449>
1635
1636         Reviewed by Jon Lee.
1637
1638         Only set up the standby fullscreen element if we are in element fullscreen.
1639
1640         * WebProcess/FullScreen/WebFullScreenManager.cpp:
1641         (WebKit::WebFullScreenManager::videoControlsManagerDidChange):
1642
1643 2018-06-06  Jeremy Jones  <jeremyj@apple.com>
1644
1645         attenuationFactor should be in range [0,1]
1646         https://bugs.webkit.org/show_bug.cgi?id=186320
1647         rdar://problem/40821456
1648
1649         Reviewed by Jer Noble.
1650
1651         If attenuationFactor is outside of this range it can cause false positives.
1652
1653         * UIProcess/ios/fullscreen/FullscreenTouchSecheuristic.cpp:
1654         (WebKit::FullscreenTouchSecheuristic::attenuationFactor):
1655
1656 2018-06-06  Tim Horton  <timothy_horton@apple.com>
1657
1658         Move animated resize into the layer tree transaction, and make it asynchronous
1659         https://bugs.webkit.org/show_bug.cgi?id=186130
1660         <rdar://problem/38477288>
1661
1662         Reviewed by Simon Fraser.
1663
1664         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
1665         (WebKit::RemoteLayerTreeTransaction::setScrollPosition):
1666         (WebKit::RemoteLayerTreeTransaction::dynamicViewportSizeUpdateID const):
1667         (WebKit::RemoteLayerTreeTransaction::setDynamicViewportSizeUpdateID):
1668         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
1669         (WebKit::RemoteLayerTreeTransaction::encode const):
1670         (WebKit::RemoteLayerTreeTransaction::decode):
1671         * WebProcess/WebPage/WebPage.cpp:
1672         (WebKit::WebPage::willCommitLayerTree):
1673         Add scrollPosition to the transaction on all platforms, not just Mac.
1674         Add the optional dynamicViewportSizeUpdateID to the transaction, representing
1675         the most recent dynamicViewportSizeUpdate that commit contains, if any.
1676
1677         * Shared/ios/DynamicViewportSizeUpdate.h:
1678         Added a typedef for DynamicViewportSizeUpdateID, and move the mode enum here.
1679
1680         * UIProcess/ios/PageClientImplIOS.h:
1681         * UIProcess/ios/PageClientImplIOS.mm:
1682         (WebKit::PageClientImpl::dynamicViewportUpdateChangedTarget): Deleted.
1683         * UIProcess/PageClient.h:
1684         * UIProcess/WebPageProxy.cpp:
1685         (WebKit::WebPageProxy::resetState):
1686         * UIProcess/WebPageProxy.h:
1687         * UIProcess/WebPageProxy.messages.in:
1688         * UIProcess/ios/WebPageProxyIOS.mm:
1689         (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
1690         (WebKit::WebPageProxy::didCommitLayerTree):
1691         (WebKit::WebPageProxy::synchronizeDynamicViewportUpdate): Deleted.
1692         (WebKit::WebPageProxy::dynamicViewportUpdateChangedTarget): Deleted.
1693         * WebProcess/WebPage/WebPage.h:
1694         * WebProcess/WebPage/WebPage.messages.in:
1695         * WebProcess/WebPage/ios/WebPageIOS.mm:
1696         (WebKit::WebPage::dynamicViewportSizeUpdate):
1697         (WebKit::WebPage::synchronizeDynamicViewportUpdate): Deleted.
1698         Remove dynamicViewportUpdateChangedTarget and synchronizeDynamicViewportUpdate.
1699         Move dynamicViewportSizeUpdateID maintenance into WKWebView.
1700
1701         * UIProcess/API/Cocoa/WKWebView.mm:
1702         (-[WKWebView _processDidExit]):
1703         Remove _resizeAnimationTransformTransactionID. We now instead pack
1704         the resize ID inside the transaction, instead of separately sending
1705         back a transaction ID to wait for.
1706
1707         (-[WKWebView _didCommitLayerTreeDuringAnimatedResize:]):
1708         (-[WKWebView _didCommitLayerTree:]):
1709         Added, factored out of _didCommitLayerTree:.
1710         If the transaction includes the result of the most recently-sent resize,
1711         store the requisite adjustments required to counter the new scale and
1712         scroll offset, update the resizeAnimationView, and, if endAnimatedResize
1713         has already been called, call _didCompleteAnimatedResize to tear down
1714         the animation view and put things back together.
1715
1716         Add some code so that if a commit arrives before the resize, we update
1717         the scale of the resize animation view to keep the width fitting.
1718
1719         (activeMaximumUnobscuredSize):
1720         (activeOrientation):
1721         Move these because the code that depends on them moved.
1722
1723         (-[WKWebView _didCompleteAnimatedResize]):
1724         Broken out of _endAnimatedResize. This can now be called from
1725         either endAnimatedResize or _didCommitLayerTreeDuringAnimatedResize,
1726         depending on which is called first.
1727
1728         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
1729         Don't create a new resize view if we still have one. Otherwise, we'll
1730         get the view ordering all wrong when making the second one. This
1731         didn't previously cause trouble, because we don't have a lot of
1732         WKScrollView subviews, but it totally could.
1733
1734         Adopt _initialContentOffsetForScrollView just to make this code more clear.
1735
1736         (-[WKWebView _endAnimatedResize]):
1737         (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:nextValidLayerTreeTransactionID:]): Deleted.
1738         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1739
1740
1741 2018-06-05  Per Arne Vollan  <pvollan@apple.com>
1742
1743         Move OpenGL display mask to screen data struct.
1744         https://bugs.webkit.org/show_bug.cgi?id=186198
1745         <rdar://problem/40724854>
1746
1747         Reviewed by Brent Fulgham.
1748
1749         Currently, the OpenGL display mask is a global in the WebContent process. This is not correct in all cases, since
1750         it is possible to have two Web views in the same WebContent process, displayed on different displays. This can be
1751         resolved by moving the OpenGL display mask to a new ScreenData struct, containing information specific to each
1752         display. The display ID of the host window is used to find the OpenGL display mask when needed. This patch makes
1753         the host window available when creating an IOSurface, in order to find the right OpenGL display mask. If no host
1754         window is available, the OpenGL display mask of the main display is used.
1755
1756         * Shared/WebPageCreationParameters.cpp:
1757         (WebKit::WebPageCreationParameters::encode const):
1758         (WebKit::WebPageCreationParameters::decode):
1759         * Shared/WebPageCreationParameters.h:
1760         * Shared/WebProcessCreationParameters.cpp:
1761         (WebKit::WebProcessCreationParameters::encode const):
1762         (WebKit::WebProcessCreationParameters::decode):
1763         * Shared/WebProcessCreationParameters.h:
1764         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1765         (WebKit::WebProcessPool::platformInitializeWebProcess):
1766         * UIProcess/WebPageProxy.cpp:
1767         (WebKit::WebPageProxy::windowScreenDidChange):
1768         (WebKit::WebPageProxy::creationParameters):
1769         * UIProcess/WebProcessPool.cpp:
1770         (WebKit::WebProcessPool::screenPropertiesStateChanged):
1771         (WebKit::displayReconfigurationCallBack):
1772         * WebProcess/WebPage/WebPage.cpp:
1773         (WebKit::m_credentialsMessenger):
1774         * WebProcess/WebPage/WebPage.h:
1775         * WebProcess/WebPage/WebPage.messages.in:
1776         * WebProcess/WebPage/mac/WebPageMac.mm:
1777         (WebKit::WebPage::openGLDisplayMaskChanged): Deleted.
1778         * WebProcess/WebProcess.cpp:
1779         (WebKit::WebProcess::setScreenProperties):
1780         * WebProcess/WebProcess.h:
1781         * WebProcess/WebProcess.messages.in:
1782         * WebProcess/cocoa/WebProcessCocoa.mm:
1783         (WebKit::WebProcess::platformInitializeWebProcess):
1784
1785 2018-06-05  Keith Rollin  <krollin@apple.com>
1786
1787         Remove tracksResourceLoadMilestones support
1788         https://bugs.webkit.org/show_bug.cgi?id=186329
1789         <rdar://problem/40829898>
1790
1791         Reviewed by Darin Adler.
1792
1793         Remove the mechanism for enabling/disabling the tracking of
1794         resource-load milestones. This was initially added in order to enable
1795         the tracking only for Safari. However, the decision has been made to
1796         enable the tracking for all WebKit clients, so it's now enabled
1797         unconditionally.
1798
1799         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1800         (WebKit::NetworkConnectionToWebProcess::startTrackingResourceLoad):
1801         (WebKit::NetworkConnectionToWebProcess::stopTrackingResourceLoad):
1802         (WebKit::NetworkConnectionToWebProcess::stopAllNetworkActivityTracking):
1803         (WebKit::NetworkConnectionToWebProcess::stopAllNetworkActivityTrackingForPage):
1804         (WebKit::networkActivityTrackingEnabled): Deleted.
1805         * NetworkProcess/NetworkProcess.cpp:
1806         (WebKit::NetworkProcess::initializeNetworkProcess):
1807         * NetworkProcess/NetworkProcess.h:
1808         (WebKit::NetworkProcess::tracksResourceLoadMilestones const): Deleted.
1809         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1810         (WebKit::NetworkProcessCreationParameters::encode const):
1811         (WebKit::NetworkProcessCreationParameters::decode):
1812         * NetworkProcess/NetworkProcessCreationParameters.h:
1813         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1814         (API::ProcessPoolConfiguration::copy):
1815         * UIProcess/API/APIProcessPoolConfiguration.h:
1816         * UIProcess/API/C/WKContextConfigurationRef.cpp:
1817         (WKContextConfigurationTracksResourceLoadMilestones): Deleted.
1818         (WKContextConfigurationSetTracksResourceLoadMilestones): Deleted.
1819         * UIProcess/API/C/WKContextConfigurationRef.h:
1820         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
1821         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
1822         (-[_WKProcessPoolConfiguration tracksResourceLoadMilestones]): Deleted.
1823         (-[_WKProcessPoolConfiguration setTracksResourceLoadMilestones:]): Deleted.
1824         * UIProcess/WebProcessPool.cpp:
1825         (WebKit::WebProcessPool::ensureNetworkProcess):
1826
1827 2018-06-05  Darin Adler  <darin@apple.com>
1828
1829         [Cocoa] Retire DispatchPtr, and add more move semantics and simpler #ifs to other smart pointers
1830         https://bugs.webkit.org/show_bug.cgi?id=186324
1831
1832         Reviewed by Anders Carlsson.
1833
1834         * NetworkProcess/cache/NetworkCacheData.h: Use OSObjectPtr instead of
1835         DispatchPtr and also use an rvalue reference in the constructor.
1836         * NetworkProcess/cache/NetworkCacheDataCocoa.mm:
1837         (WebKit::NetworkCache::Data::Data): Use adoptOSObject, rvalue reference
1838         and WTFMove.
1839         (WebKit::NetworkCache::Data::empty): Use OSObjectPtr.
1840         (WebKit::NetworkCache::Data::data const): Use adoptOSObject.
1841         (WebKit::NetworkCache::Data::subrange const): Ditto.
1842         (WebKit::NetworkCache::concatenate): Ditto.
1843         (WebKit::NetworkCache::Data::adoptMap): Ditto. Also use WTFMove.
1844
1845         * NetworkProcess/cache/NetworkCacheIOChannel.h: Use OSObjectPtr.
1846         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
1847         (WebKit::NetworkCache::IOChannel::IOChannel): Use adoptOSObject.
1848         (WebKit::NetworkCache::IOChannel::read): Use OSObjectPtr.
1849
1850 2018-06-05  Brent Fulgham  <bfulgham@apple.com>
1851
1852         Adjust compile and runtime flags to match shippable state of features
1853         https://bugs.webkit.org/show_bug.cgi?id=186319
1854         <rdar://problem/40352045>
1855
1856         Reviewed by Maciej Stachowiak, Jon Lee, and others.
1857
1858         Change the default state of various experimental features so that they are off by default in production
1859         builds, since they are still under development.
1860
1861         Turn 'CacheAPIEnabled' and 'SubresourceIntegrityEnabled' on by default, since both features have been
1862         shipping for a full cycle and have proven to be stable in production.
1863
1864         * Configurations/FeatureDefines.xcconfig: Don't build ENABLE_INPUT_TYPE_COLOR
1865         or ENABLE_INPUT_TYPE_COLOR_POPOVER.
1866         * Shared/WebPreferences.yaml: 
1867 2018-06-05  Timothy Hatcher  <timothy@apple.com>
1868
1869         Clean up LocalDefaultSystemAppearance and prefers-dark-interface media query
1870
1871         https://bugs.webkit.org/show_bug.cgi?id=186323
1872         rdar://problem/38382252
1873
1874         Reviewed by Tim Horton.
1875
1876         * UIProcess/API/Cocoa/WKWebView.mm:
1877         (-[WKWebView _defaultAppearance]):
1878         * UIProcess/API/mac/WKView.mm:
1879         (-[WKView _defaultAppearance]):
1880         * UIProcess/Cocoa/WebViewImpl.h:
1881         * UIProcess/Cocoa/WebViewImpl.mm:
1882         (WebKit::WebViewImpl::useDefaultAppearance):
1883
1884 2018-06-05  Sihui Liu  <sihui_liu@apple.com>
1885
1886         [iOS] TestWebKitAPI.WebKit.WKHTTPCookieStoreWithoutProcessPool fails because cookies aren't flushed to file
1887         https://bugs.webkit.org/show_bug.cgi?id=186303
1888         <rdar://problem/40468716>
1889
1890         Reviewed by Geoffrey Garen.
1891
1892         No matter there is an observer or not, cookies in UI process should always be flushed to 
1893         file when new process pool is created, such that cookies created via API can be synced to
1894         network process.
1895
1896         * UIProcess/API/APIHTTPCookieStore.cpp:
1897         (API::HTTPCookieStore::HTTPCookieStore):
1898         (API::HTTPCookieStore::registerObserver):
1899         (API::HTTPCookieStore::cookieManagerDestroyed):
1900         (API::HTTPCookieStore::registerForNewProcessPoolNotifications):
1901
1902 2018-06-05  Jeremy Jones  <jeremyj@apple.com>
1903
1904         secheuristic should only use touch began and ended, not changed.
1905         https://bugs.webkit.org/show_bug.cgi?id=186318
1906         rdar://problem/39781486
1907
1908         Reviewed by Jer Noble.
1909
1910         Filter out change events so swiping gestures don't trigger the heuristic.
1911
1912         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
1913         (-[WKFullScreenViewController _touchDetected:]):
1914
1915 2018-06-05  Darin Adler  <darin@apple.com>
1916
1917         [Cocoa] More preparation for ARC, focusing on WebKit and smart pointers
1918         https://bugs.webkit.org/show_bug.cgi?id=186314
1919
1920         Reviewed by Anders Carlsson.
1921
1922         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1923         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): Use __bridge for cast.
1924         * NetworkProcess/mac/NetworkProcessMac.mm:
1925         (WebKit::overrideSystemProxies): Ditto.
1926         (WebKit::NetworkProcess::allowSpecificHTTPSCertificateForHost): Ditto.
1927         * Platform/IPC/mac/ConnectionMac.mm:
1928         (IPC::Connection::sendMessage): Ditto.
1929         (IPC::readFromMachPort): Ditto.
1930
1931         * Platform/mac/StringUtilities.mm:
1932         (WebKit::formattedPhoneNumberString): Use __bridge for cast and
1933         CFBridgingRelease instead of an explicit autorelease.
1934
1935         * Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
1936         (initializeMethods): Use auto instead of an explicit type so that we get
1937         the correct type for the result of protocol_copyProtocolList.
1938
1939         * Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
1940         (-[_WKRemoteObjectRegistry _sendInvocation:interface:]): Added a
1941         bridging cast to void* because that's needed to call _Block_signature
1942         under ARC and harmless outside ARC.
1943
1944         * Shared/API/c/cf/WKStringCF.mm:
1945         (WKStringCreateWithCFString): Use __bridge for cast.
1946         * Shared/API/c/cf/WKURLCF.mm:
1947         (WKURLCreateWithCFURL): Ditto.
1948         * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
1949         (WebKit::AuthenticationManager::initializeConnection): Ditto.
1950         * Shared/Cocoa/DataDetectionResult.mm:
1951         (WebKit::DataDetectionResult::encode const): Ditto.
1952         (WebKit::DataDetectionResult::decode): Ditto.
1953         * Shared/Cocoa/WKNSError.mm:
1954         (-[WKNSError _web_createTarget]): Ditto.
1955         * Shared/Cocoa/WKNSURLExtras.mm:
1956         (-[NSURL _web_originalDataAsWTFString]): Ditto.
1957
1958         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
1959         (WebKit::XPCServiceInitializer): Removed balanced calls to both
1960         adoptOSObject and xpc_retain and instead rely on the assignment
1961         operator just added to OSObjectPtr.
1962
1963         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
1964         (WebKit::XPCServiceEventHandler): Use __bridge for cast.
1965         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
1966         (WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer): Ditto.
1967         * Shared/cf/ArgumentCodersCF.cpp:
1968         (IPC::decode): Ditto.
1969         * Shared/mac/ArgumentCodersMac.mm:
1970         (IPC::isSerializableValue): Ditto.
1971         (IPC::encode): Ditto.
1972         * Shared/mac/WebCoreArgumentCodersMac.mm:
1973         (IPC::encodeNSError): Ditto. Also use CFSTR("")" instead of @""
1974         when we need a CFString.
1975         (IPC::decodeNSError): Ditto.
1976         (IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData): Ditto.
1977         (IPC::ArgumentCoder<ProtectionSpace>::decodePlatformData): Ditto.
1978         (IPC::ArgumentCoder<Credential>::encodePlatformData): Ditto.
1979         (IPC::ArgumentCoder<Credential>::decodePlatformData): Ditto.
1980         (IPC::ArgumentCoder<ContentFilterUnblockHandler>::encode): Ditto.
1981         (IPC::ArgumentCoder<ContentFilterUnblockHandler>::decode): Ditto.
1982         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::encodePlatformData): Ditto.
1983         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::decodePlatformData): Ditto.
1984         * Shared/mac/WebHitTestResultData.mm:
1985         (WebKit::WebHitTestResultData::platformEncode const): Ditto.
1986         (WebKit::WebHitTestResultData::platformDecode): Ditto.
1987         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
1988         (WKContextIsPlugInUpdateAvailable): Ditto.
1989         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
1990         (-[WKBrowsingContextController certificateChain]): Ditto.
1991         (didStartProvisionalLoadForFrame): Ditto.
1992         (didReceiveServerRedirectForProvisionalLoadForFrame): Ditto.
1993         (didFailProvisionalLoadWithErrorForFrame): Ditto.
1994         (didCommitLoadForFrame): Ditto.
1995         (didFinishLoadForFrame): Ditto.
1996         (didFailLoadWithErrorForFrame): Ditto.
1997         (canAuthenticateAgainstProtectionSpaceInFrame): Ditto.
1998         (didReceiveAuthenticationChallengeInFrame): Ditto.
1999         (didStartProgress): Ditto.
2000         (didChangeProgress): Ditto.
2001         (didFinishProgress): Ditto.
2002         (didChangeBackForwardList): Ditto.
2003         (processDidCrash): Ditto.
2004         (setUpPageLoaderClient): Ditto.
2005         (setUpPagePolicyClient): Ditto.
2006         * UIProcess/API/Cocoa/WKBrowsingContextGroup.mm:
2007         (createWKArray): Ditto.
2008         (-[WKBrowsingContextGroup addUserStyleSheet:baseURL:whitelistedURLPatterns:blacklistedURLPatterns:mainFrameOnly:]): Ditto.
2009         (-[WKBrowsingContextGroup addUserScript:baseURL:whitelistedURLPatterns:blacklistedURLPatterns:injectionTime:mainFrameOnly:]): Ditto.
2010         * UIProcess/API/Cocoa/WKConnection.mm:
2011         (didReceiveMessage): Ditto.
2012         (didClose): Ditto.
2013         (setUpClient): Ditto.
2014         * UIProcess/API/Cocoa/WKProcessGroup.mm:
2015         (didCreateConnection): Ditto.
2016         (getInjectedBundleInitializationUserData): Ditto.
2017         (setUpInjectedBundleClient): Ditto.
2018         (-[WKProcessGroup _setAllowsSpecificHTTPSCertificate:forHost:]): Ditto.
2019         * UIProcess/API/Cocoa/WKProcessPool.mm:
2020         (-[WKProcessPool _setAllowsSpecificHTTPSCertificate:forHost:]): Ditto.
2021         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2022         (-[WKWebsiteDataStore _setProxyConfiguration:]): Ditto.
2023         (-[WKWebsiteDataStore _proxyConfiguration]): Ditto.
2024         * UIProcess/API/Cocoa/_WKThumbnailView.mm:
2025         (-[_WKThumbnailView _didTakeSnapshot:]): Ditto.
2026
2027         * UIProcess/API/Cocoa/_WKUserContentFilter.mm: Added a missing include.
2028
2029         * UIProcess/Authentication/mac/WebCredentialMac.mm:
2030         (WebKit::chain): Use __bridge for cast.
2031
2032         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2033         (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
2034         Use CFBridgingRelease instead of adoptNS.
2035         (WebKit::privateBrowsingSession): Use __bridge for cast.
2036
2037         * UIProcess/Cocoa/WebViewImpl.mm:
2038         (WebKit::WebViewImpl::provideDataForPasteboard): Use __bridge for cast.
2039         * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
2040         (WebKit::PluginInfoStore::pluginPathsInDirectory): Ditto.
2041         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
2042         (WebKit::recursivelyMapIOSurfaceBackingStore): Ditto.
2043         * UIProcess/mac/ViewGestureControllerMac.mm:
2044         (WebKit::ViewGestureController::beginSwipeGesture): Ditto.
2045         * UIProcess/mac/WKFullScreenWindowController.mm:
2046         (-[WKFullScreenWindowController enterFullScreen:]): Ditto.
2047         * UIProcess/mac/WebPopupMenuProxyMac.mm:
2048         (WebKit::WebPopupMenuProxyMac::showPopupMenu): Ditto.
2049         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm:
2050         (didCreatePage): Ditto.
2051         (willDestroyPage): Ditto.
2052         (setUpBundleClient): Ditto.
2053         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2054         (didStartProvisionalLoadForFrame): Ditto.
2055         (didReceiveServerRedirectForProvisionalLoadForFrame): Ditto.
2056         (didFinishLoadForFrame): Ditto.
2057         (globalObjectIsAvailableForFrame): Ditto.
2058         (didRemoveFrameFromHierarchy): Ditto.
2059         (didCommitLoadForFrame): Ditto.
2060         (didFinishDocumentLoadForFrame): Ditto.
2061         (didFailProvisionalLoadWithErrorForFrame): Ditto.
2062         (didFailLoadWithErrorForFrame): Ditto.
2063         (didSameDocumentNavigationForFrame): Ditto.
2064         (didLayoutForFrame): Ditto.
2065         (didReachLayoutMilestone): Ditto.
2066         (didFirstVisuallyNonEmptyLayoutForFrame): Ditto.
2067         (didHandleOnloadEventsForFrame): Ditto.
2068         (userAgentForURL): Ditto.
2069         (setUpPageLoaderClient): Ditto.
2070         (willSendRequestForFrame): Ditto.
2071         (didInitiateLoadForResource): Ditto.
2072         (didFinishLoadForResource): Ditto.
2073         (didFailLoadForResource): Ditto.
2074         (setUpResourceLoadClient): Ditto.
2075         * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
2076         (WebKit::InjectedBundle::initialize): Ditto.
2077         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
2078         (WebKit::NetscapePlugin::popUpContextMenu): Ditto.
2079
2080         * WebProcess/Plugins/PDF/PDFPlugin.h: Put functions that return NSData inside
2081         an #ifdef __OBJC__ and use __bridge for cast.
2082
2083         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
2084         (WebKit::WebDragClient::declareAndWriteDragImage): Use __bridge for cast.
2085
2086         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm:
2087         (WebKit::PlatformCALayerRemoteCustom::contents const): Added a bridging cast.
2088         (WebKit::PlatformCALayerRemoteCustom::setContents): Use __bridge for cast.
2089         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2090         (WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom): Ditto.
2091         * WebProcess/WebPage/mac/WebPageMac.mm:
2092         (WebKit::WebPage::setTopOverhangImage): Ditto.
2093         (WebKit::WebPage::setBottomOverhangImage): Ditto.
2094
2095 2018-06-05  Youenn Fablet  <youenn@apple.com>
2096
2097         ServiceWorker registration should store any script fetched through importScripts
2098         https://bugs.webkit.org/show_bug.cgi?id=182444
2099         <rdar://problem/37164835>
2100
2101         Reviewed by Chris Dumez.
2102
2103         Add C API to kill storage process.
2104         In case a Storage Process is closed or crashed, ensure that all its related service worker processes also exit.
2105
2106         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
2107         * UIProcess/API/C/WKContext.cpp:
2108         (WKContextTerminateStorageProcess):
2109         * UIProcess/API/C/WKContextPrivate.h:
2110         * WebProcess/WebProcess.cpp:
2111         (WebKit::WebProcess::webToStorageProcessConnectionClosed):
2112         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2113         (WebKit::WebSWContextManagerConnection::setScriptResource):
2114         * WebProcess/Storage/WebSWContextManagerConnection.h:
2115
2116 2018-06-05  Brent Fulgham  <bfulgham@apple.com>
2117
2118         Revise DEFAULT_EXPERIMENTAL_FEATURES_ENABLED to work properly on Apple builds
2119         https://bugs.webkit.org/show_bug.cgi?id=186286
2120         <rdar://problem/40782992>
2121
2122         Reviewed by Dan Bernstein.
2123
2124         Use the WK_RELOCATABLE_FRAMEWORKS flag (which is always defined for non-production builds)
2125         to define ENABLE(EXPERIMENTAL_FEATURES) so that we do not need to manually
2126         change this flag when preparing for a production release.
2127
2128         * Configurations/FeatureDefines.xcconfig: Use WK_RELOCATABLE_FRAMEWORKS to determine whether
2129         experimental features should be enabled, and use it to properly define the feature flag.
2130         * Shared/WebPreferencesDefaultValues.h:
2131
2132 2018-06-04  Chris Dumez  <cdumez@apple.com>
2133
2134         Rename "Cross-Origin-Options" HTTP header to "Cross-Origin-Window-Policy"
2135         https://bugs.webkit.org/show_bug.cgi?id=186287
2136         <rdar://problem/40783352>
2137
2138         Reviewed by Youenn Fablet.
2139
2140         * Shared/WebPreferences.yaml:
2141         * WebProcess/WebPage/WebPage.cpp:
2142         (WebKit::WebPage::frameBecameRemote):
2143
2144 2018-06-04  Dan Bernstein  <mitz@apple.com>
2145
2146         Restored code signing behavior when WK_USE_RESTRICTED_ENTITLEMENTS isn’t set.
2147
2148         * Configurations/DebugRelease.xcconfig: Use ad-hoc code signing when
2149           WK_USE_RESTRICTED_ENTITLEMENTS isn’t set.
2150
2151 2018-06-04  Dan Bernstein  <mitz@apple.com>
2152
2153         Removed a reference to a file that was deleted in r231190.
2154
2155         * WebKit.xcodeproj/project.pbxproj: Removed the reference to WebProcessShim.xcconfig.
2156
2157 2018-06-04  Chris Dumez  <cdumez@apple.com>
2158
2159         Update Fetch code to provide more useful exception messages
2160         https://bugs.webkit.org/show_bug.cgi?id=186156
2161
2162         Reviewed by Youenn Fablet.
2163
2164         Provide more useful error messages in our Loading / Fetch code.
2165
2166         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2167         (WebKit::WebSWServerConnection::didFailFetch):
2168         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2169         * StorageProcess/StorageProcess.cpp:
2170         (WebKit::StorageProcess::didFailFetch):
2171         * StorageProcess/StorageProcess.h:
2172         * StorageProcess/StorageProcess.messages.in:
2173         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
2174         (WebKit::ServiceWorkerClientFetch::didFail):
2175         (WebKit::ServiceWorkerClientFetch::continueLoadingAfterCheckingResponse):
2176         * WebProcess/Storage/ServiceWorkerClientFetch.h:
2177         * WebProcess/Storage/ServiceWorkerClientFetch.messages.in:
2178         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
2179         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveFormDataAndFinish):
2180         (WebKit::WebServiceWorkerFetchTaskClient::didFail):
2181         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:
2182
2183 2018-06-04  Wenson Hsieh  <wenson_hsieh@apple.com>
2184
2185         [WebKit on watchOS] Remove all uses of the EXTRA_ZOOM_MODE compiler flag
2186         https://bugs.webkit.org/show_bug.cgi?id=186279
2187
2188         Reviewed by Tim Horton.
2189
2190         Replaces uses of ENABLE(EXTRA_ZOOM_MODE) with PLATFORM(WATCHOS).
2191
2192         * Shared/WebPreferencesDefaultValues.h:
2193         * UIProcess/API/Cocoa/WKWebView.mm:
2194         (-[WKWebView _initializeWithConfiguration:]):
2195         (-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):
2196         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2197         (-[WKWebViewConfiguration init]):
2198         * UIProcess/WebProcessProxy.cpp:
2199         * UIProcess/WebProcessProxy.h:
2200         * UIProcess/ios/WKContentViewInteraction.h:
2201         * UIProcess/ios/WKContentViewInteraction.mm:
2202         (-[WKContentView _willStartScrollingOrZooming]):
2203         (-[WKContentView _didEndScrollingOrZooming]):
2204         (-[WKContentView _startAssistingKeyboard]):
2205         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
2206         (-[WKContentView _stopAssistingNode]):
2207         (-[WKContentView reloadContextViewForPresentedListViewController]):
2208         (-[WKContentView _wheelChangedWithEvent:]):
2209         (-[WKContentView _simulateTextEntered:]):
2210         (-[WKContentView selectFormAccessoryPickerRow:]):
2211         (-[WKContentView formInputLabel]):
2212         (-[WKContentView setTimePickerValueToHour:minute:]):
2213         * UIProcess/ios/WKScrollView.mm:
2214         (-[WKScrollView initWithFrame:]):
2215         (-[WKScrollView addGestureRecognizer:]):
2216         * UIProcess/ios/forms/WKFileUploadPanel.mm:
2217         (-[WKFileUploadPanel platformSupportsPickerViewController]):
2218         * WebProcess/WebPage/ios/WebPageIOS.mm:
2219         (WebKit::WebPage::platformPrefersTextLegibilityBasedZoomScaling const):
2220
2221 2018-06-04  Jeremy Jones  <jeremyj@apple.com>
2222
2223         Disable keyboard in fullscreen ios.
2224         https://bugs.webkit.org/show_bug.cgi?id=186058
2225
2226         Reviewed by Jer Noble.
2227
2228         Disallow keyboard in ios fullscreen. This will still allow select keys useful for playback.
2229
2230         * UIProcess/WebFullScreenManagerProxy.cpp:
2231         (WebKit::WebFullScreenManagerProxy::supportsFullScreen):
2232
2233 2018-06-04  Youenn Fablet  <youenn@apple.com>
2234
2235         NetworkCORSPreflightChecker should set the preflight request User-Agent header
2236         https://bugs.webkit.org/show_bug.cgi?id=186254
2237         <rdar://problem/40293504>
2238
2239         Reviewed by Chris Dumez.
2240
2241         Some servers misbehave if the User-Agent header is not set properly on preflight requests.
2242         Set it to the same value as the request triggering the preflight.
2243
2244         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
2245         (WebKit::NetworkCORSPreflightChecker::startPreflight):
2246         * NetworkProcess/NetworkCORSPreflightChecker.h:
2247         * NetworkProcess/NetworkLoadChecker.cpp:
2248         (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
2249
2250 2018-06-03  Andy Estes  <aestes@apple.com>
2251
2252         [Wi-Fi Assertions] Resume assertions when NetworkProcess::cancelPrepareToSuspend is called
2253         https://bugs.webkit.org/show_bug.cgi?id=186247
2254
2255         Reviewed by Tim Horton.
2256
2257         Since we suspended assertions in prepareToSuspend, we need to resume them if
2258         cancelPrepareToSuspend is called.
2259
2260         * NetworkProcess/NetworkProcess.cpp:
2261         (WebKit::NetworkProcess::cancelPrepareToSuspend):
2262
2263 2018-06-03  Andy Estes  <aestes@apple.com>
2264
2265         [iOS] Add a needed networking process entitlement
2266         https://bugs.webkit.org/show_bug.cgi?id=186246
2267         <rdar://problem/39578861>
2268
2269         Reviewed by Brent Fulgham.
2270
2271         Also sorted the existing entitlements.
2272
2273         * Configurations/Network-iOS.entitlements:
2274
2275 2018-06-03  Brent Fulgham  <bfulgham@apple.com>
2276
2277         Make sure that the fencePort received over IPC has the expected disposition (SEND)
2278         https://bugs.webkit.org/show_bug.cgi?id=186211
2279         <rdar://problem/37814171>
2280
2281         Reviewed by Geoffrey Garen.
2282
2283         It is possible (though very unlikely) for a message to be recevied that has the wrong mach port disposition.
2284         If this happens, we shouldn't manipulate the passed mach_port_t or pass it on to other API. We already
2285         drop messages that violate this expectation in the IPC layer, but code handling IPC::Attachment data types
2286         are not checking this value.
2287
2288         * WebProcess/WebPage/WebPage.cpp:
2289         (WebKit::WebPage::setTopContentInsetFenced):
2290         * WebProcess/cocoa/VideoFullscreenManager.mm:
2291         (WebKit::VideoFullscreenManager::setVideoLayerFrameFenced):
2292
2293 2018-06-02  Chris Dumez  <cdumez@apple.com>
2294
2295         Unreviewed, rolling out r232275.
2296
2297         May have caused a ~1% PLT regression on iOS
2298
2299         Reverted changeset:
2300
2301         "Store 0-lifetime stylesheets / scripts into the disk cache
2302         for faster history navigations"
2303         https://bugs.webkit.org/show_bug.cgi?id=186060
2304         https://trac.webkit.org/changeset/232275
2305
2306 2018-06-02  Jeremy Jones  <jeremyj@apple.com>
2307
2308         Make WKWebView firstResponder after entering or exiting fullscreen.
2309         https://bugs.webkit.org/show_bug.cgi?id=186088
2310         rdar://problem/40387859
2311
2312         Reviewed by Jer Noble.
2313
2314         Update first responder when WKWebView moves to a new window, otherwise there won't be a first responder.
2315
2316         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
2317         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
2318         (-[WKFullScreenWindowController _completedExitFullScreen]):
2319
2320 2018-06-02  Jeremy Jones  <jeremyj@apple.com>
2321
2322         Exit fullscreen when javascript alerts are presented.
2323         https://bugs.webkit.org/show_bug.cgi?id=185619
2324         rdar://problem/35724264
2325
2326         Reviewed by Jer Noble.
2327
2328         Prevent users from being trapped in fullscreen by alert cycles.
2329         Prevent fullscreen from becoming unresponsive due to alerts hidden behind fullscreen.
2330
2331         Fullscreen exit is initiated here in the UI process so that fullscreen UI is torn down immediately,
2332         before the alert is shown.
2333
2334         * UIProcess/WebPageProxy.cpp:
2335         (WebKit::WebPageProxy::exitFullscreenImmediately):
2336         (WebKit::WebPageProxy::runJavaScriptAlert):
2337         (WebKit::WebPageProxy::runJavaScriptConfirm):
2338         (WebKit::WebPageProxy::runJavaScriptPrompt):
2339         * UIProcess/WebPageProxy.h:
2340
2341 2018-06-02  Youenn Fablet  <youenn@apple.com>
2342
2343         Add a sandbox profile for com.cisco.webex.plugin.gpc64 plugin
2344         https://bugs.webkit.org/show_bug.cgi?id=186110
2345
2346         Reviewed by Brent Fulgham.
2347
2348         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: Webex needs to create some symlinks.
2349         * Resources/PlugInSandboxProfiles/com.cisco.webex.plugin.gpc64.sb: Added.
2350         * WebKit.xcodeproj/project.pbxproj:
2351
2352 2018-06-01  Wenson Hsieh  <wenson_hsieh@apple.com>
2353
2354         [Extra zoom mode] The user should always be able to double tap to zoom to a scale of at least 1
2355         https://bugs.webkit.org/show_bug.cgi?id=186209
2356         <rdar://problem/40529255>
2357
2358         Reviewed by Tim Horton.
2359
2360         Tweaks the way double-tap-to-zoom scales are determined in extra zoom mode. Rather than zooming to make the 50th
2361         and 90th percentiles of text in the document legible, only consider the 90th percentile of text size when
2362         determining zoom scale, and fix the other potential zoom scale at 1; additionally, if the zoom scales are close
2363         (within 0.3 of each other), snap the lower zoom scale to the higher value.
2364
2365         This results in the following changes in behavior:
2366         -   Enables double tap to zoom in cases where all the text in the page is already legible.
2367         -   On pages with mobile viewports, usually allows the user to toggle between initial scale and a scale of 1.
2368         -   If a significant portion of text is unusually small, the zoomed-in scale may exceed 1.
2369
2370         Test: fast/events/extrazoom/double-tap-to-zoom-with-large-text.html
2371
2372         * WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
2373         (WebKit::ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture):
2374         (WebKit::ViewGestureGeometryCollector::computeTextLegibilityScales):
2375
2376 2018-06-01  Jeremy Jones  <jeremyj@apple.com>
2377
2378         Keyboard focus should exit fullscreen.
2379         https://bugs.webkit.org/show_bug.cgi?id=185617
2380         rdar://problem/34697938
2381
2382         Reviewed by Ryosuke Niwa.
2383
2384         While in element fullscreen, initiating keyboard focus should exit fullscreen in iOS.
2385
2386         * WebProcess/WebPage/WebPage.cpp:
2387         (WebKit::WebPage::elementDidFocus):
2388
2389 2018-06-01  Chris Dumez  <cdumez@apple.com>
2390
2391         Regression(r230567): Unable to log into twitter.com in private sessions
2392         https://bugs.webkit.org/show_bug.cgi?id=186205
2393         <rdar://problem/40670799>
2394
2395         Reviewed by Youenn Fablet.
2396
2397         We were using the same SWServer for all private sessions and the SWServer's sessionID would
2398         be legacyPrivateSessionID(). As a result, the service worker's sessionID would be legacyPrivateSessionID()
2399         as well and would not match the sessionID of its client pages. This sessionID mismatch was 
2400         causing the breakage.
2401
2402         Instead of using the same SWServer of all private sessions, we now go back to using a SWServer
2403         per private session. However, we now make sure that the SWServer gets destroyed whenever its
2404         corresponding session gets destroyed.
2405
2406         * NetworkProcess/NetworkProcess.cpp:
2407         (WebKit::NetworkProcess::destroySession):
2408         * NetworkProcess/cache/CacheStorageEngine.cpp:
2409         (WebKit::CacheStorage::Engine::from):
2410         * StorageProcess/StorageProcess.cpp:
2411         (WebKit::StorageProcess::destroySession):
2412         (WebKit::StorageProcess::swServerForSession):
2413         * StorageProcess/StorageProcess.h:
2414         * StorageProcess/StorageProcess.messages.in:
2415         * UIProcess/WebProcessPool.cpp:
2416         (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
2417         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2418         (WebKit::WebsiteDataStore::~WebsiteDataStore):
2419
2420         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
2421         * UIProcess/WebsiteData/WebsiteDataStore.h:
2422         (WebKit::WebsiteDataStore::weakPtrFactory const):
2423         Fix memory leak caused by a reference cycle between the WebsiteDataStore and its
2424         WebResourceLoadStatisticsStore, by using WeakPtr to break the cycle. This was causing
2425         us to leak WebsiteDataStore objects, which would prevent the destruction of sessions.
2426
2427
2428 2018-06-01  Youenn Fablet  <youenn@apple.com>
2429
2430         Add an option to restrict communication to localhost sockets
2431         https://bugs.webkit.org/show_bug.cgi?id=186208
2432
2433         Reviewed by Eric Carlson.
2434
2435         Implement restriction to localhost sockets by setting any IP address to 127.0.0.1.
2436         This is done on WebProcess side just before requesting to open the socket by NetworkProcess.
2437
2438         * WebProcess/Network/webrtc/LibWebRTCNetwork.h:
2439         (WebKit::LibWebRTCNetwork::disableNonLocalhostConnections):
2440         * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
2441         (WebKit::LibWebRTCProvider::disableNonLocalhostConnections):
2442         (WebKit::LibWebRTCProvider::registerMDNSName):
2443         * WebProcess/Network/webrtc/LibWebRTCProvider.h:
2444         * WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp:
2445         (WebKit::prepareSocketAddress):
2446         (WebKit::LibWebRTCSocketFactory::CreateServerTcpSocket):
2447         (WebKit::LibWebRTCSocketFactory::CreateUdpSocket):
2448         (WebKit::LibWebRTCSocketFactory::CreateClientTcpSocket):
2449         * WebProcess/Network/webrtc/LibWebRTCSocketFactory.h:
2450
2451 2018-06-01  Chris Dumez  <cdumez@apple.com>
2452
2453         Regression(r230876): Swipe navigation snapshot may get removed too early
2454         https://bugs.webkit.org/show_bug.cgi?id=186168
2455         <rdar://problem/39743617>
2456
2457         Reviewed by Tim Horton.
2458
2459         The swipe navigation snapshot would get removed too early when receiving a paint
2460         event after requesting a history navigation but before the provisional load has
2461         actually started. This is because of the asynchronous navigation policy decision
2462         which occurs after requesting to navigate. To address the issue, we now start
2463         listening for events only after the provisional load has started.
2464
2465         * UIProcess/API/Cocoa/WKWebView.mm:
2466         (-[WKWebView _didStartProvisionalLoadForMainFrame]):
2467         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2468         * UIProcess/Cocoa/ViewGestureController.cpp:
2469         (WebKit::ViewGestureController::didStartProvisionalLoadForMainFrame):
2470         (WebKit::ViewGestureController::didReachMainFrameLoadTerminalState):
2471         (WebKit::ViewGestureController::didSameDocumentNavigationForMainFrame):
2472         * UIProcess/Cocoa/ViewGestureController.h:
2473         * UIProcess/ios/PageClientImplIOS.mm:
2474         (WebKit::PageClientImpl::didStartProvisionalLoadForMainFrame):
2475         * UIProcess/ios/ViewGestureControllerIOS.mm:
2476         (WebKit::ViewGestureController::endSwipeGesture):
2477         * UIProcess/mac/PageClientImplMac.h:
2478         * UIProcess/mac/PageClientImplMac.mm:
2479         (WebKit::PageClientImpl::didStartProvisionalLoadForMainFrame):
2480         * UIProcess/mac/ViewGestureControllerMac.mm:
2481         (WebKit::ViewGestureController::endSwipeGesture):
2482
2483 2018-06-01  Jiewen Tan  <jiewen_tan@apple.com>
2484
2485         Unreviewed, build fix for r232276.
2486
2487         iOS sandbox profiles don't preprocess macros. Therefore, remove the whole
2488         macro condition block.
2489
2490         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
2491
2492 2018-06-01  Sihui Liu  <sihui_liu@apple.com>
2493
2494         Stop using StorageTracker.db in LocalStorageDatabaseTracker
2495         https://bugs.webkit.org/show_bug.cgi?id=186104
2496
2497         Reviewed by Geoffrey Garen.
2498
2499         Stop using StorageTracker.db and stop caching origins in LocalStorageDatabaseTracker for efficiency 
2500         and simplicity. Since functions in LocalStorageDatabaseTracker are not frequently called, we get 
2501         little benefits from caching origins.
2502
2503         * Platform/Logging.h:
2504         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
2505         (WKKeyValueStorageManagerGetStorageDetailsByOrigin):
2506         * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
2507         (WebKit::LocalStorageDatabaseTracker::LocalStorageDatabaseTracker):
2508         (WebKit::LocalStorageDatabaseTracker::didOpenDatabaseWithOrigin):
2509         (WebKit::LocalStorageDatabaseTracker::deleteDatabaseWithOrigin):
2510         (WebKit::LocalStorageDatabaseTracker::deleteAllDatabases):
2511         (WebKit::LocalStorageDatabaseTracker::databasesModifiedSince):
2512         (WebKit::LocalStorageDatabaseTracker::origins const):
2513         (WebKit::LocalStorageDatabaseTracker::originDetails):
2514         (WebKit::LocalStorageDatabaseTracker::databasePath const):
2515         (WebKit::fileCreationTime): Deleted.
2516         (WebKit::fileModificationTime): Deleted.
2517         (WebKit::LocalStorageDatabaseTracker::trackerDatabasePath const): Deleted.
2518         (WebKit::LocalStorageDatabaseTracker::openTrackerDatabase): Deleted.
2519         (WebKit::LocalStorageDatabaseTracker::importOriginIdentifiers): Deleted.
2520         (WebKit::LocalStorageDatabaseTracker::updateTrackerDatabaseFromLocalStorageDatabaseFiles): Deleted.
2521         (WebKit::LocalStorageDatabaseTracker::addDatabaseWithOriginIdentifier): Deleted.
2522         (WebKit::LocalStorageDatabaseTracker::removeDatabaseWithOriginIdentifier): Deleted.
2523         (WebKit::LocalStorageDatabaseTracker::pathForDatabaseWithOriginIdentifier): Deleted.
2524         * UIProcess/WebStorage/LocalStorageDatabaseTracker.h:
2525         * UIProcess/WebStorage/StorageManager.h:
2526
2527 2018-06-01  Michael Catanzaro  <mcatanzaro@igalia.com>
2528
2529         [GTK] Crash in WebKitFaviconDatabase when pageURL is unset
2530         https://bugs.webkit.org/show_bug.cgi?id=186164
2531
2532         Reviewed by Carlos Garcia Campos.
2533
2534         PageURL can legitimately be null here if JavaScript does something silly with window.open.
2535
2536         * UIProcess/API/glib/WebKitFaviconDatabase.cpp:
2537         (webkitFaviconDatabaseSetIconURLForPageURL):
2538         (webkitFaviconDatabaseSetIconForPageURL):
2539
2540 2018-05-31  Brian Burg  <bburg@apple.com>
2541
2542         [Cocoa] Web Automation: use the session delegate to perform window maximize
2543         https://bugs.webkit.org/show_bug.cgi?id=186167
2544         <rdar://problem/40544391>
2545
2546         Reviewed by Timothy Hatcher.
2547
2548         Add plumbing to hand off window maximizing to the session delegate.
2549
2550         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
2551         * UIProcess/Cocoa/AutomationSessionClient.h:
2552         * UIProcess/Cocoa/AutomationSessionClient.mm:
2553         (WebKit::AutomationSessionClient::AutomationSessionClient):
2554         (WebKit::AutomationSessionClient::requestMaximizeWindowOfPage):
2555
2556 2018-06-01  Carlos Garcia Campos  <cgarcia@igalia.com>
2557
2558         Unreviewed. Try to fix GTK+ build with old versions of GTK+ after r232390.
2559
2560         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
2561         (WebKit::WebPopupMenuProxyGtk::showPopupMenu):
2562
2563 2018-06-01  Carlos Garcia Campos  <cgarcia@igalia.com>
2564
2565         [GTK] Switch to use a popup window with a tree view instead of a menu for option menu default implementation
2566         https://bugs.webkit.org/show_bug.cgi?id=186146
2567
2568         Reviewed by Michael Catanzaro.
2569
2570         It's more convenient to use than the menu.
2571
2572         * UIProcess/API/gtk/WebKitPopupMenu.cpp:
2573         (WebKit::menuCloseCallback):
2574         (WebKit::WebKitPopupMenu::activateItem):
2575         * UIProcess/API/gtk/WebKitPopupMenu.h:
2576         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
2577         (WebKit::WebPopupMenuProxyGtk::WebPopupMenuProxyGtk):
2578         (WebKit::WebPopupMenuProxyGtk::selectItem):
2579         (WebKit::WebPopupMenuProxyGtk::activateItem):
2580         (WebKit::WebPopupMenuProxyGtk::activateItemAtPath):
2581         (WebKit::WebPopupMenuProxyGtk::treeViewRowActivatedCallback):
2582         (WebKit::WebPopupMenuProxyGtk::treeViewButtonReleaseEventCallback):
2583         (WebKit::WebPopupMenuProxyGtk::buttonPressEventCallback):
2584         (WebKit::WebPopupMenuProxyGtk::keyPressEventCallback):
2585         (WebKit::WebPopupMenuProxyGtk::createPopupMenu):
2586         (WebKit::WebPopupMenuProxyGtk::show):
2587         (WebKit::WebPopupMenuProxyGtk::showPopupMenu):
2588         (WebKit::WebPopupMenuProxyGtk::hidePopupMenu):
2589         (WebKit::WebPopupMenuProxyGtk::cancelTracking):
2590         (WebKit::WebPopupMenuProxyGtk::typeAheadFindIndex):
2591         (WebKit::WebPopupMenuProxyGtk::typeAheadFind):
2592         * UIProcess/gtk/WebPopupMenuProxyGtk.h:
2593
2594 2018-05-31  Per Arne Vollan  <pvollan@apple.com>
2595
2596         Add OpenGL display mask to WebPage creation parameters.
2597         https://bugs.webkit.org/show_bug.cgi?id=186163
2598         <rdar://problem/40634504>
2599
2600         Reviewed by Brent Fulgham.
2601
2602         To make sure the OpenGL display mask is always available, include it in the WebPage creation parameters.
2603         The OpenGL display mask is sent to the WebProcess when the platform display ID changes, but that is not
2604         early enough in all cases. If the OpenGL display mask is not set, only OpenGL software rendering is offered
2605         on some hardware configurations.
2606
2607         * Shared/WebPageCreationParameters.cpp:
2608         (WebKit::WebPageCreationParameters::encode const):
2609         (WebKit::WebPageCreationParameters::decode):
2610         * Shared/WebPageCreationParameters.h:
2611         * UIProcess/WebPageProxy.cpp:
2612         (WebKit::WebPageProxy::creationParameters):
2613         * WebProcess/WebPage/WebPage.cpp:
2614         (WebKit::m_credentialsMessenger):
2615
2616 2018-05-31  Brent Fulgham  <bfulgham@apple.com>
2617
2618         Add a rule to allow reading files with prefix /private/var/db/CVMS/cvmsCodeSignObj
2619         https://bugs.webkit.org/show_bug.cgi?id=186157
2620         <rdar://problem/40666437>
2621
2622         Reviewed by Eric Carlson.
2623
2624         * WebProcess/com.apple.WebProcess.sb.in:
2625
2626 2018-05-31  Megan Gardner  <megan_gardner@apple.com>
2627
2628         Add setting to allow override screen size to be disabled.
2629         https://bugs.webkit.org/show_bug.cgi?id=186109
2630
2631         Reviewed by Andy Estes.
2632
2633         Pipe the needed settings through to WebCore.
2634
2635         * Shared/WebPreferences.yaml:
2636         * UIProcess/WebPageProxy.cpp:
2637         (WebKit::m_configurationPreferenceValues):
2638
2639 2018-05-31  Brent Fulgham  <bfulgham@apple.com>
2640
2641         [macOS] Add JIT entitlements to WebContent process and plugin process on macOS
2642         https://bugs.webkit.org/show_bug.cgi?id=184485
2643         <rdar://problem/37556535>
2644
2645         Reviewed by Dan Bernstein.
2646
2647         This patch builds on the changes from Bug 185526 to add support for a JIT entitlement. It makes the
2648         following changes:
2649
2650         1. Adds a new 'WebContent-OSX.entitlements file that unconditionally adds the JIT entitlement for all builds.
2651         2. Modifies the PluginService.entitlements to unconditionally add the JIT entitlement.
2652
2653         * Configurations/PluginService.entitlements: Updated to add the JIT entitlement.
2654         * Configurations/WebContent-OSX.entitlements: Updated to add the JIT entitlement.
2655         * Configurations/WebContentService.xcconfig: Updated to use the new 'WebContent-OSX.entitlements' file.
2656         * WebKit.xcodeproj/project.pbxproj:
2657
2658 2018-05-31  Brent Fulgham  <bfulgham@apple.com>
2659
2660         Don't attempt to extend sandbox when running tests with mock media devices
2661         https://bugs.webkit.org/show_bug.cgi?id=186150
2662         <rdar://problem/40690875>
2663
2664         Reviewed by Alexey Proskuryakov.
2665
2666         Avoid attempting to issue a sandbox extension to actual media devices when
2667         running with Mock capture devices.
2668
2669         Also handle the 'denyNextRequest' test state outside of the USE(APPLE_INTERNAL_SDK)
2670         guards, since it is needed for Open Source builds as well.
2671
2672         * UIProcess/UserMediaProcessManager.cpp:
2673         (WebKit::UserMediaProcessManager::willCreateMediaStream):
2674
2675 2018-05-31  Antti Koivisto  <antti@apple.com>
2676
2677         WebKit memory management: Safari jetsams on some websites when zooming and scrolling
2678         https://bugs.webkit.org/show_bug.cgi?id=186091
2679         <rdar://problem/36315010>
2680
2681         Reviewed by Geoff Garen.
2682
2683         When zooming a page rapidly the visible rect and the page zoom level may get momentarily out of sync.
2684         When this happens we may generate tiles for a much larger area than needed and run out of memory
2685         building the next layer tree transaction. Running out of memory is more likely if the page has lots of
2686         tiled layers in addition to the main content layer.
2687
2688         We already have code for dealing with the scale mismatch for zoom-out case (where this would cause
2689         visibly missing tiles). This patch enables the same exact adjustment for zoom-in case (where the
2690         symptom is creating too many tiles).
2691
2692         * WebProcess/WebPage/ios/WebPageIOS.mm:
2693         (WebKit::adjustExposedRectForNewScale):
2694
2695         Do some renames to make it clear that this can both expand and contract the visible rect.
2696         Bail out if there is nothing to do.
2697
2698         (WebKit::WebPage::updateVisibleContentRects):
2699
2700         Call adjustExposedRectForNewScale directly and unconditionally.
2701
2702         (WebKit::adjustExposedRectForBoundedScale): Deleted.
2703
2704 2018-05-30  Yusuke Suzuki  <utatane.tea@gmail.com>
2705
2706         [JSC] Pass VM& parameter as much as possible
2707         https://bugs.webkit.org/show_bug.cgi?id=186085
2708
2709         Reviewed by Saam Barati.
2710
2711         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
2712         (WebKit::NPJSObject::hasMethod):
2713         (WebKit::NPJSObject::construct):
2714         (WebKit::NPJSObject::invoke):
2715
2716 2018-05-30  Brent Fulgham  <bfulgham@apple.com>
2717
2718         [macOS] WebProcess needs TCC entitlements for media capture (Take 2)
2719         https://bugs.webkit.org/show_bug.cgi?id=185526
2720         <rdar://problem/36674649>
2721
2722         Reviewed by Alexey Proskuryakov.
2723
2724         In Bug 181995 I added TCC entitlements for media capture to the macOS entitlements used for
2725         relocatable builds. These changes also need to apply to system builds of WebKit.
2726
2727         Previously we had not needed an entitlements file for system builds of WebKit, so only provided
2728         an entitlements file for our relocatable build targets. Now we need entitlements when building
2729         on recent macOS targets using internal SDKs.
2730
2731         Since these various scenarios are beginning to multiple, this patch dynamically generates the
2732         entitlements file.
2733
2734         This patch does the following:
2735
2736         1. Changes the "WebContent-OSX.entitlements" to hold the TCC entitlements needed for media capture, and rename
2737            to "WebContent-OSX-restricted.entitlements".
2738         2. Removes the unneeded "com.apple.private.xpc.domain-extension" from WebContent-OSX.entitlement, and dynamically
2739            adds it using a new build step using the script 'process-webcontent-entitlements.sh'
2740         3. Updates DebugRelease.xcconfig to use the 'Safari Engineering' signing key for internal builds.
2741         4. Updates WebContentService.xcconfig to remove the CODE_SIGN_ENTITLEMENTS_OSX_WITH_XPC_DOMAIN_EXTENSION_YES target
2742            since we no longer need a custom entitlement file for this case.
2743         5. Updates WebContentService.Development.xcconfig to remove CODE_SIGN_ENTITLEMENTS_COCOA_TOUCH_NO since it is no
2744            longer needed.
2745         6. Deletes the file Configurations/WebContent.Development.entitlements since it is no longer needed.
2746         7. Revises the WebContent process sandbox to allow camera and microphone access without needing TCC
2747            entitlements, since those cannot be applied without an internal SDK.
2748         8. Revises the UserMediaProcessManager to not pass dynamic sandbox extensions to the WebContent process
2749            when building with the public SDK since those entitlements cannot be added or consumed in Open
2750            Source builds.
2751
2752         We want to use the TCC entitlements when building with the internal SDK on recent macOS builds.
2753
2754         * Configurations/Base.xcconfig:
2755         * Configurations/DebugRelease.xcconfig:
2756         * Configurations/WebContent-OSX-restricted.entitlements: Renamed from Source/WebKit/Configurations/WebContent-OSX.entitlements.
2757         * Configurations/WebContent.Development.entitlements: Removed.
2758         * Configurations/WebContentService.Development.xcconfig:
2759         * Configurations/WebContentService.xcconfig:
2760         * Scripts/process-webcontent-entitlements.sh: Added.
2761         * UIProcess/UserMediaProcessManager.cpp:
2762         (WebKit::UserMediaProcessManager::willCreateMediaStream): Don't bother creating and sending sandbox extensions for
2763         camera and microphone control for builds that cannot support them.
2764         * WebKit.xcodeproj/project.pbxproj:
2765
2766 2018-05-30  Daniel Bates  <dabates@apple.com>
2767
2768         NavigationAction does not need to hold initiating DOM Event
2769         https://bugs.webkit.org/show_bug.cgi?id=185958
2770         <rdar://problem/40531539>
2771
2772         Reviewed by Simon Fraser.
2773
2774         Write in terms of NavigationAction::{keyStateEventData, mouseEventDataForFirstMouseEvent}().
2775
2776         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
2777         (WebKit::mouseButtonForMouseEventData):
2778         (WebKit::syntheticClickTypeForMouseEventData):
2779         (WebKit::clickLocationInRootViewCoordinatesForMouseEventData):
2780         (WebKit::InjectedBundleNavigationAction::modifiersForNavigationAction):
2781         (WebKit::InjectedBundleNavigationAction::mouseButtonForNavigationAction):
2782         (WebKit::InjectedBundleNavigationAction::syntheticClickTypeForNavigationAction):
2783         (WebKit::InjectedBundleNavigationAction::clickLocationInRootViewCoordinatesForNavigationAction):
2784         (WebKit::InjectedBundleNavigationAction::InjectedBundleNavigationAction):
2785         (WebKit::mouseEventForNavigationAction): Deleted.
2786         (WebKit::mouseButtonForMouseEvent): Deleted.
2787         (WebKit::syntheticClickTypeForMouseEvent): Deleted.
2788         (WebKit::clickLocationInRootViewCoordinatesForMouseEvent): Deleted.
2789
2790 2018-05-30  Andy Estes  <aestes@apple.com>
2791
2792         [Cocoa] Add an SPI to suppress connection termination errors from CFNetwork when network interfaces change
2793         https://bugs.webkit.org/show_bug.cgi?id=186107
2794         <rdar://problem/39338957>
2795
2796         Reviewed by Brady Eidson.
2797
2798         Added an SPI which configures a process pool's networking process to set the
2799         kCFStreamPropertyAutoErrorOnSystemChange to NO on its NSURLSessionConfigurations.
2800         This instructs CFNetwork to not terminate active connections when the system's
2801         network interfaces change.
2802
2803         * NetworkProcess/NetworkProcess.h:
2804         (WebKit::NetworkProcess::suppressesConnectionTerminationOnSystemChange const):
2805         * NetworkProcess/NetworkProcessCreationParameters.cpp:
2806         (WebKit::NetworkProcessCreationParameters::encode const):
2807         (WebKit::NetworkProcessCreationParameters::decode):
2808         * NetworkProcess/NetworkProcessCreationParameters.h:
2809         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2810         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
2811         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2812         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
2813         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2814         (API::ProcessPoolConfiguration::copy):
2815         * UIProcess/API/APIProcessPoolConfiguration.h:
2816         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
2817         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
2818         (-[_WKProcessPoolConfiguration suppressesConnectionTerminationOnSystemChange]):
2819         (-[_WKProcessPoolConfiguration setSuppressesConnectionTerminationOnSystemChange:]):
2820         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2821         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2822
2823 2018-05-30  Youenn Fablet  <youenn@apple.com>
2824
2825         Rename FromOrigin runtime flag to CrossOriginResourcePolicy and enable it by default
2826         https://bugs.webkit.org/show_bug.cgi?id=186082
2827
2828         Reviewed by Chris Dumez.
2829
2830         * NetworkProcess/NetworkResourceLoadParameters.cpp:
2831         (WebKit::NetworkResourceLoadParameters::encode const):
2832         (WebKit::NetworkResourceLoadParameters::decode):
2833         * NetworkProcess/NetworkResourceLoadParameters.h:
2834         * Shared/WebPreferences.yaml:
2835         * UIProcess/API/C/WKPreferences.cpp:
2836         (WKPreferencesSetCrossOriginResourcePolicyEnabled):
2837         (WKPreferencesGetCrossOriginResourcePolicyEnabled):
2838         (WKPreferencesSetFromOriginResponseHeaderEnabled): Deleted.
2839         (WKPreferencesGetFromOriginResponseHeaderEnabled): Deleted.
2840         * UIProcess/API/C/WKPreferencesRef.h:
2841         * WebProcess/Network/WebLoaderStrategy.cpp:
2842         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
2843
2844 2018-05-30  Youenn Fablet  <youenn@apple.com>
2845
2846         Rename CrossOriginResourcePolicy same to same-origin
2847         https://bugs.webkit.org/show_bug.cgi?id=186080
2848
2849         Reviewed by Chris Dumez.
2850
2851         * NetworkProcess/NetworkLoadChecker.cpp:
2852         (WebKit::NetworkLoadChecker::shouldCrossOriginResourcePolicyPolicyCancelLoad):
2853
2854 2018-05-30  David Kilzer  <ddkilzer@apple.com>
2855
2856         [iOS] -[WKFullScreenViewController viewWillAppear:] should call [super viewWillAppeear:]
2857         <https://webkit.org/b/186103>
2858         <rdar://problem/40655695>
2859
2860         Reviewed by Eric Carlson.
2861
2862         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
2863         (WKFullScreenViewControllerPlaybackSessionModelClient::setInterface):
2864         Drive-by clean up.  For consistency, we always use the same
2865         variable in the body of the `if` statement that was used in the
2866         condition.
2867         (-[WKFullScreenViewController viewWillAppear:]): Call
2868         [super viewWillAppeear:] to fulfill API contract.
2869
2870 2018-05-30  Chris Dumez  <cdumez@apple.com>
2871
2872         Take a background process assertion in WebPageProxy::callAfterNextPresentationUpdate()
2873         https://bugs.webkit.org/show_bug.cgi?id=186097
2874         <rdar://problem/40651225>
2875
2876         Reviewed by Dan Bernstein.
2877
2878         Refactor fix landed in r232298 so that we rely on the existing Callback infrastructure
2879         to take a background process assertion.
2880
2881         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
2882         (WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing):
2883         * UIProcess/WebPageProxy.cpp:
2884         (WebKit::WebPageProxy::callAfterNextPresentationUpdate):
2885
2886 2018-05-30  Aditya Keerthi  <akeerthi@apple.com>
2887
2888         Fix the ENABLE(DATALIST_ELEMENT) build
2889         https://bugs.webkit.org/show_bug.cgi?id=186105
2890
2891         Reviewed by Wenson Hsieh.
2892
2893         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
2894
2895 2018-05-30  Jiewen Tan  <jiewen_tan@apple.com>
2896
2897         Unreviewed, a quick build fix for r232276.
2898
2899         Enabled SecItemShim again as it turns out to be useful for CFNetwork APIs that
2900         query Keychains underneath us.
2901
2902         * NetworkProcess/ios/NetworkProcessIOS.mm:
2903         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
2904         * NetworkProcess/mac/NetworkProcessMac.mm:
2905         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
2906
2907 2018-05-30  Jer Noble  <jer.noble@apple.com>
2908
2909         Auto-pip should use main content heuristic.
2910         https://bugs.webkit.org/show_bug.cgi?id=186065
2911         <rdar://problem/35862502>
2912
2913         Reviewed by Eric Carlson.
2914
2915         Make the m_pipStandbyElement clearable, which will allow the auto-pip mechanism to be torn down. Add
2916         a WebProcess-side notification when the main content changes, to facilitate this.
2917
2918         * WebProcess/FullScreen/WebFullScreenManager.cpp:
2919         (WebKit::WebFullScreenManager::videoControlsManagerDidChange):
2920         (WebKit::WebFullScreenManager::setPIPStandbyElement):
2921         (WebKit::WebFullScreenManager::didEnterFullScreen):
2922         (WebKit::WebFullScreenManager::willExitFullScreen):
2923         * WebProcess/FullScreen/WebFullScreenManager.h:
2924         * WebProcess/WebPage/WebPage.cpp:
2925         (WebKit::WebPage::videoControlsManagerDidChange):
2926         * WebProcess/WebPage/WebPage.h:
2927         * WebProcess/cocoa/PlaybackSessionManager.h:
2928         * WebProcess/cocoa/PlaybackSessionManager.mm:
2929         (WebKit::PlaybackSessionManager::setUpPlaybackControlsManager):
2930         (WebKit::PlaybackSessionManager::clearPlaybackControlsManager):
2931         (WebKit::PlaybackSessionManager::currentPlaybackControlsElement const):
2932
2933 2018-05-30  Jer Noble  <jer.noble@apple.com>
2934
2935         Fix a few issues in WKFullScreenViewController
2936         https://bugs.webkit.org/show_bug.cgi?id=186067
2937         <rdar://problem/40630944>
2938
2939         Reviewed by Darin Adler.
2940
2941         The check in setInterface() is checking the wrong pointer:
2942         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
2943         (WKFullScreenViewControllerPlaybackSessionModelClient::setInterface):
2944
2945         The check in -_effectiveFullscreenInsetTop is backwards:
2946         (-[WKFullScreenViewController _effectiveFullscreenInsetTop]):
2947
2948 2018-05-30  Chris Dumez  <cdumez@apple.com>
2949
2950         Take a background process assertion in WebPageProxy::callAfterNextPresentationUpdate()
2951         https://bugs.webkit.org/show_bug.cgi?id=186097
2952         <rdar://problem/40651225>
2953
2954         Reviewed by Tim Horton.
2955
2956         Take a background process assertion in WebPageProxy::callAfterNextPresentationUpdate(). Otherwise,
2957         apps may get stuck on _doAfterNextPresentationUpdate because the WebProcess got suspended.
2958
2959         * UIProcess/WebPageProxy.cpp:
2960         (WebKit::WebPageProxy::callAfterNextPresentationUpdate):
2961
2962 2018-05-29  Tim Horton  <timothy_horton@apple.com>
2963
2964         Fix the build
2965         https://bugs.webkit.org/show_bug.cgi?id=186078
2966
2967         Unreviewed build fix.
2968
2969         * UIProcess/API/Cocoa/WKWebView.mm:
2970         (-[WKWebView _denyNextUserMediaRequest]):
2971
2972 2018-05-29  Andy Estes  <aestes@apple.com>
2973
2974         [Wi-Fi Assertions] Track whether WiFiAssertionHolder should actually hold a Wi-Fi assertion
2975         https://bugs.webkit.org/show_bug.cgi?id=185983
2976         <rdar://problem/40205486>
2977
2978         Reviewed by Tim Horton.
2979
2980         * Configurations/Network-iOS.entitlements:
2981
2982         Added a needed entitlement.
2983
2984         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
2985         * NetworkProcess/cocoa/WiFiAssertionHolder.h:
2986         (WebKit::WiFiAssertionHolder::shouldHoldWiFiAssertion const):
2987
2988         Track whether WiFiAssertionHolder should actually hold a Wi-Fi assertion.
2989
2990         * NetworkProcess/cocoa/WiFiAssertionHolder.mm: Renamed from Source/WebKit/NetworkProcess/cocoa/WiFiAssertionHolder.cpp.
2991         (holdWiFiAssertion):
2992         (releaseWiFiAssertion):
2993         (WebKit::WiFiAssertionHolder::WiFiAssertionHolder):
2994         (WebKit::WiFiAssertionHolder::~WiFiAssertionHolder):
2995
2996         Changed holdWiFiAssertion() and releaseWiFiAssertion() to take the
2997         WiFiAssertionHolder as an argument.
2998
2999         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
3000
3001         Added a needed sandbox extension.
3002
3003         * WebKit.xcodeproj/project.pbxproj:
3004
3005 2018-05-29  Youenn Fablet  <youenn@apple.com>
3006
3007         Add a consistency check between URL and CFURL
3008         https://bugs.webkit.org/show_bug.cgi?id=186057
3009         <rdar://problem/40258457>
3010
3011         Reviewed by Geoff Garen.
3012
3013         * Shared/Cocoa/WKNSURLExtras.mm:
3014         (+[NSURL _web_URLWithWTFString:relativeToURL:]):
3015         (urlWithWTFString): Deleted.
3016         (+[NSURL _web_URLWithWTFString:]): Deleted.
3017
3018 2018-05-29  Alex Christensen  <achristensen@webkit.org>
3019
3020         Remove unused WebPage::dummy
3021         https://bugs.webkit.org/show_bug.cgi?id=186068
3022
3023         Reviewed by Sam Weinig.
3024
3025         * WebProcess/WebPage/WebPage.cpp:
3026         (WebKit::WebPage::dummy): Deleted.
3027         * WebProcess/WebPage/WebPage.h:
3028         * WebProcess/WebPage/WebPage.messages.in:
3029
3030 2018-05-29  Per Arne Vollan  <pvollan@apple.com>
3031
3032         Create typedef for HashMap<PlatformDisplayID, ScreenProperties>
3033         https://bugs.webkit.org/show_bug.cgi?id=186056
3034
3035         Reviewed by Brent Fulgham.
3036
3037         * Shared/WebProcessCreationParameters.cpp:
3038         (WebKit::WebProcessCreationParameters::decode):
3039         * Shared/WebProcessCreationParameters.h:
3040
3041 2018-05-25  Jiewen Tan  <jiewen_tan@apple.com>
3042
3043         Tighten sandbox profiles for Networking Processes to restrict accesses to macOS/iOS Keychains
3044         https://bugs.webkit.org/show_bug.cgi?id=162948
3045         <rdar://problem/40558894>
3046
3047         Reviewed by Brent Fulgham.
3048
3049         The patch conditionally tighten sandbox profiles for Networking Processes to remove Keychain related
3050         permissions and some security permisssions that are not needed. Also it conditionally remove the
3051         Process Privilege for Networking Processes to access Credentials.
3052
3053         In addition, it remove process privilege assertions for SecItemShim as it is supposed to work in processes
3054         that don't have privileges to access Keychains and delegate all operations to UI Process via IPC. Also,
3055         the patch disables SecItemShim for Networking Process conditionally.
3056
3057         * Configurations/Network-iOS.entitlements:
3058         * NetworkProcess/NetworkProcess.cpp:
3059         (WebKit::NetworkProcess::initializeNetworkProcess):
3060         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
3061         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
3062         * Shared/mac/SecItemShim.cpp:
3063         (WebKit::sendSecItemRequest):
3064         (WebKit::webSecItemCopyMatching):
3065         (WebKit::webSecItemAdd):
3066         (WebKit::webSecItemUpdate):
3067         (WebKit::webSecItemDelete):
3068         (WebKit::initializeSecItemShim):
3069
3070 2018-05-29  Chris Dumez  <cdumez@apple.com>
3071
3072         Store 0-lifetime stylesheets / scripts into the disk cache for faster history navigations
3073         https://bugs.webkit.org/show_bug.cgi?id=186060
3074         <rdar://problem/40627270>
3075
3076         Reviewed by Geoffrey Garen.
3077
3078         Tweak our storeUnconditionallyForHistoryNavigation logic to match resources whose priority
3079         is High, not just VeryHigh. Per logic in CachedResource::defaultPriorityForResourceType(Type),
3080         This now matches stylesheets and scripts in addition to main resources.
3081
3082         I found that in case of a history navigation to apple.com, a significant number of scripts
3083         and stylesheets had to be loaded from the network because our previous heuristic decided
3084         not to store them (because their priority was not VeryHigh and because their max-age was
3085         0).
3086
3087         * NetworkProcess/cache/NetworkCache.cpp:
3088         (WebKit::NetworkCache::makeStoreDecision):
3089
3090 2018-05-28  Jeff Miller  <jeffm@apple.com>
3091
3092         Expose additional WKMenuItemIdentifier strings
3093         https://bugs.webkit.org/show_bug.cgi?id=186041
3094
3095         Reviewed by Dan Bernstein.
3096
3097         Expose identifiers for media-related menu items.
3098
3099         * UIProcess/API/Cocoa/WKMenuItemIdentifiers.mm:
3100         Define new identifiers.
3101
3102         * UIProcess/API/Cocoa/WKMenuItemIdentifiersPrivate.h:
3103         Declare new identifiers.
3104
3105         * UIProcess/mac/WebContextMenuProxyMac.mm:
3106         (WebKit::menuItemIdentifier):
3107         Map to new identifiers.
3108
3109 2018-05-29  Geoffrey Garen  <ggaren@apple.com>
3110
3111         Removed some unused WebSQL trackers
3112         https://bugs.webkit.org/show_bug.cgi?id=186026
3113
3114         Reviewed by Dan Bernstein.
3115
3116         * NetworkProcess/NetworkProcess.cpp:
3117         (WebKit::NetworkProcess::NetworkProcess):
3118         * NetworkProcess/NetworkProcess.h:
3119         * WebProcess/WebProcess.cpp:
3120         (WebKit::m_nonVisibleProcessCleanupTimer):
3121         (WebKit::m_webSQLiteDatabaseTracker): Deleted.
3122         * WebProcess/WebProcess.h:
3123
3124 2018-05-29  Per Arne Vollan  <pvollan@apple.com>
3125
3126         Follow-up fixes after r228907.
3127         https://bugs.webkit.org/show_bug.cgi?id=183338
3128
3129         Reviewed by Brent Fulgham.
3130
3131         Add screen properties to the WebProcess creation parameters, instead of sending
3132         them in a message to the WebProcess just after starting it up.
3133
3134         * Shared/WebProcessCreationParameters.cpp:
3135         (WebKit::WebProcessCreationParameters::encode const):
3136         (WebKit::WebProcessCreationParameters::decode):
3137         * Shared/WebProcessCreationParameters.h:
3138         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3139         (WebKit::WebProcessPool::platformInitializeWebProcess):
3140         * UIProcess/WebProcessPool.cpp:
3141         (WebKit::WebProcessPool::initializeNewWebProcess):
3142         * WebProcess/cocoa/WebProcessCocoa.mm:
3143         (WebKit::WebProcess::platformInitializeWebProcess):
3144
3145 2018-05-29  Sihui Liu  <sihui_liu@apple.com>
3146
3147         Unable to remove IndexedDB Databases with Cocoa API removeDataOfTypes
3148         https://bugs.webkit.org/show_bug.cgi?id=185835
3149         <rdar://problem/39142257>
3150
3151         Reviewed by Chris Dumez.
3152
3153         Fix a wrong if condition: databases should be closed and deleted if websiteDataTypes contains 
3154         WebsiteDataType::IndexedDBDatabases.
3155
3156         * StorageProcess/StorageProcess.cpp:
3157         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
3158
3159 2018-05-28  Sam Weinig  <sam@webkit.org>
3160
3161         Modernize SVGRenderStyleDefs.h
3162         https://bugs.webkit.org/show_bug.cgi?id=186024
3163
3164         Reviewed by Daniel Bates.
3165
3166         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
3167         (WebKit::applyPropertiesToLayer):
3168         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
3169         (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
3170         Update for new enum names.
3171
3172 2018-05-28  Carlos Garcia Campos  <cgarcia@igalia.com>
3173
3174         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.21.3 release.
3175
3176         * gtk/NEWS: Add release notes for 2.21.3.
3177
3178 2018-05-27  Dan Bernstein  <mitz@apple.com>
3179
3180         Reverted the changes made for https://webkit.org/b/186016
3181
3182         They broke the USE(APPLE_INTERNAL_SDK) Sierra build.
3183
3184 2018-05-27  David Kilzer  <ddkilzer@apple.com>
3185
3186         [iOS] Fix warnings about leaks found by clang static analyzer
3187         <https://webkit.org/b/186009>
3188         <rdar://problem/40574267>
3189
3190         Reviewed by Daniel Bates.
3191
3192         * UIProcess/Automation/ios/WebAutomationSessionIOS.mm:
3193         (WebKit::WebAutomationSession::platformSimulateKeySequence): Fix
3194         leak of two WebEvent objects that happened in a loop.
3195         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
3196         (-[_WKPreviewControllerDelegate previewController:transitionImageForPreviewItem:contentRect:]):
3197         Fix leak of a UIImage.
3198
3199 2018-05-27  Dan Bernstein  <mitz@apple.com>
3200
3201         [Cocoa] Avoid importing directly from subumbrella frameworks
3202         https://bugs.webkit.org/show_bug.cgi?id=186016
3203
3204         Reviewed by Sam Weinig.
3205
3206         * Configurations/BaseTarget.xcconfig: Removed -iframework options from OTHER_CFLAGS and
3207           OTHER_CPLUSPLUSFLAGS.
3208         * UIProcess/Automation/mac/WebAutomationSessionMac.mm: Import Carbon.h instead of an
3209           HIToolbox header.
3210         * UIProcess/Cocoa/WebViewImpl.mm: Ditto.
3211         * UIProcess/mac/WKPrintingView.mm: Import Quartz.h instead of a PDFKit header.
3212         * UIProcess/mac/WKTextInputWindowController.mm: Import Carbon.h instead of an HIToolbox
3213           header.
3214         * WebProcess/Plugins/PDF/PDFAnnotationTextWidgetDetails.h: Import Quartz.h instead of a
3215           PDFKit header.
3216         * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h: Ditto.
3217         * WebProcess/Plugins/PDF/PDFPlugin.mm: Ditto.
3218         * WebProcess/Plugins/PDF/PDFPluginAnnotation.mm: Ditto.
3219         * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm: Ditto.
3220         * WebProcess/Plugins/PDF/PDFPluginPasswordField.mm: Ditto.
3221         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm: Ditto.
3222         * WebProcess/WebPage/mac/WebPageMac.mm: Ditto.
3223
3224 2018-05-25  Timothy Hatcher  <timothy@apple.com>
3225
3226         Setting drawsBackground to YES on a WKView doesn't take effect immediately
3227         https://bugs.webkit.org/show_bug.cgi?id=185885
3228         rdar://problem/39706506
3229
3230         Reviewed by Simon Fraser.
3231
3232         * UIProcess/API/Cocoa/WKWebView.mm:
3233         (-[WKWebView _initializeWithConfiguration:]): Removed setBackgroundExtendsBeyondPage(true)
3234         since it is now the default.
3235         * UIProcess/Cocoa/WebViewImpl.mm:
3236         (WebKit::WebViewImpl::setDrawsBackground): Make sure updateLayer gets called on the web view
3237         by calling setNeedsDisplay:YES.
3238         (WebKit::WebViewImpl::setBackgroundColor): Ditto.
3239         (WebKit::WebViewImpl::updateLayer): Removed dead code.
3240         * UIProcess/WebPageProxy.h: Make m_backgroundExtendsBeyondPage default to true. WebKit was
3241         always turning this on during WKWebView initializtion, which would cause the scroll
3242         shadow layer to be created, flash black because of no background, then destroyed soon
3243         after once WebKit's message to turn it on got delivered.
3244         * WebProcess/WebPage/WebPage.cpp:
3245         (WebPage::WebPage): Call setBackgroundExtendsBeyondPage earlier to avoid creating the scroll
3246         shadow layer, since backgroundShouldExtendBeyondPage defautls to false in WebCore for WK1.
3247         (WebKit::WebPage::setDrawsBackground): Use updateBackgroundRecursively to propagate the
3248         correct base background color.
3249
3250 2018-05-25  Youenn Fablet  <youenn@apple.com>
3251
3252         Migrate From-Origin to Cross-Origin-Resource-Policy
3253         https://bugs.webkit.org/show_bug.cgi?id=185840
3254
3255         Reviewed by Chris Dumez.
3256
3257         Do Cross-Origin-Resource-Policy (CORP) checks in NetworkLoadChecker instead of NetworkResourceLoader directly.
3258         Make sure CORP only applies to no-cors loads.
3259         Remove ancestor checks and only consider the document origin making the load.
3260         This means that in case of cross-origin redirection to same-origin, the redirection will be CORP-checked,
3261         the final response will not be CORP-checked but will be opaque.
3262
3263         * NetworkProcess/NetworkLoadChecker.cpp:
3264         (WebKit::NetworkLoadChecker::validateCrossOriginResourcePolicyPolicy):
3265         (WebKit::NetworkLoadChecker::validateResponse):
3266         * NetworkProcess/NetworkLoadChecker.h:
3267         * NetworkProcess/NetworkResourceLoader.cpp:
3268         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
3269         (WebKit::NetworkResourceLoader::didReceiveResponse):
3270         (WebKit::NetworkResourceLoader::continueWillSendRedirectedRequest):
3271         (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
3272         (WebKit::NetworkResourceLoader::dispatchWillSendRequestForCacheEntry):
3273         * NetworkProcess/NetworkResourceLoader.h:
3274         * WebProcess/Network/WebLoaderStrategy.cpp:
3275         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
3276         Send ancestor information for navigation loads only.
3277
3278 2018-05-25  Daniel Bates  <dabates@apple.com>
3279
3280         NavigationAction should not hold a strong reference to a Document
3281         https://bugs.webkit.org/show_bug.cgi?id=185712
3282         <rdar://problem/40320916>
3283
3284         Reviewed by Brent Fulgham.
3285
3286         Update code to make use of NavigationAction::requester().
3287
3288         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3289         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
3290
3291 2018-05-25  Tim Horton  <timothy_horton@apple.com>
3292
3293         Ensure that the Web Content process doesn't sleep during initialization
3294         https://bugs.webkit.org/show_bug.cgi?id=185975
3295         <rdar://problem/40548159>
3296
3297         Reviewed by Geoffrey Garen.
3298
3299         WebProcessPool::warmInitialProcess isn't worth much (or at least, as much
3300         as it could be) if the Web Content process goes to sleep in the middle
3301         of initializeWebProcess.
3302
3303         Keep the Web Content process alive until it has handled all messages
3304         sent from WebProcessPool::initializeNewWebProcess.
3305
3306         This is a significant speedup on some benchmarks I've been running
3307         that involve prewarming a process long before any content is loaded.
3308
3309         * UIProcess/WebProcessPool.cpp:
3310         (WebKit::WebProcessPool::initializeNewWebProcess):
3311
3312 2018-05-25  Chris Dumez  <cdumez@apple.com>
3313
3314         WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback() unexpectedly constructs a process pool
3315         https://bugs.webkit.org/show_bug.cgi?id=185992
3316
3317         Reviewed by Geoffrey Garen.
3318
3319         Update enableResourceLoadStatisticsAndSetTestingCallback() to pass the right parameter to processPools()
3320         to avoid constructing a process pool when none exist. Also drop the 'resourceLoadStatisticsEnabled'
3321         flag on the WebProcessPool and have it query its data store instead to know if the feature is enabled.
3322
3323         * UIProcess/WebProcessPool.cpp:
3324         (WebKit::WebProcessPool::initializeNewWebProcess):
3325         (WebKit::WebProcessPool::setResourceLoadStatisticsEnabled):
3326         * UIProcess/WebProcessPool.h:
3327         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3328         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
3329
3330 2018-05-25  Chris Dumez  <cdumez@apple.com>
3331
3332         Drop support for NSURLCache in WebKit2
3333         https://bugs.webkit.org/show_bug.cgi?id=185990
3334
3335         Reviewed by Geoffrey Garen.
3336
3337         Drop support for NSURLCache in WebKit2 now that the WebKit network cache is stable.
3338
3339         * NetworkProcess/NetworkProcess.cpp:
3340         (WebKit::NetworkProcess::setCacheModel):
3341         * NetworkProcess/NetworkProcess.h:
3342         * NetworkProcess/NetworkProcessCreationParameters.cpp:
3343         (WebKit::NetworkProcessCreationParameters::encode const):
3344         (WebKit::NetworkProcessCreationParameters::decode):
3345         * NetworkProcess/NetworkProcessCreationParameters.h:
3346         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3347         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
3348         (WebKit::NetworkProcess::clearDiskCache):
3349         (WebKit::NetworkProcess::platformSetURLCacheSize): Deleted.
3350         (WebKit::clearNSURLCache): Deleted.
3351         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
3352         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3353         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
3354         (): Deleted.
3355         (WebKit::NetworkSessionCocoa::setUsesNetworkCache): Deleted.
3356         * NetworkProcess/curl/NetworkProcessCurl.cpp:
3357         (WebKit::NetworkProcess::platformSetURLCacheSize): Deleted.
3358         * NetworkProcess/soup/NetworkProcessSoup.cpp:
3359         (WebKit::NetworkProcess::platformSetURLCacheSize): Deleted.
3360         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3361         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
3362         (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
3363         (WebKit::WebProcessPool::isNetworkCacheEnabled): Deleted.
3364         * UIProcess/WebProcessPool.h:
3365         * WebProcess/WebPage/WebFrame.cpp:
3366         (WebKit::WebFrame::suggestedFilenameForResourceWithURL const):
3367         (WebKit::WebFrame::mimeTypeForResourceWithURL const):
3368         * WebProcess/WebPage/WebPage.cpp:
3369         (WebKit::WebPage::getResourceDataFromFrame):
3370         (WebKit::WebPage::hasLocalDataForURL):
3371         * WebProcess/WebPage/WebPage.h:
3372         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
3373         (WebKit::WebPage::platformHasLocalDataForURL): Deleted.
3374         (WebKit::WebPage::cachedResponseMIMETypeForURL): Deleted.
3375         (WebKit::WebPage::cachedSuggestedFilenameForURL): Deleted.
3376         (WebKit::WebPage::cachedResponseDataForURL): Deleted.
3377         * WebProcess/WebPage/ios/WebPageIOS.mm:
3378         (WebKit::WebPage::platformHasLocalDataForURL): Deleted.
3379         (WebKit::WebPage::cachedSuggestedFilenameForURL): Deleted.
3380         (WebKit::WebPage::cachedResponseMIMETypeForURL): Deleted.
3381         (WebKit::WebPage::cachedResponseDataForURL): Deleted.
3382         * WebProcess/WebPage/mac/WebPageMac.mm:
3383         (WebKit::WebPage::accessibilityRemoteObject):
3384         (WebKit::WebPage::platformHasLocalDataForURL): Deleted.
3385         (WebKit::cachedResponseForURL): Deleted.
3386         (WebKit::WebPage::cachedSuggestedFilenameForURL): Deleted.
3387         (WebKit::WebPage::cachedResponseMIMETypeForURL): Deleted.
3388         (WebKit::WebPage::cachedResponseDataForURL): Deleted.
3389         * WebProcess/WebPage/win/WebPageWin.cpp:
3390         (WebKit::WebPage::platformHasLocalDataForURL): Deleted.
3391         (WebKit::WebPage::cachedResponseMIMETypeForURL): Deleted.
3392         (WebKit::WebPage::cachedSuggestedFilenameForURL): Deleted.
3393         (WebKit::WebPage::cachedResponseDataForURL): Deleted.
3394         * WebProcess/WebPage/wpe/WebPageWPE.cpp:
3395         (WebKit::WebPage::platformHasLocalDataForURL): Deleted.
3396         (WebKit::WebPage::cachedResponseMIMETypeForURL): Deleted.
3397         (WebKit::WebPage::cachedSuggestedFilenameForURL): Deleted.
3398         (WebKit::WebPage::cachedResponseDataForURL): Deleted.
3399         * WebProcess/cocoa/WebProcessCocoa.mm:
3400         (WebKit::WebProcess::platformInitializeWebProcess):
3401
3402 2018-05-25  Alex Christensen  <achristensen@webkit.org>
3403
3404         Fix internal iOS builds after r232198
3405         https://bugs.webkit.org/show_bug.cgi?id=185986
3406
3407         * WebProcess/WebPage/ios/WebPageIOS.mm:
3408         (WebKit::WebPage::sendTapHighlightForNodeIfNecessary):
3409
3410 2018-05-25  Alex Christensen  <achristensen@webkit.org>
3411
3412         URL::host should return a StringView to reduce allocations
3413         https://bugs.webkit.org/show_bug.cgi?id=185986
3414
3415         Reviewed by Geoff Garen.
3416
3417         * NetworkProcess/NetworkProcess.cpp:
3418         (WebKit::fetchDiskCacheEntries):
3419         * NetworkProcess/NetworkResourceLoader.cpp:
3420         (WebKit::areFrameAncestorsSameSite):
3421         * NetworkProcess/mac/NetworkProcessMac.mm:
3422         (WebKit::overrideSystemProxies):
3423         * Shared/API/APIURL.h:
3424         (API::URL::host const):
3425         * UIProcess/Automation/WebAutomationSession.cpp:
3426         (WebKit::WebAutomationSession::addSingleCookie):
3427         (WebKit::WebAutomationSession::deleteAllCookies):
3428         * UIProcess/WebProcessProxy.cpp:
3429         (WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
3430         * WebProcess/Plugins/PluginView.cpp:
3431         (WebKit::PluginView::pluginDidReceiveUserInteraction):
3432         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
3433         (WebKit::WebPluginInfoProvider::populatePluginCache):
3434         * WebProcess/WebPage/WebPage.cpp:
3435         (WebKit::needsHiddenContentEditableQuirk):
3436         (WebKit::needsPlainTextQuirk):
3437         (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
3438
3439 2018-05-25  Adrian Perez de Castro  <aperez@igalia.com>
3440
3441         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.21.2 release.
3442
3443         * wpe/NEWS: Add release notes for the 2.21.2 release.
3444
3445 2018-05-25  Chris Dumez  <cdumez@apple.com>
3446
3447         Minor ApplicationCacheStorage clean up
3448         https://bugs.webkit.org/show_bug.cgi?id=185984
3449
<