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