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