19bd20412b51c696e35d89105914bae648a3f6ad
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2018-03-12  Yoav Weiss  <yoav@yoav.ws>
2
3         Runtime flag for link prefetch and remove link subresource.
4         https://bugs.webkit.org/show_bug.cgi?id=183540
5
6         Reviewed by Chris Dumez.
7
8         Remove the LINK_PREFETCH build time flag.
9
10         * Configurations/FeatureDefines.xcconfig:
11         * WebProcess/Network/WebLoaderStrategy.cpp:
12         (WebKit::maximumBufferingTime):
13
14 2018-03-12  Chris Dumez  <cdumez@apple.com>
15
16         Load may get committed before receiving policy for the resource response
17         https://bugs.webkit.org/show_bug.cgi?id=183579
18         <rdar://problem/38268780>
19
20         Reviewed by Youenn Fablet.
21
22         r228852 updated WebResourceLoader::didReceiveResponse to only send the
23         ContinueDidReceiveResponse IPC back to the Networkprocess *after* the
24         policy decision for the resource response has been made. This is necessary
25         now that policy decisions can be made asynchronously.
26
27         However, one of the 2 code paths in NetworkProcess side (code path when
28         the resource is already in the HTTP disk cache) failed to wait for the
29         ContinueDidReceiveResponse IPC before sending over the data to the WebProcess.
30         As a result, the WebProcess could commit the load before even receiving the
31         policy response from the client.        
32
33         * NetworkProcess/NetworkResourceLoader.cpp:
34         (WebKit::NetworkResourceLoader::continueDidReceiveResponse):
35         (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
36         (WebKit::NetworkResourceLoader::continueProcessingCachedEntryAfterDidReceiveResponse):
37         * NetworkProcess/NetworkResourceLoader.h:
38         Make sure NetworkResourceLoader::didRetrieveCacheEntry() does not start sending the data
39         until the network process gets the ContinueDidReceiveResponse IPC back from the WebProcess.
40
41         * WebProcess/Network/WebResourceLoader.cpp:
42         (WebKit::WebResourceLoader::didReceiveResponse):
43         (WebKit::WebResourceLoader::didReceiveData):
44         * WebProcess/Network/WebResourceLoader.h:
45         Add assertion to make sure didReceiveData() never gets called before didReceiveResponse's
46         completion handler has been called. If this hits, then the load may get committed even
47         though the client did not reply to the policy for the resource response yet.
48
49 2018-03-12  Ali Juma  <ajuma@chromium.org>
50
51         http/tests/workers/service/service-worker-download.https.html times out with async policy delegates
52         https://bugs.webkit.org/show_bug.cgi?id=183479
53
54         Reviewed by Youenn Fablet.
55
56         Ensure that ServiceWorkerFetchClient::m_isCheckingResponse is set before code that depends on it
57         executes. This bit was set by code that's posted to the runloop using 'callOnMainThread' in
58         ServiceWorkerFetchClient::didReceiveResponse. But when didReceiveResponse is executing, tasks for
59         handling didReceiveData, didFail, or didFinish may already have been posted to the runloop, and in
60         that case would execute before m_isCheckingResponse gets set, and then incorrectly fail to 
61         early-out. Fix this by directly setting m_isCheckingResponse in didReceiveResponse.
62
63         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
64         (WebKit::ServiceWorkerClientFetch::start):
65         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
66
67 2018-03-12  Wenson Hsieh  <wenson_hsieh@apple.com>
68
69         REGRESSION(r211643): Dismissing WKActionSheet should not also dismiss its presenting view controller
70         https://bugs.webkit.org/show_bug.cgi?id=183549
71         <rdar://problem/34960698>
72
73         Reviewed by Andy Estes.
74
75         Fixes the bug by dismissing the presented view controller (i.e. the action sheet or the view controller being
76         presented during rotation) rather than the presenting view controller.
77
78         Test: ActionSheetTests.DismissingActionSheetShouldNotDismissPresentingViewController
79
80         * UIProcess/ios/WKActionSheet.mm:
81         (-[WKActionSheet doneWithSheet:]):
82
83 2018-03-12  Javier Fernandez  <jfernandez@igalia.com>
84
85         Remove GridLayout runtime flag
86         https://bugs.webkit.org/show_bug.cgi?id=183484
87
88         Reviewed by Myles C. Maxfield.
89
90         The Grid Layout feature has been enabled by default for almost a
91         year, so I think it's time to remove the runtime flag and the
92         codepath run when the feature is disabled.
93
94         * Shared/WebPreferences.yaml:
95         * WebProcess/InjectedBundle/InjectedBundle.cpp:
96         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
97
98 2018-03-11  Wenson Hsieh  <wenson_hsieh@apple.com>
99
100         Fix the internal iOS build after r229512
101         https://bugs.webkit.org/show_bug.cgi?id=183550
102
103         Reviewed by Zalan Bujtas.
104
105         Fixes a typo in a header import, as well as a nullability error. `SecTrustEvaluate()` takes in a nonnull outparam,
106         which was removed in r229512; this adds the outparam back, but does not consult its value when setting the
107         `infoDictionary`.
108
109         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
110         (-[WKFullScreenWindowController _EVOrganizationName]):
111
112 2018-03-10  Jer Noble  <jer.noble@apple.com>
113
114         Improvements to fullscreen; new UI and security features
115         https://bugs.webkit.org/show_bug.cgi?id=183503
116
117         Reviewed by Dean Jackson.
118
119         Now that the iOS Fullscreen code has more than one major class, move it into an ios/
120         directory.
121
122         Clean up the WKFullScreenWindowControllerIOS class to more clearly separate external
123         facing API from purely internal functions.
124
125         Move the WKFullScreenViewController out into its own file. Add support for fullscreen
126         top inset and fullscreen autohide duration CSS constants.
127
128         Add a heuristic to distinguish between media control related touches and ones that look
129         more keyboard interactions.
130
131         Add a new UIStackView based control to hold the fullscreen controls.
132
133         * UIProcess/ios/WKFullScreenWindowControllerIOS.mm: Removed.
134         * UIProcess/ios/fullscreen/FullscreenTouchSecheuristic.cpp: Added.
135         (WebKit::FullscreenTouchSecheuristic::scoreOfNextTouch):
136         (WebKit::FullscreenTouchSecheuristic::reset):
137         (WebKit::FullscreenTouchSecheuristic::distanceScore):
138         (WebKit::FullscreenTouchSecheuristic::attenuationFactor):
139         * UIProcess/ios/fullscreen/FullscreenTouchSecheuristic.h: 
140         (WebKit::FullscreenTouchSecheuristic::setRampUpSpeed):
141         (WebKit::FullscreenTouchSecheuristic::setRampDownSpeed):
142         (WebKit::FullscreenTouchSecheuristic::setXWeight):
143         (WebKit::FullscreenTouchSecheuristic::setYWeight):
144         (WebKit::FullscreenTouchSecheuristic::setSize):
145         (WebKit::FullscreenTouchSecheuristic::setGamma):
146         (WebKit::FullscreenTouchSecheuristic::setGammaCutoff):
147         * UIProcess/ios/fullscreen/WKFullScreenViewController.h:
148         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm: Added.
149         (WKFullScreenViewControllerPlaybackSessionModelClient::setParent):
150         (WKFullScreenViewControllerPlaybackSessionModelClient::setInterface):
151         (-[_WKExtrinsicButton setExtrinsicContentSize:]):
152         (-[_WKExtrinsicButton intrinsicContentSize]):
153         (-[WKFullScreenViewController initWithWebView:]):
154         (-[WKFullScreenViewController dealloc]):
155         (-[WKFullScreenViewController showUI]):
156         (-[WKFullScreenViewController hideUI]):
157         (-[WKFullScreenViewController videoControlsManagerDidChange]):
158         (-[WKFullScreenViewController setPrefersStatusBarHidden:]):
159         (-[WKFullScreenViewController setPlaying:]):
160         (-[WKFullScreenViewController setPictureInPictureActive:]):
161         (-[WKFullScreenViewController loadView]):
162         (-[WKFullScreenViewController viewWillAppear:]):
163         (-[WKFullScreenViewController viewDidLayoutSubviews]):
164         (-[WKFullScreenViewController viewWillTransitionToSize:withTransitionCoordinator:]):
165         (-[WKFullScreenViewController preferredStatusBarStyle]):
166         (-[WKFullScreenViewController prefersStatusBarHidden]):
167         (-[WKFullScreenViewController gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
168         (-[WKFullScreenViewController gestureRecognizer:shouldReceiveTouch:]):
169         (-[WKFullScreenViewController _manager]):
170         (-[WKFullScreenViewController _effectiveFullscreenInsetTop]):
171         (-[WKFullScreenViewController _cancelAction:]):
172         (-[WKFullScreenViewController _togglePiPAction:]):
173         (-[WKFullScreenViewController _touchDetected:]):
174         (-[WKFullScreenViewController _statusBarFrameDidChange:]):
175         (-[WKFullScreenViewController _updateWebViewFullscreenInsets]):
176         (-[WKFullScreenViewController _showPhishingAlert]):
177         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.h: Copied from Source/WebKit/UIProcess/ios/WKFullScreenWindowControllerIOS.h.
178         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm: Added.
179         (WebKit::replaceViewWithView):
180         (WebKit::WKWebViewState::applyTo):
181         (WebKit::WKWebViewState::store):
182         (-[WKFullscreenAnimationController transitionDuration:]):
183         (-[WKFullscreenAnimationController configureInitialAndFinalStatesForTransition:]):
184         (-[WKFullscreenAnimationController animateTransition:]):
185         (-[WKFullscreenAnimationController animationEnded:]):
186         (-[WKFullscreenAnimationController startInteractiveTransition:]):
187         (-[WKFullscreenAnimationController updateWithPercent:]):
188         (-[WKFullscreenAnimationController updateWithPercent:translation:anchor:]):
189         (-[WKFullscreenAnimationController end:]):
190         (-[WKFullScreenInteractiveTransition initWithAnimator:anchor:]):
191         (-[WKFullScreenInteractiveTransition wantsInteractiveStart]):
192         (-[WKFullScreenInteractiveTransition startInteractiveTransition:]):
193         (-[WKFullScreenInteractiveTransition updateInteractiveTransition:withTranslation:]):
194         (-[WKFullScreenInteractiveTransition cancelInteractiveTransition]):
195         (-[WKFullScreenInteractiveTransition finishInteractiveTransition]):
196         (-[WKFullScreenWindowController initWithWebView:]):
197         (-[WKFullScreenWindowController dealloc]):
198         (-[WKFullScreenWindowController isFullScreen]):
199         (-[WKFullScreenWindowController webViewPlaceholder]):
200         (-[WKFullScreenWindowController enterFullScreen]):
201         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
202         (-[WKFullScreenWindowController requestExitFullScreen]):
203         (-[WKFullScreenWindowController exitFullScreen]):
204         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
205         (-[WKFullScreenWindowController _completedExitFullScreen]):
206         (-[WKFullScreenWindowController close]):
207         (-[WKFullScreenWindowController webViewDidRemoveFromSuperviewWhileInFullscreen]):
208         (-[WKFullScreenWindowController videoControlsManagerDidChange]):
209         (-[WKFullScreenWindowController gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
210         (-[WKFullScreenWindowController animationControllerForPresentedController:presentingController:sourceController:]):
211         (-[WKFullScreenWindowController animationControllerForDismissedController:]):
212         (-[WKFullScreenWindowController interactionControllerForDismissal:]):
213         (-[WKFullScreenWindowController _exitFullscreenImmediately]):
214         (-[WKFullScreenWindowController _invalidateEVOrganizationName]):
215         (-[WKFullScreenWindowController _isSecure]):
216         (-[WKFullScreenWindowController _serverTrust]):
217         (-[WKFullScreenWindowController _EVOrganizationName]):
218         (-[WKFullScreenWindowController _updateLocationInfo]):
219         (-[WKFullScreenWindowController _manager]):
220         (-[WKFullScreenWindowController _startToDismissFullscreenChanged:]):
221         (-[WKFullScreenWindowController _interactiveDismissChanged:]):
222         * UIProcess/ios/fullscreen/WKFullscreenStackView.h: Renamed from Source/WebKit/UIProcess/ios/WKFullScreenWindowControllerIOS.h.
223         * UIProcess/ios/fullscreen/WKFullscreenStackView.mm: Added.
224         (+[WKFullscreenStackView baseEffects]):
225         (+[WKFullscreenStackView configureView:forTintEffectWithColor:filterType:]):
226         (+[WKFullscreenStackView configureView:withBackgroundFillOfColor:opacity:filter:]):
227         (+[WKFullscreenStackView secondaryMaterialOverlayView]):
228         (+[WKFullscreenStackView applyPrimaryGlyphTintToView:]):
229         (+[WKFullscreenStackView applySecondaryGlyphTintToView:]):
230         (-[WKFullscreenStackView initWithArrangedSubviews:axis:]):
231         (-[WKFullscreenStackView setTargetViewForSecondaryMaterialOverlay:]):
232         (-[WKFullscreenStackView contentView]):
233         (-[WKFullscreenStackView _setArrangedSubviews:axis:]):
234         (-[WKFullscreenStackView setBounds:]):
235         (-[WKFullscreenStackView updateConstraints]):
236         * WebKit.xcodeproj/project.pbxproj:
237
238 2018-03-10  Megan Gardner  <megan_gardner@apple.com>
239
240         Media query for default appearance
241         https://bugs.webkit.org/show_bug.cgi?id=183539
242         <rdar://problem/38326388>
243
244         Reviewed by Tim Horton.
245
246         Write a media query to evaluate appearance.
247
248         * Shared/WebPageCreationParameters.cpp:
249         (WebKit::WebPageCreationParameters::encode const):
250         (WebKit::WebPageCreationParameters::decode):
251         * Shared/WebPageCreationParameters.h:
252         * UIProcess/API/Cocoa/WKWebView.mm:
253         (-[WKWebView _initializeWithConfiguration:]):
254         (-[WKWebView _setUseSystemAppearance:]):
255         * UIProcess/WebPageProxy.cpp:
256         (WebKit::WebPageProxy::creationParameters):
257         (WebKit::WebPageProxy::setDefaultAppearance):
258         * UIProcess/WebPageProxy.h:
259         (WebKit::WebPageProxy::defaultAppearance const):
260         * WebProcess/WebPage/WebPage.cpp:
261         (WebKit::m_credentialsMessenger):
262         (WebKit::WebPage::setDefaultAppearance):
263         * WebProcess/WebPage/WebPage.h:
264         * WebProcess/WebPage/WebPage.messages.in:
265
266 2018-03-09  Jer Noble  <jer.noble@apple.com>
267
268         Unconditionalize more methods in VideoFullscreenInterface (and related classes)
269         https://bugs.webkit.org/show_bug.cgi?id=183501
270         <rdar://problem/38312038>
271
272         Unreviewed build fix; add correct pragmas to code referencing m_playbackSessionManager.
273
274         * UIProcess/WebPageProxy.cpp:
275         (WebKit::WebPageProxy::hasActiveVideoForControlsManager const):
276         (WebKit::WebPageProxy::requestControlledElementID const):
277         (WebKit::WebPageProxy::isPlayingVideoInEnhancedFullscreen const):
278
279 2018-03-09  Brian Burg  <bburg@apple.com>
280
281         Web Inspector: there should only be one way for async backend commands to send failure
282         https://bugs.webkit.org/show_bug.cgi?id=183524
283
284         Reviewed by Timothy Hatcher.
285
286         Remove useless ErrorString argument from async commands.
287
288         For Automation protocol, introduce sync and async macros for filling
289         in and sending a failure response. Now that async commands don't have
290         an ErrorString and sync commands don't have a callback, trying to send
291         an error with the wrong macro is a compile-time error.
292
293         * UIProcess/Automation/WebAutomationSession.cpp:
294         (WebKit::WebAutomationSession::getBrowsingContexts):
295         (WebKit::WebAutomationSession::getBrowsingContext):
296         (WebKit::WebAutomationSession::createBrowsingContext):
297         (WebKit::WebAutomationSession::closeBrowsingContext):
298         (WebKit::WebAutomationSession::switchToBrowsingContext):
299         (WebKit::WebAutomationSession::setWindowFrameOfBrowsingContext):
300         (WebKit::WebAutomationSession::waitForNavigationToComplete):
301         (WebKit::WebAutomationSession::navigateBrowsingContext):
302         (WebKit::WebAutomationSession::goBackInBrowsingContext):
303         (WebKit::WebAutomationSession::goForwardInBrowsingContext):
304         (WebKit::WebAutomationSession::reloadBrowsingContext):
305         (WebKit::WebAutomationSession::evaluateJavaScriptFunction):
306         (WebKit::WebAutomationSession::resolveChildFrameHandle):
307         (WebKit::WebAutomationSession::resolveParentFrameHandle):
308         (WebKit::WebAutomationSession::computeElementLayout):
309         (WebKit::WebAutomationSession::selectOptionElement):
310         (WebKit::WebAutomationSession::isShowingJavaScriptDialog):
311         (WebKit::WebAutomationSession::dismissCurrentJavaScriptDialog):
312         (WebKit::WebAutomationSession::acceptCurrentJavaScriptDialog):
313         (WebKit::WebAutomationSession::messageOfCurrentJavaScriptDialog):
314         (WebKit::WebAutomationSession::setUserInputForCurrentJavaScriptPrompt):
315         (WebKit::WebAutomationSession::setFilesToSelectForFileUpload):
316         (WebKit::WebAutomationSession::getAllCookies):
317         (WebKit::WebAutomationSession::deleteSingleCookie):
318         (WebKit::WebAutomationSession::addSingleCookie):
319         (WebKit::WebAutomationSession::deleteAllCookies):
320         (WebKit::WebAutomationSession::setSessionPermissions):
321         (WebKit::WebAutomationSession::performMouseInteraction):
322         (WebKit::WebAutomationSession::performKeyboardInteractions):
323         (WebKit::WebAutomationSession::takeScreenshot):
324         (WebKit::WebAutomationSession::didTakeScreenshot):
325         * UIProcess/Automation/WebAutomationSession.h:
326         * UIProcess/Automation/WebAutomationSessionMacros.h:
327         * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
328         (WebKit::WebAutomationSession::inspectBrowsingContext):
329
330 2018-03-09  Jer Noble  <jer.noble@apple.com>
331
332         Don't pass NULL to the result parameter of SecTrustEvaluate()
333         https://bugs.webkit.org/show_bug.cgi?id=183495
334         <rdar://problem/38185688>
335
336         Reviewed by Andy Estes.
337
338         * UIProcess/ios/WKFullScreenWindowControllerIOS.mm:
339         (-[WKFullScreenWindowController _EVOrganizationName]):
340
341 2018-03-09  Dean Jackson  <dino@apple.com>
342
343         Allow NavigationState to intercept requests and send them to SystemPreviewController
344         https://bugs.webkit.org/show_bug.cgi?id=183526
345         <rdar://problem/37801140>
346
347         Reviewed by Tim Horton.
348
349         Implement a bit more of SystemPreviewController, such that it can be used
350         from NavigationState to identify and handle content that can be previewed.
351
352         * UIProcess/Cocoa/NavigationState.mm:
353         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse):
354             If we'd in a download response policy, then check if SystemPreviewController
355             can show the content. We ignore the download, but pass the original URL onto
356             the preview. Ultimately, we'd want to avoid the navigation
357             but use the download destination URL for preview.
358
359         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
360         (-[_WKPreviewControllerDataSource initWithURL:]):
361             Move the URL to property, to help use a single datasource object for all previews.
362         (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
363         (-[_WKPreviewControllerDelegate initWithSystemPreviewController:]):
364             Add a delegate object, so we can detect when the preview is dismissed and return
365             to the previous page.
366         (-[_WKPreviewControllerDelegate previewControllerWillDismiss:]):
367         (WebKit::SystemPreviewController::showPreview):
368             Use single instances of the QLPreviewController, its datasource and delegate.
369
370         * UIProcess/SystemPreviewController.cpp:
371             Add a helper to navigate back.
372         (WebKit::SystemPreviewController::SystemPreviewController):
373         (WebKit::SystemPreviewController::sendPageBack):
374         * UIProcess/SystemPreviewController.h:
375
376 2018-03-09  Jer Noble  <jer.noble@apple.com>
377
378         webkitfullscreenchange event not fired at the same time as :-webkit-full-screen pseudo selector changes; causes glitchiness
379         https://bugs.webkit.org/show_bug.cgi?id=183383
380         <rdar://problem/38197028>
381
382         Reviewed by Eric Carlson.
383
384         Follow-up patch: now that the 'fullscreenchange' event is being fired slightly earlier, the
385         Fullscreen.TopContentInset tests triggers what appears to be an existing behavior: if you
386         exit in the middle of an enter fullscreen animation, the exit never happens, because the
387         NSWindow never starts the exit animation. The solution is to store the exit fullscreen
388         request, and only act upon it when the enter animation completes.
389
390         * UIProcess/mac/WKFullScreenWindowController.h:
391         * UIProcess/mac/WKFullScreenWindowController.mm:
392         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]):
393         (-[WKFullScreenWindowController exitFullScreen]):
394
395 2018-03-09  Jer Noble  <jer.noble@apple.com>
396
397         Unconditionalize more methods in VideoFullscreenInterface (and related classes)
398         https://bugs.webkit.org/show_bug.cgi?id=183501
399
400         Reviewed by Eric Carlson.
401
402         No reason for these methods to be PLATFORM(MAC) only.
403
404         * UIProcess/API/Cocoa/WKWebView.mm:
405         (-[WKWebView _videoControlsManagerDidChange]):
406         * UIProcess/API/Cocoa/WKWebViewInternal.h:
407         * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
408         (WebKit::PlaybackSessionManagerProxy::setUpPlaybackControlsManagerWithID):
409         (WebKit::PlaybackSessionManagerProxy::clearPlaybackControlsManager):
410         * UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
411         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
412         * UIProcess/PageClient.h:
413         * UIProcess/WebPageProxy.cpp:
414         (WebKit::WebPageProxy::isPlayingMediaDidChange):
415         (WebKit::WebPageProxy::handleControlledElementIDResponse const):
416         (WebKit::WebPageProxy::isPlayingVideoInEnhancedFullscreen const):
417         * UIProcess/WebPageProxy.h:
418         * UIProcess/ios/PageClientImplIOS.h:
419         * UIProcess/ios/PageClientImplIOS.mm:
420         (WebKit::PageClientImpl::videoControlsManagerDidChange):
421         * UIProcess/ios/WKFullScreenWindowControllerIOS.h:
422         * UIProcess/ios/WKFullScreenWindowControllerIOS.mm:
423         (-[WKFullScreenWindowController videoControlsManagerDidChange]):
424         * WebProcess/cocoa/PlaybackSessionManager.mm:
425         (WebKit::PlaybackSessionManager::setUpPlaybackControlsManager):
426
427 2018-03-09  Per Arne Vollan  <pvollan@apple.com>
428
429         Create CA layer contexts with +remoteContextWithOptions.
430         https://bugs.webkit.org/show_bug.cgi?id=182747
431
432         Reviewed by Brent Fulgham.
433
434         CA layer contexts (CAContext) are currently created with +contextWithCGSConnection, which is
435         using the main WindowServer connection to create the context. Instead, the contexts can be
436         created with +remoteContextWithOptions, which does not use the main WindowServer connection.
437         This is a step towards limiting the access the WebContent process has to the window server.
438         To make the +remoteContextWithOptions call succeed, the sandbox has to be modified to allow
439         access to CARenderServer. Also, access to the WindowServer should be denied by calling
440         CGSSetDenyWindowServerConnections(true) before entering the sandbox. This is planned to do
441         in a follow-up patch. The call to +remoteContextWithOptions will open up WindowServer
442         connections, since the WindowServer is the system default CA render server, but these
443         connections come with limited WindowServer exposure. In addition, we need to open up the
444         sandbox for accessing some IOKit properties.
445
446         * Platform/mac/LayerHostingContext.mm:
447         (WebKit::LayerHostingContext::createForExternalHostingProcess):
448         * Shared/mac/HangDetectionDisablerMac.mm:
449         (WebKit::setClientsMayIgnoreEvents):
450         * WebProcess/com.apple.WebProcess.sb.in:
451
452 2018-03-09  Brent Fulgham  <bfulgham@apple.com>
453
454         Remove cookie API access from WebContent Process
455         https://bugs.webkit.org/show_bug.cgi?id=183519
456         <rdar://problem/35368802>
457
458         Reviewed by Alex Christensen.
459
460         All cookie access is now handled in the Network Process. However, there are vestiges of the original logic that used CFNetwork APIs in the WebContent process.
461
462         This patch removes CFNetwork calls from the WebProcess code paths, since they serve no purpose in modern WebKit.
463
464         No tests because this is a code cleanup with no expected change in behavior.
465
466         * NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
467         (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy): Moved from WebFrameNetworkingContext.
468         * NetworkProcess/NetworkProcess.h:
469         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
470         (WebKit::NetworkProcess::setSharedHTTPCookieStorage): Moved from ChildProcess, since this should only be
471         called in the NetworkProcess.
472         * Shared/ChildProcess.h:
473         * Shared/mac/ChildProcessMac.mm:
474         (WebKit::ChildProcess::setSharedHTTPCookieStorage): Deleted.
475         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
476         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
477         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession): Remove CFNetwork code. This version of
478         'ensureWebsiteDataStoreSession' is needed to maintain a dictionary on the WebProcess side so we can refer to
479         the same network session in both the WebContent and Network processes.
480         (WebKit::WebFrameNetworkingContext::webFrameLoaderClient const):
481         (WebKit::WebFrameNetworkingContext::setCookieAcceptPolicyForAllContexts): Deleted.
482         * WebProcess/cocoa/WebProcessCocoa.mm:
483         (WebKit::WebProcess::platformInitializeWebProcess): Remove calls to CFNetwork.
484
485 2018-03-09  Youenn Fablet  <youenn@apple.com>
486
487         ServiceWorkerClientFetch should send data to its resource loader once the didReceiveResponse completion handler is called
488         https://bugs.webkit.org/show_bug.cgi?id=183110
489
490         Reviewed by Chris Dumez.
491
492         Buffering data/finish event/fail event until the response completion handler is called.
493
494         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
495         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
496         (WebKit::ServiceWorkerClientFetch::didReceiveData):
497         (WebKit::ServiceWorkerClientFetch::didFinish):
498         (WebKit::ServiceWorkerClientFetch::didFail):
499         (WebKit::ServiceWorkerClientFetch::didNotHandle):
500         (WebKit::ServiceWorkerClientFetch::cancel):
501         (WebKit::ServiceWorkerClientFetch::continueLoadingAfterCheckingResponse):
502         * WebProcess/Storage/ServiceWorkerClientFetch.h:
503
504 2018-03-09  Jer Noble  <jer.noble@apple.com>
505
506         Add new CSS env constants for use with fullscreen
507         https://bugs.webkit.org/show_bug.cgi?id=183498
508
509         Reviewed by Dean Jackson.
510
511         Pass the values given to WebFullScreenManagerProxy through the process boundary and
512         into WebCore.
513
514         * UIProcess/WebFullScreenManagerProxy.cpp:
515         (WebKit::WebFullScreenManagerProxy::setFullscreenInsetTop):
516         (WebKit::WebFullScreenManagerProxy::setFullscreenAutoHideDelay):
517         * UIProcess/WebFullScreenManagerProxy.h:
518         * WebProcess/FullScreen/WebFullScreenManager.cpp:
519         (WebKit::WebFullScreenManager::didExitFullScreen):
520         (WebKit::WebFullScreenManager::setFullscreenInsetTop):
521         (WebKit::WebFullScreenManager::setFullscreenAutoHideDelay):
522         * WebProcess/FullScreen/WebFullScreenManager.h:
523         * WebProcess/FullScreen/WebFullScreenManager.messages.in:
524
525 2018-03-09  Jer Noble  <jer.noble@apple.com>
526
527         Add isPictureInPictureActive messaging across WebKit process boundary
528         https://bugs.webkit.org/show_bug.cgi?id=183499
529
530         Reviewed by Eric Carlson.
531
532         * UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
533         * UIProcess/Cocoa/PlaybackSessionManagerProxy.messages.in:
534         * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
535         (WebKit::PlaybackSessionModelContext::pictureInPictureActiveChanged):
536         (WebKit::PlaybackSessionManagerProxy::pictureInPictureActiveChanged):
537
538 2018-03-09  Stephan Szabo  <stephan.szabo@sony.com>
539
540         Add guard for wtf/glib include
541         https://bugs.webkit.org/show_bug.cgi?id=183521
542
543         Reviewed by Alex Christensen.
544
545         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp:
546
547 2018-03-09  Andy Estes  <aestes@apple.com>
548
549         [Mac] WebKit fails to receive file promises when the embedding app is sandboxed
550         https://bugs.webkit.org/show_bug.cgi?id=183489
551         <rdar://problem/38267517>
552
553         WebKit calls -[NSFilePromiseReceiver receivePromisedFilesAtDestination:...] with
554         NSTemporaryDirectory() as the destination for receiving file promise drops. AppKit attempts
555         to issue a sandbox extension for this directory, but for security reasons App Sandbox
556         refuses to do so for NSTemporaryDirectory() itself. As a result, AppKit will call our reader
557         block with a nil error and a valid file URL, but no file will actually exist at that URL.
558
559         In order for App Sandbox to grant issuing the sandbox extension needed by AppKit, we need to
560         use some other destination directory. This patch uses FileSystem::createTemporaryDirectory()
561         to securely create a unique temporary directory inside NSTemporaryDirectory() for use as the
562         drop destination.
563
564         Reviewed by Wenson Hsieh.
565
566         * UIProcess/Cocoa/WebViewImpl.mm:
567         (WebKit::WebViewImpl::performDragOperation):
568
569 2018-03-09  Carlos Garcia Campos  <cgarcia@igalia.com>
570
571         [GTK] Do not use WebKitDOMHTMLFormElement as argument of signal WebKitWebPage::will-submit-form
572         https://bugs.webkit.org/show_bug.cgi?id=183510
573
574         Reviewed by Michael Catanzaro.
575
576         In 2.22 WebKitDOMHTMLFormElement will be deprecated in GTK+ port and won't still exist in WPE. The new
577         JavaScript GLib API will be used to replace most of the DOM API, but a few classes will remain with a minimal
578         API for things that can't be done with JavaScript. WebKitDOMElement will stay and will be added to WPE as well,
579         so if we change the signal parameter to WebKitDOMElement we will be able to keep using
580         WebKitWebPage::will-submit-form without any changes. WPE will gain this signal and the rest of the API that uses
581         DOM.
582
583         * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
584         (webkit_web_page_class_init):
585
586 2018-03-09  Carlos Garcia Campos  <cgarcia@igalia.com>
587
588         Unreviewed. [GTK][WPE] Bump Since tags of resource load stats API.
589
590         The functionality hasn't been properly tested to be released in WebKitGTK+ 2.20.
591
592         * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
593         (webkit_website_data_manager_class_init):
594         * UIProcess/API/gtk/WebKitWebsiteData.h:
595         * UIProcess/API/wpe/WebKitWebsiteData.h:
596
597 2018-03-08  Zan Dobersek  <zdobersek@igalia.com>
598
599         Unreviewed. Suppress GCC warnings in SystemPreviewController.cpp by
600         using the cross-platform #include directives for header inclusion,
601         instead of #import.
602
603         * UIProcess/SystemPreviewController.cpp:
604
605 2018-03-08  Megan Gardner  <megan_gardner@apple.com>
606
607         Allow WebViews to disable system appearance
608         https://bugs.webkit.org/show_bug.cgi?id=183418
609         <rdar://problem/36975642>
610
611         Reviewed by Tim Horton.
612         
613         Allow webviews to choose whether or not to follow the default system appearance.
614
615         * Shared/WebPageCreationParameters.cpp:
616         (WebKit::WebPageCreationParameters::encode const):
617         (WebKit::WebPageCreationParameters::decode):
618         * Shared/WebPageCreationParameters.h:
619         * UIProcess/API/Cocoa/WKWebView.mm:
620         (-[WKWebView _useSystemAppearance]):
621         (-[WKWebView _setUseSystemAppearance:]):
622         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
623         * UIProcess/WebPageProxy.cpp:
624         (WebKit::WebPageProxy::creationParameters):
625         (WebKit::WebPageProxy::setUseSystemAppearance):
626         * UIProcess/WebPageProxy.h:
627         (WebKit::WebPageProxy::useSystemAppearance const):
628         * WebProcess/WebPage/WebPage.cpp:
629         (WebKit::WebPage::setUseSystemAppearance):
630         * WebProcess/WebPage/WebPage.h:
631         * WebProcess/WebPage/WebPage.messages.in:
632
633 2018-03-08  Michael Catanzaro  <mcatanzaro@igalia.com>
634
635         Unreviewed, speculative attempt to fix CMake build after r229426
636         https://bugs.webkit.org/show_bug.cgi?id=183382
637         <rdar://problem/38191450>
638
639         * CMakeLists.txt:
640
641 2018-03-08  Wenson Hsieh  <wenson_hsieh@apple.com>
642
643         [Extra zoom mode] Support resigning first responder status when focusing a form control
644         https://bugs.webkit.org/show_bug.cgi?id=183477
645         <rdar://problem/38225994>
646
647         Reviewed by Tim Horton.
648
649         Currently, when presenting an input view controller in extra zoom mode, if the web view loses first responder
650         status, we will blur the focused element, which dismisses all focused form control UI. For certain types of form
651         controls, this prevents the user from using key pieces of functionality.
652
653         To address this, disconnect the notion of first responder status from DOM element focus while the form control
654         overlay is shown. Later, when the active input session ends, if the web content view was first responder before
655         upon focusing the element, restore first responder status on the web view. This extra tweak is needed to ensure
656         that certain UI affordances which require first responder status on the web view continue to work after
657         interacting with a form control that changes the first responder.
658
659         * UIProcess/ios/WKContentViewInteraction.h:
660         * UIProcess/ios/WKContentViewInteraction.mm:
661         (-[WKContentView presentFocusedFormControlViewController:]):
662         (-[WKContentView dismissFocusedFormControlViewController:]):
663
664 2018-03-08  John Wilander  <wilander@apple.com>
665
666         Resource Load Statistics: Revert defaults read of zero values
667         https://bugs.webkit.org/show_bug.cgi?id=183476
668
669         Unreviewed revert of three small changes landed in r229427.
670
671         * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
672         (WebKit::WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded):
673             Reverted back to strict check of greater than zero for defaults reads.
674
675 2018-03-08  Tim Horton  <timothy_horton@apple.com>
676
677         Don't have SafariServices in minimal simulator build
678         https://bugs.webkit.org/show_bug.cgi?id=183436
679         <rdar://problem/38254778>
680
681         Reviewed by Dan Bernstein.
682
683         * config.h:
684
685 2018-03-08  John Wilander  <wilander@apple.com>
686
687         Resource Load Statistics: Make debug mode always partition prevalent resources
688         https://bugs.webkit.org/show_bug.cgi?id=183468
689         <rdar://problem/38269437>
690
691         Reviewed by Brent Fulgham.
692
693         After some testing we decided that a 30 second timeout in ITP debug mode just makes
694         it confusing. We should instead always partition prevalent resources in debug mode
695         to make it easy to understand. The partitioned state is what developers want to test
696         anyway.
697
698         * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
699         (WebKit::WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded):
700             Minor change to include 0 as valid setting.
701         * UIProcess/WebResourceLoadStatisticsStore.cpp:
702         (WebKit::WebResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode):
703             Now just stores the setting of debug mode instead of changing the timeout.
704         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
705             Now does not disable partitioning under debug mode.
706         (WebKit::WebResourceLoadStatisticsStore::shouldPartitionCookies const):
707             Now returns true for prevalent resources with user interaction under debug mode.            
708         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
709             Removed duplicate debug logging statement.
710         * UIProcess/WebResourceLoadStatisticsStore.h:
711             Added member m_debugModeEnabled.
712
713 2018-03-08  Brent Fulgham  <bfulgham@apple.com>
714
715         Remove WebCookieManager and messaging from WebContent process.
716         https://bugs.webkit.org/show_bug.cgi?id=183382
717         <rdar://problem/38191450>
718
719         Reviewed by Alex Christensen.
720
721         Networking access was fully removed from the WebContent process in Bug 183192 (and related bugs). The
722         UIProcess no longer needs to ask the WebContent process about networking-related things, and shouldn't
723         waste everyone's time doing so.
724
725         This bug removes some left-over WebCookieManager API stuff, and is a first step in purging the
726         WebContent Process from accessing cookie data.
727
728         * NetworkProcess/Cookies: Copied from WebProcess/Cookies.
729         * NetworkProcess/Cookies/WebCookieManager.h:
730         * WebKit.xcodeproj/project.pbxproj:
731         * WebProcess/Cookies: Removed.
732         * WebProcess/Cookies/WebCookieManager.cpp: Removed.
733         * WebProcess/Cookies/WebCookieManager.h: Removed.
734         * WebProcess/Cookies/WebCookieManager.messages.in: Removed.
735         * WebProcess/Cookies/curl: Removed.
736         * WebProcess/Cookies/curl/WebCookieManagerCurl.cpp: Removed.
737         * WebProcess/Cookies/mac: Removed.
738         * WebProcess/Cookies/mac/WebCookieManagerMac.mm: Removed.
739         * WebProcess/Cookies/soup: Removed.
740         * WebProcess/Cookies/soup/WebCookieManagerSoup.cpp: Removed.
741         * WebProcess/InjectedBundle/InjectedBundle.cpp: Remove 'WebCookieManager.h" header.
742         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: Ditto.
743         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm: Ditto.
744         * WebProcess/WebProcess.cpp:
745         (WebKit::WebProcess::WebProcess): Remove call to add WebCookieManager as a
746         WebProcessSupplement.
747         * CMakeLists.txt: Revised paths.
748         * DerivedSources.make: Ditto.
749         * PlatformMac.cmake: Ditto.
750         * PlatformWin.cmake: Ditto.
751         * SourcesGTK.txt: Ditto.
752         * SourcesWPE.txt: Ditto.
753
754 2018-03-08  Youenn Fablet  <youenn@apple.com>
755
756         libwebrtc update broke internal builds
757         https://bugs.webkit.org/show_bug.cgi?id=183454
758
759         Reviewed by Eric Carlson.
760
761         * Configurations/BaseTarget.xcconfig:
762
763 2018-03-08  Youenn Fablet  <youenn@apple.com>
764
765         PluginInfoStore::isSupportedPlugin should check for empty mime type
766         https://bugs.webkit.org/show_bug.cgi?id=183457
767         <rdar://problem/38159575>
768
769         Reviewed by Chris Dumez.
770
771         * UIProcess/Plugins/PluginInfoStore.cpp:
772         (WebKit::PluginInfoStore::isSupportedPlugin):
773
774 2018-03-08  Yusuke Suzuki  <utatane.tea@gmail.com>
775
776         [JSC][WebCore] Extend jsDynamicCast for WebCore types in WebCore and remove jsDynamicDowncast
777         https://bugs.webkit.org/show_bug.cgi?id=183449
778
779         Reviewed by Mark Lam.
780
781         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
782         (WebKit::WebAutomationSessionProxy::elementForNodeHandle):
783         * WebProcess/WebPage/WebFrame.cpp:
784         (WebKit::WebFrame::frameForContext):
785
786 2018-03-08  Yusuke Suzuki  <utatane.tea@gmail.com>
787
788         [JSC] Add inherits<T>(VM&) leveraging JSCast fast path
789         https://bugs.webkit.org/show_bug.cgi?id=183429
790
791         Reviewed by Mark Lam.
792
793         * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
794         (WebKit::callMethod):
795         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
796         (WebKit::callNPJSObject):
797         (WebKit::constructWithConstructor):
798         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
799         (WebKit::NPJSObject::create):
800         * WebProcess/WebPage/WebFrame.cpp:
801         (WebKit::WebFrame::counterValue):
802
803 2018-03-08  Zan Dobersek  <zdobersek@igalia.com>
804
805         Remove WebCore::TextureMapperAnimation as a special case in WebKit IPC
806         generation. Values of this type aren't being transferred across IPC.
807
808         Rubber-stamped by Carlos Garcia Campos.
809
810         * Scripts/webkit/messages.py:
811
812 2018-03-08  Tim Horton  <timothy_horton@apple.com>
813
814         Stop linking ApplicationServices directly
815         https://bugs.webkit.org/show_bug.cgi?id=182867
816         <rdar://problem/38252142>
817
818         Reviewed by Alex Christensen.
819
820         The frameworks that we use that live inside ApplicationServices
821         have mostly moved out, so import them directly.
822
823         * Configurations/WebKit.xcconfig:
824
825 2018-03-08  Wenson Hsieh  <wenson_hsieh@apple.com>
826
827         [Extra zoom mode] Specify password mode as needed when inputting text
828         https://bugs.webkit.org/show_bug.cgi?id=183428
829         <rdar://problem/37609386>
830
831         Reviewed by Tim Horton.
832
833         If the focused element is a password field, or the input delegate has forced secure text entry, set a flag on
834         the text input view controller to opt in to password text input mode.
835
836         * UIProcess/ios/WKContentViewInteraction.mm:
837         (-[WKContentView presentTextInputViewController:]):
838
839 2018-03-07  Tim Horton  <timothy_horton@apple.com>
840
841         Sort and separate FeatureDefines.xcconfig
842         https://bugs.webkit.org/show_bug.cgi?id=183427
843
844         Reviewed by Dan Bernstein.
845
846         * Configurations/FeatureDefines.xcconfig:
847         Sort and split FeatureDefines into paragraphs
848         (to make it easier to sort later).
849
850 2018-03-07  Carlos Garcia Campos  <cgarcia@igalia.com>
851
852         REGRESSION(r218089): [GTK] webkit_web_view_get_inspector() needs to be called, otherwise inspector does not close
853         https://bugs.webkit.org/show_bug.cgi?id=181126
854
855         Reviewed by Carlos Alberto Lopez Perez.
856
857         Fix the condition to decide whether to detach the inspector view ourselves.
858
859         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
860         (WebKit::WebInspectorProxy::platformDetach): Remove the inspector view from its parent if we don't have a client
861         or the client didn't detach it.
862
863 2018-03-07  Carlos Garcia Campos  <cgarcia@igalia.com>
864
865         [GTK][WPE] Leak checker is not working in WebKitGLib web process tests
866         https://bugs.webkit.org/show_bug.cgi?id=183404
867
868         Reviewed by Michael Catanzaro.
869
870         Add private helper for testing to do a garbage collection when the page is closing.
871
872         * WebProcess/InjectedBundle/API/glib/WebKitWebExtension.cpp:
873         (webkitWebExtensionSetGarbageCollectOnPageDestroy):
874         * WebProcess/InjectedBundle/API/glib/WebKitWebExtensionPrivate.h:
875         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.h: Fix annotation of
876         webkit_dom_client_rect_list_item(), it should be transfer full.
877
878 2018-03-07  Youenn Fablet  <youenn@apple.com>
879
880         Match unsupported plugins based on domains and not origin
881         https://bugs.webkit.org/show_bug.cgi?id=183384
882
883         Reviewed by Chris Dumez.
884
885         Moved from a HashMap of plugins to a Vector of plugins since we cannot match exactly based on the origin.
886
887         * Scripts/webkit/messages.py:
888         * UIProcess/API/C/WKContext.cpp:
889         (WKContextAddSupportedPlugin):
890         * UIProcess/API/Cocoa/WKProcessPool.mm:
891         (-[WKProcessPool _addSupportedPlugin:named:withMimeTypes:withExtensions:]):
892         * UIProcess/Plugins/PluginInfoStore.cpp:
893         (WebKit::PluginInfoStore::isSupportedPlugin):
894         (WebKit::PluginInfoStore::supportedPluginNames):
895         (WebKit::PluginInfoStore::addSupportedPlugin):
896         * UIProcess/Plugins/PluginInfoStore.h:
897         * UIProcess/WebProcessPool.cpp:
898         (WebKit::WebProcessPool::addSupportedPlugin):
899         * UIProcess/WebProcessPool.h:
900         * UIProcess/WebProcessProxy.cpp:
901         (WebKit::WebProcessProxy::getPlugins):
902         * UIProcess/WebProcessProxy.h:
903         * UIProcess/WebProcessProxy.messages.in:
904         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
905         (WebKit::WebPluginInfoProvider::getPluginInfo):
906         (WebKit::WebPluginInfoProvider::getWebVisiblePluginInfo):
907         * WebProcess/Plugins/WebPluginInfoProvider.h:
908
909 2018-03-07  Brent Fulgham  <bfulgham@apple.com>
910
911         REGRESSION (r229093): Media playback on Facebook and Hulu require mDNSResponder access
912         https://bugs.webkit.org/show_bug.cgi?id=183421
913         <rdar://problem/38191574>
914
915         Reviewed by Dean Jackson.
916
917         CoreMedia fails to properly play back media on Facebook and Hulu if access to the
918         mDNSResponder is blocked by the sandbox. This Bug unblocks that access while we
919         investigate the underlying issue.
920
921         * WebProcess/com.apple.WebProcess.sb.in:
922
923 2018-03-07  Dean Jackson  <dino@apple.com>
924
925         Try to fix build for watchOS and tvOS.
926
927         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
928         * UIProcess/SystemPreviewController.cpp:
929
930 2018-03-07  Dean Jackson  <dino@apple.com>
931
932         Add SystemPreviewController for showing system-level views of special file types
933         https://bugs.webkit.org/show_bug.cgi?id=183413
934         <rdar://problem/37800834>
935
936         Reviewed by Tim Horton.
937
938         Add a new controller class that hangs off WebPageProxy, with the goal
939         of providing system-level viewing of some some file types. Specifically
940         those that can't be shown by WebKit.
941
942         This is the initial implementation which is quite simple. The controller
943         can be queried about whether it supports a MIME type, then it can be
944         asked to show a URL.
945
946         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: Added.
947         (-[_WKPreviewControllerDataSource initWithURL:]):
948         (-[_WKPreviewControllerDataSource numberOfPreviewItemsInPreviewController:]):
949         (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
950         (WebKit::SystemPreviewController::canPreview const):
951         (WebKit::SystemPreviewController::showPreview):
952         * UIProcess/SystemPreviewController.cpp: Added.
953         (WebKit::SystemPreviewController::SystemPreviewController):
954         (WebKit::SystemPreviewController::canPreview const):
955         (WebKit::SystemPreviewController::showPreview):
956         * UIProcess/SystemPreviewController.h: Added.
957         * UIProcess/WebPageProxy.cpp:
958         (WebKit::m_configurationPreferenceValues):
959         (WebKit::WebPageProxy::reattachToWebProcess):
960         (WebKit::WebPageProxy::resetState):
961         * UIProcess/WebPageProxy.h:
962         (WebKit::WebPageProxy::systemPreviewController):
963         * WebKit.xcodeproj/project.pbxproj:
964
965 2018-03-07  Alejandro G. Castro  <alex@igalia.com>
966
967         Make NetworkRTCResolver port agnostic
968         https://bugs.webkit.org/show_bug.cgi?id=178855
969
970         Reviewed by Youenn Fablet.
971
972         Create a specific Cocoa class to isolate the generic code in the base class, make the base implementation port
973         agnostic and dependent on DNS API in the platform directory which encapsulates the platform specific details.
974
975         * NetworkProcess/webrtc/NetworkRTCProvider.cpp: Create an alias class name defined per platform to instantiate the resolver.
976         (WebKit::NetworkRTCProvider::createResolver): Used the alias class name and receive a new IPAddress class that is not
977         dependent on rtc libwebrtc library.
978         * NetworkProcess/webrtc/NetworkRTCResolver.cpp: Remove the platform specific code. Use the DNS API to implement the
979         platform specific code in the default start and stop methods. Add the identifier of the resolve operation to the class.
980         (WebKit::NetworkRTCResolver::NetworkRTCResolver): Add the identifier in the initialization.
981         (WebKit::NetworkRTCResolver::~NetworkRTCResolver): Remove the platform specific code.
982         (WebKit::NetworkRTCResolver::completed): Ditto.
983         (WebKit::NetworkRTCResolver::start): Add a new implementation using the DNS API.
984         (WebKit::NetworkRTCResolver::stop): Ditto
985         * NetworkProcess/webrtc/NetworkRTCResolver.h: Remove the platform specific code and use the DNSResolveQueue for a general
986         solution to implement the platform specific code. Avoid using the IPAddress class that depends on libwertc classes to make
987         it more general regarding DNS name resolution.
988         (WebKit::NetworkRTCResolver::start): Make this class virtual.
989         (WebKit::NetworkRTCResolver::stop): Ditto.
990         * NetworkProcess/webrtc/NetworkRTCResolverCocoa.cpp: Copied Cocoa code from Source/WebKit/NetworkProcess/webrtc/NetworkRTCResolver.cpp.
991         Now this class overrides the start and stop methods that use DNS, cocoa implementation should use the DNS methods in the future and
992         remove this class, making sure all the platform specific class is in the platform directory.
993         * NetworkProcess/webrtc/NetworkRTCResolverCocoa.h: Copied Cocoa code from Source/WebKit/NetworkProcess/webrtc/NetworkRTCResolver.h.
994         * PlatformGTK.cmake: Add NetworkRTCResolver compilation for GTK.
995         * WebKit.xcodeproj/project.pbxproj: Add the NetworkRTCResolverCocoa class to the compilation.
996
997 2018-03-06  Brent Fulgham  <bfulgham@apple.com>
998
999         NetworkDataTask should enable logging for automation clients
1000         https://bugs.webkit.org/show_bug.cgi?id=183378
1001         <rdar://problem/38189556>
1002
1003         Reviewed by Brian Burg.
1004
1005         The NetworkDataTaskCocoa class was only logging if the SessionID object allowed logging.
1006         It should also be considering whether the current session is working on behalf of an
1007         automation client. If so, it should allow logging.
1008
1009         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
1010         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1011         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
1012         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
1013         (WebKit::NetworkDataTaskCocoa::isAlwaysOnLoggingAllowed const):
1014
1015 2018-03-06  Ryan Haddad  <ryanhaddad@apple.com>
1016
1017         Unreviewed build fix.
1018
1019         * UIProcess/ios/WKFullScreenWindowControllerIOS.mm:
1020         (-[WKFullScreenWindowController _EVOrganizationName]):
1021
1022 2018-03-06  Antoine Quint  <graouts@apple.com>
1023
1024         [Web Animations] Add a new runtime flag to control whether CSS Animations and CSS Transitions should run using the Web Animations timeline
1025         https://bugs.webkit.org/show_bug.cgi?id=183370
1026         <rdar://problem/38180729>
1027
1028         Reviewed by Dean Jackson.
1029
1030         Before we start creating WebAnimation objects to perform CSS Animations and CSS Transitions, which will replace the existing codepath
1031         involving CSSAnimationController and CompositeAnimation, we need a runtime flag that will allow all the new code to be turned off by
1032         default while we bring this feature up.
1033
1034         * Shared/WebPreferences.yaml:
1035         * UIProcess/API/C/WKPreferences.cpp:
1036         (WKPreferencesSetCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled):
1037         (WKPreferencesGetCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled):
1038         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1039         * UIProcess/API/Cocoa/WKPreferences.mm:
1040         (-[WKPreferences _setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled:]):
1041         (-[WKPreferences _cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled]):
1042         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1043         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1044         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1045         (WebKit::InjectedBundle::setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled):
1046         * WebProcess/InjectedBundle/InjectedBundle.h:
1047
1048 2018-03-06  Ms2ger  <Ms2ger@igalia.com>
1049
1050         [GLib] Implement WebsiteDataStore::defaultServiceWorkerRegistrationDirectory().
1051         https://bugs.webkit.org/show_bug.cgi?id=183364
1052
1053         Reviewed by Michael Catanzaro.
1054
1055         * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
1056         (API::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory): implement.
1057
1058 2018-03-06  Zan Dobersek  <zdobersek@igalia.com>
1059
1060         Unreviewed. Addressing further review feedback for patch landed in r229315.
1061
1062         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1063         (WebKit::CoordinatedGraphicsScene::commitSceneState): There's no need for
1064         explicit calls of the clear() method on both containers in the CommitScope
1065         objects, the destructors invoked for these objects from the CommitScope
1066         destructor will have the same effect.
1067
1068 2018-03-06  Zan Dobersek  <zdobersek@igalia.com>
1069
1070         [CoordGraphics] Remove unused scrolling-related code in TextureMapperLayer, CoordinatedGraphics stack
1071         https://bugs.webkit.org/show_bug.cgi?id=183340
1072
1073         Reviewed by Michael Catanzaro.
1074
1075         With most of the scrolling-related code in TextureMapperLayer on the
1076         chopping block, we can now drop the ScrollingClient inheritance and the
1077         commitScrollOffset() virtual method implementation. This enables
1078         removing the whole commitScrollOffset() call chain that ran from
1079         CoordinatedGraphicsScene through CoordinatedLayerTreeHost and
1080         CompositingCoordinator to the affected CoordinatedGraphicsLayer object.
1081
1082         The CoordinatedGraphicsScene::findScrollableContentsLayerAt() method is
1083         also unused and can be deleted.
1084
1085         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1086         (WebKit::CoordinatedGraphicsScene::setLayerState):
1087         (WebKit::CoordinatedGraphicsScene::createLayer):
1088         (WebKit::CoordinatedGraphicsScene::commitScrollOffset): Deleted.
1089         (WebKit::CoordinatedGraphicsScene::findScrollableContentsLayerAt): Deleted.
1090         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
1091         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1092         (WebKit::ThreadedCompositor::commitScrollOffset): Deleted.
1093         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
1094         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
1095         (WebKit::CompositingCoordinator::commitScrollOffset): Deleted.
1096         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
1097         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
1098         (WebKit::CoordinatedLayerTreeHost::commitScrollOffset): Deleted.
1099         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
1100         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
1101
1102 2018-03-06  Zan Dobersek  <zdobersek@igalia.com>
1103
1104         [CoordGraphics] Apply TextureMapperLayer animations with a single MonotonicTime value
1105         https://bugs.webkit.org/show_bug.cgi?id=183360
1106
1107         Reviewed by Sergio Villar Senin.
1108
1109         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1110         (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
1111         Pass the monotic time value, as returned by MonotonicTime::now(), to the
1112         TextureMapperLayer::applyAnimationsRecursively() call.
1113
1114 2018-03-06  Zan Dobersek  <zdobersek@igalia.com>
1115
1116         [CoordGraphics] Clean up CoordinatedImageBacking
1117         https://bugs.webkit.org/show_bug.cgi?id=183332
1118
1119         Reviewed by Carlos Garcia Campos.
1120
1121         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
1122         (WebKit::CompositingCoordinator::createImageBackingIfNeeded):
1123         Adjust call to CoordinatedImageBacking::getCoordinatedImageBackingID().
1124
1125 2018-03-06  Zan Dobersek  <zdobersek@igalia.com>
1126
1127         CoordinatedGraphicsScene: properly limit data specific to state commit operation
1128         https://bugs.webkit.org/show_bug.cgi?id=183326
1129
1130         Reviewed by Sergio Villar Senin.
1131
1132         In the process of state commit in CoordinatedGraphicsScene, the released
1133         image backings and backing stores with pending updates are stored in
1134         Vector and HashSet objects, respectively. Instead of these two objects
1135         being member variables on the CoordinatedGraphicsScene class, keep them
1136         in the CommitScope structure that's limited to the operations done in
1137         the commitSceneState() method.
1138
1139         The two member variables are dropped, and the CommitScope object is
1140         passed by reference to any helper method that needs to append either
1141         kind of object to the respective container. At the end of the state
1142         commit, backing stores with pending updates have those updates applied,
1143         and the two containers are cleared out as the CommitScope object is
1144         destroyed.
1145
1146         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1147         (WebKit::CoordinatedGraphicsScene::setLayerState):
1148         (WebKit::CoordinatedGraphicsScene::prepareContentBackingStore):
1149         (WebKit::CoordinatedGraphicsScene::resetBackingStoreSizeToLayerSize):
1150         (WebKit::CoordinatedGraphicsScene::removeTilesIfNeeded):
1151         (WebKit::CoordinatedGraphicsScene::updateTilesIfNeeded):
1152         (WebKit::CoordinatedGraphicsScene::syncImageBackings):
1153         (WebKit::CoordinatedGraphicsScene::updateImageBacking):
1154         (WebKit::CoordinatedGraphicsScene::clearImageBackingContents):
1155         (WebKit::CoordinatedGraphicsScene::removeImageBacking):
1156         (WebKit::CoordinatedGraphicsScene::commitSceneState):
1157         (WebKit::CoordinatedGraphicsScene::purgeGLResources):
1158         (WebKit::CoordinatedGraphicsScene::removeReleasedImageBackingsIfNeeded): Deleted.
1159         (WebKit::CoordinatedGraphicsScene::commitPendingBackingStoreOperations): Deleted.
1160         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
1161
1162 2018-03-05  Yusuke Suzuki  <utatane.tea@gmail.com>
1163
1164         Fix std::make_unique / new[] using system malloc
1165         https://bugs.webkit.org/show_bug.cgi?id=182975
1166
1167         Reviewed by JF Bastien.
1168
1169         Use Vector instead.
1170
1171         * NetworkProcess/win/SystemProxyWin.cpp:
1172         (WindowsSystemProxy::getSystemHttpProxy):
1173         * Platform/IPC/unix/ConnectionUnix.cpp:
1174         (IPC::Connection::processMessage):
1175         (IPC::Connection::sendOutputMessage):
1176         * Platform/win/LoggingWin.cpp:
1177         (WebKit::logLevelString):
1178         * Shared/SandboxExtension.h:
1179         * Shared/mac/SandboxExtensionMac.mm:
1180         (WebKit::SandboxExtension::HandleArray::allocate):
1181         (WebKit::SandboxExtension::HandleArray::operator[]):
1182         (WebKit::SandboxExtension::HandleArray::operator[] const):
1183         (WebKit::SandboxExtension::HandleArray::size const):
1184         (WebKit::SandboxExtension::HandleArray::encode const):
1185
1186 2018-03-05  Andy Estes  <aestes@apple.com>
1187
1188         [Mac] Teach WebCore::Pasteboard about file promise drags
1189         https://bugs.webkit.org/show_bug.cgi?id=183314
1190         <rdar://problem/38105493>
1191
1192         Reviewed by Darin Adler.
1193
1194         Added a FIXME comment.
1195
1196         * UIProcess/Cocoa/WebViewImpl.mm:
1197         (WebKit::WebViewImpl::performDragOperation):
1198
1199 2018-03-05  Jeff Miller  <jeffm@apple.com>
1200
1201         Expose still more WKPreferences SPI to match C SPI
1202         https://bugs.webkit.org/show_bug.cgi?id=183045
1203
1204         Reviewed by Alex Christensen.
1205
1206         * UIProcess/API/Cocoa/WKPreferences.mm:
1207         (-[WKPreferences _setAllowsInlineMediaPlayback:]):
1208         (-[WKPreferences _allowsInlineMediaPlayback]):
1209         (-[WKPreferences _setApplePayEnabled:]):
1210         (-[WKPreferences _applePayEnabled]):
1211         (-[WKPreferences _setDNSPrefetchingEnabled:]):
1212         (-[WKPreferences _dnsPrefetchingEnabled]):
1213         (-[WKPreferences _setInlineMediaPlaybackRequiresPlaysInlineAttribute:]):
1214         (-[WKPreferences _inlineMediaPlaybackRequiresPlaysInlineAttribute]):
1215         (-[WKPreferences _setInvisibleMediaAutoplayNotPermitted:]):
1216         (-[WKPreferences _invisibleMediaAutoplayNotPermitted]):
1217         (-[WKPreferences _setLegacyEncryptedMediaAPIEnabled:]):
1218         (-[WKPreferences _legacyEncryptedMediaAPIEnabled]):
1219         (-[WKPreferences _setMainContentUserGestureOverrideEnabled:]):
1220         (-[WKPreferences _mainContentUserGestureOverrideEnabled]):
1221         (-[WKPreferences _setMediaStreamEnabled:]):
1222         (-[WKPreferences _mediaStreamEnabled]):
1223         (-[WKPreferences _setNeedsStorageAccessFromFileURLsQuirk:]):
1224         (-[WKPreferences _needsStorageAccessFromFileURLsQuirk]):
1225         (-[WKPreferences _setPDFPluginEnabled:]):
1226         (-[WKPreferences _pdfPluginEnabled]):
1227         (-[WKPreferences _setRequiresUserGestureForAudioPlayback:]):
1228         (-[WKPreferences _requiresUserGestureForAudioPlayback]):
1229         (-[WKPreferences _setRequiresUserGestureForVideoPlayback:]):
1230         (-[WKPreferences _requiresUserGestureForVideoPlayback]):
1231         (-[WKPreferences _setServiceControlsEnabled:]):
1232         (-[WKPreferences _serviceControlsEnabled]):
1233         (-[WKPreferences _setShowsToolTipOverTruncatedText:]):
1234         (-[WKPreferences _showsToolTipOverTruncatedText]):
1235         (-[WKPreferences _setTextAreasAreResizable:]):
1236         (-[WKPreferences _textAreasAreResizable]):
1237         (-[WKPreferences _setUseGiantTiles:]):
1238         (-[WKPreferences _useGiantTiles]):
1239         (-[WKPreferences _setWantsBalancedSetDefersLoadingBehavior:]):
1240         (-[WKPreferences _wantsBalancedSetDefersLoadingBehavior]):
1241         (-[WKPreferences _setWebAudioEnabled:]):
1242         (-[WKPreferences _webAudioEnabled]):
1243         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1244
1245 2018-03-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1246
1247         Automation: clicking on a disabled option element shouldn't produce an error
1248         https://bugs.webkit.org/show_bug.cgi?id=183284
1249
1250         Reviewed by Brian Burg.
1251
1252         This was expected by selenium, but the WebDriver spec says we should simply do nothing in those cases.
1253
1254         14.1 Element Click.
1255         https://w3c.github.io/webdriver/webdriver-spec.html#element-click
1256
1257         Fixes: imported/w3c/webdriver/tests/element_click/select.py::test_option_disabled
1258
1259         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
1260         (WebKit::WebAutomationSessionProxy::selectOptionElement):
1261
1262 2018-03-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1263
1264         Automation: stale elements not detected when removed from the DOM
1265         https://bugs.webkit.org/show_bug.cgi?id=183278
1266
1267         Reviewed by Brian Burg.
1268
1269         We detect stale elements when the page is reloaded because the maps are recreated, but if an element is removed
1270         from the DOM for the same document we keep the nodes in the maps. We should clear stale elements before
1271         accessing the maps.
1272
1273         Fixes: imported/selenium/py/test/selenium/webdriver/common/webdriverwait_tests.py::testExpectedConditionStalenessOf
1274
1275         * WebProcess/Automation/WebAutomationSessionProxy.js:
1276         (let.AutomationSessionProxy.prototype.evaluateJavaScriptFunction): Call _clearStaleNodes()
1277         (let.AutomationSessionProxy.prototype.nodeForIdentifier): Ditto.
1278         (let.AutomationSessionProxy.prototype._clearStaleNodes): Check if cached nodes are still in document and remove them
1279         from the maps if they aren't.
1280
1281 2018-03-04  Yusuke Suzuki  <utatane.tea@gmail.com>
1282
1283         [WTF] Move currentCPUTime and sleep(Seconds) to CPUTime.h and Seconds.h respectively
1284         https://bugs.webkit.org/show_bug.cgi?id=183312
1285
1286         Reviewed by Mark Lam.
1287
1288         Remove wtf/CurrentTime.h include pragma.
1289
1290         * NetworkProcess/NetworkResourceLoader.cpp:
1291         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
1292         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
1293         * Platform/IPC/Connection.cpp:
1294         * Platform/unix/SharedMemoryUnix.cpp:
1295         * PluginProcess/WebProcessConnection.cpp:
1296         * Shared/ios/NativeWebTouchEventIOS.mm:
1297         * UIProcess/DrawingAreaProxyImpl.cpp:
1298         * UIProcess/ios/WKContentView.mm:
1299         * UIProcess/linux/MemoryPressureMonitor.cpp:
1300         * WebProcess/Gamepad/WebGamepad.cpp:
1301         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1302         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
1303         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
1304         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
1305         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm:
1306         * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp:
1307         * WebProcess/WebProcess.cpp:
1308         * WebProcess/cocoa/WebProcessCocoa.mm:
1309         * WebProcess/gtk/WebProcessMainGtk.cpp:
1310         * WebProcess/win/WebProcessMainWin.cpp:
1311         * WebProcess/wpe/WebProcessMainWPE.cpp:
1312
1313 2018-03-02  Brian Burg  <bburg@apple.com>
1314
1315         Web Automation: script evaluations via WebDriver should have a user gesture indicator
1316         https://bugs.webkit.org/show_bug.cgi?id=183230
1317         <rdar://problem/37959739>
1318
1319         Reviewed by Andy Estes.
1320
1321         APIs that normally require a user gesture should just work when using via WebDriver.
1322         To support cases where tests need to simulate user actions with JavaScript, use a
1323         fake user gesture, similar to how -[WKWebView evaluateJavaScript:] forces a user
1324         gesture when clients evaluate JavaScript in their web view.
1325
1326         No new tests, this is covered by W3C tests that use the Fullscreen API.
1327         This API does nothing if there is no user gesture; with this patch, it just works.
1328
1329         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
1330         (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction):
1331
1332 2018-03-04  Tim Horton  <timothy_horton@apple.com>
1333
1334         Make !ENABLE(DATA_DETECTION) iOS build actually succeed
1335         https://bugs.webkit.org/show_bug.cgi?id=183283
1336         <rdar://problem/38062148>
1337
1338         Reviewed by Sam Weinig.
1339
1340         * UIProcess/ios/WKContentViewInteraction.mm:
1341         (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
1342         (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
1343         Guard some more code with ENABLE(DATA_DETECTION).
1344
1345 2018-03-04  Dan Bernstein  <mitz@apple.com>
1346
1347         Building with ONLY_ACTIVE_ARCH=NO and ARCHS=x86_64 fails
1348         https://bugs.webkit.org/show_bug.cgi?id=183320
1349
1350         Reviewed by Tim Horton.
1351
1352         * Configurations/PluginService.32.xcconfig: If the Apple build tool specifies
1353           RC_ARCHS=x86_64, then let the service build for x86_64, but don’t install it.
1354
1355 2018-03-03  Brent Fulgham  <bfulgham@apple.com>
1356
1357         Notify the NetworkProcess when a session is servicing an automation client
1358         https://bugs.webkit.org/show_bug.cgi?id=183306
1359         <rdar://problem/37835783>
1360
1361         Reviewed by Brian Burg.
1362
1363         Network loads servicing WebDriver are done through an ephemeral session. While this is great
1364         for protecting a developer's machine from sharing state with test runs, it has the unintended
1365         effect of blocking certain logging operations.
1366
1367         We do not log content in ephemeral sessions to protect user privacy. However, ephemeral sessions
1368         generated by WebDriver should participate in logging so that proper testing (with logging) can
1369         be done.
1370
1371         This patch signals the NetworkProcess when an ephemeral session (created for automation purposes)
1372         is created, so that it can allow logging.
1373
1374         * NetworkProcess/NetworkProcess.cpp:
1375         (WebKit::NetworkProcess::destroySession): Remove controlled-by-automation entry.
1376         (WebKit::NetworkProcess::sessionIsControlledByAutomation const): Added.
1377         (WebKit::NetworkProcess::setSessionIsControlledByAutomation): Added.
1378         * NetworkProcess/NetworkProcess.h:
1379         * NetworkProcess/NetworkProcess.messages.in:
1380         * NetworkProcess/NetworkResourceLoader.cpp:
1381         (WebKit::NetworkResourceLoader::isAlwaysOnLoggingAllowed const): Checks if the relevant session
1382         is servicing an automation client, and returns true if it is.
1383         * UIProcess/WebPageProxy.cpp:
1384         (WebKit::WebPageProxy::WebPageProxy): Signal the network process if this page is being created
1385         for an automation client.
1386
1387 2018-03-02  Yusuke Suzuki  <utatane.tea@gmail.com>
1388
1389         [WTF] Remove RunLoop and RunLoop::Timer's interface using double as seconds
1390         https://bugs.webkit.org/show_bug.cgi?id=183293
1391
1392         Reviewed by Alex Christensen.
1393
1394         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
1395         (WebKit::CompositingRunLoop::scheduleUpdate):
1396         (WebKit::CompositingRunLoop::compositionCompleted):
1397         (WebKit::CompositingRunLoop::updateCompleted):
1398         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp:
1399         (WebKit::ThreadedDisplayRefreshMonitor::dispatchDisplayRefreshCallback):
1400
1401 2018-03-02  Don Olmstead  <don.olmstead@sony.com>
1402
1403         Share common WebError implementation
1404         https://bugs.webkit.org/show_bug.cgi?id=183303
1405
1406         Reviewed by Ryosuke Niwa.
1407
1408         * Shared/WebErrors.cpp:
1409         (WebKit::cancelledError):
1410         (WebKit::fileDoesNotExistError):
1411         * Shared/glib/WebErrorsGlib.cpp: Removed.
1412         * SourcesGTK.txt:
1413         * SourcesWPE.txt:
1414
1415 2018-03-02  Youenn Fablet  <youenn@apple.com>
1416
1417         LayoutTest imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-within-sw.https.html is a flaky failure
1418         https://bugs.webkit.org/show_bug.cgi?id=179248
1419         <rdar://problem/35377756>
1420
1421         Reviewed by Chris Dumez.
1422
1423         In case we go up to the initializeSize step and Caches was cleared
1424         between the time we stated to initialize and the time we got there,
1425         we need to make as if Caches was not initialized,
1426         thus keeping m_isInitialized to false and m_storage to nullptr.
1427
1428         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
1429         (WebKit::CacheStorage::Caches::initializeSize):
1430
1431 2018-03-02  Youenn Fablet  <youenn@apple.com>
1432
1433         Clients should register to StorageProcess with their service worker registration identifier
1434         https://bugs.webkit.org/show_bug.cgi?id=182313
1435         <rdar://problem/38044403>
1436
1437         Reviewed by Chris Dumez.
1438
1439         Relanding.
1440
1441         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1442         (WebKit::WebSWServerConnection::registerServiceWorkerClient):
1443         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1444         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
1445         * WebProcess/Storage/WebSWClientConnection.cpp:
1446         (WebKit::WebSWClientConnection::registerServiceWorkerClient):
1447         * WebProcess/Storage/WebSWClientConnection.h:
1448
1449 2018-03-02  Tim Horton  <timothy_horton@apple.com>
1450
1451         Make it possible to disable WKPDFView
1452         https://bugs.webkit.org/show_bug.cgi?id=183281
1453         <rdar://problem/38060815>
1454
1455         Reviewed by Dan Bates.
1456
1457         * UIProcess/API/Cocoa/WKWebView.mm:
1458         (-[WKWebView _isBackground]):
1459         (-[WKWebView _isDisplayingPDF]):
1460         (-[WKWebView _dataForDisplayedPDF]):
1461         (-[WKWebView _suggestedFilenameForDisplayedPDF]):
1462         * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
1463         (-[WKWebViewContentProviderRegistry init]):
1464         * UIProcess/ios/WKPDFView.h:
1465         * UIProcess/ios/WKPDFView.mm:
1466
1467 2018-03-02  Youenn Fablet  <youenn@apple.com>
1468
1469         WebProcessProxy should handle its completion handler at destruction time
1470         https://bugs.webkit.org/show_bug.cgi?id=183224
1471
1472         Reviewed by Brady Eidson.
1473
1474         * UIProcess/WebProcessProxy.cpp:
1475         (WebKit::WebProcessProxy::~WebProcessProxy):
1476         * UIProcess/WebProcessProxy.h:
1477
1478 2018-03-02  Brent Fulgham  <bfulgham@apple.com>
1479
1480         Update WebContent process sandbox IOKit properties
1481         https://bugs.webkit.org/show_bug.cgi?id=183269
1482         <rdar://problem/37853282>
1483
1484         Reviewed by Eric Carlson.
1485
1486         * WebProcess/com.apple.WebProcess.sb.in:
1487
1488 2018-03-01  Yusuke Suzuki  <utatane.tea@gmail.com>
1489
1490         Remove monotonicallyIncreasingTime
1491         https://bugs.webkit.org/show_bug.cgi?id=182911
1492
1493         Reviewed by Michael Catanzaro.
1494
1495         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
1496         (WebKit::CacheStorage::Cache::toRecordInformation):
1497         * Platform/IPC/ArgumentCoders.cpp:
1498         (IPC::ArgumentCoder<Seconds>::encode):
1499         (IPC::ArgumentCoder<Seconds>::decode):
1500         (IPC::ArgumentCoder<MonotonicTime>::encode):
1501         (IPC::ArgumentCoder<MonotonicTime>::decode):
1502         * Platform/IPC/ArgumentCoders.h:
1503         * Shared/Gamepad/GamepadData.cpp:
1504         (WebKit::GamepadData::GamepadData):
1505         * Shared/Gamepad/GamepadData.h:
1506         (WebKit::GamepadData::lastUpdateTime const):
1507         * Shared/WebCoreArgumentCoders.cpp:
1508         (IPC::ArgumentCoder<MonotonicTime>::encode): Deleted.
1509         (IPC::ArgumentCoder<MonotonicTime>::decode): Deleted.
1510         (IPC::ArgumentCoder<Seconds>::encode): Deleted.
1511         (IPC::ArgumentCoder<Seconds>::decode): Deleted.
1512         ArgumentCoders for MonotonicTime and Seconds are now used internally.
1513         Move them to Platform/IPC/ArgumentCoders.h.
1514
1515         * Shared/WebCoreArgumentCoders.h:
1516         * UIProcess/API/glib/IconDatabase.cpp:
1517         (WebKit::IconDatabase::iconDatabaseSyncThread):
1518         * UIProcess/DrawingAreaProxyImpl.cpp:
1519         (WebKit::DrawingAreaProxyImpl::DrawingMonitor::start):
1520         (WebKit::DrawingAreaProxyImpl::DrawingMonitor::stop):
1521         (WebKit::DrawingAreaProxyImpl::DrawingMonitor::didDraw):
1522         * UIProcess/DrawingAreaProxyImpl.h:
1523         * UIProcess/Gamepad/UIGamepad.h:
1524         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
1525         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
1526         (WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidStart):
1527         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h:
1528         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
1529         (WebKit::RemoteLayerTreeHost::animationDidStart):
1530         * WebProcess/WebPage/DrawingArea.h:
1531         (WebKit::DrawingArea::acceleratedAnimationDidStart):
1532         * WebProcess/WebPage/DrawingArea.messages.in:
1533         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.h:
1534         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
1535         (mediaTimeToCurrentTime):
1536         (-[WKAnimationDelegate animationDidStart:]):
1537         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
1538         (WebKit::PlatformCALayerRemote::animationStarted):
1539         This argument `beginTime` is not CFTimeInverval actually. We add currentTimeToMediaTime
1540         conversion here to fix this issue.
1541
1542         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h:
1543         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h:
1544         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
1545         (WebKit::RemoteLayerTreeContext::animationDidStart):
1546         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
1547         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
1548         (WebKit::RemoteLayerTreeDrawingArea::acceleratedAnimationDidStart):
1549         * WebProcess/cocoa/WebProcessCocoa.mm:
1550         (WebKit::WebProcess::destroyRenderingResources):
1551
1552 2018-03-02  Brent Fulgham  <bfulgham@apple.com>
1553
1554         [iOS] whitelist missing AppleJPEG logging feature
1555         https://bugs.webkit.org/show_bug.cgi?id=183270
1556         <rdar://problem/37808612>
1557
1558         Reviewed by Alex Christensen.
1559
1560         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1561
1562 2018-03-02  Youenn Fablet  <youenn@apple.com>
1563
1564         IOChannel::read and IOChannel::write can destroy the completion handler in the thread used to manipulate thread
1565         https://bugs.webkit.org/show_bug.cgi?id=183261
1566
1567         Reviewed by Antti Koivisto.
1568
1569         Moving the completion handler when being called so that it gets desttroyed in the thread it is called.
1570
1571         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
1572         (WebKit::NetworkCache::IOChannel::read):
1573         (WebKit::NetworkCache::IOChannel::write):
1574
1575 2018-03-02  Dan Bernstein  <mitz@apple.com>
1576
1577         Safari uses WebContent.Development when loading injected bundle embedded in its app bundle
1578         https://bugs.webkit.org/show_bug.cgi?id=183275
1579
1580         Reviewed by Tim Horton.
1581
1582         * UIProcess/mac/WebProcessProxyMac.mm:
1583         (WebKit::WebProcessProxy::shouldAllowNonValidInjectedCode const): Return false if this is
1584           a platform binary. We can also return false unconditionally when building for any shipping
1585           major macOS release.
1586
1587 2018-03-01  Commit Queue  <commit-queue@webkit.org>
1588
1589         Unreviewed, rolling out r229153.
1590         https://bugs.webkit.org/show_bug.cgi?id=183274
1591
1592         it is breaking imported/w3c/web-platform-tests/service-workers
1593         /service-worker/clients-matchall-exact-controller.https.html
1594         (Requested by youenn on #webkit).
1595
1596         Reverted changeset:
1597
1598         "Clients should register to StorageProcess with their service
1599         worker registration identifier"
1600         https://bugs.webkit.org/show_bug.cgi?id=182313
1601         https://trac.webkit.org/changeset/229153
1602
1603 2018-03-01  Brent Fulgham  <bfulgham@apple.com>
1604
1605         Add the "com.apple.security.cs.disable-library-validation” entitlement to the Plugin Process
1606         https://bugs.webkit.org/show_bug.cgi?id=183252
1607         <rdar://problem/37887136>
1608
1609         Reviewed by David Kilzer.
1610
1611         * Configurations/PluginService.entitlements:
1612
1613 2018-03-01  Youenn Fablet  <youenn@apple.com>
1614
1615         Clients should register to StorageProcess with their service worker registration identifier
1616         https://bugs.webkit.org/show_bug.cgi?id=182313
1617
1618         Reviewed by Chris Dumez.
1619
1620         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1621         (WebKit::WebSWServerConnection::registerServiceWorkerClient):
1622         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1623         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
1624         * WebProcess/Storage/WebSWClientConnection.cpp:
1625         (WebKit::WebSWClientConnection::registerServiceWorkerClient):
1626         * WebProcess/Storage/WebSWClientConnection.h:
1627
1628 2018-03-01  Youenn Fablet  <youenn@apple.com>
1629
1630         LayoutTest imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-within-sw.https.html is a flaky failure
1631         https://bugs.webkit.org/show_bug.cgi?id=179248
1632         <rdar://problem/35377756>
1633
1634         Reviewed by Chris Dumez.
1635
1636         WebKitTestRunner is clearing caches for every test but there might still be some on-going cache activity due to a previous test.
1637         In that case, the activity might try to open the Caches object at the same time the files are deleted by the clearing task.
1638         If the new test is trying to open the same caches, it will also receive the same error, hence the console log message.
1639
1640         To fix that issue, we clear the initialization pending callbacks when clearing the caches.
1641         This prevents the new test to receive the error since the new test should only start some cache activity after the cache clear task is done.
1642         Made refactoring to append the first callback into the list of pending callbacks.
1643
1644         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
1645         (WebKit::CacheStorage::Caches::initialize):
1646         (WebKit::CacheStorage::Caches::initializeSize):
1647         (WebKit::CacheStorage::Caches::clear):
1648         * NetworkProcess/cache/CacheStorageEngineCaches.h:
1649
1650 2018-03-01  Youenn Fablet  <youenn@apple.com>
1651
1652         Add API test to validate setting of service worker and cache storage directories
1653         https://bugs.webkit.org/show_bug.cgi?id=182543
1654
1655         Reviewed by Chris Dumez.
1656
1657         Add cache engine directory path to its representation dump.
1658         This is used in API tests to check that the path is correctly set.
1659
1660         Add a way for to know whether a service worker was registered from a WKWebsiteDataStore.
1661         This is used in API tests to check that the path is correctly set.
1662
1663         * NetworkProcess/cache/CacheStorageEngine.cpp:
1664         (WebKit::CacheStorage::Engine::representation):
1665         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1666         (-[WKWebsiteDataStore _hasRegisteredServiceWorker]):
1667         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
1668
1669 2018-03-01  Wenson Hsieh  <wenson_hsieh@apple.com>
1670
1671         Fix some errors due to some mach port APIs being unavailable on watchOS
1672         https://bugs.webkit.org/show_bug.cgi?id=183262
1673         <rdar://problem/38028521>
1674
1675         Reviewed by Tim Horton.
1676
1677         Minor build fix; mach_port_guard and mach_port_unguard are not available on this platform.
1678
1679         * Platform/IPC/mac/ConnectionMac.mm:
1680         (IPC::Connection::platformInvalidate):
1681         (IPC::Connection::platformInitialize):
1682         (IPC::Connection::open):
1683
1684 2018-03-01  Per Arne Vollan  <pvollan@apple.com>
1685
1686         Unreviewed build fix after r229140.
1687
1688         * WebProcess/cocoa/WebProcessCocoa.mm:
1689
1690 2018-03-01  Per Arne Vollan  <pvollan@apple.com>
1691
1692         Scrollbar preferences are ignored when the WebContent process doesn't have access to the WindowServer.
1693         https://bugs.webkit.org/show_bug.cgi?id=183231
1694         <rdar://problem/37793457>
1695
1696         Reviewed by Brent Fulgham.
1697
1698         When the WebContent process doesn't have access to the WindowServer, the scrollbars are always of the overlay type.
1699         The notification about scrollbar preferences is never received by the WebContent process when there is no
1700         WindowServer access. This can be fixed by adding an observer of scrollbar preferences in the UI process, and
1701         notifying the WebProcess about this by sending it a message. This message should also contain the preferred
1702         scrollbar type, since the call '[NSScroller preferredScrollerStyle]' will always return the overlay style when
1703         there is no WindowServer access.
1704
1705         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1706         (WebKit::WebProcessPool::registerNotificationObservers):
1707         (WebKit::WebProcessPool::unregisterNotificationObservers):
1708         * UIProcess/WebProcessPool.h:
1709         * WebProcess/WebProcess.cpp:
1710         (WebKit::WebProcess::initializeProcess):
1711         * WebProcess/WebProcess.h:
1712         * WebProcess/WebProcess.messages.in:
1713         * WebProcess/cocoa/WebProcessCocoa.mm:
1714         (WebKit::WebProcess::scrollerStylePreferenceChanged):
1715
1716 2018-03-01  Antti Koivisto  <antti@apple.com>
1717
1718         Crash when updating cache entry after validation in apps that uses class A file protection
1719         https://bugs.webkit.org/show_bug.cgi?id=183242
1720         <rdar://problem/33289058>
1721
1722         Reviewed by Chris Dumez.
1723
1724         When validating a cache entry, we keep it alive until we get a network response. With 304 response
1725         we then update the headers of this existing entry. This accesses the body data of the entry which
1726         may be backed by a mapped file. If the app uses class A protection, user might have locked
1727         the device and the entry might have become inaccessible, leading to a crash.
1728
1729         * NetworkProcess/cache/NetworkCacheEntry.cpp:
1730         (WebKit::NetworkCache::Entry::setNeedsValidation):
1731
1732         In case of class A protection, pull the data to a memory buffer immediately before starting a revalidation request.
1733         This makes the window where the file could become inaccessible much shorter (since it no longer depends on network).
1734
1735 2018-03-01  Carlos Garcia Campos  <cgarcia@igalia.com>
1736
1737         REGRESSION(r221514): [GTK] UI process crash in WebKit::WaylandCompositor::Surface::flushPendingFrameCallbacks
1738         https://bugs.webkit.org/show_bug.cgi?id=183091
1739
1740         Reviewed by Michael Catanzaro.
1741
1742         Invalidate the surface in the page map when the backing store is destroyed.
1743
1744         * UIProcess/gtk/WaylandCompositor.cpp:
1745         (WebKit::WaylandCompositor::willDestroySurface):
1746         * UIProcess/gtk/WaylandCompositor.h:
1747
1748 2018-02-28  Brian Burg  <bburg@apple.com>
1749
1750         [Cocoa] Web Automation: provide a way to ask clients the type of a JavaScript dialog
1751         https://bugs.webkit.org/show_bug.cgi?id=182660
1752         <rdar://problem/37408183>
1753
1754         Reviewed by Tim Horton and Carlos Garcia Campos.
1755
1756         Add another delegate method to ask what type of dialog is being shown.
1757         This is used to implement §18.4 Step 5, where sending text to a dialog
1758         without a prompt will return several different kinds of errors.
1759
1760         No new tests, covered by web platform tests once Safari side has landed.
1761
1762         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h: Update FIXME radar numbers.
1763         * UIProcess/Cocoa/AutomationSessionClient.h:
1764         * UIProcess/Cocoa/AutomationSessionClient.mm:
1765         (WebKit::AutomationSessionClient::AutomationSessionClient):
1766         (WebKit::toImpl):
1767         (WebKit::AutomationSessionClient::typeOfCurrentJavaScriptDialogOnPage):
1768         If there is no current dialog to be checked, the client can return the 'None'
1769         type. This gets converted into a std::nullopt and causes a command error later.
1770
1771 2018-02-28  John Wilander  <wilander@apple.com>
1772
1773         Remove assertion from ResourceLoadStatisticsClassifier::calculateResourcePrevalence() which causes crashes when domains are explicitly set as prevalent without the associated statistics
1774         https://bugs.webkit.org/show_bug.cgi?id=183233
1775
1776         Unreviewed removal of an assertion that's causing layout test crashes.
1777
1778         * Platform/classifier/ResourceLoadStatisticsClassifier.cpp:
1779         (WebKit::ResourceLoadStatisticsClassifier::calculateResourcePrevalence):
1780             Removed ASSERT(currentPrevalence == Low).
1781
1782 2018-02-28  John Wilander  <wilander@apple.com>
1783
1784         Add a second tier of prevalence to facilitate telemetry on very prevalent domains
1785         https://bugs.webkit.org/show_bug.cgi?id=183218
1786         <rdar://problem/37992388>
1787
1788         Reviewed by Brent Fulgham.
1789
1790         * Platform/classifier/ResourceLoadStatisticsClassifier.cpp:
1791         (WebKit::vectorLength):
1792             New convenience function.
1793         (WebKit::ResourceLoadStatisticsClassifier::calculateResourcePrevalence):
1794             Renamed from ResourceLoadStatisticsClassifier::hasPrevalentResourceCharacteristics().
1795             Now returns a value from the enum ResourceLoadPrevalence.
1796         (WebKit::ResourceLoadStatisticsClassifier::classifyWithVectorThreshold):
1797             Now uses the new vectorLength() convenience function.
1798         (WebKit::ResourceLoadStatisticsClassifier::hasPrevalentResourceCharacteristics): Deleted.
1799             Renamed to ResourceLoadStatisticsClassifier::calculateResourcePrevalence().
1800         * Platform/classifier/ResourceLoadStatisticsClassifier.h:
1801             Added enum ResourceLoadPrevalence.
1802         * Shared/WebCoreArgumentCoders.cpp:
1803         (IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
1804         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
1805             Handling of the new boolean field isVeryPrevalentResource.
1806         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1807         (WKWebsiteDataStoreSetStatisticsVeryPrevalentResource):
1808         (WKWebsiteDataStoreIsStatisticsVeryPrevalentResource):
1809             Test infrastructure.
1810         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
1811         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1812         (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
1813         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
1814         (WebKit::WebResourceLoadStatisticsStore::setVeryPrevalentResource):
1815         (WebKit::WebResourceLoadStatisticsStore::isVeryPrevalentResource):
1816         (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
1817             All of these are for handling of the two-tier classification.
1818             Also bumped the statisticsModelVersion to 12.
1819         * UIProcess/WebResourceLoadStatisticsStore.h:
1820
1821 2018-02-28  Alex Christensen  <achristensen@webkit.org>
1822
1823         Reduce use of NetworkingContext in WebKit
1824         https://bugs.webkit.org/show_bug.cgi?id=183213
1825
1826         Reviewed by Brady Eidson.
1827
1828         * NetworkProcess/RemoteNetworkingContext.h:
1829         * WebProcess/Network/WebLoaderStrategy.cpp:
1830         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
1831         (WebKit::WebLoaderStrategy::preconnectTo):
1832         * WebProcess/Network/WebLoaderStrategy.h:
1833         * WebProcess/Plugins/PluginView.cpp:
1834         (WebKit::PluginView::proxiesForURL):
1835         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1836         * WebProcess/WebPage/WebFrame.cpp:
1837
1838 2018-02-28  Brent Fulgham  <bfulgham@apple.com>
1839
1840         Remove network access from the WebContent process sandbox
1841         https://bugs.webkit.org/show_bug.cgi?id=183192
1842         <rdar://problem/35369115>
1843
1844         Reviewed by Alex Christensen.
1845
1846         Remove the 'system-network', 'allow-network-common', and 'network-client' access from the WebContent process.
1847         That's why we have a Network Process! 
1848
1849         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1850         * WebProcess/com.apple.WebProcess.sb.in:
1851
1852 2018-02-27  Tim Horton  <timothy_horton@apple.com>
1853
1854         Ensure target triple is propagated correctly to DerivedSources.make
1855         https://bugs.webkit.org/show_bug.cgi?id=183189
1856         <rdar://problem/37959694>
1857
1858         Reviewed by Dan Bernstein.
1859
1860         * Configurations/Base.xcconfig:
1861         * DerivedSources.make:
1862         Ditto the WebCore ChangeLog.
1863
1864 2018-02-27  Yongjun Zhang  <yongjun_zhang@apple.com>
1865
1866         Make it possible to set suggestions in extra zoom mode.
1867         https://bugs.webkit.org/show_bug.cgi?id=183154
1868         <rdar://problem/35227450>
1869
1870         Reviewed by Tim Horton.
1871
1872         In extra zoom mode, when presenting WKFocusedFormControlViewController, make it the inputDelegate for
1873         WKContentView. This is needed to ensure we can capture/cache the suggestions when _WKInputSession's
1874         suggestions is updated. Later, when we present WKTextInputViewController, we can pass the cached
1875         suggestions.
1876
1877         * UIProcess/ios/WKContentViewInteraction.mm:
1878         (-[WKContentView presentFocusedFormControlViewController:]): Set _focusedFormControlViewController as
1879             the inputDelegate for WKContentView.
1880         (-[WKContentView dismissFocusedFormControlViewController:]): Null the inputDelegate on dismissal.
1881         (-[WKContentView presentTextInputViewController:]): Pass the suggestions from WKFocusedFormControlViewController to
1882             WKTextInputViewController when the latter is presented.
1883         (-[WKContentView textInputController:didCommitText:]): Call the new delegate method textInputController:didCommitText:withSuggestion:.
1884         (-[WKContentView textInputController:didCommitText:withSuggestion:]): When a suggestions is selected, insert the
1885             suggestion which will notify the client.
1886         (-[WKContentView focusedFormControllerDidUpdateSuggestions:]): Called when the suggestion is updated after the input
1887             view controller is presented.
1888
1889 2018-02-27  Tim Horton  <timothy_horton@apple.com>
1890
1891         Stop using deprecated CADisplay SPI
1892         https://bugs.webkit.org/show_bug.cgi?id=183150
1893         <rdar://problem/37918297>
1894
1895         Reviewed by Simon Fraser.
1896
1897         * Platform/spi/ios/FrontBoardServicesSPI.h: Added.
1898         * Platform/spi/ios/UIKitSPI.h:
1899         * UIProcess/API/Cocoa/WKWebView.mm:
1900         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
1901         * WebKit.xcodeproj/project.pbxproj:
1902         Switch to the more modern way of getting the display name.
1903
1904 2018-02-27  Ryan Haddad  <ryanhaddad@apple.com>
1905
1906         Unreviewed, rolling out r229055.
1907
1908         Breaks internal builds.
1909
1910         Reverted changeset:
1911
1912         "Stop using deprecated CADisplay SPI"
1913         https://bugs.webkit.org/show_bug.cgi?id=183150
1914         https://trac.webkit.org/changeset/229055
1915
1916 2018-02-27  Wenson Hsieh  <wenson_hsieh@apple.com>
1917
1918         [Extra zoom mode] Implement additional SPI for adjusting viewport shrink-to-fit behavior
1919         https://bugs.webkit.org/show_bug.cgi?id=183100
1920         <rdar://problem/37840987>
1921
1922         Reviewed by Tim Horton.
1923
1924         Add new SPI hooks to provide finer control over certain aspects of the shrink-to-fit viewport heuristic.
1925         Currently, in certain cases of iPad multitasking, Safari allows shrinking content to fit by default. This means
1926         that even when "width=device-width" is used, if the contents of the page are too wide to fit within the
1927         viewport's width, we'll adjust the initial scale such that the viewport can fit all of the content.
1928
1929         However, in certain viewport dimensions, this heuristic is insufficient to ensure that pages are laid out and
1930         displayed properly within the viewport. Namely, one could imagine that an element with a hard-coded width that
1931         is larger than the real viewport width would cause all other elements with dimensions relative to the body to be
1932         excessively shrunk down once shrink-to-fit is applied, so the page would still look broken even if the contents
1933         of the page all fit within the viewport.
1934
1935         To mitigate this, we decouple the notions of minimum layout size from the size of the actual viewport (which we
1936         simply refer to as "view size"). This allows us to introduce a mechanism where we lay out the page at a given
1937         minimum layout size that is larger than the size of the view; later, when we determine the initial scale, we
1938         then apply shrink-to-fit scaling using the view size rather than the minimum layout size. This grants us the
1939         ability to lay out content as if our view were large, but still ensure that the contents of the page fit within
1940         the actual view.
1941
1942         * Shared/VisibleContentRectUpdateInfo.cpp:
1943         (WebKit::VisibleContentRectUpdateInfo::encode const):
1944         (WebKit::VisibleContentRectUpdateInfo::decode):
1945         (WebKit::operator<<):
1946         * Shared/VisibleContentRectUpdateInfo.h:
1947         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
1948         (WebKit::VisibleContentRectUpdateInfo::forceHorizontalShrinkToFit const):
1949         (WebKit::operator==):
1950
1951         Plumb the forceHorizontalShrinkToFit flag through VisibleContentRectUpdateInfo.
1952
1953         * Shared/WebPageCreationParameters.cpp:
1954         (WebKit::WebPageCreationParameters::encode const):
1955         (WebKit::WebPageCreationParameters::decode):
1956         * Shared/WebPageCreationParameters.h:
1957
1958         Plumb viewSize through IPC to WebPage.
1959
1960         * UIProcess/API/Cocoa/WKWebView.mm:
1961         (-[WKWebView _initializeWithConfiguration:]):
1962
1963         Start off WKWebView flags at their initial values.
1964
1965         (-[WKWebView _minimumAllowedLayoutWidth]):
1966         (-[WKWebView _setMinimumAllowedLayoutWidth:]):
1967
1968         This provides the minimum width at which the page will lay out, such that if the view width dips below this
1969         value, we'll use this minimum allowed layout width instead. 0 by default.
1970
1971         (-[WKWebView activeMinimumLayoutSizes:]):
1972
1973         Refactor this from a static function to a helper method on WKWebView that computes both the minimum layout size
1974         (which takes minimum allowed layout width into account) as well as the real view size. Refactor all call sites
1975         to use this new method, and also propagate the view size down via IPC, alongside the minimum layout size.
1976
1977         (-[WKWebView _dispatchSetMinimumLayoutSize:viewSize:]):
1978         (-[WKWebView _frameOrBoundsChanged]):
1979         (-[WKWebView _setMinimumLayoutSizeOverride:]):
1980         (-[WKWebView _setForceHorizontalViewportShrinkToFit:]):
1981         (-[WKWebView _forceHorizontalViewportShrinkToFit]):
1982
1983         Setting this flag to YES forces us to always shrink-to-fit in the horizontal axis. NO by default.
1984
1985         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
1986         (-[WKWebView _endAnimatedResize]):
1987         (activeMinimumLayoutSize): Deleted.
1988
1989         More refactoring to replace activeMinimumLayoutSize() with -activeMinimumLayoutSizes:.
1990
1991         (-[WKWebView _dispatchSetMinimumLayoutSize:]): Deleted.
1992         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1993         * UIProcess/WebPageProxy.cpp:
1994         (WebKit::WebPageProxy::creationParameters):
1995         * UIProcess/WebPageProxy.h:
1996         * UIProcess/ios/WKContentView.mm:
1997         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
1998
1999         Pass _forceHorizontalViewportShrinkToFit into the visible content rect update.
2000
2001         * UIProcess/ios/WebPageProxyIOS.mm:
2002         (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
2003         (WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSize):
2004
2005         Plumb viewSize alongside the existing minimumLayoutSize.
2006
2007         * WebProcess/WebPage/WebPage.cpp:
2008         (WebKit::m_credentialsMessenger):
2009         * WebProcess/WebPage/WebPage.h:
2010         * WebProcess/WebPage/WebPage.messages.in:
2011         * WebProcess/WebPage/ios/WebPageIOS.mm:
2012         (WebKit::WebPage::setViewportConfigurationMinimumLayoutSize):
2013         (WebKit::WebPage::dynamicViewportSizeUpdate):
2014         (WebKit::WebPage::updateVisibleContentRects):
2015
2016         Set forceHorizontalShrinkToFit on the viewport configuration here.
2017
2018 2018-02-27  Tim Horton  <timothy_horton@apple.com>
2019
2020         Stop using deprecated CADisplay SPI
2021         https://bugs.webkit.org/show_bug.cgi?id=183150
2022         <rdar://problem/37918297>
2023
2024         Reviewed by Simon Fraser.
2025
2026         * Platform/spi/ios/FrontBoardServicesSPI.h: Added.
2027         * Platform/spi/ios/UIKitSPI.h:
2028         * UIProcess/API/Cocoa/WKWebView.mm:
2029         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
2030         * WebKit.xcodeproj/project.pbxproj:
2031         Switch to the more modern way of getting the display name.
2032
2033 2018-02-26  Youenn Fablet  <youenn@apple.com>
2034
2035         Caches::m_storage should be set to null in case of error at initialization time
2036         https://bugs.webkit.org/show_bug.cgi?id=183068
2037
2038         Reviewed by Chris Dumez.
2039
2040         In case of error, we need to set m_storage back to nullptr so that
2041         next tries to initialize it will restart from scratch.
2042         If we do not set it to nullptr, we end up storing the initialize
2043         callback in a queue and the callback will never be called.
2044
2045         This is difficult to test as we need the following conditions:
2046         - we need to have an error case, like a disk writing error
2047         - we need the web app to open a cache in two different pages/frames at about the same time.
2048
2049         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2050         (WebKit::CacheStorage::Caches::initialize):
2051
2052 2018-02-26  Commit Queue  <commit-queue@webkit.org>
2053
2054         Unreviewed, rolling out r226330.
2055         https://bugs.webkit.org/show_bug.cgi?id=183152
2056
2057         incorrectly assumes enumeration callback happens once
2058         (Requested by alexchristensen on #webkit).
2059
2060         Reverted changeset:
2061
2062         "Use BlockPtrs and lambdas instead of new/delete to pass
2063         parameters to blocks in WebViewImpl::performDragOperation"
2064         https://bugs.webkit.org/show_bug.cgi?id=180795
2065         https://trac.webkit.org/changeset/226330
2066
2067 2018-02-26  Ryosuke Niwa  <rniwa@webkit.org>
2068
2069         Release assertion in WebPage::updatePreferences
2070         https://bugs.webkit.org/show_bug.cgi?id=183075
2071
2072         Reviewed by Youenn Fablet and Chris Dumez.
2073
2074         Replaced the release assertion added in r228589 with a more graceful disabling of the feature when the entitlement is missing.
2075
2076         * StorageProcess/StorageProcess.cpp:
2077         (WebKit::StorageProcess::didReceiveMessage): Added an early exit with an entitlement check to disable the feature.
2078         (WebKit::StorageProcess::initializeWebsiteDataStore): Ditto.
2079         (WebKit::StorageProcess::createStorageToWebProcessConnection): Replaced the release assertion with a debug assertion.
2080         (WebKit::StorageProcess::swServerForSession): Removed the assertion. This code can be reached when the service worker is disabled.
2081         (WebKit::StorageProcess::registerSWServerConnection): Replaced the release assertion with a debug assertion.
2082         * WebProcess/WebPage/WebPage.cpp:
2083         (WebKit::WebPage::updatePreferences): Disable the feature instead of crashing when the entitlement is missing.
2084
2085 2018-02-26  Chris Dumez  <cdumez@apple.com>
2086
2087         Regression(r223431): Crash under didReceiveChallenge in NetworkSessionCocoa
2088         https://bugs.webkit.org/show_bug.cgi?id=183134
2089         <rdar://problem/36339049>
2090
2091         Reviewed by Alex Christensen.
2092
2093         Like other delegates functions in this file, it is possible for didReceiveChallenge to get called
2094         after _session has been nulled out. Other delegate functions already had early returns when
2095         _session is null. However, such early return was missing in didReceiveChallenge.
2096
2097         This patch ends the early return to didReceiveChallenge so that we do not end up calling
2098         _session->downloadID(taskIdentifier) on a null _session.
2099
2100         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2101         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
2102
2103 2018-02-26  Youenn Fablet  <youenn@apple.com>
2104
2105         MessagePort is not always destroyed in the right thread
2106         https://bugs.webkit.org/show_bug.cgi?id=183053
2107
2108         Reviewed by Chris Dumez.
2109
2110         Update code to pass a lambda to MessagePort::existingMessagePortForIdentifier.
2111
2112         * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.cpp:
2113         (WebKit::WebMessagePortChannelProvider::checkProcessLocalPortForActivity):
2114         * WebProcess/WebProcess.cpp:
2115         (WebKit::WebProcess::messagesAvailableForPort):
2116
2117 2018-02-25  Alexey Proskuryakov  <ap@apple.com>
2118
2119         Font smoothing doesn't get disabled if the preference is set before launching WebContent process
2120         https://bugs.webkit.org/show_bug.cgi?id=183108
2121
2122         Reviewed by Tim Horton.
2123
2124         * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess):
2125         Fix the bug. While at it, also avoid the anti-pattern in setAlwaysUsesComplexTextCodePath.
2126
2127 2018-02-25  Philippe Normand  <pnormand@igalia.com>
2128
2129         Unreviewed GTK Debug build fix after r228942.
2130
2131         * UIProcess/API/glib/IconDatabase.cpp:
2132         (WebKit::IconDatabase::iconDatabaseSyncThread):
2133         (WebKit::IconDatabase::syncThreadMainLoop):
2134         (WebKit::IconDatabase::readFromDatabase):
2135         (WebKit::IconDatabase::writeToDatabase):
2136         (WebKit::IconDatabase::cleanupSyncThread):
2137
2138 2018-02-25  Chris Dumez  <cdumez@apple.com>
2139
2140         Service workers do not work well inside Web.app
2141         https://bugs.webkit.org/show_bug.cgi?id=183105
2142         <rdar://problem/37864140>
2143
2144         Reviewed by Youenn Fablet.
2145
2146         * StorageProcess/StorageProcess.cpp:
2147         (WebKit::StorageProcess::didReceiveMessage):
2148         We were failing to forward IPC messages to the ChildProcess class here. As a result,
2149         the ChildProcess::RegisterURLSchemeServiceWorkersCanHandle IPC was being ignored
2150         by the StorageProcess.
2151
2152 2018-02-24  Zan Dobersek  <zdobersek@igalia.com>
2153
2154         Unreviewed WPE breakage fix.
2155
2156         * WebProcess/wpe/WebProcessMainWPE.cpp: Call g_set_prgname() in WebProcess 
2157         to prepare the GLib state for subsequent GStreamer initialization.
2158
2159 2018-02-23  John Wilander  <wilander@apple.com>
2160
2161         Introduce ITP debug logging as an opt-in developer feature
2162         https://bugs.webkit.org/show_bug.cgi?id=183065
2163         <rdar://problem/37803761>
2164
2165         Reviewed by Brent Fulgham.
2166
2167         * Platform/Logging.h:
2168             Added a dedicated channel for Resource Load Statistics debug logging
2169             since this will be part of a developer-facing feature and should not
2170             be mixed with general Resource Load Statistics logging.
2171         * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
2172         (WebKit::WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded):
2173             Now picks up the user default setting for
2174             ResourceLoadStatisticsDebugLoggingEnabled.
2175         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2176         (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
2177             Now logs for which domains it purges website data if
2178             ResourceLoadStatisticsDebugLoggingEnabled is set.
2179         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
2180             Now logs for which domains it partitions and blocks cookies
2181             in third-party contexts if ResourceLoadStatisticsDebugLoggingEnabled
2182             is set.
2183         * UIProcess/WebResourceLoadStatisticsStore.h:
2184
2185 2018-02-23  Brent Fulgham  <bfulgham@apple.com>
2186
2187         [macOS] Correct sandbox violation during media playback
2188         https://bugs.webkit.org/show_bug.cgi?id=183092
2189         <rdar://problem/37718495>
2190
2191         Reviewed by Eric Carlson.
2192
2193         * WebProcess/com.apple.WebProcess.sb.in:
2194
2195 2018-02-23  Yousuke Kimoto  <yousuke.kimoto@sony.com>
2196
2197         [MSVC] Unknown a type definition error in WebResourceLoadStatisticsStore on wincairo webkit
2198         https://bugs.webkit.org/show_bug.cgi?id=182873
2199
2200         Reviewed by Yusuke Suzuki.
2201
2202         * UIProcess/WebResourceLoadStatisticsStore.h:
2203
2204 2018-02-23  Carlos Garcia Campos  <cgarcia@igalia.com>
2205
2206         [GStreamer][MiniBrowser] Honor GStreamer command line parameters in MiniBrowser
2207         https://bugs.webkit.org/show_bug.cgi?id=173655
2208         <rdar://problem/37706341>
2209
2210         Reviewed by Philippe Normand.
2211
2212         Actually pass the gst command line options to the WebProcess. The options in /proc/self/cmdline are separated by
2213         null characters, so we are effectively passing always the first option only, which is the program name. Then, in
2214         the web process we always ignore the first option and providing WebProcess unconditionally, so we were doing
2215         nothing.
2216
2217         * UIProcess/gtk/WebProcessPoolGtk.cpp:
2218         (WebKit::WebProcessPool::platformInitializeWebProcess): Use WebCore::extractGStreamerOptionsFromCommandLine()
2219         * UIProcess/wpe/WebProcessPoolWPE.cpp:
2220         (WebKit::WebProcessPool::platformInitializeWebProcess): Ditto.
2221         * WebProcess/soup/WebProcessSoup.cpp:
2222         (WebKit::WebProcess::platformInitializeWebProcess): Move the vector.
2223
2224 2018-02-22  Yusuke Suzuki  <utatane.tea@gmail.com>
2225
2226         Remove currentTime() / currentTimeMS()
2227         https://bugs.webkit.org/show_bug.cgi?id=183052
2228
2229         Reviewed by Mark Lam.
2230
2231         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
2232         * PluginProcess/WebProcessConnection.cpp:
2233         * Shared/WebProcessCreationParameters.h:
2234         * Shared/linux/WebMemorySamplerLinux.cpp:
2235         (WebKit::WebMemorySampler::sampleWebKit const):
2236         * Shared/mac/WebMemorySampler.mac.mm:
2237         (WebKit::WebMemorySampler::sampleWebKit const):
2238         * UIProcess/API/C/WKContext.cpp:
2239         (WKContextSetPlugInAutoStartOriginsFilteringOutEntriesAddedAfterTime):
2240         * UIProcess/API/glib/IconDatabase.cpp:
2241         (WebKit::IconDatabase::setIconDataForIconURL):
2242         (WebKit::IconDatabase::synchronousLoadDecisionForIconURL):
2243         (WebKit::IconDatabase::performURLImport):
2244         * UIProcess/DrawingAreaProxyImpl.cpp:
2245         * UIProcess/Plugins/PlugInAutoStartProvider.cpp:
2246         (WebKit::expirationTimeFromNow):
2247         (WebKit::PlugInAutoStartProvider::addAutoStartOriginHash):
2248         (WebKit::PlugInAutoStartProvider::autoStartOriginsTableCopy const):
2249         (WebKit::PlugInAutoStartProvider::setAutoStartOriginsTable):
2250         (WebKit::PlugInAutoStartProvider::setAutoStartOriginsFilteringOutEntriesAddedAfterTime):
2251         (WebKit::PlugInAutoStartProvider::setAutoStartOriginsTableWithItemsPassingTest):
2252         (WebKit::PlugInAutoStartProvider::didReceiveUserInteraction):
2253         * UIProcess/Plugins/PlugInAutoStartProvider.h:
2254         * UIProcess/WebProcessPool.cpp:
2255         (WebKit::WebProcessPool::processDidFinishLaunching):
2256         (WebKit::WebProcessPool::startMemorySampler):
2257         (WebKit::WebProcessPool::setPlugInAutoStartOriginsFilteringOutEntriesAddedAfterTime):
2258         * UIProcess/WebProcessPool.h:
2259         * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
2260         (API::InjectedBundle::PageLoaderClient::willPerformClientRedirectForFrame):
2261         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
2262         (WebKit::InjectedBundlePageLoaderClient::willPerformClientRedirectForFrame):
2263         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
2264         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2265         (WebKit::WebFrameLoaderClient::dispatchWillPerformClientRedirect):
2266         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2267         * WebProcess/WebProcess.cpp:
2268         (WebKit::m_webSQLiteDatabaseTracker):
2269         (WebKit::WebProcess::isPlugInAutoStartOriginHash):
2270         (WebKit::WebProcess::plugInDidStartFromOrigin):
2271         (WebKit::WebProcess::didAddPlugInAutoStartOriginHash):
2272         (WebKit::WebProcess::resetPlugInAutoStartOriginDefaultHashes):
2273         (WebKit::WebProcess::resetPlugInAutoStartOriginHashes):
2274         (WebKit::WebProcess::plugInDidReceiveUserInteraction):
2275         * WebProcess/WebProcess.h:
2276         * WebProcess/WebProcess.messages.in:
2277         * WebProcess/cocoa/WebProcessCocoa.mm:
2278         * WebProcess/wpe/WebProcessMainWPE.cpp:
2279
2280 2018-02-22  Matt Baker  <mattbaker@apple.com>
2281
2282         Web Inspector: REGRESSION (r228349): ImageBitmap builtin is now runtime guarded
2283         https://bugs.webkit.org/show_bug.cgi?id=183056
2284         <rdar://problem/37799067>
2285
2286         Reviewed by Joseph Pecoraro.
2287
2288         * WebProcess/WebPage/WebInspectorUI.cpp:
2289         (WebKit::WebInspectorUI::WebInspectorUI):
2290
2291 2018-02-22  Youenn Fablet  <youenn@apple.com>
2292
2293         Caches::initialize should call all pending initialization callbacks in case of error
2294         https://bugs.webkit.org/show_bug.cgi?id=183062
2295
2296         Reviewed by Chris Dumez.
2297
2298         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2299         (WebKit::CacheStorage::Caches::initialize):
2300         (WebKit::CacheStorage::Caches::initializeSize):
2301
2302 2018-02-22  Youenn Fablet  <youenn@apple.com>
2303
2304         CacheStorage::Engine::Caches::writeRecord is not always calling the completion handler
2305         https://bugs.webkit.org/show_bug.cgi?id=183055
2306
2307         Reviewed by Chris Dumez.
2308
2309         Add a completion handler to Storage::store.
2310         Use it instead in Caches::writeRecord.
2311         This ensures that the Cache add/put promise will be called once all write operations have been done.
2312
2313         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2314         (WebKit::CacheStorage::Caches::writeRecord):
2315         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2316         (WebKit::NetworkCache::Storage::WriteOperation::WriteOperation):
2317         (WebKit::NetworkCache::Storage::finishWriteOperation):
2318         (WebKit::NetworkCache::Storage::store):
2319         * NetworkProcess/cache/NetworkCacheStorage.h:
2320         (WebKit::NetworkCache::Storage::store):
2321
2322 2018-02-22  Ryosuke Niwa  <rniwa@webkit.org>
2323
2324         Add an entitlement check for service worker on iOS
2325         https://bugs.webkit.org/show_bug.cgi?id=182865
2326
2327         Reviewed by Dan Bernstein.
2328
2329         Addressed Dan's comment by using xpc_connection_copy_entitlement_value instead of obtaining the audit token first.
2330
2331         * Shared/mac/SandboxUtilities.h:
2332         * Shared/mac/SandboxUtilities.mm:
2333         (WebKit::connectedProcessHasEntitlement):
2334         * StorageProcess/ios/StorageProcessIOS.mm:
2335         (WebKit::StorageProcess::parentProcessHasServiceWorkerEntitlement const):
2336         * WebProcess/WebPage/ios/WebPageIOS.mm:
2337         (WebKit::WebPage::parentProcessHasServiceWorkerEntitlement const):
2338
2339 2018-02-22  Youenn Fablet  <youenn@apple.com>
2340
2341         Fetch event release assert should take into account the fetch mode
2342         https://bugs.webkit.org/show_bug.cgi?id=183047
2343
2344         Reviewed by Chris Dumez.
2345
2346         In case of navigation tasks, we should use the request URL and not the origin of the loading client.
2347
2348         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2349         (WebKit::isValidFetch):
2350         (WebKit::WebSWContextManagerConnection::startFetch):
2351
2352 2018-02-22  Yousuke Kimoto  <yousuke.kimoto@sony.com>
2353
2354         [WinCairo] Fix compile errors in WebPageWin.cpp and WebProcessWin.cpp due to WebCore forwarding header paths
2355         https://bugs.webkit.org/show_bug.cgi?id=182969
2356
2357         Reviewed by Konstantin Tokarev.
2358
2359         * WebProcess/WebPage/win/WebPageWin.cpp:
2360         * WebProcess/win/WebProcessWin.cpp:
2361
2362 2018-02-22  Yusuke Suzuki  <utatane.tea@gmail.com>
2363
2364         Remove sleep(double) and sleepMS(double) interfaces
2365         https://bugs.webkit.org/show_bug.cgi?id=183038
2366
2367         Reviewed by Mark Lam.
2368
2369         * PluginProcess/WebProcessConnection.cpp:
2370         (WebKit::WebProcessConnection::createPluginAsynchronously):
2371         * UIProcess/linux/MemoryPressureMonitor.cpp:
2372         (WebKit::pollIntervalForUsedMemoryPercentage):
2373         (WebKit::MemoryPressureMonitor::MemoryPressureMonitor):
2374         * WebProcess/wpe/WebProcessMainWPE.cpp:
2375
2376 2018-02-22  Youenn Fablet  <youenn@apple.com>
2377
2378         Add release logging for CacheStorage::Engine disk related functions
2379         https://bugs.webkit.org/show_bug.cgi?id=183042
2380
2381         Reviewed by Chris Dumez.
2382
2383         * NetworkProcess/cache/CacheStorageEngine.cpp:
2384         (WebKit::CacheStorage::Engine::writeFile):
2385         (WebKit::CacheStorage::Engine::readFile):
2386
2387 2018-02-22  Matt Lewis  <jlewis3@apple.com>
2388
2389         Unreviewed, rolling out r228902.
2390
2391         This broke internal builds.
2392
2393         Reverted changeset:
2394
2395         "[Cocoa] Web Automation: provide a way to ask clients the type
2396         of a JavaScript dialog"
2397         https://bugs.webkit.org/show_bug.cgi?id=182660
2398         https://trac.webkit.org/changeset/228902
2399
2400 2018-02-22  Youenn Fablet  <youenn@apple.com>
2401
2402         Add release asserts for service worker fetch and postMessage events
2403         https://bugs.webkit.org/show_bug.cgi?id=183025
2404         rdar://problem/37765052
2405
2406         Reviewed by Daniel Bates.
2407
2408         Add assertion to protect interception of a fetch load by a service worker with
2409         a different origin from the page.
2410
2411         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2412         (WebKit::WebSWContextManagerConnection::startFetch):
2413
2414 2018-02-22  Ms2ger  <Ms2ger@igalia.com>
2415
2416         [GTK][WPE] Fix some build errors in service workers code
2417         https://bugs.webkit.org/show_bug.cgi?id=182966
2418
2419         Reviewed by Žan Doberšek.
2420
2421         * CMakeLists.txt: add missing files.
2422         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: add missing includes.
2423         * UIProcess/ServiceWorkerProcessProxy.cpp: use #include rather than #import in C++; add missing ifdef.
2424         * UIProcess/ServiceWorkerProcessProxy.h: add missing ifdef.
2425         * WebProcess/Storage/WebSWClientConnection.cpp: add missing includes.
2426         * WebProcess/Storage/WebSWContextManagerConnection.cpp: add missing includes.
2427         (WebKit::WebSWContextManagerConnection::WebSWContextManagerConnection):
2428           call the function that exists outside cocoa.
2429
2430 2018-02-21  Per Arne Vollan  <pvollan@apple.com>
2431
2432         The WebContent process should not use NSScreen in the screenAvailableRect/screenRect implementations.
2433         https://bugs.webkit.org/show_bug.cgi?id=182855
2434
2435         Reviewed by Brent Fulgham.
2436
2437         On macOS, the functions screenAvailableRect and screenRect is implemented using NSScreen, which is communicating
2438         with the WindowServer. To avoid this WindowServer communication from the WebContent process when calling
2439         screenAvailableRect and screenRect, it is possible to let the UIProcess send a message to the WebContent
2440         process whenever there is a change in the display properties, and have the WebContent process cache these
2441         display properties. This message should also be sent to a newly started WebContent process.
2442
2443         * UIProcess/WebProcessPool.cpp:
2444         (WebKit::displayReconfigurationCallBack):
2445         (WebKit::registerDisplayConfigurationCallback):
2446         (WebKit::WebProcessPool::initializeNewWebProcess):
2447         (WebKit::WebProcessPool::warmInitialProcess):
2448         * WebProcess/WebProcess.cpp:
2449         (WebKit::WebProcess::setScreenProperties):
2450         * WebProcess/WebProcess.h:
2451         * WebProcess/WebProcess.messages.in:
2452
2453 2018-02-21  Christopher Reid  <chris.reid@sony.com>
2454
2455         [Curl] Curl Cookie Database File should be configurable using NetworkProcessCreationParameters
2456         https://bugs.webkit.org/show_bug.cgi?id=182751
2457
2458         Reviewed by Youenn Fablet.
2459
2460         Adding a cookiePersistentStorageFile parameter to Curl's NetworkProcessCreationParameters.
2461         This parameter is based on Soup's cookiePersistentStoragePath.
2462         This parameter is not used yet, it is added to prepare for WinCairo WebKit support.
2463
2464         * NetworkProcess/NetworkProcessCreationParameters.cpp:
2465         * NetworkProcess/NetworkProcessCreationParameters.h:
2466         * NetworkProcess/curl/NetworkProcessCurl.cpp:
2467         * WebProcess/Cookies/WebCookieManager.h:
2468         * WebProcess/Cookies/curl/WebCookieManagerCurl.cpp:
2469
2470 2018-02-21  Brian Burg  <bburg@apple.com>
2471
2472         [Cocoa] Web Automation: provide a way to ask clients the type of a JavaScript dialog
2473         https://bugs.webkit.org/show_bug.cgi?id=182660
2474         <rdar://problem/37408183>
2475
2476         Reviewed by Tim Horton and Carlos Garcia Campos.
2477
2478         Add another delegate method to ask what type of dialog is being shown.
2479         This is used to implement §18.4 Step 5, where sending text to a dialog
2480         without a prompt will return several different kinds of errors.
2481
2482         No new tests, covered by web platform tests once Safari side has landed.
2483
2484         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h: Update FIXME radar numbers.
2485         * UIProcess/Cocoa/AutomationSessionClient.h:
2486         * UIProcess/Cocoa/AutomationSessionClient.mm:
2487         (WebKit::AutomationSessionClient::AutomationSessionClient):
2488         (WebKit::toImpl):
2489         (WebKit::AutomationSessionClient::typeOfCurrentJavaScriptDialogOnPage):
2490         If there is no current dialog to be checked, the client can return the 'None'
2491         type. This gets converted into a std::nullopt and causes a command error later.
2492
2493 2018-02-21  Yousuke Kimoto  <yousuke.kimoto@sony.com>
2494
2495         [WinCairo] Fix compile errors of WebProcess and NetworkProcess due to no implementation for windows
2496         https://bugs.webkit.org/show_bug.cgi?id=182870
2497
2498         Reviewed by Youenn Fablet.
2499
2500         * NetworkProcess/NetworkProcess.cpp:
2501         (WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
2502         * WebProcess/Plugins/PluginProcessConnectionManager.cpp:
2503         (WebKit::PluginProcessConnectionManager::getPluginProcessConnection):
2504         * WebProcess/WebPage/WebInspector.cpp:
2505         (WebKit::WebInspector::openFrontendConnection):
2506         * WebProcess/WebPage/WebInspectorUI.cpp:
2507         (WebKit::WebInspectorUI::establishConnection):
2508         * WebProcess/WebProcess.cpp:
2509         (WebKit::WebProcess::ensureNetworkProcessConnection):
2510
2511 2018-02-21  Don Olmstead  <don.olmstead@sony.com>
2512
2513         [CMake][Win] Use cmakeconfig.h rather than config.h and Platform.h
2514         https://bugs.webkit.org/show_bug.cgi?id=182883
2515
2516         Reviewed by Per Arne Vollan.
2517
2518         * config.h:
2519
2520 2018-02-21  Brian Burg  <bburg@apple.com>
2521
2522         Web Automation: failed provisional loads cause "Navigate To" command to hang
2523         https://bugs.webkit.org/show_bug.cgi?id=183007
2524         <rdar://problem/37751819>
2525
2526         Reviewed by Andy Estes.
2527
2528         This hang was revealed by WPT test current_url.py::get_current_url_file_protocol. Now the
2529         test simply fails because Safari chooses a policy of 'Ignore' for externally-opened files.
2530         I filed an upstream issue with the test here: https://github.com/w3c/webdriver/issues/1232
2531
2532         * UIProcess/WebPageProxy.cpp:
2533         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
2534         Notify the session that the load failed in the frame, just like we do
2535         for non-provisional failed loads and successful loads.
2536
2537 2018-02-20  Nan Wang  <n_wang@apple.com>
2538
2539         AX: Keyboard focus not following VoiceOver cursor into web content or within web content.
2540         https://bugs.webkit.org/show_bug.cgi?id=182752
2541         <rdar://problem/37518233>
2542
2543         Reviewed by Ryosuke Niwa.
2544
2545         * UIProcess/PageClient.h:
2546         * UIProcess/WebPageProxy.h:
2547         * UIProcess/WebPageProxy.messages.in:
2548         * UIProcess/ios/PageClientImplIOS.h:
2549         * UIProcess/ios/PageClientImplIOS.mm:
2550         (WebKit::PageClientImpl::assistiveTechnologyMakeFirstResponder):
2551         * UIProcess/ios/WebPageProxyIOS.mm:
2552         (WebKit::WebPageProxy::assistiveTechnologyMakeFirstResponder):
2553         * UIProcess/mac/PageClientImplMac.h:
2554         * UIProcess/mac/PageClientImplMac.mm:
2555         (WebKit::PageClientImpl::assistiveTechnologyMakeFirstResponder):
2556         * UIProcess/mac/WebPageProxyMac.mm:
2557         (WebKit::WebPageProxy::assistiveTechnologyMakeFirstResponder):
2558         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2559         (WebKit::WebChromeClient::assistiveTechnologyMakeFirstResponder):
2560         * WebProcess/WebCoreSupport/WebChromeClient.h:
2561
2562 2018-02-14  Brian Burg  <bburg@apple.com>
2563
2564         Web Automation: combine session commands to resize and move top-level browsing contexts
2565         https://bugs.webkit.org/show_bug.cgi?id=182749
2566         <rdar://problem/37515170>
2567
2568         Reviewed by Andy Estes.
2569
2570         Since moving and resizing the window are both accomplished by setting the window frame,
2571         and the W3C WebDriver specification has a Get/Set Window Rect command, it's time to
2572         deduplicate these two methods which basically do the same thing.
2573
2574         Adopt modern JSON::Value getters that return std::optional<float>. I have been trying
2575         to move the protocol over to this style wholesale, but it is probably easier to do
2576         this conversion in smaller pieces. And so, I have started to do so.
2577
2578         This change is covered by existing WebDriver tests.
2579
2580         * UIProcess/Automation/Automation.json: Add new command.
2581         * UIProcess/Automation/WebAutomationSession.cpp:
2582         (WebKit::WebAutomationSession::setWindowFrameOfBrowsingContext): Added.
2583         (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext): Deleted.
2584         (WebKit::WebAutomationSession::moveWindowOfBrowsingContext): Deleted.
2585         * UIProcess/Automation/WebAutomationSession.h:
2586
2587 2018-02-20  Brian Burg  <bburg@apple.com>
2588
2589         ASSERT under WebAutomationSession::setProcessPool() when running W3C test suite a second time
2590         https://bugs.webkit.org/show_bug.cgi?id=182991
2591         <rdar://problem/37620578>
2592
2593         Reviewed by Timothy Hatcher.
2594
2595         Sometimes when running more than one session end-to-end with the same browser instance,
2596         UIProcess would crash under addMessageReceiver because another WebAutomationSession was still
2597         registered. This is hard to reproduce, but upon code inspection, the receiver management code
2598         is somewhat problematic because it only runs when the WebAutomationSession destructor runs.
2599         In some cases the client could retain two sessions and cause the first one to never remove itself
2600         as the message receiver.
2601
2602         Instead of unregistering the session as a message receiver underneath the session's destructor,
2603         do this whenever a new session supplants an old session since there is only one active session at a time.
2604
2605         * UIProcess/Automation/WebAutomationSession.cpp:
2606         (WebKit::WebAutomationSession::~WebAutomationSession):
2607         * UIProcess/WebProcessPool.cpp:
2608         (WebKit::WebProcessPool::setAutomationSession):
2609
2610 2018-02-20  Tim Horton  <timothy_horton@apple.com>
2611
2612         Introduce HAVE(IOSURFACE_ACCELERATOR)
2613         https://bugs.webkit.org/show_bug.cgi?id=182955
2614         <rdar://problem/37699510>
2615
2616         Reviewed by Sam Weinig.
2617
2618         * Shared/RemoteLayerTree/RemoteLayerBackingStore.h:
2619         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
2620         * Shared/cg/ShareableBitmapCG.cpp:
2621         * UIProcess/API/Cocoa/WKWebView.mm:
2622         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
2623         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
2624         * UIProcess/mac/ViewSnapshotStore.h:
2625         * UIProcess/mac/ViewSnapshotStore.mm:
2626
2627 2018-02-20  Chris Dumez  <cdumez@apple.com>
2628
2629         Provisional load may get committed before receiving the decidePolicyForNavigationResponse response
2630         https://bugs.webkit.org/show_bug.cgi?id=182720
2631         <rdar://problem/37515204>
2632
2633         Reviewed by Alex Christensen.
2634
2635         * WebProcess/Network/WebResourceLoader.cpp:
2636         (WebKit::WebResourceLoader::didReceiveResponse):
2637         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
2638         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
2639         * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp:
2640         (WebKit::WebURLSchemeTaskProxy::didReceiveResponse):
2641
2642 2018-02-20  Matt Lewis  <jlewis3@apple.com>
2643
2644         Unreviewed, rolling out r228829.
2645
2646         This caused a consistent failure in the API test
2647         WebKit.InteractionDeadlockAfterCrash on iOS Simulator
2648
2649         Reverted changeset:
2650
2651         "Switch to UIWKTextInteractionAssistant for non-editable text"
2652         https://bugs.webkit.org/show_bug.cgi?id=182834
2653         https://trac.webkit.org/changeset/228829
2654
2655 2018-02-20  Megan Gardner  <megan_gardner@apple.com>
2656
2657         Switch to UIWKTextInteractionAssistant for non-editable text
2658         https://bugs.webkit.org/show_bug.cgi?id=182834
2659         
2660         Reviewed by Wenson Hsieh and Tim Horton.
2661         
2662         Switching to only using the UIWKTextInteractionAssistant. Only character granularity is now supported. 
2663         Also keep the from regressing gating the keyboard bring up on user interaction. The presents of a  
2664         textInteractionAssistant can no longer be used as proxy for the presence of the keyboard.
2665
2666         * UIProcess/ios/WKContentViewInteraction.mm:
2667         (-[WKContentView useSelectionAssistantWithGranularity:]):
2668         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
2669
2670 2018-02-20  John Wilander  <wilander@apple.com>
2671
2672         Make WebResourceLoadStatisticsStore::processStatisticsAndDataRecords() call WebProcessProxy::notifyPageStatisticsAndDataRecordsProcessed() in a proper callback
2673         https://bugs.webkit.org/show_bug.cgi?id=182719
2674         <rdar://problem/37517370>
2675
2676         Reviewed by Brent Fulgham.
2677
2678         This will allow the page notification, statistics pruning, and persistence write
2679         to be done at the right time and hopefully stabilize the layout tests including:
2680         http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-deletion.html
2681
2682         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2683         (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
2684             Now takes a callback parameter.
2685         (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
2686         * UIProcess/WebResourceLoadStatisticsStore.h:
2687             Now calls WebProcessProxy::notifyPageStatisticsAndDataRecordsProcessed()
2688             in a callback provided to WebResourceLoadStatisticsStore::removeDataRecords().
2689
2690 2018-02-20  Zan Dobersek  <zdobersek@igalia.com>
2691
2692         [Cairo] Drop target GraphicsContext usage in Cairo operations
2693         https://bugs.webkit.org/show_bug.cgi?id=182964
2694
2695         Reviewed by Carlos Garcia Campos.
2696
2697         The GraphicsContext parameters in various Cairo operations are not used
2698         anymore, so they can be removed. Callsites are updated to reflect this.
2699
2700         * Shared/cairo/ShareableBitmapCairo.cpp:
2701         (WebKit::ShareableBitmap::paint):
2702         * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
2703         (WebKit::convertCairoSurfaceToShareableBitmap):
2704
2705 2018-02-20  Philippe Normand  <pnormand@igalia.com>
2706
2707         [GStreamer][MiniBrowser] Honor GStreamer command line parameters in MiniBrowser
2708         https://bugs.webkit.org/show_bug.cgi?id=173655
2709
2710         Reviewed by Xabier Rodriguez-Calvar.
2711
2712         The FIXME in GStreamerUtilities.cpp asks to pass the command line
2713         parameters to the GStreamer initialization function.
2714
2715         Based on initial patch by: Vanessa Chipirrás Navalón  <vchipirras@igalia.com>
2716
2717         * Shared/WebProcessCreationParameters.cpp:
2718         (WebKit::WebProcessCreationParameters::encode const):
2719         (WebKit::WebProcessCreationParameters::decode):
2720         * Shared/WebProcessCreationParameters.h: Define the vector which contains the GStreamer options.
2721         * UIProcess/gtk/WebProcessPoolGtk.cpp:
2722         (WebKit::WebProcessPool::platformInitializeWebProcess): Read from cmdline file
2723         the GStreamer options written by console.
2724         * WebProcess/soup/WebProcessSoup.cpp:
2725         (WebKit::WebProcess::platformInitializeWebProcess): Call initializeGStreamer() method passing
2726         the vector which contains the options.
2727
2728 2018-02-20  Yousuke Kimoto  <yousuke.kimoto@sony.com>
2729
2730         [Win] Fix MSVC's treating __attribute__((warn_unused_result))
2731         https://bugs.webkit.org/show_bug.cgi?id=182479
2732
2733         Reviewed by Darin Adler.
2734
2735         Since MSVC doesn't understand "__attribute__", "_Check_return_" is used instead.
2736         If clang and VisualStudio 2017 are used, a macro with "__attriute__" will be chosen.
2737
2738         * UIProcess/API/cpp/WKRetainPtr.h:
2739
2740 2018-02-19  Brady Eidson  <beidson@apple.com>
2741
2742         Add WebProcessPool option for process swapping on navigation.
2743         https://bugs.webkit.org/show_bug.cgi?id=182945
2744
2745         Reviewed by Alex Christensen.
2746
2747         Just the most basic groundwork for testing a new WK2 feature.
2748
2749         * UIProcess/API/APIProcessPoolConfiguration.h:
2750
2751         * UIProcess/API/C/WKContextConfigurationRef.cpp:
2752         (WKContextConfigurationProcessSwapsOnNavigation):
2753         (WKContextConfigurationSetProcessSwapsOnNavigation):
2754         * UIProcess/API/C/WKContextConfigurationRef.h:
2755
2756         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
2757         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
2758         (-[_WKProcessPoolConfiguration setProcessSwapsOnNavigation:]):
2759         (-[_WKProcessPoolConfiguration processSwapsOnNavigation]):
2760
2761 2018-02-19  Daniel Bates  <dabates@apple.com>
2762
2763         Null pointer dereference in WebPageProxy::urlSchemeHandlerForScheme()
2764         https://bugs.webkit.org/show_bug.cgi?id=182905
2765         <rdar://problem/37676775>
2766
2767         Reviewed by Alex Christensen.
2768
2769         Return nullptr when querying for the scheme handler of the null string.
2770
2771         Before a navigation is performed WebKit checks if the destination URL is associated with an app
2772         unless the embedding client overrides the WKNavigationDelegate delegate callback -webView:decidePolicyForNavigationAction:decisionHandler.
2773         If the URL is not associated with an app then WebKit may fall back to checking if the embedding
2774         client registered a scheme handler for it. Currently we assume that the scheme is a non-null
2775         string when checking the scheme handler registry. However the scheme can be a null string if
2776         it is part of a malformed URL. And this leads to bad news bears when we try to use it to look
2777         for a scheme handler. Instead check that the scheme is a non-null string before checking to see
2778         if it is in the scheme handler registry.
2779
2780         * UIProcess/WebPageProxy.cpp:
2781         (WebKit::WebPageProxy::urlSchemeHandlerForScheme):
2782
2783 2018-02-19  Eric Carlson  <eric.carlson@apple.com>
2784
2785         [Extra zoom mode] Don't allow PiP media playback
2786         https://bugs.webkit.org/show_bug.cgi?id=182930
2787         <rdar://problem/37676259>
2788
2789         Reviewed by Andy Estes.
2790
2791         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2792         (-[WKWebViewConfiguration init]): Don't enable PiP mode. Require user interaction for
2793         all media types.
2794
2795 2018-02-19  Ryan Haddad  <ryanhaddad@apple.com>
2796
2797         Unreviewed, rolling out r228696.
2798
2799         The API test added with this change is timing out on macOS.
2800
2801         Reverted changeset:
2802
2803         "Null pointer dereference in
2804         WebPageProxy::urlSchemeHandlerForScheme()"
2805         https://bugs.webkit.org/show_bug.cgi?id=182905
2806         https://trac.webkit.org/changeset/228696
2807
2808 2018-02-19  Daniel Bates  <dabates@apple.com>
2809
2810         Null pointer dereference in WebPageProxy::urlSchemeHandlerForScheme()
2811         https://bugs.webkit.org/show_bug.cgi?id=182905
2812
2813         Reviewed by Alex Christensen.
2814
2815         Return nullptr when querying for the scheme handler of the null string.
2816
2817         Before a navigation is performed WebKit checks if the destination URL is associated with an app
2818         unless the embedding client overrides the WKNavigationDelegate delegate callback -webView:decidePolicyForNavigationAction:decisionHandler.
2819         If the URL is not associated with an app then WebKit may fall back to checking if the embedding
2820         client registered a scheme handler for it. Currently we assume that the scheme is a non-null
2821         string when checking the scheme handler registry. However the scheme can be a null string if
2822         it is part of a malformed URL. And this leads to bad news bears when we try to use it to look
2823         for a scheme handler. Instead check that the scheme is a non-null string before checking to see
2824         if it is in the scheme handler registry.
2825
2826         * UIProcess/WebPageProxy.cpp:
2827         (WebKit::WebPageProxy::urlSchemeHandlerForScheme):
2828
2829 2018-02-19  Ms2ger  <Ms2ger@igalia.com>
2830
2831         Explicitly qualify some method calls on this in lamdas in Service Worker code.
2832         https://bugs.webkit.org/show_bug.cgi?id=182875
2833
2834         Reviewed by Chris Dumez.
2835
2836         This is necessary for the code to build with GCC 5. Other code already
2837         appears to have been adapted similarly.
2838
2839         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2840         (WebKit::WebSWServerConnection::startFetch):
2841
2842 2018-02-18  Reza Abbasian  <rabbasian@apple.com>
2843
2844         Set the appropriate AutoFill context for suggested passwords.
2845         https://bugs.webkit.org/show_bug.cgi?id=182718
2846         <rdar://problem/36326863>
2847
2848         Reviewed by Wenson Hsieh and Tim Horton.
2849
2850         Before starting the input session, call the new delegate to query if AutoFill password suggestion assistance
2851         is required for the focused element.
2852
2853         * UIProcess/API/Cocoa/_WKFormInputSession.h:
2854         * UIProcess/API/Cocoa/_WKInputDelegate.h:
2855         Introduce a new delegate to be called  before starting an input session to query if AutoFill password suggestion
2856         assistance is required for the focused element.
2857         * UIProcess/ios/WKContentViewInteraction.h:
2858         * UIProcess/ios/WKContentViewInteraction.mm:
2859         (-[WKFormInputSession initWithContentView:focusedElementInfo:requiresStrongPasswordAssistance:]):
2860         (-[WKFormInputSession requiresStrongPasswordAssistance]):
2861         (-[WKContentView cleanupInteraction]):
2862         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
2863         Call the delegate to find out if AutoFill suggested password assistance is required.
2864         (-[WKContentView _stopAssistingNode]):
2865         (-[WKContentView _autofillContext]): If the first responder is a password element and requires
2866         assistance for AutoFill suggested password, set the appropriate AutoFill context.
2867         (-[WKFormInputSession initWithContentView:focusedElementInfo:]): Deleted.
2868
2869 2018-02-17  Wenson Hsieh  <wenson_hsieh@apple.com>
2870
2871         [Extra zoom mode] Form control values are stale after dismissing and representing input view controllers
2872         https://bugs.webkit.org/show_bug.cgi?id=182877
2873         <rdar://problem/37604395>
2874
2875         Reviewed by Tim Horton.
2876
2877         Currently, when presenting an input view controller for a focused element, we populate the initial form control
2878         value using the WKContentView's assisted node information when it was last focused. However, if the user edits
2879         the value of a form control, dismisses to the form control view controller (while the element is still focused)
2880         and then begins editing the field again, the initial text will be the previous value of the input, since the
2881         AssistedNodeInformation isn't up to date.
2882
2883         To fix this, we introduce a mechanism to update WKContentView's AssistedNodeInformation for the current assisted
2884         node. This overwrites _assistedNodeInformation with new information computed from the web process, as long as
2885         the assisted node before and after the request is made in the UI process has not changed. We accomplish this by
2886         adding an identifier to AssistedNodeInformation, which is monotonically incremented when an element is focused
2887         in the web process. The UI process may then use this identifier to determine whether AssistedNodeInformations
2888         are describing the same focused element.
2889
2890         One interesting consideration here is that a normal AssistedNodeInformation update (propagated when focusing an
2891         element) may be deferred in the UI process until the next layer tree commit. In the absence of the assisted node
2892         identifier check, one could imagine a scenario in which the assisted node information in the UI process gets
2893         "updated" from a new value to an old value:
2894
2895         1. The web process focuses an element and sends AssistedNodeInformation `A`.
2896         2. WKContentView calls -updateCurrentAssistedNodeInformation.
2897         3. The web process sends AssistedNodeInformation `B`.
2898         4. `A` is received in the UI process, but deferred.
2899         5. The UI process receives `B` and sets _assistedNodeInformation to `B`.
2900         6. The UI process calls -_startAssistingNode: and sets _assistedNodeInformation to `A`.
2901
2902         This would mean that the _assistedNodeInformation is set to an earlier value, `A`, after being set to a later
2903         value, `B`. However, because the AssistedNodeInformation identifier in step (2) refers to the assisted node
2904         prior to step (1), the assisted node identifier in (5) would not match this identifier, and we would simply bail
2905         instead of overwriting assisted node information.
2906
2907         We use this AssistedNodeInformation update mechanism after inserting text via input view controllers, and also
2908         after reentering edit mode from the focused form control view controller. This fixes two issues where changing
2909         the size of the focused element after editing it results in the focused form overlay highlighting a stale frame,
2910         and also when setting the initial text when reentering edit mode for a form control that is already focused.
2911
2912         * Shared/AssistedNodeInformation.cpp:
2913         (WebKit::AssistedNodeInformation::encode const):
2914         (WebKit::AssistedNodeInformation::decode):
2915         * Shared/AssistedNodeInformation.h:
2916
2917         Add a new monotonically increasing identifier (per WebPage) which associates a AssistedNodeInformation with a
2918         focused element. In the event that the web process crashes and relaunches (thus resetting this identifier),
2919         AssistedNodeInformation state in the UI process is now also reset (see -cleanupInteraction), so we won't end up
2920         confusing AssistedNodeInformations computed by different WebPages between a web process crash.
2921
2922         * UIProcess/WebPageProxy.h:
2923
2924         A bit of related refactoring here to remove an unnecessary bool flag that indicates whether we have a deferred
2925         assisted node information. Instead, just use the presence of m_deferredNodeAssistanceArguments.
2926
2927         * UIProcess/WebPageProxy.messages.in:
2928
2929         Add a AssistedNodeInformationCallback IPC message.
2930
2931         * UIProcess/ios/WKContentViewInteraction.mm:
2932         (-[WKContentView cleanupInteraction]):
2933
2934         Clear out the previous AssistedNodeInformation. See above for details.
2935
2936         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
2937         (-[WKContentView updateCurrentAssistedNodeInformation:]):
2938
2939         Tries to update AssistedNodeInformation for the current assisted node, invoking the completion callback when
2940         finished. This may result in the assisted node information not being updated due to the current assisted node
2941         changing in the time between the start of the request and the information being received in the UI process.
2942
2943         (-[WKContentView presentViewControllerForCurrentAssistedNode]):
2944
2945         Refactored from -presentViewControllerForAssistedNode:, such that it no longer takes an AssistedNodeInformation
2946         as an argument, but rather just uses WKContentView's current _assistedNodeInformation. This was just being
2947         called with _assistedNodeInformation from all call sites anyways.
2948
2949         (-[WKContentView textInputController:didCommitText:]):
2950
2951         Request an AssistedNodeInformation update after setting the value of a form control; if the assisted node hasn't
2952         changed, update the focused form control overlay. This is needed to handle cases where the focused element's
2953         frame may have changed after inserting text (e.g. due to line wrapping), and the focused form control overlay
2954         needs to be updated to reflect this change.
2955
2956         (-[WKContentView focusedFormControlControllerDidBeginEditing:]):
2957
2958         Request an AssistedNodeInformation update before reentering edit mode; if the assisted node hasn't changed since
2959         the start of the request, present the appropriate input view controller.
2960
2961         (-[WKContentView presentViewControllerForAssistedNode:]): Deleted.
2962         * UIProcess/ios/WebPageProxyIOS.mm:
2963         (WebKit::WebPageProxy::assistedNodeInformationCallback):
2964         (WebKit::WebPageProxy::requestAssistedNodeInformation):
2965         (WebKit::WebPageProxy::didCommitLayerTree):
2966         (WebKit::WebPageProxy::startAssistingNode):
2967         (WebKit::WebPageProxy::stopAssistingNode):
2968         * WebProcess/WebPage/WebPage.cpp:
2969         (WebKit::WebPage::elementDidFocus):
2970
2971         Increment the assisted node identifier.
2972
2973         * WebProcess/WebPage/WebPage.h:
2974         * WebProcess/WebPage/WebPage.messages.in:
2975         * WebProcess/WebPage/ios/WebPageIOS.mm:
2976         (WebKit::WebPage::requestAssistedNodeInformation):
2977
2978         Compute and return an AssistedNodeInformation.
2979
2980         (WebKit::WebPage::getAssistedNodeInformation):
2981
2982 2018-02-16  Dean Jackson  <dino@apple.com>
2983
2984         Use OPENGL macros to be more clear about which OpenGL/ES WebGL uses on Cocoa
2985         https://bugs.webkit.org/show_bug.cgi?id=182894
2986
2987         Reviewed by Tim Horton.
2988
2989         Rename OPENGL_ES_2 to OPENGL_ES.
2990
2991         * CMakeLists.txt:
2992         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
2993         * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
2994         (WebKit::AcceleratedBackingStoreWayland::paint):
2995         * UIProcess/gtk/WaylandCompositor.cpp:
2996         (WebKit::WaylandCompositor::initializeEGL):
2997
2998 2018-02-16  Ryosuke Niwa  <rniwa@webkit.org>
2999
3000         Add an entitlement check for service worker on iOS
3001         https://bugs.webkit.org/show_bug.cgi?id=182865
3002         <rdar://problem/37505903>
3003
3004         Reviewed by Brady Eidson.
3005
3006         Added an entitlement check to enable service workers on iOS.
3007
3008         * Shared/mac/SandboxUtilities.h:
3009         * Shared/mac/SandboxUtilities.mm:
3010         (WebKit::connectedProcessHasEntitlement): Added.
3011         * StorageProcess/StorageProcess.cpp:
3012         (WebKit::StorageProcess::createStorageToWebProcessConnection): Enforce the entitlement check by crashing
3013         when this code is executed without the parent process having the service worker entitlement. This should
3014         never happen unless someone is trying to bypass the entitlement check in UI Process since we ordinarily
3015         disable service worker gracefully in WKWebView _initializeWithConfiguration.
3016         (WebKit::StorageProcess::swServerForSession): Ditto.
3017         (WebKit::StorageProcess::registerSWServerConnection): Ditto.
3018         * StorageProcess/StorageProcess.h:
3019         (WebKit::StorageProcess::parentProcessHasServiceWorkerEntitlement const): Added.
3020         * StorageProcess/ios/StorageProcessIOS.mm:
3021         (WebKit::StorageProcess::parentProcessHasServiceWorkerEntitlement const): Added.
3022         * UIProcess/API/Cocoa/WKWebView.mm:
3023         (-[WKWebView _initializeWithConfiguration:]): Disable the service workers when the entitlement is
3024         missing from the current process. The entitlement is enforced by WebContent and Storage process.
3025         This check avoids crashing WebContent process and gracefully disabling the feature.
3026         * WebProcess/WebPage/WebPage.cpp:
3027         (WebKit::WebPage::updatePreferences): Enforce the entitlement check.
3028         * WebProcess/WebPage/WebPage.h:
3029         (WebKit::WebPage::parentProcessHasServiceWorkerEntitlement const): Added.
3030         * WebProcess/WebPage/ios/WebPageIOS.mm:
3031         (WebKit::WebPage::parentProcessHasServiceWorkerEntitlement const): Added.
3032
3033 2018-02-16  Youenn Fablet  <youenn@apple.com>
3034
3035         Allow specifying which plug-ins are supported
3036         https://bugs.webkit.org/show_bug.cgi?id=182748
3037
3038         Reviewed by Chris Dumez.
3039
3040         Add a C and ObjC API to set which plug-ins are specified.
3041         Plug-ins may be allowed by origin of the main page or for all origins.
3042
3043         If the API to set a supported plug-in is called, WebKit enters a mode
3044         where it will block any plug-in that is not on the list.
3045
3046         The list of supported plug-ins is stored in UIProcess and sent to WebProcess.
3047         This allows to compute the list of visible plug-ins according supported plugins.
3048
3049         PluginInfoStore is storing the list of supported plugins and can
3050         answer whether a plug-in creation request is to be made unsupported or not.
3051         It also creates the structure sent to WebProcess for computing plugin visibility.
3052
3053         Updated ArgumentCoders to accept modern HashSet decoders.
3054
3055         * Platform/IPC/ArgumentCoders.h:
3056         * UIProcess/API/C/WKContext.cpp:
3057         (WKContextAddSupportedPlugin):
3058         (WKContextClearSupportedPlugins):
3059         * UIProcess/API/C/WKContextPrivate.h:
3060         * UIProcess/API/Cocoa/WKProcessPool.mm:
3061         (-[WKProcessPool _addSupportedPlugin:named:withMimeTypes:withExtensions:]):
3062         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
3063         * UIProcess/Plugins/PluginInfoStore.cpp:
3064         (WebKit::PluginInfoStore::isSupportedPlugin):
3065         (WebKit::PluginInfoStore::SupportedPlugins::isSupported):
3066         (WebKit::PluginInfoStore::SupportedPlugin::isSupported):
3067         (WebKit::PluginInfoStore::supportedPluginNames):
3068         (WebKit::PluginInfoStore::addSupportedPlugin):
3069         * UIProcess/Plugins/PluginInfoStore.h:
3070         (WebKit::PluginInfoStore::clearSupportedPlugins):
3071         * UIProcess/WebPageProxy.cpp:
3072         (WebKit::WebPageProxy::findPlugin):
3073         (WebKit::WebPageProxy::unavailablePluginButtonClicked):
3074         * UIProcess/WebPageProxy.h:
3075         * UIProcess/WebPageProxy.messages.in:
3076         * UIProcess/WebProcessPool.cpp:
3077         (WebKit::WebProcessPool::addSupportedPlugin):
3078         (WebKit::WebProcessPool::clearSupportedPlugins):
3079         * UIProcess/WebProcessPool.h:
3080         * UIProcess/WebProcessProxy.cpp:
3081         (WebKit::WebProcessProxy::getPlugins):
3082         * UIProcess/WebProcessProxy.h:
3083         * UIProcess/WebProcessProxy.messages.in:
3084         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
3085         (WebKit::WebPluginInfoProvider::getPluginInfo):
3086         (WebKit::WebPluginInfoProvider::getWebVisiblePluginInfo):
3087         (WebKit::WebPluginInfoProvider::populatePluginCache):
3088         * WebProcess/Plugins/WebPluginInfoProvider.h:
3089         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3090         (WebKit::WebChromeClient::shouldUnavailablePluginMessageBeButton const):
3091         * WebProcess/WebPage/WebPage.cpp:
3092         (WebKit::WebPage::createPlugin):
3093         (WebKit::WebPage::canPluginHandleResponse):
3094
3095 2018-02-16  Jiewen Tan  <jiewen_tan@apple.com>
3096
3097         [WebAuthN] Implement PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable()
3098         https://bugs.webkit.org/show_bug.cgi?id=182771
3099         <rdar://problem/36459988>
3100
3101         Reviewed by Brent Fulgham.
3102
3103         This patch utilizes LocalAuthentication Framework to determine if biometrics
3104         are enrolled on a device, which is the user verifying platform authenticator.
3105         To do so, it links the framework to WebKit.
3106
3107         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.cpp:
3108         (WebKit::WebCredentialsMessengerProxy::isUserVerifyingPlatformAuthenticatorAvailable):
3109         (WebKit::WebCredentialsMessengerProxy::isUserVerifyingPlatformAuthenticatorAvailableReply):
3110         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.h:
3111         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.messages.in:
3112         * UIProcess/CredentialManagement/cocoa/WebCredentialsMessengerProxyCocoa.mm:
3113         (WebKit::WebCredentialsMessengerProxy::platformIsUserVerifyingPlatformAuthenticatorAvailable):
3114         * WebKit.xcodeproj/project.pbxproj:
3115         * WebProcess/CredentialManagement/WebCredentialsMessenger.cpp:
3116         (WebKit::WebCredentialsMessenger::isUserVerifyingPlatformAuthenticatorAvailable):
3117         (WebKit::WebCredentialsMessenger::isUserVerifyingPlatformAuthenticatorAvailableReply):
3118         * WebProcess/CredentialManagement/WebCredentialsMessenger.h:
3119         * WebProcess/CredentialManagement/WebCredentialsMessenger.messages.in:
3120
3121 2018-02-16  Per Arne Vollan  <pvollan@apple.com>
3122
3123         Implement stopping of run loop in the WebContent process when using NSRunLoop.
3124         https://bugs.webkit.org/show_bug.cgi?id=182499
3125         <rdar://problem/37247424>
3126
3127         Reviewed by Brent Fulgham.
3128
3129         Add the method ChildProcess::stopNSRunLoop to end the WebContent process by executing a block
3130         with 'exit(0)' on the main run loop. 
3131
3132         * Shared/ChildProcess.h:
3133         * Shared/mac/ChildProcessMac.mm:
3134         (WebKit::ChildProcess::stopNSRunLoop):
3135         * WebProcess/cocoa/WebProcessCocoa.mm:
3136         (WebKit::WebProcess::platformInitializeWebProcess):
3137         (WebKit::WebProcess::stopRunLoop):
3138
3139 2018-02-16  Yousuke Kimoto  <yousuke.kimoto@sony.com>
3140
3141         [WinCario] Add NetworkSessionCurl
3142         https://bugs.webkit.org/show_bug.cgi?id=182680
3143
3144         Reviewed by Konstantin Tokarev.
3145
3146         * NetworkProcess/NetworkSession.cpp:
3147         (WebKit::NetworkSession::create):
3148         * PlatformWin.cmake:
3149
3150 2018-02-16  Chris Dumez  <cdumez@apple.com>
3151
3152         ASSERTION FAILED: !m_processes[i] || *m_processes[i] == process in MessagePortChannel::entanglePortWithProcess()
3153         https://bugs.webkit.org/show_bug.cgi?id=182054
3154         <rdar://problem/36871207>
3155
3156         Reviewed by Brady Eidson.
3157
3158         Pipe postMessage messages to and from service workers via the UIProcess instead of going
3159         directly to the StorageProcess. This is temporarily needed to avoid races due to the
3160         MessagePort registry currently living in the UIProcess and postMessage messages potentially
3161         sending MessagePort objects.
3162
3163         This change is covered by tests on the bots that currently flakily crash in debug.
3164
3165         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
3166         * StorageProcess/StorageProcess.cpp:
3167         (WebKit::StorageProcess::postMessageToServiceWorker):
3168         * StorageProcess/StorageProcess.h:
3169         * StorageProcess/StorageProcess.messages.in:
3170         * UIProcess/WebProcessPool.cpp:
3171         (WebKit::WebProcessPool::postMessageToServiceWorkerClient):
3172         (WebKit::WebProcessPool::postMessageToServiceWorker):
3173         * UIProcess/WebProcessPool.h:
3174         * UIProcess/WebProcessPool.messages.in:
3175         * WebProcess/Storage/WebSWClientConnection.cpp:
3176         (WebKit::WebSWClientConnection::postMessageToServiceWorker):
3177         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
3178         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerClient):
3179
3180 2018-02-16  Wenson Hsieh  <wenson_hsieh@apple.com>
3181
3182         [Extra zoom mode] Add basic support for <input type='date'> using date picker UI
3183         https://bugs.webkit.org/show_bug.cgi?id=182847
3184         <rdar://problem/35143111>
3185
3186         Reviewed by Tim Horton.
3187
3188         Add support for presenting date pickers when focusing a date input.
3189
3190         * UIProcess/ios/WKContentViewInteraction.h:
3191         * UIProcess/ios/WKContentViewInteraction.mm:
3192         (-[WKContentView _stopAssistingNode]):
3193         (-[WKContentView dismissAllInputViewControllers]):
3194
3195         Pull logic to dismiss input view controllers into a single helper.
3196
3197         (-[WKContentView presentDatePickerViewController:]):
3198         (-[WKContentView dismissDatePickerViewController:]):
3199         (-[WKContentView presentViewControllerForAssistedNode:]):
3200         (-[WKContentView textInputController:didCommitText:]):
3201         (-[WKContentView _wheelChangedWithEvent:]):
3202
3203         Delegate wheel events to the date picker.
3204
3205         * UIProcess/ios/forms/WKDatePickerViewController.h: Added.
3206         * UIProcess/ios/forms/WKDatePickerViewController.mm: Added.
3207
3208         Add harness files for the WKDatePickerViewController implementation in WebKitAdditions.
3209
3210         * WebKit.xcodeproj/project.pbxproj:
3211
3212 2018-02-15  Youenn Fablet  <youenn@apple.com>
3213
3214         Resources loaded from service workers are not downloadable
3215         https://bugs.webkit.org/show_bug.cgi?id=182848
3216
3217         Reviewed by Chris Dumez.
3218
3219         Downloads are not supporting resources loaded through service worker.
3220         As a temporary solution, we will let network process handle it.
3221         Note that this would not work if the URL can only be loaded through service worker.
3222         Note also that for navigation loads, if the content type is the default one (application/octet-stream) we are overriding it to
3223         text/html as we do not support mime sniffing yet from service worker responses.
3224         This might interfere with automatic downloads from navigation.
3225
3226         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3227         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
3228
3229 2018-02-15  Megan Gardner  <megan_gardner@apple.com>
3230
3231         Support scrolling for non-editable web-selection and start autoscroll when near screen edges
3232         https://bugs.webkit.org/show_bug.cgi?id=182815
3233
3234         Add support for autoscrolling during a selection. This also takes into account the edges of the screen
3235         and starts autoscrolling when you get close, while still allowing autoscrolling when you are past the bounds
3236         of the WebView.
3237
3238         Reviewed by Tim Horton.
3239
3240         * UIProcess/ios/WKContentViewInteraction.mm:
3241         (-[WKContentView startAutoscroll:]):
3242         (-[WKContentView resignFirstResponderForWebView]):
3243         (-[WKContentView useSelectionAssistantWithGranularity:]):
3244         (-[WKContentView selectedTextRange]):
3245         * UIProcess/ios/WebPageProxyIOS.mm:
3246         (WebKit::WebPageProxy::startAutoscrollAtPosition):
3247         * WebProcess/WebPage/ios/WebPageIOS.mm:
3248         (WebKit::WebPage::startAutoscrollAtPosition):
3249         (WebKit::WebPage::cancelAutoscroll):
3250
3251 2018-02-15  John Wilander  <wilander@apple.com>
3252
3253         Resource Load Statistics: Make sure WebResourceLoadStatisticsStore::mergeWithDataFromDecoder() can ingest older plist versions and not reset the database
3254         https://bugs.webkit.org/show_bug.cgi?id=182812
3255         <rdar://problem/37511406>
3256
3257         Reviewed by Brent Fulgham.
3258
3259         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3260         (WebKit::WebResourceLoadStatisticsStore::mergeWithDataFromDecoder):
3261             Now does the following:
3262             - Logs when there is a model version mismatch.
3263             - Does not ingest statistics if the version on disk is newer than the supported one.
3264             - Does ingest statistics if the version on disk is older than the supported one.
3265             - Passes on the version found on disk to WebCore::ResourceLoadStatistics::decode().
3266
3267 2018-02-15  Jiewen Tan  <jiewen_tan@apple.com>
3268
3269         [WebAuthN] Revisit the whole async model of task dispatching, timeout and aborting
3270         https://bugs.webkit.org/show_bug.cgi?id=181946
3271         <rdar://problem/37258262>
3272
3273         Reviewed by Chris Dumez.
3274
3275         Dummy WebCredentialsMessenger and WebCredentialsMessengerProxy are crafted to establish
3276         a message exchange channel between UIProcess and WebProcess.
3277
3278         * DerivedSources.make:
3279         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.cpp: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
3280         (WebKit::WebCredentialsMessengerProxy::WebCredentialsMessengerProxy):
3281         (WebKit::WebCredentialsMessengerProxy::~WebCredentialsMessengerProxy):
3282         (WebKit::WebCredentialsMessengerProxy::makeCredential):
3283         (WebKit::WebCredentialsMessengerProxy::getAssertion):
3284         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.h: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
3285         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.messages.in: Added.
3286         * UIProcess/WebPageProxy.cpp:
3287         (WebKit::m_configurationPreferenceValues):
3288         (WebKit::WebPageProxy::reattachToWebProcess):
3289         (WebKit::WebPageProxy::resetState):
3290         * UIProcess/WebPageProxy.h:
3291         * WebKit.xcodeproj/project.pbxproj:
3292         * WebProcess/CredentialManagement/WebCredentialsMessenger.cpp: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
3293         (WebKit::WebCredentialsMessenger::WebCredentialsMessenger):
3294         (WebKit::WebCredentialsMessenger::~WebCredentialsMessenger):
3295         (WebKit::WebCredentialsMessenger::makeCredential):
3296         (WebKit::WebCredentialsMessenger::getAssertion):
3297         (WebKit::WebCredentialsMessenger::makeCredentialReply):
3298         (WebKit::WebCredentialsMessenger::getAssertionReply):
3299         * WebProcess/CredentialManagement/WebCredentialsMessenger.h: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
3300         * WebProcess/CredentialManagement/WebCredentialsMessenger.messages.in: Added.
3301         * WebProcess/WebPage/WebPage.cpp:
3302         (WebKit::m_credentialsMessenger):
3303         (WebKit::m_cpuLimit): Deleted.
3304         * WebProcess/WebPage/WebPage.h:
3305
3306 2018-02-15  Michael Catanzaro  <mcatanzaro@igalia.com>
3307
3308         [WPE] Unify build of platform-specific files in WebKit layer
3309         https://bugs.webkit.org/show_bug.cgi?id=182696
3310
3311         Reviewed by Žan Doberšek.
3312
3313         This is easy, because all needed changes were made in the previously-landed patch.
3314
3315         * CMakeLists.txt:
3316         * PlatformWPE.cmake:
3317
3318 2018-02-15  Don Olmstead  <don.olmstead@sony.com>
3319
3320         WebCore headers should not be included relatively within dependent projects
3321         https://bugs.webkit.org/show_bug.cgi?id=182805
3322
3323         Reviewed by Chris Dumez.
3324
3325         * NetworkProcess/capture/NetworkCaptureManager.cpp:
3326         * NetworkProcess/webrtc/NetworkRTCMonitor.h:
3327         * Shared/gtk/WebEventFactory.cpp:
3328         * UIProcess/API/gtk/PageClientImpl.cpp:
3329         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3330         * UIProcess/gtk/WebPageProxyGtk.cpp:
3331         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
3332         * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
3333         * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp:
3334         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
3335         * WebProcess/WebPage/wpe/WebPageWPE.cpp:
3336
3337 2018-02-15  Matt Lewis  <jlewis3@apple.com>
3338
3339         Unreviewed, rolling out r228495.
3340
3341         This caused mulitple perf tests to fail consistently.
3342
3343         Reverted changeset:
3344
3345         "Resource Load Statistics: Make sure
3346         WebResourceLoadStatisticsStore::mergeWithDataFromDecoder() can
3347         ingest older plist versions and not reset the database"
3348         https://bugs.webkit.org/show_bug.cgi?id=182812
3349         https://trac.webkit.org/changeset/228495
3350
3351 2018-02-14  Ross Kirsling  <ross.kirsling@sony.com>
3352
3353         Default definition of InjectedBundle::PlatformBundle should not be Windows-specific.
3354         https://bugs.webkit.org/show_bug.cgi?id=182810
3355
3356         Reviewed by Michael Catanzaro.
3357
3358         This branch was added in r228455, but should not be limited to OS(WINDOWS).
3359
3360         * WebProcess/InjectedBundle/InjectedBundle.h:
3361
3362 2018-02-14  Ross Kirsling  <ross.kirsling@sony.com>
3363
3364         Default implementations of nativeEvent() should be platform-agnostic.
3365         https://bugs.webkit.org/show_bug.cgi?id=182806
3366
3367         Reviewed by Darin Adler.
3368
3369         * Shared/NativeWebKeyboardEvent.h:
3370         * Shared/NativeWebMouseEvent.h:
3371         * Shared/NativeWebWheelEvent.h:
3372
3373 2018-02-14  John Wilander  <wilander@apple.com>
3374
3375         Resource Load Statistics: Make sure WebResourceLoadStatisticsStore::mergeWithDataFromDecoder() can ingest older plist versions and not reset the database
3376         https://bugs.webkit.org/show_bug.cgi?id=182812
3377         <rdar://problem/37511406>
3378
3379         Reviewed by Brent Fulgham.
3380
3381         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3382         (WebKit::WebResourceLoadStatisticsStore::mergeWithDataFromDecoder):
3383             Now does the following:
3384             - Logs when there is a model version mismatch.
3385             - Does not ingest statistics if the version on disk is newer than the supported one.
3386             - Does ingest statistics if the version on disk is older than the supported one.
3387             - Passes on the version found on disk to WebCore::ResourceLoadStatistics::decode().
3388
3389 2018-02-14  Daniel Bates  <dabates@apple.com>
3390
3391         Disallow cross-origin subresources from asking for credentials
3392         https://bugs.webkit.org/show_bug.cgi?id=182579
3393         <rdar://problem/36162271>
3394
3395         Reviewed by Andy Estes.
3396
3397         Add a private preference to toggle allowing non-mixed content cross-origin subresources to load.
3398         WebKitTestRunner toggles this preference when it sees the test option allowCrossOriginSubresourcesToAskForCredential.
3399
3400         * Shared/WebPreferences.yaml:
3401         * UIProcess/API/C/WKPreferences.cpp:
3402         (WKPreferencesSetAllowCrossOriginSubresourcesToAskForCredentials):
3403         (WKPreferencesGetAllowCrossOriginSubresourcesToAskForCredentials):
3404         * UIProcess/API/C/WKPreferencesRefPrivate.h:
3405
3406 2018-02-14  John Wilander  <wilander@apple.com>
3407
3408         Make maximumParallelReadCount static to fix lambda capture error in WebKit::NetworkCache::Storage::traverse()
3409         https://bugs.webkit.org/show_bug.cgi?id=182797
3410         <rdar://problem/37540594>
3411
3412         Reviewed by Tim Horton.
3413
3414         This capture was added in r228455 and causes a build failure when
3415         run with -Wunused-lambda-capture. Xcode also warns about it.
3416
3417         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3418         (WebKit::NetworkCache::Storage::traverse):
3419
3420 2018-02-14  Ryosuke Niwa  <rniwa@webkit.org>
3421
3422         EventDispatcher::wheelEvent uses a wrong enum values in switch
3423         https://bugs.webkit.org/show_bug.cgi?id=182796
3424
3425         Reviewed by Chris Dumez.
3426
3427         EventDispatcher::wheelEvent is using PlatformWheelEventPhaseBegan and PlatformWheelEventPhaseEnded
3428         but the enum type of wheelEvent.phase() is WebWheelEvent::Phase.
3429
3430         The enum values are indentical for both so there is no behavioral change.
3431
3432         * WebProcess/WebPage/EventDispatcher.cpp:
3433         (WebKit::EventDispatcher::wheelEvent):
3434
3435 2018-02-14  Maureen Daum  <mdaum@apple.com>
3436
3437         Add C SPI for support of Website Data Store in Website Policies
3438         https://bugs.webkit.org/show_bug.cgi?id=182698
3439         <rdar://problem/37412008>
3440
3441         Reviewed by Andy Estes.
3442
3443         Expand the API added for _WKWebsitePolicies.websiteDataStore in r225989 and r226325
3444         to be available in the C API. In the ObjC API, we handle setting the website data
3445         store in NavigationState::NavigationClient::decidePolicyForNavigationAction. There
3446         we throw an exception if setting the website data store isn't supported, and then
3447         change the website data store. The equivalent place to do this work in the C API is
3448         in WKFramePolicyListenerUseWithPolicies. However, instead of throwing exceptions,
3449         release asserts are used.
3450
3451         * UIProcess/API/C/WKFramePolicyListener.cpp:
3452         (WKFramePolicyListenerUseWithPolicies):
3453         If the website policies data contains a website data store, do the same checks that
3454         are done in NavigationState::NavigationClient::decidePolicyForNavigationAction. Namely,
3455         that it is a valid website data store and it is a policy decision for a main frame navigation.
3456         If these checks are met, change the website data store.
3457         * UIProcess/API/C/WKPage.cpp:
3458         (WKPageUpdateWebsitePolicies):
3459         * UIProcess/API/C/WKWebsitePolicies.cpp:
3460         (WKWebsitePoliciesGetDataStore):
3461         (WKWebsitePoliciesSetDataStore):
3462         * UIProcess/API/C/WKWebsitePolicies.h:
3463         * UIProcess/WebFrameListenerProxy.cpp:
3464         (WebKit::WebFrameListenerProxy::changeWebsiteDataStore):
3465         (WebKit::WebFrameListenerProxy::isMainFrame):
3466         Expose whether the frame proxy is for a main frame, which is required to verify that
3467         website policies only specify a website data store for main frame policy decisions.
3468         * UIProcess/WebFrameListenerProxy.h:
3469         * UIProcess/WebFramePolicyListenerProxy.cpp:
3470         * UIProcess/WebFrameProxy.cpp:
3471         (WebKit::WebFrameProxy::changeWebsiteDataStore):
3472         * UIProcess/WebFrameProxy.h:
3473
3474 2018-02-14  Ryan Haddad  <ryanhaddad@apple.com>
3475
3476         Unreviewed, rolling out r228444.
3477
3478         Introduced API and Layout test failures.
3479
3480         Reverted changeset:
3481
3482         "[WebAuthN] Revisit the whole async model of task dispatching,
3483         timeout and aborting"
3484         https://bugs.webkit.org/show_bug.cgi?id=181946
3485         https://trac.webkit.org/changeset/228444
3486
3487 2018-02-13  Yousuke Kimoto  <yousuke.kimoto@sony.com>
3488
3489         [WinCairo] Fix build errors which come from including headers and not suitable implementation for windows
3490         https://bugs.webkit.org/show_bug.cgi?id=182679
3491
3492         Reviewed by Michael Catanzaro.
3493
3494         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
3495         (WebKit::NetworkCache::BlobStorage::add):
3496         * NetworkProcess/cache/NetworkCacheData.cpp:
3497         (WebKit::NetworkCache::Data::mapToFile const):
3498         (WebKit::NetworkCache::mapFile):
3499         (WebKit::NetworkCache::adoptAndMapFile):
3500         (WebKit::NetworkCache::readOrMakeSalt):
3501         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
3502         (WebKit::NetworkCache::directoryEntryType):
3503         (WebKit::NetworkCache::traverseDirectory):
3504         (WebKit::NetworkCache::fileTimes):
3505         (WebKit::NetworkCache::updateFileModificationTimeIfNeeded):
3506         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3507         (WebKit::NetworkCache::Storage::traverse):
3508         * NetworkProcess/win/SystemProxyWin.h:
3509         * Platform/IPC/Attachment.h:
3510         * Platform/Module.h:
3511         * Platform/SharedMemory.h:
3512         * PluginProcess/WebProcessConnection.cpp:
3513         * Shared/API/c/WKBase.h:
3514         * Shared/ChildProcess.cpp:
3515         * Shared/WebCoreArgumentCoders.h:
3516         * UIProcess/ProcessAssertion.h:
3517         * WebProcess/InjectedBundle/InjectedBundle.h:
3518         * WebProcess/WebProcess.cpp:
3519
3520 2018-02-13  Commit Queue  <commit-queue@webkit.org>
3521
3522         Unreviewed, rolling out r228431.
3523         https://bugs.webkit.org/show_bug.cgi?id=182766
3524
3525         Regressed CMake build stability (Requested by dolmstead on
3526         #webkit).
3527
3528         Reverted changeset:
3529
3530         "[CMake] Make WebCore headers copies"
3531         https://bugs.webkit.org/show_bug.cgi?id=182512
3532         https://trac.webkit.org/changeset/228431
3533
3534 2018-02-13  Jiewen Tan  <jiewen_tan@apple.com>
3535
3536         [WebAuthN] Revisit the whole async model of task dispatching, timeout and aborting
3537         https://bugs.webkit.org/show_bug.cgi?id=181946
3538         <rdar://problem/37258262>
3539
3540         Reviewed by Chris Dumez.
3541
3542         Dummy WebCredentialsMessenger and WebCredentialsMessengerProxy are crafted to establish
3543         a message exchange channel between UIProcess and WebProcess.
3544
3545         * DerivedSources.make:
3546         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.cpp: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
3547         (WebKit::WebCredentialsMessengerProxy::WebCredentialsMessengerProxy):
3548         (WebKit::WebCredentialsMessengerProxy::~WebCredentialsMessengerProxy):
3549         (WebKit::WebCredentialsMessengerProxy::makeCredential):
3550         (WebKit::WebCredentialsMessengerProxy::getAssertion):
3551         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.h: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
3552         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.messages.in: Added.
3553         * UIProcess/WebPageProxy.cpp:
3554         (WebKit::m_configurationPreferenceValues):
3555         (WebKit::WebPageProxy::reattachToWebProcess):
3556         * UIProcess/WebPageProxy.h:
3557         * WebKit.xcodeproj/project.pbxproj:
3558         * WebProcess/CredentialManagement/WebCredentialsMessenger.cpp: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
3559         (WebKit::WebCredentialsMessenger::WebCredentialsMessenger):
3560         (WebKit::WebCredentialsMessenger::~WebCredentialsMessenger):
3561         (WebKit::WebCredentialsMessenger::makeCredential):
3562         (WebKit::WebCredentialsMessenger::getAssertion):
3563         (WebKit::WebCredentialsMessenger::makeCredentialReply):
3564         (WebKit::WebCredentialsMessenger::getAssertionReply):
3565         * WebProcess/CredentialManagement/WebCredentialsMessenger.h: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
3566         * WebProcess/CredentialManagement/WebCredentialsMessenger.messages.in: Added.
3567         * WebProcess/WebPage/WebPage.cpp:
3568         (WebKit::m_credentialsMessenger):
3569         (WebKit::m_cpuLimit): Deleted.
3570         * WebProcess/WebPage/WebPage.h:
3571
3572 2018-02-13  Youenn Fablet  <youenn@apple.com>
3573
3574         Add support for configuring WebsiteDatastore service worker and cache storage path
3575         https://bugs.webkit.org/show_bug.cgi?id=182674
3576
3577         Reviewed by Chris Dumez.
3578
3579         Beef up WKWebsiteDataStoreConfiguration to easily set the WebsiteDataStore
3580         service worker registration and cache storage directory path.
3581
3582         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3583         (-[WKWebsiteDataStore _initWithConfiguration:]):
3584         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
3585         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
3586         (-[_WKWebsiteDataStoreConfiguration _cacheStorageDirectory]):
3587         (-[_WKWebsiteDataStoreConfiguration _setCacheStorageDirectory:]):
3588         (-[_WKWebsiteDataStoreConfiguration _serviceWorkerRegistrationDirectory]):
3589         (-[_WKWebsiteDataStoreConfiguration _setServiceWorkerRegistrationDirectory:]):
3590
3591 2018-02-13  Brian Burg  <bburg@apple.com>
3592
3593         Web Automation: don't return an error if resizing/moving a window has no effect
3594         https://bugs.webkit.org/show_bug.cgi?id=182742
3595
3596         Reviewed by Tim Horton.
3597
3598         * UIProcess/Automation/WebAutomationSession.cpp:
3599         (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext):
3600         (WebKit::WebAutomationSession::moveWindowOfBrowsingContext):
3601         Unify the behavior for all ports. Don't raise an error if the command was
3602         idempotent (by mistake or not). It should not be an error to re-maximize a window.
3603
3604 2018-02-13  Don Olmstead  <don.olmstead@sony.com>
3605
3606         [CMake] Make WebCore headers copies
3607         https://bugs.webkit.org/show_bug.cgi?id=182512
3608
3609         Reviewed by Keith Miller.
3610
3611         * CMakeLists.txt:
3612         * NetworkProcess/capture/NetworkCaptureManager.cpp:
3613         * NetworkProcess/webrtc/NetworkRTCMonitor.h:
3614         * PlatformWPE.cmake:
3615         * Scripts/generate-forwarding-headers.pl:
3616         * Shared/gtk/WebEventFactory.cpp:
3617         * UIProcess/API/gtk/PageClientImpl.cpp:
3618         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3619         * UIProcess/gtk/WebPageProxyGtk.cpp:
3620         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
3621         * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
3622         * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp:
3623         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
3624         * WebProcess/WebPage/wpe/WebPageWPE.cpp:
3625
3626 2018-02-13  Brent Fulgham  <bfulgham@apple.com>
3627
3628         [iOS] whitelist iokit-get-properties
3629         https://bugs.webkit.org/show_bug.cgi?id=182722
3630         <rdar://problem/30929165>
3631
3632         Reviewed by Eric Carlson.
3633
3634         Update the iOS sandbox to block access to IOKit properties that are not needed for
3635         legitimate WebContent process use. This brings the iOS sandbox in line with the
3636         work done under macOS.
3637
3638         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
3639
3640 2018-02-12  John Wilander  <wilander@apple.com>
3641
3642         Resource Load Statistics: Classify resources as prevalent based on redirects to other prevalent resources
3643         https://bugs.webkit.org/show_bug.cgi?id=182664
3644         <rdar://problem/37372572>
3645
3646         Reviewed by Brent Fulgham.
3647
3648         * Platform/classifier/ResourceLoadStatisticsClassifier.cpp:
3649         (WebKit::ResourceLoadStatisticsClassifier::hasPrevalentResourceCharacteristics):
3650             Unique top frame redirects now counts toward classification as prevalent.
3651         * Shared/WebCoreArgumentCoders.cpp:
3652         (IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
3653         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
3654         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
3655         (WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectFrom):
3656         (WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectTo):
3657         (WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectFrom):
3658             Test infrastructure.
3659         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
3660         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3661             Bumped the statistics model to 11 because of the added fields.
3662         (WebKit::WebResourceLoadStatisticsStore::recursivelyGetAllDomainsThatHaveRedirectedToThisDomain):
3663             This function back traces redirect chains to classify domains
3664             that have redirected to a newly classified prevalent resource.
3665         (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
3666             Now uses the new convenience function WebResourceLoadStatisticsStore::setPrevalentResource().
3667         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
3668             New convenience function to make sure we always call
3669             WebResourceLoadStatisticsStore::recursivelyGetAllDomainsThatHaveRedirectedToThisDomain()
3670             and capture redirect chains backward.
3671         (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
3672         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
3673         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
3674         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom):
3675         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo):
3676         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom):
3677             Test infrastructure.
3678         * UIProcess/WebResourceLoadStatisticsStore.h:
3679
3680 2018-02-12  Antti Koivisto  <antti@apple.com>
3681
3682         Update NetworkCache::Storage::lastStableVersion after r226349
3683         https://bugs.webkit.org/show_bug.cgi?id=182723
3684         <rdar://problem/37469554>
3685         
3686         Reviewed by Ryosuke Niwa.
3687
3688         * NetworkProcess/cache/NetworkCacheStorage.h:
3689
3690         Allow deleting version 11 caches.
3691
3692 2018-02-12  Wenson Hsieh  <wenson_hsieh@apple.com>
3693
3694         [Extra zoom mode] Add support for <input type='time'> using time picker UI
3695         https://bugs.webkit.org/show_bug.cgi?id=182683
3696         <rdar://problem/35143162>
3697
3698         Reviewed by Tim Horton.
3699
3700         Adds support for showing a time picker when an input of type time is focused in extra zoomed mode.
3701
3702         * UIProcess/ios/WKContentViewInteraction.h:
3703         * UIProcess/ios/WKContentViewInteraction.mm:
3704         (-[WKContentView _stopAssistingNode]):
3705         (-[WKContentView presentTimePickerViewController:]):
3706         (-[WKContentView dismissTimePickerViewController:]):
3707
3708         Add helpers to dismiss and present the time picker view controller.
3709
3710         (-[WKContentView presentViewControllerForAssistedNode:]):
3711
3712         When focusing InputType::Time, present a time picker. Additionally, tweak the logic here to use the generic text
3713         input view controller as a fallback when the other input view controllers (number pads, select menus and time
3714         pickers thus far) are not relevant. This prevents us from completely being unable to edit form controls that are
3715         currently unsupported.
3716
3717         (-[WKContentView textInputController:didCommitText:]):
3718         (-[WKContentView textInputControllerDidRequestDismissal:]):
3719
3720         Tweak WKContentView for changes to WKTextFormControlViewControllerDelegate.
3721
3722         (-[WKContentView actionNameForFocusedFormControlController:]):
3723
3724         Adjust this implementation to hide the focused form control "Go" button for selects and time inputs. This
3725         currently doesn't work for these form controls because it relies on implicit form submission; this should be
3726         fixed by future changes, after which we should revert this adjustment.
3727
3728         (-[WKContentView _wheelChangedWithEvent:]):
3729
3730         Delegate wheel events to the time picker if needed.
3731
3732         (-[WKContentView textInputController:didRequestDismissalWithAction:]): Deleted.
3733
3734         Renamed to -textInputControllerDidRequestDismissal:.
3735
3736         * UIProcess/ios/forms/WKTimePickerViewController.h: Added.
3737         * UIProcess/ios/forms/WKTimePickerViewController.mm: Added.
3738         * WebKit.xcodeproj/project.pbxproj:
3739
3740 2018-02-11  Michael Catanzaro  <mcatanzaro@igalia.com>
3741
3742         [GTK] Unify builds for platform-specific files in WebKit layer
3743         https://bugs.webkit.org/show_bug.cgi?id=182450
3744
3745         Reviewed by Carlos Garcia Campos.
3746
3747         Add most GTK-specific sources to unified build. API files are exempted, except for the DOM
3748         API. Files shared with PluginProcessGTK2 are also exempted. Finally, files with name
3749         conflicts in headers, which appears difficult to fix, are also exempted.
3750
3751         * CMakeLists.txt:
3752         * NetworkProcess/CustomProtocols/soup/LegacyCustomProtocolManagerSoup.cpp:
3753         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
3754         * NetworkProcess/soup/NetworkProcessSoup.cpp:
3755         * NetworkProcess/soup/NetworkSessionSoup.cpp:
3756         * NetworkProcess/soup/RemoteNetworkingContextSoup.cpp:
3757         * Platform/classifier/ResourceLoadStatisticsClassifier.cpp:
3758         * PlatformGTK.cmake:
3759         * PluginProcess/unix/PluginControllerProxyUnix.cpp:
3760         * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
3761         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
3762         * Shared/CoordinatedGraphics/SimpleViewportController.cpp:
3763         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
3764         * Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp:
3765         * Shared/Plugins/unix/PluginSearchPath.cpp:
3766         * Shared/cairo/ShareableBitmapCairo.cpp:
3767         * Shared/glib/WebContextMenuItemGlib.cpp:
3768         * Shared/glib/WebErrorsGlib.cpp:
3769         * Shared/gtk/ArgumentCodersGtk.cpp:
3770         * Shared/gtk/NativeWebKeyboardEventGtk.cpp:
3771         * Shared/gtk/ProcessExecutablePathGtk.cpp:
3772         * Shared/gtk/WebErrorsGtk.cpp:
3773         * Shared/gtk/WebEventFactory.cpp:
3774         * Shared/linux/WebMemorySamplerLinux.cpp:
3775         * Shared/soup/WebCoreArgumentCodersSoup.cpp:
3776         * Shared/soup/WebErrorsSoup.cpp:
3777         * SourcesGTK.txt: Added.
3778         * UIProcess/AcceleratedDrawingAreaProxy.cpp:
3779         * UIProcess/Automation/cairo/WebAutomationSessionCairo.cpp:
3780         * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
3781         * UIProcess/BackingStore.cpp:
3782         * UIProcess/DrawingAreaProxyImpl.cpp:
3783         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
3784         * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
3785         * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
3786         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3787         * UIProcess/WebResourceLoadStatisticsTelemetry.cpp:
3788         * UIProcess/WebStorage/StorageManager.cpp:
3789         * UIProcess/cairo/BackingStoreCairo.cpp:
3790         * UIProcess/gtk/AcceleratedBackingStore.cpp:
3791         * UIProcess/gtk/DragAndDropHandler.cpp:
3792         * UIProcess/gtk/GestureController.cpp:
3793         * UIProcess/gtk/HardwareAccelerationManager.cpp:
3794         * UIProcess/gtk/InputMethodFilter.cpp:
3795         * UIProcess/gtk/TextCheckerGtk.cpp:
3796         * UIProcess/gtk/WaylandCompositor.cpp:
3797         * UIProcess/gtk/WebColorPickerGtk.cpp:
3798         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
3799         * UIProcess/gtk/WebPasteboardProxyGtk.cpp:
3800         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
3801         * WebProcess/Cookies/soup/WebCookieManagerSoup.cpp:
3802         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.cpp:
3803         (webkit_dom_attr_dom_event_target_init):
3804         (webkit_dom_attr_set_property):
3805         (webkit_dom_attr_get_property):
3806         (webkit_dom_attr_class_init):
3807         (webkit_dom_event_target_init): Deleted.
3808         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.cpp:
3809         (webkit_dom_cdata_section_dom_event_target_init):
3810         (webkit_dom_event_target_init): Deleted.
3811         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.cpp:
3812         (webkit_dom_css_rule_set_property):
3813         (webkit_dom_css_rule_get_property):
3814         (webkit_dom_css_rule_class_init):
3815         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleList.cpp:
3816         (webkit_dom_css_rule_list_get_property):
3817         (webkit_dom_css_rule_list_class_init):
3818         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclaration.cpp:
3819         (webkit_dom_css_style_declaration_set_property):
3820         (webkit_dom_css_style_declaration_get_property):
3821         (webkit_dom_css_style_declaration_class_init):
3822         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.cpp:
3823         (webkit_dom_css_style_sheet_get_property):
3824         (webkit_dom_css_style_sheet_class_init):
3825         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.cpp:
3826         (webkit_dom_css_value_set_property):
3827         (webkit_dom_css_value_get_property):
3828         (webkit_dom_css_value_class_init):
3829         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp:
3830         (webkit_dom_character_data_dom_event_target_init):
3831         (webkit_dom_character_data_set_property):
3832         (webkit_dom_character_data_get_property):
3833         (webkit_dom_character_data_class_init):
3834         (webkit_dom_event_target_init): Deleted.
3835         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.cpp:
3836         (webkit_dom_client_rect_get_property):
3837         (webkit_dom_client_rect_class_init):
3838         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp:
3839         (webkit_dom_client_rect_list_get_property):
3840         (webkit_dom_client_rect_list_class_init):
3841         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.cpp:
3842         (webkit_dom_comment_dom_event_target_init):
3843         (webkit_dom_event_target_init): Deleted.
3844         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.cpp:
3845         (webkit_dom_dom_selection_get_property):
3846         (webkit_dom_dom_selection_class_init):
3847         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.cpp:
3848         (webkit_dom_dom_token_list_set_property):
3849         (webkit_dom_dom_token_list_get_property):
3850         (webkit_dom_dom_token_list_class_init):
3851         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp:
3852         (webkit_dom_dom_window_dom_event_target_init):
3853         (webkit_dom_dom_window_set_property):
3854         (webkit_dom_dom_window_get_property):
3855         (webkit_dom_dom_window_class_init):
3856         (webkit_dom_event_target_init): Deleted.
3857         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
3858         (webkit_dom_document_dom_event_target_init):
3859         (webkit_dom_document_set_property):
3860         (webkit_dom_document_get_property):
3861         (webkit_dom_document_class_init):
3862         (webkit_dom_event_target_init): Deleted.
3863         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp:
3864         (webkit_dom_document_fragment_dom_event_target_init):
3865         (webkit_dom_document_fragment_get_property):
3866         (webkit_dom_document_fragment_class_init):
3867         (webkit_dom_event_target_init): Deleted.
3868         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.cpp:
3869         (webkit_dom_document_type_dom_event_target_init):
3870         (webkit_dom_document_type_get_property):
3871         (webkit_dom_document_type_class_init):
3872         (webkit_dom_event_target_init): Deleted.
3873         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
3874         (webkit_dom_element_dom_event_target_init):
3875         (webkit_dom_element_set_property):
3876         (webkit_dom_element_get_property):
3877         (webkit_dom_element_class_init):
3878         (webkit_dom_event_target_init): Deleted.
3879         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.cpp:
3880         (webkit_dom_event_set_property):
3881         (webkit_dom_event_get_property):
3882         (webkit_dom_event_class_init):
3883         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFile.cpp:
3884         (webkit_dom_file_get_property):
3885         (webkit_dom_file_class_init):
3886         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileList.cpp:
3887         (webkit_dom_file_list_get_property):
3888         (webkit_dom_file_list_class_init):
3889         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.cpp:
3890         (webkit_dom_html_anchor_element_dom_event_target_init):
3891         (webkit_dom_html_anchor_element_set_property):
3892         (webkit_dom_html_anchor_element_get_property):
3893         (webkit_dom_html_anchor_element_class_init):
3894         (webkit_dom_event_target_init): Deleted.
3895         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.cpp:
3896         (webkit_dom_html_applet_element_dom_event_target_init):
3897         (webkit_dom_html_applet_element_set_property):
3898         (webkit_dom_html_applet_element_get_property):
3899         (webkit_dom_html_applet_element_class_init):
3900         (webkit_dom_event_target_init): Deleted.
3901         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.cpp:
3902         (webkit_dom_html_area_element_dom_event_target_init):
3903         (webkit_dom_html_area_element_set_property):
3904         (webkit_dom_html_area_element_get_property):
3905         (webkit_dom_html_area_element_class_init):
3906         (webkit_dom_event_target_init): Deleted.
3907         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.cpp:
3908         (webkit_dom_html_br_element_dom_event_target_init):
3909         (webkit_dom_html_br_element_set_property):
3910         (webkit_dom_html_br_element_get_property):
3911         (webkit_dom_html_br_element_class_init):
3912         (webkit_dom_event_target_init): Deleted.
3913         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.cpp:
3914         (webkit_dom_html_base_element_dom_event_target_init):
3915         (webkit_dom_html_base_element_set_property):
3916         (webkit_dom_html_base_element_get_property):
3917         (webkit_dom_html_base_element_class_init):
3918         (webkit_dom_event_target_init): Deleted.
3919         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.cpp:
3920         (webkit_dom_html_body_element_dom_event_target_init):
3921         (webkit_dom_html_body_element_set_property):
3922         (webkit_dom_html_body_element_get_property):
3923         (webkit_dom_html_body_element_class_init):
3924         (webkit_dom_event_target_init): Deleted.
3925         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.cpp:
3926         (webkit_dom_html_button_element_dom_event_target_init):
3927         (webkit_dom_html_button_element_set_property):
3928         (webkit_dom_html_button_element_get_property):
3929         (webkit_dom_html_button_element_class_init):
3930         (webkit_dom_event_target_init): Deleted.
3931         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.cpp:
3932         (webkit_dom_html_canvas_element_dom_event_target_init):
3933         (webkit_dom_html_canvas_element_set_property):
3934         (webkit_dom_html_canvas_element_get_property):
3935         (webkit_dom_html_canvas_element_class_init):
3936         (webkit_dom_event_target_init): Deleted.
3937         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollection.cpp:
3938         (webkit_dom_html_collection_get_property):
3939         (webkit_dom_html_collection_class_init):
3940         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.cpp:
3941         (webkit_dom_html_d_list_element_dom_event_target_init):
3942         (webkit_dom_html_d_list_element_set_property):
3943         (webkit_dom_html_d_list_element_get_property):
3944         (webkit_dom_html_d_list_element_class_init):
3945         (webkit_dom_event_target_init): Deleted.
3946         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.cpp:
3947         (webkit_dom_html_directory_element_dom_event_target_init):
3948         (webkit_dom_html_directory_element_set_property):
3949         (webkit_dom_html_directory_element_get_property):
3950         (webkit_dom_html_directory_element_class_init):
3951         (webkit_dom_event_target_init): Deleted.
3952         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.cpp:
3953         (webkit_dom_html_div_element_dom_event_target_init):
3954         (webkit_dom_html_div_element_set_property):
3955         (webkit_dom_html_div_element_get_property):
3956         (webkit_dom_html_div_element_class_init):
3957         (webkit_dom_event_target_init): Deleted.
3958         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.cpp:
3959         (webkit_dom_html_document_dom_event_target_init):
3960         (webkit_dom_html_document_set_property):
3961         (webkit_dom_html_document_get_property):
3962         (webkit_dom_html_document_class_init):
3963         (webkit_dom_event_target_init): Deleted.
3964         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp:
3965         (webkit_dom_html_element_dom_event_target_init):
3966         (webkit_dom_html_element_set_property):
3967         (webkit_dom_html_element_get_property):
3968         (webkit_dom_html_element_class_init):
3969         (webkit_dom_event_target_init): Deleted.
3970         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.cpp:
3971         (webkit_dom_html_embed_element_dom_event_target_init):
3972         (webkit_dom_html_embed_element_set_property):
3973         (webkit_dom_html_embed_element_get_property):
3974         (webkit_dom_html_embed_element_class_init):
3975         (webkit_dom_event_target_init): Deleted.
3976         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.cpp:
3977         (webkit_dom_html_field_set_element_dom_event_target_init):
3978         (webkit_dom_html_field_set_element_get_property):
3979         (webkit_dom_html_field_set_element_class_init):
3980         (webkit_dom_event_target_init): Deleted.
3981         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.cpp:
3982         (webkit_dom_html_font_element_dom_event_target_init):
3983         (webkit_dom_html_font_element_set_property):
3984         (webkit_dom_html_font_element_get_property):
3985         (webkit_dom_html_font_element_class_init):
3986         (webkit_dom_event_target_init): Deleted.
3987         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.cpp:
3988         (webkit_dom_html_form_element_dom_event_target_init):
3989         (webkit_dom_html_form_element_set_property):
3990         (webkit_dom_html_form_element_get_property):
3991         (webkit_dom_html_form_element_class_init):
3992         (webkit_dom_event_target_init): Deleted.
3993         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.cpp:
3994         (webkit_dom_html_frame_element_dom_event_target_init):
3995         (webk