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