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