[iOS] TestWebKitAPI.WebKit.WKHTTPCookieStoreWithoutProcessPool fails because cookies...
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2018-06-05  Sihui Liu  <sihui_liu@apple.com>
2
3         [iOS] TestWebKitAPI.WebKit.WKHTTPCookieStoreWithoutProcessPool fails because cookies aren't flushed to file
4         https://bugs.webkit.org/show_bug.cgi?id=186303
5         <rdar://problem/40468716>
6
7         Reviewed by Geoffrey Garen.
8
9         No matter there is an observer or not, cookies in UI process should always be flushed to 
10         file when new process pool is created, such that cookies created via API can be synced to
11         network process.
12
13         * UIProcess/API/APIHTTPCookieStore.cpp:
14         (API::HTTPCookieStore::HTTPCookieStore):
15         (API::HTTPCookieStore::registerObserver):
16         (API::HTTPCookieStore::cookieManagerDestroyed):
17         (API::HTTPCookieStore::registerForNewProcessPoolNotifications):
18
19 2018-06-05  Jeremy Jones  <jeremyj@apple.com>
20
21         secheuristic should only use touch began and ended, not changed.
22         https://bugs.webkit.org/show_bug.cgi?id=186318
23         rdar://problem/39781486
24
25         Reviewed by Jer Noble.
26
27         Filter out change events so swiping gestures don't trigger the heuristic.
28
29         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
30         (-[WKFullScreenViewController _touchDetected:]):
31
32 2018-06-05  Darin Adler  <darin@apple.com>
33
34         [Cocoa] More preparation for ARC, focusing on WebKit and smart pointers
35         https://bugs.webkit.org/show_bug.cgi?id=186314
36
37         Reviewed by Anders Carlsson.
38
39         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
40         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): Use __bridge for cast.
41         * NetworkProcess/mac/NetworkProcessMac.mm:
42         (WebKit::overrideSystemProxies): Ditto.
43         (WebKit::NetworkProcess::allowSpecificHTTPSCertificateForHost): Ditto.
44         * Platform/IPC/mac/ConnectionMac.mm:
45         (IPC::Connection::sendMessage): Ditto.
46         (IPC::readFromMachPort): Ditto.
47
48         * Platform/mac/StringUtilities.mm:
49         (WebKit::formattedPhoneNumberString): Use __bridge for cast and
50         CFBridgingRelease instead of an explicit autorelease.
51
52         * Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
53         (initializeMethods): Use auto instead of an explicit type so that we get
54         the correct type for the result of protocol_copyProtocolList.
55
56         * Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
57         (-[_WKRemoteObjectRegistry _sendInvocation:interface:]): Added a
58         bridging cast to void* because that's needed to call _Block_signature
59         under ARC and harmless outside ARC.
60
61         * Shared/API/c/cf/WKStringCF.mm:
62         (WKStringCreateWithCFString): Use __bridge for cast.
63         * Shared/API/c/cf/WKURLCF.mm:
64         (WKURLCreateWithCFURL): Ditto.
65         * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
66         (WebKit::AuthenticationManager::initializeConnection): Ditto.
67         * Shared/Cocoa/DataDetectionResult.mm:
68         (WebKit::DataDetectionResult::encode const): Ditto.
69         (WebKit::DataDetectionResult::decode): Ditto.
70         * Shared/Cocoa/WKNSError.mm:
71         (-[WKNSError _web_createTarget]): Ditto.
72         * Shared/Cocoa/WKNSURLExtras.mm:
73         (-[NSURL _web_originalDataAsWTFString]): Ditto.
74
75         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
76         (WebKit::XPCServiceInitializer): Removed balanced calls to both
77         adoptOSObject and xpc_retain and instead rely on the assignment
78         operator just added to OSObjectPtr.
79
80         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
81         (WebKit::XPCServiceEventHandler): Use __bridge for cast.
82         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
83         (WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer): Ditto.
84         * Shared/cf/ArgumentCodersCF.cpp:
85         (IPC::decode): Ditto.
86         * Shared/mac/ArgumentCodersMac.mm:
87         (IPC::isSerializableValue): Ditto.
88         (IPC::encode): Ditto.
89         * Shared/mac/WebCoreArgumentCodersMac.mm:
90         (IPC::encodeNSError): Ditto. Also use CFSTR("")" instead of @""
91         when we need a CFString.
92         (IPC::decodeNSError): Ditto.
93         (IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData): Ditto.
94         (IPC::ArgumentCoder<ProtectionSpace>::decodePlatformData): Ditto.
95         (IPC::ArgumentCoder<Credential>::encodePlatformData): Ditto.
96         (IPC::ArgumentCoder<Credential>::decodePlatformData): Ditto.
97         (IPC::ArgumentCoder<ContentFilterUnblockHandler>::encode): Ditto.
98         (IPC::ArgumentCoder<ContentFilterUnblockHandler>::decode): Ditto.
99         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::encodePlatformData): Ditto.
100         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::decodePlatformData): Ditto.
101         * Shared/mac/WebHitTestResultData.mm:
102         (WebKit::WebHitTestResultData::platformEncode const): Ditto.
103         (WebKit::WebHitTestResultData::platformDecode): Ditto.
104         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
105         (WKContextIsPlugInUpdateAvailable): Ditto.
106         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
107         (-[WKBrowsingContextController certificateChain]): Ditto.
108         (didStartProvisionalLoadForFrame): Ditto.
109         (didReceiveServerRedirectForProvisionalLoadForFrame): Ditto.
110         (didFailProvisionalLoadWithErrorForFrame): Ditto.
111         (didCommitLoadForFrame): Ditto.
112         (didFinishLoadForFrame): Ditto.
113         (didFailLoadWithErrorForFrame): Ditto.
114         (canAuthenticateAgainstProtectionSpaceInFrame): Ditto.
115         (didReceiveAuthenticationChallengeInFrame): Ditto.
116         (didStartProgress): Ditto.
117         (didChangeProgress): Ditto.
118         (didFinishProgress): Ditto.
119         (didChangeBackForwardList): Ditto.
120         (processDidCrash): Ditto.
121         (setUpPageLoaderClient): Ditto.
122         (setUpPagePolicyClient): Ditto.
123         * UIProcess/API/Cocoa/WKBrowsingContextGroup.mm:
124         (createWKArray): Ditto.
125         (-[WKBrowsingContextGroup addUserStyleSheet:baseURL:whitelistedURLPatterns:blacklistedURLPatterns:mainFrameOnly:]): Ditto.
126         (-[WKBrowsingContextGroup addUserScript:baseURL:whitelistedURLPatterns:blacklistedURLPatterns:injectionTime:mainFrameOnly:]): Ditto.
127         * UIProcess/API/Cocoa/WKConnection.mm:
128         (didReceiveMessage): Ditto.
129         (didClose): Ditto.
130         (setUpClient): Ditto.
131         * UIProcess/API/Cocoa/WKProcessGroup.mm:
132         (didCreateConnection): Ditto.
133         (getInjectedBundleInitializationUserData): Ditto.
134         (setUpInjectedBundleClient): Ditto.
135         (-[WKProcessGroup _setAllowsSpecificHTTPSCertificate:forHost:]): Ditto.
136         * UIProcess/API/Cocoa/WKProcessPool.mm:
137         (-[WKProcessPool _setAllowsSpecificHTTPSCertificate:forHost:]): Ditto.
138         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
139         (-[WKWebsiteDataStore _setProxyConfiguration:]): Ditto.
140         (-[WKWebsiteDataStore _proxyConfiguration]): Ditto.
141         * UIProcess/API/Cocoa/_WKThumbnailView.mm:
142         (-[_WKThumbnailView _didTakeSnapshot:]): Ditto.
143
144         * UIProcess/API/Cocoa/_WKUserContentFilter.mm: Added a missing include.
145
146         * UIProcess/Authentication/mac/WebCredentialMac.mm:
147         (WebKit::chain): Use __bridge for cast.
148
149         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
150         (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
151         Use CFBridgingRelease instead of adoptNS.
152         (WebKit::privateBrowsingSession): Use __bridge for cast.
153
154         * UIProcess/Cocoa/WebViewImpl.mm:
155         (WebKit::WebViewImpl::provideDataForPasteboard): Use __bridge for cast.
156         * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
157         (WebKit::PluginInfoStore::pluginPathsInDirectory): Ditto.
158         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
159         (WebKit::recursivelyMapIOSurfaceBackingStore): Ditto.
160         * UIProcess/mac/ViewGestureControllerMac.mm:
161         (WebKit::ViewGestureController::beginSwipeGesture): Ditto.
162         * UIProcess/mac/WKFullScreenWindowController.mm:
163         (-[WKFullScreenWindowController enterFullScreen:]): Ditto.
164         * UIProcess/mac/WebPopupMenuProxyMac.mm:
165         (WebKit::WebPopupMenuProxyMac::showPopupMenu): Ditto.
166         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm:
167         (didCreatePage): Ditto.
168         (willDestroyPage): Ditto.
169         (setUpBundleClient): Ditto.
170         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
171         (didStartProvisionalLoadForFrame): Ditto.
172         (didReceiveServerRedirectForProvisionalLoadForFrame): Ditto.
173         (didFinishLoadForFrame): Ditto.
174         (globalObjectIsAvailableForFrame): Ditto.
175         (didRemoveFrameFromHierarchy): Ditto.
176         (didCommitLoadForFrame): Ditto.
177         (didFinishDocumentLoadForFrame): Ditto.
178         (didFailProvisionalLoadWithErrorForFrame): Ditto.
179         (didFailLoadWithErrorForFrame): Ditto.
180         (didSameDocumentNavigationForFrame): Ditto.
181         (didLayoutForFrame): Ditto.
182         (didReachLayoutMilestone): Ditto.
183         (didFirstVisuallyNonEmptyLayoutForFrame): Ditto.
184         (didHandleOnloadEventsForFrame): Ditto.
185         (userAgentForURL): Ditto.
186         (setUpPageLoaderClient): Ditto.
187         (willSendRequestForFrame): Ditto.
188         (didInitiateLoadForResource): Ditto.
189         (didFinishLoadForResource): Ditto.
190         (didFailLoadForResource): Ditto.
191         (setUpResourceLoadClient): Ditto.
192         * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
193         (WebKit::InjectedBundle::initialize): Ditto.
194         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
195         (WebKit::NetscapePlugin::popUpContextMenu): Ditto.
196
197         * WebProcess/Plugins/PDF/PDFPlugin.h: Put functions that return NSData inside
198         an #ifdef __OBJC__ and use __bridge for cast.
199
200         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
201         (WebKit::WebDragClient::declareAndWriteDragImage): Use __bridge for cast.
202
203         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm:
204         (WebKit::PlatformCALayerRemoteCustom::contents const): Added a bridging cast.
205         (WebKit::PlatformCALayerRemoteCustom::setContents): Use __bridge for cast.
206         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
207         (WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom): Ditto.
208         * WebProcess/WebPage/mac/WebPageMac.mm:
209         (WebKit::WebPage::setTopOverhangImage): Ditto.
210         (WebKit::WebPage::setBottomOverhangImage): Ditto.
211
212 2018-06-05  Youenn Fablet  <youenn@apple.com>
213
214         ServiceWorker registration should store any script fetched through importScripts
215         https://bugs.webkit.org/show_bug.cgi?id=182444
216         <rdar://problem/37164835>
217
218         Reviewed by Chris Dumez.
219
220         Add C API to kill storage process.
221         In case a Storage Process is closed or crashed, ensure that all its related service worker processes also exit.
222
223         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
224         * UIProcess/API/C/WKContext.cpp:
225         (WKContextTerminateStorageProcess):
226         * UIProcess/API/C/WKContextPrivate.h:
227         * WebProcess/WebProcess.cpp:
228         (WebKit::WebProcess::webToStorageProcessConnectionClosed):
229         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
230         (WebKit::WebSWContextManagerConnection::setScriptResource):
231         * WebProcess/Storage/WebSWContextManagerConnection.h:
232
233 2018-06-05  Brent Fulgham  <bfulgham@apple.com>
234
235         Revise DEFAULT_EXPERIMENTAL_FEATURES_ENABLED to work properly on Apple builds
236         https://bugs.webkit.org/show_bug.cgi?id=186286
237         <rdar://problem/40782992>
238
239         Reviewed by Dan Bernstein.
240
241         Use the WK_RELOCATABLE_FRAMEWORKS flag (which is always defined for non-production builds)
242         to define ENABLE(EXPERIMENTAL_FEATURES) so that we do not need to manually
243         change this flag when preparing for a production release.
244
245         * Configurations/FeatureDefines.xcconfig: Use WK_RELOCATABLE_FRAMEWORKS to determine whether
246         experimental features should be enabled, and use it to properly define the feature flag.
247         * Shared/WebPreferencesDefaultValues.h:
248
249 2018-06-04  Chris Dumez  <cdumez@apple.com>
250
251         Rename "Cross-Origin-Options" HTTP header to "Cross-Origin-Window-Policy"
252         https://bugs.webkit.org/show_bug.cgi?id=186287
253         <rdar://problem/40783352>
254
255         Reviewed by Youenn Fablet.
256
257         * Shared/WebPreferences.yaml:
258         * WebProcess/WebPage/WebPage.cpp:
259         (WebKit::WebPage::frameBecameRemote):
260
261 2018-06-04  Dan Bernstein  <mitz@apple.com>
262
263         Restored code signing behavior when WK_USE_RESTRICTED_ENTITLEMENTS isn’t set.
264
265         * Configurations/DebugRelease.xcconfig: Use ad-hoc code signing when
266           WK_USE_RESTRICTED_ENTITLEMENTS isn’t set.
267
268 2018-06-04  Dan Bernstein  <mitz@apple.com>
269
270         Removed a reference to a file that was deleted in r231190.
271
272         * WebKit.xcodeproj/project.pbxproj: Removed the reference to WebProcessShim.xcconfig.
273
274 2018-06-04  Chris Dumez  <cdumez@apple.com>
275
276         Update Fetch code to provide more useful exception messages
277         https://bugs.webkit.org/show_bug.cgi?id=186156
278
279         Reviewed by Youenn Fablet.
280
281         Provide more useful error messages in our Loading / Fetch code.
282
283         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
284         (WebKit::WebSWServerConnection::didFailFetch):
285         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
286         * StorageProcess/StorageProcess.cpp:
287         (WebKit::StorageProcess::didFailFetch):
288         * StorageProcess/StorageProcess.h:
289         * StorageProcess/StorageProcess.messages.in:
290         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
291         (WebKit::ServiceWorkerClientFetch::didFail):
292         (WebKit::ServiceWorkerClientFetch::continueLoadingAfterCheckingResponse):
293         * WebProcess/Storage/ServiceWorkerClientFetch.h:
294         * WebProcess/Storage/ServiceWorkerClientFetch.messages.in:
295         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
296         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveFormDataAndFinish):
297         (WebKit::WebServiceWorkerFetchTaskClient::didFail):
298         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:
299
300 2018-06-04  Wenson Hsieh  <wenson_hsieh@apple.com>
301
302         [WebKit on watchOS] Remove all uses of the EXTRA_ZOOM_MODE compiler flag
303         https://bugs.webkit.org/show_bug.cgi?id=186279
304
305         Reviewed by Tim Horton.
306
307         Replaces uses of ENABLE(EXTRA_ZOOM_MODE) with PLATFORM(WATCHOS).
308
309         * Shared/WebPreferencesDefaultValues.h:
310         * UIProcess/API/Cocoa/WKWebView.mm:
311         (-[WKWebView _initializeWithConfiguration:]):
312         (-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):
313         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
314         (-[WKWebViewConfiguration init]):
315         * UIProcess/WebProcessProxy.cpp:
316         * UIProcess/WebProcessProxy.h:
317         * UIProcess/ios/WKContentViewInteraction.h:
318         * UIProcess/ios/WKContentViewInteraction.mm:
319         (-[WKContentView _willStartScrollingOrZooming]):
320         (-[WKContentView _didEndScrollingOrZooming]):
321         (-[WKContentView _startAssistingKeyboard]):
322         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
323         (-[WKContentView _stopAssistingNode]):
324         (-[WKContentView reloadContextViewForPresentedListViewController]):
325         (-[WKContentView _wheelChangedWithEvent:]):
326         (-[WKContentView _simulateTextEntered:]):
327         (-[WKContentView selectFormAccessoryPickerRow:]):
328         (-[WKContentView formInputLabel]):
329         (-[WKContentView setTimePickerValueToHour:minute:]):
330         * UIProcess/ios/WKScrollView.mm:
331         (-[WKScrollView initWithFrame:]):
332         (-[WKScrollView addGestureRecognizer:]):
333         * UIProcess/ios/forms/WKFileUploadPanel.mm:
334         (-[WKFileUploadPanel platformSupportsPickerViewController]):
335         * WebProcess/WebPage/ios/WebPageIOS.mm:
336         (WebKit::WebPage::platformPrefersTextLegibilityBasedZoomScaling const):
337
338 2018-06-04  Jeremy Jones  <jeremyj@apple.com>
339
340         Disable keyboard in fullscreen ios.
341         https://bugs.webkit.org/show_bug.cgi?id=186058
342
343         Reviewed by Jer Noble.
344
345         Disallow keyboard in ios fullscreen. This will still allow select keys useful for playback.
346
347         * UIProcess/WebFullScreenManagerProxy.cpp:
348         (WebKit::WebFullScreenManagerProxy::supportsFullScreen):
349
350 2018-06-04  Youenn Fablet  <youenn@apple.com>
351
352         NetworkCORSPreflightChecker should set the preflight request User-Agent header
353         https://bugs.webkit.org/show_bug.cgi?id=186254
354         <rdar://problem/40293504>
355
356         Reviewed by Chris Dumez.
357
358         Some servers misbehave if the User-Agent header is not set properly on preflight requests.
359         Set it to the same value as the request triggering the preflight.
360
361         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
362         (WebKit::NetworkCORSPreflightChecker::startPreflight):
363         * NetworkProcess/NetworkCORSPreflightChecker.h:
364         * NetworkProcess/NetworkLoadChecker.cpp:
365         (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
366
367 2018-06-03  Andy Estes  <aestes@apple.com>
368
369         [Wi-Fi Assertions] Resume assertions when NetworkProcess::cancelPrepareToSuspend is called
370         https://bugs.webkit.org/show_bug.cgi?id=186247
371
372         Reviewed by Tim Horton.
373
374         Since we suspended assertions in prepareToSuspend, we need to resume them if
375         cancelPrepareToSuspend is called.
376
377         * NetworkProcess/NetworkProcess.cpp:
378         (WebKit::NetworkProcess::cancelPrepareToSuspend):
379
380 2018-06-03  Andy Estes  <aestes@apple.com>
381
382         [iOS] Add a needed networking process entitlement
383         https://bugs.webkit.org/show_bug.cgi?id=186246
384         <rdar://problem/39578861>
385
386         Reviewed by Brent Fulgham.
387
388         Also sorted the existing entitlements.
389
390         * Configurations/Network-iOS.entitlements:
391
392 2018-06-03  Brent Fulgham  <bfulgham@apple.com>
393
394         Make sure that the fencePort received over IPC has the expected disposition (SEND)
395         https://bugs.webkit.org/show_bug.cgi?id=186211
396         <rdar://problem/37814171>
397
398         Reviewed by Geoffrey Garen.
399
400         It is possible (though very unlikely) for a message to be recevied that has the wrong mach port disposition.
401         If this happens, we shouldn't manipulate the passed mach_port_t or pass it on to other API. We already
402         drop messages that violate this expectation in the IPC layer, but code handling IPC::Attachment data types
403         are not checking this value.
404
405         * WebProcess/WebPage/WebPage.cpp:
406         (WebKit::WebPage::setTopContentInsetFenced):
407         * WebProcess/cocoa/VideoFullscreenManager.mm:
408         (WebKit::VideoFullscreenManager::setVideoLayerFrameFenced):
409
410 2018-06-02  Chris Dumez  <cdumez@apple.com>
411
412         Unreviewed, rolling out r232275.
413
414         May have caused a ~1% PLT regression on iOS
415
416         Reverted changeset:
417
418         "Store 0-lifetime stylesheets / scripts into the disk cache
419         for faster history navigations"
420         https://bugs.webkit.org/show_bug.cgi?id=186060
421         https://trac.webkit.org/changeset/232275
422
423 2018-06-02  Jeremy Jones  <jeremyj@apple.com>
424
425         Make WKWebView firstResponder after entering or exiting fullscreen.
426         https://bugs.webkit.org/show_bug.cgi?id=186088
427         rdar://problem/40387859
428
429         Reviewed by Jer Noble.
430
431         Update first responder when WKWebView moves to a new window, otherwise there won't be a first responder.
432
433         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
434         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
435         (-[WKFullScreenWindowController _completedExitFullScreen]):
436
437 2018-06-02  Jeremy Jones  <jeremyj@apple.com>
438
439         Exit fullscreen when javascript alerts are presented.
440         https://bugs.webkit.org/show_bug.cgi?id=185619
441         rdar://problem/35724264
442
443         Reviewed by Jer Noble.
444
445         Prevent users from being trapped in fullscreen by alert cycles.
446         Prevent fullscreen from becoming unresponsive due to alerts hidden behind fullscreen.
447
448         Fullscreen exit is initiated here in the UI process so that fullscreen UI is torn down immediately,
449         before the alert is shown.
450
451         * UIProcess/WebPageProxy.cpp:
452         (WebKit::WebPageProxy::exitFullscreenImmediately):
453         (WebKit::WebPageProxy::runJavaScriptAlert):
454         (WebKit::WebPageProxy::runJavaScriptConfirm):
455         (WebKit::WebPageProxy::runJavaScriptPrompt):
456         * UIProcess/WebPageProxy.h:
457
458 2018-06-02  Youenn Fablet  <youenn@apple.com>
459
460         Add a sandbox profile for com.cisco.webex.plugin.gpc64 plugin
461         https://bugs.webkit.org/show_bug.cgi?id=186110
462
463         Reviewed by Brent Fulgham.
464
465         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: Webex needs to create some symlinks.
466         * Resources/PlugInSandboxProfiles/com.cisco.webex.plugin.gpc64.sb: Added.
467         * WebKit.xcodeproj/project.pbxproj:
468
469 2018-06-01  Wenson Hsieh  <wenson_hsieh@apple.com>
470
471         [Extra zoom mode] The user should always be able to double tap to zoom to a scale of at least 1
472         https://bugs.webkit.org/show_bug.cgi?id=186209
473         <rdar://problem/40529255>
474
475         Reviewed by Tim Horton.
476
477         Tweaks the way double-tap-to-zoom scales are determined in extra zoom mode. Rather than zooming to make the 50th
478         and 90th percentiles of text in the document legible, only consider the 90th percentile of text size when
479         determining zoom scale, and fix the other potential zoom scale at 1; additionally, if the zoom scales are close
480         (within 0.3 of each other), snap the lower zoom scale to the higher value.
481
482         This results in the following changes in behavior:
483         -   Enables double tap to zoom in cases where all the text in the page is already legible.
484         -   On pages with mobile viewports, usually allows the user to toggle between initial scale and a scale of 1.
485         -   If a significant portion of text is unusually small, the zoomed-in scale may exceed 1.
486
487         Test: fast/events/extrazoom/double-tap-to-zoom-with-large-text.html
488
489         * WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
490         (WebKit::ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture):
491         (WebKit::ViewGestureGeometryCollector::computeTextLegibilityScales):
492
493 2018-06-01  Jeremy Jones  <jeremyj@apple.com>
494
495         Keyboard focus should exit fullscreen.
496         https://bugs.webkit.org/show_bug.cgi?id=185617
497         rdar://problem/34697938
498
499         Reviewed by Ryosuke Niwa.
500
501         While in element fullscreen, initiating keyboard focus should exit fullscreen in iOS.
502
503         * WebProcess/WebPage/WebPage.cpp:
504         (WebKit::WebPage::elementDidFocus):
505
506 2018-06-01  Chris Dumez  <cdumez@apple.com>
507
508         Regression(r230567): Unable to log into twitter.com in private sessions
509         https://bugs.webkit.org/show_bug.cgi?id=186205
510         <rdar://problem/40670799>
511
512         Reviewed by Youenn Fablet.
513
514         We were using the same SWServer for all private sessions and the SWServer's sessionID would
515         be legacyPrivateSessionID(). As a result, the service worker's sessionID would be legacyPrivateSessionID()
516         as well and would not match the sessionID of its client pages. This sessionID mismatch was 
517         causing the breakage.
518
519         Instead of using the same SWServer of all private sessions, we now go back to using a SWServer
520         per private session. However, we now make sure that the SWServer gets destroyed whenever its
521         corresponding session gets destroyed.
522
523         * NetworkProcess/NetworkProcess.cpp:
524         (WebKit::NetworkProcess::destroySession):
525         * NetworkProcess/cache/CacheStorageEngine.cpp:
526         (WebKit::CacheStorage::Engine::from):
527         * StorageProcess/StorageProcess.cpp:
528         (WebKit::StorageProcess::destroySession):
529         (WebKit::StorageProcess::swServerForSession):
530         * StorageProcess/StorageProcess.h:
531         * StorageProcess/StorageProcess.messages.in:
532         * UIProcess/WebProcessPool.cpp:
533         (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
534         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
535         (WebKit::WebsiteDataStore::~WebsiteDataStore):
536
537         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
538         * UIProcess/WebsiteData/WebsiteDataStore.h:
539         (WebKit::WebsiteDataStore::weakPtrFactory const):
540         Fix memory leak caused by a reference cycle between the WebsiteDataStore and its
541         WebResourceLoadStatisticsStore, by using WeakPtr to break the cycle. This was causing
542         us to leak WebsiteDataStore objects, which would prevent the destruction of sessions.
543
544
545 2018-06-01  Youenn Fablet  <youenn@apple.com>
546
547         Add an option to restrict communication to localhost sockets
548         https://bugs.webkit.org/show_bug.cgi?id=186208
549
550         Reviewed by Eric Carlson.
551
552         Implement restriction to localhost sockets by setting any IP address to 127.0.0.1.
553         This is done on WebProcess side just before requesting to open the socket by NetworkProcess.
554
555         * WebProcess/Network/webrtc/LibWebRTCNetwork.h:
556         (WebKit::LibWebRTCNetwork::disableNonLocalhostConnections):
557         * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
558         (WebKit::LibWebRTCProvider::disableNonLocalhostConnections):
559         (WebKit::LibWebRTCProvider::registerMDNSName):
560         * WebProcess/Network/webrtc/LibWebRTCProvider.h:
561         * WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp:
562         (WebKit::prepareSocketAddress):
563         (WebKit::LibWebRTCSocketFactory::CreateServerTcpSocket):
564         (WebKit::LibWebRTCSocketFactory::CreateUdpSocket):
565         (WebKit::LibWebRTCSocketFactory::CreateClientTcpSocket):
566         * WebProcess/Network/webrtc/LibWebRTCSocketFactory.h:
567
568 2018-06-01  Chris Dumez  <cdumez@apple.com>
569
570         Regression(r230876): Swipe navigation snapshot may get removed too early
571         https://bugs.webkit.org/show_bug.cgi?id=186168
572         <rdar://problem/39743617>
573
574         Reviewed by Tim Horton.
575
576         The swipe navigation snapshot would get removed too early when receiving a paint
577         event after requesting a history navigation but before the provisional load has
578         actually started. This is because of the asynchronous navigation policy decision
579         which occurs after requesting to navigate. To address the issue, we now start
580         listening for events only after the provisional load has started.
581
582         * UIProcess/API/Cocoa/WKWebView.mm:
583         (-[WKWebView _didStartProvisionalLoadForMainFrame]):
584         * UIProcess/API/Cocoa/WKWebViewInternal.h:
585         * UIProcess/Cocoa/ViewGestureController.cpp:
586         (WebKit::ViewGestureController::didStartProvisionalLoadForMainFrame):
587         (WebKit::ViewGestureController::didReachMainFrameLoadTerminalState):
588         (WebKit::ViewGestureController::didSameDocumentNavigationForMainFrame):
589         * UIProcess/Cocoa/ViewGestureController.h:
590         * UIProcess/ios/PageClientImplIOS.mm:
591         (WebKit::PageClientImpl::didStartProvisionalLoadForMainFrame):
592         * UIProcess/ios/ViewGestureControllerIOS.mm:
593         (WebKit::ViewGestureController::endSwipeGesture):
594         * UIProcess/mac/PageClientImplMac.h:
595         * UIProcess/mac/PageClientImplMac.mm:
596         (WebKit::PageClientImpl::didStartProvisionalLoadForMainFrame):
597         * UIProcess/mac/ViewGestureControllerMac.mm:
598         (WebKit::ViewGestureController::endSwipeGesture):
599
600 2018-06-01  Jiewen Tan  <jiewen_tan@apple.com>
601
602         Unreviewed, build fix for r232276.
603
604         iOS sandbox profiles don't preprocess macros. Therefore, remove the whole
605         macro condition block.
606
607         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
608
609 2018-06-01  Sihui Liu  <sihui_liu@apple.com>
610
611         Stop using StorageTracker.db in LocalStorageDatabaseTracker
612         https://bugs.webkit.org/show_bug.cgi?id=186104
613
614         Reviewed by Geoffrey Garen.
615
616         Stop using StorageTracker.db and stop caching origins in LocalStorageDatabaseTracker for efficiency 
617         and simplicity. Since functions in LocalStorageDatabaseTracker are not frequently called, we get 
618         little benefits from caching origins.
619
620         * Platform/Logging.h:
621         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
622         (WKKeyValueStorageManagerGetStorageDetailsByOrigin):
623         * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
624         (WebKit::LocalStorageDatabaseTracker::LocalStorageDatabaseTracker):
625         (WebKit::LocalStorageDatabaseTracker::didOpenDatabaseWithOrigin):
626         (WebKit::LocalStorageDatabaseTracker::deleteDatabaseWithOrigin):
627         (WebKit::LocalStorageDatabaseTracker::deleteAllDatabases):
628         (WebKit::LocalStorageDatabaseTracker::databasesModifiedSince):
629         (WebKit::LocalStorageDatabaseTracker::origins const):
630         (WebKit::LocalStorageDatabaseTracker::originDetails):
631         (WebKit::LocalStorageDatabaseTracker::databasePath const):
632         (WebKit::fileCreationTime): Deleted.
633         (WebKit::fileModificationTime): Deleted.
634         (WebKit::LocalStorageDatabaseTracker::trackerDatabasePath const): Deleted.
635         (WebKit::LocalStorageDatabaseTracker::openTrackerDatabase): Deleted.
636         (WebKit::LocalStorageDatabaseTracker::importOriginIdentifiers): Deleted.
637         (WebKit::LocalStorageDatabaseTracker::updateTrackerDatabaseFromLocalStorageDatabaseFiles): Deleted.
638         (WebKit::LocalStorageDatabaseTracker::addDatabaseWithOriginIdentifier): Deleted.
639         (WebKit::LocalStorageDatabaseTracker::removeDatabaseWithOriginIdentifier): Deleted.
640         (WebKit::LocalStorageDatabaseTracker::pathForDatabaseWithOriginIdentifier): Deleted.
641         * UIProcess/WebStorage/LocalStorageDatabaseTracker.h:
642         * UIProcess/WebStorage/StorageManager.h:
643
644 2018-06-01  Michael Catanzaro  <mcatanzaro@igalia.com>
645
646         [GTK] Crash in WebKitFaviconDatabase when pageURL is unset
647         https://bugs.webkit.org/show_bug.cgi?id=186164
648
649         Reviewed by Carlos Garcia Campos.
650
651         PageURL can legitimately be null here if JavaScript does something silly with window.open.
652
653         * UIProcess/API/glib/WebKitFaviconDatabase.cpp:
654         (webkitFaviconDatabaseSetIconURLForPageURL):
655         (webkitFaviconDatabaseSetIconForPageURL):
656
657 2018-05-31  Brian Burg  <bburg@apple.com>
658
659         [Cocoa] Web Automation: use the session delegate to perform window maximize
660         https://bugs.webkit.org/show_bug.cgi?id=186167
661         <rdar://problem/40544391>
662
663         Reviewed by Timothy Hatcher.
664
665         Add plumbing to hand off window maximizing to the session delegate.
666
667         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
668         * UIProcess/Cocoa/AutomationSessionClient.h:
669         * UIProcess/Cocoa/AutomationSessionClient.mm:
670         (WebKit::AutomationSessionClient::AutomationSessionClient):
671         (WebKit::AutomationSessionClient::requestMaximizeWindowOfPage):
672
673 2018-06-01  Carlos Garcia Campos  <cgarcia@igalia.com>
674
675         Unreviewed. Try to fix GTK+ build with old versions of GTK+ after r232390.
676
677         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
678         (WebKit::WebPopupMenuProxyGtk::showPopupMenu):
679
680 2018-06-01  Carlos Garcia Campos  <cgarcia@igalia.com>
681
682         [GTK] Switch to use a popup window with a tree view instead of a menu for option menu default implementation
683         https://bugs.webkit.org/show_bug.cgi?id=186146
684
685         Reviewed by Michael Catanzaro.
686
687         It's more convenient to use than the menu.
688
689         * UIProcess/API/gtk/WebKitPopupMenu.cpp:
690         (WebKit::menuCloseCallback):
691         (WebKit::WebKitPopupMenu::activateItem):
692         * UIProcess/API/gtk/WebKitPopupMenu.h:
693         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
694         (WebKit::WebPopupMenuProxyGtk::WebPopupMenuProxyGtk):
695         (WebKit::WebPopupMenuProxyGtk::selectItem):
696         (WebKit::WebPopupMenuProxyGtk::activateItem):
697         (WebKit::WebPopupMenuProxyGtk::activateItemAtPath):
698         (WebKit::WebPopupMenuProxyGtk::treeViewRowActivatedCallback):
699         (WebKit::WebPopupMenuProxyGtk::treeViewButtonReleaseEventCallback):
700         (WebKit::WebPopupMenuProxyGtk::buttonPressEventCallback):
701         (WebKit::WebPopupMenuProxyGtk::keyPressEventCallback):
702         (WebKit::WebPopupMenuProxyGtk::createPopupMenu):
703         (WebKit::WebPopupMenuProxyGtk::show):
704         (WebKit::WebPopupMenuProxyGtk::showPopupMenu):
705         (WebKit::WebPopupMenuProxyGtk::hidePopupMenu):
706         (WebKit::WebPopupMenuProxyGtk::cancelTracking):
707         (WebKit::WebPopupMenuProxyGtk::typeAheadFindIndex):
708         (WebKit::WebPopupMenuProxyGtk::typeAheadFind):
709         * UIProcess/gtk/WebPopupMenuProxyGtk.h:
710
711 2018-05-31  Per Arne Vollan  <pvollan@apple.com>
712
713         Add OpenGL display mask to WebPage creation parameters.
714         https://bugs.webkit.org/show_bug.cgi?id=186163
715         <rdar://problem/40634504>
716
717         Reviewed by Brent Fulgham.
718
719         To make sure the OpenGL display mask is always available, include it in the WebPage creation parameters.
720         The OpenGL display mask is sent to the WebProcess when the platform display ID changes, but that is not
721         early enough in all cases. If the OpenGL display mask is not set, only OpenGL software rendering is offered
722         on some hardware configurations.
723
724         * Shared/WebPageCreationParameters.cpp:
725         (WebKit::WebPageCreationParameters::encode const):
726         (WebKit::WebPageCreationParameters::decode):
727         * Shared/WebPageCreationParameters.h:
728         * UIProcess/WebPageProxy.cpp:
729         (WebKit::WebPageProxy::creationParameters):
730         * WebProcess/WebPage/WebPage.cpp:
731         (WebKit::m_credentialsMessenger):
732
733 2018-05-31  Brent Fulgham  <bfulgham@apple.com>
734
735         Add a rule to allow reading files with prefix /private/var/db/CVMS/cvmsCodeSignObj
736         https://bugs.webkit.org/show_bug.cgi?id=186157
737         <rdar://problem/40666437>
738
739         Reviewed by Eric Carlson.
740
741         * WebProcess/com.apple.WebProcess.sb.in:
742
743 2018-05-31  Megan Gardner  <megan_gardner@apple.com>
744
745         Add setting to allow override screen size to be disabled.
746         https://bugs.webkit.org/show_bug.cgi?id=186109
747
748         Reviewed by Andy Estes.
749
750         Pipe the needed settings through to WebCore.
751
752         * Shared/WebPreferences.yaml:
753         * UIProcess/WebPageProxy.cpp:
754         (WebKit::m_configurationPreferenceValues):
755
756 2018-05-31  Brent Fulgham  <bfulgham@apple.com>
757
758         [macOS] Add JIT entitlements to WebContent process and plugin process on macOS
759         https://bugs.webkit.org/show_bug.cgi?id=184485
760         <rdar://problem/37556535>
761
762         Reviewed by Dan Bernstein.
763
764         This patch builds on the changes from Bug 185526 to add support for a JIT entitlement. It makes the
765         following changes:
766
767         1. Adds a new 'WebContent-OSX.entitlements file that unconditionally adds the JIT entitlement for all builds.
768         2. Modifies the PluginService.entitlements to unconditionally add the JIT entitlement.
769
770         * Configurations/PluginService.entitlements: Updated to add the JIT entitlement.
771         * Configurations/WebContent-OSX.entitlements: Updated to add the JIT entitlement.
772         * Configurations/WebContentService.xcconfig: Updated to use the new 'WebContent-OSX.entitlements' file.
773         * WebKit.xcodeproj/project.pbxproj:
774
775 2018-05-31  Brent Fulgham  <bfulgham@apple.com>
776
777         Don't attempt to extend sandbox when running tests with mock media devices
778         https://bugs.webkit.org/show_bug.cgi?id=186150
779         <rdar://problem/40690875>
780
781         Reviewed by Alexey Proskuryakov.
782
783         Avoid attempting to issue a sandbox extension to actual media devices when
784         running with Mock capture devices.
785
786         Also handle the 'denyNextRequest' test state outside of the USE(APPLE_INTERNAL_SDK)
787         guards, since it is needed for Open Source builds as well.
788
789         * UIProcess/UserMediaProcessManager.cpp:
790         (WebKit::UserMediaProcessManager::willCreateMediaStream):
791
792 2018-05-31  Antti Koivisto  <antti@apple.com>
793
794         WebKit memory management: Safari jetsams on some websites when zooming and scrolling
795         https://bugs.webkit.org/show_bug.cgi?id=186091
796         <rdar://problem/36315010>
797
798         Reviewed by Geoff Garen.
799
800         When zooming a page rapidly the visible rect and the page zoom level may get momentarily out of sync.
801         When this happens we may generate tiles for a much larger area than needed and run out of memory
802         building the next layer tree transaction. Running out of memory is more likely if the page has lots of
803         tiled layers in addition to the main content layer.
804
805         We already have code for dealing with the scale mismatch for zoom-out case (where this would cause
806         visibly missing tiles). This patch enables the same exact adjustment for zoom-in case (where the
807         symptom is creating too many tiles).
808
809         * WebProcess/WebPage/ios/WebPageIOS.mm:
810         (WebKit::adjustExposedRectForNewScale):
811
812         Do some renames to make it clear that this can both expand and contract the visible rect.
813         Bail out if there is nothing to do.
814
815         (WebKit::WebPage::updateVisibleContentRects):
816
817         Call adjustExposedRectForNewScale directly and unconditionally.
818
819         (WebKit::adjustExposedRectForBoundedScale): Deleted.
820
821 2018-05-30  Yusuke Suzuki  <utatane.tea@gmail.com>
822
823         [JSC] Pass VM& parameter as much as possible
824         https://bugs.webkit.org/show_bug.cgi?id=186085
825
826         Reviewed by Saam Barati.
827
828         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
829         (WebKit::NPJSObject::hasMethod):
830         (WebKit::NPJSObject::construct):
831         (WebKit::NPJSObject::invoke):
832
833 2018-05-30  Brent Fulgham  <bfulgham@apple.com>
834
835         [macOS] WebProcess needs TCC entitlements for media capture (Take 2)
836         https://bugs.webkit.org/show_bug.cgi?id=185526
837         <rdar://problem/36674649>
838
839         Reviewed by Alexey Proskuryakov.
840
841         In Bug 181995 I added TCC entitlements for media capture to the macOS entitlements used for
842         relocatable builds. These changes also need to apply to system builds of WebKit.
843
844         Previously we had not needed an entitlements file for system builds of WebKit, so only provided
845         an entitlements file for our relocatable build targets. Now we need entitlements when building
846         on recent macOS targets using internal SDKs.
847
848         Since these various scenarios are beginning to multiple, this patch dynamically generates the
849         entitlements file.
850
851         This patch does the following:
852
853         1. Changes the "WebContent-OSX.entitlements" to hold the TCC entitlements needed for media capture, and rename
854            to "WebContent-OSX-restricted.entitlements".
855         2. Removes the unneeded "com.apple.private.xpc.domain-extension" from WebContent-OSX.entitlement, and dynamically
856            adds it using a new build step using the script 'process-webcontent-entitlements.sh'
857         3. Updates DebugRelease.xcconfig to use the 'Safari Engineering' signing key for internal builds.
858         4. Updates WebContentService.xcconfig to remove the CODE_SIGN_ENTITLEMENTS_OSX_WITH_XPC_DOMAIN_EXTENSION_YES target
859            since we no longer need a custom entitlement file for this case.
860         5. Updates WebContentService.Development.xcconfig to remove CODE_SIGN_ENTITLEMENTS_COCOA_TOUCH_NO since it is no
861            longer needed.
862         6. Deletes the file Configurations/WebContent.Development.entitlements since it is no longer needed.
863         7. Revises the WebContent process sandbox to allow camera and microphone access without needing TCC
864            entitlements, since those cannot be applied without an internal SDK.
865         8. Revises the UserMediaProcessManager to not pass dynamic sandbox extensions to the WebContent process
866            when building with the public SDK since those entitlements cannot be added or consumed in Open
867            Source builds.
868
869         We want to use the TCC entitlements when building with the internal SDK on recent macOS builds.
870
871         * Configurations/Base.xcconfig:
872         * Configurations/DebugRelease.xcconfig:
873         * Configurations/WebContent-OSX-restricted.entitlements: Renamed from Source/WebKit/Configurations/WebContent-OSX.entitlements.
874         * Configurations/WebContent.Development.entitlements: Removed.
875         * Configurations/WebContentService.Development.xcconfig:
876         * Configurations/WebContentService.xcconfig:
877         * Scripts/process-webcontent-entitlements.sh: Added.
878         * UIProcess/UserMediaProcessManager.cpp:
879         (WebKit::UserMediaProcessManager::willCreateMediaStream): Don't bother creating and sending sandbox extensions for
880         camera and microphone control for builds that cannot support them.
881         * WebKit.xcodeproj/project.pbxproj:
882
883 2018-05-30  Daniel Bates  <dabates@apple.com>
884
885         NavigationAction does not need to hold initiating DOM Event
886         https://bugs.webkit.org/show_bug.cgi?id=185958
887         <rdar://problem/40531539>
888
889         Reviewed by Simon Fraser.
890
891         Write in terms of NavigationAction::{keyStateEventData, mouseEventDataForFirstMouseEvent}().
892
893         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
894         (WebKit::mouseButtonForMouseEventData):
895         (WebKit::syntheticClickTypeForMouseEventData):
896         (WebKit::clickLocationInRootViewCoordinatesForMouseEventData):
897         (WebKit::InjectedBundleNavigationAction::modifiersForNavigationAction):
898         (WebKit::InjectedBundleNavigationAction::mouseButtonForNavigationAction):
899         (WebKit::InjectedBundleNavigationAction::syntheticClickTypeForNavigationAction):
900         (WebKit::InjectedBundleNavigationAction::clickLocationInRootViewCoordinatesForNavigationAction):
901         (WebKit::InjectedBundleNavigationAction::InjectedBundleNavigationAction):
902         (WebKit::mouseEventForNavigationAction): Deleted.
903         (WebKit::mouseButtonForMouseEvent): Deleted.
904         (WebKit::syntheticClickTypeForMouseEvent): Deleted.
905         (WebKit::clickLocationInRootViewCoordinatesForMouseEvent): Deleted.
906
907 2018-05-30  Andy Estes  <aestes@apple.com>
908
909         [Cocoa] Add an SPI to suppress connection termination errors from CFNetwork when network interfaces change
910         https://bugs.webkit.org/show_bug.cgi?id=186107
911         <rdar://problem/39338957>
912
913         Reviewed by Brady Eidson.
914
915         Added an SPI which configures a process pool's networking process to set the
916         kCFStreamPropertyAutoErrorOnSystemChange to NO on its NSURLSessionConfigurations.
917         This instructs CFNetwork to not terminate active connections when the system's
918         network interfaces change.
919
920         * NetworkProcess/NetworkProcess.h:
921         (WebKit::NetworkProcess::suppressesConnectionTerminationOnSystemChange const):
922         * NetworkProcess/NetworkProcessCreationParameters.cpp:
923         (WebKit::NetworkProcessCreationParameters::encode const):
924         (WebKit::NetworkProcessCreationParameters::decode):
925         * NetworkProcess/NetworkProcessCreationParameters.h:
926         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
927         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
928         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
929         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
930         * UIProcess/API/APIProcessPoolConfiguration.cpp:
931         (API::ProcessPoolConfiguration::copy):
932         * UIProcess/API/APIProcessPoolConfiguration.h:
933         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
934         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
935         (-[_WKProcessPoolConfiguration suppressesConnectionTerminationOnSystemChange]):
936         (-[_WKProcessPoolConfiguration setSuppressesConnectionTerminationOnSystemChange:]):
937         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
938         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
939
940 2018-05-30  Youenn Fablet  <youenn@apple.com>
941
942         Rename FromOrigin runtime flag to CrossOriginResourcePolicy and enable it by default
943         https://bugs.webkit.org/show_bug.cgi?id=186082
944
945         Reviewed by Chris Dumez.
946
947         * NetworkProcess/NetworkResourceLoadParameters.cpp:
948         (WebKit::NetworkResourceLoadParameters::encode const):
949         (WebKit::NetworkResourceLoadParameters::decode):
950         * NetworkProcess/NetworkResourceLoadParameters.h:
951         * Shared/WebPreferences.yaml:
952         * UIProcess/API/C/WKPreferences.cpp:
953         (WKPreferencesSetCrossOriginResourcePolicyEnabled):
954         (WKPreferencesGetCrossOriginResourcePolicyEnabled):
955         (WKPreferencesSetFromOriginResponseHeaderEnabled): Deleted.
956         (WKPreferencesGetFromOriginResponseHeaderEnabled): Deleted.
957         * UIProcess/API/C/WKPreferencesRef.h:
958         * WebProcess/Network/WebLoaderStrategy.cpp:
959         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
960
961 2018-05-30  Youenn Fablet  <youenn@apple.com>
962
963         Rename CrossOriginResourcePolicy same to same-origin
964         https://bugs.webkit.org/show_bug.cgi?id=186080
965
966         Reviewed by Chris Dumez.
967
968         * NetworkProcess/NetworkLoadChecker.cpp:
969         (WebKit::NetworkLoadChecker::shouldCrossOriginResourcePolicyPolicyCancelLoad):
970
971 2018-05-30  David Kilzer  <ddkilzer@apple.com>
972
973         [iOS] -[WKFullScreenViewController viewWillAppear:] should call [super viewWillAppeear:]
974         <https://webkit.org/b/186103>
975         <rdar://problem/40655695>
976
977         Reviewed by Eric Carlson.
978
979         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
980         (WKFullScreenViewControllerPlaybackSessionModelClient::setInterface):
981         Drive-by clean up.  For consistency, we always use the same
982         variable in the body of the `if` statement that was used in the
983         condition.
984         (-[WKFullScreenViewController viewWillAppear:]): Call
985         [super viewWillAppeear:] to fulfill API contract.
986
987 2018-05-30  Chris Dumez  <cdumez@apple.com>
988
989         Take a background process assertion in WebPageProxy::callAfterNextPresentationUpdate()
990         https://bugs.webkit.org/show_bug.cgi?id=186097
991         <rdar://problem/40651225>
992
993         Reviewed by Dan Bernstein.
994
995         Refactor fix landed in r232298 so that we rely on the existing Callback infrastructure
996         to take a background process assertion.
997
998         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
999         (WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing):
1000         * UIProcess/WebPageProxy.cpp:
1001         (WebKit::WebPageProxy::callAfterNextPresentationUpdate):
1002
1003 2018-05-30  Aditya Keerthi  <akeerthi@apple.com>
1004
1005         Fix the ENABLE(DATALIST_ELEMENT) build
1006         https://bugs.webkit.org/show_bug.cgi?id=186105
1007
1008         Reviewed by Wenson Hsieh.
1009
1010         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
1011
1012 2018-05-30  Jiewen Tan  <jiewen_tan@apple.com>
1013
1014         Unreviewed, a quick build fix for r232276.
1015
1016         Enabled SecItemShim again as it turns out to be useful for CFNetwork APIs that
1017         query Keychains underneath us.
1018
1019         * NetworkProcess/ios/NetworkProcessIOS.mm:
1020         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
1021         * NetworkProcess/mac/NetworkProcessMac.mm:
1022         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
1023
1024 2018-05-30  Jer Noble  <jer.noble@apple.com>
1025
1026         Auto-pip should use main content heuristic.
1027         https://bugs.webkit.org/show_bug.cgi?id=186065
1028         <rdar://problem/35862502>
1029
1030         Reviewed by Eric Carlson.
1031
1032         Make the m_pipStandbyElement clearable, which will allow the auto-pip mechanism to be torn down. Add
1033         a WebProcess-side notification when the main content changes, to facilitate this.
1034
1035         * WebProcess/FullScreen/WebFullScreenManager.cpp:
1036         (WebKit::WebFullScreenManager::videoControlsManagerDidChange):
1037         (WebKit::WebFullScreenManager::setPIPStandbyElement):
1038         (WebKit::WebFullScreenManager::didEnterFullScreen):
1039         (WebKit::WebFullScreenManager::willExitFullScreen):
1040         * WebProcess/FullScreen/WebFullScreenManager.h:
1041         * WebProcess/WebPage/WebPage.cpp:
1042         (WebKit::WebPage::videoControlsManagerDidChange):
1043         * WebProcess/WebPage/WebPage.h:
1044         * WebProcess/cocoa/PlaybackSessionManager.h:
1045         * WebProcess/cocoa/PlaybackSessionManager.mm:
1046         (WebKit::PlaybackSessionManager::setUpPlaybackControlsManager):
1047         (WebKit::PlaybackSessionManager::clearPlaybackControlsManager):
1048         (WebKit::PlaybackSessionManager::currentPlaybackControlsElement const):
1049
1050 2018-05-30  Jer Noble  <jer.noble@apple.com>
1051
1052         Fix a few issues in WKFullScreenViewController
1053         https://bugs.webkit.org/show_bug.cgi?id=186067
1054         <rdar://problem/40630944>
1055
1056         Reviewed by Darin Adler.
1057
1058         The check in setInterface() is checking the wrong pointer:
1059         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
1060         (WKFullScreenViewControllerPlaybackSessionModelClient::setInterface):
1061
1062         The check in -_effectiveFullscreenInsetTop is backwards:
1063         (-[WKFullScreenViewController _effectiveFullscreenInsetTop]):
1064
1065 2018-05-30  Chris Dumez  <cdumez@apple.com>
1066
1067         Take a background process assertion in WebPageProxy::callAfterNextPresentationUpdate()
1068         https://bugs.webkit.org/show_bug.cgi?id=186097
1069         <rdar://problem/40651225>
1070
1071         Reviewed by Tim Horton.
1072
1073         Take a background process assertion in WebPageProxy::callAfterNextPresentationUpdate(). Otherwise,
1074         apps may get stuck on _doAfterNextPresentationUpdate because the WebProcess got suspended.
1075
1076         * UIProcess/WebPageProxy.cpp:
1077         (WebKit::WebPageProxy::callAfterNextPresentationUpdate):
1078
1079 2018-05-29  Tim Horton  <timothy_horton@apple.com>
1080
1081         Fix the build
1082         https://bugs.webkit.org/show_bug.cgi?id=186078
1083
1084         Unreviewed build fix.
1085
1086         * UIProcess/API/Cocoa/WKWebView.mm:
1087         (-[WKWebView _denyNextUserMediaRequest]):
1088
1089 2018-05-29  Andy Estes  <aestes@apple.com>
1090
1091         [Wi-Fi Assertions] Track whether WiFiAssertionHolder should actually hold a Wi-Fi assertion
1092         https://bugs.webkit.org/show_bug.cgi?id=185983
1093         <rdar://problem/40205486>
1094
1095         Reviewed by Tim Horton.
1096
1097         * Configurations/Network-iOS.entitlements:
1098
1099         Added a needed entitlement.
1100
1101         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
1102         * NetworkProcess/cocoa/WiFiAssertionHolder.h:
1103         (WebKit::WiFiAssertionHolder::shouldHoldWiFiAssertion const):
1104
1105         Track whether WiFiAssertionHolder should actually hold a Wi-Fi assertion.
1106
1107         * NetworkProcess/cocoa/WiFiAssertionHolder.mm: Renamed from Source/WebKit/NetworkProcess/cocoa/WiFiAssertionHolder.cpp.
1108         (holdWiFiAssertion):
1109         (releaseWiFiAssertion):
1110         (WebKit::WiFiAssertionHolder::WiFiAssertionHolder):
1111         (WebKit::WiFiAssertionHolder::~WiFiAssertionHolder):
1112
1113         Changed holdWiFiAssertion() and releaseWiFiAssertion() to take the
1114         WiFiAssertionHolder as an argument.
1115
1116         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
1117
1118         Added a needed sandbox extension.
1119
1120         * WebKit.xcodeproj/project.pbxproj:
1121
1122 2018-05-29  Youenn Fablet  <youenn@apple.com>
1123
1124         Add a consistency check between URL and CFURL
1125         https://bugs.webkit.org/show_bug.cgi?id=186057
1126         <rdar://problem/40258457>
1127
1128         Reviewed by Geoff Garen.
1129
1130         * Shared/Cocoa/WKNSURLExtras.mm:
1131         (+[NSURL _web_URLWithWTFString:relativeToURL:]):
1132         (urlWithWTFString): Deleted.
1133         (+[NSURL _web_URLWithWTFString:]): Deleted.
1134
1135 2018-05-29  Alex Christensen  <achristensen@webkit.org>
1136
1137         Remove unused WebPage::dummy
1138         https://bugs.webkit.org/show_bug.cgi?id=186068
1139
1140         Reviewed by Sam Weinig.
1141
1142         * WebProcess/WebPage/WebPage.cpp:
1143         (WebKit::WebPage::dummy): Deleted.
1144         * WebProcess/WebPage/WebPage.h:
1145         * WebProcess/WebPage/WebPage.messages.in:
1146
1147 2018-05-29  Per Arne Vollan  <pvollan@apple.com>
1148
1149         Create typedef for HashMap<PlatformDisplayID, ScreenProperties>
1150         https://bugs.webkit.org/show_bug.cgi?id=186056
1151
1152         Reviewed by Brent Fulgham.
1153
1154         * Shared/WebProcessCreationParameters.cpp:
1155         (WebKit::WebProcessCreationParameters::decode):
1156         * Shared/WebProcessCreationParameters.h:
1157
1158 2018-05-25  Jiewen Tan  <jiewen_tan@apple.com>
1159
1160         Tighten sandbox profiles for Networking Processes to restrict accesses to macOS/iOS Keychains
1161         https://bugs.webkit.org/show_bug.cgi?id=162948
1162         <rdar://problem/40558894>
1163
1164         Reviewed by Brent Fulgham.
1165
1166         The patch conditionally tighten sandbox profiles for Networking Processes to remove Keychain related
1167         permissions and some security permisssions that are not needed. Also it conditionally remove the
1168         Process Privilege for Networking Processes to access Credentials.
1169
1170         In addition, it remove process privilege assertions for SecItemShim as it is supposed to work in processes
1171         that don't have privileges to access Keychains and delegate all operations to UI Process via IPC. Also,
1172         the patch disables SecItemShim for Networking Process conditionally.
1173
1174         * Configurations/Network-iOS.entitlements:
1175         * NetworkProcess/NetworkProcess.cpp:
1176         (WebKit::NetworkProcess::initializeNetworkProcess):
1177         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
1178         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
1179         * Shared/mac/SecItemShim.cpp:
1180         (WebKit::sendSecItemRequest):
1181         (WebKit::webSecItemCopyMatching):
1182         (WebKit::webSecItemAdd):
1183         (WebKit::webSecItemUpdate):
1184         (WebKit::webSecItemDelete):
1185         (WebKit::initializeSecItemShim):
1186
1187 2018-05-29  Chris Dumez  <cdumez@apple.com>
1188
1189         Store 0-lifetime stylesheets / scripts into the disk cache for faster history navigations
1190         https://bugs.webkit.org/show_bug.cgi?id=186060
1191         <rdar://problem/40627270>
1192
1193         Reviewed by Geoffrey Garen.
1194
1195         Tweak our storeUnconditionallyForHistoryNavigation logic to match resources whose priority
1196         is High, not just VeryHigh. Per logic in CachedResource::defaultPriorityForResourceType(Type),
1197         This now matches stylesheets and scripts in addition to main resources.
1198
1199         I found that in case of a history navigation to apple.com, a significant number of scripts
1200         and stylesheets had to be loaded from the network because our previous heuristic decided
1201         not to store them (because their priority was not VeryHigh and because their max-age was
1202         0).
1203
1204         * NetworkProcess/cache/NetworkCache.cpp:
1205         (WebKit::NetworkCache::makeStoreDecision):
1206
1207 2018-05-28  Jeff Miller  <jeffm@apple.com>
1208
1209         Expose additional WKMenuItemIdentifier strings
1210         https://bugs.webkit.org/show_bug.cgi?id=186041
1211
1212         Reviewed by Dan Bernstein.
1213
1214         Expose identifiers for media-related menu items.
1215
1216         * UIProcess/API/Cocoa/WKMenuItemIdentifiers.mm:
1217         Define new identifiers.
1218
1219         * UIProcess/API/Cocoa/WKMenuItemIdentifiersPrivate.h:
1220         Declare new identifiers.
1221
1222         * UIProcess/mac/WebContextMenuProxyMac.mm:
1223         (WebKit::menuItemIdentifier):
1224         Map to new identifiers.
1225
1226 2018-05-29  Geoffrey Garen  <ggaren@apple.com>
1227
1228         Removed some unused WebSQL trackers
1229         https://bugs.webkit.org/show_bug.cgi?id=186026
1230
1231         Reviewed by Dan Bernstein.
1232
1233         * NetworkProcess/NetworkProcess.cpp:
1234         (WebKit::NetworkProcess::NetworkProcess):
1235         * NetworkProcess/NetworkProcess.h:
1236         * WebProcess/WebProcess.cpp:
1237         (WebKit::m_nonVisibleProcessCleanupTimer):
1238         (WebKit::m_webSQLiteDatabaseTracker): Deleted.
1239         * WebProcess/WebProcess.h:
1240
1241 2018-05-29  Per Arne Vollan  <pvollan@apple.com>
1242
1243         Follow-up fixes after r228907.
1244         https://bugs.webkit.org/show_bug.cgi?id=183338
1245
1246         Reviewed by Brent Fulgham.
1247
1248         Add screen properties to the WebProcess creation parameters, instead of sending
1249         them in a message to the WebProcess just after starting it up.
1250
1251         * Shared/WebProcessCreationParameters.cpp:
1252         (WebKit::WebProcessCreationParameters::encode const):
1253         (WebKit::WebProcessCreationParameters::decode):
1254         * Shared/WebProcessCreationParameters.h:
1255         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1256         (WebKit::WebProcessPool::platformInitializeWebProcess):
1257         * UIProcess/WebProcessPool.cpp:
1258         (WebKit::WebProcessPool::initializeNewWebProcess):
1259         * WebProcess/cocoa/WebProcessCocoa.mm:
1260         (WebKit::WebProcess::platformInitializeWebProcess):
1261
1262 2018-05-29  Sihui Liu  <sihui_liu@apple.com>
1263
1264         Unable to remove IndexedDB Databases with Cocoa API removeDataOfTypes
1265         https://bugs.webkit.org/show_bug.cgi?id=185835
1266         <rdar://problem/39142257>
1267
1268         Reviewed by Chris Dumez.
1269
1270         Fix a wrong if condition: databases should be closed and deleted if websiteDataTypes contains 
1271         WebsiteDataType::IndexedDBDatabases.
1272
1273         * StorageProcess/StorageProcess.cpp:
1274         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
1275
1276 2018-05-28  Sam Weinig  <sam@webkit.org>
1277
1278         Modernize SVGRenderStyleDefs.h
1279         https://bugs.webkit.org/show_bug.cgi?id=186024
1280
1281         Reviewed by Daniel Bates.
1282
1283         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
1284         (WebKit::applyPropertiesToLayer):
1285         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
1286         (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
1287         Update for new enum names.
1288
1289 2018-05-28  Carlos Garcia Campos  <cgarcia@igalia.com>
1290
1291         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.21.3 release.
1292
1293         * gtk/NEWS: Add release notes for 2.21.3.
1294
1295 2018-05-27  Dan Bernstein  <mitz@apple.com>
1296
1297         Reverted the changes made for https://webkit.org/b/186016
1298
1299         They broke the USE(APPLE_INTERNAL_SDK) Sierra build.
1300
1301 2018-05-27  David Kilzer  <ddkilzer@apple.com>
1302
1303         [iOS] Fix warnings about leaks found by clang static analyzer
1304         <https://webkit.org/b/186009>
1305         <rdar://problem/40574267>
1306
1307         Reviewed by Daniel Bates.
1308
1309         * UIProcess/Automation/ios/WebAutomationSessionIOS.mm:
1310         (WebKit::WebAutomationSession::platformSimulateKeySequence): Fix
1311         leak of two WebEvent objects that happened in a loop.
1312         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
1313         (-[_WKPreviewControllerDelegate previewController:transitionImageForPreviewItem:contentRect:]):
1314         Fix leak of a UIImage.
1315
1316 2018-05-27  Dan Bernstein  <mitz@apple.com>
1317
1318         [Cocoa] Avoid importing directly from subumbrella frameworks
1319         https://bugs.webkit.org/show_bug.cgi?id=186016
1320
1321         Reviewed by Sam Weinig.
1322
1323         * Configurations/BaseTarget.xcconfig: Removed -iframework options from OTHER_CFLAGS and
1324           OTHER_CPLUSPLUSFLAGS.
1325         * UIProcess/Automation/mac/WebAutomationSessionMac.mm: Import Carbon.h instead of an
1326           HIToolbox header.
1327         * UIProcess/Cocoa/WebViewImpl.mm: Ditto.
1328         * UIProcess/mac/WKPrintingView.mm: Import Quartz.h instead of a PDFKit header.
1329         * UIProcess/mac/WKTextInputWindowController.mm: Import Carbon.h instead of an HIToolbox
1330           header.
1331         * WebProcess/Plugins/PDF/PDFAnnotationTextWidgetDetails.h: Import Quartz.h instead of a
1332           PDFKit header.
1333         * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h: Ditto.
1334         * WebProcess/Plugins/PDF/PDFPlugin.mm: Ditto.
1335         * WebProcess/Plugins/PDF/PDFPluginAnnotation.mm: Ditto.
1336         * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm: Ditto.
1337         * WebProcess/Plugins/PDF/PDFPluginPasswordField.mm: Ditto.
1338         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm: Ditto.
1339         * WebProcess/WebPage/mac/WebPageMac.mm: Ditto.
1340
1341 2018-05-25  Timothy Hatcher  <timothy@apple.com>
1342
1343         Setting drawsBackground to YES on a WKView doesn't take effect immediately
1344         https://bugs.webkit.org/show_bug.cgi?id=185885
1345         rdar://problem/39706506
1346
1347         Reviewed by Simon Fraser.
1348
1349         * UIProcess/API/Cocoa/WKWebView.mm:
1350         (-[WKWebView _initializeWithConfiguration:]): Removed setBackgroundExtendsBeyondPage(true)
1351         since it is now the default.
1352         * UIProcess/Cocoa/WebViewImpl.mm:
1353         (WebKit::WebViewImpl::setDrawsBackground): Make sure updateLayer gets called on the web view
1354         by calling setNeedsDisplay:YES.
1355         (WebKit::WebViewImpl::setBackgroundColor): Ditto.
1356         (WebKit::WebViewImpl::updateLayer): Removed dead code.
1357         * UIProcess/WebPageProxy.h: Make m_backgroundExtendsBeyondPage default to true. WebKit was
1358         always turning this on during WKWebView initializtion, which would cause the scroll
1359         shadow layer to be created, flash black because of no background, then destroyed soon
1360         after once WebKit's message to turn it on got delivered.
1361         * WebProcess/WebPage/WebPage.cpp:
1362         (WebPage::WebPage): Call setBackgroundExtendsBeyondPage earlier to avoid creating the scroll
1363         shadow layer, since backgroundShouldExtendBeyondPage defautls to false in WebCore for WK1.
1364         (WebKit::WebPage::setDrawsBackground): Use updateBackgroundRecursively to propagate the
1365         correct base background color.
1366
1367 2018-05-25  Youenn Fablet  <youenn@apple.com>
1368
1369         Migrate From-Origin to Cross-Origin-Resource-Policy
1370         https://bugs.webkit.org/show_bug.cgi?id=185840
1371
1372         Reviewed by Chris Dumez.
1373
1374         Do Cross-Origin-Resource-Policy (CORP) checks in NetworkLoadChecker instead of NetworkResourceLoader directly.
1375         Make sure CORP only applies to no-cors loads.
1376         Remove ancestor checks and only consider the document origin making the load.
1377         This means that in case of cross-origin redirection to same-origin, the redirection will be CORP-checked,
1378         the final response will not be CORP-checked but will be opaque.
1379
1380         * NetworkProcess/NetworkLoadChecker.cpp:
1381         (WebKit::NetworkLoadChecker::validateCrossOriginResourcePolicyPolicy):
1382         (WebKit::NetworkLoadChecker::validateResponse):
1383         * NetworkProcess/NetworkLoadChecker.h:
1384         * NetworkProcess/NetworkResourceLoader.cpp:
1385         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
1386         (WebKit::NetworkResourceLoader::didReceiveResponse):
1387         (WebKit::NetworkResourceLoader::continueWillSendRedirectedRequest):
1388         (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
1389         (WebKit::NetworkResourceLoader::dispatchWillSendRequestForCacheEntry):
1390         * NetworkProcess/NetworkResourceLoader.h:
1391         * WebProcess/Network/WebLoaderStrategy.cpp:
1392         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
1393         Send ancestor information for navigation loads only.
1394
1395 2018-05-25  Daniel Bates  <dabates@apple.com>
1396
1397         NavigationAction should not hold a strong reference to a Document
1398         https://bugs.webkit.org/show_bug.cgi?id=185712
1399         <rdar://problem/40320916>
1400
1401         Reviewed by Brent Fulgham.
1402
1403         Update code to make use of NavigationAction::requester().
1404
1405         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1406         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1407
1408 2018-05-25  Tim Horton  <timothy_horton@apple.com>
1409
1410         Ensure that the Web Content process doesn't sleep during initialization
1411         https://bugs.webkit.org/show_bug.cgi?id=185975
1412         <rdar://problem/40548159>
1413
1414         Reviewed by Geoffrey Garen.
1415
1416         WebProcessPool::warmInitialProcess isn't worth much (or at least, as much
1417         as it could be) if the Web Content process goes to sleep in the middle
1418         of initializeWebProcess.
1419
1420         Keep the Web Content process alive until it has handled all messages
1421         sent from WebProcessPool::initializeNewWebProcess.
1422
1423         This is a significant speedup on some benchmarks I've been running
1424         that involve prewarming a process long before any content is loaded.
1425
1426         * UIProcess/WebProcessPool.cpp:
1427         (WebKit::WebProcessPool::initializeNewWebProcess):
1428
1429 2018-05-25  Chris Dumez  <cdumez@apple.com>
1430
1431         WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback() unexpectedly constructs a process pool
1432         https://bugs.webkit.org/show_bug.cgi?id=185992
1433
1434         Reviewed by Geoffrey Garen.
1435
1436         Update enableResourceLoadStatisticsAndSetTestingCallback() to pass the right parameter to processPools()
1437         to avoid constructing a process pool when none exist. Also drop the 'resourceLoadStatisticsEnabled'
1438         flag on the WebProcessPool and have it query its data store instead to know if the feature is enabled.
1439
1440         * UIProcess/WebProcessPool.cpp:
1441         (WebKit::WebProcessPool::initializeNewWebProcess):
1442         (WebKit::WebProcessPool::setResourceLoadStatisticsEnabled):
1443         * UIProcess/WebProcessPool.h:
1444         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1445         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
1446
1447 2018-05-25  Chris Dumez  <cdumez@apple.com>
1448
1449         Drop support for NSURLCache in WebKit2
1450         https://bugs.webkit.org/show_bug.cgi?id=185990
1451
1452         Reviewed by Geoffrey Garen.
1453
1454         Drop support for NSURLCache in WebKit2 now that the WebKit network cache is stable.
1455
1456         * NetworkProcess/NetworkProcess.cpp:
1457         (WebKit::NetworkProcess::setCacheModel):
1458         * NetworkProcess/NetworkProcess.h:
1459         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1460         (WebKit::NetworkProcessCreationParameters::encode const):
1461         (WebKit::NetworkProcessCreationParameters::decode):
1462         * NetworkProcess/NetworkProcessCreationParameters.h:
1463         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1464         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
1465         (WebKit::NetworkProcess::clearDiskCache):
1466         (WebKit::NetworkProcess::platformSetURLCacheSize): Deleted.
1467         (WebKit::clearNSURLCache): Deleted.
1468         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
1469         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1470         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
1471         (): Deleted.
1472         (WebKit::NetworkSessionCocoa::setUsesNetworkCache): Deleted.
1473         * NetworkProcess/curl/NetworkProcessCurl.cpp:
1474         (WebKit::NetworkProcess::platformSetURLCacheSize): Deleted.
1475         * NetworkProcess/soup/NetworkProcessSoup.cpp:
1476         (WebKit::NetworkProcess::platformSetURLCacheSize): Deleted.
1477         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1478         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
1479         (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
1480         (WebKit::WebProcessPool::isNetworkCacheEnabled): Deleted.
1481         * UIProcess/WebProcessPool.h:
1482         * WebProcess/WebPage/WebFrame.cpp:
1483         (WebKit::WebFrame::suggestedFilenameForResourceWithURL const):
1484         (WebKit::WebFrame::mimeTypeForResourceWithURL const):
1485         * WebProcess/WebPage/WebPage.cpp:
1486         (WebKit::WebPage::getResourceDataFromFrame):
1487         (WebKit::WebPage::hasLocalDataForURL):
1488         * WebProcess/WebPage/WebPage.h:
1489         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
1490         (WebKit::WebPage::platformHasLocalDataForURL): Deleted.
1491         (WebKit::WebPage::cachedResponseMIMETypeForURL): Deleted.
1492         (WebKit::WebPage::cachedSuggestedFilenameForURL): Deleted.
1493         (WebKit::WebPage::cachedResponseDataForURL): Deleted.
1494         * WebProcess/WebPage/ios/WebPageIOS.mm:
1495         (WebKit::WebPage::platformHasLocalDataForURL): Deleted.
1496         (WebKit::WebPage::cachedSuggestedFilenameForURL): Deleted.
1497         (WebKit::WebPage::cachedResponseMIMETypeForURL): Deleted.
1498         (WebKit::WebPage::cachedResponseDataForURL): Deleted.
1499         * WebProcess/WebPage/mac/WebPageMac.mm:
1500         (WebKit::WebPage::accessibilityRemoteObject):
1501         (WebKit::WebPage::platformHasLocalDataForURL): Deleted.
1502         (WebKit::cachedResponseForURL): Deleted.
1503         (WebKit::WebPage::cachedSuggestedFilenameForURL): Deleted.
1504         (WebKit::WebPage::cachedResponseMIMETypeForURL): Deleted.
1505         (WebKit::WebPage::cachedResponseDataForURL): Deleted.
1506         * WebProcess/WebPage/win/WebPageWin.cpp:
1507         (WebKit::WebPage::platformHasLocalDataForURL): Deleted.
1508         (WebKit::WebPage::cachedResponseMIMETypeForURL): Deleted.
1509         (WebKit::WebPage::cachedSuggestedFilenameForURL): Deleted.
1510         (WebKit::WebPage::cachedResponseDataForURL): Deleted.
1511         * WebProcess/WebPage/wpe/WebPageWPE.cpp:
1512         (WebKit::WebPage::platformHasLocalDataForURL): Deleted.
1513         (WebKit::WebPage::cachedResponseMIMETypeForURL): Deleted.
1514         (WebKit::WebPage::cachedSuggestedFilenameForURL): Deleted.
1515         (WebKit::WebPage::cachedResponseDataForURL): Deleted.
1516         * WebProcess/cocoa/WebProcessCocoa.mm:
1517         (WebKit::WebProcess::platformInitializeWebProcess):
1518
1519 2018-05-25  Alex Christensen  <achristensen@webkit.org>
1520
1521         Fix internal iOS builds after r232198
1522         https://bugs.webkit.org/show_bug.cgi?id=185986
1523
1524         * WebProcess/WebPage/ios/WebPageIOS.mm:
1525         (WebKit::WebPage::sendTapHighlightForNodeIfNecessary):
1526
1527 2018-05-25  Alex Christensen  <achristensen@webkit.org>
1528
1529         URL::host should return a StringView to reduce allocations
1530         https://bugs.webkit.org/show_bug.cgi?id=185986
1531
1532         Reviewed by Geoff Garen.
1533
1534         * NetworkProcess/NetworkProcess.cpp:
1535         (WebKit::fetchDiskCacheEntries):
1536         * NetworkProcess/NetworkResourceLoader.cpp:
1537         (WebKit::areFrameAncestorsSameSite):
1538         * NetworkProcess/mac/NetworkProcessMac.mm:
1539         (WebKit::overrideSystemProxies):
1540         * Shared/API/APIURL.h:
1541         (API::URL::host const):
1542         * UIProcess/Automation/WebAutomationSession.cpp:
1543         (WebKit::WebAutomationSession::addSingleCookie):
1544         (WebKit::WebAutomationSession::deleteAllCookies):
1545         * UIProcess/WebProcessProxy.cpp:
1546         (WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
1547         * WebProcess/Plugins/PluginView.cpp:
1548         (WebKit::PluginView::pluginDidReceiveUserInteraction):
1549         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
1550         (WebKit::WebPluginInfoProvider::populatePluginCache):
1551         * WebProcess/WebPage/WebPage.cpp:
1552         (WebKit::needsHiddenContentEditableQuirk):
1553         (WebKit::needsPlainTextQuirk):
1554         (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
1555
1556 2018-05-25  Adrian Perez de Castro  <aperez@igalia.com>
1557
1558         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.21.2 release.
1559
1560         * wpe/NEWS: Add release notes for the 2.21.2 release.
1561
1562 2018-05-25  Chris Dumez  <cdumez@apple.com>
1563
1564         Minor ApplicationCacheStorage clean up
1565         https://bugs.webkit.org/show_bug.cgi?id=185984
1566
1567         Reviewed by Youenn Fablet.
1568
1569         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1570         (WebKit::WebsiteDataStore::fetchDataAndApply):
1571         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1572         (WKBundlePageCopyOriginsWithApplicationCache):
1573
1574 2018-05-25  Chris Dumez  <cdumez@apple.com>
1575
1576         Avoid triggering network cache speculative revalidation for loads allowing expired content
1577         https://bugs.webkit.org/show_bug.cgi?id=185985
1578
1579         Reviewed by Antti Koivisto.
1580
1581         Avoid triggering network cache speculative revalidation for loads allowing expired content
1582         (e.g. history loads, restoring pages after crash or safari relaunch). This causes us to do
1583         unnecessary revalidations, it is both wasteful and bad for performance.
1584
1585         * NetworkProcess/cache/NetworkCache.cpp:
1586         (WebKit::NetworkCache::Cache::retrieve):
1587
1588 2018-05-25  David Kilzer  <ddkilzer@apple.com>
1589
1590         Fix issues with -dealloc methods found by clang static analyzer
1591         <https://webkit.org/b/185887>
1592
1593         Reviewed by Joseph Pecoraro.
1594
1595         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: Drive-by fix
1596         to use `copy` for `mimeType` property.
1597         (-[_WKPreviewControllerDataSource initWithMIMEType:]): Drive-by
1598         fix to use `instancetype` instead of `id`.  Use -copy for
1599         `mimeType` argument to match property definition.
1600         (-[_WKPreviewControllerDataSource dealloc]): Add.  Release
1601         `_completionHandler` and `_mimeType` to fix leaks.
1602         * UIProcess/ios/WKPasswordView.mm:
1603         (-[WKPasswordView dealloc]): Add.  Release
1604         `_userDidEnterPassword` to fix leak.
1605         * UIProcess/ios/fullscreen/WKFullScreenViewController.h:
1606         Drive-by clean-up to make `location` property `copy` instead of
1607         `retain`.
1608         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
1609         (-[WKFullScreenViewController dealloc]): Release `_target` and
1610         `_location` to fix leaks.
1611         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
1612         (-[WKFullscreenAnimationController dealloc]): Add.  Release
1613         `_viewController` to fix leak.
1614         * UIProcess/ios/fullscreen/WKFullscreenStackView.mm:
1615         (@property secondaryMaterialOverlayView): Mark explicitly as
1616         `assign` since this isn't a retained variable.
1617         (@property secondaryMaterialOverlayViewConstraints): Mark
1618         explicitly as `retain` since there is nothing to keep this
1619         object alive.
1620         (+[WKFullscreenStackView secondaryMaterialOverlayView]): Fix
1621         leak by autoreleasing the return value.
1622         (-[WKFullscreenStackView dealloc]): Release retained instance
1623         variables to fix leaks.  Note that `_stackView` and
1624         `_visualEffectView` are internally retained despite their
1625         @property declarations.
1626         (-[WKFullscreenStackView setTargetViewForSecondaryMaterialOverlay:]):
1627         Retain @property targetViewForSecondaryMaterialOverlay to match
1628         its declaration.
1629
1630 2018-05-23  Antoine Quint  <graouts@apple.com>
1631
1632         [Web Animations] Use DEFAULT_EXPERIMENTAL_FEATURES_ENABLED for Web Animations experimental features
1633         https://bugs.webkit.org/show_bug.cgi?id=185919
1634
1635         Reviewed by Dean Jackson.
1636
1637         * Shared/WebPreferences.yaml:
1638
1639 2018-05-24  Dan Bernstein  <mitz@apple.com>
1640
1641         ProcessLauncherMac.mm contains a couple of meaningless #ifndef directives
1642         https://bugs.webkit.org/show_bug.cgi?id=185973
1643
1644         Reviewed by Tim Horton.
1645
1646         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1647         (WebKit::ProcessLauncher::launchProcess): Use #if !ASSERT_DISABLED to guard statements that
1648           are only needed for an assertion, instead of #ifndef _NDEBUG, which is always true.
1649
1650 2018-05-24  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1651
1652         [GTK][WPE] Memory pressure monitor doesn't reliable notify all the subprocesses
1653         https://bugs.webkit.org/show_bug.cgi?id=184261
1654
1655         Reviewed by Carlos Garcia Campos.
1656
1657         On Linux we had two implementations for getting notifications about memory pressure events:
1658         - The memory cgroup (called systemd here).
1659         - The UIProcess memory monitor (which delivered events via a shared eventfd)
1660
1661         The problem with the first is that it was usually not working on a standard machine due to
1662         the special permissions or configurations required for memory cgroups, so the second one
1663         (eventfd) was used as a fall-back in that case.
1664         But this eventfd method is racy with more than one WebKit child process and it wasn't
1665         reliably delivering the notifications.
1666
1667         This patch removes the memory cgroup implementation and modifies the UIProcess memory monitor
1668         to deliver the events via WebKit IPC. This simplifies the code a lot and allows us to have
1669         only one implementation that should work in any Linux machine.
1670
1671         The implementation now also triggers the event with information about the criticalness of it.
1672
1673         Previously a critical event was triggered always at a 95% of pressure.
1674         Now a non-critical one is triggered at 90% and critical remains at a 95%.
1675
1676         Start triggering events early should compensate the fact than triggering the event via WebKit IPC is
1677         a bit slower than doing that via an eventfd (or than listening on the memory cgroup event controller).
1678
1679         The events are delivered to all WebKit childs: WebProcess, NetworkProcess, StorageProcess, PluginProcess.
1680
1681         In the case of the StorageProcess a dummy controller is installed, which currently does nothing,
1682         but leaves a note for a future implementation and at least allows to trigger platformReleaseMemory()
1683         that on Linux/glibc should end calling malloc_trim()
1684
1685         * NetworkProcess/NetworkProcess.cpp:
1686         (WebKit::NetworkProcess::initializeNetworkProcess):
1687         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1688         (WebKit::NetworkProcessCreationParameters::encode const):
1689         (WebKit::NetworkProcessCreationParameters::decode):
1690         * NetworkProcess/NetworkProcessCreationParameters.h:
1691         * PluginProcess/PluginProcess.cpp:
1692         (WebKit::PluginProcess::didReceiveMessage):
1693         (WebKit::PluginProcess::initializePluginProcess):
1694         * Shared/ChildProcess.cpp:
1695         (WebKit::ChildProcess::didReceiveMemoryPressureEvent):
1696         * Shared/ChildProcess.h:
1697         * Shared/ChildProcess.messages.in:
1698         * Shared/Plugins/PluginProcessCreationParameters.cpp:
1699         (WebKit::PluginProcessCreationParameters::encode const):
1700         (WebKit::PluginProcessCreationParameters::decode):
1701         * Shared/Plugins/PluginProcessCreationParameters.h:
1702         * Shared/WebProcessCreationParameters.cpp:
1703         (WebKit::WebProcessCreationParameters::encode const):
1704         (WebKit::WebProcessCreationParameters::decode):
1705         * Shared/WebProcessCreationParameters.h:
1706         * StorageProcess/StorageProcess.cpp:
1707         (WebKit::StorageProcess::initializeProcess):
1708         * UIProcess/Plugins/PluginProcessManager.cpp:
1709         (WebKit::PluginProcessManager::sendMemoryPressureEvent):
1710         * UIProcess/Plugins/PluginProcessManager.h:
1711         * UIProcess/Plugins/PluginProcessProxy.cpp:
1712         (WebKit::PluginProcessProxy::sendMemoryPressureEvent):
1713         (WebKit::PluginProcessProxy::didFinishLaunching):
1714         * UIProcess/Plugins/PluginProcessProxy.h:
1715         * UIProcess/WebProcessPool.cpp:
1716         (WebKit::WebProcessPool::sendMemoryPressureEvent):
1717         (WebKit::WebProcessPool::ensureNetworkProcess):
1718         (WebKit::WebProcessPool::initializeNewWebProcess):
1719         * UIProcess/WebProcessPool.h:
1720         (WebKit::WebProcessPool::sendToStorageProcess):
1721         * UIProcess/linux/MemoryPressureMonitor.cpp:
1722         (WebKit::pollIntervalForUsedMemoryPercentage): Fix equation for calculating the interval percentage.
1723         (WebKit::MemoryPressureMonitor::singleton):
1724         (WebKit::MemoryPressureMonitor::start):
1725         * UIProcess/linux/MemoryPressureMonitor.h:
1726         * WebProcess/WebProcess.cpp:
1727         (WebKit::WebProcess::initializeWebProcess):
1728
1729 2018-05-24  Youenn Fablet  <youenn@apple.com>
1730
1731         Update plugin search path to look for user installed plugins
1732         https://bugs.webkit.org/show_bug.cgi?id=185960
1733
1734         Reviewed by Brent Fulgham.
1735
1736         Now that UIProcess may be sandboxed, the home directory is no longer the user home directory.
1737         Update the path to still look for plugins in the user home directory.
1738
1739         * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
1740         (WebKit::PluginInfoStore::pluginsDirectories):
1741
1742 2018-05-24  Jiewen Tan  <jiewen_tan@apple.com>
1743
1744         Adopt SecKeyProxy SPI in certificate based challenge response code
1745         https://bugs.webkit.org/show_bug.cgi?id=185848
1746         <rdar://problem/34586181>
1747
1748         Reviewed by Alex Christensen.
1749
1750         This patch adopts SecKeyProxy SPI in HTTPS client certificate authentication code.
1751         1) SecKeyProxy is a new SPI to relay crypto operations from one process to another. The owner process of the proxy
1752         will behave like a server, and other owners of the SecKeys created from the proxy's endpoints will then behave
1753         like clients. This client-server model allows more restricted sandbox for client processes, and meanwhile permits
1754         them to relay crypto operations to the server process while maintaining the same SecKey interfaces as used for local operations.
1755         2) Because of the client-server model, the server process, i.e. the UI Process in our case, needs to keep the proxy
1756         object alive long enough for the client process, i.e. Network Processes in our case, to finish all operations, and then destroy
1757         the proxy object afterward. The ideal place to hold such a proxy is WebsiteDataStore such that proxies could live with the
1758         corresponding network session.
1759         3) A new class called SecKeyProxyStore is then created to bind the lifetime of SecKeyProxy to the WebsiteDataStore while initializing
1760         it correctly. At the time the authentication process reaches WebPageProxy::didReceiveAuthenticationChallengeProxy where we have
1761         accesses to the WebsiteDataStore, we haven't yet been able to determine the Credential to authenticate the challenge. Therefore, we
1762         have to reserve a place in the WebsiteDataStore ahead and then fill it with the right Credential. That's why SecKeyProxyStore exists.
1763         In WebPageProxy::didReceiveAuthenticationChallengeProxy, we create a strong reference of SecKeyProxyStore which will eventually hold
1764         a strong reference of the SecKeyProxy, and move it to the WebsiteDataStore. We also create a weak reference to SecKeyProxyStore
1765         and move it to the AuthenticationChallenge. In this way, we indirectly bind the lifetime of SecKeyProxy to the WebsiteDataStore through
1766         the strong reference and also we can initialize the proxy through the weak reference while a credential is finally determined.
1767         4) Endpoints of the SecKeyProxy will be passed to the Network Process for creating the 'remote' SecKey. However, those endpoints are
1768         of NSXPCListenerEndpoint type, which can only be passed with xpc connections and are not compatible with our IPC mechanism. In order
1769         to pass endpoints around, this patch reuses the xpc connection that is used to bootstrap Network Processes from the UI Process. To do
1770         so, it sends xpc messages at the place where original IPC messages are sent and overwrites the boostrap listener of the xpc connection
1771         when Network Process is initialized. From the listener, it continues the original authentication code path.
1772         5) Tests, again, are manually covered by tlstestwebkit.org. Noted, the prompting Keychain dialog in macOS should say Safari instead of
1773         "com.apple.WebKit.Networking*" now.
1774
1775         * Shared/AuthenticationManagerCocoa.mm: Added.
1776         (WebKit::AuthenticationManager::initializeConnection):
1777         * Shared/Authentication/cocoa/AuthenticationManager.h:
1778         * Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.h:
1779         * UIProcess/Authentication/AuthenticationChallengeProxy.cpp:
1780         (WebKit::AuthenticationChallengeProxy::useCredential):
1781         (WebKit::AuthenticationChallengeProxy::setSecKeyProxyStore):
1782         * UIProcess/Authentication/AuthenticationChallengeProxy.h:
1783         * UIProcess/Authentication/cocoa/AuthenticationChallengeProxyCocoa.mm: Added.
1784         (WebKit::AuthenticationChallengeProxy::sendClientCertificateCredentialOverXpc const):
1785         * UIProcess/Authentication/cocoa/SecKeyProxyStore.h: Added.
1786         (WebKit::SecKeyProxyStore::create):
1787         (WebKit::SecKeyProxyStore::isInitialized const):
1788         (WebKit::SecKeyProxyStore::get const):
1789         (WebKit::SecKeyProxyStore::weakPtrFactory const):
1790         * UIProcess/Authentication/cocoa/SecKeyProxyStore.mm: Added.
1791         (WebKit::SecKeyProxyStore::initialize):
1792         * UIProcess/WebPageProxy.cpp:
1793         (WebKit::WebPageProxy::didReceiveAuthenticationChallengeProxy):
1794         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1795         (WebKit::WebsiteDataStore::addSecKeyProxyStore):
1796         * UIProcess/WebsiteData/WebsiteDataStore.h:
1797         * WebKit.xcodeproj/project.pbxproj:
1798
1799 2018-05-24  Megan Gardner  <megan_gardner@apple.com>
1800
1801         Fix Issues with Loupe Gesture
1802         https://bugs.webkit.org/show_bug.cgi?id=185926
1803
1804         Reviewed by Tim Horton.
1805
1806         The loupe gesture was not giving us the correct selection in some situations.
1807
1808         * UIProcess/ios/WKContentViewInteraction.mm:
1809         (-[WKContentView gestureRecognizer:canBePreventedByGestureRecognizer:]):
1810         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
1811         (-[WKContentView setSelectedTextRange:]):
1812         * WebProcess/WebPage/WebPage.h:
1813         * WebProcess/WebPage/ios/WebPageIOS.mm:
1814         (WebKit::WebPage::selectWithGesture):
1815         (WebKit::WebPage::clearSelection):
1816
1817 2018-05-24  Keith Rollin  <krollin@apple.com>
1818
1819         Don't track resource load milestones in private sessions
1820         https://bugs.webkit.org/show_bug.cgi?id=185828
1821         <rdar://problem/40424197>
1822
1823         Reviewed by Brent Fulgham.
1824
1825         Bug 184838 adds the facility for tracing the beginning and ending of
1826         resources loads and reporting so that historical information can be
1827         gathered to assess the health of the networking stack. Disable this
1828         facility for private browsing sessions.
1829
1830         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1831         (WebKit::NetworkConnectionToWebProcess::startTrackingResourceLoad):
1832         (WebKit::NetworkConnectionToWebProcess::stopTrackingResourceLoad):
1833         * NetworkProcess/NetworkConnectionToWebProcess.h:
1834         * NetworkProcess/NetworkResourceLoader.cpp:
1835         (WebKit::NetworkResourceLoader::start):
1836
1837 2018-05-24  Brent Fulgham  <bfulgham@apple.com>
1838
1839         REGRESSION(r224908): [macOS] Media playback not honoring custom caption styles
1840         https://bugs.webkit.org/show_bug.cgi?id=185955
1841         <rdar://problem/40339278>
1842
1843         Reviewed by Eric Carlson.
1844
1845         In r224908 I removed access to the MediaAccessibility mach port, as well as
1846         read/write access to various preferences associated with that process, as it
1847         was no longer needed by modern WebKit media routines.
1848
1849         Detailed testing reveals that read access is still needed to these preferences
1850         to properly handle custom caption styles.
1851
1852         This patch re-enables access to the media accessibility preferences.
1853
1854         * WebProcess/com.apple.WebProcess.sb.in:
1855
1856 2018-05-24  Brent Fulgham  <bfulgham@apple.com>
1857
1858         REGRESSION(r230269): ASSERTION FAILED: sendRightCount == 1 at ProcessLauncherMac.mm(218)
1859         https://bugs.webkit.org/show_bug.cgi?id=185687
1860         <rdar://problem/39386361>
1861
1862         Reviewed by Brady Eidson.
1863
1864         In r230269 I added an assertion to help identify cases where we were doing bad
1865         bookkeeping in our port send rights. I assumed that because we were adding
1866         one send right, that when we went to close down the connection that we should
1867         have only one send right.
1868         
1869         I have since discovered that this assumption is invalid, and that I should
1870         only be checking that we have AT LEAST ONE send right at the time we attempt
1871         to remove it.
1872
1873         This patch changes the assertion to confirm that we have at least one send
1874         right before we remove the send right.
1875
1876         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1877         (WebKit::ProcessLauncher::launchProcess):
1878
1879 2018-05-24  Chris Dumez  <cdumez@apple.com>
1880
1881         Some of the work in initializeLogChannelsIfNecessary() is unnecessary for release builds
1882         https://bugs.webkit.org/show_bug.cgi?id=185951
1883
1884         Reviewed by Geoffrey Garen.
1885
1886         Some of the work in initializeLogChannelsIfNecessary() is unnecessary for release builds and slows down
1887         launch time. In particular, it is unnecessary to read NSDefaults to figure out which logging channels
1888         should be enabled.
1889
1890         * Platform/foundation/LoggingFoundation.mm:
1891         (WebKit::logLevelString):
1892         * Platform/unix/LoggingUnix.cpp:
1893         (WebKit::logLevelString):
1894         * Platform/win/LoggingWin.cpp:
1895         (WebKit::logLevelString):
1896
1897 2018-05-24  Per Arne Vollan  <pvollan@apple.com>
1898
1899         Crash under WebKit::PluginProxy::destroy()
1900         https://bugs.webkit.org/show_bug.cgi?id=185841
1901         <rdar://problem/39936896>
1902
1903         Reviewed by Brent Fulgham.
1904
1905         A release assert in Connection::sencSync is failing since scripts are not allowed in this context,
1906         and the WebKit process is allowed to process incoming messages while waiting for the sync reply.
1907         In this context, scripts are disallowed in the method Element::addShadowRoot. To make sure the
1908         WebContent process will not wait indefinitely for a reply from the Plugin process, use a timeout
1909         of 1 second when sending the message.
1910
1911         * WebProcess/Plugins/PluginProxy.cpp:
1912         (WebKit::PluginProxy::destroy):
1913
1914 2018-05-24  Carlos Garcia Campos  <cgarcia@igalia.com>
1915
1916         Unreviewed. Fix GTK+ input method unit tests after r232049.
1917
1918         Unit tests don't use a WebPageProxy.
1919
1920         * UIProcess/gtk/InputMethodFilter.cpp:
1921         (WebKit::InputMethodFilter::isViewFocused const):
1922         (WebKit::InputMethodFilter::setEnabled):
1923         * UIProcess/gtk/InputMethodFilter.h:
1924
1925 2018-05-24  Carlos Garcia Campos  <cgarcia@igalia.com>
1926
1927         WebDriver: implement maximize, minimize and fullscreen window commands
1928         https://bugs.webkit.org/show_bug.cgi?id=180398
1929
1930         Reviewed by Brian Burg.
1931
1932         * UIProcess/API/APIAutomationSessionClient.h:
1933         (API::AutomationSessionClient::requestMaximizeWindowOfPage): Added to allow clients maximize the window.
1934         * UIProcess/API/glib/WebKitAutomationSession.cpp:
1935         * UIProcess/API/glib/WebKitWebViewPrivate.h:
1936         * UIProcess/API/gtk/WebKitWebViewGtk.cpp:
1937         (WindowStateEvent::WindowStateEvent): Struct to handle window state events.
1938         (WindowStateEvent::~WindowStateEvent): Complete the event.
1939         (WindowStateEvent::complete): Call the completion handler is not called already.
1940         (windowStateEventCallback): Handle window state event changes.
1941         (webkitWebViewMaximizeWindow): Try to maximize the window and wait for the event.
1942         (webkitWebViewMinimizeWindow): Try to minimize the window and wait for the event.
1943         (webkitWebViewRestoreWindow): Try to unmaximize or unminimize the window and wait for the event.
1944         * UIProcess/API/wpe/WebKitWebViewWPE.cpp:
1945         (webkitWebViewMaximizeWindow):
1946         (webkitWebViewMinimizeWindow):
1947         (webkitWebViewRestoreWindow):
1948         * UIProcess/Automation/Automation.json:
1949         * UIProcess/Automation/WebAutomationSession.cpp:
1950         (WebKit::WebAutomationSession::maximizeWindowOfBrowsingContext): Exit fullscreen, restore the window and then
1951         maximize it.
1952         (WebKit::WebAutomationSession::maximizeWindowForPage): Ask the client to maximize the window of page.
1953         * UIProcess/Automation/WebAutomationSession.h:
1954         * UIProcess/Automation/atoms/EnterFullscreen.js:
1955         (enterFullscreen): Return early if fullscreen is disabled or if window is already in fullscreen.
1956
1957 2018-05-23  Eric Carlson  <eric.carlson@apple.com>
1958
1959         Avoid loading AVFoundation to check supported MIME types if possible
1960         https://bugs.webkit.org/show_bug.cgi?id=185839
1961         <rdar://problem/40182010>
1962
1963         Reviewed by Jer Noble.
1964         
1965         * Shared/WebProcessCreationParameters.cpp:
1966         (WebKit::WebProcessCreationParameters::encode const): Encode mediaMIMETypes.
1967         (WebKit::WebProcessCreationParameters::decode): Decode mediaMIMETypes.
1968         * Shared/WebProcessCreationParameters.h:
1969
1970         * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
1971         (WebKit::mediaTypeCache): Static Vector of media MIME types.
1972         (WebKit::WebProcessProxy::cacheMediaMIMETypes): Cache the type list and pass it to every other
1973         process proxy.
1974         (WebKit::WebProcessProxy::cacheMediaMIMETypesInternal): Cache the type list and pass it to the
1975         web process.
1976         (WebKit::WebProcessProxy::mediaMIMETypes): Return the cached type list.
1977
1978         * UIProcess/WebProcessPool.cpp:
1979         (WebKit::WebProcessPool::initializeNewWebProcess): Set parameters.mediaMIMETypes.
1980
1981         * UIProcess/WebProcessProxy.h:
1982         * UIProcess/WebProcessProxy.messages.in: Add CacheMediaMIMETypes.
1983
1984         * WebProcess/WebProcess.h:
1985         * WebProcess/WebProcess.messages.in: Add SetMediaMIMETypes.
1986
1987         * WebProcess/cocoa/WebProcessCocoa.mm:
1988         (WebKit::WebProcess::platformInitializeWebProcess): Cache the MIME types if the list isn't
1989         empty, else register with AVFoundationMIMETypeCache to be notified when it loads types.
1990         AVFoundationMIMETypeCache to 
1991         (WebKit::WebProcess::platformTerminate): Unregister with AVFoundationMIMETypeCache.
1992         (WebKit::WebProcess::setMediaMIMETypes): Pass list of types to AVFoundationMIMETypeCache.
1993
1994 2018-05-23  Brian Burg  <bburg@apple.com>
1995
1996         Web Automation: disable process swap on navigation when an automation session is active
1997         https://bugs.webkit.org/show_bug.cgi?id=185552
1998
1999         Reviewed by Tim Horton.
2000
2001         * UIProcess/WebProcessPool.cpp:
2002         (WebKit::WebProcessPool::processForNavigationInternal):
2003         This is not intended to work right now. Opt out to avoid crashing
2004         later when a process is deallocated unexpectedly.
2005
2006 2018-05-23  Youenn Fablet  <youenn@apple.com>
2007
2008         NetworkLoadChecker should check cached redirections
2009         https://bugs.webkit.org/show_bug.cgi?id=185849
2010
2011         Reviewed by Chris Dumez.
2012
2013         * NetworkProcess/NetworkLoadChecker.cpp:
2014         (WebKit::NetworkLoadChecker::checkRedirection):
2015         Set the resource error url as done by WebCore SubresourceLoader.
2016         * NetworkProcess/NetworkResourceLoader.cpp:
2017         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
2018         Pass the resource request to dispatchWillSendRedirectedRequest now needs it.
2019         (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
2020         Make sure that m_networkLoad is not null before cancelling it since we might be checking a cached redirection.
2021         (WebKit::NetworkResourceLoader::continueWillSendRedirectedRequest):
2022         Ensure the redirect response is coming from the Network before adding it to the cache.
2023         (WebKit::NetworkResourceLoader::dispatchWillSendRequestForCacheEntry):
2024         Call willSendRedirectedRequest to make sure the cached redirect is validated.
2025         * NetworkProcess/NetworkResourceLoader.h:
2026
2027 2018-05-23  Carlos Garcia Campos  <cgarcia@igalia.com>
2028
2029         [GTK] WebDriver: implement AutomationSessionClient::didDisconnectFromRemote
2030         https://bugs.webkit.org/show_bug.cgi?id=185866
2031
2032         Reviewed by Brian Burg.
2033
2034         To handle the case of the session being closed by the browser, for example in case of a network process
2035         crash. This is currently causing WebDriver tests to timeout in the bot.
2036
2037         * UIProcess/API/glib/WebKitAutomationSession.cpp: Add an implementation of didDisconnectFromRemote() to notify
2038         the WebContext that the session will be closed.
2039         * UIProcess/API/glib/WebKitWebContext.cpp: Remove the automation session when closed.
2040         * UIProcess/API/glib/WebKitWebContextPrivate.h:
2041
2042 2018-05-22  Brent Fulgham  <bfulgham@apple.com>
2043
2044         Close access to "lsopen" for non-UI process
2045         https://bugs.webkit.org/show_bug.cgi?id=185890
2046         <rdar://problem/39686511>
2047
2048         Reviewed by Alexey Proskuryakov.
2049
2050         Close down access to 'lsopen' in the iOS sandboxes. These operations are
2051         performed by the UIProcess on behalf of these helper processes.
2052
2053         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
2054         * Resources/SandboxProfiles/ios/com.apple.WebKit.Storage.sb:
2055         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2056
2057 2018-05-22  Dean Jackson  <dino@apple.com>
2058
2059         Optimized path zoom animation needs a valid UIImage and CGRect
2060         https://bugs.webkit.org/show_bug.cgi?id=185883
2061         <rdar://problem/40306056>
2062
2063         Reviewed by Jon Lee.
2064
2065         Take the rectangle that was passed into the ResourceRequest and
2066         use it for the origin of an animation into QuickLook.
2067
2068         * Shared/WebCoreArgumentCoders.cpp:
2069         (IPC::ArgumentCoder<ResourceRequest>::encode):
2070         (IPC::ArgumentCoder<ResourceRequest>::decode):
2071         * UIProcess/Cocoa/DownloadClient.mm:
2072         (WebKit::DownloadClient::didStart):
2073         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
2074         (-[_WKPreviewControllerDelegate initWithSystemPreviewController:fromRect:]):
2075         (-[_WKPreviewControllerDelegate presentingViewController]):
2076         (-[_WKPreviewControllerDelegate previewController:frameForPreviewItem:inSourceView:]):
2077         (-[_WKPreviewControllerDelegate previewController:transitionImageForPreviewItem:contentRect:]):
2078         (WebKit::SystemPreviewController::start):
2079         (-[_WKPreviewControllerDelegate initWithSystemPreviewController:]): Deleted.
2080         * UIProcess/Downloads/DownloadProxy.h:
2081         (WebKit::DownloadProxy::systemPreviewDownloadRect const):
2082         * UIProcess/SystemPreviewController.h:
2083         * UIProcess/WebPageProxy.cpp:
2084         (WebKit::WebPageProxy::syncRootViewToScreen):
2085         * UIProcess/WebPageProxy.h:
2086
2087 2018-05-22  Sihui Liu  <sihui_liu@apple.com>
2088
2089         [iOS] TestWebKitAPI.WebKit.WKHTTPCookieStoreWithoutProcessPool fails because cookies use different files with/without processpool
2090         https://bugs.webkit.org/show_bug.cgi?id=185831
2091
2092         Reviewed by Chris Dumez.
2093
2094         Started to use uiProcessCookieStorageIdentifier for iOS: make sure cookies handled without 
2095         processpool would use the same storage file as when processpool exists.
2096
2097         * NetworkProcess/NetworkProcess.h:
2098         * NetworkProcess/NetworkProcessCreationParameters.cpp:
2099         (WebKit::NetworkProcessCreationParameters::encode const):
2100         (WebKit::NetworkProcessCreationParameters::decode):
2101         * NetworkProcess/NetworkProcessCreationParameters.h:
2102         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2103         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
2104         * Shared/WebProcessCreationParameters.cpp:
2105         (WebKit::WebProcessCreationParameters::encode const):
2106         (WebKit::WebProcessCreationParameters::decode):
2107         * Shared/WebProcessCreationParameters.h:
2108         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2109         (WebKit::WebProcessPool::platformInitializeWebProcess):
2110         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2111
2112 2018-05-22  Chris Dumez  <cdumez@apple.com>
2113
2114         Regression(AsyncPolicyDelegates): Box.app login Window is blank
2115         https://bugs.webkit.org/show_bug.cgi?id=185832
2116         <rdar://problem/40307871>
2117
2118         Reviewed by Geoffrey Garen.
2119
2120         Moved WeakObjCPtr.h header from WebKit/ to wtf/ so that it can be used in
2121         WebKitLegacy code.
2122
2123         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
2124         * UIProcess/API/Cocoa/WKBrowsingContextControllerInternal.h:
2125         * UIProcess/API/Cocoa/WKConnection.mm:
2126         * UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
2127         * UIProcess/API/Cocoa/WKProcessGroup.mm:
2128         * UIProcess/API/Cocoa/WKProcessPool.mm:
2129         * UIProcess/API/Cocoa/WKScriptMessage.mm:
2130         * UIProcess/API/Cocoa/WKWebView.mm:
2131         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2132         * UIProcess/API/Cocoa/_WKAutomationSession.mm:
2133         * UIProcess/API/Cocoa/_WKDownload.mm:
2134         * UIProcess/API/Cocoa/_WKElementAction.mm:
2135         * UIProcess/ApplicationStateTracker.h:
2136         * UIProcess/Cocoa/AutomationClient.h:
2137         * UIProcess/Cocoa/AutomationSessionClient.h:
2138         * UIProcess/Cocoa/DiagnosticLoggingClient.h:
2139         * UIProcess/Cocoa/DownloadClient.h:
2140         * UIProcess/Cocoa/FindClient.h:
2141         * UIProcess/Cocoa/FullscreenClient.h:
2142         * UIProcess/Cocoa/IconLoadingDelegate.h:
2143         * UIProcess/Cocoa/NavigationState.h:
2144         * UIProcess/Cocoa/UIDelegate.h:
2145         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
2146         * UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm:
2147         * UIProcess/Cocoa/WebViewImpl.h:
2148         * UIProcess/ios/ViewGestureControllerIOS.mm:
2149         * UIProcess/ios/WKActionSheetAssistant.mm:
2150         * UIProcess/ios/WKContentViewInteraction.mm:
2151         * UIProcess/ios/WKPDFView.mm:
2152         (-[WKPDFView web_setContentProviderData:suggestedFilename:]):
2153         * UIProcess/ios/WKScrollView.mm:
2154         * UIProcess/mac/WKInspectorViewController.mm:
2155         * UIProcess/mac/WKInspectorWKWebView.mm:
2156         * WebKit.xcodeproj/project.pbxproj:
2157         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2158
2159 2018-05-22  Sihui Liu  <sihui_liu@apple.com>
2160
2161         Conversion between SecurityOriginData and DatabaseIdentifier is asymmetric when port is null
2162         https://bugs.webkit.org/show_bug.cgi?id=185715
2163
2164         Reviewed by Geoffrey Garen.
2165
2166         Add getter for origins in WKWebsiteDataRecord for testing.
2167
2168         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
2169         (-[WKWebsiteDataRecord _originsString]):
2170         * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h:
2171
2172
2173 2018-05-22  Brady Eidson  <beidson@apple.com>
2174
2175         Rename the "Web content is visible" process assertion.
2176         https://bugs.webkit.org/show_bug.cgi?id=185878
2177
2178         Reviewed by Chris Dumez.
2179
2180         * UIProcess/ios/ProcessAssertionIOS.mm:
2181         (WebKit::ProcessAssertion::ProcessAssertion):
2182
2183 2018-05-22  Andy Estes  <aestes@apple.com>
2184
2185         [Wi-Fi Assertions] Drop assertions on process suspension
2186         https://bugs.webkit.org/show_bug.cgi?id=185844
2187         <rdar://problem/40352319>
2188
2189         Reviewed by Daniel Bates.
2190
2191         * NetworkProcess/NetworkProcess.cpp:
2192         (WebKit::NetworkProcess::actualPrepareToSuspend):
2193         (WebKit::NetworkProcess::processDidResume):
2194         * NetworkProcess/NetworkProcess.h:
2195         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2196         (WebKit::NetworkProcess::platformPrepareToSuspend):
2197         (WebKit::NetworkProcess::platformProcessDidResume):
2198
2199 2018-05-22  Brent Fulgham  <bfulgham@apple.com>
2200
2201         REGRESSION(r229093): Re-enable Network Extension support in the WebContent process (Take 2)
2202         https://bugs.webkit.org/show_bug.cgi?id=185874
2203         <rdar://problem/40454404>
2204
2205         Reviewed by Eric Carlson.
2206
2207         Add back a necessary XPC connection after locking down the network features in r229093.
2208
2209         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2210         * WebProcess/com.apple.WebProcess.sb.in:
2211
2212 2018-05-22  Ryan Haddad  <ryanhaddad@apple.com>
2213
2214         Unreviewed, rolling out r232052.
2215
2216         Breaks internal builds.
2217
2218         Reverted changeset:
2219
2220         "Use more C++17"
2221         https://bugs.webkit.org/show_bug.cgi?id=185176
2222         https://trac.webkit.org/changeset/232052
2223
2224 2018-05-22  Alberto Garcia  <berto@igalia.com>
2225
2226         [CMake] Properly detect compiler flags, needed libs, and fallbacks for usage of 64-bit atomic operations
2227         https://bugs.webkit.org/show_bug.cgi?id=182622
2228         <rdar://problem/40292317>
2229
2230         Reviewed by Michael Catanzaro.
2231
2232         Move the test to determine whether we need to link against
2233         libatomic to the common file WebKitCompilerFlags.cmake so it can
2234         also be used for JavaScriptCore.
2235
2236         * CMakeLists.txt:
2237
2238 2018-05-22  Michael Catanzaro  <mcatanzaro@igalia.com>
2239
2240         Unreviewed, rolling out r231843.
2241
2242         Broke cross build
2243
2244         Reverted changeset:
2245
2246         "[CMake] Properly detect compiler flags, needed libs, and
2247         fallbacks for usage of 64-bit atomic operations"
2248         https://bugs.webkit.org/show_bug.cgi?id=182622
2249         https://trac.webkit.org/changeset/231843
2250
2251 2018-05-22  Carlos Garcia Campos  <cgarcia@igalia.com>
2252
2253         Crash when loading a SVG image
2254         https://bugs.webkit.org/show_bug.cgi?id=185819
2255
2256         Reviewed by Brent Fulgham.
2257
2258         This is happening in WebLoaderStrategy::scheduleLoad() when getting the value of
2259         FrameLoaderClient::pageID(). SVGImage uses the empty clients for the loader, and
2260         EmptyFrameLoaderClient::pageID() returns std::nullopt. The same happens with the frameID. This changed in
2261         r225934, when pageID() and frameID() were changed to return std::optional, EmptyFrameLoaderClient was updated to
2262         return std::nullopt instead of 0.
2263
2264         * WebProcess/Network/WebLoaderStrategy.cpp:
2265         (WebKit::WebLoaderStrategy::scheduleLoad): Use value_or(0) instead of value() to get pageID and frameID from
2266         FrameLoaderClient.
2267
2268 2018-05-21  Yusuke Suzuki  <utatane.tea@gmail.com>
2269
2270         Use more C++17
2271         https://bugs.webkit.org/show_bug.cgi?id=185176
2272
2273         Reviewed by JF Bastien.
2274
2275         * Configurations/Base.xcconfig:
2276         * DerivedSources.make:
2277
2278 2018-05-21  Carlos Garcia Campos  <cgarcia@igalia.com>
2279
2280         [GTK][Wayland] UI process crash when closing the window
2281         https://bugs.webkit.org/show_bug.cgi?id=185818
2282
2283         Reviewed by Michael Catanzaro.
2284
2285         This happens when a page containing a text field is loaded but the focus remains in the url bar when the window
2286         is closed. This is because we are sending a notify-in to the IM context, but the focus is still in the URL
2287         bar. That confuses the wayland input method manager that tries to free the text of the web view IM context that has
2288         already been deleted.
2289
2290         * UIProcess/gtk/InputMethodFilter.cpp:
2291         (WebKit::InputMethodFilter::setEnabled): Only send notify-in if the view is actually focused.
2292
2293 2018-05-21  Ryosuke Niwa  <rniwa@webkit.org>
2294
2295         Remove unused and no-op WKContextSetCookieStorageDirectory
2296         https://bugs.webkit.org/show_bug.cgi?id=185857
2297
2298         Reviewed by Youenn Fablet.
2299
2300         Deleted C API which didn't do anything useful, and consequently not used by anyone.
2301
2302         * UIProcess/API/C/WKContext.cpp:
2303         (WKContextSetCookieStorageDirectory): Deleted.
2304         * UIProcess/API/C/WKContextPrivate.h:
2305         * UIProcess/WebProcessPool.h:
2306
2307 2018-05-21  Chris Nardi  <cnardi@chromium.org>
2308
2309         Remove dead exception in MediaList.appendMedium
2310         https://bugs.webkit.org/show_bug.cgi?id=185278
2311
2312         Reviewed by Chris Dumez.
2313
2314         Remove code pertaining to an exception being thrown by appendMedium().
2315
2316         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.cpp:
2317         (webkit_dom_media_list_append_medium):
2318
2319 2018-05-21  Aditya Keerthi  <akeerthi@apple.com>
2320
2321         [iOS] Click events only fire once when editing
2322         https://bugs.webkit.org/show_bug.cgi?id=185777
2323
2324         Reviewed by Tim Horton.
2325
2326         gestureRecognizerShouldBegin: was returning false for the single tap gesture when a node was being
2327         edited. This is an artifact of how the gesture was previously handled with the text selection assistant.
2328         This condition is now removed, allowing the single tap gesture to go through and correctly propagate the
2329         click event.
2330
2331         Also added an early return to _didGetTapHighlightForRequest: in order to prevent the tap highlight from
2332         being shown when the node is already being assisted.
2333
2334         * UIProcess/ios/WKContentViewInteraction.mm:
2335         (-[WKContentView _didGetTapHighlightForRequest:color:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:]):
2336         (-[WKContentView gestureRecognizerShouldBegin:]):
2337
2338 2018-05-21  Daniel Bates  <dabates@apple.com>
2339
2340         REGRESSION (r231107): CSP report-only policies are ignored for beacon, importScripts, fetch(), EventSource, and XHR
2341         https://bugs.webkit.org/show_bug.cgi?id=185789
2342         <rdar://problem/40380175>
2343
2344         Reviewed by Andy Estes.
2345
2346         Have NetworkLoadChecker implement the ContentSecurityPolicyClient interface and support logging
2347         console messages, sending CSP reports, and dispatching SecurityPolicyViolation events.
2348
2349         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2350         (WebKit::NetworkConnectionToWebProcess::loadPing):
2351         * NetworkProcess/NetworkLoadChecker.cpp:
2352         (WebKit::NetworkLoadChecker::NetworkLoadChecker): Modified to take a reference to the NetworkConnectionToWebProcess,
2353         the web page ID, the web frame ID, and the resource load identifier. These details are necessary
2354         in order to implement the ContentSecurityPolicyClient interface.
2355         (WebKit::NetworkLoadChecker::isAllowedByContentSecurityPolicy): Added.
2356         (WebKit::NetworkLoadChecker::continueCheckingRequest): Write in terms of isAllowedByContentSecurityPolicy().
2357         (WebKit::NetworkLoadChecker::contentSecurityPolicy): Pass ourself as the client so that we receive
2358         delegate callbacks.
2359         (WebKit::NetworkLoadChecker::addConsoleMessage): Added.
2360         (WebKit::NetworkLoadChecker::sendCSPViolationReport): Added.
2361         (WebKit::NetworkLoadChecker::enqueueSecurityPolicyViolationEvent): Added.
2362         * NetworkProcess/NetworkLoadChecker.h:
2363         * NetworkProcess/NetworkResourceLoader.cpp:
2364         (NetworkResourceLoader::enqueueSecurityPolicyViolationEvent): Added.
2365         * NetworkProcess/NetworkResourceLoader.h:
2366         * NetworkProcess/PingLoad.cpp:
2367         (WebKit::PingLoad::PingLoad): Modified to take a reference to the NetworkConnectionToWebProcess and pass
2368         this through to the NetworkLoadChecker along with the web page ID, web frame ID and resource load identifier.
2369         * NetworkProcess/PingLoad.h:
2370         * WebProcess/WebPage/WebPage.cpp:
2371         (WebKit::WebPage::enqueueSecurityPolicyViolationEvent): Added.
2372         * WebProcess/WebPage/WebPage.h:
2373         * WebProcess/WebPage/WebPage.messages.in: Add message EnqueueSecurityPolicyViolationEvent.
2374
2375 2018-05-21  Brian Burg  <bburg@apple.com>
2376
2377         Web Automation: always return an empty cookie list if document.cookieURL() is empty
2378         https://bugs.webkit.org/show_bug.cgi?id=185838
2379         <rdar://problem/37737526>
2380
2381         Reviewed by Tim Horton.
2382
2383         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
2384         (WebKit::WebAutomationSessionProxy::getCookiesForFrame):
2385         This crashes in CFNetwork code because an empty cookie URL is not a valid input.
2386         Just return an empty list since there couldn't be any cookies returned.
2387
2388 2018-05-21  Brian Burg  <bburg@apple.com>
2389
2390         Web Automation: terminate the automation session if the network or storage process crashes
2391         https://bugs.webkit.org/show_bug.cgi?id=185827
2392         <rdar://problem/40424020>
2393
2394         Reviewed by Tim Horton.
2395
2396         If one of the processes crashes, the page may be in an undefined state and
2397         automation will fail in unpredictable ways. It's better to just give up immediately.
2398
2399         * UIProcess/WebProcessPool.cpp:
2400         (WebKit::WebProcessPool::networkProcessFailedToLaunch):
2401         (WebKit::WebProcessPool::storageProcessCrashed):
2402
2403 2018-05-21  Sihui Liu  <sihui_liu@apple.com>
2404
2405         Add a diskCacheSizeOverride accessor function on WKContextConfigurationRef
2406         https://bugs.webkit.org/show_bug.cgi?id=185826
2407         <rdar://problem/39732113>
2408
2409         Reviewed by Alex Christensen.
2410
2411         * UIProcess/API/C/WKContextConfigurationRef.cpp:
2412         (WKContextConfigurationDiskCacheSizeOverride):
2413         (WKContextConfigurationSetDiskCacheSizeOverride):
2414         * UIProcess/API/C/WKContextConfigurationRef.h:
2415
2416 2018-05-21  Jer Noble  <jer.noble@apple.com>
2417
2418         Complete fix for enabling modern EME by default
2419         https://bugs.webkit.org/show_bug.cgi?id=185770
2420         <rdar://problem/40368220>
2421
2422         Reviewed by Eric Carlson.
2423
2424         * Configurations/FeatureDefines.xcconfig:
2425
2426 2018-05-21  Sam Weinig  <sam@webkit.org>
2427
2428         Modernize RenderStyleConstants.h - Part 1
2429         https://bugs.webkit.org/show_bug.cgi?id=185809
2430
2431         Reviewed by Yusuke Suzuki.
2432
2433         * WebProcess/WebPage/ios/WebPageIOS.mm:
2434         (WebKit::WebPage::rangeForWebSelectionAtPosition):
2435         (WebKit::WebPage::getPositionInformation):
2436         Update for new enum names.
2437
2438 2018-05-21  Carlos Garcia Campos  <cgarcia@igalia.com>
2439
2440         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.21.2 release.
2441
2442         * gtk/NEWS: Add release notes for 2.21.2.
2443
2444 2018-05-21  Carlos Garcia Campos  <cgarcia@igalia.com>
2445
2446         Unreviewed, rolling out r222967.
2447
2448         It's not ready yet
2449
2450         Reverted changeset:
2451
2452         "[GTK][WPE] Add API to configure and enable resource load
2453         statistics"
2454         https://bugs.webkit.org/show_bug.cgi?id=177943
2455         https://trac.webkit.org/changeset/222967
2456
2457 2018-05-18  Commit Queue  <commit-queue@webkit.org>
2458
2459         Unreviewed, rolling out r231982.
2460         https://bugs.webkit.org/show_bug.cgi?id=185793
2461
2462         Caused layout test failures (Requested by realdawei on
2463         #webkit).
2464
2465         Reverted changeset:
2466
2467         "Complete fix for enabling modern EME by default"
2468         https://bugs.webkit.org/show_bug.cgi?id=185770
2469         https://trac.webkit.org/changeset/231982
2470
2471 2018-05-18  Brian Burg  <bburg@apple.com>
2472
2473         [Cocoa] Add missing nullability annotations to _WKAutomationSessionDelegate
2474         https://bugs.webkit.org/show_bug.cgi?id=185791
2475         <rdar://problem/40279891>
2476
2477         Reviewed by Tim Horton.
2478
2479         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h: If there is no dialog shown,
2480         then the delegate methods to return the dialog text may return a nil NSString.
2481
2482 2018-05-18  Youenn Fablet  <youenn@apple.com>
2483
2484         NetworkLoadChecker should cancel its content extension retrieval task when being destroyed
2485         https://bugs.webkit.org/show_bug.cgi?id=185661
2486         <rdar://problem/39985509>
2487
2488         Reviewed by Chris Dumez.
2489
2490         Make sure that the Content Extension retrieval callback checks that NetworkLoadChecker is alive.
2491         This allows stopping NetworkLoadChecker be ref counted.
2492         This in turns allows NetworkResourceLoader to delete its NetworkLoadChecker when being deleted as well.
2493         By doing so, we simplify the memory management of NetworkResourceLoader and NetworkLoadChecker.
2494
2495         * NetworkProcess/NetworkLoadChecker.cpp:
2496         (WebKit::NetworkLoadChecker::checkRequest):
2497         (WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad):
2498         * NetworkProcess/NetworkLoadChecker.h:
2499         (WebKit::NetworkLoadChecker::weakPtrFactory):
2500         * NetworkProcess/NetworkResourceLoader.cpp:
2501         * NetworkProcess/NetworkResourceLoader.h:
2502         * NetworkProcess/PingLoad.cpp:
2503         (WebKit::PingLoad::PingLoad):
2504         * NetworkProcess/PingLoad.h:
2505
2506 2018-05-18  Per Arne Vollan  <pvollan@apple.com>
2507
2508         WebProcess fails to launch
2509         https://bugs.webkit.org/show_bug.cgi?id=185140
2510
2511         Reviewed by Geoffrey Garen.
2512
2513         If the NSApplication runloop is not used in the WebContent process, launchServicesCheckIn() needs to be called
2514         in order for enableSandboxStyleFileQuarantine() to succeed. Determine at runtime if launchServicesCheckIn()
2515         should be called by checking if the NSApplication event loop is running.
2516
2517         * WebProcess/cocoa/WebProcessCocoa.mm:
2518         (WebKit::WebProcess::platformInitializeProcess):
2519
2520 2018-05-18  Jer Noble  <jer.noble@apple.com>
2521
2522         Complete fix for enabling modern EME by default
2523         https://bugs.webkit.org/show_bug.cgi?id=185770
2524         <rdar://problem/40368220>
2525
2526         Reviewed by Eric Carlson.
2527
2528         * Configurations/FeatureDefines.xcconfig:
2529
2530 2018-05-18  Brent Fulgham  <bfulgham@apple.com>
2531
2532         Convert ProcessPrivilege assertions to regular debug-only assertions
2533         https://bugs.webkit.org/show_bug.cgi?id=185775
2534         <rdar://problem/40372286>
2535
2536         Reviewed by Geoffrey Garen.
2537
2538         In Bug 184322 I added a number of RELEASE_ASSERT checks that certain
2539         UI-only calls were not being made in the WebContent process.
2540
2541         Measurements have shown that these RELEASE_ASSERTs have regressed performance
2542         by around 1% on some benchmarks, so we should convert them to normal asserts.
2543
2544         This patch changes the RELEASE_ASSERTs into ASSERTs.
2545
2546         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2547         (WebKit::WebProcessPool::platformInitializeWebProcess):
2548         * UIProcess/Cocoa/WebViewImpl.mm:
2549         (WebKit::WebViewImpl::WebViewImpl):
2550         (WebKit::WebViewImpl::becomeFirstResponder):
2551         (WebKit::WebViewImpl::pluginFocusOrWindowFocusChanged):
2552         (WebKit::WebViewImpl::validateUserInterfaceItem):
2553         (WebKit::WebViewImpl::startSpeaking):
2554         (WebKit::WebViewImpl::stopSpeaking):
2555         (WebKit::applicationFlagsForDrag):
2556         (WebKit::WebViewImpl::doneWithKeyEvent):
2557         * UIProcess/Gamepad/mac/UIGamepadProviderMac.mm:
2558         (WebKit::UIGamepadProvider::platformWebPageProxyForGamepadInput):
2559         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
2560         (WebKit::PluginProcessProxy::enterFullscreen):
2561         (WebKit::PluginProcessProxy::beginModal):
2562         (WebKit::PluginProcessProxy::endModal):
2563         * UIProcess/mac/DisplayLink.cpp:
2564         (WebKit::DisplayLink::DisplayLink):
2565         (WebKit::DisplayLink::~DisplayLink):
2566         * UIProcess/mac/WebPageProxyMac.mm:
2567         (WebKit::WebPageProxy::getIsSpeaking):
2568         (WebKit::WebPageProxy::speak):
2569         (WebKit::WebPageProxy::stopSpeaking):
2570         (WebKit::WebPageProxy::startDisplayLink):
2571         * UIProcess/mac/WebPopupMenuProxyMac.mm:
2572         (WebKit::WebPopupMenuProxyMac::showPopupMenu):
2573
2574 2018-05-18  Eric Carlson  <eric.carlson@apple.com>
2575
2576         Handle failure to extend sandbox gracefully
2577         https://bugs.webkit.org/show_bug.cgi?id=185779
2578         <rdar://problem/40316349>
2579
2580         Reviewed by Brent Fulgham.
2581
2582         * UIProcess/API/Cocoa/WKWebView.mm:
2583         (-[WKWebView _denyNextUserMediaRequest]): 
2584         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2585
2586         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2587         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Don't append
2588         the request to m_grantedRequests if it failed.
2589         (WebKit::UserMediaPermissionRequestManagerProxy::grantAccess): Deny request if willCreateMediaStream
2590         fails.
2591         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
2592
2593         * UIProcess/UserMediaProcessManager.cpp:
2594         (WebKit::UserMediaProcessManager::willCreateMediaStream): Don't try to extend sandbox if
2595         we fail to allocate all necessary handles.
2596         * UIProcess/UserMediaProcessManager.h:
2597         (WebKit::UserMediaProcessManager::denyNextUserMediaRequest): New, for testing.
2598
2599 2018-05-18  Antoine Quint  <graouts@apple.com>
2600
2601         [Web Animations] Turn Web Animations with CSS integration on for test runners
2602         https://bugs.webkit.org/show_bug.cgi?id=184819
2603         <rdar://problem/39597337>
2604
2605         Unreviewed. Rolling out the patch for this bug, it caused some flaky timeouts for animation suspension tests.
2606
2607         * Shared/WebPreferences.yaml:
2608
2609 2018-05-18  Wenson Hsieh  <wenson_hsieh@apple.com>
2610
2611         [Extra zoom mode] Clearing text fields should dispatch input events of type "deleteContent"
2612         https://bugs.webkit.org/show_bug.cgi?id=185769
2613         <rdar://problem/40368261>
2614
2615         Reviewed by Tim Horton.
2616
2617         When setting the text of the currently focused element to the empty string, just delete the text instead of
2618         pretending to insert an empty string. This mimics deleting content using the delete key on macOS, and fires an
2619         input event with inputType "deleteContent" instead of "insertText".
2620
2621         Test: fast/forms/extrazoom/delete-content-in-text-field.html
2622
2623         * WebProcess/WebPage/WebPage.cpp:
2624         (WebKit::WebPage::setTextAsync):
2625
2626 2018-05-18  Keith Rollin  <krollin@apple.com>
2627
2628         Renamed "trackNetworkActivity" to "tracksResourceLoadMilestones"
2629         https://bugs.webkit.org/show_bug.cgi?id=185523
2630         <rdar://problem/40136361>
2631
2632         Reviewed by Geoffrey Garen.
2633
2634         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2635         (WebKit::networkActivityTrackingEnabled):
2636         * NetworkProcess/NetworkProcess.cpp:
2637         (WebKit::NetworkProcess::initializeNetworkProcess):
2638         * NetworkProcess/NetworkProcess.h:
2639         (WebKit::NetworkProcess::tracksResourceLoadMilestones const):
2640         (WebKit::NetworkProcess::trackNetworkActivity const): Deleted.
2641         * NetworkProcess/NetworkProcessCreationParameters.cpp:
2642         (WebKit::NetworkProcessCreationParameters::encode const):
2643         (WebKit::NetworkProcessCreationParameters::decode):
2644         * NetworkProcess/NetworkProcessCreationParameters.h:
2645         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2646         (API::ProcessPoolConfiguration::copy):
2647         * UIProcess/API/APIProcessPoolConfiguration.h:
2648         * UIProcess/API/C/WKContextConfigurationRef.cpp:
2649         (WKContextConfigurationTracksResourceLoadMilestones):
2650         (WKContextConfigurationSetTracksResourceLoadMilestones):
2651         (WKContextConfigurationTrackNetworkActivity): Deleted.
2652         (WKContextConfigurationSetTrackNetworkActivity): Deleted.
2653         * UIProcess/API/C/WKContextConfigurationRef.h:
2654         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
2655         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
2656         (-[_WKProcessPoolConfiguration tracksResourceLoadMilestones]):
2657         (-[_WKProcessPoolConfiguration setTracksResourceLoadMilestones:]):
2658         (-[_WKProcessPoolConfiguration trackNetworkActivity]): Deleted.
2659         (-[_WKProcessPoolConfiguration setTrackNetworkActivity:]): Deleted.
2660         * UIProcess/WebProcessPool.cpp:
2661         (WebKit::WebProcessPool::ensureNetworkProcess):
2662
2663 2018-05-18  Chris Dumez  <cdumez@apple.com>
2664
2665         Avoid keeping the frame alive when ref'ing a WindowProxy
2666         https://bugs.webkit.org/show_bug.cgi?id=185737
2667         <rdar://problem/40004666>
2668
2669         Reviewed by Sam Weinig.
2670
2671         * WebProcess/Plugins/PluginView.cpp:
2672         (WebKit::PluginView::windowScriptNPObject):
2673
2674 2018-05-18  Youenn Fablet  <youenn@apple.com>
2675
2676         -Wmemset-elt-size warning in LibWebRTCSocket constructor
2677         https://bugs.webkit.org/show_bug.cgi?id=185555
2678         <rdar://problem/40217250>
2679
2680         Reviewed by Darin Adler.
2681
2682         GetOption implementation was broken in that it was not initializing properly its array of options.
2683         This patch fixes it by using an array of optional<int> which are initialized by default.
2684         When no value is set, we return the error code -1.
2685         In theory, we should go to NetworkProcess to get the actual value.
2686         Since GetOption is not used in practice, we just do this best effort implementation of storing previously set values.
2687
2688         * WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
2689         (WebKit::LibWebRTCSocket::LibWebRTCSocket):
2690         (WebKit::LibWebRTCSocket::GetOption):
2691         * WebProcess/Network/webrtc/LibWebRTCSocket.h:
2692
2693 2018-05-18  Antoine Quint  <graouts@apple.com>
2694
2695         [Web Animations] Turn Web Animations with CSS integration on for test runners
2696         https://bugs.webkit.org/show_bug.cgi?id=184819
2697         <rdar://problem/39597337>
2698
2699         Reviewed by Jon Lee.
2700
2701         * Shared/WebPreferences.yaml: Leave Web Animations off by default, it's up to clients
2702         to turn it on.
2703
2704 2018-05-18  Fujii Hironori  <Hironori.Fujii@sony.com>
2705
2706         [Curl] Remove unused SystemProxyWin.cpp
2707         https://bugs.webkit.org/show_bug.cgi?id=185224
2708
2709         Reviewed by Antti Koivisto.
2710
2711         SystemProxyWin is not used at the moment. Remove it.
2712
2713         * NetworkProcess/win/SystemProxyWin.cpp: Removed.
2714         * NetworkProcess/win/SystemProxyWin.h: Removed.
2715         * PlatformWin.cmake: Removed SystemProxyWin.cpp.
2716
2717 2018-05-17  Nan Wang  <n_wang@apple.com>
2718
2719         AX: [macOS] Expose the primary screen height through AX API
2720         https://bugs.webkit.org/show_bug.cgi?id=185742
2721
2722         Reviewed by Chris Fleizach.
2723
2724         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
2725         (-[WKAccessibilityWebPageObject accessibilityAttributeNames]):
2726         (-[WKAccessibilityWebPageObject accessibilityAttributeValue:]):
2727
2728 2018-05-17  Alex Christensen  <achristensen@webkit.org>
2729
2730         Use CompletionHandlers for DelayedReplies
2731         https://bugs.webkit.org/show_bug.cgi?id=182269
2732
2733         Reviewed by Youenn Fablet.
2734
2735         DelayedReplies should be a noncopyable, non-refcountable type.  They should be
2736         called once and only once.  This is what CompletionHandlers are for.
2737
2738         No change in behavior.  Just cleaner code.
2739
2740         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2741         (WebKit::NetworkConnectionToWebProcess::performSynchronousLoad):
2742         * NetworkProcess/NetworkConnectionToWebProcess.h:
2743         * NetworkProcess/NetworkResourceLoader.cpp:
2744         (WebKit::NetworkResourceLoader::SynchronousLoadData::SynchronousLoadData):
2745         (WebKit::sendReplyToSynchronousRequest):
2746         (WebKit::NetworkResourceLoader::NetworkResourceLoader):
2747         * NetworkProcess/NetworkResourceLoader.h:
2748         * Platform/IPC/HandleMessage.h:
2749         (IPC::callMemberFunctionImpl):
2750         (IPC::callMemberFunction):
2751         (IPC::handleMessageDelayed):
2752         * PluginProcess/PluginControllerProxy.cpp:
2753         (WebKit::PluginControllerProxy::setInitializationReply):
2754         (WebKit::PluginControllerProxy::takeInitializationReply):
2755         * PluginProcess/PluginControllerProxy.h:
2756         * PluginProcess/WebProcessConnection.cpp:
2757         (WebKit::WebProcessConnection::destroyPlugin):
2758         (WebKit::WebProcessConnection::createPlugin):
2759         (WebKit::WebProcessConnection::createPluginAsynchronously):
2760         * PluginProcess/WebProcessConnection.h:
2761         * Scripts/webkit/LegacyMessageReceiver-expected.cpp:
2762         (Messages::WebPage::GetPluginProcessConnection::send):
2763         (Messages::WebPage::TestMultipleAttributes::send):
2764         (Messages::WebPage::GetPluginProcessConnection::DelayedReply::DelayedReply): Deleted.
2765         (Messages::WebPage::GetPluginProcessConnection::DelayedReply::~DelayedReply): Deleted.
2766         (Messages::WebPage::GetPluginProcessConnection::DelayedReply::send): Deleted.
2767         (Messages::WebPage::TestMultipleAttributes::DelayedReply::DelayedReply): Deleted.
2768         (Messages::WebPage::TestMultipleAttributes::DelayedReply::~DelayedReply): Deleted.
2769         (Messages::WebPage::TestMultipleAttributes::DelayedReply::send): Deleted.
2770         * Scripts/webkit/LegacyMessages-expected.h:
2771         * Scripts/webkit/MessageReceiver-expected.cpp:
2772         (Messages::WebPage::GetPluginProcessConnection::send):
2773         (Messages::WebPage::TestMultipleAttributes::send):
2774         (Messages::WebPage::GetPluginProcessConnection::DelayedReply::DelayedReply): Deleted.
2775         (Messages::WebPage::GetPluginProcessConnection::DelayedReply::~DelayedReply): Deleted.
2776         (Messages::WebPage::GetPluginProcessConnection::DelayedReply::send): Deleted.
2777         (Messages::WebPage::TestMultipleAttributes::DelayedReply::DelayedReply): Deleted.
2778         (Messages::WebPage::TestMultipleAttributes::DelayedReply::~DelayedReply): Deleted.
2779         (Messages::WebPage::TestMultipleAttributes::DelayedReply::send): Deleted.
2780         * Scripts/webkit/Messages-expected.h:
2781         * Scripts/webkit/messages.py:
2782         * UIProcess/Network/NetworkProcessProxy.cpp:
2783         (WebKit::NetworkProcessProxy::getNetworkProcessConnection):
2784         (WebKit::NetworkProcessProxy::networkProcessCrashed):
2785         (WebKit::NetworkProcessProxy::networkProcessFailedToLaunch):
2786         (WebKit::NetworkProcessProxy::didCreateNetworkConnectionToWebProcess):
2787         * UIProcess/Network/NetworkProcessProxy.h:
2788         * UIProcess/Plugins/PluginProcessManager.cpp:
2789         (WebKit::PluginProcessManager::getPluginProcessConnection):
2790         * UIProcess/Plugins/PluginProcessManager.h:
2791         * UIProcess/Plugins/PluginProcessProxy.cpp:
2792         (WebKit::PluginProcessProxy::getPluginProcessConnection):
2793         (WebKit::PluginProcessProxy::pluginProcessCrashedOrFailedToLaunch):
2794         (WebKit::PluginProcessProxy::didCreateWebProcessConnection):
2795         * UIProcess/Plugins/PluginProcessProxy.h:
2796         * UIProcess/Storage/StorageProcessProxy.cpp:
2797         (WebKit::StorageProcessProxy::getStorageProcessConnection):
2798         (WebKit::StorageProcessProxy::didClose):
2799         (WebKit::StorageProcessProxy::didCreateStorageToWebProcessConnection):
2800         * UIProcess/Storage/StorageProcessProxy.h:
2801         * UIProcess/WebPageProxy.cpp:
2802         (WebKit::ExceededDatabaseQuotaRecords::createRecord):
2803         (WebKit::WebPageProxy::receivedPolicyDecision):
2804         (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
2805         (WebKit::WebPageProxy::createNewPage):
2806         (WebKit::WebPageProxy::runJavaScriptAlert):
2807         (WebKit::WebPageProxy::runJavaScriptConfirm):
2808         (WebKit::WebPageProxy::runJavaScriptPrompt):
2809         (WebKit::WebPageProxy::webGLPolicyForURL):
2810         (WebKit::WebPageProxy::resolveWebGLPolicyForURL):
2811         (WebKit::WebPageProxy::getToolbarsAreVisible):
2812         (WebKit::WebPageProxy::getMenuBarIsVisible):
2813         (WebKit::WebPageProxy::getStatusBarIsVisible):
2814         (WebKit::WebPageProxy::getWindowFrame):
2815         (WebKit::WebPageProxy::screenToRootView):
2816         (WebKit::WebPageProxy::rootViewToScreen):
2817         (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel):
2818         (WebKit::WebPageProxy::exceededDatabaseQuota):
2819         (WebKit::WebPageProxy::reachedApplicationCacheOriginQuota):
2820         * UIProcess/WebPageProxy.h:
2821         * UIProcess/WebProcessPool.cpp:
2822         (WebKit::WebProcessPool::networkProcessCrashed):
2823         (WebKit::WebProcessPool::getNetworkProcessConnection):
2824         (WebKit::WebProcessPool::getStorageProcessConnection):
2825         * UIProcess/WebProcessPool.h:
2826         * UIProcess/WebProcessProxy.cpp:
2827         (WebKit::WebProcessProxy::getPluginProcessConnection):
2828         (WebKit::WebProcessProxy::getNetworkProcessConnection):
2829         (WebKit::WebProcessProxy::getStorageProcessConnection):
2830         * UIProcess/WebProcessProxy.h:
2831         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2832         (WebKit::WebSWContextManagerConnection::syncTerminateWorker):
2833         * WebProcess/Storage/WebSWContextManagerConnection.h:
2834         * WebProcess/WebPage/WebPage.h:
2835         * WebProcess/WebPage/ios/WebPageIOS.mm:
2836         (WebKit::WebPage::computePagesForPrintingAndDrawToPDF):
2837
2838 2018-05-17  Jer Noble  <jer.noble@apple.com>
2839
2840         CRASH in -[WKFullScreenViewController _manager]
2841         https://bugs.webkit.org/show_bug.cgi?id=185745
2842         <rdar://problem/39195241>
2843
2844         Reviewed by Eric Carlson.
2845
2846         Protect against WKFullScreenViewController outliving WKWebView by making its
2847         _webView property weak. Additionally, add a sanity-check RetainPtr where _webView
2848         is referenced multiple times within a function.
2849
2850         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
2851         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
2852         (-[WKFullScreenWindowController initWithWebView:]):
2853         (-[WKFullScreenWindowController enterFullScreen]):
2854         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
2855         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
2856         (-[WKFullScreenWindowController _completedExitFullScreen]):
2857         (-[WKFullScreenWindowController close]):
2858         (-[WKFullScreenWindowController webViewDidRemoveFromSuperviewWhileInFullscreen]):
2859         (-[WKFullScreenWindowController _exitFullscreenImmediately]):
2860         (-[WKFullScreenWindowController _isSecure]):
2861         (-[WKFullScreenWindowController _serverTrust]):
2862         (-[WKFullScreenWindowController _updateLocationInfo]):
2863         (-[WKFullScreenWindowController _manager]):
2864         (-[WKFullScreenWindowController _startToDismissFullscreenChanged:]):
2865
2866 2018-05-17  Brent Fulgham  <bfulgham@apple.com>
2867
2868         Correct default for StorageAccess API
2869         https://bugs.webkit.org/show_bug.cgi?id=185748
2870         <rdar://problem/40220659>
2871
2872         Reviewed by Dean Jackson.
2873
2874         Flip the default state to 'true' so that the new "sticky" state
2875         for Storage Access API and attributing user interaction for
2876         Storage Access API use is applied by default.
2877
2878         * Shared/WebPreferences.yaml:
2879
2880 2018-05-17  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2881
2882         [WPE] Implement and enable FULLSCREEN_API
2883         https://bugs.webkit.org/show_bug.cgi?id=185676
2884
2885         Reviewed by Žan Doberšek.
2886
2887         Do the initial implementation of FULLSCREEN_API for WPE and
2888         enable the CMake option by default.
2889
2890         Most of the layout tests (55 of 58) are passing and the feature
2891         seems to work fine on different websites that use it.
2892
2893         * UIProcess/API/wpe/PageClientImpl.cpp:
2894         (WebKit::PageClientImpl::fullScreenManagerProxyClient):
2895         (WebKit::PageClientImpl::closeFullScreenManager):
2896         (WebKit::PageClientImpl::isFullScreen):
2897         (WebKit::PageClientImpl::enterFullScreen):
2898         (WebKit::PageClientImpl::exitFullScreen):
2899         (WebKit::PageClientImpl::beganEnterFullScreen):
2900         (WebKit::PageClientImpl::beganExitFullScreen):
2901         * UIProcess/API/wpe/PageClientImpl.h:
2902         * UIProcess/API/wpe/WPEView.h:
2903         (WKWPE::View::isFullScreen):
2904         (WKWPE::View::setFullScreen):
2905
2906 2018-05-17  Jiewen Tan  <jiewen_tan@apple.com>
2907
2908         Convert CertificateInfo into Credential in UI Process instead of Networking Process
2909         https://bugs.webkit.org/show_bug.cgi?id=185662
2910         <rdar://problem/40275561>
2911
2912         Reviewed by Alex Christensen.
2913
2914         Right now we convert CertificateInfo into Credential in the very last stage of client certificate authentication process
2915         when it reaches Networking Process. This patch moves that conversion earlier in UI Process such that we don't have to
2916         pass both Credential and CertificateInfo to Networking Process.
2917
2918         CertificateInfo is only used in macOS for C API specifically. WK2 includes macOS/iOS relies on NSURLCredential/WebCore::Credential
2919         solely. WK2 has already exercised the ability of using WebCore::Credential to do client certficate authentication. This patch therefore
2920         takes advantage of that. It converts CertficateInfo objects into Credential objects right after WebCredential is initialized, and then merge
2921         any code paths that utilizes CertficateInfo into ones that uses WebCore::Credential.
2922
2923         Covered by existing tests.
2924
2925         * Shared/Authentication/AuthenticationManager.cpp:
2926         (WebKit::AuthenticationManager::useCredentialForChallenge):
2927         (WebKit::AuthenticationManager::useCredentialForSingleChallenge):
2928         (WebKit::AuthenticationManager::tryUseCertificateInfoForChallenge): Deleted.
2929         * Shared/Authentication/AuthenticationManager.h:
2930         * Shared/Authentication/AuthenticationManager.messages.in:
2931         * UIProcess/Authentication/AuthenticationChallengeProxy.cpp:
2932         (WebKit::AuthenticationChallengeProxy::useCredential):
2933         * UIProcess/Authentication/WebCredential.cpp:
2934         (WebKit::WebCredential::WebCredential):
2935         (WebKit::WebCredential::certificateInfo): Deleted.
2936         * UIProcess/Authentication/WebCredential.h:
2937         (WebKit::WebCredential::create):
2938         * UIProcess/Authentication/mac/WebCredentialMac.mm: Renamed from Source/WebKit/Shared/Authentication/mac/AuthenticationManager.mac.mm.
2939         (WebKit::leafCertificate):
2940         (WebKit::chain):
2941         (WebKit::WebCredential::WebCredential):
2942         * WebKit.xcodeproj/project.pbxproj:
2943
2944 2018-05-17  Jeremy Jones  <jeremyj@apple.com>
2945
2946         Ensure valid rects for fullsceen animation.
2947         https://bugs.webkit.org/show_bug.cgi?id=185736
2948         rdar://problem/40320174
2949
2950         Reviewed by Jer Noble.
2951
2952         Protect against zero width and height since those can make for NANs in the animation transforms.
2953
2954         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
2955         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
2956         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
2957
2958 2018-05-17  Jer Noble  <jer.noble@apple.com>
2959
2960         Turn Modern EME API on by default and remove it as an experimental feature
2961         https://bugs.webkit.org/show_bug.cgi?id=185693
2962         <rdar://problem/39954396>
2963
2964         Reviewed by Eric Carlson.
2965
2966         * Shared/WebPreferences.yaml:
2967
2968 2018-05-17  Dean Jackson  <dino@apple.com>
2969
2970         Safari optimized flow should be releasing viewer to prevent memory growth with subsequent launches/closes
2971         https://bugs.webkit.org/show_bug.cgi?id=185722
2972         <rdar://problem/40247351>
2973
2974         Reviewed by Antoine Quint.
2975
2976         I made a rookie mistake in the original patch: I was holding a strong
2977         reference to "self" in a block, which was causing a retain cycle.
2978         Replace that with a WeakObjCPtr.
2979
2980         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
2981         (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
2982
2983 2018-05-16  Brent Fulgham  <bfulgham@apple.com>
2984
2985         REGRESSION(r229093)[macOS] Allow network-outbound for syslog use
2986         https://bugs.webkit.org/show_bug.cgi?id=185703
2987         <rdar://problem/39778918>
2988
2989         Reviewed by Eric Carlson.
2990
2991         In r229093 I removed the 'network-outbound' permission for syslog use.
2992         Further testing has shown that this is still needed for subsystem
2993         logging in our bundle loading code.
2994
2995         This patch re-enabled network-outbound for syslog.
2996
2997         * WebProcess/com.apple.WebProcess.sb.in:
2998
2999 2018-05-16  Andy VanWagoner  <andy@vanwagoner.family>
3000
3001         Add support for Intl NumberFormat formatToParts
3002         https://bugs.webkit.org/show_bug.cgi?id=185375
3003
3004         Reviewed by Yusuke Suzuki.
3005
3006         Add flag for NumberFormat formatToParts.
3007
3008         * Configurations/FeatureDefines.xcconfig:
3009
3010 2018-05-16  Andy Estes  <aestes@apple.com>
3011
3012         [Wi-Fi Assertions] Adopt WiFiAssertionHolderAdditions
3013         https://bugs.webkit.org/show_bug.cgi?id=185685
3014         <rdar://problem/40136681>
3015
3016         Reviewed by Sam Weinig.
3017
3018         * NetworkProcess/cocoa/WiFiAssertionHolder.cpp:
3019         (WebKit::WiFiAssertionHolder::WiFiAssertionHolder):
3020         (WebKit::WiFiAssertionHolder::~WiFiAssertionHolder):
3021         (WebKit::ensureWiFiManagerClient): Deleted.
3022
3023 2018-05-16  Fujii Hironori  <Hironori.Fujii@sony.com>
3024
3025         [Win] Implement WebPage::handleEditingKeyboardEvent
3026         https://bugs.webkit.org/show_bug.cgi?id=185327
3027
3028         Reviewed by Alexey Proskuryakov.
3029
3030         * WebProcess/WebPage/win/WebPageWin.cpp:
3031         (WebKit::WebPage::handleEditingKeyboardEvent): Copied from WebKitLegacy.
3032
3033 2018-05-16  Sihui Liu  <sihui_liu@apple.com>
3034
3035         Session cookies aren't reliably set when using default WKWebSiteDataStore
3036         https://bugs.webkit.org/show_bug.cgi?id=185624
3037         <rdar://problem/39111626>
3038
3039         Reviewed by Geoffrey Garen.
3040
3041         Session cookies of default session were set in UI Process when there was no process pool, 
3042         but they were not synced (or synced slowly to) Network Process. To make these cookies visible
3043         as soon as they were set through API, we could manually set those cookies in Network Process
3044         during its initilization. 
3045
3046         * NetworkProcess/mac/RemoteNetworkingContext.mm:
3047         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
3048         * UIProcess/API/APIHTTPCookieStore.cpp:
3049         (API::HTTPCookieStore::cookies):
3050         (API::HTTPCookieStore::setCookie):
3051         (API::HTTPCookieStore::deleteCookie):
3052         * UIProcess/WebProcessPool.cpp:
3053         (WebKit::WebProcessPool::ensureNetworkProcess):
3054         (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
3055         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3056         (WebKit::WebsiteDataStore::clearPendingCookies):
3057         * UIProcess/WebsiteData/WebsiteDataStore.h:
3058
3059 2018-05-16  Chris Nardi  <cnardi@chromium.org>
3060
3061         Remove Document#selectedStylesheetSet/preferredStylesheetSet
3062         https://bugs.webkit.org/show_bug.cgi?id=185381
3063
3064         Reviewed by Darin Adler.
3065
3066         Make API methods for Document#selectedStylesheetSet/preferredStylesheetSet do nothing.
3067
3068         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.h:
3069         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp:
3070         (webkit_dom_document_set_property):
3071         (webkit_dom_document_get_property):
3072         (webkit_dom_document_get_preferred_stylesheet_set):
3073         (webkit_dom_document_get_selected_stylesheet_set):
3074         (webkit_dom_document_set_selected_stylesheet_set):
3075
3076 2018-05-16  Alberto Garcia  <berto@igalia.com>
3077
3078         [CMake] Properly detect compiler flags, needed libs, and fallbacks for usage of 64-bit atomic operations
3079         https://bugs.webkit.org/show_bug.cgi?id=182622
3080
3081         Reviewed by Michael Catanzaro.
3082
3083         Move the test to determine whether we need to link against
3084         libatomic to the common file WebKitCompilerFlags.cmake so it can
3085         also be used for JavaScriptCore.
3086
3087         * CMakeLists.txt:
3088
3089 2018-05-15  Yusuke Suzuki  <utatane.tea@gmail.com>
3090
3091         [JSC] Check TypeInfo first before calling getCallData when we would like to check whether given object is a function
3092         https://bugs.webkit.org/show_bug.cgi?id=185601
3093
3094         Reviewed by Saam Barati.
3095
3096         * WebProcess/Plugins/Netscape/JSNPObject.h:
3097
3098 2018-05-15  Sihui Liu  <sihui_liu@apple.com>
3099
3100         StorageManager::deleteLocalStorageOriginsModifiedSince: database files get deleted before database connections close
3101         https://bugs.webkit.org/show_bug.cgi?id=185671
3102
3103         Reviewed by Geoffrey Garen.
3104
3105         We should delete database files before closing databases.
3106
3107         * UIProcess/WebStorage/LocalStorageDatabase.cpp:
3108         (WebKit::LocalStorageDatabase::updateDatabaseWithChangedItems):
3109         * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
3110         (WebKit::LocalStorageDatabaseTracker::databasesModifiedSince):
3111         (WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince): Deleted.
3112         * UIProcess/WebStorage/LocalStorageDatabaseTracker.h:
3113         * UIProcess/WebStorage/StorageManager.cpp:
3114         (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
3115
3116 2018-05-15  Dean Jackson  <dino@apple.com>
3117
3118         Launch System Preview as the download starts, rather than waiting for a response
3119         https://bugs.webkit.org/show_bug.cgi?id=185669
3120         <rdar://problem/40278181>
3121
3122         Reviewed by Tim Horton.
3123
3124         We were waiting for the RequestResponse to get a MIME-type before
3125         launching the system preview. This causes an annoying delay.
3126
3127         Instead, assume that the system preview is one of the handled
3128         mime types and launch the viewer immediately. If it gets something it
3129         didn't expect, it will show an error.
3130
3131         * UIProcess/Cocoa/DownloadClient.mm:
3132         (WebKit::DownloadClient::didStart):
3133         (WebKit::DownloadClient::didReceiveResponse):
3134         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
3135         (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
3136         (WebKit::SystemPreviewController::start): Small cleanup to ensure we
3137         don't try to present twice (this shouldn't happen).
3138
3139 2018-05-15  Dean Jackson  <dino@apple.com>
3140
3141         Post-review cleanup for 185459
3142         https://bugs.webkit.org/show_bug.cgi?id=185665
3143         <rdar://problem/40276689>
3144
3145         Reviewed by Tim Horton.
3146
3147         Jon made some comments in 185459 that I'm addressing here.
3148
3149         * UIProcess/Cocoa/DownloadClient.h:
3150         * UIProcess/Cocoa/DownloadClient.mm: Guard the activity token for iOS
3151         in a way that means it will still work ok on macOS.
3152         (WebKit::DownloadClient::didStart):
3153         (WebKit::DownloadClient::processDidCrash):
3154         (WebKit::DownloadClient::didFinish):
3155         (WebKit::DownloadClient::didFail):
3156         (WebKit::DownloadClient::didCancel):
3157         (WebKit::DownloadClient::takeActivityToken):
3158         (WebKit::DownloadClient::releaseActivityTokenIfNecessary):
3159         (WebKit::DownloadClient::releaseActivityToken): Deleted.
3160
3161         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: Add an early return.
3162         (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
3163
3164 2018-05-15  Tadeu Zagallo  <tzagallo@apple.com>
3165
3166         Update touch event tracking types on every touch
3167         https://bugs.webkit.org/show_bug.cgi?id=184250
3168         <rdar://problem/39145092>
3169
3170         Reviewed by Geoffrey Garen.
3171
3172         The tracking types for touch events were only update on touchstart, which meant that event
3173         listeners added after the touchstart would always be treated as passive, even if explicitly
3174         setting passive to false.
3175
3176         * UIProcess/WebPageProxy.cpp:
3177         (WebKit::WebPageProxy::handleTouchEventSynchronously):
3178         (WebKit::WebPageProxy::handleTouchEvent):
3179
3180 2018-05-15  Per Arne Vollan  <pvollan@apple.com>
3181
3182         Pause display links when window is not visible.
3183         https://bugs.webkit.org/show_bug.cgi?id=185627
3184         <rdar://problem/39401106>
3185
3186         Reviewed by Simon Fraser.
3187
3188         Pause/resume display links created in the UI process when the window is hidden/shown.
3189
3190         * UIProcess/WebPageProxy.cpp:
3191         (WebKit::WebPageProxy::dispatchActivityStateChange):
3192         * UIProcess/mac/DisplayLink.cpp:
3193         (WebKit::DisplayLink::pause):
3194         (WebKit::DisplayLink::resume):
3195         * UIProcess/mac/DisplayLink.h:
3196
3197 2018-05-15  Dean Jackson  <dino@apple.com>
3198
3199         Provide UIView and UIImage for zoom transition
3200         https://bugs.webkit.org/show_bug.cgi?id=185655
3201         <rdar://problem/40267224>
3202
3203         Reviewed by Antoine Quint.
3204
3205         Provide a UIView* for the frameForPreviewItem to use as a source view.
3206         Also implement the transitionImageForPreviewItem delegate, even though
3207         we're returning nil.
3208
3209         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
3210         (-[_WKPreviewControllerDelegate previewController:frameForPreviewItem:inSourceView:]):
3211         (-[_WKPreviewControllerDelegate previewController:transitionImageForPreviewItem:contentRect:]):
3212
3213 2018-05-15  Daniel Bates  <dabates@apple.com>
3214
3215         Fix the Apple Internal build
3216
3217         Make a similar change to WebKit as I did for LegacyWebKit in r231777. See <rdar://problem/40237873> for more details.
3218
3219         * UIProcess/mac/WKFullScreenWindowController.mm:
3220         (-[WKFullScreenWindowController enterFullScreen:]):
3221         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]):
3222         (-[WKFullScreenWindowController exitFullScreen]):
3223         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
3224         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
3225         (-[WKFullScreenWindowController completeFinishExitFullScreenAnimationAfterRepaint]):
3226         (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]):
3227         (-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]):
3228
3229 2018-05-15  Megan Gardner  <megan_gardner@apple.com>
3230
3231         Clear selections from web content with single tap
3232         https://bugs.webkit.org/show_bug.cgi?id=185634
3233
3234         Reviewed by Tim Horton.
3235         
3236         With the switch to the single text selection assistant, we were not correctly clearing the selection when a
3237         single tap happened.
3238
3239         * UIProcess/ios/WKContentViewInteraction.mm:
3240         (-[WKContentView _singleTapCommited:]):
3241
3242 2018-05-15  Antoine Quint  <graouts@apple.com>
3243
3244         [Web Animations] Expose Web Animations CSS integration as an experimental feature
3245         https://bugs.webkit.org/show_bug.cgi?id=185647
3246
3247         Reviewed by Dean Jackson.
3248
3249         Rename the Web Animations CSS integration flag.
3250
3251         * Shared/WebPreferences.yaml:
3252         * UIProcess/API/C/WKPreferences.cpp:
3253         (WKPreferencesSetWebAnimationsCSSIntegrationEnabled):
3254         (WKPreferencesGetWebAnimationsCSSIntegrationEnabled):
3255         (WKPreferencesSetCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled): Deleted.
3256         (WKPreferencesGetCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled): Deleted.
3257         * UIProcess/API/C/WKPreferencesRefPrivate.h:
3258         * UIProcess/API/Cocoa/WKPreferences.mm:
3259         (-[WKPreferences _setWebAnimationsCSSIntegrationEnabled:]):
3260         (-[WKPreferences _webAnimationsCSSIntegrationEnabled]):
3261         (-[WKPreferences _setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled:]): Deleted.
3262         (-[WKPreferences _cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled]): Deleted.
3263         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
3264         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3265         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
3266         (WebKit::InjectedBundle::setWebAnimationsCSSIntegrationEnabled):
3267         (WebKit::InjectedBundle::setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled): Deleted.
3268         * WebProcess/InjectedBundle/InjectedBundle.h:
3269
3270 2018-05-15  Dean Jackson  <dino@apple.com>
3271
3272         Update animation when presenting QuickLook
3273         https://bugs.webkit.org/show_bug.cgi?id=185648
3274         <rdar://problem/39652624>
3275
3276         Reviewed by Antoine Quint.
3277
3278         Implement the QuickLook delegate on _WKPreviewControllerDelegate that
3279         produces a zoom-like animation when the QLPreviewController appears.
3280
3281         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
3282         (-[_WKPreviewControllerDelegate previewController:frameForPreviewItem:inSourceView:]):
3283         * UIProcess/SystemPreviewController.h: Add a reference back to the page, so that
3284         the delegate implementation can access the presentingViewController.
3285         (WebKit::SystemPreviewController::page):
3286
3287 2018-05-14  Dean Jackson  <dino@apple.com>
3288
3289         Download and present System Preview
3290         https://bugs.webkit.org/show_bug.cgi?id=185459
3291         <rdar://problem/40079228>
3292
3293         Reviewed by Tim Horton.
3294
3295         Extend DownloadClient so that it can handle the case where
3296         the download was triggered by a System Preview. In this situation
3297         the result (and progress) are piped into QuickLook via the SystemPreviewController.
3298
3299         The DownloadProxy class is also extended to handle the destination
3300         filename and the size of the content.
3301
3302         Lastly, SystemPreviewController is updated to have a start(), show()
3303         and cancel() interface, and no longer adjusts page navigation.
3304
3305         * UIProcess/Cocoa/DownloadClient.h:
3306         * UIProcess/Cocoa/DownloadClient.mm: Handle the SystemPreview case, which
3307         doesn't have a download delegate, but instead needs to communicate with
3308         the SystemPreviewController, if one exists.
3309         (WebKit::DownloadClient::didStart):
3310         (WebKit::DownloadClient::didReceiveResponse):
3311         (WebKit::DownloadClient::didReceiveData):
3312         (WebKit::DownloadClient::didCreateDestination):
3313         (WebKit::DownloadClient::processDidCrash):
3314         (WebKit::DownloadClient::decideDestinationWithSuggestedFilename):
3315         (WebKit::DownloadClient::didFinish):
3316         (WebKit::DownloadClient::didFail):
3317         (WebKit::DownloadClient::didCancel):
3318         (WebKit::DownloadClient::releaseActivityToken):
3319
3320         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: Implement the new API.
3321         (-[_WKPreviewControllerDataSource initWithMIMEType:]):
3322         (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
3323         (-[_WKPreviewControllerDataSource setProgress:]):
3324         (-[_WKPreviewControllerDataSource finish:]):
3325         (-[_WKPreviewControllerDelegate previewControllerDidDismiss:]):
3326         (WebKit::SystemPreviewController::start):
3327         (WebKit::SystemPreviewController::updateProgress):
3328         (WebKit::SystemPreviewController::finish):
3329         (WebKit::SystemPreviewController::cancel):
3330         (-[_WKPreviewControllerDataSource initWithURL:]): Deleted.
3331         (-[_WKPreviewControllerDelegate previewControllerWillDismiss:]): Deleted.
3332         (WebKit::SystemPreviewController::canPreview const): Deleted.
3333         (WebKit::SystemPreviewController::showPreview): Deleted.
3334         * UIProcess/Downloads/DownloadProxy.h: Track the destination file by name
3335         and size. Also expose a helper to identify system preview downloads.
3336         (WebKit::DownloadProxy::destinationFilename const):
3337         (WebKit::DownloadProxy::setDestinationFilename):
3338         (WebKit::DownloadProxy::expectedContentLength const):
3339         (WebKit::DownloadProxy::setExpectedContentLength):
3340         (WebKit::DownloadProxy::bytesLoaded const):
3341         (WebKit::DownloadProxy::setBytesLoaded):
3342         (WebKit::DownloadProxy::isSystemPreviewDownload const):
3343
3344         * UIProcess/SystemPreviewController.cpp: New API.
3345         (WebKit::SystemPreviewController::canPreview const):
3346         (WebKit::SystemPreviewController::sendPageBack): Deleted.
3347         (WebKit::SystemPreviewController::showPreview): Deleted.
3348         * UIProcess/SystemPreviewController.h:
3349
3350         * UIProcess/WebPageProxy.cpp:
3351         (WebKit::m_configurationPreferenceValues):
3352         (WebKit::WebPageProxy::reattachToWebProcess):
3353         (WebKit::WebPageProxy::resetState):
3354         * UIProcess/WebPageProxy.h:
3355
3356 2018-05-14  Brady Eidson  <beidson@apple.com>
3357
3358         Add an API test to guard against regressions while re-entering setDefersLoading:.
3359         <rdar://problem/37033737> and https://bugs.webkit.org/show_bug.cgi?id=185630
3360
3361         Reviewed by Chris Dumez.
3362
3363         * UIProcess/API/Cocoa/WKWebView.mm:
3364         (-[WKWebView _setDefersLoadingForTesting:]):
3365         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3366
3367         * UIProcess/WebPageProxy.cpp:
3368         (WebKit::WebPageProxy::setDefersLoadingForTesting):
3369         * UIProcess/WebPageProxy.h:
3370         * WebProcess/WebPage/WebPage.messages.in:
3371
3372 2018-05-14  Tim Horton  <timothy_horton@apple.com>
3373
3374         Use the system font by default in extra zoom mode
3375         https://bugs.webkit.org/show_bug.cgi?id=185638
3376         <rdar://problem/40230277>
3377
3378         Reviewed by Wenson Hsieh.
3379
3380         * Shared/WebPreferencesDefaultValues.h:
3381
3382 2018-05-14  Michael Catanzaro  <mcatanzaro@igalia.com>
3383
3384         Unreviewed, rolling out r231755.
3385
3386         Change is not correct
3387
3388         Reverted changeset:
3389
3390         "-Wmemset-elt-size warning in LibWebRTCSocket constructor"
3391         https://bugs.webkit.org/show_bug.cgi?id=185555
3392         https://trac.webkit.org/changeset/231755
3393
3394 2018-05-14  Wenson Hsieh  <wenson_hsieh@apple.com>
3395
3396         [Extra zoom mode] Google search results are excessively zoomed in
3397         https://bugs.webkit.org/show_bug.cgi?id=185347
3398         <rdar://problem/39999778>
3399
3400         Reviewed by Tim Horton.
3401
3402         Adds a new experimental feature for the "disabled-adaptations" meta tag, and adds plumbing in WebKit to
3403         propagate disabled adaptation changes to the ViewportConfiguration. The experimental feature is on by default in
3404         extra zoom mode.
3405
3406         * Shared/WebPreferences.yaml:
3407         * Shared/WebPreferencesDefaultValues.h:
3408         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3409         (WebKit::WebChromeClient::dispatchDisabledAdaptationsDidChange const):
3410         * WebProcess/WebCoreSupport/WebChromeClient.h:
3411         * WebProcess/WebPage/WebPage.cpp:
3412         (WebKit::WebPage::disabledAdaptationsDidChange):
3413         * WebProcess/WebPage/WebPage.h:
3414
3415 2018-05-14  Chris Dumez  <cdumez@apple.com>
3416
3417         Overly aggressive timer throttling in service workers
3418         https://bugs.webkit.org/show_bug.cgi?id=185575
3419         <rdar://problem/40219038>
3420
3421         Reviewed by Geoff Garen.
3422
3423         After ~30 seconds, the system would put the service worker process in "App Nap",
3424         causing its timers to get aggressively throttled. This happens because the
3425         service worker processes are WebProcesses that have no visible WebPages.
3426
3427         To address the issue, we now disable process suppression for all service worker
3428         processes. This causes those processes to construct a UserActivity which prevents
3429         App Nap.
3430
3431         This patch also refactors the code a bit to avoid duplication. The ProcessSuppression
3432         suppression logic in now all on ChildProcessProxy / ChildProcess.
3433
3434         * NetworkProcess/NetworkProcess.messages.in:
3435         * PluginProcess/PluginProcess.messages.in:
3436         * Shared/ChildProcess.messages.in:
3437         * UIProcess/ChildProcessProxy.cpp:
3438         (WebKit::ChildProcessProxy::setProcessSuppressionEnabled):
3439         * UIProcess/ChildProcessProxy.h:
3440         * UIProcess/Network/NetworkProcessProxy.h:
3441         * UIProcess/Network/mac/NetworkProcessProxyMac.mm: Removed.
3442         * UIProcess/Plugins/PluginProcessProxy.h:
3443         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
3444         * UIProcess/ServiceWorkerProcessProxy.cpp:
3445         (WebKit::ServiceWorkerProcessProxy::didFinishLaunching):
3446         * UIProcess/ServiceWorkerProcessProxy.h:
3447         * UIProcess/WebProcessProxy.h:
3448         * WebKit.xcodeproj/project.pbxproj:
3449         * WebProcess/WebProcess.messages.in:
3450
3451 2018-05-14  Andy Estes  <aestes@apple.com>
3452
3453         [Wi-Fi Assertions] Allow clients to specify a context identifier
3454         https://bugs.webkit.org/show_bug.cgi?id=185620
3455         <rdar://problem/39915196>
3456
3457         Reviewed by Brady Eidson.
3458
3459         Added an SPI on _WKProcessPoolConfiguration that allows clients to specify a
3460         context identifier.
3461
3462         * NetworkProcess/NetworkProcessCreationParameters.cpp:
3463         (WebKit::NetworkProcessCreationParameters::encode const):
3464         (WebKit::NetworkProcessCreationParameters::decode):
3465