Cache API implementation should be able to compute storage size for WebKit client...
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2017-10-17  Youenn Fablet  <youenn@apple.com>
2
3         Cache API implementation should be able to compute storage size for WebKit client applications.
4         https://bugs.webkit.org/show_bug.cgi?id=178350
5
6         Reviewed by Chris Dumez.
7
8         When gathering data from DOM Cache, we compute the size as follows:
9         - If Caches object is not persistent, size is zero
10         - If Caches object is persistent, we use the size computed by NetworkCache::Storage. 
11         Covered by updated tests.
12
13         * NetworkProcess/cache/CacheStorageEngine.cpp:
14         (WebKit::CacheStorage::ReadOriginsTaskCounter::create):
15         (WebKit::CacheStorage::ReadOriginsTaskCounter::addOrigin):
16         (WebKit::CacheStorage::Engine::fetchEntries):
17         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
18         (WebKit::CacheStorage::Caches::storageSize const):
19         * NetworkProcess/cache/CacheStorageEngineCaches.h:
20         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
21         (WKWebsiteDataStoreGetFetchCacheSizeForOrigin):
22         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
23
24 2017-10-17  Keith Miller  <keith_miller@apple.com>
25
26         Change WebCore sources to work with unified source builds
27         https://bugs.webkit.org/show_bug.cgi?id=178229
28
29         Rubber stamped by Tim Horton.
30
31         * Configurations/FeatureDefines.xcconfig:
32
33 2017-10-16  Wenson Hsieh  <wenson_hsieh@apple.com>
34
35         Unreviewed, fix the iOS build after r223431
36
37         Remove an unused variable captured in a lambda.
38
39         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
40         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
41
42 2017-10-12  Matt Rajca  <mrajca@apple.com>
43
44         Add API support for quirk that lets an arbitrary click allow auto-play.
45         https://bugs.webkit.org/show_bug.cgi?id=178227
46
47         Reviewed by Alex Christensen.
48
49         Instead of hardcoding sites in WebCore, let API clients control which websites opt into the quirk that lets
50         an arbitrary click allow auto-play via website policies.
51
52         * Shared/WebsitePolicies.h:
53         * UIProcess/API/C/WKWebsitePolicies.cpp:
54         (WKWebsitePoliciesSetAllowedAutoplayQuirks):
55         (WKWebsitePoliciesGetAllowedAutoplayQuirks):
56         * UIProcess/API/C/WKWebsitePolicies.h:
57         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
58         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
59         (-[_WKWebsitePolicies setAllowedAutoplayQuirks:]):
60         (-[_WKWebsitePolicies allowedAutoplayQuirks]):
61         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
62         (WebKit::WebFrameLoaderClient::applyToDocumentLoader):
63         * WebProcess/WebPage/WebPage.cpp:
64         (WebKit::WebPage::updateWebsitePolicies):
65
66 2017-10-16  Andy Estes  <aestes@apple.com>
67
68         [Apple Pay] Add subLocality and subAdministrativeArea to ApplePayPaymentContact and ApplePayError
69         https://bugs.webkit.org/show_bug.cgi?id=178191
70         <rdar://problem/34906367>
71
72         Reviewed by Tim Horton.
73
74         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
75         (WebKit::toNSError):
76
77 2017-10-16  Tim Horton  <timothy_horton@apple.com>
78
79         Safari crashes after searching PDF (under [WKPDFView zoom:to:atPoint:kind:])
80         https://bugs.webkit.org/show_bug.cgi?id=178358
81         <rdar://problem/34676899>
82
83         Reviewed by Wenson Hsieh.
84
85         * UIProcess/ios/WKPDFView.mm:
86         (-[WKPDFView _didFindMatch:]):
87         UIPDFSelection can return a null rect as the selection's bounds.
88         We can't zoom to a null rect (and doing so results in CA throwing an
89         exception later).
90
91 2017-10-16  Alex Christensen  <achristensen@webkit.org>
92
93         Add a _WKThumbnailView initializer with a WKWebView
94         https://bugs.webkit.org/show_bug.cgi?id=178351
95         <rdar://problem/34979453>
96
97         Reviewed by Tim Horton.
98
99         * UIProcess/API/Cocoa/WKWebView.mm:
100         (-[WKWebView _page]):
101         (-[WKWebView _setThumbnailView:]):
102         (-[WKWebView _thumbnailView]):
103         (-[WKWebView _setIgnoresAllEvents:]):
104         (-[WKWebView _ignoresAllEvents]):
105         * UIProcess/API/Cocoa/WKWebViewInternal.h:
106         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
107         * UIProcess/API/Cocoa/_WKThumbnailView.h:
108         * UIProcess/API/Cocoa/_WKThumbnailView.mm:
109         (-[_WKThumbnailView initWithFrame:fromWKWebView:]):
110         (-[_WKThumbnailView _viewWasUnparented]):
111         (-[_WKThumbnailView _viewWasParented]):
112
113 2017-10-16  Alex Christensen  <achristensen@webkit.org>
114
115         Expose more WKView properties as WKWebViewPrivate SPI
116         https://bugs.webkit.org/show_bug.cgi?id=178349
117         <rdar://problem/34980919>
118
119         Reviewed by Tim Horton.
120
121         _backgroundExtendsBeyondPage was already exposed on iOS, but we need it on Mac, too.
122         A few other properties also need exposing.
123
124         * UIProcess/API/Cocoa/WKWebView.mm:
125         (toAPIScrollbarStyle):
126         (toCoreScrollbarStyle):
127         (-[WKWebView _setBackgroundExtendsBeyondPage:]):
128         (-[WKWebView _backgroundExtendsBeyondPage]):
129         (-[WKWebView _setOverlayScrollbarStyle:]):
130         (-[WKWebView _overlayScrollbarStyle]):
131         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
132
133 2017-10-16  Chris Dumez  <cdumez@apple.com>
134
135         Log using differential privacy domains where the WebContent process crashes
136         https://bugs.webkit.org/show_bug.cgi?id=178346
137         <rdar://problem/33293830>
138
139         Reviewed by Alex Christensen.
140
141         * UIProcess/WebPageProxy.cpp:
142         (WebKit::WebPageProxy::reload):
143         (WebKit::WebPageProxy::currentURL const):
144         (WebKit::WebPageProxy::processDidTerminate):
145         * UIProcess/WebPageProxy.h:
146         * UIProcess/WebProcessProxy.cpp:
147         (WebKit::WebProcessProxy::didClose):
148
149 2017-10-16  Youenn Fablet  <youenn@apple.com>
150
151         Activate Cache API by default
152         https://bugs.webkit.org/show_bug.cgi?id=178186
153
154         Reviewed by Chris Dumez.
155
156         * Shared/WebPreferencesDefinitions.h:
157
158 2017-10-16  Sam Weinig  <sam@webkit.org>
159
160         [Settings] Remove all custom code from Settings.h/cpp
161         https://bugs.webkit.org/show_bug.cgi?id=178330
162
163         Reviewed by Simon Fraser.
164
165         * Shared/WebPreferencesDefinitions.h:
166         * UIProcess/API/C/WKPreferences.cpp:
167         (WKPreferencesSetFrameFlatteningEnabled):
168         (WKPreferencesGetFrameFlatteningEnabled):
169         * UIProcess/API/glib/WebKitSettings.cpp:
170         (webkit_settings_get_enable_frame_flattening):
171         (webkit_settings_set_enable_frame_flattening):
172         * WebProcess/InjectedBundle/InjectedBundle.cpp:
173         (WebKit::InjectedBundle::setFrameFlatteningEnabled):
174         
175             Update for naming changes of FrameFlattening now that it is an enum class.
176
177         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
178         (WebKit::WebChromeClient::contentsSizeChanged const):
179
180             Ge the effectiveFrameFlattening from the FrameView, rather than the Settings.
181
182 2017-10-16  Chris Dumez  <cdumez@apple.com>
183
184         [WK2][NetworkSession] Add support for resuming downloads
185         https://bugs.webkit.org/show_bug.cgi?id=177625
186         <rdar://problem/34345975>
187
188         Reviewed by Alex Christensen.
189
190         Add support for resuming downloads for the WK2 NETWORK_SESSION code path.
191
192         This was tested manually. I was unable to write an API test because our tests
193         do not run an HTTP server and CFNetwork does not seem to generate resume data
194         when cancelling a download over non-HTTP.
195
196         * NetworkProcess/Downloads/Download.cpp:
197         (WebKit::Download::didReceiveChallenge):
198         (WebKit::Download::continueCanAuthenticateAgainstProtectionSpace):
199         * NetworkProcess/Downloads/Download.h:
200         * NetworkProcess/Downloads/DownloadManager.cpp:
201         (WebKit::DownloadManager::continueCanAuthenticateAgainstProtectionSpace):
202         (WebKit::DownloadManager::resumeDownload):
203         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
204         (WebKit::Download::resume):
205         This currently includes a workaround for <rdar://problem/34745171>. We update the
206         resume data to include the NSURLSessionResumeInfoLocalPath key with the final
207         destination path so that CFNetwork looks for the temporary data at the right
208         location.
209
210         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
211         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
212         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
213         (WebKit::NetworkSessionCocoa::downloadTaskWithResumeData):
214         * Shared/Authentication/AuthenticationManager.cpp:
215         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
216         * Shared/Authentication/AuthenticationManager.h:
217
218 2017-10-16  Adrian Perez de Castro  <aperez@igalia.com>
219
220         [WPE] Build failure due to invalid cast of EGLNativeWindowType when targetting 64-bit ARM
221         https://bugs.webkit.org/show_bug.cgi?id=178090
222
223         Reviewed by Michael Catanzaro.
224
225         EGLNativeWindowType can be aliased to a different type depending (at least) on the EGL
226         implementation, its build options, and the libepoxy build options.  Using "static_cast"
227         works when it is a numeric value and the width of the value needs to be optionally
228         extended to 64 bits (e.g. the EGL type is "int" in a 32-bit CPU) but not for pointers,
229         and using "reinterpret_cast" works when the size of a pointer is 64 bits but not in other
230         cases. Therefore it seems reasonable to use a plain C cast expression to solve this
231         particular situation.
232
233         * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp:
234         (WebKit::AcceleratedSurfaceWPE::window const): Use a good old plain C cast expression.
235
236 2017-10-16  Chris Dumez  <cdumez@apple.com>
237
238         Clicks on Link with download attribute causes all (other) links to trigger download when clicked
239         https://bugs.webkit.org/show_bug.cgi?id=178267
240         <rdar://problem/34985016>
241
242         Reviewed by Darin Adler.
243
244         When clicking on an anchor with the download attribute, the m_syncNavigationActionHasDownloadAttribute
245         flag on WebPageProxy would get set. This flag would not get reset right away and instead, it would get
246         updated during the next call to WebPageProxy::decidePolicyForNavigationAction(). The issue is that if
247         you later click on a link with target="_blank", WebPageProxy::decidePolicyForNewWindowAction() gets
248         called instead of WebPageProxy::decidePolicyForNavigationAction() and we do not reset the
249         m_syncNavigationActionHasDownloadAttribute flag and we force a download.
250
251         To address the problem, I got rid of this flag on WebPageProxy and it is error-prone and should really
252         not be at page-level. Instead, I added a shouldForceDownload flag on the navigation object. It makes
253         more sense to associate the flag with the navigation and makes it less error-prone.
254
255         * UIProcess/API/APINavigation.h:
256         (API::Navigation::setShouldForceDownload):
257         (API::Navigation::shouldForceDownload const):
258         * UIProcess/WebPageProxy.cpp:
259         (WebKit::WebPageProxy::receivedPolicyDecision):
260         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
261         * UIProcess/WebPageProxy.h:
262
263 2017-10-16  Ryan Haddad  <ryanhaddad@apple.com>
264
265         Unreviewed, rolling out r223271.
266
267         This change introduced LayoutTest failures on WK1.
268
269         Reverted changeset:
270
271         "Use asynchronous ResourceHandleClient calls for WebKit1"
272         https://bugs.webkit.org/show_bug.cgi?id=160677
273         https://trac.webkit.org/changeset/223271
274
275 2017-10-13  Youenn Fablet  <youenn@apple.com>
276
277         Implement listing origins for which CacheStorage is storing data
278         https://bugs.webkit.org/show_bug.cgi?id=178236
279
280         Reviewed by Chris Dumez.
281
282         Cache storage is split on per-origin folders which name is obfuscated through salting.
283         To retrieve the origin for each folder, an origin file is now stored within each folder.
284         This file contains the actual origin.
285
286         Adding support to get the list of origin by iterating through each folder and
287         getting the actual origin by reading the content of the 'origin' file.
288
289         Adding C API for WebKitTestRunner.
290
291         * NetworkProcess/cache/CacheStorageEngine.cpp:
292         (WebKit::CacheStorage::Engine::fetchEntries):
293         (WebKit::CacheStorage::ReadOriginsTaskCounter::create):
294         (WebKit::CacheStorage::ReadOriginsTaskCounter::~ReadOriginsTaskCounter):
295         (WebKit::CacheStorage::ReadOriginsTaskCounter::addOrigin):
296         (WebKit::CacheStorage::ReadOriginsTaskCounter::ReadOriginsTaskCounter):
297         * NetworkProcess/cache/CacheStorageEngine.h:
298         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
299         (WebKit::CacheStorage::cachesOriginFilename):
300         (WebKit::CacheStorage::Caches::retrieveOriginFromDirectory):
301         (WebKit::CacheStorage::Caches::Caches):
302         (WebKit::CacheStorage::Caches::storeOrigin):
303         (WebKit::CacheStorage::Caches::readOrigin):
304         (WebKit::CacheStorage::Caches::initialize):
305         * NetworkProcess/cache/CacheStorageEngineCaches.h:
306         (WebKit::CacheStorage::Caches::origin const):
307         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
308         (WKWebsiteDataStoreGetFetchCacheOrigins):
309         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
310
311 2017-10-13  Alex Christensen  <achristensen@webkit.org>
312
313         Fix API tests after r223269.
314         https://bugs.webkit.org/show_bug.cgi?id=178246
315
316         * UIProcess/API/APIContentRuleListStore.cpp:
317         (API::ContentRuleListStore::getContentRuleListSource):
318         Version 10 also has the ability to recover content rule list source.
319
320 2017-10-11  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
321
322         [GLib] WebKitNavigationAction should tell whether it is a redirect
323         https://bugs.webkit.org/show_bug.cgi?id=178178
324
325         There is no good way to know whether a given navigation action has been caused
326         by a redirect through the glib API. This is necessary to implement some app mode
327         heuristics for Epiphany.
328
329         Reviewed by Carlos Garcia Campos.
330
331         * UIProcess/API/glib/WebKitNavigationAction.cpp:
332         (webkit_navigation_action_is_redirect): returns whether the navigation action is a redirect.
333         * UIProcess/API/glib/WebKitNavigationActionPrivate.h: add isRedirect to the wrapper object.
334         (_WebKitNavigationAction::_WebKitNavigationAction):
335         * UIProcess/API/gtk/WebKitNavigationAction.h: add the new API.
336         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: ditto.
337         * UIProcess/API/wpe/WebKitNavigationAction.h: ditto.
338
339 2017-10-12  Brady Eidson  <beidson@apple.com>
340
341         SW "Hello world".
342         https://bugs.webkit.org/show_bug.cgi?id=178187
343
344         Reviewed by Andy Estes.
345
346         * WebProcess/WebProcess.cpp:
347         (WebKit::WebProcess::startServiceWorkerContext):
348
349 2017-10-12  Alex Christensen  <achristensen@webkit.org>
350
351         Remove unnecessary includes in WebKit
352         https://bugs.webkit.org/show_bug.cgi?id=178235
353
354         Reviewed by Tim Horton.
355
356         * Platform/IPC/ArgumentCoders.h:
357         * WebProcess/WebProcess.cpp:
358         * WebProcess/WebStorage/StorageAreaImpl.h:
359
360 2017-10-12  Alex Christensen  <achristensen@webkit.org>
361
362         Increment ContentRuleListStore::CurrentContentRuleListFileVersion
363         https://bugs.webkit.org/show_bug.cgi?id=178246
364         <rdar://problem/34890057>
365
366         Reviewed by Tim Horton.
367
368         * UIProcess/API/APIContentRuleListStore.h:
369         Things are crashing.  Something isn't binary reverse compatible.
370         Probably something related to r222602.
371         This is why we have a version number to update.
372
373 2017-10-12  Alex Christensen  <achristensen@webkit.org>
374
375         Expose some of WKView's WebViewImpl accessors through WKWebViewPrivate
376         https://bugs.webkit.org/show_bug.cgi?id=178240
377         <rdar://problem/34962720>
378
379         Reviewed by Tim Horton.
380         
381         Also renamed createFullScreenWindow to fullScreenWindow to reflect the fact that it returns
382         an autoreleased NSWindow so we don't make the same naming mistake in the WKWebView SPI.
383
384         * UIProcess/API/Cocoa/WKWebView.mm:
385         (-[WKWebView _dismissContentRelativeChildWindows]):
386         (-[WKWebView _setFrame:andScrollBy:]):
387         (-[WKWebView _setTotalHeightOfBanners:]):
388         (-[WKWebView _totalHeightOfBanners]):
389         (-[WKWebView _beginDeferringViewInWindowChanges]):
390         (-[WKWebView _endDeferringViewInWindowChanges]):
391         (-[WKWebView _endDeferringViewInWindowChangesSync]):
392         (-[WKWebView _gestureEventWasNotHandledByWebCore:]):
393         (-[WKWebView _setIgnoresNonWheelEvents:]):
394         (-[WKWebView _ignoresNonWheelEvents]):
395         (-[WKWebView _setCustomSwipeViews:]):
396         (-[WKWebView _setCustomSwipeViewsTopContentInset:]):
397         (-[WKWebView _tryToSwipeWithEvent:ignoringPinnedState:]):
398         (-[WKWebView _setDidMoveSwipeSnapshotCallback:]):
399         (-[WKWebView _fullScreenPlaceholderView]):
400         (-[WKWebView _fullScreenWindow]):
401         (-[WKWebView _disableFrameSizeUpdates]):
402         (-[WKWebView _enableFrameSizeUpdates]):
403         (-[WKWebView _canChangeFrameLayout:]):
404         (-[WKWebView _underlayColor]):
405         (-[WKWebView _setUnderlayColor:]):
406         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
407         * UIProcess/API/mac/WKView.mm:
408         (-[WKView createFullScreenWindow]):
409         * UIProcess/Cocoa/WebViewImpl.h:
410         * UIProcess/Cocoa/WebViewImpl.mm:
411         (WebKit::WebViewImpl::fullScreenWindowController):
412         (WebKit::WebViewImpl::fullScreenWindow):
413         (WebKit::WebViewImpl::createFullScreenWindow): Deleted.
414
415 2017-10-12  Youenn Fablet  <youenn@apple.com>
416
417         Layout Test http/tests/cache-storage/cache-clearing.https.html is failing
418         https://bugs.webkit.org/show_bug.cgi?id=178200
419
420         Reviewed by Chris Dumez.
421
422         Deleting only the per-origin folders inside the CacheStorage engine root folder.
423
424         * NetworkProcess/cache/CacheStorageEngine.cpp:
425         (WebKit::CacheStorage::Engine::clearAllCaches):
426         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
427         (WKWebsiteDataStoreRemoveAllFetchCaches):
428         (WKWebsiteDataStoreRemoveFetchCacheForOrigin):
429         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
430
431 2017-10-12  Chris Dumez  <cdumez@apple.com>
432
433         [Mac] Add support for MouseEvent.buttons
434         https://bugs.webkit.org/show_bug.cgi?id=178214
435
436         Reviewed by Ryosuke Niwa.
437
438         * Shared/WebEvent.h:
439         (WebKit::WebMouseEvent::buttons const):
440         * Shared/WebEventConversion.cpp:
441         (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
442         * Shared/WebMouseEvent.cpp:
443         (WebKit::WebMouseEvent::WebMouseEvent):
444         (WebKit::WebMouseEvent::encode const):
445         (WebKit::WebMouseEvent::decode):
446         * Shared/mac/WebEventFactory.mm:
447         (WebKit::currentlyPressedMouseButtons):
448         (WebKit::WebEventFactory::createWebMouseEvent):
449         * WebProcess/Plugins/PDF/PDFPlugin.mm:
450         (WebKit::PDFPlugin::showContextMenuAtPoint):
451         * WebProcess/Plugins/PluginView.cpp:
452         (WebKit::PluginView::createWebEvent const):
453         * WebProcess/WebPage/WebPage.cpp:
454         (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick):
455         (WebKit::WebPage::simulateMouseDown):
456         (WebKit::WebPage::simulateMouseUp):
457         (WebKit::WebPage::simulateMouseMotion):
458
459 2017-10-12  Youenn Fablet  <youenn@apple.com>
460
461         Add API to clean CacheStorage data
462         https://bugs.webkit.org/show_bug.cgi?id=178034
463
464         Unreviewed.
465
466         * Shared/WebsiteData/WebsiteDataType.h: fixing the DOMCache value. 
467
468 2017-10-12  Stephan Szabo  <stephan.szabo@sony.com>
469
470         [WinCairo] add WebProcess files for wincairo webkit
471         https://bugs.webkit.org/show_bug.cgi?id=178024
472
473         Reviewed by Alex Christensen.
474
475         * PlatformWin.cmake:
476         * WebProcess/Cookies/curl/WebCookieManagerCurl.cpp: Added.
477         (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
478         (WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy):
479         * WebProcess/InjectedBundle/win/InjectedBundleWin.cpp: Added.
480         (WebKit::InjectedBundle::initialize):
481         (WebKit::InjectedBundle::setBundleParameter):
482         (WebKit::InjectedBundle::setBundleParameters):
483         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
484         * WebProcess/Plugins/Netscape/win/PluginProxyWin.cpp: Added.
485         (WebKit::PluginProxy::needsBackingStore const):
486         * WebProcess/WebCoreSupport/win/WebContextMenuClientWin.cpp: Added.
487         (WebKit::WebContextMenuClient::lookUpInDictionary):
488         (WebKit::WebContextMenuClient::isSpeaking):
489         (WebKit::WebContextMenuClient::speak):
490         (WebKit::WebContextMenuClient::stopSpeaking):
491         * WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.cpp: Added.
492         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession):
493         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
494         (WebKit::WebFrameNetworkingContext::WebFrameNetworkingContext):
495         (WebKit::WebFrameNetworkingContext::storageSession const):
496         (WebKit::WebFrameNetworkingContext::webFrameLoaderClient const):
497         (WebKit::WebFrameNetworkingContext::blockedError const):
498         * WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.h: Added.
499         (WebKit::WebFrameNetworkingContext::create):
500         * WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp: Added.
501         (WebKit::WebPopupMenu::setUpPlatformData):
502         * WebProcess/WebPage/win/WebInspectorUIWin.cpp: Added.
503         (WebKit::WebInspectorUI::canSave):
504         (WebKit::WebInspectorUI::localizedStringsURL):
505         (WebKit::RemoteWebInspectorUI::localizedStringsURL):
506         * WebProcess/WebPage/win/WebPageWin.cpp: Added.
507         (WebKit::WebPage::platformInitialize):
508         (WebKit::WebPage::platformDetach):
509         (WebKit::WebPage::platformEditorState const):
510         (WebKit::WebPage::platformPreferencesDidChange):
511         (WebKit::WebPage::performDefaultBehaviorForKeyEvent):
512         (WebKit::WebPage::platformHasLocalDataForURL):
513         (WebKit::WebPage::cachedResponseMIMETypeForURL):
514         (WebKit::WebPage::platformCanHandleRequest):
515         (WebKit::WebPage::cachedSuggestedFilenameForURL):
516         (WebKit::WebPage::cachedResponseDataForURL):
517         (WebKit::WebPage::platformUserAgent const):
518         (WebKit::WebPage::interpretKeyEvent):
519         * WebProcess/WebProcess.cpp:
520         (WebKit::WebProcess::ensureWebToStorageProcessConnection):
521         * WebProcess/win/WebProcessWin.cpp: Added.
522         (loadResourceIntoBuffer):
523         (WebKit::WebProcess::platformInitializeWebProcess):
524         (WebKit::WebProcess::platformTerminate):
525         (WebKit::WebProcess::platformSetCacheModel):
526
527 2017-10-12  David Kilzer  <ddkilzer@apple.com>
528
529         [iOS] Fix -Wunused-lambda-capture warnings in WebCore/WebKit with new clang compiler
530         <https://webkit.org/b/178226>
531
532         Reviewed by Chris Fleizach.
533
534         * UIProcess/ios/WKContentViewInteraction.mm:
535         (-[WKContentView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:withFlags:]):
536         - Remove unused lambda variable 'touch' which was also passed as
537           an argument.
538         (-[WKContentView changeSelectionWithTouchesFrom:to:withGesture:withState:]):
539         - Remove unused lambda variable 'gestureState' which was also
540           passed as an argument.
541         (-[WKContentView _simulateLongPressActionAtLocation:]):
542         - Remove unused lambda variable 'location'.
543
544 2017-10-12  John Wilander  <wilander@apple.com>
545
546         ResourceLoadObserver::logFrameNavigation() should use redirectResponse.url()
547         https://bugs.webkit.org/show_bug.cgi?id=175257
548         <rdar://problem/33359866>
549
550         Reviewed by Brent Fulgham.
551
552         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
553         (-[WKWebsiteDataStore _resourceLoadStatisticsIsRegisteredAsSubFrameUnder:topFrameHost:completionHandler:]):
554         (-[WKWebsiteDataStore _resourceLoadStatisticsIsRegisteredAsRedirectingTo:hostRedirectedTo:completionHandler:]):
555             Test infrastructure.
556         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
557         * UIProcess/WebResourceLoadStatisticsStore.cpp:
558         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder):
559         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo):
560             Test infrastructure.
561         * UIProcess/WebResourceLoadStatisticsStore.h:
562
563 2017-10-12  Andy Estes  <aestes@apple.com>
564
565         [iOS] Conditionally rename DatabaseProcess to StorageProcess when building for iOS devices
566         https://bugs.webkit.org/show_bug.cgi?id=178181
567         <rdar://problem/33660282>
568
569         Reviewed by Dan Bernstein.
570
571         * Configurations/BaseTarget.xcconfig:
572         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
573         (WebKit::serviceName):
574         * WebKit.xcodeproj/project.pbxproj:
575
576 2017-10-12  Youenn Fablet  <youenn@apple.com>
577
578         CacheStorage persistent folder should be in /Library/Cache
579         https://bugs.webkit.org/show_bug.cgi?id=178193
580
581         Reviewed by Brady Eidson.
582
583         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
584         (API::WebsiteDataStore::defaultCacheStorageDirectory): Making CacheStorage
585         directory a subfolder of Caches folder.
586         (API::WebsiteDataStore::defaultDataStoreConfiguration):
587         * UIProcess/WebProcessPool.cpp:
588         (WebKit::legacyWebsiteDataStoreConfiguration):
589         (WebKit::WebProcessPool::ensureNetworkProcess): Make sure the web site data store
590         has the right cache directory path. Also make sure that the quota is set even if there is no folder specified.
591         Quota may still be useful in case of non persistent sessions.
592         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
593         (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
594         * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
595         (API::WebsiteDataStore::defaultCacheStorageDirectory):
596
597 2017-10-11  Sam Weinig  <sam@webkit.org>
598
599         Remove out-parameter variants of copyToVector
600         https://bugs.webkit.org/show_bug.cgi?id=178155
601
602         Reviewed by Tim Horton.
603
604         * Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
605         (-[_WKRemoteObjectInterface debugDescription]):
606         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
607         (WebKit::dump):
608         * UIProcess/WebPageProxy.cpp:
609         (WebKit::WebPageProxy::resetState):
610         * UIProcess/WebProcessPool.cpp:
611         (WebKit::WebProcessPool::createNewWebProcess):
612         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
613         (WebKit::WebsiteDataStore::parameters):
614         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
615         (WebKit::WebsiteDataStore::pendingCookies const):
616         * UIProcess/ios/ProcessAssertionIOS.mm:
617         (-[WKProcessAssertionBackgroundTaskManager _notifyClientsOfImminentSuspension]):
618         * WebProcess/Cookies/WebCookieManager.cpp:
619         (WebKit::WebCookieManager::getHostnamesWithCookies):
620         * WebProcess/Geolocation/WebGeolocationManager.cpp:
621         (WebKit::WebGeolocationManager::didChangePosition):
622         (WebKit::WebGeolocationManager::didFailToDeterminePosition):
623         * WebProcess/Network/WebLoaderStrategy.cpp:
624         (WebKit::WebLoaderStrategy::internallyFailedLoadTimerFired):
625
626             Replace out-parameter based copyToVector, with one that returns a Vector.
627
628 2017-10-11  Jaehun Lim  <ljaehun.lim@samsung.com>
629
630         Fix debug build
631
632         Unreviewed.
633
634         Add ENABLE(SERVICE_WORKER) guard.
635
636         * UIProcess/WebProcessPool.cpp:
637         (WebKit::WebProcessPool::createWebPage):
638
639 2017-10-11  Youenn Fablet  <youenn@apple.com>
640
641         Add API to clean CacheStorage data
642         https://bugs.webkit.org/show_bug.cgi?id=178034
643
644         Unreviewed.
645
646         * NetworkProcess/NetworkProcess.cpp:
647         (WebKit::NetworkProcess::fetchWebsiteData): Fixing lifetime of aggregator.
648
649 2017-10-11  Youenn Fablet  <youenn@apple.com>
650
651         Add API to clean CacheStorage data
652         https://bugs.webkit.org/show_bug.cgi?id=178034
653
654         Reviewed by Chris Dumez.
655
656         Introducing a new website data type for DOMCache.
657         Adding API to delete DOMCache for a given origin or for all origins.
658         This is added to WKWebsiteDataStore.
659
660         Cleaning a CacheStorage will remove all data in the Cache object but the object will stay live
661         for the duration of the NetworkProcess.
662         This allows ensuring that once a cache is cleaned, WebProcess will update to this new state.
663
664         Fetching of WebsiteData for DOMCache is not implemented yet since we do not keep a list of all origins for which we have data.
665
666         * NetworkProcess/NetworkProcess.cpp:
667         (WebKit::fetchDOMCacheEntries):
668         (WebKit::NetworkProcess::fetchWebsiteData):
669         (WebKit::NetworkProcess::deleteWebsiteData):
670         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
671         * NetworkProcess/cache/CacheStorageEngine.cpp:
672         (WebKit::CacheStorage::Engine::cachesRootPath):
673         (WebKit::CacheStorage::Engine::fetchEntries):
674         (WebKit::CacheStorage::ClearTasksHandler::ClearTasksHandler):
675         (WebKit::CacheStorage::ClearTasksHandler::~ClearTasksHandler):
676         (WebKit::CacheStorage::Engine::clearEngines):
677         (WebKit::CacheStorage::Engine::clearCachesForOrigins):
678         (WebKit::CacheStorage::Engine::readCachesFromDisk):
679         (WebKit::CacheStorage::deleteFolder):
680         (WebKit::CacheStorage::Engine::clearCaches):
681         (WebKit::CacheStorage::Engine::unlock): Removing the assertion as Cache objects are removed when clearing data.
682         * NetworkProcess/cache/CacheStorageEngine.h:
683         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
684         (WebKit::CacheStorage::Caches::Caches):
685         (WebKit::CacheStorage::Caches::clear):
686         * NetworkProcess/cache/CacheStorageEngineCaches.h:
687         (WebKit::CacheStorage::Caches::create):
688         * Shared/WebsiteData/WebsiteDataType.h:
689         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
690         (WKWebsiteDataStoreRemoveAllDOMCaches):
691         (WKWebsiteDataStoreRemoveDOMCacheForOrigin):
692         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
693         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
694         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
695         (dataTypesToString):
696         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
697         (WebKit::toWebsiteDataType):
698         (WebKit::toWKWebsiteDataTypes):
699         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
700         (+[WKWebsiteDataStore allWebsiteDataTypes]):
701         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
702         (WebKit::computeNetworkProcessAccessTypeForDataFetch):
703         (WebKit::computeNetworkProcessAccessTypeForDataRemoval):
704
705 2017-10-11  Chris Dumez  <cdumez@apple.com>
706
707         [Geolocation] Expose Coordinates.floorLevel
708         https://bugs.webkit.org/show_bug.cgi?id=178173
709         <rdar://problem/34918936>
710
711         Reviewed by Ryosuke Niwa.
712
713         * UIProcess/API/C/WKGeolocationPosition.cpp:
714         (WKGeolocationPositionCreate):
715         (WKGeolocationPositionCreate_b):
716         (WKGeolocationPositionCreate_c):
717         * UIProcess/API/C/WKGeolocationPosition.h:
718
719 2017-10-11  Youenn Fablet  <youenn@apple.com>
720
721         Bump default cache storage quota to 20MB
722         https://bugs.webkit.org/show_bug.cgi?id=178132
723
724         Reviewed by Alex Christensen.
725
726         Adding the ability to set the quota per origin through WebsiteDataStore.
727         Moving cache storage directory setting also in WebsiteDataStore.
728
729         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
730         (WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession):
731         * NetworkProcess/NetworkProcess.cpp:
732         (WebKit::NetworkProcess::initializeNetworkProcess):
733         * NetworkProcess/mac/RemoteNetworkingContext.mm:
734         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
735         * Shared/WebsiteDataStoreParameters.cpp:
736         (WebKit::WebsiteDataStoreParameters::encode const):
737         (WebKit::WebsiteDataStoreParameters::decode):
738         * Shared/WebsiteDataStoreParameters.h:
739         * UIProcess/API/APIProcessPoolConfiguration.cpp:
740         (API::ProcessPoolConfiguration::createWithLegacyOptions):
741         (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
742         (API::ProcessPoolConfiguration::ProcessPoolConfiguration):
743         (API::ProcessPoolConfiguration::copy):
744         * UIProcess/API/APIProcessPoolConfiguration.h:
745         * UIProcess/API/C/WKContextConfigurationRef.cpp:
746         * UIProcess/API/C/WKContextConfigurationRef.h:
747         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
748         (-[WKWebsiteDataStore _cacheStoragePerOriginQuota]):
749         (-[WKWebsiteDataStore _setCacheStoragePerOriginQuota:]):
750         (-[WKWebsiteDataStore _cacheStorageDirectory]):
751         (-[WKWebsiteDataStore _setCacheStorageDirectory:]):
752         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
753         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
754         * UIProcess/WebProcessPool.cpp:
755         (WebKit::legacyWebsiteDataStoreConfiguration):
756         (WebKit::WebProcessPool::ensureNetworkProcess):
757         (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
758         * UIProcess/WebProcessPool.h:
759         * UIProcess/WebsiteData/WebsiteDataStore.h:
760         (WebKit::WebsiteDataStore::cacheStoragePerOriginQuota const):
761         (WebKit::WebsiteDataStore::setCacheStoragePerOriginQuota):
762         (WebKit::WebsiteDataStore::cacheStorageDirectory const):
763         (WebKit::WebsiteDataStore::setCacheStorageDirectory):
764
765 2017-10-11  Myles C. Maxfield  <mmaxfield@apple.com>
766
767         Allow PAL to log messages
768         https://bugs.webkit.org/show_bug.cgi?id=171523
769
770         Reviewed by Alex Christensen.
771
772         * Platform/Logging.h:
773         * Scripts/generate-forwarding-headers.pl:
774
775 2017-10-11  Ryosuke Niwa  <rniwa@webkit.org>
776
777         Sanitize URL in pasteboard for other applications and cross origin content
778         https://bugs.webkit.org/show_bug.cgi?id=178060
779         <rdar://problem/34874518>
780
781         Reviewed by Wenson Hsieh.
782
783         Plubmed the origin identifier through IPC from Pasteboard in WebContent process to PlatformPasteboard in UIProcess.
784
785         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
786         (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
787         * UIProcess/WebPasteboardProxy.cpp:
788         (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
789         * UIProcess/WebPasteboardProxy.h:
790         * UIProcess/WebPasteboardProxy.messages.in:
791         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
792         (WebKit::WebPlatformStrategies::typesSafeForDOMToReadAndWrite):
793         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
794
795 2017-10-11  Chris Dumez  <cdumez@apple.com>
796
797         Modernize Geolocation code
798         https://bugs.webkit.org/show_bug.cgi?id=178148
799
800         Reviewed by Ryosuke Niwa.
801
802         * Shared/WebGeolocationPosition.cpp:
803         (WebKit::WebGeolocationPosition::create):
804         (WebKit::WebGeolocationPosition::~WebGeolocationPosition):
805         * Shared/WebGeolocationPosition.h:
806         (WebKit::WebGeolocationPosition::timestamp const):
807         (WebKit::WebGeolocationPosition::latitude const):
808         (WebKit::WebGeolocationPosition::longitude const):
809         (WebKit::WebGeolocationPosition::accuracy const):
810         (WebKit::WebGeolocationPosition::altitude const):
811         (WebKit::WebGeolocationPosition::altitudeAccuracy const):
812         (WebKit::WebGeolocationPosition::heading const):
813         (WebKit::WebGeolocationPosition::speed const):
814         (WebKit::WebGeolocationPosition::corePosition const):
815         (WebKit::WebGeolocationPosition::WebGeolocationPosition):
816         * UIProcess/API/C/WKGeolocationPosition.cpp:
817         (WKGeolocationPositionCreate_b):
818         * UIProcess/API/Cocoa/_WKGeolocationPosition.mm:
819         (WebKit::wrapper):
820         * UIProcess/API/glib/WebKitGeolocationProvider.cpp:
821         (WebKit::WebKitGeolocationProvider::notifyPositionChanged):
822         * UIProcess/WebGeolocationManagerProxy.cpp:
823         (WebKit::WebGeolocationManagerProxy::providerDidChangePosition):
824         * UIProcess/ios/WKGeolocationProviderIOS.mm:
825         (-[WKLegacyCoreLocationProvider positionChanged:]):
826         * WebProcess/Geolocation/WebGeolocationManager.cpp:
827         (WebKit::WebGeolocationManager::didChangePosition):
828         * WebProcess/Geolocation/WebGeolocationManager.h:
829         * WebProcess/Geolocation/WebGeolocationManager.messages.in:
830         * WebProcess/WebCoreSupport/WebGeolocationClient.cpp:
831         (WebKit::WebGeolocationClient::lastPosition):
832         * WebProcess/WebCoreSupport/WebGeolocationClient.h:
833
834 2017-10-11  Brady Eidson  <beidson@apple.com>
835
836         Add a SW context process (where SW scripts will actually execute).
837         https://bugs.webkit.org/show_bug.cgi?id=178156
838
839         Reviewed by Andy Estes.
840
841         This patch adds an auxiliary "ServiceWorker context" WebProcess to a WebProcessPool.
842
843         This process is where ServiceWorker scripts will execute, separate from the client WebProcess
844         hosting the page(s) they are serving.
845
846         This patch also adds all of the plumbing to pass along a fetched service worker script to this
847         context WebProcess, as well as message back failure to actually start the script so we can test.
848
849         Touches lots of code sites but is basically just a lot of plumbing.
850
851         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
852         (WebKit::WebSWServerConnection::WebSWServerConnection):
853         (WebKit::WebSWServerConnection::startServiceWorkerContext):
854         (WebKit::WebSWServerConnection::sendToContextProcess):
855         (WebKit::WebSWServerConnection::setContextConnection):
856         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
857
858         * StorageProcess/StorageProcess.cpp:
859         (WebKit::StorageProcess::workerContextProcessConnection):
860         (WebKit::StorageProcess::createWorkerContextProcessConnection):
861         (WebKit::StorageProcess::didGetWorkerContextProcessConnection):
862         (WebKit::StorageProcess::serviceWorkerContextFailedToStart):
863         (WebKit::StorageProcess::registerSWServerConnection):
864         (WebKit::StorageProcess::unregisterSWServerConnection):
865         * StorageProcess/StorageProcess.h:
866         * StorageProcess/StorageProcess.messages.in:
867
868         * StorageProcess/StorageToWebProcessConnection.cpp:
869         (WebKit::StorageToWebProcessConnection::~StorageToWebProcessConnection):
870         (WebKit::StorageToWebProcessConnection::establishSWServerConnection):
871         (WebKit::StorageToWebProcessConnection::removeSWServerConnection):
872         (WebKit::StorageToWebProcessConnection::workerContextProcessConnectionCreated):
873         * StorageProcess/StorageToWebProcessConnection.h:
874
875         * UIProcess/Storage/StorageProcessProxy.cpp:
876         (WebKit::StorageProcessProxy::create):
877         (WebKit::StorageProcessProxy::StorageProcessProxy):
878         (WebKit::StorageProcessProxy::didClose):
879         (WebKit::StorageProcessProxy::getWorkerContextProcessConnection):
880         (WebKit::StorageProcessProxy::didGetWorkerContextProcessConnection):
881         * UIProcess/Storage/StorageProcessProxy.h:
882         * UIProcess/Storage/StorageProcessProxy.messages.in:
883
884         * UIProcess/WebProcessPool.cpp:
885         (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
886         (WebKit::WebProcessPool::getWorkerContextProcessConnection):
887         (WebKit::WebProcessPool::didGetWorkerContextProcessConnection):
888         (WebKit::WebProcessPool::disconnectProcess):
889         (WebKit::WebProcessPool::createWebPage):
890         * UIProcess/WebProcessPool.h:
891
892         * UIProcess/WebProcessProxy.cpp:
893         (WebKit::WebProcessProxy::didGetWorkerContextConnection):
894         * UIProcess/WebProcessProxy.h:
895         * UIProcess/WebProcessProxy.messages.in:
896
897         * WebProcess/WebProcess.cpp:
898         (WebKit::WebProcess::getWorkerContextConnection):
899         (WebKit::WebProcess::startServiceWorkerContext):
900         * WebProcess/WebProcess.h:
901         * WebProcess/WebProcess.messages.in:
902
903 2017-10-11  Don Olmstead  <don.olmstead@sony.com>
904
905         Remove ENABLE_NETWORK_CACHE
906         https://bugs.webkit.org/show_bug.cgi?id=177424
907
908         Reviewed by Antti Koivisto.
909
910         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
911         (WebKit::NetworkConnectionToWebProcess::storeDerivedDataToCache):
912         * NetworkProcess/NetworkConnectionToWebProcess.h:
913         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
914         * NetworkProcess/NetworkProcess.cpp:
915         (WebKit::fetchDiskCacheEntries):
916         (WebKit::clearDiskCacheEntries):
917         (WebKit::NetworkProcess::setCacheModel):
918         * NetworkProcess/NetworkProcess.h:
919         (WebKit::NetworkProcess::cache):
920         * NetworkProcess/NetworkProcessCreationParameters.cpp:
921         (WebKit::NetworkProcessCreationParameters::encode const):
922         (WebKit::NetworkProcessCreationParameters::decode):
923         * NetworkProcess/NetworkProcessCreationParameters.h:
924         * NetworkProcess/NetworkResourceLoader.cpp:
925         (WebKit::NetworkResourceLoader::NetworkResourceLoader):
926         (WebKit::NetworkResourceLoader::canUseCachedRedirect const):
927         (WebKit::NetworkResourceLoader::start):
928         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
929         (WebKit::NetworkResourceLoader::startNetworkLoad):
930         (WebKit::NetworkResourceLoader::abort):
931         (WebKit::NetworkResourceLoader::didReceiveResponse):
932         (WebKit::NetworkResourceLoader::didReceiveBuffer):
933         (WebKit::NetworkResourceLoader::didFinishLoading):
934         (WebKit::NetworkResourceLoader::didFailLoading):
935         (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
936         (WebKit::NetworkResourceLoader::continueWillSendRequest):
937         (WebKit::NetworkResourceLoader::dispatchWillSendRequestForCacheEntry):
938         * NetworkProcess/NetworkResourceLoader.h:
939         * NetworkProcess/cache/NetworkCache.cpp:
940         * NetworkProcess/cache/NetworkCache.h:
941         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
942         * NetworkProcess/cache/NetworkCacheBlobStorage.h:
943         * NetworkProcess/cache/NetworkCacheCoders.cpp:
944         * NetworkProcess/cache/NetworkCacheCoders.h:
945         * NetworkProcess/cache/NetworkCacheCodersCocoa.cpp:
946         * NetworkProcess/cache/NetworkCacheCodersSoup.cpp:
947         * NetworkProcess/cache/NetworkCacheData.cpp:
948         * NetworkProcess/cache/NetworkCacheData.h:
949         * NetworkProcess/cache/NetworkCacheDataCocoa.mm:
950         * NetworkProcess/cache/NetworkCacheDataSoup.cpp:
951         * NetworkProcess/cache/NetworkCacheEntry.cpp:
952         * NetworkProcess/cache/NetworkCacheEntry.h:
953         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
954         * NetworkProcess/cache/NetworkCacheFileSystem.h:
955         * NetworkProcess/cache/NetworkCacheIOChannel.h:
956         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
957         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
958         * NetworkProcess/cache/NetworkCacheKey.cpp:
959         * NetworkProcess/cache/NetworkCacheKey.h:
960         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
961         * NetworkProcess/cache/NetworkCacheStatistics.h:
962         * NetworkProcess/cache/NetworkCacheStorage.cpp:
963         * NetworkProcess/cache/NetworkCacheStorage.h:
964         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
965         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
966         (WebKit::NetworkProcess::clearDiskCache):
967         * NetworkProcess/ios/NetworkProcessIOS.mm:
968         (WebKit::NetworkProcess::clearCacheForAllOrigins):
969         * NetworkProcess/soup/NetworkProcessSoup.cpp:
970         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
971         (WebKit::NetworkProcess::clearDiskCache):
972         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
973         (WebKit::registerUserDefaultsIfNeeded):
974         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
975         (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
976         (WebKit::WebProcessPool::isNetworkCacheEnabled):
977         * UIProcess/soup/WebProcessPoolSoup.cpp:
978         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
979         * WebProcess/Network/WebLoaderStrategy.cpp:
980         (WebKit::WebLoaderStrategy::storeDerivedDataToCache):
981         * config.h:
982
983 2017-10-11  Michael Catanzaro  <mcatanzaro@igalia.com>
984
985         Unreviewed, rolling out r223146.
986
987         Better to not expose cairo in the WPE API
988
989         Reverted changeset:
990
991         "[WPE] Header cairo.h is used in GLib API headers but cannot
992         be found"
993         https://bugs.webkit.org/show_bug.cgi?id=178100
994         http://trac.webkit.org/changeset/223146
995
996 2017-09-27  Frederic Wang  <fwang@igalia.com>
997
998         [iOS] Do not flatten frames when async frame scrolling is enabled
999         https://bugs.webkit.org/show_bug.cgi?id=173704
1000
1001         Reviewed by Simon Fraser.
1002
1003         This patch disables frame flattening when async frame scrolling is enabled on iOS, as
1004         otherwise you can not scroll them. Once iframe scrolling is implemented in iOS (bug 149264),
1005         developers and beta testers will be able to check it by enabling "Async Frame Scrolling"
1006         in the "Experimental WebKit Features" menu of Safari iOS.
1007
1008         Test: platform/ios/fast/frames/flattening/iframe-flattening-with-async-frame-scrolling.html
1009
1010         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1011         (WebKit::WebChromeClient::contentsSizeChanged): Use effectiveFrameFlattening() introduced in
1012         Source/WebCore.
1013
1014 2017-10-10  Ryosuke Niwa  <rniwa@webkit.org>
1015
1016         Enable custom pasteboard data in DumpRenderTree and WebKitTestRunner
1017         https://bugs.webkit.org/show_bug.cgi?id=178154
1018
1019         Reviewed by Wenson Hsieh.
1020
1021         Plumbed customPasteboardDataEnabled flag to be used in WebKitTestRunner.
1022
1023         * Shared/WebPreferencesDefinitions.h:
1024         * UIProcess/API/C/WKPreferences.cpp:
1025         (WKPreferencesSetCustomPasteboardDataEnabled):
1026         (WKPreferencesGetCustomPasteboardDataEnabled):
1027         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1028         * WebProcess/WebPage/WebPage.cpp:
1029         (WebKit::WebPage::updatePreferences):
1030
1031 2017-10-10  Adrian Perez de Castro  <aperez@igalia.com>
1032
1033         [WPE] Remove the possibility of installing the old WebKit2 C API
1034         https://bugs.webkit.org/show_bug.cgi?id=178125
1035
1036         Reviewed by Michael Catanzaro.
1037
1038         * PlatformWPE.cmake: Remove support for installing the deprecated C API.
1039
1040 2017-10-10  Chris Dumez  <cdumez@apple.com>
1041
1042         [WK2] Add API to clear service worker registrations
1043         https://bugs.webkit.org/show_bug.cgi?id=178085
1044         <rdar://problem/34866025>
1045
1046         Reviewed by Ryosuke Niwa.
1047
1048         Add API to clear service worker registrations. Although the request to
1049         clear the registration is passed on to the StorageProcess, it is currently
1050         a no-op on StorageProcess side until we actually persist service worker
1051         registrations on disk.
1052
1053         * Shared/WebsiteData/WebsiteDataType.h:
1054         * StorageProcess/StorageProcess.cpp:
1055         (WebKit::StorageProcess::fetchWebsiteData):
1056         (WebKit::StorageProcess::deleteWebsiteData):
1057         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
1058         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1059         (WKWebsiteDataStoreRemoveAllServiceWorkerRegistrations):
1060         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
1061         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
1062         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
1063         (dataTypesToString):
1064         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
1065         (WebKit::toWebsiteDataType):
1066         (WebKit::toWKWebsiteDataTypes):
1067         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1068         (+[WKWebsiteDataStore allWebsiteDataTypes]):
1069         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1070         (WebKit::WebsiteDataStore::fetchDataAndApply):
1071         (WebKit::WebsiteDataStore::removeData):
1072
1073 2017-10-10  Commit Queue  <commit-queue@webkit.org>
1074
1075         Unreviewed, rolling out r223130.
1076         https://bugs.webkit.org/show_bug.cgi?id=178147
1077
1078         Breaks the build when EGLNativeWindowType is a pointer
1079         (Requested by aperezdc on #webkit).
1080
1081         Reverted changeset:
1082
1083         "[WPE] Build failure due to invalid cast of
1084         EGLNativeWindowType when targetting 64-bit ARM"
1085         https://bugs.webkit.org/show_bug.cgi?id=178090
1086         http://trac.webkit.org/changeset/223130
1087
1088 2017-10-10  Sam Weinig  <sam@webkit.org>
1089
1090         Replace copyKeysToVector/copyValuesToVector with copyToVector(map.keys())/copyToVector(map.values())
1091         https://bugs.webkit.org/show_bug.cgi?id=178102
1092
1093         Reviewed by Tim Horton.
1094
1095         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1096         (WebKit::NetworkConnectionToWebProcess::didClose):
1097         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
1098         (WebKit::dumpChangedLayers):
1099         * UIProcess/API/glib/WebKitWebContext.cpp:
1100         (webkitWebContextInvalidateCustomProtocolRequests):
1101         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1102         (webkitWebViewBaseContainerForall):
1103         * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
1104         (-[WKWebViewContentProviderRegistry _mimeTypesWithCustomContentProviders]):
1105         * UIProcess/GenericCallback.h:
1106         (WebKit::invalidateCallbackMap):
1107         * UIProcess/WebProcessProxy.cpp:
1108         (WebKit::WebProcessProxy::shutDown):
1109         (WebKit::WebProcessProxy::didClose):
1110         (WebKit::WebProcessProxy::didBecomeUnresponsive):
1111         (WebKit::WebProcessProxy::didBecomeResponsive):
1112         (WebKit::WebProcessProxy::willChangeIsResponsive):
1113         (WebKit::WebProcessProxy::didChangeIsResponsive):
1114         (WebKit::WebProcessProxy::disconnectFramesFromPage):
1115         (WebKit::WebProcessProxy::frameCountInPage const):
1116         (WebKit::WebProcessProxy::requestTermination):
1117         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
1118         (WebKit::NPRuntimeObjectMap::invalidate):
1119         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
1120         (WebKit::NetscapePlugin::stopAllStreams):
1121         * WebProcess/Plugins/PluginView.cpp:
1122         (WebKit::PluginView::cancelAllStreams):
1123         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
1124         (WebKit::RemoteLayerTreeContext::buildTransaction):
1125         * WebProcess/WebProcess.cpp:
1126         (WebKit::WebProcess::didClose):
1127
1128 2017-10-10  Adrian Perez de Castro  <aperez@igalia.com>
1129
1130         [WPE] Header cairo.h is used in GLib API headers but cannot be found
1131         https://bugs.webkit.org/show_bug.cgi?id=178100
1132
1133         Reviewed by Michael Catanzaro.
1134
1135         * wpe/wpe-webkit.pc.in: Add Cairo to the "Requires" field, so its flags get pulled
1136         in and the "cairo.h", used in the WPE WebKit GLib API headers, can be found.
1137
1138 2017-10-10  Michael Catanzaro  <mcatanzaro@igalia.com>
1139
1140         CSS constant properties should not be enabled by default
1141         https://bugs.webkit.org/show_bug.cgi?id=177416
1142
1143         Reviewed by Darin Adler.
1144
1145         * Shared/WebPreferencesDefinitions.h:
1146
1147 2017-10-10  Brady Eidson  <beidson@apple.com>
1148
1149         Random StorageProcess and SWServer cleanup.
1150         https://bugs.webkit.org/show_bug.cgi?id=178141
1151
1152         Reviewed by Andy Estes.
1153
1154         -StorageProcess should own the set of SWServers
1155         -Some renaming and cleanup
1156
1157         * StorageProcess/StorageProcess.cpp:
1158         (WebKit::StorageProcess::createStorageToWebProcessConnection):
1159         (WebKit::StorageProcess::swServerForSession):
1160         * StorageProcess/StorageProcess.h:
1161         (WebKit::StorageProcess::queue):
1162
1163         * StorageProcess/StorageToWebProcessConnection.cpp:
1164         (WebKit::StorageToWebProcessConnection::establishSWServerConnection):
1165         * StorageProcess/StorageToWebProcessConnection.h:
1166
1167 2017-10-10  Michael Catanzaro  <mcatanzaro@igalia.com>
1168
1169         Unreviewed, rolling out r223136.
1170
1171         Forgot to update GTK API header
1172
1173         Reverted changeset:
1174
1175         "[WPE] Header cairo.h is used in GLib API headers but cannot
1176         be found"
1177         https://bugs.webkit.org/show_bug.cgi?id=178100
1178         http://trac.webkit.org/changeset/223136
1179
1180 2017-10-10  Adrian Perez de Castro  <aperez@igalia.com>
1181
1182         [WPE] Header cairo.h is used in GLib API headers but cannot be found
1183         https://bugs.webkit.org/show_bug.cgi?id=178100
1184
1185         Reviewed by Žan Doberšek.
1186
1187         Instead of including <cairo.h>, it is better to forward-declare cairo_surface_t,
1188         which is the one and only Cairo declaration needed by the WPE API header.
1189
1190         * UIProcess/API/glib/WebKitFaviconDatabase.cpp: Add inclusion of <cairo.h>.
1191         * UIProcess/API/glib/WebKitWebView.cpp: Add inclusion of <cairo.h>.
1192         * UIProcess/API/wpe/WebKitFaviconDatabase.h: Add forward declaration of cairo_surface_t.
1193
1194 2017-10-10  Adrian Perez de Castro  <aperez@igalia.com>
1195
1196         [WPE] Cannot link against libWPEWebkit due to wrong contents of wpe-webkit.pc
1197         https://bugs.webkit.org/show_bug.cgi?id=178133
1198
1199         Reviewed by Žan Doberšek.
1200
1201         * wpe/wpe-webkit.pc.in: Remove "-lWPE" and replace "Requires.private" with a plain "Requires".
1202
1203 2017-10-10  Adrian Perez de Castro  <aperez@igalia.com>
1204
1205         [WPE] Build failure due to invalid cast of EGLNativeWindowType when targetting 64-bit ARM
1206         https://bugs.webkit.org/show_bug.cgi?id=178090
1207
1208         Reviewed by Žan Doberšek.
1209
1210         * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp:
1211         (WebKit::AcceleratedSurfaceWPE::window const): Use static_cast instead of reinterpret_cast,
1212         this way extending values of EGLNativeWindowType to 64 bits is allowed.
1213
1214 2017-10-10  Adrian Perez de Castro  <aperez@igalia.com>
1215
1216         [WPE] GLib API headers WebKitScriptDialog.h and WebKitFileChooserRequest.h are not installed
1217         https://bugs.webkit.org/show_bug.cgi?id=178104
1218
1219         Reviewed by Žan Doberšek.
1220
1221         * PlatformWPE.cmake: Add missing header paths to the WPE_API_INSTALLED_HEADERS variable.
1222
1223 2017-10-10  Adrian Perez de Castro  <aperez@igalia.com>
1224
1225         [WPE][CMake] The “install” target should install all public API headers
1226         https://bugs.webkit.org/show_bug.cgi?id=176475
1227
1228         Reviewed by Žan Doberšek.
1229
1230         Install the WPE port GLib-based API headers. The deprecated C API is still available,
1231         but disabled by default behind the "EXPORT_DEPRECATED_WEBKIT2_C_API" CMake option.
1232
1233         * PlatformWPE.cmake: Always install "wpe-webkit.pc" and the GLib C API for WPE.
1234
1235 2017-10-09  Jeremy Jones  <jeremyj@apple.com>
1236
1237         Fix typo of virtual keyword in PageClientImplIOS.h
1238         https://bugs.webkit.org/show_bug.cgi?id=178088
1239
1240         Reviewed by Simon Fraser.
1241
1242         This compile error happens when FULLSCREEN_API is enabled for iOS.
1243         Remove the redundant virtual keyword since function is marked override.
1244
1245         * UIProcess/ios/PageClientImplIOS.h:
1246
1247 2017-10-09  Chris Dumez  <cdumez@apple.com>
1248
1249         [iOS][WK2] Tiles outsides the viewport are sometimes missing after relaunching a crashes WebProcess
1250         https://bugs.webkit.org/show_bug.cgi?id=178095
1251         <rdar://problem/34415016>
1252
1253         Reviewed by Simon Fraser.
1254
1255         Make sure we reset WKWebView._hasScheduledVisibleRectUpdate to NO in WKWebView._processDidExit.
1256         _scheduleVisibleContentRectUpdateAfterScrollInView would otherwise return early because
1257         WKWebView._hasScheduledVisibleRectUpdate is always YES. Normally,
1258         _addUpdateVisibleContentRectPreCommitHandler sets a CATransaction commit handler that
1259         resets _hasScheduledVisibleRectUpdate to NO, but it does not do so when ![webView _isValid]
1260         (which is true when the WebProcess has crashed.
1261
1262         Also reset WKWebView._commitDidRestoreScrollPosition to NO in WKWebView._processDidExit even
1263         though it does not seem to be the cause of this bug. It seems to make sense to reset this member
1264         when the process crashes.
1265
1266         * UIProcess/API/Cocoa/WKWebView.mm:
1267         (-[WKWebView _processDidExit]):
1268
1269 2017-10-09  Youenn Fablet  <youenn@apple.com>
1270
1271         Add quota to cache API
1272         https://bugs.webkit.org/show_bug.cgi?id=177552
1273
1274         Reviewed by Alex Christensen.
1275
1276         Adding support for quota checking in CacheStorage::Caches.
1277         It is passed to NetworkProcess at creation time.
1278         Default quota size is configured to 400Ko by origin per default.
1279         This value is suitable for testing.
1280         Future patch should raise this default value and allows configuring it.
1281
1282         Quota is computed based on the response body size.
1283         This size is padded at WebCore for opaque responses.
1284         Size is stored persistently as opaque response padded size should remain stable.
1285         See https://github.com/whatwg/storage/issues/31 for the rationale about this padding.
1286
1287         In case of putting several records at the same time, the size of all records
1288         is computed so that all records will be written or rejected together.
1289
1290         Sending QuotaExceeded error when quota is exceeded.
1291         Future effort should allow asking UIProcess for quota extension.
1292
1293         * NetworkProcess/NetworkProcess.cpp:
1294         (WebKit::NetworkProcess::cacheStoragePerOriginQuota const):
1295         * NetworkProcess/NetworkProcess.h:
1296         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1297         (WebKit::NetworkProcessCreationParameters::encode const):
1298         (WebKit::NetworkProcessCreationParameters::decode):
1299         * NetworkProcess/NetworkProcessCreationParameters.h:
1300         * NetworkProcess/cache/CacheStorageEngine.cpp:
1301         (WebKit::CacheStorage::Engine::readCachesFromDisk):
1302         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
1303         (WebKit::CacheStorage::Cache::toRecordInformation):
1304         (WebKit::CacheStorage::isolatedCopy):
1305         (WebKit::CacheStorage::Cache::open):
1306         (WebKit::CacheStorage::Cache::storeRecords):
1307         (WebKit::CacheStorage::Cache::put):
1308         (WebKit::CacheStorage::Cache::writeRecordToDisk):
1309         (WebKit::CacheStorage::Cache::updateRecordToDisk):
1310         (WebKit::CacheStorage::Cache::removeRecordFromDisk):
1311         (WebKit::CacheStorage::Cache::encode):
1312         (WebKit::CacheStorage::Cache::decodeRecordHeader):
1313         (WebKit::CacheStorage::Cache::decode):
1314         * NetworkProcess/cache/CacheStorageEngineCache.h:
1315         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
1316         (WebKit::CacheStorage::Caches::Caches):
1317         (WebKit::CacheStorage::Caches::initialize):
1318         (WebKit::CacheStorage::Caches::initializeSize):
1319         (WebKit::CacheStorage::Caches::requestSpace):
1320         (WebKit::CacheStorage::Caches::writeRecord):
1321         (WebKit::CacheStorage::Caches::removeRecord):
1322         (WebKit::CacheStorage::Caches::removeCacheEntry):
1323         * NetworkProcess/cache/CacheStorageEngineCaches.h:
1324         (WebKit::CacheStorage::Caches::create):
1325         (WebKit::CacheStorage::Caches::hasEnoughSpace const):
1326         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1327         (WebKit::NetworkCache::Storage::traverse):
1328         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1329         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
1330         * Shared/WebCoreArgumentCoders.cpp:
1331         (IPC::ArgumentCoder<DOMCacheEngine::Record>::encode):
1332         (IPC::ArgumentCoder<DOMCacheEngine::Record>::decode):
1333         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1334         (API::ProcessPoolConfiguration::copy):
1335         * UIProcess/API/APIProcessPoolConfiguration.h:
1336         * UIProcess/WebProcessPool.cpp:
1337         (WebKit::WebProcessPool::ensureNetworkProcess):
1338
1339 2017-10-09  Sam Weinig  <sam@webkit.org>
1340
1341         Make HashMap::keys() and HashMap::values() work with WTF::map/WTF::copyToVector
1342         https://bugs.webkit.org/show_bug.cgi?id=178072
1343
1344         Reviewed by Darin Adler.
1345
1346         * Shared/AsyncRequest.h:
1347         (WebKit::AsyncRequestMap::values):
1348         * UIProcess/WebProcessProxy.h:
1349         (WebKit::WebProcessProxy::pages const):
1350
1351             Update for type change for HashMap::values().
1352
1353 2017-10-09  Jeremy Jones  <jeremyj@apple.com>
1354
1355         Incorrect fullscreen animation when element has a transform.
1356         https://bugs.webkit.org/show_bug.cgi?id=177558
1357         rdar://problem/29603741
1358
1359         Reviewed by Jer Noble.
1360
1361         Use a bit of code from element fullscreen to do this correctly for video fullscreen.
1362         The key is to get the absolute quad from the renderer. This will work for scaling,
1363         But since we still take the bounding box, it won't work for rotations.
1364
1365         * WebProcess/cocoa/VideoFullscreenManager.mm:
1366         (WebKit::inlineVideoFrame):
1367
1368 2017-10-09  Robin Morisset  <rmorisset@apple.com>
1369
1370         Make the names of the options consistent
1371         https://bugs.webkit.org/show_bug.cgi?id=177933
1372
1373         Reviewed by Saam Barati.
1374
1375         * NetworkProcess/capture/json.hpp:
1376         * Platform/IPC/Connection.cpp:
1377         (IPC::Connection::connectionDidClose):
1378         * UIProcess/API/Cocoa/WKWebView.mm:
1379         (-[WKWebView _keyboardWillHide:]):
1380         * UIProcess/WebPageProxy.cpp:
1381         (WebKit::WebPageProxy::runModal):
1382         * UIProcess/mac/WebInspectorProxyMac.mm:
1383         (WebKit::WebInspectorProxy::inspectedViewFrameDidChange):
1384         * WebProcess/WebPage/ios/WebPageIOS.mm:
1385         (WebKit::WebPage::selectWithGesture):
1386
1387 2017-10-09  Adrian Perez de Castro  <aperez@igalia.com>
1388
1389         [WPE][GTK] Propagate libepoxy compiler flags obtained from pkg-config
1390         https://bugs.webkit.org/show_bug.cgi?id=178081
1391
1392         Reviewed by Carlos Alberto Lopez Perez.
1393
1394         * CMakeLists.txt: Use ${LIBEPOXY_DEFINITIONS} for building WebKit.
1395
1396 2017-10-08  Tim Horton  <timothy_horton@apple.com>
1397
1398         mediaPlaybackRequiresUserAction API replacement annotation is wrong
1399         https://bugs.webkit.org/show_bug.cgi?id=178063
1400
1401         Reviewed by Dan Bernstein.
1402
1403         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
1404         mediaPlaybackRequiresUserAction suggests that you should use 
1405         requiresUserActionForMediaPlayback instead, but that is also deprecated.
1406         Instead, follow the chain and suggest mediaTypesRequiringUserActionForPlayback.
1407
1408 2017-10-06  Wenson Hsieh  <wenson_hsieh@apple.com>
1409
1410         [iOS WK2] API tests added in r222991 are failing in iOS 11 test runners
1411         https://bugs.webkit.org/show_bug.cgi?id=178037
1412
1413         Reviewed by Tim Horton.
1414
1415         This patch carries out some minor cleanup around UIKitSPI.h in WebKit2, so that the internal SDK isn't required
1416         to implement -[WKContentView insertTextSuggestion:].
1417
1418         * Platform/spi/ios/UIKitSPI.h:
1419         * UIProcess/ios/WKContentViewInteraction.mm:
1420         (-[WKContentView insertTextSuggestion:]):
1421
1422 2017-10-06  Chris Dumez  <cdumez@apple.com>
1423
1424         [Beacon][Cocoa] Beacon requests with BufferSource payload should not have a Content-Type HTTP header
1425         https://bugs.webkit.org/show_bug.cgi?id=178027
1426         <rdar://problem/34748470>
1427
1428         Reviewed by Youenn Fablet.
1429
1430         Use new NSURLSessionConfiguration._suppressedAutoAddedHTTPHeaders CFNetwork SPI to
1431         make sure that CFNetwork never adds a Content-Type HTTP headers to our requests
1432         when we did not add one.
1433
1434         This is covered by the following tests on newer OSes:
1435         - imported/w3c/web-platform-tests/beacon/headers/header-content-type.html
1436         - http/tests/blink/sendbeacon/beacon-same-origin.html
1437
1438         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1439         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
1440
1441 2017-10-06  Aishwarya Nirmal  <anirmal@apple.com>
1442
1443         [iOS] Respect the "caret-color" CSS property when editing 
1444         https://bugs.webkit.org/show_bug.cgi?id=177489
1445         <rdar://problem/34600419>
1446
1447         Reviewed by Tim Horton.
1448
1449         This change adds support for the caret-color property on iOS.
1450
1451         * Shared/EditorState.cpp:
1452         (WebKit::EditorState::PostLayoutData::encode const):
1453         (WebKit::EditorState::PostLayoutData::decode):
1454         * Shared/EditorState.h:
1455         * UIProcess/ios/WKContentViewInteraction.mm:
1456         (-[WKContentView insertionPointColor]):
1457         * WebProcess/WebPage/ios/WebPageIOS.mm:
1458         (WebKit::WebPage::platformEditorState const):
1459
1460 2017-10-06  Brian Burg  <bburg@apple.com>
1461
1462         Web Inspector: clicking in Inspector webview clears the selection in the inspected page
1463         https://bugs.webkit.org/show_bug.cgi?id=178014
1464         <rdar://problem/12706857>
1465
1466         Reviewed by Timothy Hatcher.
1467
1468         If the Inspector is docked to the inspected view, clicking on the Inspector
1469         webview will cause selection in the inspected view to be lost. This is because
1470         the selection is lost when the web view resigns first responder.
1471
1472         Add a check in maintainsInactiveSelection to always retain selection if
1473         Web Inspector is open. This approach seems simpler than trying to sync a client's
1474         usage of WKPageSetMaintainsInactiveSelection with overrides that need to be applied
1475         and unapplied when an inspector web view is shown or hidden.
1476
1477         * UIProcess/WebPageProxy.cpp:
1478         (WebKit::WebPageProxy::maintainsInactiveSelection const):
1479         (WebKit::WebPageProxy::inspector const): Drive by, use nullptr.
1480
1481         * UIProcess/WebPageProxy.h:
1482         (WebKit::WebPageProxy::maintainsInactiveSelection const): Deleted.
1483
1484 2017-10-06  Alex Christensen  <achristensen@webkit.org>
1485
1486         Add more infrastructure to apply custom headers to same-origin requests
1487         https://bugs.webkit.org/show_bug.cgi?id=177629
1488
1489         Reviewed by Ryosuke Niwa.
1490
1491         * UIProcess/API/C/WKWebsitePolicies.cpp:
1492         (WKWebsitePoliciesCopyCustomHeaderFields):
1493         (WKWebsitePoliciesSetCustomHeaderFields):
1494         * UIProcess/API/C/WKWebsitePolicies.h:
1495         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
1496         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
1497         (-[_WKWebsitePolicies customHeaderFields]):
1498         (-[_WKWebsitePolicies setCustomHeaderFields:]):
1499
1500         Make the SPI for setting custom header fields take a dictionary<String, String>
1501         instead of an array of Strings with colons. This matches NSURLRequest and other
1502         APIs that deal with header fields.
1503
1504 2017-10-06  Wenson Hsieh  <wenson_hsieh@apple.com>
1505
1506         [iOS] Tweak support for classifying form controls (followup to r222487)
1507         https://bugs.webkit.org/show_bug.cgi?id=177917
1508         <rdar://problem/34820122>
1509
1510         Reviewed by Dean Jackson.
1511
1512         This patch follows up with <http://trac.webkit.org/r222487>. It combines the functionality of two SPI hooks
1513         implemented on WKContentView into a single method that vends a context dictionary, and additionally addresses an
1514         issue with the original implementation, wherein some cached state on WebPageProxy is set upon starting node
1515         assistance, but is never unset when stopping node assistance, nor set anywhere else. See per-method comments for
1516         more detail.
1517
1518         * UIProcess/WebPageProxy.h:
1519
1520         Remove members m_acceptsAutofilledLoginCredentials and m_representingPageURL from WebPageProxy. This state is
1521         retrieved from the AssistedNodeInformation struct when starting node assistance, but is never reset anywhere
1522         else. Instead of introducing new members to remember this state, we can just use the WKContentView's current
1523         assisted node information.
1524
1525         This also means that programmatically focusing forms (without user gesture) will no longer cause WKContentView
1526         to accept autofilled login credentials, since we bail out of node assistance and don't begin an input session.
1527
1528         * UIProcess/ios/WKContentView.mm:
1529         (-[WKContentView acceptsAutofilledLoginCredentials]): Deleted.
1530         (-[WKContentView representingPageURL]): Deleted.
1531         * UIProcess/ios/WKContentViewInteraction.mm:
1532         (-[WKContentView _autofillContext]):
1533
1534         Merge functionality of the previous two SPI hooks, such that -_autofillContext will return a non-null dictionary
1535         containing the URL of the focused element's document if and only if WKContentView accepts autofilled login
1536         credentials, and there exists a representing page URL.
1537
1538         When the page stops assisting the focused node, we set the AssistedNodeInformation's element type to None, so we
1539         additionally bail and return nil if the element type is None. As an aside, it seems a more reasonable approach to
1540         resetting state upon stopping node assistance is to just completely reset _assistedNodeInformation to its initial
1541         value, i.e. via _assistedNodeInformation = { }. It's not clear whether there are behaviors relying on the fact
1542         that all members but the element type in the content view's assisted node information could be stale, so this
1543         seems worthy of some investigation.
1544
1545         * UIProcess/ios/WebPageProxyIOS.mm:
1546         (WebKit::WebPageProxy::startAssistingNode):
1547         (WebKit::WebPageProxy::acceptsAutofilledLoginCredentials): Deleted.
1548         (WebKit::WebPageProxy::representingPageURL): Deleted.
1549
1550 2017-10-06  Yousuke Kimoto  <yousuke.kimoto@sony.com>
1551
1552         [WinCairo] Add shared curl files
1553         https://bugs.webkit.org/show_bug.cgi?id=177999
1554
1555         Reviewed by Alex Christensen.
1556
1557         * PlatformWin.cmake:
1558         * Shared/Authentication/curl/AuthenticationManagerCurl.cpp: Added.
1559         (WebKit::AuthenticationManager::receivedCredential):
1560         (WebKit::AuthenticationManager::receivedRequestToContinueWithoutCredential):
1561         (WebKit::AuthenticationManager::receivedCancellation):
1562         (WebKit::AuthenticationManager::receivedRequestToPerformDefaultHandling):
1563         (WebKit::AuthenticationManager::receivedChallengeRejection):
1564         * Shared/curl/WebCoreArgumentCodersCurl.cpp: Added.
1565         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
1566         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
1567         (IPC::ArgumentCoder<CertificateInfo>::encode):
1568         (IPC::ArgumentCoder<CertificateInfo>::decode):
1569         (IPC::ArgumentCoder<ResourceError>::encodePlatformData):
1570         (IPC::ArgumentCoder<ResourceError>::decodePlatformData):
1571         (IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData):
1572         (IPC::ArgumentCoder<ProtectionSpace>::decodePlatformData):
1573         (IPC::ArgumentCoder<Credential>::encodePlatformData):
1574         (IPC::ArgumentCoder<Credential>::decodePlatformData):
1575
1576 2017-10-06  Brent Fulgham  <bfulgham@apple.com>
1577
1578         Sandbox rules block PluginProcess using "File Open/Save" dialogs
1579         https://bugs.webkit.org/show_bug.cgi?id=177965
1580         <rdar://problem/33976846>
1581
1582         Reviewed by Alexey Proskuryakov.
1583
1584         Update the PluginProcess sandboxes to allow the same XPC services as
1585         the WebContent process. Also allow access to the openAndSavePanelServices.
1586
1587         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: 
1588
1589 2017-10-06  Brady Eidson  <beidson@apple.com>
1590
1591         Add (entirely incorrect) fetching of ServiceWorker scripts.
1592         https://bugs.webkit.org/show_bug.cgi?id=176179
1593
1594         Reviewed by Andy Estes.
1595
1596         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1597         (WebKit::WebSWServerConnection::startScriptFetchInClient):
1598         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1599         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
1600
1601         * WebProcess/Storage/WebSWClientConnection.cpp:
1602         (WebKit::WebSWClientConnection::finishFetchingScriptInServer):
1603         * WebProcess/Storage/WebSWClientConnection.h:
1604         * WebProcess/Storage/WebSWClientConnection.messages.in:
1605
1606 2017-10-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1607
1608         [GTK][WPE] Add API to configure and enable resource load statistics
1609         https://bugs.webkit.org/show_bug.cgi?id=177943
1610
1611         Reviewed by Michael Catanzaro.
1612
1613         Add new WebKitWebsiteDataManager construct only property to set the directory where the persistent stats are
1614         stored, and methods to enable resource load statistics and query whether it's currently enabled. Also add a new
1615         Website data type to be able to remove the persistent stats using WebKitWebsiteDataManager existing API.
1616
1617         * UIProcess/API/glib/WebKitWebContext.cpp:
1618         (websiteDataStoreConfigurationForWebProcessPoolConfiguration):
1619         (webkitWebContextConstructed):
1620         * UIProcess/API/glib/WebKitWebsiteData.cpp:
1621         (recordContainsSupportedDataTypes):
1622         (toWebKitWebsiteDataTypes):
1623         * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
1624         (webkitWebsiteDataManagerGetProperty):
1625         (webkitWebsiteDataManagerSetProperty):
1626         (webkitWebsiteDataManagerConstructed):
1627         (webkit_website_data_manager_class_init):
1628         (webkitWebsiteDataManagerGetDataStore):
1629         (webkit_website_data_manager_get_resource_load_stats_directory):
1630         (webkit_website_data_manager_set_resource_load_stats_enabled):
1631         (webkit_website_data_manager_get_resource_load_stats_enabled):
1632         (toWebsiteDataTypes):
1633         * UIProcess/API/gtk/WebKitWebsiteData.h:
1634         * UIProcess/API/gtk/WebKitWebsiteDataManager.h:
1635         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
1636         * UIProcess/API/wpe/WebKitWebsiteData.h:
1637         * UIProcess/API/wpe/WebKitWebsiteDataManager.h:
1638
1639 2017-10-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1640
1641         [GTK][WPE] All resource load statistics tests added in r212183 crash in GTK bots, timeout in GTK and WPE bots since r219049
1642         https://bugs.webkit.org/show_bug.cgi?id=168171
1643
1644         Reviewed by Chris Dumez.
1645
1646         Add C API to handle all resource load statistics requests made by the layout tests.
1647
1648         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1649         (WKWebsiteDataStoreSetStatisticsLastSeen):
1650         (WKWebsiteDataStoreSetStatisticsPrevalentResource):
1651         (WKWebsiteDataStoreIsStatisticsPrevalentResource):
1652         (WKWebsiteDataStoreSetStatisticsHasHadUserInteraction):
1653         (WKWebsiteDataStoreIsStatisticsHasHadUserInteraction):
1654         (WKWebsiteDataStoreSetStatisticsGrandfathered):
1655         (WKWebsiteDataStoreIsStatisticsGrandfathered):
1656         (WKWebsiteDataStoreSetStatisticsSubframeUnderTopFrameOrigin):
1657         (WKWebsiteDataStoreSetStatisticsSubresourceUnderTopFrameOrigin):
1658         (WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectTo):
1659         (WKWebsiteDataStoreSetStatisticsTimeToLiveUserInteraction):
1660         (WKWebsiteDataStoreSetStatisticsTimeToLiveCookiePartitionFree):
1661         (WKWebsiteDataStoreStatisticsProcessStatisticsAndDataRecords):
1662         (WKWebsiteDataStoreStatisticsUpdateCookiePartitioning):
1663         (WKWebsiteDataStoreSetStatisticsShouldPartitionCookiesForHost):
1664         (WKWebsiteDataStoreStatisticsSubmitTelemetry):
1665         (WKWebsiteDataStoreSetStatisticsNotifyPagesWhenDataRecordsWereScanned):
1666         (WKWebsiteDataStoreSetStatisticsShouldClassifyResourcesBeforeDataRecordsRemoval):
1667         (WKWebsiteDataStoreSetStatisticsNotifyPagesWhenTelemetryWasCaptured):
1668         (WKWebsiteDataStoreSetStatisticsMinimumTimeBetweenDataRecordsRemoval):
1669         (WKWebsiteDataStoreSetStatisticsGrandfatheringTime):
1670         (WKWebsiteDataStoreSetStatisticsMaxStatisticsEntries):
1671         (WKWebsiteDataStoreSetStatisticsPruneEntriesDownTo):
1672         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
1673         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
1674         (WKWebsiteDataStoreStatisticsClearThroughWebsiteDataRemoval):
1675         (WKWebsiteDataStoreStatisticsResetToConsistentState):
1676         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
1677
1678 2017-10-05  Tim Horton  <timothy_horton@apple.com>
1679
1680         Fix the Mac CMake build
1681         https://bugs.webkit.org/show_bug.cgi?id=177985
1682
1683         Unreviewed build fix.
1684
1685         * CMakeLists.txt:
1686         * PlatformMac.cmake:
1687         After r222917, there's one more piece of WebKitSystemInterface left.
1688         And some missing bits of PaymentRequest.
1689
1690 2017-10-05  Keith Miller  <keith_miller@apple.com>
1691
1692         Unreviewed, tapi builds without optimization so we should have TAPI passes -DRELEASE_WITHOUT_OPTIMIZATIONS.
1693
1694         * Configurations/Base.xcconfig:
1695
1696 2017-10-05  Jer Noble  <jer.noble@apple.com>
1697
1698         [Cocoa] Enable ENABLE_ENCRYPTED_MEDIA build-time setting
1699         https://bugs.webkit.org/show_bug.cgi?id=177261
1700
1701         Reviewed by Eric Carlson.
1702
1703         * Configurations/FeatureDefines.xcconfig:
1704
1705 2017-10-05  Alex Christensen  <achristensen@webkit.org>
1706
1707         Add ObjC equivalent of WKPageNavigationClient.didChangeBackForwardList
1708         https://bugs.webkit.org/show_bug.cgi?id=177966
1709         <rdar://problem/22387135>
1710
1711         Reviewed by Tim Horton.
1712
1713         * UIProcess/API/APINavigationClient.h:
1714         (API::NavigationClient::didChangeBackForwardList):
1715         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
1716         * UIProcess/Cocoa/NavigationState.h:
1717         * UIProcess/Cocoa/NavigationState.mm:
1718         (WebKit::NavigationState::setNavigationDelegate):
1719         (WebKit::NavigationState::NavigationClient::didFailToInitializePlugIn):
1720         (WebKit::NavigationState::NavigationClient::didChangeBackForwardList):
1721         (WebKit::NavigationState::NavigationClient::willPerformClientRedirect):
1722         (WebKit::NavigationState::NavigationClient::didCancelClientRedirect):
1723         (WebKit::NavigationState::NavigationClient::renderingProgressDidChange):
1724         (WebKit::NavigationState::NavigationClient::canAuthenticateAgainstProtectionSpace):
1725         (WebKit::NavigationState::NavigationClient::processDidTerminate):
1726         (WebKit::NavigationState::NavigationClient::processDidBecomeResponsive):
1727         (WebKit::NavigationState::NavigationClient::processDidBecomeUnresponsive):
1728         (WebKit::NavigationState::NavigationClient::webCryptoMasterKey):
1729         (WebKit::NavigationState::NavigationClient::didFinishLoadForQuickLookDocumentInMainFrame):
1730         (WebKit::NavigationState::HistoryClient::didNavigateWithNavigationData):
1731         (WebKit::NavigationState::HistoryClient::didPerformClientRedirect):
1732         (WebKit::NavigationState::HistoryClient::didPerformServerRedirect):
1733         (WebKit::NavigationState::HistoryClient::didUpdateHistoryTitle):
1734         * UIProcess/WebPageProxy.cpp:
1735         (WebKit::WebPageProxy::didChangeBackForwardList):
1736
1737 2017-10-05  Alex Christensen  <achristensen@webkit.org>
1738
1739         Add ObjC SPI with userInfo corresponding to WKPageNavigationClient's decidePolicyForNavigationAction, didStartProvisionalNavigation, and didFailNavigation
1740         https://bugs.webkit.org/show_bug.cgi?id=177974
1741         <rdar://problem/22888802>
1742
1743         Reviewed by Tim Horton.
1744
1745         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
1746         * UIProcess/Cocoa/NavigationState.h:
1747         * UIProcess/Cocoa/NavigationState.mm:
1748         (WebKit::NavigationState::setNavigationDelegate):
1749         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
1750         (WebKit::NavigationState::NavigationClient::didStartProvisionalNavigation):
1751         (WebKit::NavigationState::NavigationClient::didFailNavigationWithError):
1752         * UIProcess/Cocoa/UIDelegate.mm:
1753         (WebKit::UIDelegate::ContextMenuClient::menuFromProposedMenu):
1754
1755 2017-10-05  John Wilander  <wilander@apple.com>
1756
1757         Storage Access API: Web process should ask UI process for grant/deny
1758         https://bugs.webkit.org/show_bug.cgi?id=176941
1759         <rdar://problem/34440036>
1760
1761         Reviewed by Chris Dumez and Sam Weinig.
1762
1763         This patch adds infrastructure to let WebCore::Document call
1764         WebKit::WebResourceLoadStatisticsStore and ask for storage
1765         access on behalf of an iframe. The communication goes through
1766         the ChromeClient since we might want to add a native prompt.
1767         From the ChromeClient it continues to the WebPage which
1768         messages the WebPageProxy. The WebPageProxy calls the
1769         WebsiteDataStore which owns the WebResourceLoadStatisticsStore.
1770         A uint64_t is used to match the right callback with the boolean
1771         result.
1772
1773         * UIProcess/WebPageProxy.cpp:
1774         (WebKit::WebPageProxy::requestStorageAccess):
1775         * UIProcess/WebPageProxy.h:
1776         * UIProcess/WebPageProxy.messages.in:
1777         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1778         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
1779         * UIProcess/WebResourceLoadStatisticsStore.h:
1780         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1781         (WebKit::WebsiteDataStore::requestStorageAccess):
1782         * UIProcess/WebsiteData/WebsiteDataStore.h:
1783         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1784         (WebKit::WebChromeClient::requestStorageAccess):
1785         * WebProcess/WebCoreSupport/WebChromeClient.h:
1786         * WebProcess/WebPage/WebPage.cpp:
1787         (WebKit::nextRequestStorageAccessContextId):
1788         (WebKit::WebPage::requestStorageAccess):
1789         (WebKit::WebPage::storageAccessResponse):
1790         * WebProcess/WebPage/WebPage.h:
1791         * WebProcess/WebPage/WebPage.messages.in:
1792
1793 2017-10-05  Chris Dumez  <cdumez@apple.com>
1794
1795         Drop unused parameters for CookiesStrategy::cookiesEnabled()
1796         https://bugs.webkit.org/show_bug.cgi?id=177957
1797
1798         Reviewed by Alex Christensen.
1799
1800         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1801         (WebKit::NetworkConnectionToWebProcess::cookiesEnabled):
1802         * NetworkProcess/NetworkConnectionToWebProcess.h:
1803         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1804         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1805         (WebKit::WebPlatformStrategies::cookiesEnabled):
1806         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
1807
1808 2017-10-05  Tim Horton  <timothy_horton@apple.com>
1809
1810         Make progress toward properly-formed XPC services in the Mac CMake build
1811         https://bugs.webkit.org/show_bug.cgi?id=177918
1812
1813         Reviewed by Alex Christensen.
1814
1815         * CMakeLists.txt:
1816         * PlatformMac.cmake:
1817         Turn on the storage process on Mac, and fix its build.
1818         Move XPC services to Versions/A/XPCServices and add the toplevel
1819         XPCServices as a symlink of that.
1820         Run the XPC services' Info.plists through configure_file, and substitute
1821         the important variables (most critically the bundle identifier).
1822         Factor out the service setup so we don't keep duplicating it as it
1823         gets more complicated.
1824
1825 2017-10-05  Andy Estes  <aestes@apple.com>
1826
1827         [Payment Request] Add a payment method that supports Apple Pay
1828         https://bugs.webkit.org/show_bug.cgi?id=177850
1829
1830         Reviewed by Youenn Fablet.
1831
1832         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1833         (toShippingMethod): Converted the NSDecimalNumber amount to a string rather than an integer.
1834         (WebKit::toDecimalNumber): used -decimalNumberWithString:locale: rather than
1835         -initWithMantissa:exponent:isNegative: to create an NSDecimalNumber.
1836         (WebKit::toPKPaymentSummaryItem):
1837         (WebKit::toPKShippingMethod):
1838
1839 2017-10-05  Youenn Fablet  <youenn@apple.com>
1840
1841         Make LibWebRTCProvider port agnostic
1842         https://bugs.webkit.org/show_bug.cgi?id=177747
1843
1844         Reviewed by Alex Christensen & Alex Garcia.
1845
1846         * WebProcess/Network/webrtc/LibWebRTCProvider.h: Making sure Mac/iOS provider creates the codec factories.
1847
1848 2017-10-04  Alex Christensen  <achristensen@webkit.org>
1849
1850         Stop linking with WebKitSystemInterface
1851         https://bugs.webkit.org/show_bug.cgi?id=177915
1852
1853         Reviewed by Antti Koivisto.
1854
1855         * Configurations/DebugRelease.xcconfig:
1856         * WebKit.xcodeproj/project.pbxproj:
1857
1858 2017-10-04  Alex Christensen  <achristensen@webkit.org>
1859
1860         Remove unnecessary includes of WebKitSystemInterface on Cocoa platforms
1861         https://bugs.webkit.org/show_bug.cgi?id=177912
1862
1863         Reviewed by Saam Barati.
1864
1865         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1866         * NetworkProcess/mac/NetworkProcessMac.mm:
1867         * NetworkProcess/mac/RemoteNetworkingContext.mm:
1868         * Platform/IPC/mac/ConnectionMac.mm:
1869         * Platform/mac/LayerHostingContext.mm:
1870         * PluginProcess/mac/PluginProcessMac.mm:
1871         * PluginProcess/mac/PluginProcessShim.mm:
1872         * Shared/ios/ChildProcessIOS.mm:
1873         * Shared/mac/ChildProcessMac.mm:
1874         * Shared/mac/SandboxExtensionMac.mm:
1875         * Shared/mac/WebCoreArgumentCodersMac.mm:
1876         * Shared/mac/WebEventFactory.mm:
1877         * StorageProcess/ios/StorageProcessIOS.mm:
1878         * StorageProcess/mac/StorageProcessMac.mm:
1879         * UIProcess/API/Cocoa/WKWebView.mm:
1880         * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
1881         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
1882         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1883         * UIProcess/Cocoa/WebViewImpl.mm:
1884         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
1885         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
1886         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
1887         * UIProcess/mac/PageClientImplMac.mm:
1888         * UIProcess/mac/WKTextInputWindowController.mm:
1889         * UIProcess/mac/WebContextMenuProxyMac.mm:
1890         * UIProcess/mac/WebPopupMenuProxyMac.mm:
1891         * UIProcess/mac/WindowServerConnection.mm:
1892         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
1893         * WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm:
1894         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1895         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
1896         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
1897         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
1898         * WebProcess/WebPage/ios/WebPageIOS.mm:
1899         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
1900         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
1901         * WebProcess/WebPage/mac/WebPageMac.mm:
1902         * WebProcess/cocoa/WebProcessCocoa.mm:
1903
1904 2017-10-04  Youenn Fablet  <youenn@apple.com>
1905
1906         rtc::PacketOptions should have its own IPC encoding/decoding routines
1907         https://bugs.webkit.org/show_bug.cgi?id=177812
1908
1909         Reviewed by Alex Christensen.
1910
1911         Replacing rtc::PacketOptions IPC encoding/decoding from passing the structure as individual parameters to the structure as a parameter.
1912         Introducing WebKit::RTCPacketOptions as a wrapper around it for which encode/decode routines are added.
1913         Updating code using rtc::PacketOptions accordingly.
1914
1915         * NetworkProcess/webrtc/NetworkRTCSocket.cpp:
1916         (WebKit::NetworkRTCSocket::sendTo):
1917         * NetworkProcess/webrtc/NetworkRTCSocket.h:
1918         * NetworkProcess/webrtc/NetworkRTCSocket.messages.in:
1919         * Platform/IPC/Decoder.cpp:
1920         (IPC::Decoder::operator>>):
1921         (IPC::Decoder::decode):
1922         * Platform/IPC/Decoder.h:
1923         * Platform/IPC/Encoder.cpp:
1924         (IPC::Encoder::encode):
1925         * Platform/IPC/Encoder.h:
1926         * Shared/RTCPacketOptions.cpp: Added.
1927         (WebKit::RTCPacketOptions::encode const):
1928         (WebKit::RTCPacketOptions::decode):
1929         * Shared/RTCPacketOptions.h: Added.
1930         * WebKit.xcodeproj/project.pbxproj:
1931         * WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
1932         (WebKit::LibWebRTCSocket::SendTo):
1933
1934 2017-10-04  Don Olmstead  <don.olmstead@sony.com>
1935
1936         Include Pasteboard.h for all in WebCoreArgumentCoders
1937         https://bugs.webkit.org/show_bug.cgi?id=177902
1938
1939         Reviewed by Alex Christensen.
1940
1941         * Shared/WebCoreArgumentCoders.cpp:
1942
1943 2017-10-04  David Kilzer  <ddkilzer@apple.com>
1944
1945         Remove unused variables in lambdas for network process cache
1946         <https://webkit.org/b/177878>
1947         <rdar://problem/34038482>
1948
1949         Reviewed by Tim Horton.
1950
1951         * NetworkProcess/cache/CacheStorageEngine.cpp:
1952         (WebKit::CacheStorage::Engine::open):
1953         (WebKit::CacheStorage::Engine::putRecords):
1954         (WebKit::CacheStorage::Engine::deleteMatchingRecords):
1955         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
1956         (WebKit::CacheStorageEngineConnection::reference):
1957         - Remove unused |this| from lambda captures.
1958
1959 2017-10-04  Stephan Szabo  <stephan.szabo@sony.com>
1960
1961         [WinCairo] add PLATFORM(WIN) configurations to config.h
1962         https://bugs.webkit.org/show_bug.cgi?id=177846
1963
1964         Reviewed by Alex Christensen.
1965
1966         * config.h:
1967
1968 2017-10-04  Adrian Perez de Castro  <aperez@igalia.com>
1969
1970         [GTK] WebKit2GTK+ does not handle touchmove and touchend events correctly
1971         https://bugs.webkit.org/show_bug.cgi?id=158531
1972
1973         Reviewed by Carlos Alberto Lopez Perez.
1974
1975         Do not bypass WebCore event handling when receiving touch events.
1976
1977         Based on a patch by Andre Moreira Magalhaes <andre.magalhaes@collabora.co.uk>.
1978         Thanks to Carlos Garnacho <carlosg@gnome.org> for helping out reviewing the code.
1979
1980         * UIProcess/API/gtk/PageClientImpl.cpp:
1981         (WebKit::PageClientImpl::doneWithTouchEvent): Make sure touchend reaches gesture controller if touchbegin evet got to it.
1982         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1983         (webkitWebViewBaseTouchEvent): Do not invoke gesture controller directly by bypassing WebCore event handling.
1984         * UIProcess/gtk/GestureController.cpp:
1985         (WebKit::GestureController::reset): Added.
1986         (WebKit::GestureController::handleEvent): Reset gesture controller when touchpadupdate/end is received without touchbegin.
1987         (WebKit::GestureController::Gesture::reset): Added.
1988         * UIProcess/gtk/GestureController.h:
1989
1990 2017-10-04  Michael Catanzaro  <mcatanzaro@igalia.com>
1991
1992         Unreviewed WPE build fix after r222837
1993         https://bugs.webkit.org/show_bug.cgi?id=177449
1994
1995         * Shared/wpe/WebEventFactory.cpp:
1996         (WebKit::wallTimeForEventTime):
1997
1998 2017-10-04  Ryosuke Niwa  <rniwa@webkit.org>
1999
2000         Use blob URL when pasting RTFD instead of overriding DocumentLoader
2001         https://bugs.webkit.org/show_bug.cgi?id=177801
2002         <rdar://problem/34542270>
2003
2004         Reviewed by Wenson Hsieh.
2005
2006         Fixed the assertion failure when RTFD content is empty.
2007
2008         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
2009         (WebKit::WebPasteboardProxy::getPasteboardBufferForType):
2010
2011 2017-10-04  Michael Catanzaro  <mcatanzaro@igalia.com>
2012
2013         REGRESSION(r222392): [WPE][GTK] Many forms tests are failing due to broken event timestamps
2014         https://bugs.webkit.org/show_bug.cgi?id=177449
2015
2016         Reviewed by Chris Dumez.
2017
2018         * Shared/wpe/WebEventFactory.cpp:
2019         (WebKit::wallTimeForEventTime):
2020
2021 2017-10-03  Brent Fulgham  <bfulgham@apple.com>
2022
2023         Correct nullptr dereference during shutdown
2024         https://bugs.webkit.org/show_bug.cgi?id=177845
2025         <rdar://problem/33651405>
2026
2027         Reviewed by Chris Dumez.
2028
2029         It looks like the ResourceLoadStatisticsPersistentStorage destructor is calling code that attempts
2030         to use member variables in its owning class (WebResourceLoadStatisticsStore). Since these may have
2031         already been destroyed, they are in an invalid state when accessed.
2032
2033         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
2034         (WebKit::ResourceLoadStatisticsPersistentStorage::~ResourceLoadStatisticsPersistentStorage): Do not call
2035         finishAllPendingWorkSynchronously() in the destructor, since it relies on the m_memoryStore to be
2036         a reference to completely valid object.
2037         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2038         (WebKit::WebResourceLoadStatisticsStore::~WebResourceLoadStatisticsStore): Instead, call
2039         'finishAllPendingWorkSynchronously' here, when the object is still in a known valid state.
2040
2041 2017-10-03  Alex Christensen  <achristensen@webkit.org>
2042
2043         Moderize WebKit's back forward list code
2044         https://bugs.webkit.org/show_bug.cgi?id=177843
2045
2046         Reviewed by Tim Horton.
2047
2048         Use Ref instead of RefPtr when possible.
2049         Use references instead of pointers when possible.
2050         Remove unnecessary null checks.
2051         Reduce unnecessary Vector copying.
2052
2053         * Shared/SessionState.h:
2054         * Shared/WebBackForwardListItem.h:
2055         * UIProcess/API/APILoaderClient.h:
2056         (API::LoaderClient::didChangeBackForwardList):
2057         (API::LoaderClient::shouldKeepCurrentBackForwardListItemInList):
2058         * UIProcess/API/C/WKPage.cpp:
2059         (WKPageSetPageLoaderClient):
2060         * UIProcess/WebBackForwardList.cpp:
2061         (WebKit::WebBackForwardList::pageClosed):
2062         (WebKit::WebBackForwardList::addItem):
2063         (WebKit::WebBackForwardList::goToItem):
2064         (WebKit::WebBackForwardList::currentItem const):
2065         (WebKit::WebBackForwardList::backItem const):
2066         (WebKit::WebBackForwardList::forwardItem const):
2067         (WebKit::WebBackForwardList::itemAtIndex const):
2068         (WebKit::WebBackForwardList::backListAsAPIArrayWithLimit const):
2069         (WebKit::WebBackForwardList::forwardListAsAPIArrayWithLimit const):
2070         (WebKit::WebBackForwardList::removeAllItems):
2071         (WebKit::WebBackForwardList::clear):
2072         (WebKit::WebBackForwardList::backForwardListState const):
2073         (WebKit::WebBackForwardList::restoreFromState):
2074         * UIProcess/WebBackForwardList.h:
2075         * UIProcess/WebPageProxy.cpp:
2076         (WebKit::WebPageProxy::reattachToWebProcessWithItem):
2077         (WebKit::WebPageProxy::initializeWebPage):
2078         (WebKit::WebPageProxy::didChangeBackForwardList):
2079         (WebKit::WebPageProxy::shouldKeepCurrentBackForwardListItemInList):
2080         (WebKit::WebPageProxy::backForwardGoToItem):
2081         * UIProcess/WebPageProxy.h:
2082         * UIProcess/WebProcessProxy.cpp:
2083         (WebKit::WebProcessProxy::registerNewWebBackForwardListItem):
2084         * UIProcess/WebProcessProxy.h:
2085         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
2086         (WebKit::WebBackForwardListProxy::itemAtIndex):
2087
2088 2017-10-03  Chris Dumez  <cdumez@apple.com>
2089
2090         SharedStringHashStore should support removing hashes
2091         https://bugs.webkit.org/show_bug.cgi?id=177770
2092
2093         Reviewed by Alex Christensen.
2094
2095         SharedStringHashStore should support removing hashes. It currently only supports adding hashes or
2096         clearing all of them, which is sufficient for the VisitedLinkStore but will not be for Service
2097         Worker purposes.
2098
2099         * Shared/SharedStringHashStore.cpp:
2100         (WebKit::SharedStringHashStore::SharedStringHashStore):
2101         (WebKit::SharedStringHashStore::add):
2102         (WebKit::SharedStringHashStore::remove):
2103         (WebKit::SharedStringHashStore::contains):
2104         (WebKit::SharedStringHashStore::clear):
2105         (WebKit::SharedStringHashStore::resizeTable):
2106         (WebKit::SharedStringHashStore::pendingOperationsTimerFired):
2107         * Shared/SharedStringHashStore.h:
2108         * Shared/SharedStringHashTable.cpp:
2109         (WebKit::SharedStringHashTable::remove):
2110         * Shared/SharedStringHashTable.h:
2111         * UIProcess/API/Cocoa/_WKVisitedLinkStore.h:
2112         * UIProcess/API/Cocoa/_WKVisitedLinkStore.mm:
2113         (-[_WKVisitedLinkStore containsVisitedLinkWithURL:]):
2114         (-[_WKVisitedLinkStore removeVisitedLinkWithURL:]):
2115         * UIProcess/VisitedLinkStore.cpp:
2116         (WebKit::VisitedLinkStore::containsVisitedLinkHash):
2117         (WebKit::VisitedLinkStore::removeVisitedLinkHash):
2118         (WebKit::VisitedLinkStore::didUpdateSharedStringHashes):
2119         * UIProcess/VisitedLinkStore.h:
2120
2121 2017-10-03  Alex Christensen  <achristensen@webkit.org>
2122
2123         Fix API tests after r222794.
2124         https://bugs.webkit.org/show_bug.cgi?id=177825
2125
2126         * UIProcess/WebPageProxy.cpp:
2127         (WebKit::WebPageProxy::willGoToBackForwardListItem):
2128         Sometimes there's no navigation client.
2129
2130 2017-10-03  Alex Christensen  <achristensen@webkit.org>
2131
2132         Add ObjC equivalent of WKPageLoaderClient.pluginDidFail
2133         https://bugs.webkit.org/show_bug.cgi?id=177787
2134         <rdar://problem/22387633>
2135
2136         Reviewed by Tim Horton.
2137
2138         * UIProcess/API/APILoaderClient.h:
2139         (API::LoaderClient::didFailToInitializePlugin):
2140         * UIProcess/API/APINavigationClient.h:
2141         (API::NavigationClient::canHandleDidFailToInitializePlugIn const):
2142         (API::NavigationClient::didFailToInitializePlugIn):
2143         * UIProcess/API/C/WKPage.cpp:
2144         (WKPageSetPageLoaderClient):
2145         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
2146         * UIProcess/Cocoa/NavigationState.h:
2147         * UIProcess/Cocoa/NavigationState.mm:
2148         (WebKit::NavigationState::setNavigationDelegate):
2149         (WebKit::NavigationState::NavigationClient::canHandleDidFailToInitializePlugIn const):
2150         (WebKit::NavigationState::NavigationClient::didFailToInitializePlugIn):
2151         * UIProcess/WebPageProxy.cpp:
2152         (WebKit::WebPageProxy::didFailToInitializePlugin):
2153
2154 2017-10-03  Adrian Perez de Castro  <aperez@igalia.com>
2155
2156         [GTK] Prefer -webkit-system-font
2157         https://bugs.webkit.org/show_bug.cgi?id=177814
2158
2159         Reviewed by Carlos Garcia Campos.
2160
2161         Use "font-family: -webkit-system-font" instead of "font: menu".
2162
2163         * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
2164         (WebKit::RemoteInspectorProtocolHandler::handleRequest): Edited HTML snippet.
2165
2166 2017-10-03  Alex Christensen  <achristensen@webkit.org>
2167
2168         Add ObjC SPI equivalent to WKPageLoaderClient.willGoToBackForwardListItem
2169         https://bugs.webkit.org/show_bug.cgi?id=177825
2170         <rdar://problem/22387505>
2171
2172         Reviewed by Tim Horton.
2173
2174         * UIProcess/API/APILoaderClient.h:
2175         (API::LoaderClient::willGoToBackForwardListItem):
2176         * UIProcess/API/APINavigationClient.h:
2177         (API::NavigationClient::canHandleWillGoToBackForwardListItem const):
2178         (API::NavigationClient::willGoToBackForwardListItem):
2179         * UIProcess/API/C/WKPage.cpp:
2180         (WKPageSetPageLoaderClient):
2181         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
2182         * UIProcess/Cocoa/NavigationState.h:
2183         * UIProcess/Cocoa/NavigationState.mm:
2184         (WebKit::NavigationState::setNavigationDelegate):
2185         (WebKit::NavigationState::NavigationClient::canHandleWillGoToBackForwardListItem const):
2186         (WebKit::NavigationState::NavigationClient::willGoToBackForwardListItem):
2187         * UIProcess/WebPageProxy.cpp:
2188         (WebKit::WebPageProxy::willGoToBackForwardListItem):
2189         * UIProcess/WebPageProxy.h:
2190         * UIProcess/WebPageProxy.messages.in:
2191         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2192         (WebKit::WebFrameLoaderClient::shouldGoToHistoryItem const):
2193
2194 2017-10-03  Michael Catanzaro  <mcatanzaro@igalia.com>
2195
2196         REGRESSION(r222392): [WPE][GTK] Many forms tests are failing due to broken event timestamps
2197         https://bugs.webkit.org/show_bug.cgi?id=177449
2198
2199         Reviewed by Chris Dumez.
2200
2201         * Shared/gtk/WebEventFactory.cpp:
2202         (WebKit::WebEventFactory::createWebMouseEvent):
2203         (WebKit::WebEventFactory::createWebWheelEvent):
2204         (WebKit::WebEventFactory::createWebKeyboardEvent):
2205         (WebKit::WebEventFactory::createWebTouchEvent):
2206         * Shared/wpe/WebEventFactory.cpp:
2207         (WebKit::wallTimeForEventTime):
2208         (WebKit::WebEventFactory::createWebKeyboardEvent):
2209         (WebKit::WebEventFactory::createWebMouseEvent):
2210         (WebKit::WebEventFactory::createWebWheelEvent):
2211         (WebKit::WebEventFactory::createWebTouchEvent):
2212
2213 2017-10-03  Carlos Garcia Campos  <cgarcia@igalia.com>
2214
2215         [GTK][WPE] WebProcess should run cleanup on quit to release resources
2216         https://bugs.webkit.org/show_bug.cgi?id=168126
2217
2218         Reviewed by Michael Catanzaro.
2219
2220         Do not call exit on sync message send failure for GTK and WPE ports.
2221
2222         * WebProcess/WebProcess.cpp:
2223         (WebKit::WebProcess::initializeConnection):
2224
2225 2017-10-02  Ryosuke Niwa  <rniwa@webkit.org>
2226
2227         Move more code into PasteboardCustomData
2228         https://bugs.webkit.org/show_bug.cgi?id=177795
2229
2230         Reviewed by Wenson Hsieh.
2231
2232         Added the support for encoding and decoding the origin string in PasteboardCustomData.
2233
2234         * Shared/WebCoreArgumentCoders.cpp:
2235         (IPC::ArgumentCoder<PasteboardCustomData>::encode):
2236         (IPC::ArgumentCoder<PasteboardCustomData>::decode):
2237
2238 2017-10-02  Adrian Perez de Castro  <aperez@igalia.com>
2239
2240         [GTK] Do not hardcode font family in served remote inspector HTML snippets
2241         https://bugs.webkit.org/show_bug.cgi?id=177742
2242
2243         Reviewed by Carlos Garcia Campos.
2244
2245         Instead of hardcoding Cantarell as the font used for the HTML snippets served
2246         by the remote inspector handler, use "font: menu" to obtain the system UI
2247         font, plus a "font-size" rule for adjusting the size.
2248
2249         * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
2250         (WebKit::RemoteInspectorProtocolHandler::handleRequest): Change the
2251         CSS rules in the served snippet.
2252
2253 2017-10-02  Joseph Pecoraro  <pecoraro@apple.com>
2254
2255         Web Inspector: Include Beacon and Ping requests in Network tab
2256         https://bugs.webkit.org/show_bug.cgi?id=177641
2257         <rdar://problem/33086839>
2258
2259         Reviewed by Chris Dumez.
2260
2261         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2262         (WebKit::NetworkConnectionToWebProcess::loadPing):
2263         (WebKit::NetworkConnectionToWebProcess::didFinishPingLoad):
2264         * NetworkProcess/NetworkConnectionToWebProcess.h:
2265         * NetworkProcess/PingLoad.cpp:
2266         (WebKit::PingLoad::PingLoad):
2267         (WebKit::PingLoad::didFinish):
2268         (WebKit::PingLoad::didReceiveResponseNetworkSession):
2269         * NetworkProcess/PingLoad.h:
2270         * WebProcess/Network/NetworkProcessConnection.cpp:
2271         (WebKit::NetworkProcessConnection::didFinishPingLoad):
2272         * WebProcess/Network/NetworkProcessConnection.h:
2273         * WebProcess/Network/NetworkProcessConnection.messages.in:
2274         * WebProcess/Network/WebLoaderStrategy.cpp:
2275         (WebKit::WebLoaderStrategy::networkProcessCrashed):
2276         (WebKit::WebLoaderStrategy::startPingLoad):
2277         (WebKit::WebLoaderStrategy::didFinishPingLoad):
2278         * WebProcess/Network/WebLoaderStrategy.h:
2279         Pass an optional ResourceResponse back to the ping completion handler.
2280
2281 2017-10-02  Alex Christensen  <achristensen@webkit.org>
2282
2283         REGRESSION: API tests WebKit.ProcessDidTerminateRequestedByClient and WebKit.ProcessDidTerminateWithReasonCrash are timing out
2284         https://bugs.webkit.org/show_bug.cgi?id=177764
2285
2286         Reviewed by Chris Dumez.
2287
2288         * UIProcess/API/C/WKPage.cpp:
2289         (WKPageSetPageNavigationClient):
2290         I shouldn't have reverted the A API telling the listener to continue if there's no client function.
2291
2292 2017-10-02  Carlos Garcia Campos  <cgarcia@igalia.com>
2293
2294         [WPE][GTK] Crash in webkit_web_resource_get_data_finish()
2295         https://bugs.webkit.org/show_bug.cgi?id=177107
2296
2297         Reviewed by Michael Catanzaro.
2298
2299         Handle errors in webkit_web_resource_get_data() callback.
2300
2301         * UIProcess/API/glib/WebKitWebResource.cpp:
2302         (resourceDataCallback):
2303         (webkit_web_resource_get_data):
2304
2305 2017-10-02  Olivier Blin  <olivier.blin@softathome.com>
2306
2307         [WPE] Fix UIProcess build with GStreamer and without VIDEO
2308         https://bugs.webkit.org/show_bug.cgi?id=177753
2309
2310         Reviewed by Michael Catanzaro.
2311
2312         GStreamer builds fail when WebAudio is enabled but VIDEO disabled.
2313         This is the WPE counterpart of bug 153135.
2314
2315         * UIProcess/API/wpe/PageClientImpl.h:
2316
2317 2017-10-02  Alex Christensen  <achristensen@webkit.org>
2318
2319         Expose more WKPreferences SPI to match C SPI
2320         https://bugs.webkit.org/show_bug.cgi?id=177697
2321
2322         * UIProcess/API/Cocoa/WKPreferences.mm:
2323         (-[WKPreferences _javaEnabledForLocalFiles]):
2324         (-[WKPreferences _setPlugInsEnabled:]): Deleted.
2325         (-[WKPreferences _plugInsEnabled]): Deleted.
2326         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2327         _javaEnabledForLocalFiles should return the correct value.
2328         _plugInsEnabled has public API.  This SPI is not needed.
2329
2330 2017-10-02  Alex Christensen  <achristensen@webkit.org>
2331
2332         REGRESSION(r214201): WebProcess hangs during policy decisions
2333         https://bugs.webkit.org/show_bug.cgi?id=177590
2334         <rdar://problem/33362929>
2335
2336         Reviewed by Andy Estes.
2337
2338         This is like r222431 but for trunk instead of a branch.
2339         It includes the same regression API test so I don't make the same mistake again.
2340
2341         * UIProcess/API/C/WKPage.cpp:
2342         (WKPageSetPageNavigationClient):
2343         * UIProcess/WebPageProxy.cpp:
2344         (WebKit::WebPageProxy::receivedPolicyDecision):
2345         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2346         (WebKit::WebPageProxy::decidePolicyForResponseSync):
2347         * UIProcess/WebPageProxy.h:
2348         * UIProcess/WebPageProxy.messages.in:
2349         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2350         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
2351         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
2352         (WebKit::WebFrameLoaderClient::applyToDocumentLoader):
2353         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2354         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2355         * WebProcess/WebPage/WebDocumentLoader.cpp:
2356         (WebKit::WebDocumentLoader::setNavigationID):
2357         * WebProcess/WebPage/WebFrame.cpp:
2358         (WebKit::WebFrame::setUpPolicyListener):
2359         (WebKit::WebFrame::invalidatePolicyListener):
2360         (WebKit::WebFrame::didReceivePolicyDecision):
2361         * WebProcess/WebPage/WebFrame.h:
2362         * WebProcess/WebPage/WebPage.cpp:
2363         (WebKit::WebPage::didReceivePolicyDecision):
2364         * WebProcess/WebPage/WebPage.h:
2365         * WebProcess/WebPage/WebPage.messages.in:
2366
2367 2017-10-02  Alex Christensen  <achristensen@webkit.org>
2368
2369         Remove unnecessary copy of SessionID in WebPageProxy
2370         https://bugs.webkit.org/show_bug.cgi?id=177702
2371
2372         Reviewed by Darin Adler.
2373
2374         * UIProcess/WebPageProxy.cpp:
2375         (WebKit::WebPageProxy::sessionID const):
2376         (WebKit::WebPageProxy::creationParameters):
2377         * UIProcess/WebPageProxy.h:
2378         (WebKit::WebPageProxy::sessionID const): Deleted.
2379
2380 2017-10-02  Alex Christensen  <achristensen@webkit.org>
2381
2382         Expose more WKPreferences SPI to match C SPI
2383         https://bugs.webkit.org/show_bug.cgi?id=177697
2384         <rdar://problem/24110556>
2385
2386         Reviewed by Darin Adler.
2387
2388         * UIProcess/API/Cocoa/WKPreferences.mm:
2389         (-[WKPreferences _setJavaEnabledForLocalFiles:]):
2390         (-[WKPreferences _javaEnabledForLocalFiles]):
2391         (-[WKPreferences _setCanvasUsesAcceleratedDrawing:]):
2392         (-[WKPreferences _canvasUsesAcceleratedDrawing]):
2393         (-[WKPreferences _setAcceleratedCompositingEnabled:]):
2394         (-[WKPreferences _acceleratedCompositingEnabled]):
2395         (-[WKPreferences _setDefaultTextEncodingName:]):
2396         (-[WKPreferences _defaultTextEncodingName]):
2397         (-[WKPreferences _setNeedsSiteSpecificQuirks:]):
2398         (-[WKPreferences _needsSiteSpecificQuirks]):
2399         (-[WKPreferences _setAuthorAndUserStylesEnabled:]):
2400         (-[WKPreferences _authorAndUserStylesEnabled]):
2401         (-[WKPreferences _setDOMTimersThrottlingEnabled:]):
2402         (-[WKPreferences _domTimersThrottlingEnabled]):
2403         (-[WKPreferences _setWebArchiveDebugModeEnabled:]):
2404         (-[WKPreferences _webArchiveDebugModeEnabled]):
2405         (-[WKPreferences _setLocalFileContentSniffingEnabled:]):
2406         (-[WKPreferences _localFileContentSniffingEnabled]):
2407         (-[WKPreferences _setUsesPageCache:]):
2408         (-[WKPreferences _usesPageCache]):
2409         (-[WKPreferences _setPageCacheSupportsPlugins:]):
2410         (-[WKPreferences _pageCacheSupportsPlugins]):
2411         (-[WKPreferences _setShouldPrintBackgrounds:]):
2412         (-[WKPreferences _shouldPrintBackgrounds]):
2413         (-[WKPreferences _setWebSecurityEnabled:]):
2414         (-[WKPreferences _webSecurityEnabled]):
2415         (-[WKPreferences _setUniversalAccessFromFileURLsAllowed:]):
2416         (-[WKPreferences _universalAccessFromFileURLsAllowed]):
2417         (-[WKPreferences _setAVFoundationEnabled:]):
2418         (-[WKPreferences _avFoundationEnabled]):
2419         (-[WKPreferences _setSuppressesIncrementalRendering:]):
2420         (-[WKPreferences _suppressesIncrementalRendering]):
2421         (-[WKPreferences _setAsynchronousPluginInitializationEnabled:]):
2422         (-[WKPreferences _asynchronousPluginInitializationEnabled]):
2423         (-[WKPreferences _setArtificialPluginInitializationDelayEnabled:]):
2424         (-[WKPreferences _artificialPluginInitializationDelayEnabled]):
2425         (-[WKPreferences _setCookieEnabled:]):
2426         (-[WKPreferences _cookieEnabled]):
2427         (-[WKPreferences _setPlugInSnapshottingEnabled:]):
2428         (-[WKPreferences _plugInSnapshottingEnabled]):
2429         (-[WKPreferences _setQTKitEnabled:]):
2430         (-[WKPreferences _qtKitEnabled]):
2431         (-[WKPreferences _setSubpixelCSSOMElementMetricsEnabled:]):
2432         (-[WKPreferences _subpixelCSSOMElementMetricsEnabled]):
2433         (-[WKPreferences _setMediaSourceEnabled:]):
2434         (-[WKPreferences _mediaSourceEnabled]):
2435         (-[WKPreferences _setViewGestureDebuggingEnabled:]):
2436         (-[WKPreferences _viewGestureDebuggingEnabled]):
2437         (-[WKPreferences _setCSSAnimationTriggersEnabled:]):
2438         (-[WKPreferences _cssAnimationTriggersEnabled]):
2439         (-[WKPreferences _setStandardFontFamily:]):
2440         (-[WKPreferences _standardFontFamily]):
2441         (-[WKPreferences _setNotificationsEnabled:]):
2442         (-[WKPreferences _notificationsEnabled]):
2443         (-[WKPreferences _setBackspaceKeyNavigationEnabled:]):
2444         (-[WKPreferences _backspaceKeyNavigationEnabled]):
2445         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2446
2447 2017-10-02  Carlos Garcia Campos  <cgarcia@igalia.com>
2448
2449         [GTK][WPE] Enable interactive forms validation by default
2450         https://bugs.webkit.org/show_bug.cgi?id=177737
2451
2452         Reviewed by Michael Catanzaro.
2453
2454         It's currently disabled for no reason.
2455
2456         * Shared/WebPreferencesDefinitions.h:
2457
2458 2017-10-02  Michael Catanzaro  <mcatanzaro@igalia.com>
2459
2460         Remove ENABLE_CSS_REGIONS
2461         https://bugs.webkit.org/show_bug.cgi?id=177689
2462
2463         Reviewed by Darin Adler.
2464
2465         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp:
2466         (webkit_dom_element_get_webkit_region_overset):
2467         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.h:
2468         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
2469         (webkit_dom_element_get_webkit_region_overset): Deleted.
2470         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.h:
2471
2472 2017-09-30  Darin Adler  <darin@apple.com>
2473
2474         Have IPC::Connection::Client objects consistently invalidate the connection when destroyed
2475         https://bugs.webkit.org/show_bug.cgi?id=177708
2476
2477         Reviewed by Anders Carlsson.
2478
2479         I ran into an intermittent crash when running regression tests. It looked like a connection
2480         client was being called after it was destroyed. I did an audit of the all the connection
2481         clients to make sure they all invalidate their connection before they are destroyed.
2482
2483         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2484         (WebKit::NetworkConnectionToWebProcess::~NetworkConnectionToWebProcess): Invalidate the
2485         connection since this object opened the connection. There is no obvious
2486         guarantee that the connection will already be invalid when this is destroyed.
2487         * StorageProcess/StorageToWebProcessConnection.cpp:
2488         (WebKit::StorageToWebProcessConnection::~StorageToWebProcessConnection): Ditto.
2489         * UIProcess/Plugins/PluginProcessProxy.cpp:
2490         (WebKit::PluginProcessProxy::~PluginProcessProxy): Ditto.
2491         * WebProcess/Network/NetworkProcessConnection.cpp:
2492         (WebKit::NetworkProcessConnection::~NetworkProcessConnection): Ditto.
2493         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
2494         (WebKit::WebToStorageProcessConnection::~WebToStorageProcessConnection): Ditto.
2495
2496         * StorageProcess/StorageToWebProcessConnection.h: Derive privately rather than publicly
2497         from IPC::Connection::Client because we can, and this means we don't have to study quite
2498         as much code to understand how this is used as a connection client.
2499         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h: Ditto.
2500         * WebProcess/Storage/WebToStorageProcessConnection.h: Ditto.
2501         * WebProcess/WebPage/WebInspector.h: Ditto.
2502         * WebProcess/WebPage/WebInspectorUI.h: Ditto.
2503
2504         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
2505         (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer): Added a comment about a
2506         reference cycle cycle leading to a leak that I believe exists here.
2507
2508 2017-09-29  Alex Christensen  <achristensen@webkit.org>
2509
2510         REGRESSION: ASSERTION FAILED: m_provisionalURL.isEmpty() in WebKit::FrameLoadState::didStartProvisionalLoad
2511         https://bugs.webkit.org/show_bug.cgi?id=177491
2512
2513         Reviewed by Andy Estes.
2514
2515         * WebProcess/WebPage/WebFrame.cpp:
2516         (WebKit::WebFrame::setUpWillSubmitFormListener):
2517         (WebKit::WebFrame::continueWillSubmitForm):
2518         (WebKit::WebFrame::invalidatePolicyListener):
2519         Speculative fix for a flaky assertion.
2520         Restore the clearing of the policy listeners we used to have when form submission was treated as a policy.
2521
2522 2017-09-29  Chris Dumez  <cdumez@apple.com>
2523
2524         http/tests/preconnect/link-rel-preconnect-https.html is flaky
2525         https://bugs.webkit.org/show_bug.cgi?id=177673
2526
2527         Reviewed by Alex Christensen.
2528
2529         Update PreconnectTask to query the client when a certificate needs to be
2530         validated. This allows WebKitTestRunner to ignore invalid certificates
2531         and this causes http/tests/preconnect/link-rel-preconnect-https.html
2532         to pass consistently.
2533
2534         To avoid duplicating code, PreconnectTask now uses NetworkLoad internally
2535         instead of using a NetworkDataTask directly.
2536
2537         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2538         (WebKit::NetworkConnectionToWebProcess::preconnectTo):
2539         * NetworkProcess/NetworkConnectionToWebProcess.h:
2540         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2541         * NetworkProcess/NetworkLoad.h:
2542         * NetworkProcess/NetworkProcess.cpp:
2543         (WebKit::generateCanAuthenticateIdentifier):
2544         (WebKit::NetworkProcess::canAuthenticateAgainstProtectionSpace):
2545         (WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpace):
2546         (WebKit::NetworkProcess::preconnectTo):
2547         * NetworkProcess/NetworkProcess.h:
2548         * NetworkProcess/NetworkResourceLoadParameters.cpp:
2549         (WebKit::NetworkResourceLoadParameters::encode const):
2550         (WebKit::NetworkResourceLoadParameters::decode):
2551         * NetworkProcess/PreconnectTask.cpp:
2552         (WebKit::PreconnectTask::PreconnectTask):
2553         (WebKit::PreconnectTask::~PreconnectTask):
2554         (WebKit::PreconnectTask::willSendRedirectedRequest):
2555         (WebKit::PreconnectTask::didReceiveResponse):
2556         (WebKit::PreconnectTask::didReceiveBuffer):
2557         (WebKit::PreconnectTask::didFinishLoading):
2558         (WebKit::PreconnectTask::didFailLoading):
2559         (WebKit::PreconnectTask::didSendData):
2560         (WebKit::PreconnectTask::canAuthenticateAgainstProtectionSpaceAsync):
2561         (WebKit::PreconnectTask::continueCanAuthenticateAgainstProtectionSpace):
2562         (WebKit::PreconnectTask::frameID const):
2563         (WebKit::PreconnectTask::pageID const):
2564         * NetworkProcess/PreconnectTask.h:
2565         * WebProcess/Network/WebLoaderStrategy.cpp:
2566         (WebKit::WebLoaderStrategy::preconnectTo):
2567         * WebProcess/Network/WebLoaderStrategy.h:
2568
2569 2017-09-29  Alex Christensen  <achristensen@webkit.org>
2570
2571         Expose WebPreferences::webGLEnabled through WKPreferences
2572         https://bugs.webkit.org/show_bug.cgi?id=177692
2573         <rdar://problem/24110556>
2574
2575         Reviewed by Andy Estes.
2576
2577         * UIProcess/API/Cocoa/WKPreferences.mm:
2578         (-[WKPreferences _setWebGLEnabled:]):
2579         (-[WKPreferences _webGLEnabled]):
2580         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2581
2582 2017-09-29  Chris Dumez  <cdumez@apple.com>
2583
2584         [WK2][NETWORK_SESSION] Move some authentication-related code to avoid duplication
2585         https://bugs.webkit.org/show_bug.cgi?id=177667
2586
2587         Reviewed by Alex Christensen.
2588
2589         Move some authentication-related code to avoid duplication.
2590         This is a preparation code supporting Download authentication
2591         as Download uses a NSURLSessionDownloadTask and not a
2592         NetworkDataTask.
2593
2594         * NetworkProcess/NetworkDataTask.h:
2595         (WebKit::NetworkDataTask::setSuggestedFilename):
2596         * NetworkProcess/NetworkLoad.cpp:
2597         (WebKit::NetworkLoad::didReceiveChallenge):
2598         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
2599         * NetworkProcess/NetworkSession.cpp:
2600         (WebKit::NetworkSession::allowsSpecificHTTPSCertificateForHost):
2601         * NetworkProcess/NetworkSession.h:
2602         * NetworkProcess/PreconnectTask.cpp:
2603         (WebKit::PreconnectTask::didReceiveChallenge):
2604         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
2605         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2606         (WebKit::NetworkDataTaskCocoa::didReceiveChallenge):
2607         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
2608         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2609         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
2610         (WebKit::certificatesMatch):
2611         (WebKit::NetworkSessionCocoa::allowsSpecificHTTPSCertificateForHost):
2612
2613 2017-09-29  Alex Christensen  <achristensen@webkit.org>
2614
2615         Fix WKWebViewConfigurationPrivate after r222663
2616         https://bugs.webkit.org/show_bug.cgi?id=177644
2617
2618         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2619         (-[WKWebViewConfiguration init]):
2620         (-[WKWebViewConfiguration copyWithZone:]):
2621         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2622
2623 2017-09-29  Chris Dumez  <cdumez@apple.com>
2624
2625         Split some logic out of VisitedLinkStore and make it reusable
2626         https://bugs.webkit.org/show_bug.cgi?id=177575
2627
2628         Reviewed by Alex Christensen.
2629
2630         Split some logic out of VisitedLinkStore and make it reusable for other purposes than
2631         visited links and from other processes than the UIProcess.
2632
2633         The plan is to reuse the new SharedStringHashStore for Service Worker registration
2634         on StorageProcess side and querying on WebContent process side.
2635
2636         * CMakeLists.txt:
2637         * Shared/SharedStringHashStore.cpp: Added.
2638         (WebKit::nextPowerOf2):
2639         (WebKit::tableSizeForKeyCount):
2640         (WebKit::SharedStringHashStore::SharedStringHashStore):
2641         (WebKit::SharedStringHashStore::createSharedMemoryHandle):
2642         (WebKit::SharedStringHashStore::add):
2643         (WebKit::SharedStringHashStore::clear):
2644         (WebKit::SharedStringHashStore::resizeTable):
2645         (WebKit::SharedStringHashStore::pendingSharedStringHashesTimerFired):
2646         * Shared/SharedStringHashStore.h: Copied from Source/WebKit/WebProcess/WebPage/VisitedLinkTableController.h.
2647         (WebKit::SharedStringHashStore::Client::~Client):
2648         (WebKit::SharedStringHashStore::isEmpty const):
2649         * Shared/SharedStringHashTable.cpp: Renamed from Source/WebKit/Shared/VisitedLinkTable.cpp.
2650         (WebKit::SharedStringHashTable::SharedStringHashTable):
2651         (WebKit::SharedStringHashTable::~SharedStringHashTable):
2652         (WebKit::SharedStringHashTable::setSharedMemory):
2653         (WebKit::SharedStringHashTable::add):
2654         (WebKit::SharedStringHashTable::contains const):
2655         (WebKit::SharedStringHashTable::clear):
2656         * Shared/SharedStringHashTable.h: Renamed from Source/WebKit/Shared/VisitedLinkTable.h.
2657         * UIProcess/API/C/WKContext.cpp:
2658         (WKContextAddVisitedLink):
2659         * UIProcess/API/Cocoa/_WKVisitedLinkStore.mm:
2660         (-[_WKVisitedLinkStore addVisitedLinkWithURL:]):
2661         * UIProcess/VisitedLinkStore.cpp:
2662         (WebKit::VisitedLinkStore::VisitedLinkStore):
2663         (WebKit::VisitedLinkStore::addProcess):
2664         (WebKit::VisitedLinkStore::addVisitedLinkHash):
2665         (WebKit::VisitedLinkStore::removeAll):
2666         (WebKit::VisitedLinkStore::addVisitedLinkHashFromPage):
2667         (WebKit::VisitedLinkStore::sendStoreHandleToProcess):
2668         (WebKit::VisitedLinkStore::didInvalidateSharedMemory):
2669         (WebKit::VisitedLinkStore::didAddSharedStringHashes):
2670         * UIProcess/VisitedLinkStore.h:
2671         * UIProcess/WebProcessPool.cpp:
2672         * UIProcess/WebProcessPool.h:
2673         * UIProcess/WebProcessProxy.h:
2674         * WebKit.xcodeproj/project.pbxproj:
2675         * WebProcess/WebPage/VisitedLinkTableController.cpp:
2676         (WebKit::VisitedLinkTableController::isLinkVisited):
2677         (WebKit::VisitedLinkTableController::addVisitedLink):
2678         (WebKit::VisitedLinkTableController::visitedLinkStateChanged):
2679         * WebProcess/WebPage/VisitedLinkTableController.h:
2680         * WebProcess/WebPage/VisitedLinkTableController.messages.in:
2681
2682 2017-09-28  Alex Christensen  <achristensen@webkit.org>
2683
2684         Add WKWebViewConfiguration SPI equivalent to WKPageConfigurationSetBackgroundCPULimit
2685         https://bugs.webkit.org/show_bug.cgi?id=177644
2686         <rdar://problem/34338698>
2687
2688         Reviewed by Geoffrey Garen.
2689
2690         WKPageConfigurationSetBackgroundCPULimit is a setter of a std::optional<double> with no accessor.
2691         It's never set to 0 in practice, so I guess the ObjC equivalent is a double that is zero or nonzero.
2692
2693         * UIProcess/API/Cocoa/WKWebView.mm:
2694         (-[WKWebView _initializeWithConfiguration:]):
2695         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2696         (-[WKWebViewConfiguration _setCPULimit:]):
2697         (-[WKWebViewConfiguration _cpuLimit]):
2698         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2699
2700 2017-09-28  Ryosuke Niwa  <rniwa@webkit.org>
2701
2702         Image pasting is not working on tineye.com / gmail.com / GitHub.com due to lack of support for DataTransfer.items
2703         https://bugs.webkit.org/show_bug.cgi?id=170449
2704         <rdar://problem/31432525>
2705
2706         Reviewed by Wenson Hsieh.
2707
2708         Add sandbox extensions for files in the pasteboard to make copying & pasting image files work.
2709         This is what we do for drag & drop but we should consider adding a mechanism to rekoke the extension in the future.
2710
2711         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
2712         (WebKit::WebPasteboardProxy::getPasteboardPathnamesForType): Add sandbox extensions to the pasted files.
2713         * UIProcess/WebPasteboardProxy.h:
2714         * UIProcess/WebPasteboardProxy.messages.in:
2715         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2716         (WebKit::WebPlatformStrategies::getPathnamesForType): Consume the sandbox tokens sent by the UI process permanently
2717         since WebCore will now create File objects for these pasted files.
2718
2719 2017-09-29  Wenson Hsieh  <wenson_hsieh@apple.com>
2720
2721         [iOS WK2] Implement -[WKContentView hasText] for compatibility with the UITextInput protocol
2722         https://bugs.webkit.org/show_bug.cgi?id=177662
2723         <rdar://problem/33410373>
2724
2725         Reviewed by Tim Horton.
2726
2727         Implements -[WKContentView hasText] by propagating a flag through post-layout editor state.
2728
2729         * Shared/EditorState.cpp:
2730         (WebKit::EditorState::PostLayoutData::encode const):
2731         (WebKit::EditorState::PostLayoutData::decode):
2732         * Shared/EditorState.h:
2733
2734         Add a new flag to EditorState indicating whether or not the current editable root containing the selection has
2735         any plain text. Add IPC support for this new flag.
2736
2737         * UIProcess/ios/WKContentViewInteraction.mm:
2738         (-[WKContentView hasText]):
2739         * WebProcess/WebPage/ios/WebPageIOS.mm:
2740         (WebKit::computeEditableRootHasContentAndPlainText):
2741
2742         Add a new helper to compute whether or not the editable root has any content, and any plain text. This
2743         is used as the last cached value for -hasText on WKContentView that we will deliver to UIKit. Some important
2744         things to note here:
2745         - If post layout data already indicates that we have selected some plain text, or that there is a plain text
2746           character near the selection, just set the flags to true and bail, since the editable root necessarily has
2747           content that is plain text.
2748         - If hasContent is false, don't even bother computing hasPlainText, because it must also be false.
2749         - Otherwise, use hasAnyPlainText to compute the value of hasPlainText, which is a faster variant of plainText.
2750         These optimizations help us avoid doing extra work at all when running Speedometer, apart from checking the
2751         values of a few PostLayoutData flags. This also fixes the value of hasContent, which was previously always false
2752         if we had a range selection rather than a caret selection even when the editable root has content, because the
2753         logic to compute the value of hasContent only existed in the branch where we have a caret selection.
2754
2755         (WebKit::WebPage::platformEditorState const):
2756
2757 2017-09-28  Timothy Horton  <timothy_horton@apple.com>
2758
2759         Fix the macOS CMake build
2760
2761         * CMakeLists.txt:
2762
2763 2017-09-28  Timothy Horton  <timothy_horton@apple.com>
2764
2765         Revise deployment target macros from r222620
2766
2767         Rubber-stamped by Wenson Hsieh.
2768
2769         * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h:
2770         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2771         (WebKit::PDFPlugin::pdfDocumentDidLoad):
2772
2773 2017-09-28  Aishwarya Nirmal  <anirmal@apple.com>
2774
2775         Request for PDF URL targets for specific pages, sections, etc.
2776         https://bugs.webkit.org/show_bug.cgi?id=177582
2777         <rdar://problem/5692679>
2778
2779         Reviewed by Tim Horton.
2780         
2781         This change sets the URL fragment for scroll anchoring in PDFs.
2782
2783         * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h:
2784         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2785         (WebKit::PDFPlugin::pdfDocumentDidLoad):
2786
2787 2017-09-28  Ross Kirsling  <ross.kirsling@sony.com>
2788
2789         [PAL] Move HysteresisActivity into PAL
2790         https://bugs.webkit.org/show_bug.cgi?id=177516
2791
2792         Reviewed by Alex Christensen.
2793
2794         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
2795         (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::PendingFrameLoad):
2796         * Shared/WebSQLiteDatabaseTracker.cpp:
2797         (WebKit::WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker):
2798         (WebKit::WebSQLiteDatabaseTracker::hysteresisUpdated):
2799         * Shared/WebSQLiteDatabaseTracker.h:
2800         * WebProcess/WebPage/WebPage.cpp:
2801         (WebKit::m_pageScrolledHysteresis):
2802         (WebKit::m_userActivityHysteresis):
2803         (WebKit::WebPage::updateUserActivity):
2804         * WebProcess/WebPage/WebPage.h:
2805         * WebProcess/WebProcess.cpp:
2806         (WebKit::WebProcess::WebProcess):
2807         * WebProcess/WebProcess.h:
2808
2809 2017-09-28  Chris Dumez  <cdumez@apple.com>
2810
2811         Add support for <link rel=preconnect>
2812         https://bugs.webkit.org/show_bug.cgi?id=177474
2813         <rdar://problem/33141380>
2814
2815         Reviewed by Alex Christensen.
2816
2817         Add support for <link rel=preconnect>:
2818         - https://w3c.github.io/resource-hints/#preconnect
2819
2820         Also add corresponding native private API.
2821
2822         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2823         (WebKit::NetworkConnectionToWebProcess::preconnectTo):
2824         (WebKit::NetworkConnectionToWebProcess::didFinishPreconnection):
2825         * NetworkProcess/NetworkConnectionToWebProcess.h:
2826         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2827         * NetworkProcess/NetworkDataTask.cpp:
2828         (WebKit::NetworkDataTask::create):
2829         * NetworkProcess/NetworkLoadParameters.h:
2830         * NetworkProcess/NetworkProcess.cpp:
2831         (WebKit::NetworkProcess::preconnectTo):
2832         * NetworkProcess/NetworkProcess.h:
2833         * NetworkProcess/NetworkProcess.messages.in:
2834         * NetworkProcess/PreconnectTask.cpp: Added.
2835         (WebKit::PreconnectTask::PreconnectTask):
2836         (WebKit::PreconnectTask::~PreconnectTask):
2837         (WebKit::PreconnectTask::willPerformHTTPRedirection):
2838         (WebKit::PreconnectTask::didReceiveChallenge):
2839         (WebKit::PreconnectTask::didReceiveResponseNetworkSession):
2840         (WebKit::PreconnectTask::didReceiveData):
2841         (WebKit::PreconnectTask::didCompleteWithError):
2842         (WebKit::PreconnectTask::didSendData):
2843         (WebKit::PreconnectTask::wasBlocked):
2844         (WebKit::PreconnectTask::cannotShowURL):
2845         (WebKit::PreconnectTask::didFinish):
2846         * NetworkProcess/PreconnectTask.h: Copied from Source/WebKit/NetworkProcess/NetworkLoadParameters.h.
2847         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
2848         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2849         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
2850         * Shared/WebCoreArgumentCoders.h:
2851         * Shared/WebPreferencesDefinitions.h:
2852         * UIProcess/API/C/WKContext.cpp:
2853         (WKContextPreconnectToServer):
2854         * UIProcess/API/C/WKContextPrivate.h:
2855         * UIProcess/API/Cocoa/WKProcessPool.mm:
2856         (-[WKProcessPool _preconnectToServer:]):
2857         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2858         * UIProcess/WebProcessPool.cpp:
2859         (WebKit::WebProcessPool::preconnectToServer):
2860         * UIProcess/WebProcessPool.h:
2861         * WebKit.xcodeproj/project.pbxproj:
2862         * WebProcess/Network/NetworkProcessConnection.cpp:
2863         (WebKit::NetworkProcessConnection::didFinishPreconnection):
2864         * WebProcess/Network/NetworkProcessConnection.h:
2865         * WebProcess/Network/NetworkProcessConnection.messages.in:
2866         * WebProcess/Network/WebLoaderStrategy.cpp:
2867         (WebKit::WebLoaderStrategy::networkProcessCrashed):
2868         (WebKit::generateLoadIdentifier):
2869         (WebKit::WebLoaderStrategy::startPingLoad):
2870         (WebKit::WebLoaderStrategy::preconnectTo):
2871         (WebKit::WebLoaderStrategy::didFinishPreconnection):
2872         * WebProcess/Network/WebLoaderStrategy.h:
2873         * WebProcess/WebPage/WebPage.cpp:
2874         (WebKit::WebPage::updatePreferences):
2875         * config.h:
2876
2877 2017-09-28  Zan Dobersek  <zdobersek@igalia.com>
2878
2879         [Cairo] Remove the cairo_glyph_t complexity from GlyphBuffer
2880         https://bugs.webkit.org/show_bug.cgi?id=177598
2881
2882         Reviewed by Carlos Garcia Campos.
2883
2884         * Shared/API/c/cairo/WKImageCairo.cpp: Explicitly include the <cairo.h>
2885         header here now that it's not included in GlyphBuffer.h.
2886         * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp: Ditto.
2887
2888 2017-09-27  Alex Christensen  <achristensen@webkit.org>
2889
2890         Add WKContentRuleList notify action type
2891         https://bugs.webkit.org/show_bug.cgi?id=177013
2892         <rdar://problem/31073936>
2893
2894         Reviewed by Darin Adler.
2895
2896         * NetworkProcess/PingLoad.cpp:
2897         (WebKit::PingLoad::processContentExtensionRulesForLoad):
2898         * UIProcess/API/APINavigationClient.h:
2899         (API::NavigationClient::contentRuleListNotification):
2900         * UIProcess/API/C/WKPage.cpp:
2901         (WKPageSetPageNavigationClient):
2902         * UIProcess/API/C/WKPageNavigationClient.h:
2903         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
2904         * UIProcess/Cocoa/NavigationState.h:
2905         * UIProcess/Cocoa/NavigationState.mm:
2906         (WebKit::NavigationState::setNavigationDelegate):
2907         (WebKit::NavigationState::NavigationClient::contentRuleListNotification):
2908         * UIProcess/WebPageProxy.cpp:
2909         (WebKit::WebPageProxy::contentRuleListNotification):
2910         * UIProcess/WebPageProxy.h:
2911         * UIProcess/WebPageProxy.messages.in:
2912         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2913         (WebKit::WebChromeClient::contentRuleListNotification):
2914         * WebProcess/WebCoreSupport/WebChromeClient.h:
2915
2916 2017-09-27  Wenson Hsieh  <wenson_hsieh@apple.com>
2917
2918         Drag event DataTransfer has unexpected types "dyn.ah62d4..."
2919         https://bugs.webkit.org/show_bug.cgi?id=172526
2920         <rdar://problem/32396081>
2921
2922         Reviewed by Ryosuke Niwa.
2923
2924         Add boilerplate plumbing and encoder/decoder support for new pasteboard codepaths. See WebCore ChangeLog for
2925         more details.
2926
2927         * Scripts/webkit/messages.py:
2928         (headers_for_type):
2929         * Shared/WebCoreArgumentCoders.cpp:
2930         (IPC::ArgumentCoder<PasteboardCustomData>::encode):
2931         (IPC::ArgumentCoder<PasteboardCustomData>::decode):
2932
2933         Add encoder/decoder support for PasteboardCustomData.
2934
2935         (IPC::ArgumentCoder<PasteboardWebContent>::encode):
2936         (IPC::ArgumentCoder<PasteboardWebContent>::decode):
2937
2938         Encode and decode dataInHTMLFormat.
2939
2940         * Shared/WebCoreArgumentCoders.h:
2941         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
2942         (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
2943         (WebKit::WebPasteboardProxy::writeCustomData):
2944         * UIProcess/WebPasteboardProxy.cpp:
2945         (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
2946         (WebKit::WebPasteboardProxy::writeCustomData):
2947         * UIProcess/WebPasteboardProxy.h:
2948         * UIProcess/WebPasteboardProxy.messages.in:
2949         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2950         (WebKit::WebPlatformStrategies::typesSafeForDOMToReadAndWrite):
2951         (WebKit::WebPlatformStrategies::writeCustomData):
2952         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
2953
2954 2017-09-27  Alex Christensen  <achristensen@webkit.org>
2955
2956         Allow modern decoding of std::optional<T>
2957         https://bugs.webkit.org/show_bug.cgi?id=177519
2958
2959         Reviewed by Tim Horton.
2960
2961         * Platform/IPC/ArgumentCoders.h:
2962         (IPC::ArgumentCoder<std::optional<T>>::decode):
2963         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
2964         (IPC::ArgumentCoder<WebCore::PaymentAuthorizationResult>::decode):
2965         (IPC::ArgumentCoder<WebCore::PaymentError>::decode):
2966         (IPC::ArgumentCoder<WebCore::PaymentMethodUpdate>::decode):
2967         (IPC::ArgumentCoder<WebCore::ShippingContactUpdate>::decode):
2968         (IPC::ArgumentCoder<WebCore::ShippingMethodUpdate>::decode):
2969         * Shared/WebCoreArgumentCoders.cpp:
2970         (IPC::ArgumentCoder<IntPoint>::decode):
2971         (IPC::ArgumentCoder<IntSize>::decode):
2972         * Shared/WebCoreArgumentCoders.h:
2973         * Shared/WebPageCreationParameters.cpp:
2974         (WebKit::WebPageCreationParameters::decode):
2975
2976 2017-09-27  Commit Queue  <commit-queue@webkit.org>
2977
2978         Unreviewed, rolling out r222541.
2979         https://bugs.webkit.org/show_bug.cgi?id=177580
2980
2981         WebCore isn't ready for the asynchronousness this was going to
2982         enable (Requested by alexchristensen on #webkit).
2983
2984         Reverted changeset:
2985
2986         "Pass a completion handler instead of a
2987         WebFramePolicyListenerProxy during policy decisions"
2988         https://bugs.webkit.org/show_bug.cgi?id=177509
2989         http://trac.webkit.org/changeset/222541
2990
2991 2017-09-27  Tina Liu  <iting_liu@apple.com>
2992
2993         Expose setShouldSuppressFirstResponderChanges() as WKView SPI
2994         https://bugs.webkit.org/show_bug.cgi?id=177513
2995         <rdar://problem/34669220>
2996
2997         Reviewed by Wenson Hsieh.
2998
2999         We already have setShouldSuppressFirstResponderChanges() SPI on WKWebView; Expose it on
3000         WKView as well for clients using legacy WebKit.
3001
3002         * UIProcess/API/Cocoa/WKViewPrivate.h:
3003         * UIProcess/API/mac/WKView.mm:
3004         (-[WKView _setShouldSuppressFirstResponderChanges:]):
3005
3006 2017-09-27  Chris Dumez  <cdumez@apple.com>
3007
3008         Have PingLoad take a CompletionHandler
3009         https://bugs.webkit.org/show_bug.cgi?id=177549
3010
3011         Reviewed by Youenn Fablet.
3012
3013         Have PingLoad take a CompletionHandler instead of relying on it calling on method on the
3014         NetworkConnectionToWebProcess when it is done.
3015
3016         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3017         (WebKit::NetworkConnectionToWebProcess::loadPing):
3018         * NetworkProcess/PingLoad.cpp:
3019         (WebKit::PingLoad::PingLoad):
3020         (WebKit::PingLoad::didFinish):
3021         * NetworkProcess/PingLoad.h:
3022
3023 2017-09-26  Alex Christensen  <achristensen@webkit.org>
3024
3025         Pass a completion handler instead of a WebFramePolicyListenerProxy during policy decisions
3026         https://bugs.webkit.org/show_bug.cgi?id=177509
3027
3028         Reviewed by Tim Horton.
3029
3030         This makes WebFramePolicyListenerProxy just a wrapper around a WTF::Function which is only needed for the C and glib APIs.
3031         This is a step towards making WebPageProxy::DecidePolicyForResponseSync and WebPageProxy::DecidePolicyForNavigationAction asynchronous.
3032
3033         This patch has no change in behavior.
3034
3035         * CMakeLists.txt:
3036         * UIProcess/API/APINavigationClient.h:
3037         (API::NavigationClient::decidePolicyForNavigationAction):
3038         (API::NavigationClient::decidePolicyForNavigationResponse):
3039         * UIProcess/API/APIPolicyClient.h:
3040         (API::PolicyClient::decidePolicyForNavigationAction):
3041         (API::PolicyClient::decidePolicyForNewWindowAction):
3042         (API::PolicyClient::decidePolicyForResponse):
3043         * UIProcess/API/C/WKFramePolicyListener.cpp:
3044         (WKFramePolicyListenerUseWithPolicies):
3045         * UIProcess/API/C/WKPage.cpp:
3046         (WKPageSetPagePolicyClient):
3047         (WKPageSetPageNavigationClient):
3048         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
3049         * UIProcess/API/glib/WebKitPolicyClient.cpp:
3050         * UIProcess/Automation/WebAutomationSession.cpp:
3051         * UIProcess/Cocoa/NavigationState.h:
3052         * UIProcess/Cocoa/NavigationState.mm:
3053         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
3054         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse):
3055         * UIProcess/Cocoa/WebViewImpl.mm:
3056         * UIProcess/RemoteWebInspectorProxy.cpp:
3057         * UIProcess/WebFormSubmissionListenerProxy.h:
3058         * UIProcess/WebFrameListenerProxy.cpp: Removed.
3059         * UIProcess/WebFrameListenerProxy.h: Removed.
3060         * UIProcess/WebFramePolicyListenerProxy.cpp:
3061         (WebKit::WebFramePolicyListenerProxy::WebFramePolicyListenerProxy):
3062         (WebKit::WebFramePolicyListenerProxy::~WebFramePolicyListenerProxy):
3063         (WebKit::WebFramePolicyListenerProxy::create):
3064         (WebKit::WebFramePolicyListenerProxy::use):
3065         (WebKit::WebFramePolicyListenerProxy::download):
3066         (WebKit::WebFramePolicyListenerProxy::ignore):
3067         * UIProcess/WebFramePolicyListenerProxy.h:
3068         (WebKit::WebFramePolicyListenerProxy::create): Deleted.
3069         (): Deleted.
3070         (WebKit::WebFramePolicyListenerProxy::operator new): Deleted.
3071         * UIProcess/WebFrameProxy.cpp:
3072         (WebKit::WebFrameProxy::webProcessWillShutDown):
3073         (WebKit::WebFrameProxy::receivedPolicyDecision): Deleted.
3074         (WebKit::WebFrameProxy::setUpPolicyListenerProxy): Deleted.
3075         * UIProcess/WebFrameProxy.h:
3076         * UIProcess/WebInspectorProxy.cpp:
3077         * UIProcess/WebPageProxy.cpp:
3078         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
3079         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
3080         (WebKit::WebPageProxy::decidePolicyForResponseSync):
3081         (WebKit::WebPageProxy::receivedPolicyDecision): Deleted.
3082         (WebKit::WebPageProxy::decidePolicyForResponse): Deleted.
3083         * UIProcess/WebPageProxy.h:
3084         * UIProcess/mac/ViewGestureControllerMac.mm:
3085         * WebKit.xcodeproj/project.pbxproj:
3086
3087 2017-09-26  Brian Burg  <bburg@apple.com>
3088
3089         Web Automation: overflow:hidden elements with no children are mistakenly reported as not visible
3090         https://bugs.webkit.org/show_bug.cgi?id=177514
3091         <rdar://problem/31936291>
3092
3093         Reviewed by Joseph Pecoraro.
3094
3095         * UIProcess/Automation/atoms/ElementDisplayed.js:
3096         (isShown.isElementSubtreeHiddenByOverflow):
3097         Array.prototype.every returns true when passed an empty list, so we need
3098         to check for the case where the element has no children and return 'false'.
3099
3100 2017-09-26  Youenn Fablet  <youenn@apple.com>
3101
3102         [Cocoa] Add a modern WKPreferences switch to disable WebRTC
3103         https://bugs.webkit.org/show_bug.cgi?id=176638
3104         <rdar://problem/34335158>
3105
3106         Reviewed by Alex Christensen.
3107
3108         * UIProcess/API/Cocoa/WKPreferences.mm:
3109         (-[WKPreferences _peerConnectionEnabled]):
3110         (-[WKPreferences _setPeerConnectionEnabled:]):
3111         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
3112
3113 2017-09-26  Brent Fulgham  <bfulgham@apple.com>
3114
3115         Harden our access to the vector of URL schemes.
3116         https://bugs.webkit.org/show_bug.cgi?id=177470
3117         <rdar://problem/33881522>
3118
3119         Reviewed by Chris Dumez.
3120
3121         Instead of asserting, use MESSAGE_CHECK so that we actually refuse to access an invalid iterator.
3122
3123         * UIProcess/WebPageProxy.cpp:
3124         (WebKit::WebPageProxy::startURLSchemeTask):
3125         (WebKit::WebPageProxy::stopURLSchemeTask):
3126
3127 2017-09-26  Jer Noble  <jer.noble@apple.com>
3128
3129         Thrown ObjC exception when right clicking on <img> containing mp4 link
3130         https://bugs.webkit.org/show_bug.cgi?id=177370
3131
3132         Reviewed by Darin Adler.
3133
3134         Creating a NSImage from mp4 data will fail and return nil; do a nil-check before attempting
3135         to put the results into a NSMutableArray.
3136
3137         * UIProcess/mac/WebContextMenuProxyMac.mm:
3138         (WebKit::WebContextMenuProxyMac::createShareMenuItem):
3139
3140 2017-09-26  Brian Burg  <bburg@apple.com>
3141
3142         Web Automation: add commands to get and set user permissions for pages in an automation session
3143         https://bugs.webkit.org/show_bug.cgi?id=177405
3144         <rdar://problem/34493846>
3145
3146         Reviewed by Joseph Pecoraro.
3147
3148         To test some Web APIs via WebDriver, it needs to be possible to simulate a user accepting or
3149         denying requests for elevated permissions, such as getUserMedia() or geolocation.
3150
3151         This patch adds a generic way for a test to configure the automation session's
3152         simulated user action that will happen every time a specific permission is requested.
3153         A test can set a "session permission", trigger the permission request via Web API,
3154         and then verify that the page behaves correctly when the user accepted or denied the request.
3155
3156         A proposal will follow shortly to expose this functionality via a new REST API endpoint.
3157
3158         * UIProcess/Automation/Automation.json: Add get/set commands.
3159
3160         * UIProcess/Automation/WebAutomationSession.cpp:
3161         (WebKit::WebAutomationSession::getSessionPermissions):
3162         (WebKit::WebAutomationSession::setSessionPermissions):
3163         For now, store the permission value in a member of the session. The getUserMedia
3164         permission only needs a bool, but there is no reason we couldn't use more complicated
3165         values for permissions (i.e., strings, numbers, arrays, objects) someday.
3166
3167         (WebKit::WebAutomationSession::shouldAllowGetUserMediaForPage const):
3168         Expose the specific decision to be taken based on whether the request is allowed or denied.
3169
3170         * UIProcess/Automation/WebAutomationSession.h:
3171         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
3172         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
3173         If the page is under automation, then simulate the user action according to the
3174         current values of permissions set for the session.
3175
3176 2017-09-25  Alex Christensen  <achristensen@webkit.org>
3177
3178         Make PolicyAction an encodable enum class
3179         https://bugs.webkit.org/show_bug.cgi?id=177480
3180
3181         Reviewed by Antti Koivisto.
3182
3183         * NetworkProcess/Downloads/DownloadManager.cpp:
3184         (WebKit::DownloadManager::continueDecidePendingDownloadDestination):
3185         (WebKit::DownloadManager::cancelDownload):
3186         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
3187         (WebKit::NetworkCORSPreflightChecker::didReceiveResponseNetworkSession):
3188         * NetworkProcess/NetworkDataTask.cpp:
3189         (WebKit::NetworkDataTask::didReceiveResponse):
3190         * NetworkProcess/NetworkDataTaskBlob.cpp:
3191         (WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse):
3192         * NetworkProcess/NetworkLoad.cpp:
3193         (WebKit::NetworkLoad::~NetworkLoad):
3194         (WebKit::NetworkLoad::continueDidReceiveResponse):
3195         (WebKit::NetworkLoad::notifyDidReceiveResponse):
3196         * NetworkProcess/PingLoad.cpp:
3197         (WebKit::PingLoad::didReceiveResponseNetworkSession):
3198         * NetworkProcess/capture/NetworkDataTaskReplay.cpp:
3199         (WebKit::NetworkCapture::NetworkDataTaskReplay::didReceiveResponse):
3200         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3201         (toNSURLSessionResponseDisposition):
3202         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
3203         (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse):
3204         * Scripts/webkit/messages.py:
3205         (headers_for_type):
3206         * UIProcess/WebFormSubmissionListenerProxy.h:
3207         * UIProcess/WebFrameListenerProxy.h:
3208         (WebKit::WebFrameListenerProxy::navigation): Deleted.
3209         * UIProcess/WebFramePolicyListenerProxy.cpp:
3210         (WebKit::WebFramePolicyListenerProxy::use):
3211         (WebKit::WebFramePolicyListenerProxy::download):
3212         (WebKit::WebFramePolicyListenerProxy::ignore):
3213         * UIProcess/WebPageProxy.cpp:
3214         (WebKit::WebPageProxy::receivedPolicyDecision):
3215         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
3216         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3217         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
3218         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
3219         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
3220         * WebProcess/WebPage/WebFrame.cpp:
3221         (WebKit::WebFrame::invalidatePolicyListener):
3222         * WebProcess/WebPage/WebPage.cpp:
3223         (WebKit::WebPage::didReceivePolicyDecision):
3224         * WebProcess/WebPage/WebPage.h:
3225         * WebProcess/WebPage/WebPage.messages.in:
3226
3227 2017-09-25  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
3228
3229         [WinCairo] Share default value of font family preferences among non-cocoa builds
3230         https://bugs.webkit.org/show_bug.cgi?id=177479
3231
3232         Reviewed by Yusuke Suzuki.
3233
3234         * Shared/WebPreferencesDefinitions.h:
3235
3236 2017-09-25  Frederik Riedel  <riedel@apple.com>
3237
3238         Expose way to set values of classified form controls as {Legacy WebKit, WebKit} SPI
3239         https://bugs.webkit.org/show_bug.cgi?id=174394
3240         <rdar://problem/33183504>
3241
3242         Reviewed by Ryosuke Niwa.
3243
3244         * Platform/spi/ios/UIKitSPI.h:
3245         * Shared/AssistedNodeInformation.cpp:
3246         (WebKit::AssistedNodeInformation::encode const):
3247         Encodes additional node information, including if the node is part of a login screen.
3248         (WebKit::AssistedNodeInformation::decode):
3249         Decodes the additional assisted node information.
3250         * Shared/AssistedNodeInformation.h:
3251         * UIProcess/WebPageProxy.h:
3252         * UIProcess/ios/WKContentView.mm:
3253         (-[WKContentView acceptsAutofilledLoginCredentials]):
3254         Determines if the WKContentView shows a login screen.
3255         (-[WKContentView representingPageUrl]):
3256         Returns the URL of the currently displayed web page.
3257         * UIProcess/ios/WKContentViewInteraction.mm:
3258         (-[WKContentView insertTextSuggestion:]):
3259         Inserts the login credentials into the Web View.
3260         * UIProcess/ios/WebPageProxyIOS.mm:
3261         (WebKit::WebPageProxy::startAssistingNode):
3262         Transfer the additional assistednode information (acceptsAutofilledLoginCredentials and representingPageUrl).
3263         (WebKit::WebPageProxy::acceptsAutofilledLoginCredentials):
3264         Returns if the Web View shows a login screen.
3265         (WebKit::WebPageProxy::representingPageUrl):
3266         Returns the Web View's URL.
3267         (WebKit::WebPageProxy::autofillLoginCredentials):
3268         Insert the credentials into the Web View.
3269         * WebProcess/WebPage/WebPage.h:
3270         * WebProcess/WebPage/WebPage.messages.in:
3271         * WebProcess/WebPage/ios/WebPageIOS.mm:
3272         (WebKit::WebPage::getAssistedNodeInformation): Transports the information if the currently
3273         highlighted node accepts autofilled login credentials.
3274         (WebKit::WebPage::autofillLoginCredentials): Fills the login credentials into the
3275         WebPage.
3276
3277 2017-09-25  Youenn Fablet  <youenn@apple.com>
3278
3279         WebRTC video does not resume receiving when switching back to Safari 11 on iOS
3280         https://bugs.webkit.org/show_bug.cgi?id=175472
3281         <rdar://problem/33860863>
3282
3283         Reviewed by Darin Adler.
3284
3285         Notifying LibWebRTC of backgrounding/foregrouding.
3286
3287         * WebProcess/WebPage/ios/WebPageIOS.mm:
3288         (WebKit::WebPage::applicationDidEnterBackground):
3289         (WebKit::WebPage::applicationWillEnterForeground):
3290
3291 2017-09-25  Sam Weinig  <sam@webkit.org>
3292
3293         Remove unused EditorClient functions
3294         https://bugs.webkit.org/show_bug.cgi?id=177463
3295
3296         Reviewed by Alex Christensen.
3297
3298         Remove unused EditorClient functions.
3299
3300         * WebProcess/WebCoreSupport/WebEditorClient.h:
3301         * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
3302         (WebKit::WebEditorClient::canonicalizeURL): Deleted.
3303         (WebKit::WebEditorClient::canonicalizeURLString): Deleted.
3304         (WebKit::WebEditorClient::writeDataToPasteboard): Deleted.
3305         (WebKit::WebEditorClient::supportedPasteboardTypesForCurrentSelection): Deleted.
3306         (WebKit::WebEditorClient::readDataFromPasteboard): Deleted.
3307         (WebKit::WebEditorClient::pasteboardChangeCount): Deleted.
3308         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
3309         (WebKit::WebEditorClient::canonicalizeURL): Deleted.
3310         (WebKit::WebEditorClient::canonicalizeURLString): Deleted.
3311
3312 2017-09-25  Alex Christensen  <achristensen@webkit.org>
3313
3314         Make Attribute an enum class
3315         https://bugs.webkit.org/show_bug.cgi?id=177414
3316
3317         Reviewed by Yusuke Suzuki.
3318
3319         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
3320         (WebKit::JSNPObject::getOwnPropertySlot):
3321
3322 2017-09-25  Alex Christensen  <achristensen@webkit.org>
3323
3324         Stop using PolicyCallback
3325         https://bugs.webkit.org/show_bug.cgi?id=176088
3326
3327         Reviewed by Andy Estes.
3328
3329         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3330         * WebProcess/WebPage/WebFrame.cpp:
3331         (WebKit::WebFrame::invalidatePolicyListener):
3332         * WebProcess/WebPage/WebFrame.h:
3333         * WebProcess/WebPage/WebInspector.cpp:
3334
3335 2017-09-25  Chris Dumez  <cdumez@apple.com>
3336
3337         [WK2] Add API to query if a download was user-initiated
3338         https://bugs.webkit.org/show_bug.cgi?id=177435
3339         <rdar://problem/34498422>
3340
3341         Reviewed by Alex Christensen.
3342
3343         Add C and Cocoa private API to query if a download was user-initiated.
3344
3345         For clarity, we now construct navigation object for subframe loads
3346         as well (we used to do so only for main frame loads). This allows us
3347         to store the user-intiated flag and the redirect chain on the navigation
3348         object instead of the WebFrameProxy.
3349
3350         * UIProcess/API/APINavigation.cpp:
3351         (API::Navigation::Navigation):
3352         (API::Navigation::appendRedirectionURL):
3353         * UIProcess/API/APINavigation.h:
3354         (API::Navigation::takeRedirectChain):
3355         (API::Navigation::setWasUserInitiated):
3356         (API::Navigation::wasUserInitiated const):
3357         * UIProcess/API/C/WKDownload.cpp:
3358         (WKDownloadGetWasUserInitiated):
3359         * UIProcess/API/C/WKDownload.h:
3360         * UIProcess/API/Cocoa/_WKDownload.h:
3361         * UIProcess/API/Cocoa/_WKDownload.mm:
3362         (-[_WKDownload wasUserInitiated]):
3363         * UIProcess/Downloads/DownloadProxy.h:
3364         (WebKit::DownloadProxy::setWasUserInitiated):
3365         (WebKit::DownloadProxy::wasUserInitiated const):
3366         * UIProcess/WebFrameProxy.cpp:
3367         (WebKit::WebFrameProxy::didStartProvisionalLoad):
3368         (WebKit::WebFrameProxy::didReceiveServerRedirectForProvisionalLoad):
3369         (WebKit::WebFrameProxy::didFailProvisionalLoad):
3370         (WebKit::WebFrameProxy::didFinishLoad):
3371         (WebKit::WebFrameProxy::didFailLoad):
3372         * UIProcess/WebFrameProxy.h:
3373         (WebKit::WebFrameProxy::title const):
3374         * UIProcess/WebPageProxy.cpp:
3375         (WebKit::WebPageProxy::receivedPolicyDecision):
3376         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
3377         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
3378         (WebKit::WebPageProxy::decidePolicyForResponse):
3379         (WebKit::WebPageProxy::decidePolicyForResponseSync):
3380         * UIProcess/WebPageProxy.h:
3381         * UIProcess/WebPageProxy.messages.in:
3382         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3383         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
3384
3385 2017-09-25  Chris Dumez  <cdumez@apple.com>
3386
3387         Make StoredCredentials an enum class and rename its header
3388         https://bugs.webkit.org/show_bug.cgi?id=177455
3389
3390         Reviewed by Youenn Fablet.
3391
3392         Make StoredCredentials an enum class and rename its header for clarity. This was error-prone because 0 meant
3393         "allow" and and 1 meant "do not allow". It was trivial to convert it to a boolean by mistake and get the
3394         opposite behavior.
3395
3396         * NetworkProcess/Downloads/DownloadManager.cpp:
3397         (WebKit::DownloadManager::startDownload):
3398         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
3399         (WebKit::NetworkCORSPreflightChecker::didCompleteWithError):
3400         * NetworkProcess/NetworkCORSPreflightChecker.h:
3401         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3402         (WebKit::NetworkConnectionToWebProcess::loadPing):
3403         * NetworkProcess/NetworkDataTask.cpp:
3404         (WebKit::NetworkDataTask::create):
3405         (WebKit::NetworkDataTask::NetworkDataTask):
3406         * NetworkProcess/NetworkDataTask.h:
3407         * NetworkProcess/NetworkDataTaskBlob.cpp:
3408         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
3409         * NetworkProcess/NetworkLoad.cpp:
3410         (WebKit::NetworkLoad::shouldUseCredentialStorage):
3411         * NetworkProcess/NetworkLoadParameters.h:
3412         * NetworkProcess/NetworkResourceLoadParameters.cpp:
3413         (WebKit::NetworkResourceLoadParameters::encode const):
3414         (WebKit::NetworkResourceLoadParameters::decode):
3415         * NetworkProcess/PingLoad.cpp:
3416         (WebKit::PingLoad::willPerformHTTPRedirection):
3417         (WebKit::PingLoad::makeCrossOriginAccessRequest):
3418         (WebKit::PingLoad::makeSimpleCrossOriginAccessRequest):
3419         (WebKit::PingLoad::makeCrossOriginAccessRequestWithPreflight):
3420         (WebKit::PingLoad::preflightSuccess):
3421         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
3422         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
3423         * NetworkProcess/capture/NetworkDataTaskReplay.cpp:
3424         (WebKit::NetworkCapture::NetworkDataTaskReplay::NetworkDataTaskReplay):
3425         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
3426         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3427         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
3428         (WebKit::NetworkDataTaskCocoa::~NetworkDataTaskCocoa):
3429         (WebKit::NetworkDataTaskCocoa::tryPasswordBasedAuthentication):
3430         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
3431         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3432         (-[WKNetworkSessionDelegate existingTask:]):
3433         (WebKit::NetworkSessionCocoa::dataTaskForIdentifier):
3434         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
3435         (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
3436         (WebKit::NetworkDataTaskSoup::createRequest):
3437         (WebKit::NetworkDataTaskSoup::authenticate):
3438         (WebKit::NetworkDataTaskSoup::continueAuthenticate):
3439         (WebKit::NetworkDataTaskSoup::continueHTTPRedirection):
3440         * NetworkProcess/soup/NetworkDataTaskSoup.h:
3441         * WebProcess/Network/WebLoaderStrategy.cpp:
3442         (WebKit::WebLoaderStrategy::scheduleLoad):
3443         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
3444         (WebKit::WebLoaderStrategy::startPingLoad):
3445         * WebProcess/Network/WebLoaderStrategy.h:
3446
3447 2017-09-25  Sam Weinig  <sam@webkit.org>
3448
3449         Remove unnecessary userVisibleString EditorClient function
3450         https://bugs.webkit.org/show_bug.cgi?id=177456
3451
3452         Reviewed by Dan Bernstein.
3453
3454         * WebProcess/WebCoreSupport/WebEditorClient.h:
3455         * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
3456         (WebKit::WebEditorClient::userVisibleString): Deleted.
3457         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
3458         (WebKit::WebEditorClient::userVisibleString): Deleted.
3459
3460             Remove userVisibleString client function.
3461
3462 2017-09-25  Commit Queue  <commit-queue@webkit.org>
3463
3464         Unreviewed, rolling out r222455.
3465         https://bugs.webkit.org/show_bug.cgi?id=177460
3466
3467         broke iOS build (Requested by alexchristensen on #webkit).
3468
3469         Reverted changeset:
3470
3471         "Add WKContentRuleList notify action type"
3472         https://bugs.webkit.org/show_bug.cgi?id=177013
3473         http://trac.webkit.org/changeset/222455
3474
3475 2017-09-25  Alex Christensen  <achristensen@webkit.org>
3476
3477         Separate form submission from PolicyChecker infrastructure
3478         https://bugs.webkit.org/show_bug.cgi?id=177396
3479
3480         Reviewed by Geoffrey Garen.
3481
3482         * UIProcess/API/APIFormClient.h:
3483         (API::FormClient::willSubmitForm):
3484         * UIProcess/API/Cocoa/WKWebView.mm:
3485         (-[WKWebView _setInputDelegate:]):
3486         * UIProcess/WebFormClient.cpp:
3487         (WebKit::WebFormClient::willSubmitForm):
3488         * UIProcess/WebFormClient.h:
3489         * UIProcess/WebFormSubmissionListenerProxy.cpp:
3490         (WebKit::WebFormSubmissionListenerProxy::continueSubmission):
3491         (WebKit::WebFormSubmissionListenerProxy::WebFormSubmissionListenerProxy): Deleted.
3492         * UIProcess/WebFormSubmissionListenerProxy.h:
3493         (WebKit::WebFormSubmissionListenerProxy::create):
3494         (WebKit::WebFormSubmissionListenerProxy::WebFormSubmissionListenerProxy):
3495         (): Deleted.
3496         (WebKit::WebFormSubmissionListenerProxy::operator new): Deleted.
3497         * UIProcess/WebFrameProxy.cpp:
3498         (WebKit::WebFrameProxy::setUpFormSubmissionListenerProxy): Deleted.
3499         * UIProcess/WebFrameProxy.h:
3500         * UIProcess/WebPageProxy.cpp:
3501         (WebKit::WebPageProxy::willSubmitForm):
3502         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3503         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
3504         (WebKit::WebFrameLoaderClient::dispatchWillSubmitForm):
3505         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
3506         * WebProcess/WebPage/WebFrame.cpp:
3507         (WebKit::WebFrame::setUpWillSubmitFormListener):
3508         (WebKit::WebFrame::continueWillSubmitForm):
3509         * WebProcess/WebPage/WebFrame.h:
3510         * WebProcess/WebPage/WebPage.cpp:
3511         (WebKit::WebPage::continueWillSubmitForm):
3512         * WebProcess/WebPage/WebPage.h:
3513         * WebProcess/WebPage/WebPage.messages.in:
3514
3515 2017-09-25  Alex Christensen  <achristensen@webkit.org>
3516
3517         Add WKContentRuleList notify action type
3518         https://bugs.webkit.org/show_bug.cgi?id=177013
3519         <rdar://problem/31073936>
3520
3521         Reviewed by Darin Adler.
3522
3523         * NetworkProcess/PingLoad.cpp:
3524         (WebKit::PingLoad::processContentExtensionRulesForLoad):
3525         * UIProcess/API/APINavigationClient.h:
3526         (API::NavigationClient::contentRuleListNotification):
3527         * UIProcess/API/C/WKPage.cpp:
3528         (WKPageSetPageNavigationClient):
3529         * UIProcess/API/C/WKPageNavigationClient.h:
3530         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
3531         * UIProcess/Cocoa/NavigationState.h:
3532         * UIProcess/Cocoa/NavigationState.mm:
3533         (WebKit::NavigationState::setNavigationDelegate):
3534         (WebKit::NavigationState::NavigationClient::contentRuleListNotification):
3535         * UIProcess/WebPageProxy.cpp:
3536         (WebKit::WebPageProxy::contentRuleListNotification):
3537         * UIProcess/WebPageProxy.h:
3538         * UIProcess/WebPageProxy.messages.in:
3539         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3540         (WebKit::WebChromeClient::contentRuleListNotification):
3541         * WebProcess/WebCoreSupport/WebChromeClient.h:
3542
3543 2017-09-25  Timothy Horton  <timothy_horton@apple.com>
3544
3545         Make progress on getting Mac CMake building again
3546         https://bugs.webkit.org/show_bug.cgi?id=177443
3547
3548         Unreviewed, just "fixing" the build.
3549
3550         * PlatformMac.cmake:
3551         Add some missing files and include paths.
3552
3553 2017-09-24  Michael Catanzaro  <mcatanzaro@igalia.com>
3554
3555         Viewport fit is no longer experimental
3556         https://bugs.webkit.org/show_bug.cgi?id=177417
3557
3558         Reviewed by Darin Adler.
3559
3560         * Shared/WebPreferencesDefinitions.h:
3561
3562 2017-09-24  Michael Catanzaro  <mcatanzaro@igalia.com>
3563
3564         [GTK] Unreviewed, move webkit_hit_test_result_context_is_scrollbar in documentation
3565
3566         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
3567
3568 2017-09-24  Michael Catanzaro  <mcatanzaro@igalia.com>
3569
3570         Alphabetize experimental features list
3571         https://bugs.webkit.org/show_bug.cgi?id=177374
3572
3573         Reviewed by Darin Adler.
3574
3575         * Shared/WebPreferencesDefinitions.h:
3576
3577 2017-09-24  Zan Dobersek  <zdobersek@igalia.com>
3578
3579         [WebKit] Changing EME setting through InjectedBundle should update WebPreferencesStore
3580         https://bugs.webkit.org/show_bug.cgi?id=177312
3581
3582         Reviewed by Carlos Garcia Campos.
3583
3584         When enabling EME through the InjectedBundle for testing purposes, it's
3585         only enabled in RuntimeEnabledFeatures, but not in WebPreferencesStore.
3586         This causes failures on imported W3C tests that cover EME persistent
3587         state licenses and perform parts of that test in a new window, where
3588         the original RuntimeEnabledFeatures state doesn't have any effect.
3589
3590         To avoid those failures, when enabling EME feature for testing purposes
3591         through InjectedBundle, the feature should also be enabled in the
3592         WebPreferencesStore.
3593
3594         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3595         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
3596
3597 2017-09-22  Zalan Bujtas  <zalan@apple.com>
3598
3599         WeakPtrFactory should populate m_ref lazily.
3600         https://bugs.webkit.org/show_bug.cgi?id=177375
3601
3602         Reviewed by Geoffrey Garen.
3603
3604         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
3605         (WebKit::WebPaymentCoordinatorProxy::WebPaymentCoordinatorProxy):
3606         (WebKit::WebPaymentCoordinatorProxy::canMakePaymentsWithActiveCard):
3607         (WebKit::WebPaymentCoordinatorProxy::openPaymentSetup):
3608         * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
3609         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
3610         * UIProcess/ApplicationStateTracker.mm:
3611         (WebKit::ApplicationStateTracker::ApplicationStateTracker):
3612         * UIProcess/Cocoa/WebViewImpl.h:
3613         (WebKit::WebViewImpl::createWeakPtr):
3614         * UIProcess/Cocoa/WebViewImpl.mm:
3615         (WebKit::WebViewImpl::WebViewImpl):
3616         * UIProcess/Launcher/ProcessLauncher.cpp:
3617         (WebKit::ProcessLauncher::ProcessLauncher):
3618         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
3619         (WebKit::ProcessLauncher::launchProcess):
3620         * UIProcess/ProcessAssertion.h:
3621         (WebKit::ProcessAssertion::createWeakPtr):
3622         * UIProcess/WebPageProxy.cpp:
3623         (WebKit::m_configurationPreferenceValues):
3624         (WebKit::m_weakPtrFactory): Deleted.
3625         * UIProcess/WebPageProxy.h:
3626         (WebKit::WebPageProxy::createWeakPtr const):
3627         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
3628         (WebKit::RemoteLayerTreeDrawingArea::createWeakPtr):
3629         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
3630         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
3631
3632 2017-09-22  John Wilander  <wilander@apple.com>
3633
3634         Re-enable configuration.HTTPCookieStorage on session without credentials
3635         https://bugs.webkit.org/show_bug.cgi?id=177393
3636
3637         This patch rolls back the crucial change to the network session
3638         without credentials that landed in r221632:
3639         <http://trac.webkit.org/changeset/221632>
3640
3641         Reviewed by Brent Fulgham.
3642
3643         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3644         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
3645             Commented out the disabled cookie jar and added a FIXME
3646             referring to https://bugs.webkit.org/show_bug.cgi?id=177394.
3647
3648 2017-09-22  Chris Dumez  <cdumez@apple.com>
3649
3650         Enable File and Directory Entries API at runtime
3651         https://bugs.webkit.org/show_bug.cgi?id=176616
3652         <rdar://problem/34330942>
3653
3654         Reviewed by Geoffrey Garen.
3655
3656         Enable File and Directory Entries API at runtime on Mac/WebKit2,
3657         now that DataTransfer.items is enabled there.
3658
3659         * Shared/WebPreferencesDefinitions.h:
3660
3661 2017-09-22  Matt Lewis  <jlewis3@apple.com>
3662
3663         Unreviewed, rolling out r222394.
3664
3665         This broke the Windows Debug Build.
3666
3667         Reverted changeset:
3668
3669         "Remove build-webkit's notion of feature flags having a
3670         default value"
3671         https://bugs.webkit.org/show_bug.cgi?id=177338
3672         http://trac.webkit.org/changeset/222394
3673
3674 2017-09-22  John Wilander  <wilander@apple.com>
3675
3676         Non-prevalent resources should be allowed access to existing cookies in a third-party context
3677         https://bugs.webkit.org/show_bug.cgi?id=177336
3678         <rdar://problem/34578257>
3679
3680         Reviewed by Brent Fulgham.
3681
3682         This patch restructures what is communicated to the network process,
3683         from two vectors - with user interaction and without user interaction -
3684         to three vectors - to partition, to block, to neither partition nor block.
3685         The previous two vectors did not allow proper categorization into which
3686         domains should be partitioned, blocked, or left alone. That was the cause
3687         of the regression where non-prevalent third-party domains erroneously had
3688         their cookies blocked when they should fall back to the old behavior of
3689         access but no new cookies allowed to be set.
3690
3691         * NetworkProcess/NetworkProcess.cpp:
3692         (WebKit::NetworkProcess::updatePrevalentDomainsToPartitionOrBlockCookies):
3693         (WebKit::NetworkProcess::updatePrevalentDomainsWithAndWithoutInteraction): Deleted.
3694         * NetworkProcess/NetworkProcess.h:
3695         * NetworkProcess/NetworkProcess.messages.in:
3696         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3697         (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:]):
3698         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3699         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
3700         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
3701         (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains):
3702         (WebKit::WebResourceLoadStatisticsStore::clearInMemory):
3703         (WebKit::WebResourceLoadStatisticsStore::shouldPartitionCookies const):
3704         (WebKit::WebResourceLoadStatisticsStore::shouldBlockCookies const):
3705         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
3706         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains):
3707         (WebKit::WebResourceLoadStatisticsStore::clearPartitioningStateForDomains):
3708         (WebKit::WebResourceLoadStatisticsStore::resetCookiePartitioningState):
3709         * UIProcess/WebResourceLoadStatisticsStore.h:
3710         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3711         (WebKit::WebsiteDataStore::updatePrevalentDomainsToPartitionOrBlockCookies):
3712         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
3713         (WebKit::WebsiteDataStore::updatePrevalentDomainsWithAndWithoutInteraction): Deleted.
3714         * UIProcess/WebsiteData/WebsiteDataStore.h:
3715
3716 2017-09-22  Tim Horton <timothy_horton@apple.com> and Michael Catanzaro <mcatanzaro@igalia.com>
3717
3718         Remove build-webkit's notion of feature flags having a default value
3719         https://bugs.webkit.org/show_bug.cgi?id=177338
3720
3721         Reviewed by Alex Christensen.
3722
3723         Use ENABLE_EXPERIMENTAL_FEATURES instead of ENABLE_DEVELOPER_MODE to enable runtime
3724         experimental features.
3725
3726         * Shared/WebPreferencesDefinitions.h:
3727
3728 2017-09-22  Chris Dumez  <cdumez@apple.com>
3729
3730         Use high resolution timestamp for event time
3731         https://bugs.webkit.org/show_bug.cgi?id=154246
3732         <rdar://problem/34333304>
3733
3734         Reviewed by Ryosuke Niwa.
3735
3736         Use WallTime / MonotonicTime instead of double type for clarity.
3737
3738         * Shared/WebCoreArgumentCoders.cpp:
3739         (IPC::ArgumentCoder<WallTime>::encode):
3740         (IPC::ArgumentCoder<WallTime>::decode):
3741         * Shared/WebCoreArgumentCoders.h:
3742         * Shared/WebEvent.cpp:
3743         (WebKit::WebEvent::WebEvent):
3744         * Shared/WebEvent.h:
3745         (WebKit::WebEvent::timestamp const):
3746         (WebKit::WebTouchEvent::WebTouchEvent):
3747         * Shared/WebKeyboardEvent.cpp:
3748         (WebKit::WebKeyboardEvent::WebKeyboardEvent):
3749         * Shared/WebMouseEvent.cpp:
3750         (WebKit::WebMouseEvent::WebMouseEvent):
3751         * Shared/WebTouchEvent.cpp:
3752         (WebKit::WebTouchEvent::WebTouchEvent):
3753         * Shared/WebWheelEvent.cpp:
3754         (WebKit::WebWheelEvent::WebWheelEvent):
3755         * Shared/gtk/WebEventFactory.cpp:
3756         (WebKit::WebEventFactory::createWebMouseEvent):
3757         (WebKit::WebEventFactory::createWebWheelEvent):
3758         (WebKit::WebEventFactory::createWebKeyboardEvent):
3759         (WebKit::WebEventFactory::createWebTouchEvent):
3760         * Shared/ios/NativeWebTouchEventIOS.mm:
3761         (WebKit::NativeWebTouchEvent::NativeWebTouchEvent):
3762         * Shared/ios/WebIOSEventFactory.mm:
3763         (WebIOSEventFactory::createWebKeyboardEvent):
3764         * Shared/mac/NativeWebGestureEventMac.mm:
3765         (WebKit::NativeWebGestureEvent::NativeWebGestureEvent):
3766         * Shared/mac/WebEventFactory.mm:
3767         (WebKit::WebEventFactory::createWebMouseEvent):
3768         (WebKit::WebEventFactory::createWebWheelEvent):
3769         (WebKit::WebEventFactory::createWebKeyboardEvent):
3770         * Shared/mac/WebGestureEvent.h:
3771         (WebKit::WebGestureEvent::WebGestureEvent):
3772         * Shared/wpe/WebEventFactory.cpp:
3773         (WebKit::WebEventFactory::createWebKeyboardEvent):
3774         (WebKit::WebEventFactory::createWebMouseEvent):
3775         (WebKit::WebEventFactory::createWebWheelEvent):
3776         (WebKit::WebEventFactory::createWebTouchEvent):
3777         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
3778         (WKBundlePageSimulateMouseDown):
3779         (WKBundlePageSimulateMouseUp):
3780         (WKBundlePageSimulateMouseMotion):
3781         * WebProcess/Plugins/PDF/PDFPlugin.mm:
3782         (WebKit::PDFPlugin::showContextMenuAtPoint):
3783         * WebProcess/Plugins/PluginView.cpp:
3784         (WebKit::PluginView::createWebEvent const):
3785         * WebProcess/WebPage/WebPage.cpp:
3786         (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick):
3787         (WebKit::WebPage::contextMenuAtPointInWindow):
3788         (WebKit::WebPage::dragEnded):
3789         (WebKit::WebPage::simulateMouseDown):
3790         (WebKit::WebPage::simulateMouseUp):
3791         (WebKit::WebPage::simulateMouseMotion):
3792         * WebProcess/WebPage/WebPage.h:
3793         * WebProcess/WebPage/ios/WebPageIOS.mm:
3794         (WebKit::WebPage::handleSyntheticClick):
3795         (WebKit::WebPage::completeSyntheticClick):
3796         (WebKit::WebPage::requestAdditionalItemsForDragSession):
3797         (WebKit::WebPage::inspectorNodeSearchMovedToPosition):
3798
3799 2017-09-22  Fujii Hironori  <Hironori.Fujii@sony.com>
3800
3801         [GTK] Web Inspector: Can't load three.js
3802         https://bugs.webkit.org/show_bug.cgi?id=177340
3803
3804         Reviewed by Carlos Garcia Campos.
3805
3806         * PlatformGTK.cmake: Add JS files of three.js to InspectorFiles variable.
3807         * PlatformWPE.cmake: Ditto.
3808
3809 2017-09-21  Ryosuke Niwa  <rniwa@webkit.org>
3810
3811         Enable dataTransfer.items on macOS and iOS
3812         https://bugs.webkit.org/show_bug.cgi?id=177335
3813
3814         Reviewed by Sam Weinig.
3815
3816         * Shared/WebPreferencesDefinitions.h:
3817
3818 2017-09-21  Dan Bernstein  <mitz@apple.com>
3819
3820         Try to fix Apple internal builds with the iOS 11.0 SDK.
3821
3822         * Configurations/WebKit.xcconfig: Disable framework header postprocessing for iOS 11.0.
3823
3824 2017-09-21  Chris Dumez  <cdumez@apple.com>
3825
3826         Regression(r222308): new API tests are failing for !NETWORK_SESSION
3827         https://bugs.webkit.org/show_bug.cgi?id=177321
3828
3829         Reviewed by Alex Christensen.
3830
3831         When a load is redirected and then converted into a download, CFNetwork
3832         seems to call [NSURLDownloadDelegate willSendRequest:] on the download
3833         with a non-nil redirectResponse, which was unexpected.
3834
3835         To address the issue, we now ignore the willSendRequest call if the
3836         new request's URL is the same as the redirectResponse one.
3837
3838         * NetworkProcess/Downloads/mac/DownloadMac.mm:
3839         (-[WKDownloadAsDelegate download:willSendRequest:redirectResponse:]):
3840
3841 2017-09-21  Chris Dumez  <cdumez@apple.com>
3842
3843         Unreviewed, drop assertion added in r222308.
3844
3845         The assertion is hit by a couple of tests still but there is no bad effect
3846         to the vector not being empty at this point since we clear it right after.
3847
3848         * UIProcess/WebFrameProxy.cpp:
3849         (WebKit::WebFrameProxy::didStartProvisionalLoad):
3850
3851 2017-09-21  Chris Dumez  <cdumez@apple.com>
3852
3853         [WK2] Add API to get the redirect chain of a WKDownload
3854         https://bugs.webkit.org/show_bug.cgi?id=176628
3855         <rdar://problem/34338279>
3856
3857         Reviewed by Alex Christensen.
3858
3859         Re-enable assertion initially added in r222308 and later disabled in
3860         r222320. The assertion was hit because we failed to clear the redirect
3861         chain in WebFrameProxy::didFailProvisionalLoad().
3862
3863         * UIProcess/WebFrameProxy.cpp:
3864         (WebKit::WebFrameProxy::didStartProvisionalLoad):
3865         (WebKit::WebFrameProxy::didFailProvisionalLoad):
3866
3867 2017-09-21  Alex Christensen  <achristensen@webkit.org>
3868
3869         REGRESSION(r221465) WKWebViews without WebGL delegate callbacks crash when WebGL contexts are created
3870         https://bugs.webkit.org/show_bug.cgi?id=177306
3871         <rdar://problem/34351988>
3872
3873         Reviewed by Chris Dumez.
3874
3875         * UIProcess/Cocoa/NavigationState.mm:
3876         (WebKit::NavigationState::NavigationClient::webGLLoadPolicy const):
3877         (WebKit::NavigationState::NavigationClient::resolveWebGLLoadPolicy const):
3878         I forgot to early return after calling the default completion handler if there's no delegate selector.
3879
3880 2017-09-21  Chris Dumez  <cdumez@apple.com>
3881
3882         Unreviewed, temporarily disable assertion added in r222308 while I investigate.
3883
3884         * UIProcess/WebFrameProxy.cpp:
3885         (WebKit::WebFrameProxy::didStartProvisionalLoad):
3886
3887 2017-09-20  Stephan Szabo  <stephan.szabo@sony.com>
3888
3889         [Win] WTF: Add alias for process id to use in place of direct uses of pid_t
3890         https://bugs.webkit.org/show_bug.cgi?id=177017
3891
3892         Reviewed by Alex Christensen.
3893
3894         * NetworkProcess/NetworkProcessCreationParameters.h:
3895         * Shared/WebProcessCreationParameters.h:
3896         * UIProcess/API/APIProcessPoolConfiguration.h:
3897         * UIProcess/API/C/WKContext.cpp:
3898         (WKContextGetNetworkProcessIdentifier):
3899         (WKContextGetDatabaseProcessIdentifier):
3900         * UIProcess/API/C/WKContextPrivate.h:
3901         * UIProcess/API/C/WKPage.cpp:
3902         (WKPageGetProcessIdentifier):
3903         * UIProcess/API/C/WKPagePrivate.h:
3904         * UIProcess/ChildProcessProxy.h:
3905         (WebKit::ChildProcessProxy::processIdentifier const):
3906         * UIProcess/Launcher/ProcessLauncher.cpp:
3907         (WebKit::ProcessLauncher::didFinishLaunchingProcess):
3908         * UIProcess/Launcher/ProcessLauncher.h:
3909         (WebKit::ProcessLauncher::processIdentifier const):
3910         * UIProcess/ProcessAssertion.cpp:
3911         (WebKit::ProcessAssertion::ProcessAssertion):
3912         (WebKit::ProcessAndUIAssertion::ProcessAndUIAssertion):
3913         * UIProcess/ProcessAssertion.h:
3914         (WebKit::ProcessAssertion::ProcessAssertion):
3915         * UIProcess/ProcessThrottler.cpp:
3916         (WebKit::ProcessThrottler::didConnectToProcess):
3917         * UIProcess/ProcessThrottler.h:
3918         * UIProcess/WebPageProxy.cpp:
3919         (WebKit::WebPageProxy::processIdentifier const):
3920         * UIProcess/WebPageProxy.h:
3921         * UIProcess/WebProcessPool.cpp:
3922         (WebKit::WebProcessPool::networkProcessIdentifier):
3923         (WebKit::WebProcessPool::storageProcessIdentifier):
3924         * UIProcess/WebProcessPool.h:
3925
3926 2017-09-20  Chris Dumez  <cdumez@apple.com>
3927
3928         [WK2] Add API to get the redirect chain of a WKDownload
3929         https://bugs.webkit.org/show_bug.cgi?id=176628
3930         <rdar://problem/34338279>
3931
3932         Reviewed by Alex Christensen.
3933
3934         Add API to get the redirect chain of a WKDwnload. The redirect chain includes redirects
3935         that happened during initial load, before the load was converted into a download.
3936
3937         * UIProcess/API/C/WKDownload.cpp:
3938         (WKDownloadCopyRedirectChain):
3939         * UIProcess/API/C/WKDownload.h:
3940         * UIProcess/API/Cocoa/_WKDownload.h:
3941         * UIProcess/API/Cocoa/_WKDownload.mm:
3942         (-[_WKDownload originatingWebView]):
3943         (-[_WKDownload redirectChain]):
3944         * UIProcess/Downloads/DownloadProxy.cpp:
3945         (WebKit::DownloadProxy::willSendRequest):
3946         * UIProcess/Downloads/DownloadProxy.h:
3947         (WebKit::DownloadProxy::setRedirectChain):
3948         (WebKit::DownloadProxy::redirectChain const):
3949         * UIProcess/WebFrameProxy.cpp:
3950         (WebKit::WebFrameProxy::didStartProvisionalLoad):
3951         (WebKit::WebFrameProxy::didReceiveServerRedirectForProvisionalLoad):
3952         * UIProcess/WebFrameProxy.h:
3953         (WebKit::WebFrameProxy::redirectChain const):
3954         * UIProcess/WebPageProxy.cpp:
3955         (WebKit::WebPageProxy::receivedPolicyDecision):
3956
3957 2017-09-20  Alex Christensen  <achristensen@webkit.org>
3958
3959         Add infrastructure for adding custom headers to requests per website
3960         https://bugs.webkit.org/show_bug.cgi?id=177255
3961
3962         Reviewed by Geoffrey Garen.
3963
3964         * Shared/WebsitePolicies.cpp: Added.
3965         * Shared/WebsitePolicies.h:
3966         (WebKit::WebsitePolicies::encode const):
3967         (WebKit::WebsitePolicies::decode):
3968         * UIProcess/API/APIWebsitePolicies.h:
3969         * UIProcess/API/C/WKWebsitePolicies.cpp:
3970         (WKWebsitePoliciesCopyCustomHeaderFields):
3971         (WKWebsitePoliciesSetCustomHeaderFields):
3972         * UIProcess/API/C/WKWebsitePolicies.h:
3973         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
3974         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
3975         (-[_WKWebsitePolicies customHeaderFields]):
3976         (-[_WKWebsitePolicies setCustomHeaderFields:]):
3977         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3978         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
3979
3980 2017-09-20  Michael Catanzaro  <mcatanzaro@igalia.com>
3981
3982         REGRESSION(r222194) [WPE] Library and executable output names broken
3983         https://bugs.webkit.org/show_bug.cgi?id=177273
3984
3985         Reviewed by Carlos Alberto Lopez Perez.
3986
3987         Move the WebKit2 output name variables to here from Source/cmake, since this is a better
3988         place and where they are set on all other ports. Update them for the changes in r222194.
3989
3990         * PlatformWPE.cmake:
3991
3992 2017-09-20  Jonathan Bedard  <jbedard@apple.com>
3993
3994         Removed nullable from UIDragItem property
3995         https://bugs.webkit.org/show_bug.cgi?id=176264
3996         <rdar://problem/31144674>
3997
3998         Unreviewed build fix
3999
4000         When a nullable annotation is used in a header file,
4001         the Objective-C compiler forces annotations on the entire
4002         file. Remove an unneeded annotation in UIKitSPI.h so that
4003         we can build in iOS 11.
4004
4005         * Platform/spi/ios/UIKitSPI.h:
4006
4007 2017-09-20  Antti Koivisto  <antti@apple.com>
4008
4009         Remove DOM and styling support for CSS Regions
4010         https://bugs.webkit.org/show_bug.cgi?id=177221
4011
4012         Reviewed by Andreas Kling.
4013
4014         * Configurations/FeatureDefines.xcconfig:
4015
4016 2017-09-19  Simon Fraser  <simon.fraser@apple.com>
4017
4018         Do more math in terms of FloatSizes and FloatPoints
4019         https://bugs.webkit.org/show_bug.cgi?id=177217
4020
4021         Reviewed by Zalan Bujtas.
4022
4023         Add operator/(const FloatSize&, const FloatSize&), GraphicsContext::translate(const FloatPoint&),
4024         FloatRect.scale(FloatSize) and AffineTransform::translate(const FloatSize&)
4025         and use them in lots of places to do math in terms of points and sizes.
4026
4027         * UIProcess/API/Cocoa/WKWebView.mm:
4028         (-[WKWebView _didCommitLayerTree:]):
4029         * UIProcess/ios/DragDropInteractionState.mm:
4030         (WebKit::createTargetedDragPreview):
4031         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
4032         (WebKit::imageForRect):
4033         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
4034         (WebKit::InjectedBundleRangeHandle::renderedImage):
4035         * WebProcess/WebPage/WebPage.cpp:
4036         (WebKit::paintSnapshotAtSize):
4037         (WebKit::WebPage::snapshotNode):
4038
4039 2017-09-19  Simon Fraser  <simon.fraser@apple.com>
4040
4041         tiled-drawing/tiled-backing-in-window.html fails on Retina displays
4042         https://bugs.webkit.org/show_bug.cgi?id=177113
4043
4044         Reviewed by Tim Horton.
4045
4046         Make m_customDeviceScaleFactor a std::optional<> instead of having the weird "0 is unset"
4047         behavior.
4048
4049         * UIProcess/WebPageProxy.cpp:
4050         (WebKit::WebPageProxy::deviceScaleFactor const):
4051         (WebKit::WebPageProxy::setCustomDeviceScaleFactor):
4052         * UIProcess/WebPageProxy.h:
4053
4054 2017-09-19  Alex Christensen  <achristensen@webkit.org>
4055
4056         Allow modern decoding of Vectors
4057         https://bugs.webkit.org/show_bug.cgi?id=177102
4058
4059         Reviewed by Andy Estes.
4060
4061         Rather than allow modern decoding of Vectors of types that only allow legacy decoding,
4062         I just made modern decoders for all types that we need to decode in Vectors.
4063
4064         * NetworkProcess/NetworkResourceLoadParameters.cpp:
4065         (WebKit::NetworkResourceLoadParameters::decode):
4066         * Platform/IPC/ArgumentCoders.cpp:
4067         (IPC::ArgumentCoder<std::chrono::system_clock::time_point>::decode):
4068         * Platform/IPC/ArgumentCoders.h:
4069         * Shared/AssistedNodeInformation.cpp:
4070         (WebKit::OptionItem::decode):
4071         * Shared/AssistedNodeInformation.h:
4072         * Shared/CallbackID.h:
4073         (WebKit::CallbackID::decode):
4074         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
4075         (IPC::ArgumentCoder<WebCore::PaymentError>::decode):