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