[Web Animations] Turn Web Animations with CSS integration on for test runners
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2018-05-18  Antoine Quint  <graouts@apple.com>
2
3         [Web Animations] Turn Web Animations with CSS integration on for test runners
4         https://bugs.webkit.org/show_bug.cgi?id=184819
5         <rdar://problem/39597337>
6
7         Reviewed by Jon Lee.
8
9         * Shared/WebPreferences.yaml: Leave Web Animations off by default, it's up to clients
10         to turn it on.
11
12 2018-05-18  Fujii Hironori  <Hironori.Fujii@sony.com>
13
14         [Curl] Remove unused SystemProxyWin.cpp
15         https://bugs.webkit.org/show_bug.cgi?id=185224
16
17         Reviewed by Antti Koivisto.
18
19         SystemProxyWin is not used at the moment. Remove it.
20
21         * NetworkProcess/win/SystemProxyWin.cpp: Removed.
22         * NetworkProcess/win/SystemProxyWin.h: Removed.
23         * PlatformWin.cmake: Removed SystemProxyWin.cpp.
24
25 2018-05-17  Nan Wang  <n_wang@apple.com>
26
27         AX: [macOS] Expose the primary screen height through AX API
28         https://bugs.webkit.org/show_bug.cgi?id=185742
29
30         Reviewed by Chris Fleizach.
31
32         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
33         (-[WKAccessibilityWebPageObject accessibilityAttributeNames]):
34         (-[WKAccessibilityWebPageObject accessibilityAttributeValue:]):
35
36 2018-05-17  Alex Christensen  <achristensen@webkit.org>
37
38         Use CompletionHandlers for DelayedReplies
39         https://bugs.webkit.org/show_bug.cgi?id=182269
40
41         Reviewed by Youenn Fablet.
42
43         DelayedReplies should be a noncopyable, non-refcountable type.  They should be
44         called once and only once.  This is what CompletionHandlers are for.
45
46         No change in behavior.  Just cleaner code.
47
48         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
49         (WebKit::NetworkConnectionToWebProcess::performSynchronousLoad):
50         * NetworkProcess/NetworkConnectionToWebProcess.h:
51         * NetworkProcess/NetworkResourceLoader.cpp:
52         (WebKit::NetworkResourceLoader::SynchronousLoadData::SynchronousLoadData):
53         (WebKit::sendReplyToSynchronousRequest):
54         (WebKit::NetworkResourceLoader::NetworkResourceLoader):
55         * NetworkProcess/NetworkResourceLoader.h:
56         * Platform/IPC/HandleMessage.h:
57         (IPC::callMemberFunctionImpl):
58         (IPC::callMemberFunction):
59         (IPC::handleMessageDelayed):
60         * PluginProcess/PluginControllerProxy.cpp:
61         (WebKit::PluginControllerProxy::setInitializationReply):
62         (WebKit::PluginControllerProxy::takeInitializationReply):
63         * PluginProcess/PluginControllerProxy.h:
64         * PluginProcess/WebProcessConnection.cpp:
65         (WebKit::WebProcessConnection::destroyPlugin):
66         (WebKit::WebProcessConnection::createPlugin):
67         (WebKit::WebProcessConnection::createPluginAsynchronously):
68         * PluginProcess/WebProcessConnection.h:
69         * Scripts/webkit/LegacyMessageReceiver-expected.cpp:
70         (Messages::WebPage::GetPluginProcessConnection::send):
71         (Messages::WebPage::TestMultipleAttributes::send):
72         (Messages::WebPage::GetPluginProcessConnection::DelayedReply::DelayedReply): Deleted.
73         (Messages::WebPage::GetPluginProcessConnection::DelayedReply::~DelayedReply): Deleted.
74         (Messages::WebPage::GetPluginProcessConnection::DelayedReply::send): Deleted.
75         (Messages::WebPage::TestMultipleAttributes::DelayedReply::DelayedReply): Deleted.
76         (Messages::WebPage::TestMultipleAttributes::DelayedReply::~DelayedReply): Deleted.
77         (Messages::WebPage::TestMultipleAttributes::DelayedReply::send): Deleted.
78         * Scripts/webkit/LegacyMessages-expected.h:
79         * Scripts/webkit/MessageReceiver-expected.cpp:
80         (Messages::WebPage::GetPluginProcessConnection::send):
81         (Messages::WebPage::TestMultipleAttributes::send):
82         (Messages::WebPage::GetPluginProcessConnection::DelayedReply::DelayedReply): Deleted.
83         (Messages::WebPage::GetPluginProcessConnection::DelayedReply::~DelayedReply): Deleted.
84         (Messages::WebPage::GetPluginProcessConnection::DelayedReply::send): Deleted.
85         (Messages::WebPage::TestMultipleAttributes::DelayedReply::DelayedReply): Deleted.
86         (Messages::WebPage::TestMultipleAttributes::DelayedReply::~DelayedReply): Deleted.
87         (Messages::WebPage::TestMultipleAttributes::DelayedReply::send): Deleted.
88         * Scripts/webkit/Messages-expected.h:
89         * Scripts/webkit/messages.py:
90         * UIProcess/Network/NetworkProcessProxy.cpp:
91         (WebKit::NetworkProcessProxy::getNetworkProcessConnection):
92         (WebKit::NetworkProcessProxy::networkProcessCrashed):
93         (WebKit::NetworkProcessProxy::networkProcessFailedToLaunch):
94         (WebKit::NetworkProcessProxy::didCreateNetworkConnectionToWebProcess):
95         * UIProcess/Network/NetworkProcessProxy.h:
96         * UIProcess/Plugins/PluginProcessManager.cpp:
97         (WebKit::PluginProcessManager::getPluginProcessConnection):
98         * UIProcess/Plugins/PluginProcessManager.h:
99         * UIProcess/Plugins/PluginProcessProxy.cpp:
100         (WebKit::PluginProcessProxy::getPluginProcessConnection):
101         (WebKit::PluginProcessProxy::pluginProcessCrashedOrFailedToLaunch):
102         (WebKit::PluginProcessProxy::didCreateWebProcessConnection):
103         * UIProcess/Plugins/PluginProcessProxy.h:
104         * UIProcess/Storage/StorageProcessProxy.cpp:
105         (WebKit::StorageProcessProxy::getStorageProcessConnection):
106         (WebKit::StorageProcessProxy::didClose):
107         (WebKit::StorageProcessProxy::didCreateStorageToWebProcessConnection):
108         * UIProcess/Storage/StorageProcessProxy.h:
109         * UIProcess/WebPageProxy.cpp:
110         (WebKit::ExceededDatabaseQuotaRecords::createRecord):
111         (WebKit::WebPageProxy::receivedPolicyDecision):
112         (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
113         (WebKit::WebPageProxy::createNewPage):
114         (WebKit::WebPageProxy::runJavaScriptAlert):
115         (WebKit::WebPageProxy::runJavaScriptConfirm):
116         (WebKit::WebPageProxy::runJavaScriptPrompt):
117         (WebKit::WebPageProxy::webGLPolicyForURL):
118         (WebKit::WebPageProxy::resolveWebGLPolicyForURL):
119         (WebKit::WebPageProxy::getToolbarsAreVisible):
120         (WebKit::WebPageProxy::getMenuBarIsVisible):
121         (WebKit::WebPageProxy::getStatusBarIsVisible):
122         (WebKit::WebPageProxy::getWindowFrame):
123         (WebKit::WebPageProxy::screenToRootView):
124         (WebKit::WebPageProxy::rootViewToScreen):
125         (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel):
126         (WebKit::WebPageProxy::exceededDatabaseQuota):
127         (WebKit::WebPageProxy::reachedApplicationCacheOriginQuota):
128         * UIProcess/WebPageProxy.h:
129         * UIProcess/WebProcessPool.cpp:
130         (WebKit::WebProcessPool::networkProcessCrashed):
131         (WebKit::WebProcessPool::getNetworkProcessConnection):
132         (WebKit::WebProcessPool::getStorageProcessConnection):
133         * UIProcess/WebProcessPool.h:
134         * UIProcess/WebProcessProxy.cpp:
135         (WebKit::WebProcessProxy::getPluginProcessConnection):
136         (WebKit::WebProcessProxy::getNetworkProcessConnection):
137         (WebKit::WebProcessProxy::getStorageProcessConnection):
138         * UIProcess/WebProcessProxy.h:
139         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
140         (WebKit::WebSWContextManagerConnection::syncTerminateWorker):
141         * WebProcess/Storage/WebSWContextManagerConnection.h:
142         * WebProcess/WebPage/WebPage.h:
143         * WebProcess/WebPage/ios/WebPageIOS.mm:
144         (WebKit::WebPage::computePagesForPrintingAndDrawToPDF):
145
146 2018-05-17  Jer Noble  <jer.noble@apple.com>
147
148         CRASH in -[WKFullScreenViewController _manager]
149         https://bugs.webkit.org/show_bug.cgi?id=185745
150         <rdar://problem/39195241>
151
152         Reviewed by Eric Carlson.
153
154         Protect against WKFullScreenViewController outliving WKWebView by making its
155         _webView property weak. Additionally, add a sanity-check RetainPtr where _webView
156         is referenced multiple times within a function.
157
158         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
159         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
160         (-[WKFullScreenWindowController initWithWebView:]):
161         (-[WKFullScreenWindowController enterFullScreen]):
162         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
163         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
164         (-[WKFullScreenWindowController _completedExitFullScreen]):
165         (-[WKFullScreenWindowController close]):
166         (-[WKFullScreenWindowController webViewDidRemoveFromSuperviewWhileInFullscreen]):
167         (-[WKFullScreenWindowController _exitFullscreenImmediately]):
168         (-[WKFullScreenWindowController _isSecure]):
169         (-[WKFullScreenWindowController _serverTrust]):
170         (-[WKFullScreenWindowController _updateLocationInfo]):
171         (-[WKFullScreenWindowController _manager]):
172         (-[WKFullScreenWindowController _startToDismissFullscreenChanged:]):
173
174 2018-05-17  Brent Fulgham  <bfulgham@apple.com>
175
176         Correct default for StorageAccess API
177         https://bugs.webkit.org/show_bug.cgi?id=185748
178         <rdar://problem/40220659>
179
180         Reviewed by Dean Jackson.
181
182         Flip the default state to 'true' so that the new "sticky" state
183         for Storage Access API and attributing user interaction for
184         Storage Access API use is applied by default.
185
186         * Shared/WebPreferences.yaml:
187
188 2018-05-17  Carlos Alberto Lopez Perez  <clopez@igalia.com>
189
190         [WPE] Implement and enable FULLSCREEN_API
191         https://bugs.webkit.org/show_bug.cgi?id=185676
192
193         Reviewed by Žan Doberšek.
194
195         Do the initial implementation of FULLSCREEN_API for WPE and
196         enable the CMake option by default.
197
198         Most of the layout tests (55 of 58) are passing and the feature
199         seems to work fine on different websites that use it.
200
201         * UIProcess/API/wpe/PageClientImpl.cpp:
202         (WebKit::PageClientImpl::fullScreenManagerProxyClient):
203         (WebKit::PageClientImpl::closeFullScreenManager):
204         (WebKit::PageClientImpl::isFullScreen):
205         (WebKit::PageClientImpl::enterFullScreen):
206         (WebKit::PageClientImpl::exitFullScreen):
207         (WebKit::PageClientImpl::beganEnterFullScreen):
208         (WebKit::PageClientImpl::beganExitFullScreen):
209         * UIProcess/API/wpe/PageClientImpl.h:
210         * UIProcess/API/wpe/WPEView.h:
211         (WKWPE::View::isFullScreen):
212         (WKWPE::View::setFullScreen):
213
214 2018-05-17  Jiewen Tan  <jiewen_tan@apple.com>
215
216         Convert CertificateInfo into Credential in UI Process instead of Networking Process
217         https://bugs.webkit.org/show_bug.cgi?id=185662
218         <rdar://problem/40275561>
219
220         Reviewed by Alex Christensen.
221
222         Right now we convert CertificateInfo into Credential in the very last stage of client certificate authentication process
223         when it reaches Networking Process. This patch moves that conversion earlier in UI Process such that we don't have to
224         pass both Credential and CertificateInfo to Networking Process.
225
226         CertificateInfo is only used in macOS for C API specifically. WK2 includes macOS/iOS relies on NSURLCredential/WebCore::Credential
227         solely. WK2 has already exercised the ability of using WebCore::Credential to do client certficate authentication. This patch therefore
228         takes advantage of that. It converts CertficateInfo objects into Credential objects right after WebCredential is initialized, and then merge
229         any code paths that utilizes CertficateInfo into ones that uses WebCore::Credential.
230
231         Covered by existing tests.
232
233         * Shared/Authentication/AuthenticationManager.cpp:
234         (WebKit::AuthenticationManager::useCredentialForChallenge):
235         (WebKit::AuthenticationManager::useCredentialForSingleChallenge):
236         (WebKit::AuthenticationManager::tryUseCertificateInfoForChallenge): Deleted.
237         * Shared/Authentication/AuthenticationManager.h:
238         * Shared/Authentication/AuthenticationManager.messages.in:
239         * UIProcess/Authentication/AuthenticationChallengeProxy.cpp:
240         (WebKit::AuthenticationChallengeProxy::useCredential):
241         * UIProcess/Authentication/WebCredential.cpp:
242         (WebKit::WebCredential::WebCredential):
243         (WebKit::WebCredential::certificateInfo): Deleted.
244         * UIProcess/Authentication/WebCredential.h:
245         (WebKit::WebCredential::create):
246         * UIProcess/Authentication/mac/WebCredentialMac.mm: Renamed from Source/WebKit/Shared/Authentication/mac/AuthenticationManager.mac.mm.
247         (WebKit::leafCertificate):
248         (WebKit::chain):
249         (WebKit::WebCredential::WebCredential):
250         * WebKit.xcodeproj/project.pbxproj:
251
252 2018-05-17  Jeremy Jones  <jeremyj@apple.com>
253
254         Ensure valid rects for fullsceen animation.
255         https://bugs.webkit.org/show_bug.cgi?id=185736
256         rdar://problem/40320174
257
258         Reviewed by Jer Noble.
259
260         Protect against zero width and height since those can make for NANs in the animation transforms.
261
262         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
263         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
264         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
265
266 2018-05-17  Jer Noble  <jer.noble@apple.com>
267
268         Turn Modern EME API on by default and remove it as an experimental feature
269         https://bugs.webkit.org/show_bug.cgi?id=185693
270         <rdar://problem/39954396>
271
272         Reviewed by Eric Carlson.
273
274         * Shared/WebPreferences.yaml:
275
276 2018-05-17  Dean Jackson  <dino@apple.com>
277
278         Safari optimized flow should be releasing viewer to prevent memory growth with subsequent launches/closes
279         https://bugs.webkit.org/show_bug.cgi?id=185722
280         <rdar://problem/40247351>
281
282         Reviewed by Antoine Quint.
283
284         I made a rookie mistake in the original patch: I was holding a strong
285         reference to "self" in a block, which was causing a retain cycle.
286         Replace that with a WeakObjCPtr.
287
288         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
289         (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
290
291 2018-05-16  Brent Fulgham  <bfulgham@apple.com>
292
293         REGRESSION(r229093)[macOS] Allow network-outbound for syslog use
294         https://bugs.webkit.org/show_bug.cgi?id=185703
295         <rdar://problem/39778918>
296
297         Reviewed by Eric Carlson.
298
299         In r229093 I removed the 'network-outbound' permission for syslog use.
300         Further testing has shown that this is still needed for subsystem
301         logging in our bundle loading code.
302
303         This patch re-enabled network-outbound for syslog.
304
305         * WebProcess/com.apple.WebProcess.sb.in:
306
307 2018-05-16  Andy VanWagoner  <andy@vanwagoner.family>
308
309         Add support for Intl NumberFormat formatToParts
310         https://bugs.webkit.org/show_bug.cgi?id=185375
311
312         Reviewed by Yusuke Suzuki.
313
314         Add flag for NumberFormat formatToParts.
315
316         * Configurations/FeatureDefines.xcconfig:
317
318 2018-05-16  Andy Estes  <aestes@apple.com>
319
320         [Wi-Fi Assertions] Adopt WiFiAssertionHolderAdditions
321         https://bugs.webkit.org/show_bug.cgi?id=185685
322         <rdar://problem/40136681>
323
324         Reviewed by Sam Weinig.
325
326         * NetworkProcess/cocoa/WiFiAssertionHolder.cpp:
327         (WebKit::WiFiAssertionHolder::WiFiAssertionHolder):
328         (WebKit::WiFiAssertionHolder::~WiFiAssertionHolder):
329         (WebKit::ensureWiFiManagerClient): Deleted.
330
331 2018-05-16  Fujii Hironori  <Hironori.Fujii@sony.com>
332
333         [Win] Implement WebPage::handleEditingKeyboardEvent
334         https://bugs.webkit.org/show_bug.cgi?id=185327
335
336         Reviewed by Alexey Proskuryakov.
337
338         * WebProcess/WebPage/win/WebPageWin.cpp:
339         (WebKit::WebPage::handleEditingKeyboardEvent): Copied from WebKitLegacy.
340
341 2018-05-16  Sihui Liu  <sihui_liu@apple.com>
342
343         Session cookies aren't reliably set when using default WKWebSiteDataStore
344         https://bugs.webkit.org/show_bug.cgi?id=185624
345         <rdar://problem/39111626>
346
347         Reviewed by Geoffrey Garen.
348
349         Session cookies of default session were set in UI Process when there was no process pool, 
350         but they were not synced (or synced slowly to) Network Process. To make these cookies visible
351         as soon as they were set through API, we could manually set those cookies in Network Process
352         during its initilization. 
353
354         * NetworkProcess/mac/RemoteNetworkingContext.mm:
355         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
356         * UIProcess/API/APIHTTPCookieStore.cpp:
357         (API::HTTPCookieStore::cookies):
358         (API::HTTPCookieStore::setCookie):
359         (API::HTTPCookieStore::deleteCookie):
360         * UIProcess/WebProcessPool.cpp:
361         (WebKit::WebProcessPool::ensureNetworkProcess):
362         (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
363         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
364         (WebKit::WebsiteDataStore::clearPendingCookies):
365         * UIProcess/WebsiteData/WebsiteDataStore.h:
366
367 2018-05-16  Chris Nardi  <cnardi@chromium.org>
368
369         Remove Document#selectedStylesheetSet/preferredStylesheetSet
370         https://bugs.webkit.org/show_bug.cgi?id=185381
371
372         Reviewed by Darin Adler.
373
374         Make API methods for Document#selectedStylesheetSet/preferredStylesheetSet do nothing.
375
376         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.h:
377         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp:
378         (webkit_dom_document_set_property):
379         (webkit_dom_document_get_property):
380         (webkit_dom_document_get_preferred_stylesheet_set):
381         (webkit_dom_document_get_selected_stylesheet_set):
382         (webkit_dom_document_set_selected_stylesheet_set):
383
384 2018-05-16  Alberto Garcia  <berto@igalia.com>
385
386         [CMake] Properly detect compiler flags, needed libs, and fallbacks for usage of 64-bit atomic operations
387         https://bugs.webkit.org/show_bug.cgi?id=182622
388
389         Reviewed by Michael Catanzaro.
390
391         Move the test to determine whether we need to link against
392         libatomic to the common file WebKitCompilerFlags.cmake so it can
393         also be used for JavaScriptCore.
394
395         * CMakeLists.txt:
396
397 2018-05-15  Yusuke Suzuki  <utatane.tea@gmail.com>
398
399         [JSC] Check TypeInfo first before calling getCallData when we would like to check whether given object is a function
400         https://bugs.webkit.org/show_bug.cgi?id=185601
401
402         Reviewed by Saam Barati.
403
404         * WebProcess/Plugins/Netscape/JSNPObject.h:
405
406 2018-05-15  Sihui Liu  <sihui_liu@apple.com>
407
408         StorageManager::deleteLocalStorageOriginsModifiedSince: database files get deleted before database connections close
409         https://bugs.webkit.org/show_bug.cgi?id=185671
410
411         Reviewed by Geoffrey Garen.
412
413         We should delete database files before closing databases.
414
415         * UIProcess/WebStorage/LocalStorageDatabase.cpp:
416         (WebKit::LocalStorageDatabase::updateDatabaseWithChangedItems):
417         * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
418         (WebKit::LocalStorageDatabaseTracker::databasesModifiedSince):
419         (WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince): Deleted.
420         * UIProcess/WebStorage/LocalStorageDatabaseTracker.h:
421         * UIProcess/WebStorage/StorageManager.cpp:
422         (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
423
424 2018-05-15  Dean Jackson  <dino@apple.com>
425
426         Launch System Preview as the download starts, rather than waiting for a response
427         https://bugs.webkit.org/show_bug.cgi?id=185669
428         <rdar://problem/40278181>
429
430         Reviewed by Tim Horton.
431
432         We were waiting for the RequestResponse to get a MIME-type before
433         launching the system preview. This causes an annoying delay.
434
435         Instead, assume that the system preview is one of the handled
436         mime types and launch the viewer immediately. If it gets something it
437         didn't expect, it will show an error.
438
439         * UIProcess/Cocoa/DownloadClient.mm:
440         (WebKit::DownloadClient::didStart):
441         (WebKit::DownloadClient::didReceiveResponse):
442         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
443         (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
444         (WebKit::SystemPreviewController::start): Small cleanup to ensure we
445         don't try to present twice (this shouldn't happen).
446
447 2018-05-15  Dean Jackson  <dino@apple.com>
448
449         Post-review cleanup for 185459
450         https://bugs.webkit.org/show_bug.cgi?id=185665
451         <rdar://problem/40276689>
452
453         Reviewed by Tim Horton.
454
455         Jon made some comments in 185459 that I'm addressing here.
456
457         * UIProcess/Cocoa/DownloadClient.h:
458         * UIProcess/Cocoa/DownloadClient.mm: Guard the activity token for iOS
459         in a way that means it will still work ok on macOS.
460         (WebKit::DownloadClient::didStart):
461         (WebKit::DownloadClient::processDidCrash):
462         (WebKit::DownloadClient::didFinish):
463         (WebKit::DownloadClient::didFail):
464         (WebKit::DownloadClient::didCancel):
465         (WebKit::DownloadClient::takeActivityToken):
466         (WebKit::DownloadClient::releaseActivityTokenIfNecessary):
467         (WebKit::DownloadClient::releaseActivityToken): Deleted.
468
469         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: Add an early return.
470         (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
471
472 2018-05-15  Tadeu Zagallo  <tzagallo@apple.com>
473
474         Update touch event tracking types on every touch
475         https://bugs.webkit.org/show_bug.cgi?id=184250
476         <rdar://problem/39145092>
477
478         Reviewed by Geoffrey Garen.
479
480         The tracking types for touch events were only update on touchstart, which meant that event
481         listeners added after the touchstart would always be treated as passive, even if explicitly
482         setting passive to false.
483
484         * UIProcess/WebPageProxy.cpp:
485         (WebKit::WebPageProxy::handleTouchEventSynchronously):
486         (WebKit::WebPageProxy::handleTouchEvent):
487
488 2018-05-15  Per Arne Vollan  <pvollan@apple.com>
489
490         Pause display links when window is not visible.
491         https://bugs.webkit.org/show_bug.cgi?id=185627
492         <rdar://problem/39401106>
493
494         Reviewed by Simon Fraser.
495
496         Pause/resume display links created in the UI process when the window is hidden/shown.
497
498         * UIProcess/WebPageProxy.cpp:
499         (WebKit::WebPageProxy::dispatchActivityStateChange):
500         * UIProcess/mac/DisplayLink.cpp:
501         (WebKit::DisplayLink::pause):
502         (WebKit::DisplayLink::resume):
503         * UIProcess/mac/DisplayLink.h:
504
505 2018-05-15  Dean Jackson  <dino@apple.com>
506
507         Provide UIView and UIImage for zoom transition
508         https://bugs.webkit.org/show_bug.cgi?id=185655
509         <rdar://problem/40267224>
510
511         Reviewed by Antoine Quint.
512
513         Provide a UIView* for the frameForPreviewItem to use as a source view.
514         Also implement the transitionImageForPreviewItem delegate, even though
515         we're returning nil.
516
517         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
518         (-[_WKPreviewControllerDelegate previewController:frameForPreviewItem:inSourceView:]):
519         (-[_WKPreviewControllerDelegate previewController:transitionImageForPreviewItem:contentRect:]):
520
521 2018-05-15  Daniel Bates  <dabates@apple.com>
522
523         Fix the Apple Internal build
524
525         Make a similar change to WebKit as I did for LegacyWebKit in r231777. See <rdar://problem/40237873> for more details.
526
527         * UIProcess/mac/WKFullScreenWindowController.mm:
528         (-[WKFullScreenWindowController enterFullScreen:]):
529         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]):
530         (-[WKFullScreenWindowController exitFullScreen]):
531         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
532         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
533         (-[WKFullScreenWindowController completeFinishExitFullScreenAnimationAfterRepaint]):
534         (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]):
535         (-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]):
536
537 2018-05-15  Megan Gardner  <megan_gardner@apple.com>
538
539         Clear selections from web content with single tap
540         https://bugs.webkit.org/show_bug.cgi?id=185634
541
542         Reviewed by Tim Horton.
543         
544         With the switch to the single text selection assistant, we were not correctly clearing the selection when a
545         single tap happened.
546
547         * UIProcess/ios/WKContentViewInteraction.mm:
548         (-[WKContentView _singleTapCommited:]):
549
550 2018-05-15  Antoine Quint  <graouts@apple.com>
551
552         [Web Animations] Expose Web Animations CSS integration as an experimental feature
553         https://bugs.webkit.org/show_bug.cgi?id=185647
554
555         Reviewed by Dean Jackson.
556
557         Rename the Web Animations CSS integration flag.
558
559         * Shared/WebPreferences.yaml:
560         * UIProcess/API/C/WKPreferences.cpp:
561         (WKPreferencesSetWebAnimationsCSSIntegrationEnabled):
562         (WKPreferencesGetWebAnimationsCSSIntegrationEnabled):
563         (WKPreferencesSetCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled): Deleted.
564         (WKPreferencesGetCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled): Deleted.
565         * UIProcess/API/C/WKPreferencesRefPrivate.h:
566         * UIProcess/API/Cocoa/WKPreferences.mm:
567         (-[WKPreferences _setWebAnimationsCSSIntegrationEnabled:]):
568         (-[WKPreferences _webAnimationsCSSIntegrationEnabled]):
569         (-[WKPreferences _setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled:]): Deleted.
570         (-[WKPreferences _cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled]): Deleted.
571         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
572         * WebProcess/InjectedBundle/InjectedBundle.cpp:
573         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
574         (WebKit::InjectedBundle::setWebAnimationsCSSIntegrationEnabled):
575         (WebKit::InjectedBundle::setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled): Deleted.
576         * WebProcess/InjectedBundle/InjectedBundle.h:
577
578 2018-05-15  Dean Jackson  <dino@apple.com>
579
580         Update animation when presenting QuickLook
581         https://bugs.webkit.org/show_bug.cgi?id=185648
582         <rdar://problem/39652624>
583
584         Reviewed by Antoine Quint.
585
586         Implement the QuickLook delegate on _WKPreviewControllerDelegate that
587         produces a zoom-like animation when the QLPreviewController appears.
588
589         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
590         (-[_WKPreviewControllerDelegate previewController:frameForPreviewItem:inSourceView:]):
591         * UIProcess/SystemPreviewController.h: Add a reference back to the page, so that
592         the delegate implementation can access the presentingViewController.
593         (WebKit::SystemPreviewController::page):
594
595 2018-05-14  Dean Jackson  <dino@apple.com>
596
597         Download and present System Preview
598         https://bugs.webkit.org/show_bug.cgi?id=185459
599         <rdar://problem/40079228>
600
601         Reviewed by Tim Horton.
602
603         Extend DownloadClient so that it can handle the case where
604         the download was triggered by a System Preview. In this situation
605         the result (and progress) are piped into QuickLook via the SystemPreviewController.
606
607         The DownloadProxy class is also extended to handle the destination
608         filename and the size of the content.
609
610         Lastly, SystemPreviewController is updated to have a start(), show()
611         and cancel() interface, and no longer adjusts page navigation.
612
613         * UIProcess/Cocoa/DownloadClient.h:
614         * UIProcess/Cocoa/DownloadClient.mm: Handle the SystemPreview case, which
615         doesn't have a download delegate, but instead needs to communicate with
616         the SystemPreviewController, if one exists.
617         (WebKit::DownloadClient::didStart):
618         (WebKit::DownloadClient::didReceiveResponse):
619         (WebKit::DownloadClient::didReceiveData):
620         (WebKit::DownloadClient::didCreateDestination):
621         (WebKit::DownloadClient::processDidCrash):
622         (WebKit::DownloadClient::decideDestinationWithSuggestedFilename):
623         (WebKit::DownloadClient::didFinish):
624         (WebKit::DownloadClient::didFail):
625         (WebKit::DownloadClient::didCancel):
626         (WebKit::DownloadClient::releaseActivityToken):
627
628         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: Implement the new API.
629         (-[_WKPreviewControllerDataSource initWithMIMEType:]):
630         (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
631         (-[_WKPreviewControllerDataSource setProgress:]):
632         (-[_WKPreviewControllerDataSource finish:]):
633         (-[_WKPreviewControllerDelegate previewControllerDidDismiss:]):
634         (WebKit::SystemPreviewController::start):
635         (WebKit::SystemPreviewController::updateProgress):
636         (WebKit::SystemPreviewController::finish):
637         (WebKit::SystemPreviewController::cancel):
638         (-[_WKPreviewControllerDataSource initWithURL:]): Deleted.
639         (-[_WKPreviewControllerDelegate previewControllerWillDismiss:]): Deleted.
640         (WebKit::SystemPreviewController::canPreview const): Deleted.
641         (WebKit::SystemPreviewController::showPreview): Deleted.
642         * UIProcess/Downloads/DownloadProxy.h: Track the destination file by name
643         and size. Also expose a helper to identify system preview downloads.
644         (WebKit::DownloadProxy::destinationFilename const):
645         (WebKit::DownloadProxy::setDestinationFilename):
646         (WebKit::DownloadProxy::expectedContentLength const):
647         (WebKit::DownloadProxy::setExpectedContentLength):
648         (WebKit::DownloadProxy::bytesLoaded const):
649         (WebKit::DownloadProxy::setBytesLoaded):
650         (WebKit::DownloadProxy::isSystemPreviewDownload const):
651
652         * UIProcess/SystemPreviewController.cpp: New API.
653         (WebKit::SystemPreviewController::canPreview const):
654         (WebKit::SystemPreviewController::sendPageBack): Deleted.
655         (WebKit::SystemPreviewController::showPreview): Deleted.
656         * UIProcess/SystemPreviewController.h:
657
658         * UIProcess/WebPageProxy.cpp:
659         (WebKit::m_configurationPreferenceValues):
660         (WebKit::WebPageProxy::reattachToWebProcess):
661         (WebKit::WebPageProxy::resetState):
662         * UIProcess/WebPageProxy.h:
663
664 2018-05-14  Brady Eidson  <beidson@apple.com>
665
666         Add an API test to guard against regressions while re-entering setDefersLoading:.
667         <rdar://problem/37033737> and https://bugs.webkit.org/show_bug.cgi?id=185630
668
669         Reviewed by Chris Dumez.
670
671         * UIProcess/API/Cocoa/WKWebView.mm:
672         (-[WKWebView _setDefersLoadingForTesting:]):
673         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
674
675         * UIProcess/WebPageProxy.cpp:
676         (WebKit::WebPageProxy::setDefersLoadingForTesting):
677         * UIProcess/WebPageProxy.h:
678         * WebProcess/WebPage/WebPage.messages.in:
679
680 2018-05-14  Tim Horton  <timothy_horton@apple.com>
681
682         Use the system font by default in extra zoom mode
683         https://bugs.webkit.org/show_bug.cgi?id=185638
684         <rdar://problem/40230277>
685
686         Reviewed by Wenson Hsieh.
687
688         * Shared/WebPreferencesDefaultValues.h:
689
690 2018-05-14  Michael Catanzaro  <mcatanzaro@igalia.com>
691
692         Unreviewed, rolling out r231755.
693
694         Change is not correct
695
696         Reverted changeset:
697
698         "-Wmemset-elt-size warning in LibWebRTCSocket constructor"
699         https://bugs.webkit.org/show_bug.cgi?id=185555
700         https://trac.webkit.org/changeset/231755
701
702 2018-05-14  Wenson Hsieh  <wenson_hsieh@apple.com>
703
704         [Extra zoom mode] Google search results are excessively zoomed in
705         https://bugs.webkit.org/show_bug.cgi?id=185347
706         <rdar://problem/39999778>
707
708         Reviewed by Tim Horton.
709
710         Adds a new experimental feature for the "disabled-adaptations" meta tag, and adds plumbing in WebKit to
711         propagate disabled adaptation changes to the ViewportConfiguration. The experimental feature is on by default in
712         extra zoom mode.
713
714         * Shared/WebPreferences.yaml:
715         * Shared/WebPreferencesDefaultValues.h:
716         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
717         (WebKit::WebChromeClient::dispatchDisabledAdaptationsDidChange const):
718         * WebProcess/WebCoreSupport/WebChromeClient.h:
719         * WebProcess/WebPage/WebPage.cpp:
720         (WebKit::WebPage::disabledAdaptationsDidChange):
721         * WebProcess/WebPage/WebPage.h:
722
723 2018-05-14  Chris Dumez  <cdumez@apple.com>
724
725         Overly aggressive timer throttling in service workers
726         https://bugs.webkit.org/show_bug.cgi?id=185575
727         <rdar://problem/40219038>
728
729         Reviewed by Geoff Garen.
730
731         After ~30 seconds, the system would put the service worker process in "App Nap",
732         causing its timers to get aggressively throttled. This happens because the
733         service worker processes are WebProcesses that have no visible WebPages.
734
735         To address the issue, we now disable process suppression for all service worker
736         processes. This causes those processes to construct a UserActivity which prevents
737         App Nap.
738
739         This patch also refactors the code a bit to avoid duplication. The ProcessSuppression
740         suppression logic in now all on ChildProcessProxy / ChildProcess.
741
742         * NetworkProcess/NetworkProcess.messages.in:
743         * PluginProcess/PluginProcess.messages.in:
744         * Shared/ChildProcess.messages.in:
745         * UIProcess/ChildProcessProxy.cpp:
746         (WebKit::ChildProcessProxy::setProcessSuppressionEnabled):
747         * UIProcess/ChildProcessProxy.h:
748         * UIProcess/Network/NetworkProcessProxy.h:
749         * UIProcess/Network/mac/NetworkProcessProxyMac.mm: Removed.
750         * UIProcess/Plugins/PluginProcessProxy.h:
751         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
752         * UIProcess/ServiceWorkerProcessProxy.cpp:
753         (WebKit::ServiceWorkerProcessProxy::didFinishLaunching):
754         * UIProcess/ServiceWorkerProcessProxy.h:
755         * UIProcess/WebProcessProxy.h:
756         * WebKit.xcodeproj/project.pbxproj:
757         * WebProcess/WebProcess.messages.in:
758
759 2018-05-14  Andy Estes  <aestes@apple.com>
760
761         [Wi-Fi Assertions] Allow clients to specify a context identifier
762         https://bugs.webkit.org/show_bug.cgi?id=185620
763         <rdar://problem/39915196>
764
765         Reviewed by Brady Eidson.
766
767         Added an SPI on _WKProcessPoolConfiguration that allows clients to specify a
768         context identifier.
769
770         * NetworkProcess/NetworkProcessCreationParameters.cpp:
771         (WebKit::NetworkProcessCreationParameters::encode const):
772         (WebKit::NetworkProcessCreationParameters::decode):
773         * NetworkProcess/NetworkProcessCreationParameters.h:
774         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
775         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
776         * UIProcess/API/APIProcessPoolConfiguration.cpp:
777         (API::ProcessPoolConfiguration::copy):
778         * UIProcess/API/APIProcessPoolConfiguration.h:
779         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
780         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
781         (-[_WKProcessPoolConfiguration wirelessContextIdentifier]):
782         (-[_WKProcessPoolConfiguration setWirelessContextIdentifier:]):
783         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
784         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
785
786 2018-05-11  Brian Burg  <bburg@apple.com>
787
788         Web Automation: Automation.getBrowsingContext returns window origin that differs from window.screenX/Y
789         https://bugs.webkit.org/show_bug.cgi?id=185571
790         <rdar://problem/40180785>
791
792         Reviewed by Timothy Hatcher.
793
794         This code path was refactored to use completion handlers. It seems that the window.screenX/Y
795         code path converts back to user coordinates but the WebDriver code path does not. Make them
796         consistent since that is how it is spec'd and tested.
797
798         * UIProcess/WebPageProxy.cpp:
799         (WebKit::WebPageProxy::getWindowFrameWithCallback):
800         Convert the window frame to user coordinate space so it's the same as window.screenY.
801
802 2018-05-14  Brian Burg  <bburg@apple.com>
803
804         WebDriver: W3C test case actions/key.py::test_lone_keyup_sends_no_events is failing
805         https://bugs.webkit.org/show_bug.cgi?id=185577
806         <rdar://problem/40185478>
807
808         Reviewed by Timothy Hatcher.
809
810         This test is failing because it expects Release Actions to not emit any
811         events if nothing has changed from the initial state. Because the two code paths
812         for creating empty states don't actually produce the same empty state, a difference
813         in location was detected between the two empty states. This generates a mousemove.
814
815         To fix this, unify the code that creates an empty state. For mouse input sources, always
816         initialize the location to (0, 0) so that the mouse input source always has
817         a location that is valid to click at.
818
819         * UIProcess/Automation/SimulatedInputDispatcher.h:
820         Extract the type enum out of the class to avoid circular definitions of
821         SimulatedInputSource and SimulatedInputSourceState.
822
823         * UIProcess/Automation/SimulatedInputDispatcher.cpp:
824         (WebKit::SimulatedInputSourceState::emptyStateForSourceType):
825         Take the input source type when generating an empty state. We always want location
826         set for a mouse input source, but not set it for other input sources like keys.
827
828         (WebKit::SimulatedInputKeyFrame::keyFrameToResetInputSources):
829         (WebKit::SimulatedInputDispatcher::transitionInputSourceToState):
830         (WebKit::SimulatedInputSource::create):
831         (WebKit::SimulatedInputSource::SimulatedInputSource):
832         (WebKit::SimulatedInputSourceState::emptyState): Deleted.
833         * UIProcess/Automation/WebAutomationSession.cpp:
834         (WebKit::WebAutomationSession::WebAutomationSession):
835         (WebKit::WebAutomationSession::inputSourceForType const):
836         (WebKit::simulatedInputSourceTypeFromProtocolSourceType):
837         (WebKit::WebAutomationSession::performInteractionSequence):
838         * UIProcess/Automation/WebAutomationSession.h:
839
840 2018-05-14  Michael Catanzaro  <mcatanzaro@igalia.com>
841
842         -Wmemset-elt-size warning in LibWebRTCSocket constructor
843         https://bugs.webkit.org/show_bug.cgi?id=185555
844
845         Reviewed by Youenn Fablet.
846
847         Add missing multiplication.
848
849         * WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
850         (WebKit::LibWebRTCSocket::LibWebRTCSocket):
851
852 2018-05-14  Zan Dobersek  <zdobersek@igalia.com>
853
854         [GTK] REGRESSION(r231170) Build broken with Clang 5.0
855         https://bugs.webkit.org/show_bug.cgi?id=185198
856
857         Reviewed by Michael Catanzaro.
858
859         * Shared/RTCNetwork.h: With std::optional forward declaration gone,
860         explicitly include the WTF Optional.h header.
861
862 2018-05-13  Dean Jackson  <dino@apple.com>
863
864         WebKit2_Sim-7606.1.17.4 introduced dep cycle
865         https://bugs.webkit.org/show_bug.cgi?id=185588
866         <rdar://problem/40196581>
867
868         Reviewed by Tim Horton.
869
870         Soft link AssetViewer.framework to avoid a dependency cycle.
871
872         * Configurations/WebKit.xcconfig:
873         * UIProcess/ios/WKSystemPreviewView.mm:
874         (-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]):
875
876 2018-05-11  Daniel Bates  <dabates@apple.com>
877
878         X-Frame-Options: SAMEORIGIN needs to check all ancestor frames
879         https://bugs.webkit.org/show_bug.cgi?id=185567
880         <rdar://problem/40175008>
881
882         Reviewed by Brent Fulgham.
883
884         Change the behavior of "X-Frame-Options: SAMEORIGIN" to ensure that all ancestors frames
885         are same-origin with the document that delivered this header. This prevents an intermediary
886         malicious frame from clickjacking a child frame whose document is same-origin with the top-
887         level frame. It also makes the behavior of X-Frame-Options in WebKit more closely match
888         the behavior of X-Frame-Options in other browsers, including Chrome and Firefox.
889         
890         Currently a document delivered with "X-Frame-Options: SAMEORIGIN" must only be same-origin
891         with the top-level frame's document in order to be displayed. This prevents clickjacking by
892         a malicious page that embeds a page delivered with "X-Frame-Options: SAMEORIGIN". However,
893         it does not protect against clickjacking of the "X-Frame-Options: SAMEORIGIN" page (victim)
894         if embedded by an intermediate malicious iframe, say a "rogue ad", that was embedded in a
895         document same origin with the victim page. We should protect against such attacks.
896
897         * NetworkProcess/NetworkResourceLoader.cpp:
898         (WebKit::NetworkResourceLoader::shouldInterruptLoadForXFrameOptions):
899
900 2018-05-11  Dean Jackson  <dino@apple.com>
901
902         WKWebViewContentProvider should know what MIME type it was created to handle
903         https://bugs.webkit.org/show_bug.cgi?id=185574
904         <rdar://problem/40183049>
905
906         Reviewed by Tim Horton.
907
908         Pass the MIME type of the downloaded asset into the WKWebViewContentProvider's
909         init method, so it can choose to do something based on that information. The
910         PDF and LegacyPDF views don't care because they, clearly, only handle PDF. But
911         a WKSystemPreviewView can handle multiple types.
912
913         * UIProcess/API/Cocoa/WKWebView.mm:
914         (-[WKWebView _setHasCustomContentView:loadedMIMEType:]): Send the MIME type on
915         to the WKWebViewContentProvider.
916         * UIProcess/Cocoa/WKWebViewContentProvider.h: Add a new parameter to web_initWithFrame.
917         * UIProcess/ios/WKLegacyPDFView.mm:
918         (-[WKLegacyPDFView web_initWithFrame:webView:mimeType:]):
919         (-[WKLegacyPDFView web_initWithFrame:webView:]): Deleted.
920         * UIProcess/ios/WKPDFView.mm:
921         (-[WKPDFView web_initWithFrame:webView:mimeType:]):
922         (-[WKPDFView web_initWithFrame:webView:]): Deleted.
923         * UIProcess/ios/WKSystemPreviewView.mm:
924         (-[WKSystemPreviewView web_initWithFrame:webView:mimeType:]):
925         (-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]): Actually use
926         the MIME type to tell QuickLook what it will be getting, rather than basing it on
927         the file extension.
928         (-[WKSystemPreviewView web_initWithFrame:webView:]): Deleted.
929
930 2018-05-11  Brent Fulgham  <bfulgham@apple.com>
931
932         Allow the WebContent process to read global ViewBridge preferences
933         https://bugs.webkit.org/show_bug.cgi?id=185569
934         <rdar://problem/40164339>
935
936         Reviewed by Eric Carlson.
937
938         Allow reads of the global /Library/Preferences/com.apple.ViewBridge.plist preference file.
939
940         * WebProcess/com.apple.WebProcess.sb.in:
941
942 2018-05-11  Megan Gardner  <megan_gardner@apple.com>
943
944         Cleanup canPerformActionForWebView in relation to the webSelectionAssistant being removed
945         https://bugs.webkit.org/show_bug.cgi?id=185536
946
947         Reviewed by Tim Horton.
948         
949         The _webSelectionAssistant is now always nil, therefor many of these checks are unnecessary.
950         Remove the check for a webSelection and clean up the logic surrounding those checks.
951
952         * UIProcess/ios/WKContentViewInteraction.mm:
953         (-[WKContentView canPerformActionForWebView:withSender:]):
954
955 2018-05-11  Brady Eidson  <beidson@apple.com>
956
957         Followup to: Make sure history navigations reuse the existing process when necessary.
958         https://bugs.webkit.org/show_bug.cgi?id=185532
959
960         Reviewed by Andy Estes.
961
962         * UIProcess/WebProcessPool.cpp:
963         (WebKit::WebProcessPool::processForNavigationInternal): When re-using the same process,
964           don't change the policy action.
965
966 2018-05-11  Charles Vazac  <cvazac@gmail.com>
967
968         Runtime feature flag for Server-Timing
969         https://bugs.webkit.org/show_bug.cgi?id=184758
970
971         Reviewed by Youenn Fablet.
972
973         * Shared/WebPreferences.yaml: Added ServerTimingEnabled.
974         * UIProcess/API/C/WKPreferences.cpp:
975         (WKPreferencesGetServerTimingEnabled):
976         * UIProcess/API/C/WKPreferencesRefPrivate.h: WK_EXPORT for WKPreferencesSetServerTimingEnabled.
977         * WebProcess/Storage/WebSWContextManagerConnection.cpp: Call setServerTimingEnabled.
978
979 2018-05-11  Antti Koivisto  <antti@apple.com>
980
981         Network process should not stat() all cache files on startup to find their sizes
982         https://bugs.webkit.org/show_bug.cgi?id=185542
983         <rdar://problem/40092953>
984
985         Reviewed by Chris Dumez.
986
987         This is done to compute how much disk space a cache is using. While the operation happens
988         in a background priority thread it is still quite a bit of work.
989
990         Large bodies are saved in separate blob files so record file sizes are capped. We can avoid work by
991         estimating their size instead of counting it exactly.
992
993         * NetworkProcess/cache/NetworkCacheStorage.cpp:
994         (WebKit::NetworkCache::estimateRecordsSize):
995         (WebKit::NetworkCache::Storage::synchronize):
996
997             Use size estimation if blob storage is in use.
998             Remove the code that would delete empty files. Normal cache shrinking handles this.
999
1000         (WebKit::NetworkCache::Storage::shouldStoreBodyAsBlob):
1001
1002 2018-05-11  Brady Eidson  <beidson@apple.com>
1003
1004         Make sure history navigations reuse the existing process when necessary.
1005         <rdar://problem/39746516> and https://bugs.webkit.org/show_bug.cgi?id=185532
1006
1007         Reviewed by Ryosuke Niwa.
1008
1009         If a view navigates to either a data: or blob: URL, it reuses the existing process.
1010  
1011         In such cases we need to also ensure that history navigations back will also reuse the existing process.
1012
1013         * Shared/NavigationActionData.cpp:
1014         (WebKit::NavigationActionData::encode const):
1015         (WebKit::NavigationActionData::decode):
1016         * Shared/NavigationActionData.h:
1017
1018         * UIProcess/API/APINavigation.h:
1019         (API::Navigation::setTargetItem):
1020
1021         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
1022         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
1023         (-[_WKProcessPoolConfiguration pageCacheEnabled]):
1024         (-[_WKProcessPoolConfiguration setPageCacheEnabled:]):
1025
1026         * UIProcess/WebPageProxy.cpp:
1027         (WebKit::WebPageProxy::receivedPolicyDecision):
1028         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1029
1030         * UIProcess/WebProcessPool.cpp:
1031         (WebKit::WebProcessPool::processForNavigationInternal): If the current and target back/forward items both
1032           came from the same process, then reuse the existing process.
1033
1034         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1035         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1036
1037 2018-05-10  Brent Fulgham  <bfulgham@apple.com>
1038
1039         REGRESSION(r231057): Encrypted media content playback failures
1040         https://bugs.webkit.org/show_bug.cgi?id=185537
1041         <rdar://problem/40038478>
1042
1043         Reviewed by Eric Carlson.
1044
1045         Put access to the SecurityServer back in the sandbox so we can validate the
1046         signatures of media encoder/decoders.
1047
1048         * WebProcess/com.apple.WebProcess.sb.in:
1049
1050 2018-05-11  Youenn Fablet  <youenn@apple.com>
1051
1052         NetworkCORSPreflightChecker should proceed when having a ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested challenge
1053         https://bugs.webkit.org/show_bug.cgi?id=185522
1054         <rdar://problem/39987152>
1055
1056         Reviewed by Brent Fulgham.
1057
1058         In case of such challenge, refuse to proceed with authentication since preflight is not using credentials.
1059         Previously, we were failing right away which is not right in case preflight is the request triggering the connection.
1060
1061         Manually tested.
1062
1063         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
1064         (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
1065
1066 2018-05-10  Daniel Bates  <dabates@apple.com>
1067
1068         Use PlatformStrategies to switch between WebKit and WebKitLegacy checking of CSP frame-ancestors and X-Frame-Options
1069         https://bugs.webkit.org/show_bug.cgi?id=185412
1070
1071         Reviewed by Ryosuke Niwa.
1072
1073         Update code for renaming and write in terms of WebLoaderStrategy::shouldPerformSecurityChecks()
1074         instead of explicitly querying RuntimeEnabledFeatures::sharedFeatures().restrictedHTTPResponseAccess().
1075
1076         * WebProcess/Network/WebLoaderStrategy.cpp:
1077         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
1078         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
1079         (WebKit::WebLoaderStrategy::startPingLoad):
1080         (WebKit::WebLoaderStrategy::preconnectTo):
1081         (WebKit::WebLoaderStrategy::shouldPerformSecurityChecks const):
1082         (WebKit::WebLoaderStrategy::havePerformedSecurityChecks const):
1083         (WebKit::WebLoaderStrategy::isDoingLoadingSecurityChecks const): Deleted.
1084         * WebProcess/Network/WebLoaderStrategy.h:
1085         * WebProcess/WebPage/WebPage.cpp:
1086
1087 2018-05-10  Timothy Horton  <timothy_horton@apple.com>
1088
1089         Fix the build after r231393
1090         ​https://bugs.webkit.org/show_bug.cgi?id=185519
1091         <rdar://problem/40131741>
1092
1093         * Configurations/WebKit.xcconfig:
1094
1095 2018-05-10  John Wilander  <wilander@apple.com>
1096
1097         Storage Access API: Extend lifetime of cookies on successful user approval
1098         https://bugs.webkit.org/show_bug.cgi?id=185534
1099         <rdar://problem/40064547>
1100
1101         Reviewed by Brent Fulgham.
1102
1103         * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
1104         (WebKit::WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded):
1105             Picks up the experimental feature flag.
1106         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1107         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccessInternal):
1108             Now updates the domain's user interaction timestamp if the user was
1109             prompted for this access.
1110         * UIProcess/WebResourceLoadStatisticsStore.h:
1111
1112 2018-05-10  Chris Dumez  <cdumez@apple.com>
1113
1114         [iOS] Release page load process assertion if the screen is locked
1115         https://bugs.webkit.org/show_bug.cgi?id=185333
1116
1117         Reviewed by Geoff Garen.
1118
1119         We normally take a background process assertion during page loads to allow them to complete
1120         even if the tab / app is backgrounded. We should however avoid doing so when the backgrounding
1121         is caused by the screen locking. Keeping the process assertion in this case would prevent the
1122         whole device from sleeping longer than it should, thus negatively impacting power.
1123
1124         * UIProcess/Cocoa/NavigationState.h:
1125         * UIProcess/Cocoa/NavigationState.mm:
1126         (WebKit::NavigationState::NavigationState):
1127         (WebKit::NavigationState::releaseNetworkActivityToken):
1128         (WebKit::NavigationState::didChangeIsLoading):
1129         * UIProcess/ios/WebPageProxyIOS.mm:
1130         (WebKit::WebPageProxy::applicationDidEnterBackground):
1131
1132 2018-05-10  Megan Gardner  <megan_gardner@apple.com>
1133
1134         Remove Unused Chinese/Japanese Reanalyze code
1135         https://bugs.webkit.org/show_bug.cgi?id=185529
1136
1137         Reviewed by Wenson Hsieh.
1138         
1139         The code for this has actually been completely removed from UIKit. This is unreachable 
1140         dead code that should be removed if just for cleanliness. 
1141
1142         * Platform/spi/ios/UIKitSPI.h:
1143         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1144         * UIProcess/ios/WKContentViewInteraction.h:
1145         * UIProcess/ios/WKContentViewInteraction.mm:
1146         (-[WKContentView canPerformActionForWebView:withSender:]):
1147         (-[WKContentView _reanalyzeForWebView:]): Deleted.
1148
1149 2018-05-10  Chris Dumez  <cdumez@apple.com>
1150
1151         [iOS] Apps that are not visible may not get suspended if they trigger page loads while in the background
1152         https://bugs.webkit.org/show_bug.cgi?id=185318
1153
1154         Reviewed by Geoffrey Garen.
1155
1156         Whenever there is a page load going on, we take a background process assertion to delay process
1157         suspension until this load completes. However, there is also a 3 seconds grace period after
1158         a load is complete to allow the app to trigger a new load shortly after. This grace period was
1159         introduced to support use cases where a visible app does loads in an offscreen view. However,
1160         it can be abused by apps running in the background as they could trigger new page loads while
1161         in the background to delay process suspension. This patch tightens the policy so that only
1162         apps that are currently visible get to use this grace period. Apps that are in the background
1163         get to finish their current load and will then get suspended.
1164
1165         * UIProcess/Cocoa/NavigationState.mm:
1166         (WebKit::NavigationState::didChangeIsLoading):
1167
1168 2018-05-10  Chris Dumez  <cdumez@apple.com>
1169
1170         'Cross-Origin-Options header implementation follow-up
1171         https://bugs.webkit.org/show_bug.cgi?id=185520
1172
1173         Reviewed by Ryosuke Niwa.
1174
1175         * WebProcess/WebPage/WebPage.cpp:
1176         (WebKit::WebPage::frameBecameRemote):
1177
1178 2018-05-10  Per Arne Vollan  <pvollan@apple.com>
1179
1180         Drop-down Control borders missing.
1181         https://bugs.webkit.org/show_bug.cgi?id=185500
1182         <rdar://problem/40093461>
1183
1184         Reviewed by Brent Fulgham.
1185
1186         Open sandbox for reading of some files in temp folder.
1187
1188         * WebProcess/com.apple.WebProcess.sb.in:
1189
1190 2018-05-10  Eric Carlson  <eric.carlson@apple.com>
1191
1192         [MediaStream, iOS] Don't check authorizationStatusForMediaType when using mock capture devices
1193         https://bugs.webkit.org/show_bug.cgi?id=185516
1194         <rdar://problem/36328191>
1195
1196         Reviewed by Youenn Fablet.
1197
1198         * UIProcess/Cocoa/UIDelegate.mm:
1199         (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest): Don't check
1200         +[AVCaptureDevice authorizationStatusForMediaType:] when using mock capture devices.
1201
1202 2018-05-10  Brent Fulgham  <bfulgham@apple.com>
1203
1204         REGRESSION(r230323): UIProcess needs to notify WebContent process of Accessibility setting changes
1205         https://bugs.webkit.org/show_bug.cgi?id=185515
1206         <rdar://problem/39627764>
1207
1208         Reviewed by Chris Fleizach.
1209
1210         The UIProcess needs to register for relevant Accessibility preference updates so that it can notify the
1211         WebContent processes that screen properties have changed.
1212
1213         This is represented by NSWorkspaceAccessibilityDisplayOptionsDidChangeNotification.
1214
1215         Tested manually with the Accessibility preferences pane.
1216
1217         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1218         (WebKit::WebProcessPool::registerNotificationObservers): Add notification observer. When the notification
1219         is received, call 'screenPropertiesStateChanged' to message the information to the WebContent processes.
1220         (WebKit::WebProcessPool::unregisterNotificationObservers): Clean up observer.
1221         * UIProcess/WebProcessPool.cpp:
1222         (WebKit::WebProcessPool::screenPropertiesStateChanged): Added helper function.
1223         * UIProcess/WebProcessPool.h:
1224
1225 2018-05-09  Carlos Garcia Campos  <cgarcia@igalia.com>
1226
1227         WebDriver: implement advance user interactions
1228         https://bugs.webkit.org/show_bug.cgi?id=174616
1229
1230         Reviewed by Brian Burg.
1231
1232         Handle origin in case of mouse move transitions.
1233
1234         * UIProcess/Automation/Automation.json: Add MouseMoveOrigin enum and pass it as parameter of InputSourceState
1235         together with optional node handle. Also pass the frame handle to performInteractionSequence command to find the
1236         node in the current browsing context.
1237         * UIProcess/Automation/SimulatedInputDispatcher.cpp:
1238         (WebKit::SimulatedInputKeyFrame::keyFrameToResetInputSources): Ensure we reset the location.
1239         (WebKit::SimulatedInputDispatcher::resolveLocation): Helper to resolve destination location based on current
1240         location and mouse move origin.
1241         (WebKit::SimulatedInputDispatcher::transitionInputSourceToState): Use resolveLocation() in mouse transitions.
1242         (WebKit::SimulatedInputDispatcher::run): Receive and save the frame ID.
1243         (WebKit::SimulatedInputDispatcher::finishDispatching): Reset the frame ID.
1244         * UIProcess/Automation/SimulatedInputDispatcher.h:
1245         * UIProcess/Automation/WebAutomationSession.cpp:
1246         (WebKit::WebAutomationSession::computeElementLayout): Use even numbers for the callback ID to not conflict with
1247         viewportInViewCenterPointOfElement() callbacks.
1248         (WebKit::WebAutomationSession::didComputeElementLayout): Handle computeElementLayout() or
1249         viewportInViewCenterPointOfElement() requests by calling the right callback depending on whether the ID is odd
1250         or even number.
1251         (WebKit::WebAutomationSession::viewportInViewCenterPointOfElement): Send ComputeElementLayout message to the
1252         WebProcess using odd numbers for the callback ID to not conflict with computeElementLayout() callbacks.
1253         (WebKit::WebAutomationSession::performInteractionSequence): Handle the mouse origin and element handle.
1254         (WebKit::WebAutomationSession::cancelInteractionSequence): Pass the frame ID to the input dispatcher.
1255         * UIProcess/Automation/WebAutomationSession.h:
1256         * UIProcess/Automation/WebAutomationSessionMacros.h:
1257
1258 2018-05-09  Tim Horton  <timothy_horton@apple.com>
1259
1260         Remove the unused HAVE_OS_ACTIVITY
1261         https://bugs.webkit.org/show_bug.cgi?id=185501
1262
1263         Reviewed by Wenson Hsieh.
1264
1265         * config.h:
1266
1267 2018-05-09  Chris Dumez  <cdumez@apple.com>
1268
1269         Add initial support for 'Cross-Origin-Options' HTTP response header
1270         https://bugs.webkit.org/show_bug.cgi?id=184996
1271         <rdar://problem/39664620>
1272
1273         Reviewed by Geoff Garen.
1274
1275         * Shared/WebPreferences.yaml:
1276         Add this as an experimental feature, on by default.
1277
1278         * WebProcess/WebPage/WebPage.cpp:
1279         (WebKit::WebPage::frameBecameRemote):
1280         Make sure we pass the cross-origin options from the local Window
1281         to the remote one when transitioning.
1282
1283 2018-05-09  Wenson Hsieh  <wenson_hsieh@apple.com>
1284
1285         [Extra zoom mode] fast/viewport/extrazoom/viewport-change-min-device-width.html sometimes fails
1286         https://bugs.webkit.org/show_bug.cgi?id=185490
1287         <rdar://problem/40097629>
1288
1289         Reviewed by Tim Horton.
1290
1291         This test is currently flaky due to incorrect logic when computing the unobscured content rect, in the slice of
1292         time after a frame load has been committed, and before the first visible content rect update from the UI process
1293         after the frame load has been committed.
1294
1295         * WebProcess/WebPage/ios/WebPageIOS.mm:
1296         (WebKit::WebPage::viewportConfigurationChanged):
1297
1298         In the case where !m_hasReceivedVisibleContentRectsAfterDidCommitLoad, we try to set the unobscured content size
1299         to be the view size divided by the initial scale. However, in extra zoom mode, `ViewportConfiguration`'s
1300         `minimumLayoutSize()` is the layout size, which is larger than the size of the view by default, so dividing this
1301         by the initial scale yields a bogus value. Instead, use `viewLayoutSize()` instead.
1302
1303         (WebKit::WebPage::updateViewportSizeForCSSViewportUnits):
1304
1305         We also try to divide the view size by the initial scale when computing the effective viewport size for `vw` and
1306         `vh`. Additionally, fix the misleading name of a variable (largestUnobscuredRect) that stores a size.
1307
1308 2018-05-09  Brent Fulgham  <bfulgham@apple.com>
1309
1310         Restrict unarchiving of bundle parameters to a set of known classes
1311         https://bugs.webkit.org/show_bug.cgi?id=185489
1312         <rdar://problem/21912401>
1313
1314         Reviewed by Ryosuke Niwa.
1315
1316         Stop accepting anything derived from NSObject, and instead only agree to unarchive objects
1317         from a set of things we actually pass as InjectedBundle parameters.
1318
1319         * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
1320         (WebKit::InjectedBundle::setBundleParameter):
1321
1322 2018-05-09  Richard Houle  <rhoule@apple.com>
1323
1324         [Cocoa] Some fields are not identified as [WKWebProcessPlugInNodeHandle isTextField]
1325         https://bugs.webkit.org/show_bug.cgi?id=185260
1326         <rdar://problem/39290394>
1327
1328         INPUT element are not considered to be text fields when
1329         calling -[WKWebProcessPlugInNodeHandle isTextField]
1330         when they are of type number.
1331
1332         Reviewed by Tim Horton.
1333
1334         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
1335         (WebKit::InjectedBundleNodeHandle::isTextField const):
1336
1337 2018-05-09  Youenn Fablet  <youenn@apple.com>
1338
1339         Allow WebResourceLoader to cancel a load served from a service worker
1340         https://bugs.webkit.org/show_bug.cgi?id=185274
1341
1342         Reviewed by Chris Dumez.
1343
1344         Use FetchIdentifier instead of uint64_t.
1345         Add IPC support for cancelling a fetch from WebProcess to service worker process.
1346         Ask service worker process to cancel the fetch when its corresponding WebResourceLoader is cancelled.
1347         No change of behavior as once a WebResourceLoader is cancelled, any related IPC is not processed.
1348         A follow-up patch should try to cancel the FetchResponse load, meaning to either cancel the network load
1349         or to abort reading the readable stream.
1350
1351         * Scripts/webkit/messages.py:
1352         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1353         (WebKit::WebSWServerConnection::cancelFetch):
1354         (WebKit::WebSWServerConnection::startFetch):
1355         (WebKit::WebSWServerConnection::didReceiveFetchResponse):
1356         (WebKit::WebSWServerConnection::didReceiveFetchData):
1357         (WebKit::WebSWServerConnection::didReceiveFetchFormData):
1358         (WebKit::WebSWServerConnection::didFinishFetch):
1359         (WebKit::WebSWServerConnection::didFailFetch):
1360         (WebKit::WebSWServerConnection::didNotHandleFetch):
1361         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1362         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
1363         * StorageProcess/StorageProcess.cpp:
1364         (WebKit::StorageProcess::didFailFetch):
1365         (WebKit::StorageProcess::didNotHandleFetch):
1366         (WebKit::StorageProcess::didReceiveFetchResponse):
1367         (WebKit::StorageProcess::didReceiveFetchData):
1368         (WebKit::StorageProcess::didReceiveFetchFormData):
1369         (WebKit::StorageProcess::didFinishFetch):
1370         * StorageProcess/StorageProcess.h:
1371         * StorageProcess/StorageProcess.messages.in:
1372         * WebProcess/Network/WebLoaderStrategy.cpp:
1373         (WebKit::WebLoaderStrategy::remove):
1374         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
1375         (WebKit::ServiceWorkerClientFetch::create):
1376         (WebKit::ServiceWorkerClientFetch::ServiceWorkerClientFetch):
1377         (WebKit::ServiceWorkerClientFetch::start):
1378         (WebKit::ServiceWorkerClientFetch::cancel):
1379         * WebProcess/Storage/ServiceWorkerClientFetch.h:
1380         * WebProcess/Storage/WebSWClientConnection.cpp:
1381         (WebKit::WebSWClientConnection::startFetch):
1382         (WebKit::WebSWClientConnection::cancelFetch):
1383         * WebProcess/Storage/WebSWClientConnection.h:
1384         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1385         (WebKit::WebSWContextManagerConnection::cancelFetch):
1386         (WebKit::WebSWContextManagerConnection::startFetch):
1387         * WebProcess/Storage/WebSWContextManagerConnection.h:
1388         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
1389         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
1390         (WebKit::WebServiceWorkerFetchTaskClient::WebServiceWorkerFetchTaskClient):
1391         (WebKit::WebServiceWorkerFetchTaskClient::cancel):
1392         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:
1393         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
1394         (WebKit::WebServiceWorkerProvider::handleFetch):
1395         (WebKit::WebServiceWorkerProvider::cancelFetch):
1396         (WebKit::WebServiceWorkerProvider::fetchFinished):
1397         * WebProcess/Storage/WebServiceWorkerProvider.h:
1398
1399 2018-05-09  Andy Estes  <aestes@apple.com>
1400
1401         [iOS] Consider the annotation bounds when positioning action sheets near long-pressed PDF links
1402         https://bugs.webkit.org/show_bug.cgi?id=185472
1403         <rdar://problem/39967092>
1404
1405         Reviewed by Daniel Bates.
1406
1407         Adopted new PDFHostViewControllerDelegate methods that include annotation rects
1408         when URLs and page indices are long-pressed. This allows us to avoid obscuring
1409         annotations when positioning action sheet popovers.
1410
1411         We also no longer need to convert the press location into host view coordinate
1412         space, as PDFKit now does that for us.
1413
1414         * UIProcess/ios/WKPDFView.mm:
1415         (-[WKPDFView _showActionSheetForURL:atLocation:withAnnotationRect:]):
1416         (-[WKPDFView pdfHostViewController:didLongPressURL:atLocation:withAnnotationRect:]):
1417         (-[WKPDFView pdfHostViewController:didLongPressPageIndex:atLocation:withAnnotationRect:]):
1418         (-[WKPDFView _showActionSheetForURL:atLocation:]): Deleted.
1419         (-[WKPDFView pdfHostViewController:didLongPressURL:atLocation:]): Deleted.
1420         (-[WKPDFView pdfHostViewController:didLongPressPageIndex:atLocation:]): Deleted.
1421
1422 2018-05-09  Andy Estes  <aestes@apple.com>
1423
1424         [iOS] Tell PDFHostViewController when animated resizes begin and end
1425         https://bugs.webkit.org/show_bug.cgi?id=185477
1426         <rdar://problem/39875372>
1427
1428         Reviewed by Anders Carlsson.
1429
1430         * UIProcess/API/Cocoa/WKWebView.mm:
1431         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
1432         (-[WKWebView _endAnimatedResize]):
1433         * UIProcess/Cocoa/WKWebViewContentProvider.h:
1434         * UIProcess/ios/WKPDFView.mm:
1435         (-[WKPDFView web_beginAnimatedResize]):
1436         (-[WKPDFView web_endAnimatedResize]):
1437
1438 2018-05-09  Michael Catanzaro  <mcatanzaro@igalia.com>
1439
1440         Unreviewed. Update OptionsWPE.cmake and NEWS for 2.21.1 release.
1441
1442         * wpe/NEWS: Added. Add release notes for 2.21.1.
1443
1444 2018-05-09  Michael Catanzaro  <mcatanzaro@igalia.com>
1445
1446         [WPE] Build cleanly with GCC 8 and ICU 60
1447         https://bugs.webkit.org/show_bug.cgi?id=185462
1448
1449         Reviewed by Carlos Alberto Lopez Perez.
1450
1451         * Platform/IPC/glib/GSocketMonitor.cpp:
1452         (IPC::GSocketMonitor::start): Silence -Wcast-function-type warning.
1453         * Shared/API/glib/WebKitContextMenu.cpp:
1454         (webkit_context_menu_new_with_items): Ditto.
1455
1456 2018-05-08  Sihui Liu  <sihui_liu@apple.com>
1457
1458         Adopt new async _savecookies SPI for keeping networking process active during flushing cookies
1459         https://bugs.webkit.org/show_bug.cgi?id=185261
1460         <rdar://problem/37214391>
1461
1462         Reviewed by Chris Dumez.
1463
1464         By adopting new async SPI _savecookies, we can keep networking process active(not suspended)
1465         until cookies are fully synced to disk with process assertion.
1466
1467         * NetworkProcess/NetworkProcess.cpp:
1468         (WebKit::NetworkProcess::didSyncAllCookies):
1469         * NetworkProcess/NetworkProcess.h:
1470         * NetworkProcess/NetworkProcess.messages.in:
1471         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1472         (WebKit::NetworkProcess::syncAllCookies):
1473         * UIProcess/Network/NetworkProcessProxy.cpp:
1474         (WebKit::NetworkProcessProxy::didClose):
1475         (WebKit::NetworkProcessProxy::syncAllCookies):
1476         (WebKit::NetworkProcessProxy::didSyncAllCookies):
1477         * UIProcess/Network/NetworkProcessProxy.h:
1478         * UIProcess/Network/NetworkProcessProxy.messages.in:
1479         * UIProcess/WebProcessPool.cpp:
1480         (WebKit::WebProcessPool::syncNetworkProcessCookies):
1481
1482 2018-05-08  Per Arne Vollan  <pvollan@apple.com>
1483
1484         Set colorspace in the PDF plugin.
1485         https://bugs.webkit.org/show_bug.cgi?id=185445
1486         <rdar://problem/40030981>
1487
1488         Reviewed by Simon Fraser.
1489
1490         * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h:
1491         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1492         (WebKit::PDFPlugin::PDFPlugin):
1493
1494 2018-05-08  Megan Gardner  <megan_gardner@apple.com>
1495
1496         Don't clear selection until we are actually interacting with a Node.
1497         https://bugs.webkit.org/show_bug.cgi?id=185455
1498
1499         Reviewed by Wenson Hsieh.
1500         
1501         The presence of TextInteractionAssistant should not be used as a proxy for it we are actually editing content.
1502         We need to check to see if we have an active node, and then we should clear the selection.
1503
1504         * UIProcess/ios/WKContentViewInteraction.mm:
1505         (-[WKContentView setSelectedTextRange:]):
1506
1507 2018-05-08  Ryan Haddad  <ryanhaddad@apple.com>
1508
1509         Unreviewed, rolling out r231486.
1510
1511         Caused service worker LayoutTest failures on macOS Debug WK2.
1512
1513         Reverted changeset:
1514
1515         "Allow WebResourceLoader to cancel a load served from a
1516         service worker"
1517         https://bugs.webkit.org/show_bug.cgi?id=185274
1518         https://trac.webkit.org/changeset/231486
1519
1520 2018-05-08  Andy Estes  <aestes@apple.com>
1521
1522         [iOS] _WKWebViewPrintFormatter should return a page count of 0 for PDF documents that do not allow printing
1523         https://bugs.webkit.org/show_bug.cgi?id=185133
1524
1525         Reviewed by Andreas Kling.
1526
1527         * UIProcess/ios/WKPDFView.mm:
1528         (-[WKPDFView _ensureDocumentForPrinting]):
1529         (-[WKPDFView _wk_pageCountForPrintFormatter:]):
1530         (-[WKPDFView _wk_printedDocument]):
1531
1532 2018-05-08  Andy Estes  <aestes@apple.com>
1533
1534         [iOS] WKPDFView remains in the view hierarchy after navigating away
1535         https://bugs.webkit.org/show_bug.cgi?id=185449
1536         <rdar://problem/39693469>
1537
1538         Reviewed by Tim Horton.
1539
1540         WKPDFView removes the PDF host view from the view hierarchy in its -dealloc
1541         method, and relies on WKWebView releasing its last reference in
1542         -_setHasCustomContentView:loadedMIMEType: when the user navigates.
1543
1544         However, WKWPDFView was capturing a strong reference to self in the block passed
1545         to +[PDFHostViewController createHostView:forExtensionIdentifier:], and PDFKit
1546         (actually UIKit) is retaining this block beyond its being called. This results in
1547         the PDF host view remaining as a child of the WKScrollView even after the user
1548         navigates to another page.
1549
1550         Changed the aforementioned block to a lambda that captures a weak reference to
1551         self to prevent WKPDFView from outliving the current navigation.
1552
1553         * UIProcess/ios/WKPDFView.mm:
1554         (-[WKPDFView retain]):
1555         (-[WKPDFView web_setContentProviderData:suggestedFilename:]):
1556
1557 2018-05-08  John Wilander  <wilander@apple.com>
1558
1559         Storage Access API: Make user opt-in sticky
1560         https://bugs.webkit.org/show_bug.cgi?id=185454
1561         <rdar://problem/40003946>
1562
1563         Reviewed by Alex Christensen.
1564
1565         This patch persists the user's choice to opt-in to access under specific domains.
1566         Such storage access should age out with the accessing domain's cookies and website
1567         data. The opt-in prompt is still an experimental feature.
1568
1569         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1570         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
1571         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
1572         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
1573         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
1574         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccessInternal):
1575         (WebKit::WebResourceLoadStatisticsStore::hasUserGrantedStorageAccessThroughPrompt const):
1576         (WebKit::WebResourceLoadStatisticsStore::hasHadUnexpiredRecentUserInteraction const):
1577         * UIProcess/WebResourceLoadStatisticsStore.h:
1578
1579 2018-05-08  Daniel Bates  <dabates@apple.com>
1580
1581         Do not apply X-Frame-Options and CSP frame-ancestors to Quick Look-applicable responses in NetworkProcess
1582         https://bugs.webkit.org/show_bug.cgi?id=185442
1583         <rdar://problem/40067209>
1584
1585         Reviewed by Andy Estes.
1586
1587         Just as we exempt responses in WebContent process that will be handled by Quick Look from the Content
1588         Security Policy frame-ancestors directive and X-Frame-Options checking we need to do the same when
1589         such checks are performed in NetworkProcess following r231479.
1590
1591         HTTP responses that will be previewed using Quick Look are not considered web pages and are subject
1592         to the security model for Quick Look documents. That is, they are exempt from Content Security Policy
1593         and X-Frame-Options processing.
1594
1595         * NetworkProcess/NetworkResourceLoader.cpp:
1596         (WebKit::NetworkResourceLoader::shouldInterruptLoadForCSPFrameAncestorsOrXFrameOptions):
1597
1598 2018-05-08  Brian Burg  <bburg@apple.com>
1599
1600         REGRESSION(r230743): Mousemove events are not coalesced properly, mousemove/drag is very laggy
1601         https://bugs.webkit.org/show_bug.cgi?id=185425
1602         <rdar://problem/39323336>
1603
1604         Reviewed by Simon Fraser.
1605
1606         When mousemove events come in faster than they can be processed, we should coalesce
1607         pending mousemoves that have not yet been sent to WebProcess. This has the effect of
1608         processing the most recent mousemove location, which is the old behavior that regressed.
1609
1610         * UIProcess/WebPageProxy.cpp:
1611         (WebKit::WebPageProxy::handleMouseEvent):
1612         If there is >1 event in the mouse queue, then the first one is being processed by WebProcess
1613         and the second one is eligible for coalescing. Replace it if the last event and new event
1614         are both mousemoves.
1615
1616 2018-05-08  Per Arne Vollan  <pvollan@apple.com>
1617
1618         The PDF context menu should not be created in the WebContent process.
1619         https://bugs.webkit.org/show_bug.cgi?id=185401
1620
1621         Reviewed by Tim Horton.
1622
1623         Send a sync IPC message from the WebContent process to the UI process with the necessary context
1624         menu information when the menu is requested. The NSMenu will then be created and shown in the
1625         UI process. The reply will contain the selected menu item index.
1626
1627         * Shared/mac/PDFContextMenu.h: Added.
1628         (WebKit::PDFContextMenuItem::encode const):
1629         (WebKit::PDFContextMenuItem::decode):
1630         (WebKit::PDFContextMenu::encode const):
1631         (WebKit::PDFContextMenu::decode):
1632         * UIProcess/WebPageProxy.h:
1633         * UIProcess/WebPageProxy.messages.in:
1634         * UIProcess/mac/WebPageProxyMac.mm:
1635         (-[WKPDFMenuTarget menuItem]):
1636         (-[WKPDFMenuTarget contextMenuAction:]):
1637         (WebKit::WebPageProxy::showPDFContextMenu):
1638         * WebKit.xcodeproj/project.pbxproj:
1639         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1640         (WebKit::PDFPlugin::handleContextMenuEvent):
1641
1642 2018-05-08  Dean Jackson  <dino@apple.com>
1643
1644         System Preview links should trigger a download
1645         https://bugs.webkit.org/show_bug.cgi?id=185439
1646         <rdar://problem/40065545>
1647
1648         Reviewed by Jon Lee.
1649
1650         Encode the new field identifying a system preview. And
1651         if you encounter such a resource request, trigger
1652         a download.
1653
1654         * Shared/WebCoreArgumentCoders.cpp:
1655         (IPC::ArgumentCoder<ResourceRequest>::encode):
1656         (IPC::ArgumentCoder<ResourceRequest>::decode):
1657         * UIProcess/WebPageProxy.cpp:
1658         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1659
1660 2018-05-08  John Wilander  <wilander@apple.com>
1661
1662         Storage Access API: Add a request roundtrip to check whether prompting is needed
1663         https://bugs.webkit.org/show_bug.cgi?id=185368
1664         <rdar://problem/40011556>
1665
1666         Reviewed by Alex Christensen and Youenn Fablet.
1667
1668         This patch adds an enum WebKit::StorageAccessStatus to handle our three access
1669         states:
1670         - WebKit::StorageAccessStatus::CannotRequestAccess.
1671             This means the domain is blocked from cookie access.
1672         - WebKit::StorageAccessStatus::RequiresUserPrompt.
1673             This means that access has not been granted yet and a prompt is required.
1674         - WebKit::StorageAccessStatus::HasAccess.
1675             This either means that this domain does not need to ask for access,
1676             access was already granted, or access was granted now.
1677
1678         If the call to WebResourceLoadStatisticsStore::requestStorageAccess() comes
1679         back as WebKit::StorageAccessStatus::RequiresUserPrompt, the WebPageProxy
1680         prompts the user and if the user said yes, calls a direct
1681         WebResourceLoadStatisticsStore::grantStorageAccess().
1682
1683         Existing test cases pass because requestStorageAccessConfirm in WKPage.cpp
1684         does not have m_client.requestStorageAccessConfirm and thus returns true.
1685
1686         * UIProcess/Network/NetworkProcessProxy.messages.in:
1687             Added a missing #endif.
1688         * UIProcess/WebPageProxy.cpp:
1689         (WebKit::WebPageProxy::requestStorageAccess):
1690             Here we now handle the various cases encoded in WebKit::StorageAccessStatus.
1691         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1692         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
1693             Now covers the optional prompt case.
1694         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
1695         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
1696         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccessInternal):
1697             Granting access is broken out to allow WebKit::WebPageProxy to call it
1698             directly.
1699         * UIProcess/WebResourceLoadStatisticsStore.h:
1700         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1701         (WebKit::WebsiteDataStore::requestStorageAccess):
1702         (WebKit::WebsiteDataStore::grantStorageAccess):
1703             Piping through calls from from WebKit::WebResourceLoadStatisticsStore
1704             to WebKit::WebPageProxy.
1705         * UIProcess/WebsiteData/WebsiteDataStore.h:
1706
1707 2018-05-08  Chris Dumez  <cdumez@apple.com>
1708
1709         Unreviewed, rolling out r231376 and r231458.
1710
1711         Caused some API tests failures on iOS
1712
1713         Reverted changesets:
1714
1715         "[iOS] Apps that are not visible may not get suspended if they
1716         trigger page loads while in the background"
1717         https://bugs.webkit.org/show_bug.cgi?id=185318
1718         https://trac.webkit.org/changeset/231376
1719
1720         "[iOS] Release page load process assertion if the screen is
1721         locked"
1722         https://bugs.webkit.org/show_bug.cgi?id=185333
1723         https://trac.webkit.org/changeset/231458
1724
1725 2018-05-08  Dean Jackson  <dino@apple.com>
1726
1727         Use thumbnails in System Previews
1728         https://bugs.webkit.org/show_bug.cgi?id=185397
1729         <rdar://problem/40039376>
1730
1731         Reviewed by Jon Lee.
1732
1733         A system preview that goes through the WKWebViewContentProvider will
1734         show a static thumbnail/snapshot of the item, rather than jumping
1735         directly to QuickLook.
1736
1737         This means we have to link to the AssetViewer framework. That provides
1738         a ASVThumbnailView that will trigger QuickLook for us.
1739
1740         * Configurations/WebKit.xcconfig: Link to AssetViewer.
1741
1742         * UIProcess/ios/WKSystemPreviewView.h: Better macro use. Remove some unneeded protocols.
1743         * UIProcess/ios/WKSystemPreviewView.mm:
1744         (-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]): Update this
1745         to use an ASVThumbnailView, when on the internal SDK (because it is private).
1746         (-[WKSystemPreviewView _layoutThumbnailView]): Use the content insets to put
1747         the thumbnail in the right place.
1748         (-[WKSystemPreviewView thumbnailView:wantsToPresentPreviewController:forItem:]):
1749         Delegate method.
1750         (-[WKSystemPreviewView web_contentView]):
1751         (-[WKSystemPreviewView web_computedContentInsetDidChange]):
1752         (-[WKSystemPreviewView numberOfPreviewItemsInPreviewController:]): Deleted.
1753         (-[WKSystemPreviewView previewController:previewItemAtIndex:]): Deleted.
1754         (-[WKSystemPreviewView previewControllerWillDismiss:]): Deleted.
1755
1756 2018-05-08  Youenn Fablet  <youenn@apple.com>
1757
1758         Allow WebResourceLoader to cancel a load served from a service worker
1759         https://bugs.webkit.org/show_bug.cgi?id=185274
1760
1761         Reviewed by Chris Dumez.
1762
1763         Use FetchIdentifier instead of uint64_t.
1764         Add IPC support for cancelling a fetch from WebProcess to service worker process.
1765         Ask service worker process to cancel the fetch when its corresponding WebResourceLoader is cancelled.
1766         No change of behavior as once a WebResourceLoader is cancelled, any related IPC is not processed.
1767         A follow-up patch should try to cancel the FetchResponse load, meaning to either cancel the network load
1768         or to abort reading the readable stream.
1769
1770         * Scripts/webkit/messages.py:
1771         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1772         (WebKit::WebSWServerConnection::cancelFetch):
1773         (WebKit::WebSWServerConnection::startFetch):
1774         (WebKit::WebSWServerConnection::didReceiveFetchResponse):
1775         (WebKit::WebSWServerConnection::didReceiveFetchData):
1776         (WebKit::WebSWServerConnection::didReceiveFetchFormData):
1777         (WebKit::WebSWServerConnection::didFinishFetch):
1778         (WebKit::WebSWServerConnection::didFailFetch):
1779         (WebKit::WebSWServerConnection::didNotHandleFetch):
1780         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1781         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
1782         * StorageProcess/StorageProcess.cpp:
1783         (WebKit::StorageProcess::didFailFetch):
1784         (WebKit::StorageProcess::didNotHandleFetch):
1785         (WebKit::StorageProcess::didReceiveFetchResponse):
1786         (WebKit::StorageProcess::didReceiveFetchData):
1787         (WebKit::StorageProcess::didReceiveFetchFormData):
1788         (WebKit::StorageProcess::didFinishFetch):
1789         * StorageProcess/StorageProcess.h:
1790         * StorageProcess/StorageProcess.messages.in:
1791         * WebProcess/Network/WebLoaderStrategy.cpp:
1792         (WebKit::WebLoaderStrategy::remove):
1793         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
1794         (WebKit::ServiceWorkerClientFetch::create):
1795         (WebKit::ServiceWorkerClientFetch::ServiceWorkerClientFetch):
1796         (WebKit::ServiceWorkerClientFetch::start):
1797         (WebKit::ServiceWorkerClientFetch::cancel):
1798         * WebProcess/Storage/ServiceWorkerClientFetch.h:
1799         * WebProcess/Storage/WebSWClientConnection.cpp:
1800         (WebKit::WebSWClientConnection::startFetch):
1801         (WebKit::WebSWClientConnection::cancelFetch):
1802         * WebProcess/Storage/WebSWClientConnection.h:
1803         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1804         (WebKit::WebSWContextManagerConnection::cancelFetch):
1805         (WebKit::WebSWContextManagerConnection::startFetch):
1806         * WebProcess/Storage/WebSWContextManagerConnection.h:
1807         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
1808         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
1809         (WebKit::WebServiceWorkerFetchTaskClient::WebServiceWorkerFetchTaskClient):
1810         (WebKit::WebServiceWorkerFetchTaskClient::cancel):
1811         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:
1812         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
1813         (WebKit::WebServiceWorkerProvider::handleFetch):
1814         (WebKit::WebServiceWorkerProvider::cancelFetch):
1815         (WebKit::WebServiceWorkerProvider::fetchFinished):
1816         * WebProcess/Storage/WebServiceWorkerProvider.h:
1817
1818 2018-05-08  Antti Koivisto  <antti@apple.com>
1819
1820         Don't use mapped cache files in case of Class A/B protected app
1821         https://bugs.webkit.org/show_bug.cgi?id=185422
1822         <rdar://problem/34001688>
1823
1824         Reviewed by Chris Dumez.
1825
1826         Currently we don't use shared memory maps in these cases. This still leaves us open for crashes
1827         in the network process when the device is locked.
1828
1829         This patch disables use of blob storage (mapped cache files) in apps that use class A/B protection.
1830         Normally we use blobs for resources > 16KB. Since use of shared memory is already disabled,
1831         the only optimization lost for these apps is body data deduplication.
1832
1833         Any existing cache entries with blobs are ignored and deleted. New entries are created with
1834         body data inlined with the metadata.
1835
1836         * NetworkProcess/cache/NetworkCache.cpp:
1837         (WebKit::NetworkCache::Cache::store):
1838         * NetworkProcess/cache/NetworkCache.h:
1839         (WebKit::NetworkCache::Cache::canUseSharedMemoryForBodyData const): Deleted.
1840         * NetworkProcess/cache/NetworkCacheEntry.cpp:
1841         (WebKit::NetworkCache::Entry::initializeShareableResourceHandleFromStorageRecord const):
1842
1843             Remove the code the prevented use of shared memory in these cases. Non-mapped Data objects
1844             are never shareable.
1845
1846         (WebKit::NetworkCache::Entry::setNeedsValidation):
1847         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
1848         (WebKit::NetworkCache::isSafeToUseMemoryMapForPath):
1849         (WebKit::NetworkCache::canUseSharedMemoryForPath): Deleted.
1850         * NetworkProcess/cache/NetworkCacheFileSystem.h:
1851         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1852         (WebKit::NetworkCache::Storage::Storage):
1853         (WebKit::NetworkCache::Storage::mayContainBlob const):
1854         (WebKit::NetworkCache::Storage::shouldStoreBodyAsBlob):
1855         (WebKit::NetworkCache::shouldStoreBodyAsBlob): Deleted.
1856         * NetworkProcess/cache/NetworkCacheStorage.h:
1857         (WebKit::NetworkCache::Storage::canUseSharedMemoryForBodyData const): Deleted.
1858
1859 2018-05-07  Carlos Garcia Campos  <cgarcia@igalia.com>
1860
1861         Unreviewed. Add missing exit not included in r231298.
1862
1863         * WebProcess/WebProcess.cpp:
1864         (WebKit::WebProcess::ensureWebToStorageProcessConnection):
1865
1866 2018-05-07  Daniel Bates  <dabates@apple.com>
1867
1868         Check X-Frame-Options and CSP frame-ancestors in network process
1869         https://bugs.webkit.org/show_bug.cgi?id=185410
1870         <rdar://problem/37733934>
1871
1872         Reviewed by Ryosuke Niwa.
1873
1874         * NetworkProcess/NetworkResourceLoadParameters.cpp:
1875         (WebKit::NetworkResourceLoadParameters::encode const): Always encode the frame ancestor origins.
1876         (WebKit::NetworkResourceLoadParameters::decode): Always decode the frame ancestor origins.
1877         * NetworkProcess/NetworkResourceLoader.cpp:
1878         (WebKit::NetworkResourceLoader::shouldInterruptLoadForXFrameOptions): Added.
1879         (WebKit::NetworkResourceLoader::shouldInterruptLoadForCSPFrameAncestorsOrXFrameOptions): Added.
1880         (WebKit::NetworkResourceLoader::didReceiveResponse): Check if the load needs to be interrupted due
1881         to a violation of the CSP frame-ancestors directive or X-Frame-Options. If there is a violation
1882         then stop the load.
1883         (WebKit::NetworkResourceLoader::didRetrieveCacheEntry): Ditto.
1884         (NetworkResourceLoader::addConsoleMessage): Added.
1885         (NetworkResourceLoader::sendCSPViolationReport): Added.
1886         * NetworkProcess/NetworkResourceLoader.h:
1887         * Scripts/webkit/messages.py: Teach the generator about data types MessageLevel and MessageSource
1888         as they are both defined in file JavaScriptCore/ConsoleTypes.h as opposed to independent headers.
1889         Also tell the generator that these types should not be forward declared so that we can use these
1890         types without their JSC:: prefix in WebPage.messages.in.
1891         * WebProcess/Network/NetworkProcessConnection.cpp:
1892         (WebKit::NetworkProcessConnection::didReceiveMessage): Route WebPage messages to the appropriate
1893         web page.
1894         * WebProcess/Network/WebLoaderStrategy.cpp:
1895         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): Added message StopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied.
1896         * WebProcess/Network/WebResourceLoader.cpp:
1897         (WebKit::WebResourceLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied): Added.
1898         * WebProcess/Network/WebResourceLoader.h:
1899         * WebProcess/Network/WebResourceLoader.messages.in:
1900         * WebProcess/WebPage/WebFrame.cpp:
1901         (WebKit::WebFrame::addConsoleMessage):
1902         * WebProcess/WebPage/WebFrame.h:
1903         * WebProcess/WebPage/WebPage.cpp:
1904         (WebKit::WebPage::addConsoleMessage): Added.
1905         (WebKit::WebPage::sendCSPViolationReport): Added.
1906         * WebProcess/WebPage/WebPage.h:
1907         * WebProcess/WebPage/WebPage.messages.in: Add messages AddConsoleMessage and SendCSPViolationReport
1908         for adding a console message to Web Inspector and sending a CSP report, respectively.
1909
1910 2018-05-07  Daniel Bates  <dabates@apple.com>
1911
1912         Abstract logic to log console messages and send CSP violation reports into a client
1913         https://bugs.webkit.org/show_bug.cgi?id=185393
1914         <rdar://problem/40036053>
1915
1916         Reviewed by Brent Fulgham.
1917
1918         For now, build a URL from the source origin associated with the NetworkResourceLoader
1919         and pass this to the ContentSecurityPolicy constructor.
1920
1921         Additionally, make NetworkLoadChecker::contentSecurityPolicy() non-const since it returns
1922         a non-const pointer to a ContentSecurityPolicy object; => callers can mutate this object
1923         right from under NetworkLoadChecker. Making this non-const makes this clear to a reader.
1924         Also remove the mutable keyword from the definition of NetworkLoadChecker::m_contentSecurityPolicy.
1925
1926         * NetworkProcess/NetworkLoadChecker.cpp:
1927         (WebKit::NetworkLoadChecker::contentSecurityPolicy):
1928         (WebKit::NetworkLoadChecker::contentSecurityPolicy const): Deleted.
1929         * NetworkProcess/NetworkLoadChecker.h:
1930
1931 2018-05-07  Alex Christensen  <achristensen@webkit.org>
1932
1933         WebResourceLoadStatisticsStore::requestStorageAccess should call its completion handler on the main thread
1934         https://bugs.webkit.org/show_bug.cgi?id=185403
1935
1936         Reviewed by Brent Fulgham.
1937
1938         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1939         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
1940
1941 2018-05-07  Chris Dumez  <cdumez@apple.com>
1942
1943         [iOS] Release page load process assertion if the screen is locked
1944         https://bugs.webkit.org/show_bug.cgi?id=185333
1945
1946         Reviewed by Geoffrey Garen.
1947
1948         We normally take a background process assertion during page loads to allow them to complete
1949         even if the tab / app is backgrounded. We should however avoid doing so when the backgrounding
1950         is caused by the screen locking. Keeping the process assertion in this case would prevent the
1951         whole device from sleeping longer than it should, thus negatively impacting power.
1952
1953         * UIProcess/Cocoa/NavigationState.h:
1954         * UIProcess/Cocoa/NavigationState.mm:
1955         (WebKit::NavigationState::NavigationState):
1956         (WebKit::NavigationState::releaseNetworkActivityToken):
1957         (WebKit::NavigationState::didChangeIsLoading):
1958         * UIProcess/ios/WebPageProxyIOS.mm:
1959         (WebKit::WebPageProxy::applicationDidEnterBackground):
1960
1961 2018-05-07  Brent Fulgham  <bfulgham@apple.com>
1962
1963         Add experimental feature to prompt for Storage Access API use
1964         https://bugs.webkit.org/show_bug.cgi?id=185335
1965         <rdar://problem/39994649>
1966
1967         Reviewed by Alex Christensen and Youenn Fablet.
1968
1969         Create a new experimental feature that gates the ability of WebKit clients to prompt the user when
1970         Storage Access API is invoked.
1971
1972         Currently this feature doesn't have any user-visible impact.
1973
1974         * Shared/API/APIObject.h:
1975         * Shared/API/c/WKBase.h:
1976         * Shared/WebPreferences.yaml:
1977         * UIProcess/API/APIUIClient.h:
1978         (API::UIClient::requestStorageAccessConfirm):
1979         * UIProcess/API/C/WKPage.cpp:
1980         (WebKit::RequestStorageAccessConfirmResultListener::create):
1981         (WebKit::RequestStorageAccessConfirmResultListener::~RequestStorageAccessConfirmResultListener):
1982         (WebKit::RequestStorageAccessConfirmResultListener::call):
1983         (WebKit::RequestStorageAccessConfirmResultListener::RequestStorageAccessConfirmResultListener):
1984         (WKPageRequestStorageAccessConfirmResultListenerGetTypeID):
1985         (WKPageRequestStorageAccessConfirmResultListenerCall):
1986         (WKPageSetPageUIClient):
1987         * UIProcess/API/C/WKPageUIClient.h:
1988         * UIProcess/API/Cocoa/WKPreferences.mm:
1989         (-[WKPreferences _storageAccessPromptsEnabled]):
1990         (-[WKPreferences _setStorageAccessPromptsEnabled:]):
1991         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1992         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1993         * UIProcess/Cocoa/UIDelegate.h:
1994         * UIProcess/Cocoa/UIDelegate.mm:
1995         (WebKit::UIDelegate::setDelegate):
1996         (WebKit::UIDelegate::UIClient::requestStorageAccessConfirm):
1997         * UIProcess/WebPageProxy.cpp:
1998         (WebKit::WebPageProxy::requestStorageAccessConfirm):
1999         * UIProcess/WebPageProxy.h:
2000         * UIProcess/WebPageProxy.messages.in:
2001         * UIProcess/WebPreferences.cpp:
2002         (WebKit::WebPreferences::update):
2003         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2004         (WebKit::WebChromeClient::requestStorageAccess):
2005
2006 2018-05-07  Dean Jackson  <dino@apple.com>
2007
2008         Use a dark gray for system preview bbackground
2009         https://bugs.webkit.org/show_bug.cgi?id=185391
2010         <rdar://problem/40035120>
2011
2012         Reviewed by Eric Carlson.
2013
2014         Throw some darker shade at this view.
2015
2016         * UIProcess/ios/WKSystemPreviewView.mm:
2017         (-[WKSystemPreviewView web_initWithFrame:webView:]):
2018
2019 2018-05-07  Don Olmstead  <don.olmstead@sony.com>
2020
2021         [Win] Add missing methods to WebChromeClient
2022         https://bugs.webkit.org/show_bug.cgi?id=185325
2023
2024         Reviewed by Brent Fulgham.
2025
2026         * WebProcess/WebCoreSupport/WebChromeClient.h:
2027
2028 2018-05-07  Megan Gardner  <megan_gardner@apple.com>
2029
2030         Allow Web Touch events to timeout
2031         https://bugs.webkit.org/show_bug.cgi?id=185282
2032
2033         Reviewed by Tim Horton.
2034         
2035         This is backwards, fixing.
2036
2037         * UIProcess/WebPageProxy.cpp:
2038         (WebKit::WebPageProxy::handleTouchEventSynchronously):
2039
2040 2018-05-07  Don Olmstead  <don.olmstead@sony.com>
2041
2042         [Win] LoggingWin is missing includes
2043         https://bugs.webkit.org/show_bug.cgi?id=185326
2044
2045         Reviewed by Per Arne Vollan.
2046
2047         * Platform/win/LoggingWin.cpp:
2048
2049 2018-05-07  Daniel Bates  <dabates@apple.com>
2050
2051         CSP should be passed the referrer
2052         https://bugs.webkit.org/show_bug.cgi?id=185367
2053
2054         Reviewed by Per Arne Vollan.
2055
2056         Pass the referrer through NetworkLoadChecker so that it can pass it to the ContentSecurityPolicy
2057         object it instantiates.
2058
2059         * NetworkProcess/NetworkLoadChecker.cpp:
2060         (WebKit::NetworkLoadChecker::NetworkLoadChecker):
2061         (WebKit::NetworkLoadChecker::contentSecurityPolicy const):
2062         * NetworkProcess/NetworkLoadChecker.h:
2063         (WebKit::NetworkLoadChecker::create):
2064         * NetworkProcess/NetworkResourceLoader.cpp:
2065         * NetworkProcess/PingLoad.cpp:
2066         (WebKit::PingLoad::PingLoad):
2067
2068 2018-05-07  Daniel Bates  <dabates@apple.com>
2069
2070         Substitute CrossOriginPreflightResultCache::clear() for CrossOriginPreflightResultCache::empty()
2071         https://bugs.webkit.org/show_bug.cgi?id=185170
2072
2073         Reviewed by Per Arne Vollan.
2074
2075         * WebProcess/WebProcess.cpp:
2076         (WebKit::WebProcess::clearResourceCaches):
2077         (WebKit::WebProcess::deleteWebsiteData):
2078
2079 2018-05-07  Brian Burg  <bburg@apple.com>
2080
2081         Web Inspector: opt out of process swap on navigation if a Web Inspector frontend is connected
2082         https://bugs.webkit.org/show_bug.cgi?id=184861
2083         <rdar://problem/39153768>
2084
2085         Reviewed by Timothy Hatcher.
2086
2087         We need to track how many frontends are attached to the web page (both local and remote).
2088         InspectorController propagates this out to WebKit via InspectorClient. This is then
2089         kept in UIProcess as a member of WebPageProxy. When making a decision whether to use a
2090         new process for a navigation, return early with "no" if any frontends are open for the
2091         page being navigated.
2092
2093         * UIProcess/WebPageProxy.h:
2094         (WebKit::WebPageProxy::didChangeInspectorFrontendCount):
2095         (WebKit::WebPageProxy::inspectorFrontendCount const):
2096         * UIProcess/WebPageProxy.messages.in:
2097         * UIProcess/WebProcessPool.cpp:
2098         (WebKit::WebProcessPool::processForNavigation):
2099         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
2100         (WebKit::WebInspectorClient::frontendCountChanged):
2101         * WebProcess/WebCoreSupport/WebInspectorClient.h:
2102         * WebProcess/WebPage/WebPage.cpp:
2103         (WebKit::WebPage::inspectorFrontendCountChanged):
2104         * WebProcess/WebPage/WebPage.h:
2105
2106 2018-05-04  Tim Horton  <timothy_horton@apple.com>
2107
2108         Shift to a lower-level framework for simplifying URLs
2109         https://bugs.webkit.org/show_bug.cgi?id=185334
2110
2111         Reviewed by Dan Bernstein.
2112
2113         * Configurations/WebKit.xcconfig:
2114         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
2115         (-[WKFullScreenWindowController _updateLocationInfo]):
2116
2117 2018-05-04  Per Arne Vollan  <pvollan@apple.com>
2118
2119         Shutdown WindowServer connections after checking in with launch services
2120         https://bugs.webkit.org/show_bug.cgi?id=185082
2121         <rdar://problem/39613173>
2122
2123         Reviewed by Brent Fulgham.
2124
2125         When WindowServer access is blocked in the WebContent process, we should shutdown all connections
2126         after checking in with launch services.
2127
2128         * WebProcess/cocoa/WebProcessCocoa.mm:
2129         (WebKit::WebProcess::platformInitializeProcess):
2130
2131 2018-05-04  Don Olmstead  <don.olmstead@sony.com>
2132
2133         [Win][WebKit] Fix forwarding headers for Windows build
2134         https://bugs.webkit.org/show_bug.cgi?id=184412
2135
2136         Reviewed by Alex Christensen.
2137
2138         * PlatformWin.cmake:
2139         * UIProcess/API/APIAttachment.h:
2140         * UIProcess/API/APIContextMenuClient.h:
2141         * UIProcess/API/C/WKProcessTerminationReason.h:
2142         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
2143
2144 2018-05-04  Chris Dumez  <cdumez@apple.com>
2145
2146         [iOS] Apps that are not visible may not get suspended if they trigger page loads while in the background
2147         https://bugs.webkit.org/show_bug.cgi?id=185318
2148
2149         Reviewed by Geoffrey Garen.
2150
2151         Whenever there is a page load going on, we take a background process assertion to delay process
2152         suspension until this load completes. However, there is also a 3 seconds grace period after
2153         a load is complete to allow the app to trigger a new load shortly after. This grace period was
2154         introduced to support use cases where a visible app does loads in an offscreen view. However,
2155         it can be abused by apps running in the background as they could trigger new page loads while
2156         in the background to delay process suspension. This patch tightens the policy so that only
2157         apps that are currently visible get to use this grace period. Apps that are in the background
2158         get to finish their current load and will then get suspended.
2159
2160         * UIProcess/Cocoa/NavigationState.mm:
2161         (WebKit::NavigationState::didChangeIsLoading):
2162
2163 2018-05-04  Per Arne Vollan  <pvollan@apple.com>
2164
2165         Adjust sandbox profile for simulator.
2166         https://bugs.webkit.org/show_bug.cgi?id=185319
2167
2168         Reviewed by Brent Fulgham.
2169
2170         Disable Kerberos rules, as well as rules related to NSApplication initialization.
2171
2172         * WebProcess/com.apple.WebProcess.sb.in:
2173
2174 2018-05-04  Tim Horton  <timothy_horton@apple.com>
2175
2176         Wasted time dlopening Lookup when tearing down a WKWebView
2177         https://bugs.webkit.org/show_bug.cgi?id=185310
2178         <rdar://problem/39934085>
2179
2180         Reviewed by Wenson Hsieh.
2181
2182         * UIProcess/Cocoa/WebViewImpl.h:
2183         * UIProcess/Cocoa/WebViewImpl.mm:
2184         (-[WKWindowVisibilityObserver dealloc]):
2185         (-[WKWindowVisibilityObserver startObservingLookupDismissalIfNeeded]):
2186         (WebKit::WebViewImpl::prepareForDictionaryLookup):
2187         (-[WKWindowVisibilityObserver startObservingLookupDismissal]): Deleted.
2188         Avoid un-registering as a Lookup dismissal observer if we never
2189         registered in the first place, because that involves dlopening Lookup.
2190
2191 2018-05-04  Megan Gardner  <megan_gardner@apple.com>
2192
2193         Allow Web Touch events to timeout
2194         https://bugs.webkit.org/show_bug.cgi?id=185282
2195         <rdar://problem/38728319>
2196
2197         Reviewed by Tim Horton.
2198         
2199         Web Touch events currently never time out, which blocks the user from interacting with the UI Process at all.
2200         We should allow these events to time out so that the user can interact with the rest of the UI.
2201
2202         * UIProcess/WebPageProxy.cpp:
2203         (WebKit::WebPageProxy::handleTouchEventSynchronously):
2204
2205 2018-05-04  Wenson Hsieh  <whsieh@berkeley.edu>
2206
2207         REGRESSION: [ios-simulator] 3 WKWebViewAutofillTests API test failures seen with 11.3 SDK
2208         https://bugs.webkit.org/show_bug.cgi?id=184196
2209         <rdar://problem/39054481>
2210
2211         Reviewed by Tim Horton.
2212
2213         Remove an unnecessary call to NSClassFromString, now that trunk WebKit only supports iOS 11.3+.
2214
2215         * UIProcess/ios/WKContentViewInteraction.mm:
2216         (-[WKContentView insertTextSuggestion:]):
2217
2218 2018-05-04  Youenn Fablet  <youenn@apple.com>
2219
2220         NetworkProcessProxy::didReceiveAuthenticationChallenge should take an AuthenticationChallenge r-value
2221         https://bugs.webkit.org/show_bug.cgi?id=185302
2222
2223         Reviewed by Geoffrey Garen.
2224
2225         Pass AuthenticationChallenge as an r-value since it comes from IPC.
2226         No change of behavior.
2227
2228         * UIProcess/Authentication/AuthenticationChallengeProxy.cpp:
2229         (WebKit::AuthenticationChallengeProxy::AuthenticationChallengeProxy):
2230         * UIProcess/Authentication/AuthenticationChallengeProxy.h:
2231         (WebKit::AuthenticationChallengeProxy::create):
2232         * UIProcess/Downloads/DownloadProxy.cpp:
2233         (WebKit::DownloadProxy::didReceiveAuthenticationChallenge):
2234         * UIProcess/Downloads/DownloadProxy.h:
2235         * UIProcess/Network/NetworkProcessProxy.cpp:
2236         (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
2237         * UIProcess/Network/NetworkProcessProxy.h:
2238
2239 2018-05-04  Sihui Liu  <sihui_liu@apple.com>
2240
2241         Assertion failure in NetworkStorageSession::setCookie: privilege of UI process is not set
2242         https://bugs.webkit.org/show_bug.cgi?id=185262
2243
2244         Reviewed by Chris Dumez.
2245
2246         Fix an assertion failure by setting UI process privileges in constructor of WebsiteDataStore
2247         because UI process may use the cookie API before creating a WebView.
2248
2249         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2250         (WebKit::WebsiteDataStore::WebsiteDataStore):
2251
2252 2018-05-04  Per Arne Vollan  <pvollan@apple.com>
2253
2254         Adjust sandbox rules for simulator.
2255         https://bugs.webkit.org/show_bug.cgi?id=185275
2256
2257         Reviewed by Brent Fulgham.
2258
2259         Enable rules related to CoreMedia for minimal simulator.
2260
2261         * WebProcess/com.apple.WebProcess.sb.in:
2262
2263 2018-05-04  Carlos Garcia Campos  <cgarcia@igalia.com>
2264
2265         [GTK] Epiphany (GNOME Web) says "Error downloading: Service Unavailable." when trying to download an image from discogs.com
2266         https://bugs.webkit.org/show_bug.cgi?id=174730
2267
2268         Reviewed by Michael Catanzaro.
2269
2270         The problem is that we don't send any User-Agent HTTP header for downloads started by WebProcessPool::download().
2271
2272         * UIProcess/API/glib/WebKitDownload.cpp:
2273         (webkitDownloadUpdateRequest): Helper to update the cached request.
2274         (webkitDownloadStarted): Updated the cached request if we have one.
2275         (webkit_download_get_request): Use webkitDownloadUpdateRequest().
2276         * UIProcess/API/glib/WebKitDownloadClient.cpp:
2277         * UIProcess/API/glib/WebKitDownloadPrivate.h:
2278         * UIProcess/WebProcessPool.cpp:
2279         (WebKit::WebProcessPool::download): Set the User-Agent HTTP header if there isn't any.
2280
2281 2018-05-04  Carlos Garcia Campos  <cgarcia@igalia.com>
2282
2283         [GTK] Some event tests failing after r230817
2284         https://bugs.webkit.org/show_bug.cgi?id=185072
2285
2286         Reviewed by Michael Catanzaro.
2287
2288         Do not send mouse move events to the WebProcess for crossing events during testing. WTR never generates crossing
2289         events and they can confuse tests.
2290
2291         Fixes: editing/pasteboard/drag-link-with-data-transfer-adds-trusted-link-to-pasteboard.html
2292                fast/css/user-drag-none.html
2293                fast/events/context-activated-by-key-event.html
2294                fast/events/drag-selects-image.html
2295                fast/events/dropzone-005.html
2296                fast/events/mouse-click-events.html
2297                fast/events/mouse-cursor-change.html
2298
2299         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2300         (webkitWebViewBaseCrossingNotifyEvent):
2301
2302 2018-05-03  Chris Dumez  <cdumez@apple.com>
2303
2304         More aggressively terminate child processes when the connection to their parent process is severed
2305         https://bugs.webkit.org/show_bug.cgi?id=177972
2306         <rdar://problem/33317607>
2307
2308         Reviewed by Geoff Garen.
2309
2310         More aggressively terminate child processes when the connection to their parent process is severed.
2311         Previously, we would dispatch to the main thread and then exit the process. This would sometimes
2312         cause the process to say alive for 10 seconds until our watchdog would forcefully terminate the
2313         process. This could happen in particular when the main thread is blocked on a synchronous IPC.
2314
2315         * NetworkProcess/NetworkProcess.cpp:
2316         (WebKit::NetworkProcess::didClose): Deleted.
2317         * NetworkProcess/NetworkProcess.h:
2318         * PluginProcess/PluginProcess.cpp:
2319         (WebKit::PluginProcess::didClose): Deleted.
2320         * PluginProcess/PluginProcess.h:
2321         * Shared/ChildProcess.cpp:
2322         (WebKit::ChildProcess::didClose):
2323         (WebKit::didCloseOnConnectionWorkQueue):
2324         (WebKit::ChildProcess::terminationTimerFired):
2325         * Shared/ChildProcess.h:
2326         * StorageProcess/StorageProcess.cpp:
2327         (WebKit::StorageProcess::didClose): Deleted.
2328         * StorageProcess/StorageProcess.h:
2329         * WebProcess/WebProcess.cpp:
2330         (WebKit::WebProcess::didClose): Deleted.
2331         * WebProcess/WebProcess.h:
2332
2333 2018-05-03  Yusuke Suzuki  <utatane.tea@gmail.com>
2334
2335         Use default std::optional if it is provided
2336         https://bugs.webkit.org/show_bug.cgi?id=185159
2337
2338         Reviewed by Michael Catanzaro.
2339
2340         * Shared/SandboxExtension.h:
2341         (WebKit::SandboxExtension::Handle::decode):
2342         * Shared/TouchBarMenuItemData.cpp:
2343         (WebKit::TouchBarMenuItemData::decode):
2344
2345 2018-05-03  Justin Fan  <justin_fan@apple.com>
2346
2347         [WebGL] Add runtime flag for enabling ASTC support in WebGL
2348         https://bugs.webkit.org/show_bug.cgi?id=184840
2349
2350         Reviewed by Myles C. Maxfield.
2351
2352         Added runtime flag for ASTC support in WebGL, to turn on/off when extension is implemented.
2353
2354         * Shared/WebPreferences.yaml:
2355
2356 2018-05-03  Keith Rollin  <krollin@apple.com>
2357
2358         Unreviewed build fix after <https://trac.webkit.org/changeset/231282>.
2359
2360         * NetworkProcess/NetworkActivityTracker.h:
2361
2362 2018-05-03  Wenson Hsieh  <wenson_hsieh@apple.com>
2363
2364         Ads in NYTimes app are shifted downwards by the scroll view's top content inset
2365         https://bugs.webkit.org/show_bug.cgi?id=185251
2366         <rdar://problem/39062357>
2367
2368         Reviewed by Tim Horton.
2369
2370         The NYTimes app embeds advertisements in each article's WKWebView by adding views in the WKScrollView's view
2371         hierarchy. These views are positioned using the bounding client rects of elements in the DOM (via Element
2372         ::getBoundingClientRect). Prior to r229641, WebKit would report bounding client rects inset by the content
2373         insets of WKScrollView, which means that if a top content inset X is specified on the scroll view, an element
2374         that is flush against the top of the viewport will have a bounding client rect top of -X (when it should really
2375         be 0).
2376
2377         To account for this, NYTimes adds the scroll view content insets back to the bounding client rect when
2378         determining the position of each advertisement which, after r229641, causes these views to be shifted downwards
2379         by an amount equal to the scroll view content inset top.
2380
2381         This new behavior does not affect Safari, since Safari uses SPI to explicitly set obscured insets. As such, we
2382         address this by gating the scroll view content inset fix with a linked-on-or-after check.
2383
2384         * UIProcess/API/Cocoa/WKWebView.mm:
2385         (-[WKWebView _computedObscuredInset]):
2386         * UIProcess/Cocoa/VersionChecks.h:
2387
2388 2018-05-03  Chris Dumez  <cdumez@apple.com>
2389
2390         Load hangs if the WebProcess fails to launch
2391         https://bugs.webkit.org/show_bug.cgi?id=185225
2392         <rdar://problem/38249058>
2393
2394         Reviewed by Geoff Garen.
2395
2396         When a process fails to launch, ChildProcessProxy::didFinishLaunching() gets called with an
2397         invalid connection identifier. While NetworkProcessProxy::didFinishLaunching() properly deals with
2398         this situation, WebProcessProxy::didFinishLaunching() does not. As a result, we do not attempt to
2399         relaunch the process, we do not notify the client and WebPageProxy::m_isValid stays true.
2400
2401         This patch thus updates WebProcessProxy::didFinishLaunching() to check if the connection identifier
2402         is valid and treats it as a crash. As a result, the WebPageProxies properly reset their state and
2403         the client gets notified of the crash so that it can attempt to reload.
2404
2405         * UIProcess/API/Cocoa/WKProcessPool.mm:
2406         (-[WKProcessPool _makeNextWebProcessLaunchFailForTesting]):
2407         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2408         * UIProcess/Launcher/ProcessLauncher.h:
2409         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2410         (WebKit::ProcessLauncher::launchProcess):
2411         Add SPI to make the next WebProcess launch fail, for the purpose of API testing.
2412
2413         * UIProcess/WebProcessPool.h:
2414         * UIProcess/WebProcessProxy.cpp:
2415         (WebKit::WebProcessProxy::getLaunchOptions):
2416         (WebKit::WebProcessProxy::didClose):
2417         (WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
2418         (WebKit::WebProcessProxy::didFinishLaunching):
2419         * UIProcess/WebProcessProxy.h:
2420
2421 2018-05-03  Commit Queue  <commit-queue@webkit.org>
2422
2423         Unreviewed, rolling out r231223 and r231288.
2424         https://bugs.webkit.org/show_bug.cgi?id=185256
2425
2426         The change in r231223 breaks internal builds, and r231288 is a
2427         dependent change. (Requested by ryanhaddad on #webkit).
2428
2429         Reverted changesets:
2430
2431         "Use default std::optional if it is provided"
2432         https://bugs.webkit.org/show_bug.cgi?id=185159
2433         https://trac.webkit.org/changeset/231223
2434
2435         "Use pointer instead of
2436         std::optional<std::reference_wrapper<>>"
2437         https://bugs.webkit.org/show_bug.cgi?id=185186
2438         https://trac.webkit.org/changeset/231288
2439
2440 2018-05-03  Per Arne Vollan  <pvollan@apple.com>
2441
2442         An error message is written to stderr when the WebContent process is blocking WindowServer access.
2443         https://bugs.webkit.org/show_bug.cgi?id=184701
2444
2445         Reviewed by Brent Fulgham.
2446
2447         Calling 'setApplicationIsDaemon(true)' instead of 'CGSSetDenyWindowServerConnections(true)' to disable
2448         access to the WindowServer in the WebContent process, will remove this error message. After this change,
2449         the url of the WebContent process is still showing up in Activity Monitor, which previously was a
2450         problem when calling 'setApplicationIsDaemon(true)'.
2451
2452         * WebProcess/WebProcess.cpp:
2453         (WebKit::WebProcess::initializeProcess):
2454         * WebProcess/cocoa/WebProcessCocoa.mm:
2455         (WebKit::WebProcess::platformInitializeProcess):
2456
2457 2018-05-03  Ryan Haddad  <ryanhaddad@apple.com>
2458
2459         Unreviewed, rolling out r231253.
2460
2461         The API test added with this change is crashing on the bots.
2462
2463         Reverted changeset:
2464
2465         "Web Inspector: opt out of process swap on navigation if a Web
2466         Inspector frontend is connected"
2467         https://bugs.webkit.org/show_bug.cgi?id=184861
2468         https://trac.webkit.org/changeset/231253
2469
2470 2018-05-03  Brent Fulgham  <bfulgham@apple.com>
2471
2472         Re-eneable Network Extension support in the WebContent process
2473         https://bugs.webkit.org/show_bug.cgi?id=185236
2474         <rdar://problem/39883004>
2475
2476         Reviewed by Eric Carlson.
2477
2478         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2479         * WebProcess/com.apple.WebProcess.sb.in:
2480
2481 2018-05-03  Tim Horton  <timothy_horton@apple.com>
2482
2483         REGRESSION (r231014): Entitlements are not applied to XPC services on macOS
2484         https://bugs.webkit.org/show_bug.cgi?id=185241
2485
2486         Reviewed by Dan Bernstein.
2487
2488         * Configurations/BaseXPCService.xcconfig:
2489         * Configurations/WebContentService.Development.xcconfig:
2490         * Configurations/WebContentService.xcconfig:
2491
2492 2018-05-03  Carlos Garcia Campos  <cgarcia@igalia.com>
2493
2494         REGRESSION(r222772): [GTK][WPE] WebProcess from WebKitGtk+ 2.19.9x SIGSEVs in WebKit::WebProcess::ensureNetworkProcessConnection() at Source/WebKit/WebProcess/WebProcess.cpp:1127
2495         https://bugs.webkit.org/show_bug.cgi?id=183348
2496
2497         Reviewed by Michael Catanzaro.
2498
2499         When connection doesn't exit in case of sync message failure, always exit in case of failing to send
2500         GetNetworkProcessConnection or GetStorageProcessConnection messages. This can happen when the WebView is created
2501         and destroyed quickly.
2502
2503         * WebProcess/WebProcess.cpp:
2504         (WebKit::WebProcess::ensureNetworkProcessConnection):
2505         (WebKit::WebProcess::ensureWebToStorageProcessConnection):
2506
2507 2018-05-02  Nan Wang  <n_wang@apple.com>
2508
2509         AX: Missing kAXSWebAccessibilityEventsEnabledNotification causes a crash
2510         https://bugs.webkit.org/show_bug.cgi?id=185237
2511
2512         Reviewed by Dan Bernstein.
2513
2514         When libAccessibility.dylib is missing, the compiler would optimize out the global
2515         notification and lead to a crash. Fixed it by using the isNullFunction check instead,
2516         since we are sure the global notification would be there when the corresponding function 
2517         is available.
2518
2519         * UIProcess/API/Cocoa/WKWebView.mm:
2520         (-[WKWebView _initializeWithConfiguration:]):
2521
2522 2018-05-02  Keith Rollin  <krollin@apple.com>
2523
2524         Add facility for tracking times and results of page and resource loading
2525         https://bugs.webkit.org/show_bug.cgi?id=184838
2526         <rdar://problem/36548974>
2527
2528         Reviewed by Brent Fulgham.
2529
2530         Add NetworkActivityTracker. The idea behind this facility is to create
2531         and destroy them around networking activity that we want to track for
2532         the purpose of measuring overall network health. They can be created
2533         around the loading of pages or individual resources, and can be
2534         arranged in a parent/child hierarchy to indicate what pages the
2535         resources are part of. The NetworkActivity tracker tracks load times
2536         and results. On Cocoa, it can be integrated with CFNetwork in order to
2537         associate WebKit activity with low-level networking activity.
2538
2539         * CMakeLists.txt:
2540         * Configurations/WebKit.xcconfig:
2541         * NetworkProcess/NetworkActivityTracker.cpp: Copied from Source/WebKit/NetworkProcess/NetworkLoadParameters.h.
2542         (WebKit::NetworkActivityTracker::NetworkActivityTracker):
2543         (WebKit::NetworkActivityTracker::~NetworkActivityTracker):
2544         (WebKit::NetworkActivityTracker::setParent):
2545         (WebKit::NetworkActivityTracker::start):
2546         (WebKit::NetworkActivityTracker::complete):
2547         * NetworkProcess/NetworkActivityTracker.h: Added.
2548         (WebKit::NetworkActivityTracker::getPlatformObject):
2549         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2550         (WebKit::NetworkConnectionToWebProcess::didClose):
2551         (WebKit::NetworkConnectionToWebProcess::pageLoadCompleted):
2552         (WebKit::networkActivityTrackingEnabled):
2553         (WebKit::NetworkConnectionToWebProcess::startTrackingResourceLoad):
2554         (WebKit::NetworkConnectionToWebProcess::stopTrackingResourceLoad):
2555         (WebKit::NetworkConnectionToWebProcess::stopAllNetworkActivityTracking):
2556         (WebKit::NetworkConnectionToWebProcess::stopAllNetworkActivityTrackingForPage):
2557         (WebKit::NetworkConnectionToWebProcess::findRootNetworkActivity):
2558         (WebKit::NetworkConnectionToWebProcess::findNetworkActivityTracker):
2559         * NetworkProcess/NetworkConnectionToWebProcess.h:
2560         (WebKit::NetworkConnectionToWebProcess::ResourceNetworkActivityTracker::ResourceNetworkActivityTracker):
2561         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2562         * NetworkProcess/NetworkDataTask.cpp:
2563         (WebKit::NetworkDataTask::create):
2564         * NetworkProcess/NetworkLoadParameters.h:
2565         * NetworkProcess/NetworkProcess.cpp:
2566         (WebKit::NetworkProcess::initializeNetworkProcess):
2567         * NetworkProcess/NetworkProcess.h:
2568         (WebKit::NetworkProcess::trackNetworkActivity const):
2569         * NetworkProcess/NetworkProcessCreationParameters.cpp:
2570         (WebKit::NetworkProcessCreationParameters::encode const):
2571         (WebKit::NetworkProcessCreationParameters::decode):
2572         * NetworkProcess/NetworkProcessCreationParameters.h:
2573         * NetworkProcess/NetworkResourceLoader.cpp:
2574         (WebKit::NetworkResourceLoader::start):
2575         (WebKit::NetworkResourceLoader::cleanup):
2576         (WebKit::NetworkResourceLoader::abort):
2577         (WebKit::NetworkResourceLoader::didFinishLoading):
2578         (WebKit::NetworkResourceLoader::didFailLoading):
2579         (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
2580         (WebKit::NetworkResourceLoader::continueProcessingCachedEntryAfterDidReceiveResponse):
2581         * NetworkProcess/NetworkResourceLoader.h:
2582         * NetworkProcess/cocoa/NetworkActivityTrackerCocoa.mm: Added.
2583         (WebKit::NetworkActivityTracker::NetworkActivityTracker):
2584         (WebKit::NetworkActivityTracker::~NetworkActivityTracker):
2585         (WebKit::NetworkActivityTracker::setParent):
2586         (WebKit::NetworkActivityTracker::start):
2587         (WebKit::NetworkActivityTracker::complete):
2588         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
2589         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2590         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
2591         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2592         (API::ProcessPoolConfiguration::copy):
2593         * UIProcess/API/APIProcessPoolConfiguration.h:
2594         * UIProcess/API/C/WKContextConfigurationRef.cpp:
2595         (WKContextConfigurationTrackNetworkActivity):
2596         (WKContextConfigurationSetTrackNetworkActivity):
2597         * UIProcess/API/C/WKContextConfigurationRef.h:
2598         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
2599         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
2600         (-[_WKProcessPoolConfiguration trackNetworkActivity]):
2601         (-[_WKProcessPoolConfiguration setTrackNetworkActivity:]):
2602         * UIProcess/WebProcessPool.cpp:
2603         (WebKit::WebProcessPool::ensureNetworkProcess):
2604         * WebKit.xcodeproj/project.pbxproj:
2605         * WebProcess/Network/WebLoaderStrategy.cpp:
2606         (WebKit::WebLoaderStrategy::pageLoadCompleted):
2607         * WebProcess/Network/WebLoaderStrategy.h:
2608
2609 2018-05-02  Jer Noble  <jer.noble@apple.com>
2610
2611         Open audio/video sandbox services for minimal simulator
2612         https://bugs.webkit.org/show_bug.cgi?id=185217
2613         <rdar://problem/39918909>
2614
2615         Reviewed by Per Arne Vollan.
2616
2617         * WebKit.xcodeproj/project.pbxproj:
2618         * WebProcess/com.apple.WebProcess.sb.in:
2619
2620 2018-05-02  Daniel Bates  <dabates@apple.com>
2621
2622         Cleanup NetworkResourceLoader::didReceiveResponse()
2623         https://bugs.webkit.org/show_bug.cgi?id=185209
2624
2625         Reviewed by Chris Dumez.
2626
2627         Use early returns to make the control flow easier to read and reason about. Disregarding a
2628         From-Origin violation, NetworkResourceLoader::didReceiveResponse() only returns NetworkLoadClient::ShouldContinueDidReceiveResponse::No
2629         when the load is for a main resource and hence it must wait for the embedding client to allow
2630         the load before continuing with it. With regards to a From-Origin violation, the network
2631         process schedules to fail the load in a subsequent turn of the event loop before returning
2632         NetworkLoadClient::ShouldContinueDidReceiveResponse::No. It return NetworkLoadClient::ShouldContinueDidReceiveResponse::No
2633         solely to tell the NetworkLoadClient to defer assuming the load is allowed (because we will
2634         fail it on the next turn of the event loop).
2635
2636         Additionally, remove all logging about the return value as we no longer have a need for
2637         such logging.
2638
2639         * NetworkProcess/NetworkResourceLoader.cpp:
2640         (WebKit::NetworkResourceLoader::didReceiveResponse):
2641
2642 2018-05-02  Alex Christensen  <achristensen@webkit.org>
2643
2644         Add WKWebsiteDataStorePrivate._proxyConfiguration SPI
2645         https://bugs.webkit.org/show_bug.cgi?id=185179
2646
2647         Reviewed by Andy Estes.
2648
2649         * NetworkProcess/NetworkSessionCreationParameters.h:
2650         (WebKit::NetworkSessionCreationParameters::encode const):
2651         (WebKit::NetworkSessionCreationParameters::decode):
2652         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2653         (WebKit::NetworkDataTaskCocoa::applySniffingPoliciesAndBindRequestToInferfaceIfNeeded):
2654         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
2655         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2656         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
2657         * Shared/WebsiteDataStoreParameters.cpp:
2658         (WebKit::WebsiteDataStoreParameters::privateSessionParameters):
2659         * Shared/cf/ArgumentCodersCF.cpp:
2660         (IPC::encode):
2661         (IPC::decode):
2662         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2663         (-[WKWebsiteDataStore _setProxyConfiguration:]):
2664         (-[WKWebsiteDataStore _proxyConfiguration]):
2665         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
2666         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
2667         (WebKit::WebsiteDataStore::parameters):
2668         * UIProcess/WebsiteData/WebsiteDataStore.h:
2669         (WebKit::WebsiteDataStore::setProxyConfiguration):
2670         (WebKit::WebsiteDataStore::proxyConfiguration):
2671
2672 2018-05-02  Youenn Fablet  <youenn@apple.com>
2673
2674         Use NetworkLoadChecker for navigation loads
2675         https://bugs.webkit.org/show_bug.cgi?id=184892
2676         <rdar://problem/39652686>
2677
2678         Reviewed by Chris Dumez.
2679
2680         Compute whether a response is same origin in no-cors case.
2681         This allows providing more precise filtering.
2682         In case of navigate loads, set the tainting to basic which will make filtering to the minimum.
2683
2684         Pass the sourceOrigin for navigation loads as well.
2685         Enable to restrict HTTP response access for navigation load.
2686
2687         Content Blockers are disabled for now in NetworkLoadChecker for navigation loads.
2688         They should be reenabled as a follow-up.
2689
2690         Add a specific case to allow any redirection to about:// URLs.
2691         While this does not conform with the spec, this keeps the existing WebKit behavior.
2692
2693         * NetworkProcess/NetworkLoadChecker.cpp:
2694         (WebKit::NetworkLoadChecker::NetworkLoadChecker):
2695         (WebKit::NetworkLoadChecker::validateResponse):
2696         (WebKit::NetworkLoadChecker::continueCheckingRequest):
2697         (WebKit::NetworkLoadChecker::doesNotNeedCORSCheck const):
2698         * NetworkProcess/NetworkResourceLoader.cpp:
2699         (WebKit::NetworkResourceLoader::sanitizeResponseIfPossible):
2700         * WebProcess/Network/WebLoaderStrategy.cpp:
2701         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
2702         (WebKit::WebLoaderStrategy::isDoingLoadingSecurityChecks const):
2703         We only do security checks if this runtime flag is on.
2704         * WebProcess/Network/WebLoaderStrategy.h:
2705
2706 2018-05-02  Jer Noble  <jer.noble@apple.com>
2707
2708         Make EncryptedMediaAPIEnabled an experimental feature
2709         https://bugs.webkit.org/show_bug.cgi?id=185212
2710
2711         Reviewed by Eric Carlson.
2712
2713         * Shared/WebPreferences.yaml:
2714
2715 2018-05-02  Per Arne Vollan  <pvollan@apple.com>
2716
2717         Adjust sandbox profile in simulator mode.
2718         https://bugs.webkit.org/show_bug.cgi?id=185172
2719         <rdar://problem/39876860>
2720
2721         Reviewed by Brent Fulgham.
2722
2723         Fix some sandbox violations.
2724
2725         * WebProcess/com.apple.WebProcess.sb.in:
2726
2727 2018-05-02  Brian Burg  <bburg@apple.com>
2728
2729         Web Inspector: opt out of process swap on navigation if a Web Inspector frontend is connected
2730         https://bugs.webkit.org/show_bug.cgi?id=184861
2731         <rdar://problem/39153768>
2732
2733         Reviewed by Ryosuke Niwa.
2734
2735         We need to track how many frontends are attached to the web page (both local and remote).
2736         InspectorController propagates this out to WebKit via InspectorClient. This is then
2737         kept in UIProcess as a member of WebPageProxy. When making a decision whether to use a
2738         new process for a navigation, return early with "no" if any frontends are open for the
2739         page being navigated.
2740
2741         * UIProcess/WebPageProxy.h:
2742         (WebKit::WebPageProxy::didChangeInspectorFrontendCount):
2743         (WebKit::WebPageProxy::inspectorFrontendCount const):
2744         * UIProcess/WebPageProxy.messages.in:
2745         * UIProcess/WebProcessPool.cpp:
2746         (WebKit::WebProcessPool::processForNavigation):
2747         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
2748         (WebKit::WebInspectorClient::frontendCountChanged):
2749         * WebProcess/WebCoreSupport/WebInspectorClient.h:
2750         * WebProcess/WebPage/WebPage.cpp:
2751         (WebKit::WebPage::inspectorFrontendCountChanged):
2752         * WebProcess/WebPage/WebPage.h:
2753
2754 2018-05-02  Jer Noble  <jer.noble@apple.com>
2755
2756         Adopt -destinationWindowToExitFullScreenForWindow:
2757         https://bugs.webkit.org/show_bug.cgi?id=185204
2758         <rdar://problem/22486621>
2759
2760         Reviewed by Eric Carlson.
2761
2762         * UIProcess/mac/WKFullScreenWindowController.mm:
2763         (-[WKFullScreenWindowController destinationWindowToExitFullScreenForWindow:]):
2764
2765 2018-05-02  Per Arne Vollan  <pvollan@apple.com>
2766
2767         Disable Media capture rules in sandbox for simulator.
2768         https://bugs.webkit.org/show_bug.cgi?id=185206
2769         <rdar://problem/39910015>
2770
2771         Reviewed by Eric Carlson.
2772
2773         These rules are not relevant in this case.
2774
2775         * WebProcess/com.apple.WebProcess.sb.in:
2776
2777 2018-05-02  Eric Carlson  <eric.carlson@apple.com>
2778
2779         [iOS] Provide audio route information when invoking AirPlay picker
2780         https://bugs.webkit.org/show_bug.cgi?id=185199
2781         <rdar://problem/39853103>
2782
2783         Reviewed by Jer Noble.
2784
2785         * Scripts/webkit/messages.py:
2786         * UIProcess/PageClient.h:
2787         * UIProcess/WebPageProxy.h:
2788         * UIProcess/WebPageProxy.messages.in:
2789         * UIProcess/ios/PageClientImplIOS.h:
2790         * UIProcess/ios/PageClientImplIOS.mm:
2791         (WebKit::PageClientImpl::showPlaybackTargetPicker):  Pass route sharing policy and routing context UID.
2792
2793         * UIProcess/ios/WKContentViewInteraction.h:
2794         * UIProcess/ios/WKContentViewInteraction.mm:
2795         (-[WKContentView _showPlaybackTargetPicker:fromRect:routeSharingPolicy:routingContextUID:]): Take same.
2796         (-[WKContentView _showPlaybackTargetPicker:fromRect:]): Deleted.
2797
2798         * UIProcess/ios/WebPageProxyIOS.mm:
2799         (WebKit::WebPageProxy::showPlaybackTargetPicker): Pass route sharing policy and routing context UID.
2800
2801         * UIProcess/ios/forms/WKAirPlayRoutePicker.h:
2802         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
2803         (-[WKAirPlayRoutePicker showFromView:routeSharingPolicy:routingContextUID:]): Take same.
2804         (-[WKAirPlayRoutePicker showFromView:]): Deleted.
2805
2806         * WebProcess/WebCoreSupport/WebChromeClient.h:
2807         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
2808         (WebKit::WebChromeClient::showPlaybackTargetPicker):
2809
2810 2018-05-02  Jer Noble  <jer.noble@apple.com>
2811
2812         Get the WebKit.framework bundle by asking for WKWebView
2813         https://bugs.webkit.org/show_bug.cgi?id=185175
2814
2815         Reviewed by Tim Horton.
2816
2817         * NetworkProcess/mac/NetworkProcessMac.mm:
2818         (WebKit::NetworkProcess::initializeSandbox):
2819         * Shared/mac/ChildProcessMac.mm:
2820         (WebKit::ChildProcess::initializeSandbox):
2821         * StorageProcess/mac/StorageProcessMac.mm:
2822         (WebKit::StorageProcess::initializeSandbox):
2823
2824 2018-05-02  Youenn Fablet  <youenn@apple.com>
2825
2826         Cannot gather srflx or relay ICE candidates on IPv6 network (ICE agent hangs?)
2827         https://bugs.webkit.org/show_bug.cgi?id=181009
2828         <rdar://problem/36144555>
2829
2830         Reviewed by Eric Carlson.
2831
2832         On iOS/IPv6 networks, STUN servers name resolution returns a zero IPv6 IP address.
2833         No error is raised which leads to sending STUN requests with that IP address.
2834         Once the request times out, the ICE candidate gathering finishes with host candidates only.
2835
2836         This patch makes WebRTC DNS resolver to send only IPv4 resolved addresses.
2837         STUN is used for NAT traversal which is for IPv4 addresses.
2838         Not sending IPv6 addresses allows terminating ICE candidate gathering sooner.
2839
2840         Manually tested on iOS with IPv4/IPv6 and IPv6 networks.
2841
2842         * NetworkProcess/webrtc/NetworkRTCResolverCocoa.cpp:
2843         (WebKit::resolvedName):
2844
2845 2018-05-02  Youenn Fablet  <youenn@apple.com>
2846
2847         CacheStorage::Engine should keep a list of initialization callback
2848         https://bugs.webkit.org/show_bug.cgi?id=185184
2849         <rdar://problem/38875651>
2850
2851         Reviewed by Antti Koivisto.
2852
2853         Keep each initialize callback in a Vector so as to compute the salt only once.
2854         Call all callbacks then in a loop.
2855
2856         * NetworkProcess/cache/CacheStorageEngine.cpp:
2857         (WebKit::CacheStorage::Engine::~Engine):
2858         (WebKit::CacheStorage::Engine::initialize):
2859         * NetworkProcess/cache/CacheStorageEngine.h:
2860
2861 2018-05-02  Jer Noble  <jer.noble@apple.com>
2862
2863         Pipe volume through PlaybackSessionManager/Proxy.
2864         https://bugs.webkit.org/show_bug.cgi?id=185182
2865
2866         Reviewed by Eric Carlson.
2867
2868         * UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
2869         * UIProcess/Cocoa/PlaybackSessionManagerProxy.messages.in:
2870         * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
2871         (WebKit::PlaybackSessionModelContext::setVolume):
2872         (WebKit::PlaybackSessionModelContext::volumeChanged):
2873         (WebKit::PlaybackSessionManagerProxy::volumeChanged):
2874         (WebKit::PlaybackSessionManagerProxy::setVolume):
2875         * WebProcess/cocoa/PlaybackSessionManager.h:
2876         * WebProcess/cocoa/PlaybackSessionManager.messages.in:
2877         * WebProcess/cocoa/PlaybackSessionManager.mm:
2878         (WebKit::PlaybackSessionInterfaceContext::volumeChanged):
2879         (WebKit::PlaybackSessionManager::volumeChanged):
2880         (WebKit::PlaybackSessionManager::setVolume):
2881
2882 2018-05-01  Yusuke Suzuki  <utatane.tea@gmail.com>
2883
2884         Use default std::optional if it is provided
2885         https://bugs.webkit.org/show_bug.cgi?id=185159
2886
2887         Reviewed by JF Bastien.
2888
2889         * Shared/SandboxExtension.h:
2890         (WebKit::SandboxExtension::Handle::decode):
2891         * Shared/TouchBarMenuItemData.cpp:
2892         (WebKit::TouchBarMenuItemData::decode):
2893
2894 2018-05-01  Jer Noble  <jer.noble@apple.com>
2895
2896         Production build error in Migrate Header phase when WK_ALTERNATE_FRAMEWORKS_DIR is set to non-empty value
2897         https://bugs.webkit.org/show_bug.cgi?id=185171
2898
2899         Reviewed by Timothy Hatcher.
2900
2901         * Configurations/BaseTarget.xcconfig:
2902
2903 2018-05-01  Per Arne Vollan  <pvollan@apple.com>
2904
2905         Use correct runloop type in the WebContent process.
2906         https://bugs.webkit.org/show_bug.cgi?id=185140
2907
2908         Reviewed by Brent Fulgham.
2909
2910         Use WK_MACOS_* machinery to determine runloop type for the WebContent process.
2911
2912         * Configurations/WebContentService.xcconfig:
2913
2914 2018-05-01  Oleksandr Skachkov  <gskachkov@gmail.com>
2915
2916         WebAssembly: add support for stream APIs - JavaScript API
2917         https://bugs.webkit.org/show_bug.cgi?id=183442
2918
2919         Reviewed by Yusuke Suzuki and JF Bastien.
2920
2921         Add WEBASSEMBLY_STREAMING_API feature flag
2922
2923         * Configurations/FeatureDefines.xcconfig:
2924
2925 2018-04-30  Per Arne Vollan  <pvollan@apple.com>
2926
2927         Use correct runloop type in the WebContent process.
2928         https://bugs.webkit.org/show_bug.cgi?id=185140
2929         <rdar://problem/39585037>
2930
2931         Reviewed by Brent Fulgham.
2932
2933         The macOS target version should be used to determine the runloop type.
2934
2935         * Configurations/WebContentService.xcconfig:
2936
2937 2018-04-30  Michael Saboff  <msaboff@apple.com>
2938
2939         Eliminate WebProcessShim.dylib
2940         https://bugs.webkit.org/show_bug.cgi?id=185147
2941
2942         Reviewed by Ryosuke Niwa.
2943
2944         * Configurations/WebContentService.xcconfig:
2945         * Configurations/WebProcessShim.xcconfig: Removed.
2946         * WebKit.xcodeproj/project.pbxproj:
2947
2948 2018-04-30  Michael Saboff  <msaboff@apple.com>
2949
2950         Remove unused mac/CookieStorageShimLibrary
2951         https://bugs.webkit.org/show_bug.cgi?id=185146
2952
2953         Reviewed by Alex Christensen.
2954
2955         * Shared/mac/CookieStorageShimLibrary.cpp: Removed.
2956         * Shared/mac/CookieStorageShimLibrary.h: Removed.
2957         * WebKit.xcodeproj/project.pbxproj:
2958
2959 2018-04-30  Alex Christensen  <achristensen@webkit.org>
2960
2961         Add WKUIDelegatePrivate equivalent of WKPageContextMenuClient getContextMenuFromProposedMenuAsync
2962         https://bugs.webkit.org/show_bug.cgi?id=180955
2963
2964         Reviewed by Andy Estes.
2965
2966         * UIProcess/API/APIContextMenuClient.h:
2967         (API::ContextMenuClient::menuFromProposedMenu):
2968         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2969         * UIProcess/Cocoa/UIDelegate.h:
2970         * UIProcess/Cocoa/UIDelegate.mm:
2971         (WebKit::UIDelegate::setDelegate):
2972         (WebKit::UIDelegate::ContextMenuClient::menuFromProposedMenu):
2973         * UIProcess/mac/WebContextMenuProxyMac.mm:
2974         (WebKit::WebContextMenuProxyMac::showContextMenuWithItems):
2975
2976 2018-04-30  JF Bastien  <jfbastien@apple.com>
2977
2978         Use some C++17 features
2979         https://bugs.webkit.org/show_bug.cgi?id=185135
2980
2981         Reviewed by Alex Christensen.
2982
2983         As discussed here [0] let's move WebKit to a subset of C++17. We
2984         now require GCC 6 [1] which means that, according to [2] we can
2985         use the following C++17 language features (I removed some
2986         uninteresting ones):
2987
2988          - New auto rules for direct-list-initialization
2989          - static_assert with no message
2990          - typename in a template template parameter
2991          - Nested namespace definition
2992          - Attributes for namespaces and enumerators
2993          - u8 character literals
2994          - Allow constant evaluation for all non-type template arguments
2995          - Fold Expressions
2996          - Unary fold expressions and empty parameter packs
2997          - __has_include in preprocessor conditional
2998          - Differing begin and end types in range-based for
2999          - Improving std::pair and std::tuple
3000
3001         Consult the Tony Tables [3] to see before / after examples.
3002
3003         Of course we can use any library feature if we're willing to
3004         import them to WTF (and they don't require language support).
3005
3006
3007           [0]: https://lists.webkit.org/pipermail/webkit-dev/2018-March/029922.html
3008           [1]: https://trac.webkit.org/changeset/231152/webkit
3009           [2]: https://en.cppreference.com/w/cpp/compiler_support
3010           [3]: https://github.com/tvaneerd/cpp17_in_TTs/blob/master/ALL_IN_ONE.md
3011
3012         * Configurations/Base.xcconfig:
3013         * DerivedSources.make:
3014         * PlatformMac.cmake:
3015
3016 2018-04-30  Wenson Hsieh  <wenson_hsieh@apple.com>
3017
3018         [Extra zoom mode] Respect the existing shrink-to-fit attribute instead of using min-device-width
3019         https://bugs.webkit.org/show_bug.cgi?id=185132
3020         <rdar://problem/39834562>
3021
3022         Reviewed by Tim Horton.
3023
3024         Remove the experimental feature for `min-device-width`.
3025
3026         * Shared/WebPreferences.yaml:
3027
3028 2018-04-30  Keith Rollin  <krollin@apple.com>
3029
3030         Include breadcrumb for tracking resource loading into CFNetwork
3031         https://bugs.webkit.org/show_bug.cgi?id=184837
3032         rdar://problem/39575411
3033
3034         Reviewed by Brent Fulgham.
3035
3036         When starting the network-based loading of a resource, log the
3037         description provided by NetworkDataTask. On Cocoa, this is implemented
3038         to return the description property in NSURLSessionTask. This
3039         information better allows us to track a resource load through the
3040         WebContent process, the Networking process, and the Cocoa networking
3041         layers.
3042
3043         * NetworkProcess/NetworkDataTask.cpp:
3044         (WebKit::NetworkDataTask::description const):
3045         * NetworkProcess/NetworkDataTask.h:
3046         * NetworkProcess/NetworkLoad.cpp:
3047         (WebKit::NetworkLoad::description const):
3048         * NetworkProcess/NetworkLoad.h:
3049         * NetworkProcess/NetworkResourceLoader.cpp:
3050         (WebKit::NetworkResourceLoader::startNetworkLoad):
3051         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
3052         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3053         (WebKit::NetworkDataTaskCocoa::description const):
3054
3055 2018-04-30  Andy Estes  <aestes@apple.com>
3056
3057         [iOS] Try to unlock PDF documents before printing them
3058         https://bugs.webkit.org/show_bug.cgi?id=185084
3059         <rdar://problem/39356622>
3060
3061         Reviewed by Dan Bernstein.
3062
3063         * UIProcess/ios/WKPDFView.mm:
3064         (-[WKPDFView pdfHostViewController:documentDidUnlockWithPassword:]):
3065
3066         Stored the password that successfully unlocked the current PDF document.
3067
3068         (-[WKPDFView _wk_printedDocument]):
3069
3070         Used the stored password to unlock the CGPDFDocument we create for printing.
3071
3072 2018-04-28  Andy Estes  <aestes@apple.com>
3073
3074         [iOS] Present an action sheet when long-pressing on PDF links
3075         https://bugs.webkit.org/show_bug.cgi?id=185093
3076         <rdar://problem/39356651>
3077
3078         Reviewed by Dan Bernstein.
3079
3080         * UIProcess/ios/WKPDFView.mm:
3081         (-[WKPDFView dealloc]):
3082
3083         Called -[WKActionSheetAssistant cleanupSheet].
3084
3085         (-[WKPDFView web_setContentProviderData:suggestedFilename:]):
3086
3087         Created a WKActionSheetAssistant with the host view as the assistant view and
3088         ourselves as the delegate.
3089
3090         (-[WKPDFView _URLWithPageIndex:]):
3091
3092         Added. Creates a URL to the current page with a page number fragment appended.
3093
3094         (-[WKPDFView _goToURL:atLocation:]):
3095
3096         Added. Navigates to a URL with a synthetic mouse click at a location in host view
3097         coordinates.
3098
3099         (-[WKPDFView pdfHostViewController:goToURL:]):
3100         (-[WKPDFView pdfHostViewController:goToPageIndex:withViewFrustum:]):
3101
3102         Called -_goToURL:atLocation:. Used -_URLWithPageIndex: to construct an NSURL from
3103         a page index.
3104
3105         (-[WKPDFView _showActionSheetForURL:atLocation:]):
3106
3107         Added. Populates _positionInformation with a URL and location and calls
3108         -[WKActionSheetAssistant showLinkSheet].
3109
3110         (-[WKPDFView pdfHostViewController:didLongPressURL:atLocation:]):
3111         (-[WKPDFView pdfHostViewController:didLongPressPageIndex:atLocation:]):
3112
3113         Called -_showActionSheetForURL:atLocation:. Used -_URLWithPageIndex: to construct
3114         an NSURL from a page index.
3115
3116         (-[WKPDFView positionInformationForActionSheetAssistant:]):
3117
3118         Returned _positionInformation.
3119
3120         (-[WKPDFView actionSheetAssistant:performAction:]):
3121
3122         Populated the pasteboard with plain text and URL representations of
3123         _positionInformation.url.
3124
3125         (-[WKPDFView actionSheetAssistant:openElementAtLocation:]):
3126
3127         Called -_goToURL:atLocation.
3128
3129         (-[WKPDFView actionSheetAssistant:shareElementWithURL:rect:]):
3130
3131         Created a UIWKSelectionAssistant and called -showShareSheetFor:fromRect:.
3132
3133         (-[WKPDFView actionSheetAssistant:shouldIncludeAppLinkActionsForElement:]):
3134
3135         Returned API::UIClient::shouldIncludeAppLinkActionsForElement().
3136
3137         (-[WKPDFView actionSheetAssistant:decideActionsForElement:defaultActions:]):
3138
3139         Returned API::UIClient::actionsForElement()l
3140
3141 2018-04-28  Andy Estes  <aestes@apple.com>
3142
3143         [iOS] Allow com.apple.WebKit.Networking to look up com.apple.wifi.manager
3144         https://bugs.webkit.org/show_bug.cgi?id=185114
3145         <rdar://problem/39808763>
3146
3147         Reviewed by Wenson Hsieh.
3148
3149         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
3150
3151 2018-04-28  Brent Fulgham  <bfulgham@apple.com>
3152
3153         Revise sandboxes to allow additional IOKit property access
3154         https://bugs.webkit.org/show_bug.cgi?id=185095
3155         <rdar://problem/39809455>
3156
3157         Reviewed by Eric Carlson.
3158
3159         Update the WebContent and Plugin processes to allow additional IOKit property access.
3160
3161         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
3162         * WebProcess/com.apple.WebProcess.sb.in:
3163
3164 2018-04-28  Carlos Garcia Campos  <cgarcia@igalia.com>
3165
3166         [GTK] WebProcess from WebKitGtk+ 2.19.92 SIGSEVs in WebCore::TextureMapperGL::~TextureMapperGL
3167         https://bugs.webkit.org/show_bug.cgi?id=184040
3168
3169         Reviewed by Michael Catanzaro.
3170
3171         This can happen when using single shared process model or when the process limit is reached in multiple process
3172         model. In this case, all pages in the same web process with accelerated compositing enabled share the same
3173         compositing thread. Every page sets its GL context as current when rendering a frame, but not when invalidating
3174         the threaded compositor when the page is closed. So, if a hidden tab is closed, the threaded compositor is
3175         invalidated and the GL resources of the current context (the visible page) are destroyed. This is also causing
3176         the blank pages issue when closing a tab related to another one, the current one stops rendering anything because
3177         its GL context has been released. We should make the threaded compositor context current when invalidating it.
3178
3179         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
3180         (WebKit::ThreadedCompositor::invalidate):
3181
3182 2018-04-27  Timothy Hatcher  <timothy@apple.com>
3183
3184         REGRESSION: Touch events fail to dispatch to the page in all cases.
3185
3186         https://bugs.webkit.org/show_bug.cgi?id=185097
3187         rdar://problem/39731995
3188
3189         Reviewed by Tim Horton.
3190
3191         * UIProcess/ios/WKContentViewInteraction.mm:
3192         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
3193         Consult internal gesture recognizers, otherwise NO might get returned.
3194
3195 2018-04-26  Ryosuke Niwa  <rniwa@webkit.org>
3196
3197         PSON: Triggering a navigation to an invalid URL creates a new WebContent process
3198         https://bugs.webkit.org/show_bug.cgi?id=185066
3199
3200         Reviewed by Youenn Fablet.
3201
3202         Don't create a new WebContent process when the target URL is invalid as well as when the source URL is invalid.
3203
3204         * UIProcess/WebProcessPool.cpp:
3205         (WebKit::WebProcessPool::processForNavigationInternal):
3206
3207 2018-04-27  Youenn Fablet  <youenn@apple.com>
3208
3209         Use NetworkLoadChecker for XHR/fetch loads
3210         https://bugs.webkit.org/show_bug.cgi?id=184741
3211
3212         Reviewed by Chris Dumez.
3213
3214         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
3215         (WebKit::NetworkCORSPreflightChecker::didCompleteWithError):
3216         Pass the preflight error as completion error if any.
3217         * NetworkProcess/NetworkLoad.cpp:
3218         (WebKit::NetworkLoad::willPerformHTTPRedirection):
3219         Set response source to Network so that checks relying on that are correct.
3220         * NetworkProcess/NetworkLoadChecker.cpp:
3221         (WebKit::NetworkLoadChecker::validateResponse):
3222         Adding Oppaqueredirect tainting.
3223         (NetworkLoadChecker::doesNotNeedCORSCheck):
3224         Adding a check to only activate CORS checks for CORS enabled schemes.
3225         Non CORS enabled schemes loads should have failed in WebProcess already.
3226         (WebKit::NetworkLoadChecker::checkCORSRedirectedRequest):
3227         Remove Authorization header as done by SubresourceLoader.
3228         (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
3229         If error is cancellation, we still want to call the completion handler.
3230         * NetworkProcess/NetworkResourceLoader.cpp:
3231         Activate network load checker for all types of loads.
3232         (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
3233         Handle manual redirection by directly calling didReceiveResponse.
3234
3235 2018-04-27  Wenson Hsieh  <wenson_hsieh@apple.com>
3236
3237         Add an experimental feature flag for viewport "min-device-width"
3238         https://bugs.webkit.org/show_bug.cgi?id=185050
3239         <rdar://problem/39624038>
3240
3241         Reviewed by Tim Horton.
3242
3243         Add MinDeviceWidthEnabled as a new experimental feature, on by default in extra zoom mode and off elsewhere.
3244
3245         * Shared/WebPreferences.yaml:
3246         * Shared/WebPreferencesDefaultValues.h:
3247
3248 2018-04-27  Daniel Bates  <dabates@apple.com>
3249
3250         UIDelegate::UIClient::didResignInputElementStrongPasswordAppearance() is applicable to both Mac and iOS
3251         https://bugs.webkit.org/show_bug.cgi?id=185079
3252         <rdar://problem/39794960>
3253
3254         I inadvertently forgot to move the UIDelegate field webViewDidResignInputElementStrongPasswordAppearanceWithUserInfo
3255         outside the PLATFORM(MAC)-guard.
3256
3257         * UIProcess/Cocoa/UIDelegate.h:
3258
3259 2018-04-27  Daniel Bates  <dabates@apple.com>
3260
3261         UIDelegate::UIClient::didResignInputElementStrongPasswordAppearance() is applicable to both Mac and iOS
3262         https://bugs.webkit.org/show_bug.cgi?id=185079
3263         <rdar://problem/39794960>
3264
3265         Reviewed by Andy Estes.
3266
3267         * UIProcess/Cocoa/UIDelegate.h:
3268         * UIProcess/Cocoa/UIDelegate.mm:
3269         (WebKit::UIDelegate::setDelegate):
3270         (WebKit::UIDelegate::UIClient::didResignInputElementStrongPasswordAppearance):
3271
3272 2018-04-27  Wenson Hsieh  <wenson_hsieh@apple.com>
3273
3274         Rename minimumLayoutSize to viewLayoutSize
3275         https://bugs.webkit.org/show_bug.cgi?id=185050
3276         <rdar://problem/39624038>
3277
3278         Reviewed by Tim Horton.
3279
3280         Renames minimumLayoutSize to viewLayoutSize, since the minimum layout size in ViewportConfiguration is now
3281         different from the minimum layout size that is currently pushed down from the UI process (e.g. WKWebView SPI) in
3282         the case where `min-device-width` is used to override the minimum layout size.
3283
3284         * Shared/WebPageCreationParameters.cpp:
3285         (WebKit::WebPageCreationParameters::encode const):
3286         (WebKit::WebPageCreationParameters::decode):
3287         * Shared/WebPageCreationParameters.h:
3288         * UIProcess/API/Cocoa/WKWebView.mm:
3289         (-[WKWebView _processDidExit]):
3290         (-[WKWebView activeViewLayoutSize:]):
3291         (-[WKWebView _dispatchSetViewLayoutSize:]):
3292         (-[WKWebView _frameOrBoundsChanged]):
3293         (-[WKWebView _minimumLayoutSizeOverride]):
3294         (-[WKWebView _setViewLayoutSizeOverride:]):
3295         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
3296         (-[WKWebView _endAnimatedResize]):
3297         (-[WKWebView _overrideLayoutParametersWithMinimumLayoutSize:maximumUnobscuredSizeOverride:]):
3298         (-[WKWebView _clearOverrideLayoutParameters]):
3299         (-[WKWebView _minimumLayoutWidth]):
3300         (-[WKWebView _setMinimumLayoutWidth:]):
3301         (-[WKWebView activeMinimumLayoutSize:]): Deleted.
3302         (-[WKWebView _dispatchSetMinimumLayoutSize:]): Deleted.
3303         (-[WKWebView _setMinimumLayoutSizeOverride:]): Deleted.
3304         (-[WKWebView _overrideLayoutParametersWithMinimumLayoutSize:minimumLayoutSizeForMinimalUI:maximumUnobscuredSizeOverride:]): Deleted.
3305
3306         Remove unused SPI that has been deprecated since iOS 9, has a simple drop-in replacement, and no longer has any
3307         internal clients.
3308
3309         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3310         * UIProcess/Cocoa/WebViewImpl.mm:
3311         (WebKit::WebViewImpl::setMinimumSizeForAutoLayout):
3312         (WebKit::WebViewImpl::minimumSizeForAutoLayout const):
3313         (WebKit::WebViewImpl::setIntrinsicContentSize):
3314         * UIProcess/DrawingAreaProxy.h:
3315         (WebKit::DrawingAreaProxy::viewLayoutSizeDidChange):
3316         (WebKit::DrawingAreaProxy::minimumLayoutSizeDidChange): Deleted.
3317         * UIProcess/WebPageProxy.cpp:
3318         (WebKit::WebPageProxy::creationParameters):
3319         (WebKit::WebPageProxy::setViewLayoutSize):
3320         (WebKit::WebPageProxy::setMinimumLayoutSize): Deleted.
3321         * UIProcess/WebPageProxy.h:
3322         (WebKit::WebPageProxy::viewLayoutSize const):
3323         (WebKit::WebPageProxy::minimumLayoutSize const): Deleted.
3324         * UIProcess/ios/WebPageProxyIOS.mm:
3325         (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
3326         (WebKit::WebPageProxy::setViewportConfigurationViewLayoutSize):
3327         (WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSize): Deleted.
3328         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
3329         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
3330         (WebKit::TiledCoreAnimationDrawingAreaProxy::viewLayoutSizeDidChange):
3331         (WebKit::TiledCoreAnimationDrawingAreaProxy::didUpdateGeometry):
3332         (WebKit::TiledCoreAnimationDrawingAreaProxy::intrinsicContentSizeDidChange):
3333         (WebKit::TiledCoreAnimationDrawingAreaProxy::willSendUpdateGeometry):
3334         (WebKit::TiledCoreAnimationDrawingAreaProxy::minimumLayoutSizeDidChange): Deleted.
3335         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3336         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
3337         * WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
3338         (WebKit::ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture):
3339         * WebProcess/WebPage/WebPage.cpp:
3340         (WebKit::m_credentialsMessenger):
3341         (WebKit::WebPage::setViewLayoutSize):
3342         (WebKit::WebPage::setMinimumLayoutSize): Deleted.
3343         * WebProcess/WebPage/WebPage.h:
3344         (WebKit::WebPage::viewLayoutSize const):
3345         (WebKit::WebPage::minimumLayoutSize const): Deleted.
3346         * WebProcess/WebPage/WebPage.messages.in:
3347         * WebProcess/WebPage/ios/WebPageIOS.mm:
3348         (WebKit::WebPage::setViewportConfigurationViewLayoutSize):
3349         (WebKit::WebPage::dynamicViewportSizeUpdate):
3350         (WebKit::WebPage::setViewportConfigurationMinimumLayoutSize): Deleted.
3351         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3352         (WebKit::TiledCoreAnimationDrawingArea::updateIntrinsicContentSizeIfNeeded):
3353         (WebKit::TiledCoreAnimationDrawingArea::updateGeometry):
3354
3355 2018-04-27  Wenson Hsieh  <wenson_hsieh@apple.com>
3356
3357         [Extra zoom mode] Add a mechanism to override default viewport behaviors in extra zoom mode
3358         https://bugs.webkit.org/show_bug.cgi?id=185050
3359         <rdar://problem/39624038>
3360
3361         Reviewed by Tim Horton.
3362
3363         Remove the forceHorizontalViewportShrinkToFit and minimumAllowedLayoutWidth SPI hooks from WebKit, and
3364         additionally remove all logic for plumbing viewSize to WebCore. See WebCore/ChangeLog for more information.
3365
3366         * Shared/VisibleContentRectUpdateInfo.cpp:
3367         (WebKit::VisibleContentRectUpdateInfo::encode const):
3368         (WebKit::VisibleContentRectUpdateInfo::decode):
3369         (WebKit::operator<<):
3370         * Shared/VisibleContentRectUpdateInfo.h:
3371         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
3372         (WebKit::VisibleContentRectUpdateInfo::allowShrinkToFit const):
3373         (WebKit::operator==):
3374         (WebKit::VisibleContentRectUpdateInfo::forceHorizontalShrinkToFit const): Deleted.
3375         * UIProcess/API/Cocoa/WKWebView.mm:
3376         (-[WKWebView _initializeWithConfiguration:]):
3377         (-[WKWebView activeMinimumLayoutSize:]):
3378         (-[WKWebView _dispatchSetMinimumLayoutSize:]):
3379         (-[WKWebView _frameOrBoundsChanged]):
3380         (-[WKWebView _setMinimumLayoutSizeOverride:]):
3381         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
3382         (-[WKWebView _endAnimatedResize]):
3383         (-[WKWebView _minimumAllowedLayoutWidth]): Deleted.
3384         (-[WKWebView _setMinimumAllowedLayoutWidth:]): Deleted.
3385         (-[WKWebView activeMinimumLayoutSizes:]): Deleted.
3386         (-[WKWebView _dispatchSetMinimumLayoutSize:viewSize:]): Deleted.
3387         (-[WKWebView _setForceHorizontalViewportShrinkToFit:]): Deleted.
3388         (-[WKWebView _forceHorizontalViewportShrinkToFit]): Deleted.
3389         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3390         * UIProcess/WebPageProxy.cpp:
3391         (WebKit::WebPageProxy::creationParameters):
3392         * UIProcess/WebPageProxy.h:
3393         * UIProcess/ios/WKContentView.mm:
3394         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
3395         * UIProcess/ios/WebPageProxyIOS.mm:
3396         (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
3397         (WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSize):
3398         * WebProcess/WebPage/WebPage.cpp:
3399         (WebKit::m_credentialsMessenger):
3400         * WebProcess/WebPage/WebPage.h:
3401         * WebProcess/WebPage/WebPage.messages.in:
3402         * WebProcess/WebPage/ios/WebPageIOS.mm:
3403         (WebKit::WebPage::setViewportConfigurationMinimumLayoutSize):
3404         (WebKit::WebPage::dynamicViewportSizeUpdate):
3405         (WebKit::WebPage::updateVisibleContentRects):
3406
3407 2018-04-27  Carlos Garcia Campos  <cgarcia@igalia.com>
3408
3409         REGRESSION(r230812): [WPE][GTK] WebKitWebViewSessionState.cpp throws away encoded BackForwardList identifier
3410         https://bugs.webkit.org/show_bug.cgi?id=184823
3411
3412         Reviewed by Michael Catanzaro.
3413
3414         Bump session sate format version to 2 and stop encoding the backfoward list item identifier, since it's always
3415         regenerated.
3416
3417         * UIProcess/API/glib/WebKitWebViewSessionState.cpp:
3418         (encodeBackForwardListItemState): Always encode version 2.
3419         (encodeBackForwardListState): Ditto.
3420         (encodeSessionState): Ditto.
3421         (decodeBackForwardListItemStateV1): Decode list item state for version 1.
3422         (decodeBackForwardListItemState): Receive the version and call decodeBackForwardListItemStateV1() if it's 1 or
3423         use the version 2 otherwise.
3424         (decodeSessionState): Load data for known formats and use the one that worked to decode it.
3425
3426 2018-04-26  Megan Gardner  <megan_gardner@apple.com>
3427
3428         Add timeout for ensurePositionInformationIsUpToDate
3429         https://bugs.webkit.org/show_bug.cgi?id=184567
3430
3431         Reviewed by Wenson Hsieh.
3432         
3433         We are having long hang times for WebKit, and this is one of the culprits.
3434         If we do not get an answer for positionInformation in a reasonable amount of time, we should timeout,
3435         so as to not hang the UI.
3436
3437         * UIProcess/ios/WKContentViewInteraction.mm:
3438         (-[WKContentView ensurePositionInformationIsUpToDate:]):
3439
3440 2018-04-26  Andy Estes  <aestes@apple.com>
3441
3442         Try again to fix the iOS build after r231063.
3443
3444         * Configurations/Base.xcconfig:
3445
3446 2018-04-26  Jer Noble  <jer.noble@apple.com>
3447
3448         WK_COCOA_TOUCH the WK_ACCESSIBILITY_LDFLAGS
3449         https://bugs.webkit.org/show_bug.cgi?id=185007
3450         <rdar://problem/39735943>
3451
3452         Reviewed by Timothy Hatcher.
3453
3454         * Configurations/WebKit.xcconfig:
3455
3456 2018-04-26  Jer Noble  <jer.noble@apple.com>
3457
3458         Unreviewed build fix; fix iOS TAPI build step after r231063.
3459
3460         * Configurations/WebKit.xcconfig:
3461
3462 2018-04-26  Jer Noble  <jer.noble@apple.com>
3463
3464         WK_COCOA_TOUCH all the things.
3465         https://bugs.webkit.org/show_bug.cgi?id=185006
3466
3467         Reviewed by Tim Horton.
3468
3469         * Configurations/BaseTarget.xcconfig:
3470         * Configurations/WebKit.xcconfig:
3471
3472 2018-04-26  Daniel Bates  <dabates@apple.com>
3473