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