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