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