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