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