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